Lines Matching refs:parser
279 struct of_range_parser parser; in of_range_to_resource() local
282 ret = of_range_parser_init(&parser, np); in of_range_to_resource()
286 for_each_of_range(&parser, &range) in of_range_to_resource()
754 static int parser_init(struct of_pci_range_parser *parser, in parser_init() argument
759 parser->node = node; in parser_init()
760 parser->pna = of_n_addr_cells(node); in parser_init()
761 parser->na = of_bus_n_addr_cells(node); in parser_init()
762 parser->ns = of_bus_n_size_cells(node); in parser_init()
763 parser->dma = !strcmp(name, "dma-ranges"); in parser_init()
764 parser->bus = of_match_bus(node); in parser_init()
766 parser->range = of_get_property(node, name, &rlen); in parser_init()
767 if (parser->range == NULL) in parser_init()
770 parser->end = parser->range + rlen / sizeof(__be32); in parser_init()
775 int of_pci_range_parser_init(struct of_pci_range_parser *parser, in of_pci_range_parser_init() argument
778 return parser_init(parser, node, "ranges"); in of_pci_range_parser_init()
782 int of_pci_dma_range_parser_init(struct of_pci_range_parser *parser, in of_pci_dma_range_parser_init() argument
785 return parser_init(parser, node, "dma-ranges"); in of_pci_dma_range_parser_init()
790 struct of_pci_range *of_pci_range_parser_one(struct of_pci_range_parser *parser, in of_pci_range_parser_one() argument
793 int na = parser->na; in of_pci_range_parser_one()
794 int ns = parser->ns; in of_pci_range_parser_one()
795 int np = parser->pna + na + ns; in of_pci_range_parser_one()
796 int busflag_na = parser->bus->flag_cells; in of_pci_range_parser_one()
801 if (!parser->range || parser->range + np > parser->end) in of_pci_range_parser_one()
804 range->flags = parser->bus->get_flags(parser->range); in of_pci_range_parser_one()
806 range->bus_addr = of_read_number(parser->range + busflag_na, na - busflag_na); in of_pci_range_parser_one()
808 if (parser->dma) in of_pci_range_parser_one()
809 range->cpu_addr = of_translate_dma_address(parser->node, in of_pci_range_parser_one()
810 parser->range + na); in of_pci_range_parser_one()
812 range->cpu_addr = of_translate_address(parser->node, in of_pci_range_parser_one()
813 parser->range + na); in of_pci_range_parser_one()
814 range->size = of_read_number(parser->range + parser->pna + na, ns); in of_pci_range_parser_one()
816 parser->range += np; in of_pci_range_parser_one()
819 while (parser->range + np <= parser->end) { in of_pci_range_parser_one()
823 flags = parser->bus->get_flags(parser->range); in of_pci_range_parser_one()
824 bus_addr = of_read_number(parser->range + busflag_na, na - busflag_na); in of_pci_range_parser_one()
825 if (parser->dma) in of_pci_range_parser_one()
826 cpu_addr = of_translate_dma_address(parser->node, in of_pci_range_parser_one()
827 parser->range + na); in of_pci_range_parser_one()
829 cpu_addr = of_translate_address(parser->node, in of_pci_range_parser_one()
830 parser->range + na); in of_pci_range_parser_one()
831 size = of_read_number(parser->range + parser->pna + na, ns); in of_pci_range_parser_one()
840 parser->range += np; in of_pci_range_parser_one()
893 struct of_range_parser parser; in of_dma_get_range() local
918 of_dma_range_parser_init(&parser, node); in of_dma_get_range()
919 for_each_of_range(&parser, &range) { in of_dma_get_range()
940 of_dma_range_parser_init(&parser, node); in of_dma_get_range()
941 for_each_of_range(&parser, &range) { in of_dma_get_range()
966 struct of_range_parser parser; in of_dma_get_max_cpu_address() local
979 of_dma_range_parser_init(&parser, np); in of_dma_get_max_cpu_address()
980 for_each_of_range(&parser, &range) in of_dma_get_max_cpu_address()