[source] bcm53xx: add quick fixes for BCM53573

LEDE Commits lede-commits at lists.infradead.org
Mon Aug 15 03:49:29 PDT 2016


rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/?p=source.git;a=commitdiff;h=27b078e83aa05e66697dfc177d6deb69dd7d4491

commit 27b078e83aa05e66697dfc177d6deb69dd7d4491
Author: Rafał Miłecki <rafal at milecki.pl>
AuthorDate: Mon Aug 15 12:47:21 2016 +0200

    bcm53xx: add quick fixes for BCM53573
    
    It adds and uses ILP clock that requires some other work (in progress)
    for upstreaming it. Other than that it adds a quick fix for bcma to add
    serial flash before trying to read SPROM.
    
    Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
 .../patches-4.4/905-BCM53573-minor-hacks.patch     | 97 ++++++++++++++++++++++
 1 file changed, 97 insertions(+)

diff --git a/target/linux/bcm53xx/patches-4.4/905-BCM53573-minor-hacks.patch b/target/linux/bcm53xx/patches-4.4/905-BCM53573-minor-hacks.patch
new file mode 100644
index 0000000..c48170a
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/905-BCM53573-minor-hacks.patch
@@ -0,0 +1,97 @@
+From 6f1c62440eb6846cb8045d7a5480ec7bbe47c96f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Mon, 15 Aug 2016 10:30:41 +0200
+Subject: [PATCH] BCM53573 minor hacks
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
+---
+
+--- a/arch/arm/boot/dts/bcm53573.dtsi
++++ b/arch/arm/boot/dts/bcm53573.dtsi
+@@ -44,6 +44,24 @@
+ 		};
+ 	};
+ 
++	ilp: ilp at 0 {
++		compatible = "brcm,ns-ilp";
++		reg = <0x18012000 0x1000>;
++		reg-names = "pmu";
++		clocks = <&alp>;
++		#clock-cells = <0>;
++		clock-output-names = "ilp";
++	};
++
++	timer {
++		compatible = "arm,armv7-timer";
++		interrupts = <GIC_PPI 13 0>,
++			     <GIC_PPI 14 0>,
++			     <GIC_PPI 11 0>,
++			     <GIC_PPI 10 0>;
++		clocks = <&ilp>;
++	};
++
+ 	clocks {
+ 		#address-cells = <1>;
+ 		#size-cells = <1>;
+--- a/drivers/bcma/main.c
++++ b/drivers/bcma/main.c
+@@ -349,14 +349,6 @@ static int bcma_register_devices(struct
+ 	}
+ #endif
+ 
+-#ifdef CONFIG_BCMA_SFLASH
+-	if (bus->drv_cc.sflash.present) {
+-		err = platform_device_register(&bcma_sflash_dev);
+-		if (err)
+-			bcma_err(bus, "Error registering serial flash\n");
+-	}
+-#endif
+-
+ #ifdef CONFIG_BCMA_NFLASH
+ 	if (bus->drv_cc.nflash.present) {
+ 		err = platform_device_register(&bcma_nflash_dev);
+@@ -437,6 +429,14 @@ int bcma_bus_register(struct bcma_bus *b
+ 			bcma_register_core(bus, core);
+ 	}
+ 
++#ifdef CONFIG_BCMA_SFLASH
++	if (bus->drv_cc.sflash.present) {
++		err = platform_device_register(&bcma_sflash_dev);
++		if (err)
++			bcma_err(bus, "Error registering serial flash\n");
++	}
++#endif
++
+ 	/* Try to get SPROM */
+ 	err = bcma_sprom_get(bus);
+ 	if (err == -ENOENT) {
+--- a/drivers/clocksource/arm_arch_timer.c
++++ b/drivers/clocksource/arm_arch_timer.c
+@@ -14,6 +14,7 @@
+ #include <linux/smp.h>
+ #include <linux/cpu.h>
+ #include <linux/cpu_pm.h>
++#include <linux/clk.h>
+ #include <linux/clockchips.h>
+ #include <linux/clocksource.h>
+ #include <linux/interrupt.h>
+@@ -376,6 +377,16 @@ arch_timer_detect_rate(void __iomem *cnt
+ 			arch_timer_rate = arch_timer_get_cntfrq();
+ 	}
+ 
++	/* Get clk rate through clk driver if present */
++	if (!arch_timer_rate) {
++		struct clk *clk = of_clk_get(np, 0);
++
++		if (!IS_ERR(clk)) {
++			if (!clk_prepare_enable(clk))
++				arch_timer_rate = clk_get_rate(clk);
++		}
++	}
++
+ 	/* Check the timer frequency. */
+ 	if (arch_timer_rate == 0)
+ 		pr_warn("Architected timer frequency not available\n");



More information about the lede-commits mailing list