6f17e10ded4bd57bc3a0376a0eae72fcc828e46d
[openwrt/openwrt.git] / target / linux / bcm53xx / patches-4.4 / 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 @@ -44,6 +44,24 @@
15 };
16 };
17
18 + ilp: ilp@0 {
19 + compatible = "brcm,bcm53573-ilp";
20 + reg = <0x18012000 0x1000>;
21 + reg-names = "pmu";
22 + clocks = <&alp>;
23 + #clock-cells = <0>;
24 + clock-output-names = "ilp";
25 + };
26 +
27 + timer {
28 + compatible = "arm,armv7-timer";
29 + interrupts = <GIC_PPI 13 0>,
30 + <GIC_PPI 14 0>,
31 + <GIC_PPI 11 0>,
32 + <GIC_PPI 10 0>;
33 + clocks = <&ilp>;
34 + };
35 +
36 clocks {
37 #address-cells = <1>;
38 #size-cells = <1>;
39 --- a/drivers/bcma/main.c
40 +++ b/drivers/bcma/main.c
41 @@ -349,14 +349,6 @@ static int bcma_register_devices(struct
42 }
43 #endif
44
45 -#ifdef CONFIG_BCMA_SFLASH
46 - if (bus->drv_cc.sflash.present) {
47 - err = platform_device_register(&bcma_sflash_dev);
48 - if (err)
49 - bcma_err(bus, "Error registering serial flash\n");
50 - }
51 -#endif
52 -
53 #ifdef CONFIG_BCMA_NFLASH
54 if (bus->drv_cc.nflash.present) {
55 err = platform_device_register(&bcma_nflash_dev);
56 @@ -437,6 +429,14 @@ int bcma_bus_register(struct bcma_bus *b
57 bcma_register_core(bus, core);
58 }
59
60 +#ifdef CONFIG_BCMA_SFLASH
61 + if (bus->drv_cc.sflash.present) {
62 + err = platform_device_register(&bcma_sflash_dev);
63 + if (err)
64 + bcma_err(bus, "Error registering serial flash\n");
65 + }
66 +#endif
67 +
68 /* Try to get SPROM */
69 err = bcma_sprom_get(bus);
70 if (err == -ENOENT) {
71 --- a/drivers/clocksource/arm_arch_timer.c
72 +++ b/drivers/clocksource/arm_arch_timer.c
73 @@ -14,6 +14,7 @@
74 #include <linux/smp.h>
75 #include <linux/cpu.h>
76 #include <linux/cpu_pm.h>
77 +#include <linux/clk.h>
78 #include <linux/clockchips.h>
79 #include <linux/clocksource.h>
80 #include <linux/interrupt.h>
81 @@ -376,6 +377,16 @@ arch_timer_detect_rate(void __iomem *cnt
82 arch_timer_rate = arch_timer_get_cntfrq();
83 }
84
85 + /* Get clk rate through clk driver if present */
86 + if (!arch_timer_rate) {
87 + struct clk *clk = of_clk_get(np, 0);
88 +
89 + if (!IS_ERR(clk)) {
90 + if (!clk_prepare_enable(clk))
91 + arch_timer_rate = clk_get_rate(clk);
92 + }
93 + }
94 +
95 /* Check the timer frequency. */
96 if (arch_timer_rate == 0)
97 pr_warn("Architected timer frequency not available\n");