Lines Matching refs:offs

32 static int append_psci_compatible(void *fdt, int offs, const char *str)  in append_psci_compatible()  argument
34 return fdt_appendprop(fdt, offs, "compatible", str, strlen(str) + 1); in append_psci_compatible()
66 int offs; in dt_add_psci_node() local
73 offs = fdt_path_offset(fdt, "/"); in dt_add_psci_node()
74 if (offs < 0) in dt_add_psci_node()
76 offs = fdt_add_subnode(fdt, offs, "psci"); in dt_add_psci_node()
77 if (offs < 0) in dt_add_psci_node()
79 if (append_psci_compatible(fdt, offs, "arm,psci-1.0")) in dt_add_psci_node()
81 if (append_psci_compatible(fdt, offs, "arm,psci-0.2")) in dt_add_psci_node()
83 if (append_psci_compatible(fdt, offs, "arm,psci")) in dt_add_psci_node()
85 if (fdt_setprop_string(fdt, offs, "method", "smc")) in dt_add_psci_node()
87 if (fdt_setprop_u32(fdt, offs, "cpu_suspend", PSCI_CPU_SUSPEND_FNID)) in dt_add_psci_node()
89 if (fdt_setprop_u32(fdt, offs, "cpu_off", PSCI_CPU_OFF)) in dt_add_psci_node()
91 if (fdt_setprop_u32(fdt, offs, "cpu_on", PSCI_CPU_ON_FNID)) in dt_add_psci_node()
110 int offs; in dt_update_one_cpu_node() local
113 for (offs = fdt_first_subnode(fdt, offset); offs >= 0; in dt_update_one_cpu_node()
114 offs = fdt_next_subnode(fdt, offs)) { in dt_update_one_cpu_node()
119 prop = fdt_getprop(fdt, offs, "device_type", &len); in dt_update_one_cpu_node()
126 prop = fdt_getprop(fdt, offs, "enable-method", &len); in dt_update_one_cpu_node()
131 ret = fdt_setprop_string(fdt, offs, "enable-method", "psci"); in dt_update_one_cpu_node()
141 if (offs == -FDT_ERR_NOTFOUND) in dt_update_one_cpu_node()
144 return offs; in dt_update_one_cpu_node()
160 int offs, ret; in dt_add_psci_cpu_enable_methods() local
163 offs = fdt_path_offset(fdt, "/cpus"); in dt_add_psci_cpu_enable_methods()
164 if (offs < 0) in dt_add_psci_cpu_enable_methods()
165 return offs; in dt_add_psci_cpu_enable_methods()
167 ret = dt_update_one_cpu_node(fdt, offs); in dt_add_psci_cpu_enable_methods()
199 int offs = fdt_path_offset(dtb, "/reserved-memory"); in fdt_add_reserved_memory() local
206 if (offs < 0) { /* create if not existing yet */ in fdt_add_reserved_memory()
207 offs = fdt_add_subnode(dtb, 0, "reserved-memory"); in fdt_add_reserved_memory()
208 if (offs < 0) { in fdt_add_reserved_memory()
209 return offs; in fdt_add_reserved_memory()
211 fdt_setprop_u32(dtb, offs, "#address-cells", ac); in fdt_add_reserved_memory()
212 fdt_setprop_u32(dtb, offs, "#size-cells", sc); in fdt_add_reserved_memory()
213 fdt_setprop(dtb, offs, "ranges", NULL, 0); in fdt_add_reserved_memory()
228 offs = fdt_add_subnode(dtb, offs, node_name); in fdt_add_reserved_memory()
229 fdt_setprop(dtb, offs, "no-map", NULL, 0); in fdt_add_reserved_memory()
230 fdt_setprop(dtb, offs, "reg", addresses, idx * sizeof(uint32_t)); in fdt_add_reserved_memory()
336 int offs; in fdt_add_cpus_node() local
346 offs = fdt_add_subnode(dtb, 0, "cpus"); in fdt_add_cpus_node()
347 if (offs < 0) { in fdt_add_cpus_node()
349 return offs; in fdt_add_cpus_node()
352 err = fdt_setprop_u32(dtb, offs, "#address-cells", 2); in fdt_add_cpus_node()
355 "#address-cells", offs); in fdt_add_cpus_node()
359 err = fdt_setprop_u32(dtb, offs, "#size-cells", 0); in fdt_add_cpus_node()
362 "#size-cells", offs); in fdt_add_cpus_node()
382 err = fdt_add_cpu(dtb, offs, mpidr); in fdt_add_cpus_node()
394 return offs; in fdt_add_cpus_node()