Lines Matching refs:np

271 	struct device_node *np;  in cell_iommu_find_ioc()  local
277 for_each_node_by_name(np, "ioc") { in cell_iommu_find_ioc()
278 if (of_node_to_nid(np) != nid) in cell_iommu_find_ioc()
280 if (of_address_to_resource(np, 0, &r)) { in cell_iommu_find_ioc()
282 np->full_name); in cell_iommu_find_ioc()
286 of_node_put(np); in cell_iommu_find_ioc()
291 for_each_node_by_type(np, "cpu") { in cell_iommu_find_ioc()
295 nidp = of_get_property(np, "node-id", NULL); in cell_iommu_find_ioc()
297 tmp = of_get_property(np, "ioc-translation", NULL); in cell_iommu_find_ioc()
300 of_node_put(np); in cell_iommu_find_ioc()
455 static inline u32 cell_iommu_get_ioid(struct device_node *np) in cell_iommu_get_ioid() argument
459 ioid = of_get_property(np, "ioid", NULL); in cell_iommu_get_ioid()
462 np->full_name); in cell_iommu_get_ioid()
470 cell_iommu_setup_window(struct cbe_iommu *iommu, struct device_node *np, in cell_iommu_setup_window() argument
478 ioid = cell_iommu_get_ioid(np); in cell_iommu_setup_window()
700 static int __init cell_iommu_get_window(struct device_node *np, in cell_iommu_get_window() argument
708 dma_window = of_get_property(np, "ibm,dma-window", NULL); in cell_iommu_get_window()
715 of_parse_dma_window(np, dma_window, &index, base, size); in cell_iommu_get_window()
719 static struct cbe_iommu * __init cell_iommu_alloc(struct device_node *np) in cell_iommu_alloc() argument
725 nid = of_node_to_nid(np); in cell_iommu_alloc()
728 np->full_name); in cell_iommu_alloc()
732 nid, np->full_name); in cell_iommu_alloc()
744 np->full_name); in cell_iommu_alloc()
759 static void __init cell_iommu_init_one(struct device_node *np, in cell_iommu_init_one() argument
765 iommu = cell_iommu_alloc(np); in cell_iommu_init_one()
770 cell_iommu_get_window(np, &base, &size); in cell_iommu_init_one()
779 cell_iommu_setup_window(iommu, np, base, size, in cell_iommu_init_one()
813 struct device_node *np = NULL; in cell_iommu_init_disabled() local
832 for_each_node_by_name(np, "axon") { in cell_iommu_init_disabled()
833 if (np->parent == NULL || np->parent->parent != NULL) in cell_iommu_init_disabled()
835 if (cell_iommu_get_window(np, &base, &size) == 0) in cell_iommu_init_disabled()
838 if (np == NULL) { in cell_iommu_init_disabled()
839 for_each_node_by_name(np, "pci-internal") { in cell_iommu_init_disabled()
840 if (np->parent == NULL || np->parent->parent != NULL) in cell_iommu_init_disabled()
842 if (cell_iommu_get_window(np, &base, &size) == 0) in cell_iommu_init_disabled()
846 of_node_put(np); in cell_iommu_init_disabled()
851 if (np && size < memblock_end_of_DRAM()) { in cell_iommu_init_disabled()
898 struct device_node *np; in cell_iommu_get_fixed_address() local
902 np = of_node_get(dev->of_node); in cell_iommu_get_fixed_address()
904 naddr = of_n_addr_cells(np); in cell_iommu_get_fixed_address()
905 nsize = of_n_size_cells(np); in cell_iommu_get_fixed_address()
906 np = of_get_next_parent(np); in cell_iommu_get_fixed_address()
907 if (!np) in cell_iommu_get_fixed_address()
910 ranges = of_get_property(np, "dma-ranges", &len); in cell_iommu_get_fixed_address()
924 pna = of_n_addr_cells(np); in cell_iommu_get_fixed_address()
933 cpu_addr = of_translate_dma_address(np, ranges + i + naddr); in cell_iommu_get_fixed_address()
948 of_node_put(np); in cell_iommu_get_fixed_address()
1001 struct device_node *np, unsigned long dbase, unsigned long dsize, in cell_iommu_setup_fixed_ptab() argument
1013 (cell_iommu_get_ioid(np) & CBE_IOPTE_IOID_Mask); in cell_iommu_setup_fixed_ptab()
1040 struct device_node *np; in cell_iommu_fixed_mapping_init() local
1043 np = of_find_node_by_name(NULL, "axon"); in cell_iommu_fixed_mapping_init()
1044 of_node_put(np); in cell_iommu_fixed_mapping_init()
1046 if (!np) { in cell_iommu_fixed_mapping_init()
1052 np = of_find_node_with_property(NULL, "dma-ranges"); in cell_iommu_fixed_mapping_init()
1053 of_node_put(np); in cell_iommu_fixed_mapping_init()
1055 if (!np) { in cell_iommu_fixed_mapping_init()
1066 for_each_node_by_name(np, "axon") { in cell_iommu_fixed_mapping_init()
1067 cell_iommu_get_window(np, &dbase, &dsize); in cell_iommu_fixed_mapping_init()
1098 for_each_node_by_name(np, "axon") { in cell_iommu_fixed_mapping_init()
1099 cell_iommu_get_window(np, &dbase, &dsize); in cell_iommu_fixed_mapping_init()
1112 for_each_node_by_name(np, "axon") { in cell_iommu_fixed_mapping_init()
1113 iommu = cell_iommu_alloc(np); in cell_iommu_fixed_mapping_init()
1117 cell_iommu_get_window(np, &dbase, &dsize); in cell_iommu_fixed_mapping_init()
1130 cell_iommu_setup_fixed_ptab(iommu, np, dbase, dsize, in cell_iommu_fixed_mapping_init()
1133 cell_iommu_setup_window(iommu, np, dbase, dsize, 0); in cell_iommu_fixed_mapping_init()
1189 struct device_node *np; in cell_iommu_init() local
1211 for_each_node_by_name(np, "axon") { in cell_iommu_init()
1212 if (np->parent == NULL || np->parent->parent != NULL) in cell_iommu_init()
1214 cell_iommu_init_one(np, 0); in cell_iommu_init()
1220 for_each_node_by_name(np, "pci-internal") { in cell_iommu_init()
1221 if (np->parent == NULL || np->parent->parent != NULL) in cell_iommu_init()
1223 cell_iommu_init_one(np, SPIDER_DMA_OFFSET); in cell_iommu_init()