Lines Matching +full:bd +full:- +full:address

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Old U-boot compatibility for PowerQUICC II
15 #include "fsl-soc.h"
21 static bd_t bd; variable
40 /* Different versions of u-boot put the BCSR in different places, and
44 * For any node defined as compatible with fsl,pq2-localbus,
45 * #address/#size must be 2/1 for the localbus, and 1/1 for the parent bus.
58 if (!bus_node || !dt_is_compatible(bus_node, "fsl,pq2-localbus")) in update_cs_ranges()
103 option | ~(cs_ranges_buf[i].size - 1)); in update_cs_ranges()
113 /* Older u-boots don't set PCI up properly. Update the hardware to match
114 * the device tree. The prefetch mem region and non-prefetch mem region
117 * 32-bit PCI is supported. All three region types (prefetchable mem,
118 * non-prefetchable mem, and I/O) must be present.
131 if (!node || !dt_is_compatible(node, "fsl,pq2-pci")) in fixup_pci()
171 if (mem->size[1] != mmio->size[1]) in fixup_pci()
173 if (mem->size[1] & (mem->size[1] - 1)) in fixup_pci()
175 if (io->size[1] & (io->size[1] - 1)) in fixup_pci()
178 if (mem->phys_addr + mem->size[1] == mmio->phys_addr) in fixup_pci()
180 else if (mmio->phys_addr + mmio->size[1] == mem->phys_addr) in fixup_pci()
185 out_be32(&pci_regs[1][0], mem_base->phys_addr | 1); in fixup_pci()
186 out_be32(&pci_regs[2][0], ~(mem->size[1] + mmio->size[1] - 1)); in fixup_pci()
188 out_be32(&pci_regs[1][1], io->phys_addr | 1); in fixup_pci()
189 out_be32(&pci_regs[2][1], ~(io->size[1] - 1)); in fixup_pci()
191 out_le32(&pci_regs[0][0], mem->pci_addr[1] >> 12); in fixup_pci()
192 out_le32(&pci_regs[0][2], mem->phys_addr >> 12); in fixup_pci()
193 out_le32(&pci_regs[0][4], (~(mem->size[1] - 1) >> 12) | 0xa0000000); in fixup_pci()
195 out_le32(&pci_regs[0][6], mmio->pci_addr[1] >> 12); in fixup_pci()
196 out_le32(&pci_regs[0][8], mmio->phys_addr >> 12); in fixup_pci()
197 out_le32(&pci_regs[0][10], (~(mmio->size[1] - 1) >> 12) | 0x80000000); in fixup_pci()
199 out_le32(&pci_regs[0][12], io->pci_addr[1] >> 12); in fixup_pci()
200 out_le32(&pci_regs[0][14], io->phys_addr >> 12); in fixup_pci()
201 out_le32(&pci_regs[0][16], (~(io->size[1] - 1) >> 12) | 0xc0000000); in fixup_pci()
207 mem_pow2 = 1 << (__ilog2_u32(bd.bi_memsize - 1) + 1); in fixup_pci()
208 mem_mask = ~(mem_pow2 - 1) >> 12; in fixup_pci()
235 printf("Bad PCI node -- using existing firmware setup.\r\n"); in fixup_pci()
239 printf("Unsupported PCI node -- using existing firmware setup.\r\n"); in fixup_pci()
246 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize); in pq2_platform_fixups()
247 dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr); in pq2_platform_fixups()
248 dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq); in pq2_platform_fixups()
252 setprop(node, "clock-frequency", &bd.bi_cpmfreq, 4); in pq2_platform_fixups()
256 setprop(node, "clock-frequency", &bd.bi_brgfreq, 4); in pq2_platform_fixups()