summaryrefslogtreecommitdiffstats
path: root/arch/ppc
diff options
context:
space:
mode:
authorJuergen Borleis <jbe@pengutronix.de>2015-07-24 15:42:03 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-07-27 07:46:53 +0200
commit04ac96fa2daa0421e7f90b18ca72820f70b2e4e6 (patch)
tree8ae72fa80d15978fc330fb6ec10e0976e3b07142 /arch/ppc
parentf53a2c1bfa87155e65b13bbd56bb4bc0836ebeed (diff)
downloadbarebox-04ac96fa2daa0421e7f90b18ca72820f70b2e4e6.tar.gz
barebox-04ac96fa2daa0421e7f90b18ca72820f70b2e4e6.tar.xz
Devicetree/PPC: fix devicetree's fixup
Currently Barebox fails to boot a kernel/devicetree pair on PowerPC. With of_find_node_by_path() the framework uses a global variable to find the root node and fails. With of_find_node_by_path_from() and forwarding the 'root' parameter it works again as expected. This fixes the following error message at run-time: Loading U-Boot uImage '/tmp/tftpcmd/kernel' Loading devicetree from '/tmp/tftpcmd/oftree' bootm: No devicetree given. handler failed with: Invalid argument Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/ppc')
-rw-r--r--arch/ppc/mach-mpc5xxx/cpu.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/ppc/mach-mpc5xxx/cpu.c b/arch/ppc/mach-mpc5xxx/cpu.c
index c860e709f2..a53af63039 100644
--- a/arch/ppc/mach-mpc5xxx/cpu.c
+++ b/arch/ppc/mach-mpc5xxx/cpu.c
@@ -83,17 +83,21 @@ static int of_mpc5200_fixup(struct device_node *root, void *unused)
int div = in_8((void*)CFG_MBAR + 0x204) & 0x0020 ? 8 : 4;
- node = of_find_node_by_path("/cpus/PowerPC,5200@0");
- if (!node)
+ node = of_find_node_by_path_from(root, "/cpus/PowerPC,5200@0");
+ if (!node) {
+ pr_err("Cannot find node '/cpus/PowerPC,5200@0' for proper CPU frequency fixup\n");
return -EINVAL;
+ }
of_property_write_u32(node, "timebase-frequency", get_timebase_clock());
of_property_write_u32(node, "bus-frequency", get_bus_clock());
of_property_write_u32(node, "clock-frequency", get_cpu_clock());
- node = of_find_node_by_path("/soc5200@f0000000");
- if (!node)
+ node = of_find_node_by_path_from(root, "/soc5200@f0000000");
+ if (!node) {
+ pr_err("Cannot find node '/soc5200@f0000000' for proper SOC frequency fixup\n");
return -EINVAL;
+ }
of_property_write_u32(node, "bus-frequency", get_ipb_clock());
of_property_write_u32(node, "system-frequency", get_bus_clock() * div);