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()
475 cell_iommu_setup_window(struct cbe_iommu *iommu, struct device_node *np, in cell_iommu_setup_window() argument
483 ioid = cell_iommu_get_ioid(np); in cell_iommu_setup_window()
706 static int __init cell_iommu_get_window(struct device_node *np, in cell_iommu_get_window() argument
714 dma_window = of_get_property(np, "ibm,dma-window", NULL); in cell_iommu_get_window()
721 of_parse_dma_window(np, dma_window, &index, base, size); in cell_iommu_get_window()
725 static struct cbe_iommu * __init cell_iommu_alloc(struct device_node *np) in cell_iommu_alloc() argument
731 nid = of_node_to_nid(np); in cell_iommu_alloc()
734 np->full_name); in cell_iommu_alloc()
738 nid, np->full_name); in cell_iommu_alloc()
750 np->full_name); in cell_iommu_alloc()
765 static void __init cell_iommu_init_one(struct device_node *np, in cell_iommu_init_one() argument
771 iommu = cell_iommu_alloc(np); in cell_iommu_init_one()
776 cell_iommu_get_window(np, &base, &size); in cell_iommu_init_one()
785 cell_iommu_setup_window(iommu, np, base, size, in cell_iommu_init_one()
819 struct device_node *np = NULL; in cell_iommu_init_disabled() local
838 for_each_node_by_name(np, "axon") { in cell_iommu_init_disabled()
839 if (np->parent == NULL || np->parent->parent != NULL) in cell_iommu_init_disabled()
841 if (cell_iommu_get_window(np, &base, &size) == 0) in cell_iommu_init_disabled()
844 if (np == NULL) { in cell_iommu_init_disabled()
845 for_each_node_by_name(np, "pci-internal") { in cell_iommu_init_disabled()
846 if (np->parent == NULL || np->parent->parent != NULL) in cell_iommu_init_disabled()
848 if (cell_iommu_get_window(np, &base, &size) == 0) in cell_iommu_init_disabled()
852 of_node_put(np); in cell_iommu_init_disabled()
857 if (np && size < memblock_end_of_DRAM()) { in cell_iommu_init_disabled()
904 struct device_node *np; in cell_iommu_get_fixed_address() local
908 np = of_node_get(dev->of_node); in cell_iommu_get_fixed_address()
910 naddr = of_n_addr_cells(np); in cell_iommu_get_fixed_address()
911 nsize = of_n_size_cells(np); in cell_iommu_get_fixed_address()
912 np = of_get_next_parent(np); in cell_iommu_get_fixed_address()
913 if (!np) in cell_iommu_get_fixed_address()
916 ranges = of_get_property(np, "dma-ranges", &len); in cell_iommu_get_fixed_address()
930 pna = of_n_addr_cells(np); in cell_iommu_get_fixed_address()
939 cpu_addr = of_translate_dma_address(np, ranges + i + naddr); in cell_iommu_get_fixed_address()
954 of_node_put(np); in cell_iommu_get_fixed_address()
1007 struct device_node *np, unsigned long dbase, unsigned long dsize, in cell_iommu_setup_fixed_ptab() argument
1019 (cell_iommu_get_ioid(np) & CBE_IOPTE_IOID_Mask); in cell_iommu_setup_fixed_ptab()
1046 struct device_node *np; in cell_iommu_fixed_mapping_init() local
1049 np = of_find_node_by_name(NULL, "axon"); in cell_iommu_fixed_mapping_init()
1050 of_node_put(np); in cell_iommu_fixed_mapping_init()
1052 if (!np) { in cell_iommu_fixed_mapping_init()
1058 np = of_find_node_with_property(NULL, "dma-ranges"); in cell_iommu_fixed_mapping_init()
1059 of_node_put(np); in cell_iommu_fixed_mapping_init()
1061 if (!np) { in cell_iommu_fixed_mapping_init()
1072 for_each_node_by_name(np, "axon") { in cell_iommu_fixed_mapping_init()
1073 cell_iommu_get_window(np, &dbase, &dsize); in cell_iommu_fixed_mapping_init()
1104 for_each_node_by_name(np, "axon") { in cell_iommu_fixed_mapping_init()
1105 cell_iommu_get_window(np, &dbase, &dsize); in cell_iommu_fixed_mapping_init()
1118 for_each_node_by_name(np, "axon") { in cell_iommu_fixed_mapping_init()
1119 iommu = cell_iommu_alloc(np); in cell_iommu_fixed_mapping_init()
1123 cell_iommu_get_window(np, &dbase, &dsize); in cell_iommu_fixed_mapping_init()
1136 cell_iommu_setup_fixed_ptab(iommu, np, dbase, dsize, in cell_iommu_fixed_mapping_init()
1139 cell_iommu_setup_window(iommu, np, dbase, dsize, 0); in cell_iommu_fixed_mapping_init()
1195 struct device_node *np; in cell_iommu_init() local
1215 for_each_node_by_name(np, "axon") { in cell_iommu_init()
1216 if (np->parent == NULL || np->parent->parent != NULL) in cell_iommu_init()
1218 cell_iommu_init_one(np, 0); in cell_iommu_init()
1224 for_each_node_by_name(np, "pci-internal") { in cell_iommu_init()
1225 if (np->parent == NULL || np->parent->parent != NULL) in cell_iommu_init()
1227 cell_iommu_init_one(np, SPIDER_DMA_OFFSET); in cell_iommu_init()