Skip to contentSkip to conversation

ARM: dts: BCM5301X: GIC_PPI bug, TWD WD and i2c Support

PATCH Superseded Jon Mason 2 participants 7 messages Mar 3, 2017 – Mar 6, 2017 Device tree bindings

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

v2 cover ARM: dts: BCM5301X: GIC_PPI bug, TWD WD and i2c Support

Changes in v2:
* Rafal discovered an issue with the GIC_PPI flags being incorrect. Since there was a dependency on that DT entry in this series, I added a patch to correct the issue and reworked the TWD patch with the changes.

These seemed to have been lost sometime last year. See
https://lkml.org/lkml/2016/5/11/953

I am dropping the syscon reboot from the series, as I believe that was the sticking point, and resending the TWD and i2c patches.

Jon Mason (3):
ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags
ARM: dts: bcm5301x: Add TWD WD Support to DT
ARM: dts: bcm5301x: Add I2C support to the DT

 arch/arm/boot/dts/bcm5301x.dtsi | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v2 1/3 ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags

GIC_PPI flags were misconfigured for the timers, resulting in errors like:

[    0.000000] GIC: PPI11 is secure or misconfigured

Changing them to being edge triggered corrects the issue

Fixes d27509f1 ("ARM: BCM5301X: add dts files for BCM4708 SoC")
---
 arch/arm/boot/dts/bcm5301x.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/bcm5301x.dtsi +2 -2
index 4fbb089..00de62d 100644
@@ -66,14 +66,14 @@
 		timer at 20200 {
 			compatible = "arm,cortex-a9-global-timer";
 			reg = <0x20200 0x100>;
-			interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_PPI 11 IRQ_TYPE_EDGE_RISING>;
 			clocks = <&periph_clk>;
 		};
 
 		local-timer at 20600 {
 			compatible = "arm,cortex-a9-twd-timer";
 			reg = <0x20600 0x100>;
-			interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_PPI 13 IRQ_TYPE_EDGE_RISING>;
 			clocks = <&periph_clk>;
 		};
 
Signature · 1 line
2.7.4
author
#3 lore raw

PATCH v2 2/3 ARM: dts: bcm5301x: Add TWD WD Support to DT

In reply to Jon Mason

From: Jon Mason <[email protected]>

Add support for the ARM TWD Watchdog to the bcm5301x device tree. The ARM TWD timer allocated the register space for the WDT, so this patch necessitated shrinking that. Also, the GIC masks were added for these.

---
 arch/arm/boot/dts/bcm5301x.dtsi | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
arch/arm/boot/dts/bcm5301x.dtsi +12 -3
index 00de62d..4e3fbce 100644
@@ -70,10 +70,19 @@
 			clocks = <&periph_clk>;
 		};
 
-		local-timer at 20600 {
+		timer at 20600 {
 			compatible = "arm,cortex-a9-twd-timer";
-			reg = <0x20600 0x100>;
-			interrupts = <GIC_PPI 13 IRQ_TYPE_EDGE_RISING>;
+			reg = <0x20600 0x20>;
+			interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) |
+						  IRQ_TYPE_EDGE_RISING)>;
+			clocks = <&periph_clk>;
+		};
+
+		watchdog at 20620 {
+			compatible = "arm,cortex-a9-twd-wdt";
+			reg = <0x20620 0x20>;
+			interrupts = <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) |
+						  IRQ_TYPE_EDGE_RISING)>;
 			clocks = <&periph_clk>;
 		};
 
Signature · 1 line
2.7.4
author
#4 lore raw

PATCH v2 3/3 ARM: dts: bcm5301x: Add I2C support to the DT

In reply to Jon Mason

From: Jon Mason <[email protected]>

Add I2C support to the bcm5301x Device Tree. Since no driver changes are needed to enable this hardware, only the device tree changes are required to make this functional.

---
 arch/arm/boot/dts/bcm5301x.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/boot/dts/bcm5301x.dtsi +9 -0
index 4e3fbce..2a343f2 100644
@@ -338,6 +338,15 @@
 		};
 	};
 
