Lines Matching refs:parser
673 static int parser_init(struct of_pci_range_parser *parser, in parser_init() argument
678 parser->node = node; in parser_init()
679 parser->pna = of_n_addr_cells(node); in parser_init()
680 parser->na = of_bus_n_addr_cells(node); in parser_init()
681 parser->ns = of_bus_n_size_cells(node); in parser_init()
682 parser->dma = !strcmp(name, "dma-ranges"); in parser_init()
683 parser->bus = of_match_bus(node); in parser_init()
685 parser->range = of_get_property(node, name, &rlen); in parser_init()
686 if (parser->range == NULL) in parser_init()
689 parser->end = parser->range + rlen / sizeof(__be32); in parser_init()
694 int of_pci_range_parser_init(struct of_pci_range_parser *parser, in of_pci_range_parser_init() argument
697 return parser_init(parser, node, "ranges"); in of_pci_range_parser_init()
701 int of_pci_dma_range_parser_init(struct of_pci_range_parser *parser, in of_pci_dma_range_parser_init() argument
704 return parser_init(parser, node, "dma-ranges"); in of_pci_dma_range_parser_init()
709 struct of_pci_range *of_pci_range_parser_one(struct of_pci_range_parser *parser, in of_pci_range_parser_one() argument
712 int na = parser->na; in of_pci_range_parser_one()
713 int ns = parser->ns; in of_pci_range_parser_one()
714 int np = parser->pna + na + ns; in of_pci_range_parser_one()
720 if (!parser->range || parser->range + np > parser->end) in of_pci_range_parser_one()
723 range->flags = parser->bus->get_flags(parser->range); in of_pci_range_parser_one()
726 if (parser->bus->has_flags) in of_pci_range_parser_one()
729 range->bus_addr = of_read_number(parser->range + busflag_na, na - busflag_na); in of_pci_range_parser_one()
731 if (parser->dma) in of_pci_range_parser_one()
732 range->cpu_addr = of_translate_dma_address(parser->node, in of_pci_range_parser_one()
733 parser->range + na); in of_pci_range_parser_one()
735 range->cpu_addr = of_translate_address(parser->node, in of_pci_range_parser_one()
736 parser->range + na); in of_pci_range_parser_one()
737 range->size = of_read_number(parser->range + parser->pna + na, ns); in of_pci_range_parser_one()
739 parser->range += np; in of_pci_range_parser_one()
742 while (parser->range + np <= parser->end) { in of_pci_range_parser_one()
746 flags = parser->bus->get_flags(parser->range); in of_pci_range_parser_one()
747 bus_addr = of_read_number(parser->range + busflag_na, na - busflag_na); in of_pci_range_parser_one()
748 if (parser->dma) in of_pci_range_parser_one()
749 cpu_addr = of_translate_dma_address(parser->node, in of_pci_range_parser_one()
750 parser->range + na); in of_pci_range_parser_one()
752 cpu_addr = of_translate_address(parser->node, in of_pci_range_parser_one()
753 parser->range + na); in of_pci_range_parser_one()
754 size = of_read_number(parser->range + parser->pna + na, ns); in of_pci_range_parser_one()
763 parser->range += np; in of_pci_range_parser_one()
936 struct of_range_parser parser; in of_dma_get_range() local
965 of_dma_range_parser_init(&parser, node); in of_dma_get_range()
966 for_each_of_range(&parser, &range) in of_dma_get_range()
979 of_dma_range_parser_init(&parser, node); in of_dma_get_range()
980 for_each_of_range(&parser, &range) { in of_dma_get_range()
1011 struct of_range_parser parser; in of_dma_get_max_cpu_address() local
1024 of_dma_range_parser_init(&parser, np); in of_dma_get_max_cpu_address()
1025 for_each_of_range(&parser, &range) in of_dma_get_max_cpu_address()