4e0a752d6613ceefc1e0ca450ea64cb78992a9da
[openwrt/openwrt.git] / target / linux / bcm53xx / patches-4.14 / 905-BCM53573-minor-hacks.patch
1 From 6f1c62440eb6846cb8045d7a5480ec7bbe47c96f Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Mon, 15 Aug 2016 10:30:41 +0200
4 Subject: [PATCH] BCM53573 minor hacks
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
10 ---
11
12 --- a/arch/arm/boot/dts/bcm53573.dtsi
13 +++ b/arch/arm/boot/dts/bcm53573.dtsi
14 @@ -48,6 +48,15 @@
15 };
16 };
17
18 + timer {
19 + compatible = "arm,armv7-timer";
20 + interrupts = <GIC_PPI 13 0>,
21 + <GIC_PPI 14 0>,
22 + <GIC_PPI 11 0>,
23 + <GIC_PPI 10 0>;
24 + clocks = <&ilp>;
25 + };
26 +
27 clocks {
28 #address-cells = <1>;
29 #size-cells = <1>;
30 --- a/drivers/bcma/main.c
31 +++ b/drivers/bcma/main.c
32 @@ -348,14 +348,6 @@ static int bcma_register_devices(struct
33 }
34 #endif
35
36 -#ifdef CONFIG_BCMA_SFLASH
37 - if (bus->drv_cc.sflash.present) {
38 - err = platform_device_register(&bcma_sflash_dev);
39 - if (err)
40 - bcma_err(bus, "Error registering serial flash\n");
41 - }
42 -#endif
43 -
44 #ifdef CONFIG_BCMA_NFLASH
45 if (bus->drv_cc.nflash.present) {
46 err = platform_device_register(&bcma_nflash_dev);
47 @@ -436,6 +428,14 @@ int bcma_bus_register(struct bcma_bus *b
48 bcma_register_core(bus, core);
49 }
50
51 +#ifdef CONFIG_BCMA_SFLASH
52 + if (bus->drv_cc.sflash.present) {
53 + err = platform_device_register(&bcma_sflash_dev);
54 + if (err)
55 + bcma_err(bus, "Error registering serial flash\n");
56 + }
57 +#endif
58 +
59 /* Try to get SPROM */
60 err = bcma_sprom_get(bus);
61 if (err == -ENOENT) {
62 --- a/drivers/clocksource/arm_arch_timer.c
63 +++ b/drivers/clocksource/arm_arch_timer.c
64 @@ -17,6 +17,7 @@
65 #include <linux/smp.h>
66 #include <linux/cpu.h>
67 #include <linux/cpu_pm.h>
68 +#include <linux/clk.h>
69 #include <linux/clockchips.h>
70 #include <linux/clocksource.h>
71 #include <linux/interrupt.h>
72 @@ -836,6 +837,16 @@ static void arch_timer_of_configure_rate
73 if (of_property_read_u32(np, "clock-frequency", &arch_timer_rate))
74 arch_timer_rate = rate;
75
76 + /* Get clk rate through clk driver if present */
77 + if (!arch_timer_rate) {
78 + struct clk *clk = of_clk_get(np, 0);
79 +
80 + if (!IS_ERR(clk)) {
81 + if (!clk_prepare_enable(clk))
82 + arch_timer_rate = clk_get_rate(clk);
83 + }
84 + }
85 +
86 /* Check the timer frequency. */
87 if (arch_timer_rate == 0)
88 pr_warn("frequency not available\n");