The ability to read MAC addresses from MTD is useful for other targets besides
[openwrt.git] / target / linux / mpc85xx / patches-3.18 / 142-add-mpic-timer-clock-frequency.patch
1 From 1c20a5420c2602e2438209f34a633eae377eda5e Mon Sep 17 00:00:00 2001
2 From: Heiner Kallweit <hkallweit1@gmail.com>
3 Date: Thu, 19 Feb 2015 23:43:32 +0100
4 Subject: [PATCH] mpc85xx: add mpic timer clock frequency
5
6 MPIC timers are enabled in the config, however a devicetree clock setting
7 is missing causing the following error:
8 /soc@ffe00000/timer@41100: cannot get timer frequency.
9 /soc@ffe00000/timer@42100: cannot get timer frequency.
10
11 This patch adds the missing clock and avoids the error.
12 It's a functional copy of this code
13 do_fixup_by_compat_u32(blob, "fsl,mpic",
14         "clock-frequency", get_bus_freq(0), 1);
15 in arch/powerpc/cpu/mpc85xx/fdt.c in the u-boot code.
16
17 Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
18 ---
19  arch/powerpc/boot/cuboot-tl-wdr4900-v1.c | 6 +++++-
20  1 file changed, 5 insertions(+), 1 deletion(-)
21
22 diff --git a/arch/powerpc/boot/cuboot-tl-wdr4900-v1.c b/arch/powerpc/boot/cuboot-tl-wdr4900-v1.c
23 index 095e777..17459ef 100644
24 --- a/arch/powerpc/boot/cuboot-tl-wdr4900-v1.c
25 +++ b/arch/powerpc/boot/cuboot-tl-wdr4900-v1.c
26 @@ -119,7 +119,7 @@ static void process_boot_dtb(void *boot_dtb)
27  
28  static void platform_fixups(void)
29  {
30 -       void *soc;
31 +       void *soc, *mpic;
32  
33         dt_fixup_memory(0, mem_size);
34  
35 @@ -144,6 +144,10 @@ static void platform_fixups(void)
36                                 sizeof(bus_freq));
37                 }
38         }
39 +
40 +       mpic = find_node_by_compatible(NULL, "fsl,mpic");
41 +       if (mpic)
42 +               setprop(mpic, "clock-frequency", &bus_freq, sizeof(bus_freq));
43  }
44  
45  void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
46 -- 
47 2.3.0
48