Lines Matching defs:fdt
32 static int append_psci_compatible(void *fdt, int offs, const char *str)
34 return fdt_appendprop(fdt, offs, "compatible", str, strlen(str) + 1);
52 * @fdt: pointer to the device tree blob in memory
64 int dt_add_psci_node(void *fdt)
68 if (fdt_path_offset(fdt, "/psci") >= 0) {
73 offs = fdt_path_offset(fdt, "/");
76 offs = fdt_add_subnode(fdt, offs, "psci");
79 if (append_psci_compatible(fdt, offs, "arm,psci-1.0"))
81 if (append_psci_compatible(fdt, offs, "arm,psci-0.2"))
83 if (append_psci_compatible(fdt, offs, "arm,psci"))
85 if (fdt_setprop_string(fdt, offs, "method", "smc"))
87 if (fdt_setprop_u32(fdt, offs, "cpu_suspend", PSCI_CPU_SUSPEND_FNID))
89 if (fdt_setprop_u32(fdt, offs, "cpu_off", PSCI_CPU_OFF))
91 if (fdt_setprop_u32(fdt, offs, "cpu_on", PSCI_CPU_ON_FNID))
108 static int dt_update_one_cpu_node(void *fdt, int offset)
113 for (offs = fdt_first_subnode(fdt, offset); offs >= 0;
114 offs = fdt_next_subnode(fdt, offs)) {
119 prop = fdt_getprop(fdt, offs, "device_type", &len);
126 prop = fdt_getprop(fdt, offs, "enable-method", &len);
131 ret = fdt_setprop_string(fdt, offs, "enable-method", "psci");
149 * @fdt: pointer to the device tree blob in memory
158 int dt_add_psci_cpu_enable_methods(void *fdt)
163 offs = fdt_path_offset(fdt, "/cpus");
167 ret = dt_update_one_cpu_node(fdt, offs);