Lines Matching full:range

50 	u64		(*map)(__be32 *addr, const __be32 *range,
70 static u64 of_bus_default_map(__be32 *addr, const __be32 *range, in of_bus_default_map() argument
75 cp = of_read_number(range, na); in of_bus_default_map()
76 s = of_read_number(range + na + pna, ns); in of_bus_default_map()
167 static u64 of_bus_pci_map(__be32 *addr, const __be32 *range, int na, int ns, in of_bus_pci_map() argument
174 rf = of_bus_pci_get_flags(range); in of_bus_pci_map()
181 cp = of_read_number(range + 1, na - 1); in of_bus_pci_map()
182 s = of_read_number(range + na + pna, ns); in of_bus_pci_map()
211 * @range: the PCI range that describes the resource
212 * @np: device node where the range belongs to
214 * reflect the values contained in the range.
216 * Returns EINVAL if the range cannot be converted to resource.
218 * Note that if the range is an IO range, the resource will be converted
220 * if the range cannot be matched to any host bridge IO space (our case here).
221 * To guard against that we try to register the IO range first.
224 int of_pci_range_to_resource(struct of_pci_range *range, in of_pci_range_to_resource() argument
228 res->flags = range->flags; in of_pci_range_to_resource()
237 err = pci_register_io_range(&np->fwnode, range->cpu_addr, in of_pci_range_to_resource()
238 range->size); in of_pci_range_to_resource()
241 port = pci_address_to_pio(range->cpu_addr); in of_pci_range_to_resource()
249 upper_32_bits(range->cpu_addr)) { in of_pci_range_to_resource()
254 res->start = range->cpu_addr; in of_pci_range_to_resource()
256 res->end = res->start + range->size - 1; in of_pci_range_to_resource()
284 static u64 of_bus_isa_map(__be32 *addr, const __be32 *range, int na, int ns, in of_bus_isa_map() argument
290 if ((addr[0] ^ range[0]) & cpu_to_be32(1)) in of_bus_isa_map()
294 cp = of_read_number(range + 1, na - 1); in of_bus_isa_map()
295 s = of_read_number(range + na + pna, ns); in of_bus_isa_map()
687 parser->range = of_get_property(node, name, &rlen); in parser_init()
688 if (parser->range == NULL) in parser_init()
691 parser->end = parser->range + rlen / sizeof(__be32); in parser_init()
712 struct of_pci_range *range) in of_pci_range_parser_one() argument
719 if (!range) in of_pci_range_parser_one()
722 if (!parser->range || parser->range + np > parser->end) in of_pci_range_parser_one()
725 range->flags = parser->bus->get_flags(parser->range); in of_pci_range_parser_one()
731 range->bus_addr = of_read_number(parser->range + busflag_na, na - busflag_na); in of_pci_range_parser_one()
734 range->cpu_addr = of_translate_dma_address(parser->node, in of_pci_range_parser_one()
735 parser->range + na); in of_pci_range_parser_one()
737 range->cpu_addr = of_translate_address(parser->node, in of_pci_range_parser_one()
738 parser->range + na); in of_pci_range_parser_one()
739 range->size = of_read_number(parser->range + parser->pna + na, ns); in of_pci_range_parser_one()
741 parser->range += np; in of_pci_range_parser_one()
744 while (parser->range + np <= parser->end) { in of_pci_range_parser_one()
748 flags = parser->bus->get_flags(parser->range); in of_pci_range_parser_one()
749 bus_addr = of_read_number(parser->range + busflag_na, na - busflag_na); in of_pci_range_parser_one()
752 parser->range + na); in of_pci_range_parser_one()
755 parser->range + na); in of_pci_range_parser_one()
756 size = of_read_number(parser->range + parser->pna + na, ns); in of_pci_range_parser_one()
758 if (flags != range->flags) in of_pci_range_parser_one()
760 if (bus_addr != range->bus_addr + range->size || in of_pci_range_parser_one()
761 cpu_addr != range->cpu_addr + range->size) in of_pci_range_parser_one()
764 range->size += size; in of_pci_range_parser_one()
765 parser->range += np; in of_pci_range_parser_one()
768 return range; in of_pci_range_parser_one()
786 /* memory-mapped I/O range */ in of_translate_ioport()
855 * @np: the device whose io range will be mapped
856 * @index: index of the io range
877 * @device: the device whose io range will be mapped
878 * @index: index of the io range
918 * of_dma_get_range - Get DMA range info and put it into a map array
919 * @np: device node to get DMA range info
920 * @map: dma range structure to return
939 struct of_range range; in of_dma_get_range() local
968 for_each_of_range(&parser, &range) in of_dma_get_range()
982 for_each_of_range(&parser, &range) { in of_dma_get_range()
984 range.bus_addr, range.cpu_addr, range.size); in of_dma_get_range()
985 if (range.cpu_addr == OF_BAD_ADDR) { in of_dma_get_range()
987 range.bus_addr, node); in of_dma_get_range()
990 r->cpu_start = range.cpu_addr; in of_dma_get_range()
991 r->dma_start = range.bus_addr; in of_dma_get_range()
992 r->size = range.size; in of_dma_get_range()
993 r->offset = range.cpu_addr - range.bus_addr; in of_dma_get_range()
1016 struct of_range range; in of_dma_get_max_cpu_address() local
1027 for_each_of_range(&parser, &range) in of_dma_get_max_cpu_address()
1028 if (range.cpu_addr + range.size > cpu_end) in of_dma_get_max_cpu_address()
1029 cpu_end = range.cpu_addr + range.size - 1; in of_dma_get_max_cpu_address()