Lines Matching refs:na

20 #define OF_CHECK_ADDR_COUNT(na)	((na) > 0 && (na) <= OF_MAX_ADDR_CELLS)  argument
21 #define OF_CHECK_COUNTS(na, ns) (OF_CHECK_ADDR_COUNT(na) && \ argument
28 static void of_dump_addr(const char *s, const __be32 *addr, int na) in of_dump_addr() argument
31 while (na--) in of_dump_addr()
36 static void of_dump_addr(const char *s, const __be32 *addr, int na) { } in of_dump_addr() argument
46 u64 (*map)(__be32 *addr, const __be32 *range, int na, int ns, int pna);
47 int (*translate)(__be32 *addr, u64 offset, int na);
61 int na, int ns, int pna) in of_bus_default_map() argument
65 cp = of_read_number(range, na); in of_bus_default_map()
66 s = of_read_number(range + na + pna, ns); in of_bus_default_map()
67 da = of_read_number(addr, na); in of_bus_default_map()
78 static int of_bus_default_translate(__be32 *addr, u64 offset, int na) in of_bus_default_translate() argument
80 u64 a = of_read_number(addr, na); in of_bus_default_translate()
81 memset(addr, 0, na * 4); in of_bus_default_translate()
83 if (na > 1) in of_bus_default_translate()
84 addr[na - 2] = cpu_to_be32(a >> 32); in of_bus_default_translate()
85 addr[na - 1] = cpu_to_be32(a & 0xffffffffu); in of_bus_default_translate()
134 int onesize, i, na, ns; in of_get_address() local
140 dev_count_cells(dev, &na, &ns); in of_get_address()
142 bus->count_cells(dev, &na, &ns); in of_get_address()
144 if (!OF_CHECK_ADDR_COUNT(na)) in of_get_address()
153 onesize = na + ns; in of_get_address()
157 *size = of_read_number(prop + na, ns); in of_get_address()
168 __be32 *addr, int na, int ns, int pna, in of_translate_one() argument
195 offset = of_read_number(addr, na); in of_translate_one()
205 rone = na + pna + ns; in of_translate_one()
207 offset = bus->map(addr, ranges, na, ns, pna); in of_translate_one()
215 memcpy(addr, ranges + na, 4 * pna); in of_translate_one()
241 int na, ns, pna, pns; in __of_translate_address() local
256 bus->count_cells(dev, &na, &ns); in __of_translate_address()
257 if (!OF_CHECK_COUNTS(na, ns)) { in __of_translate_address()
261 memcpy(addr, in_addr, na * 4); in __of_translate_address()
263 debug("bus is %s (na=%d, ns=%d) on %s\n", bus->name, na, ns, in __of_translate_address()
265 of_dump_addr("translating address:", addr, na); in __of_translate_address()
277 result = of_read_number(addr, na); in __of_translate_address()
294 if (of_translate_one(dev, bus, pbus, addr, na, ns, pna, rprop)) in __of_translate_address()
298 na = pna; in __of_translate_address()
302 of_dump_addr("one level translation:", addr, na); in __of_translate_address()
327 int na, ns, pna, pns; in of_get_dma_range() local
372 bus_node->count_cells(dev, &na, &ns); in of_get_dma_range()
373 if (!OF_CHECK_COUNTS(na, ns)) { in of_get_dma_range()
387 *bus = of_read_number(ranges, na); in of_get_dma_range()
388 *cpu = of_translate_dma_address(dev, ranges + na); in of_get_dma_range()
389 *size = of_read_number(ranges + na + pna, ns); in of_get_dma_range()