+	i2c0: i2c at 18009000 {
+		compatible = "brcm,iproc-i2c";
+		reg = <0x18009000 0x50>;
+		interrupts = <GIC_SPI 121 IRQ_TYPE_NONE>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clock-frequency = <100000>;
+	};
+
 	lcpll0: lcpll0 at 1800c100 {
 		#clock-cells = <1>;
 		compatible = "brcm,nsp-lcpll0";
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 1/3 ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags

In reply to Jon Mason
Quoted 9 lines · Jon Mason

GIC_PPI flags were misconfigured for the timers, resulting in errors like:

[    0.000000] GIC: PPI11 is secure or misconfigured

Changing them to being edge triggered corrects the issue

Fixes d27509f1 ("ARM: BCM5301X: add dts files for BCM4708 SoC")

Applied, thanks!

Signature · 1 line
Florian
#5 lore raw

Re: [PATCH v2 3/3] ARM: dts: bcm5301x: Add I2C support to the DT

In reply to Jon Mason
Quoted 16 lines · Jon Mason

From: Jon Mason <[email protected]>

Add I2C support to the bcm5301x Device Tree. Since no driver changes are needed to enable this hardware, only the device tree changes are required to make this functional.

---
 arch/arm/boot/dts/bcm5301x.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/boot/dts/bcm5301x.dtsi +0 -0
index 4e3fbce..2a343f2 100644

arch/arm/boot/dts/bcm5301x.dtsi line 347

Quoted 10 lines
arch/arm/boot/dts/bcm5301x.dtsi +7 -0
@@ -338,6 +338,15 @@
 		};
 	};
 
+	i2c0: i2c at 18009000 {
+		compatible = "brcm,iproc-i2c";
+		reg = <0x18009000 0x50>;
+		interrupts = <GIC_SPI 121 IRQ_TYPE_NONE>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clock-frequency = <100000>;

Should not this have a:
status = "disabled"

property by default such that boards can override this by phandle when there are actual I2C devices available?

Quoted 6 lines
arch/arm/boot/dts/bcm5301x.dtsi +2 -0
+	};
+
 	lcpll0: lcpll0 at 1800c100 {
 		#clock-cells = <1>;
 		compatible = "brcm,nsp-lcpll0";
Signature · 1 line
Florian
author
#6 lore raw

Re: [PATCH v2 3/3] ARM: dts: bcm5301x: Add I2C support to the DT

Quoted 33 lines · Florian Fainelli
Quoted 16 lines · Jon Mason

From: Jon Mason <[email protected]>

Add I2C support to the bcm5301x Device Tree. Since no driver changes are needed to enable this hardware, only the device tree changes are required to make this functional.

---
 arch/arm/boot/dts/bcm5301x.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/boot/dts/bcm5301x.dtsi +0 -0
index 4e3fbce..2a343f2 100644

arch/arm/boot/dts/bcm5301x.dtsi line 347

Quoted 10 lines
arch/arm/boot/dts/bcm5301x.dtsi +7 -0
@@ -338,6 +338,15 @@
              };
      };
 
+     i2c0: i2c at 18009000 {
+             compatible = "brcm,iproc-i2c";
+             reg = <0x18009000 0x50>;
+             interrupts = <GIC_SPI 121 IRQ_TYPE_NONE>;
+             #address-cells = <1>;
+             #size-cells = <0>;
+             clock-frequency = <100000>;

Should not this have a:
status = "disabled"

Quoted 2 lines

property by default such that boards can override this by phandle when there are actual I2C devices available?

Your comment appears to match the way it is being done in most device trees.

NSP implementation is identical to this. So, if I should change it here, I should make there too.

Thanks,
Jon

Quoted 9 lines

arch/arm/boot/dts/bcm5301x.dtsi line 352

Quoted 6 lines
arch/arm/boot/dts/bcm5301x.dtsi +2 -0
+     };
+
      lcpll0: lcpll0 at 1800c100 {
              #clock-cells = <1>;
              compatible = "brcm,nsp-lcpll0";

--
Florian