Lines Matching refs:parser
675 static int parser_init(struct of_pci_range_parser *parser, in parser_init() argument
680 parser->node = node; in parser_init()
681 parser->pna = of_n_addr_cells(node); in parser_init()
682 parser->na = of_bus_n_addr_cells(node); in parser_init()
683 parser->ns = of_bus_n_size_cells(node); in parser_init()
684 parser->dma = !strcmp(name, "dma-ranges"); in parser_init()
685 parser->bus = of_match_bus(node); in parser_init()
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()
696 int of_pci_range_parser_init(struct of_pci_range_parser *parser, in of_pci_range_parser_init() argument
699 return parser_init(parser, node, "ranges"); in of_pci_range_parser_init()
703 int of_pci_dma_range_parser_init(struct of_pci_range_parser *parser, in of_pci_dma_range_parser_init() argument
706 return parser_init(parser, node, "dma-ranges"); in of_pci_dma_range_parser_init()
711 struct of_pci_range *of_pci_range_parser_one(struct of_pci_range_parser *parser, in of_pci_range_parser_one() argument
714 int na = parser->na; in of_pci_range_parser_one()
715 int ns = parser->ns; in of_pci_range_parser_one()
716 int np = parser->pna + na + ns; 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()
728 if (parser->bus->has_flags) 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()
733 if (parser->dma) 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()
750 if (parser->dma) in of_pci_range_parser_one()
751 cpu_addr = of_translate_dma_address(parser->node, in of_pci_range_parser_one()
752 parser->range + na); in of_pci_range_parser_one()
754 cpu_addr = of_translate_address(parser->node, 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()
765 parser->range += np; in of_pci_range_parser_one()
938 struct of_range_parser parser; in of_dma_get_range() local
967 of_dma_range_parser_init(&parser, node); in of_dma_get_range()
968 for_each_of_range(&parser, &range) in of_dma_get_range()
981 of_dma_range_parser_init(&parser, node); in of_dma_get_range()
982 for_each_of_range(&parser, &range) { in of_dma_get_range()
1013 struct of_range_parser parser; in of_dma_get_max_cpu_address() local
1026 of_dma_range_parser_init(&parser, np); in of_dma_get_max_cpu_address()
1027 for_each_of_range(&parser, &range) in of_dma_get_max_cpu_address()