Lines Matching refs:np

16 static const __be32 *read_prop_string(const struct device_node *np,  in read_prop_string()  argument
21 prop = of_get_property(np, prop_name, NULL); in read_prop_string()
27 static const __be32 *read_prop_dword(const struct device_node *np, in read_prop_dword() argument
32 prop = of_get_property(np, prop_name, NULL); in read_prop_dword()
40 static const __be64 *read_prop64_dword(const struct device_node *np, in read_prop64_dword() argument
45 prop = of_get_property(np, prop_name, NULL); in read_prop64_dword()
54 static int read_handle(struct device_node *np, u64 *handle) in read_handle() argument
60 prop = of_get_address(np, 0, &size, NULL); in read_handle()
65 *handle = of_read_number(prop, of_n_addr_cells(np)); in read_handle()
69 static int read_phys_addr(struct device_node *np, char *prop_name, in read_phys_addr() argument
76 naddr = of_n_addr_cells(np); in read_phys_addr()
77 nsize = of_n_size_cells(np); in read_phys_addr()
79 prop = of_get_property(np, prop_name, &len); in read_phys_addr()
140 int cxl_of_read_afu_properties(struct cxl_afu *afu, struct device_node *np) in cxl_of_read_afu_properties() argument
153 prop = of_get_property(np, "compatible", &len); in cxl_of_read_afu_properties()
160 read_prop_string(np, "name"); in cxl_of_read_afu_properties()
163 rc = read_phys_addr(np, "reg", afu); in cxl_of_read_afu_properties()
167 rc = read_phys_addr(np, "assigned-addresses", afu); in cxl_of_read_afu_properties()
177 read_prop_string(np, "ibm,loc-code"); in cxl_of_read_afu_properties()
178 read_prop_string(np, "device_type"); in cxl_of_read_afu_properties()
181 read_prop_dword(np, "ibm,#processes", &afu->max_procs_virtualised); in cxl_of_read_afu_properties()
184 read_prop_dword(np, "ibm,scratchpad-size", &val); in cxl_of_read_afu_properties()
185 read_prop_dword(np, "ibm,programmable", &val); in cxl_of_read_afu_properties()
186 read_prop_string(np, "ibm,phandle"); in cxl_of_read_afu_properties()
190 read_prop_dword(np, "ibm,max-ints-per-process", &afu->guest->max_ints); in cxl_of_read_afu_properties()
193 prop = read_prop_dword(np, "ibm,min-ints-per-process", &afu->pp_irqs); in cxl_of_read_afu_properties()
203 read_prop_dword(np, "ibm,max-ints", &val); in cxl_of_read_afu_properties()
204 read_prop_dword(np, "ibm,vpd-size", &val); in cxl_of_read_afu_properties()
207 read_prop64_dword(np, "ibm,error-buffer-size", &afu->eb_len); in cxl_of_read_afu_properties()
211 read_prop_dword(np, "ibm,config-record-type", &val); in cxl_of_read_afu_properties()
213 read_prop64_dword(np, "ibm,config-record-size", &afu->crs_len); in cxl_of_read_afu_properties()
216 read_prop_dword(np, "ibm,#config-records", &afu->crs_num); in cxl_of_read_afu_properties()
239 read_prop_dword(np, "ibm,function-number", &val); in cxl_of_read_afu_properties()
240 read_prop_dword(np, "ibm,privileged-function", &val); in cxl_of_read_afu_properties()
241 read_prop_dword(np, "vendor-id", &val); in cxl_of_read_afu_properties()
242 read_prop_dword(np, "device-id", &val); in cxl_of_read_afu_properties()
243 read_prop_dword(np, "revision-id", &val); in cxl_of_read_afu_properties()
244 read_prop_dword(np, "class-code", &val); in cxl_of_read_afu_properties()
245 read_prop_dword(np, "subsystem-vendor-id", &val); in cxl_of_read_afu_properties()
246 read_prop_dword(np, "subsystem-id", &val); in cxl_of_read_afu_properties()
253 prop = read_prop_dword(np, "ibm,process-mmio", &val); in cxl_of_read_afu_properties()
260 read_prop_dword(np, "ibm,supports-aur", &val); in cxl_of_read_afu_properties()
261 read_prop_dword(np, "ibm,supports-csrp", &val); in cxl_of_read_afu_properties()
262 read_prop_dword(np, "ibm,supports-prr", &val); in cxl_of_read_afu_properties()
265 prop = read_prop_dword(np, "ibm,function-error-interrupt", &val); in cxl_of_read_afu_properties()
283 static int read_adapter_irq_config(struct cxl *adapter, struct device_node *np) in read_adapter_irq_config() argument
289 ranges = of_get_property(np, "interrupt-ranges", &len); in read_adapter_irq_config()
335 int cxl_of_read_adapter_handle(struct cxl *adapter, struct device_node *np) in cxl_of_read_adapter_handle() argument
337 if (read_handle(np, &adapter->guest->handle)) in cxl_of_read_adapter_handle()
344 int cxl_of_read_adapter_properties(struct cxl *adapter, struct device_node *np) in cxl_of_read_adapter_properties() argument
353 naddr = of_n_addr_cells(np); in cxl_of_read_adapter_properties()
358 read_prop_dword(np, "#address-cells", &val); in cxl_of_read_adapter_properties()
359 read_prop_dword(np, "#size-cells", &val); in cxl_of_read_adapter_properties()
361 prop = of_get_property(np, "compatible", &len); in cxl_of_read_adapter_properties()
368 read_prop_string(np, "name"); in cxl_of_read_adapter_properties()
369 read_prop_string(np, "model"); in cxl_of_read_adapter_properties()
371 prop = of_get_property(np, "reg", NULL); in cxl_of_read_adapter_properties()
378 read_prop_string(np, "ibm,loc-code"); in cxl_of_read_adapter_properties()
381 if ((rc = read_adapter_irq_config(adapter, np))) in cxl_of_read_adapter_properties()
385 read_prop_string(np, "device_type"); in cxl_of_read_adapter_properties()
386 read_prop_string(np, "ibm,phandle"); in cxl_of_read_adapter_properties()
389 prop = read_prop_dword(np, "ibm,caia-version", &val); in cxl_of_read_adapter_properties()
395 prop = read_prop_dword(np, "ibm,psl-revision", &val); in cxl_of_read_adapter_properties()
399 prop = read_prop_string(np, "status"); in cxl_of_read_adapter_properties()
406 prop = read_prop_dword(np, "vendor-id", &val); in cxl_of_read_adapter_properties()
410 prop = read_prop_dword(np, "device-id", &val); in cxl_of_read_adapter_properties()
415 read_prop_dword(np, "ibm,privileged-facility", &val); in cxl_of_read_adapter_properties()
416 read_prop_dword(np, "revision-id", &val); in cxl_of_read_adapter_properties()
417 read_prop_dword(np, "class-code", &val); in cxl_of_read_adapter_properties()
420 prop = read_prop_dword(np, "subsystem-vendor-id", &val); in cxl_of_read_adapter_properties()
424 prop = read_prop_dword(np, "subsystem-id", &val); in cxl_of_read_adapter_properties()
454 struct device_node *np = NULL; in cxl_of_probe() local
462 np = pdev->dev.of_node; in cxl_of_probe()
463 if (np == NULL) in cxl_of_probe()
467 adapter = cxl_guest_init_adapter(np, pdev); in cxl_of_probe()
474 for_each_child_of_node(np, afu_np) { in cxl_of_probe()