ppc4xx: Fixup ebc clock in FDT for 405GP/EP
authorMarkus Brunner <super.firetwister@googlemail.com>
Mon, 28 Apr 2008 06:47:47 +0000 (08:47 +0200)
committerStefan Roese <sr@denx.de>
Tue, 29 Apr 2008 05:37:54 +0000 (07:37 +0200)
On ppc405EP and ppc405GP (at least) the ebc is directly attached to the plb
and not to the opb. This patch will try to fixup /plb/ebc if /plb/opb/ebc
doesn't exist.

Signed-off-by: Markus Brunner <super.firetwister@gmail.com>
cpu/ppc4xx/fdt.c

index 1f4d6f27fdd4af16065fdb1d7a3fb3bde059dabc..02dece0c0ff6ffdf3c99553e04e0c9327e5e1588 100644 (file)
@@ -83,8 +83,14 @@ void ft_cpu_setup(void *blob, bd_t *bd)
                             bd->bi_intfreq, 1);
        do_fixup_by_path_u32(blob, "/plb", "clock-frequency", sys_info.freqPLB, 1);
        do_fixup_by_path_u32(blob, "/plb/opb", "clock-frequency", sys_info.freqOPB, 1);
-       do_fixup_by_path_u32(blob, "/plb/opb/ebc", "clock-frequency",
-                            sys_info.freqEBC, 1);
+
+       if (fdt_path_offset(blob, "/plb/opb/ebc") >= 0)
+               do_fixup_by_path_u32(blob, "/plb/opb/ebc", "clock-frequency",
+                       sys_info.freqEBC, 1);
+       else
+               do_fixup_by_path_u32(blob, "/plb/ebc", "clock-frequency",
+                       sys_info.freqEBC, 1);
+
        fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
 
        /*