Lines Matching +full:cpu +full:- +full:ns
1 // SPDX-License-Identifier: GPL-2.0+
3 * FDT Address translation based on u-boot fdt_support.c which in turn was
9 * Copyright 2010-2011 Freescale Semiconductor, Inc.
22 #define OF_CHECK_COUNTS(na, ns) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \ argument
23 (ns) > 0)
30 while(na--) in of_dump_addr()
43 int na, int ns, int pna);
54 prop = fdt_getprop(blob, parentoffset, "#address-cells", NULL); in fdt_bus_default_count_cells()
62 prop = fdt_getprop(blob, parentoffset, "#size-cells", NULL); in fdt_bus_default_count_cells()
71 int na, int ns, int pna) in fdt_bus_default_map() argument
76 s = of_read_number(range + na + pna, ns); in fdt_bus_default_map()
84 return da - cp; in fdt_bus_default_map()
93 addr[na - 2] = cpu_to_fdt32(a >> 32); in fdt_bus_default_translate()
94 addr[na - 1] = cpu_to_fdt32(a & 0xffffffffu); in fdt_bus_default_translate()
112 int na, int ns, int pna, const char *rprop) in fdt_translate_one() argument
133 rone = na + pna + ns; in fdt_translate_one()
134 for (; rlen >= rone; rlen -= rone, ranges += rone) { in fdt_translate_one()
135 offset = bus->map(addr, ranges, na, ns, pna); in fdt_translate_one()
150 return pbus->translate(addr, offset, pna); in fdt_translate_one()
154 * Translate an address from the device-tree into a CPU physical address,
158 * Note: We consider that crossing any level with #size-cells == 0 to mean
160 * that can be mapped to a cpu physical address). This is not really specified
169 int na, ns, pna, pns; in fdt_translate_address() local
189 bus->count_cells(blob, parent, &na, &ns); in fdt_translate_address()
190 if (!OF_CHECK_COUNTS(na, ns)) { in fdt_translate_address()
197 pr_debug("bus (na=%d, ns=%d) on %s\n", in fdt_translate_address()
198 na, ns, fdt_get_name(blob, parent, NULL)); in fdt_translate_address()
216 pbus->count_cells(blob, parent, &pna, &pns); in fdt_translate_address()
223 pr_debug("parent bus (na=%d, ns=%d) on %s\n", in fdt_translate_address()
228 addr, na, ns, pna, "ranges")) in fdt_translate_address()
233 ns = pns; in fdt_translate_address()
243 * of_flat_dt_translate_address - translate DT addr into CPU phys addr