Skip to contentSkip to conversation

ARM: dts: bcm5301x: Add TWD and I2C

PATCH In review Jon Mason 2 participants 9 messages Feb 28, 2017 – Mar 2, 2017 Device tree bindings

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

cover ARM: dts: bcm5301x: Add TWD and I2C

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 (2):
ARM: dts: bcm5301x: Add TWD WD Support to DT
ARM: dts: bcm5301x: Add I2C support to the DT

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

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

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 4fbb089..3fbc450 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_LEVEL_HIGH>;
+			reg = <0x20600 0x20>;
+			interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) |
+						  IRQ_TYPE_LEVEL_HIGH)>;
+			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_LEVEL_HIGH)>;
 			clocks = <&periph_clk>;
 		};
 
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH 1/2] ARM: dts: bcm5301x: Add TWD WD Support to DT

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

Quoted 6 lines · Jon Mason
arch/arm/boot/dts/bcm5301x.dtsi +1 -1
@@ -70,10 +70,19 @@
                        clocks = <&periph_clk>;
                };
 
-               local-timer at 20600 {
+               timer at 20600 {

Is there a reason for this rename? I don't really have preference for any name, it's just we shouldn't keep renaming this depending of personal preferences.

It also doesn't seem like adjusting to any schema:
bcm63138.dtsi uses local-timer at 1e600 bcm-nsp.dtsi uses twd-timer at 20600 berlin2cd.dtsi uses local-timer at ad0600 berlin2.dtsi uses local-timer at ad0600 berlin2q.dtsi uses local-timer at ad0600

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

Quoted 8 lines
arch/arm/boot/dts/bcm5301x.dtsi +5 -2
                        compatible = "arm,cortex-a9-twd-timer";
-                       reg = <0x20600 0x100>;
-                       interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
+                       reg = <0x20600 0x20>;
+                       interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) |
+                                                 IRQ_TYPE_LEVEL_HIGH)>;
+                       clocks = <&periph_clk>;
+               };

The rest looks OK, thanks! :)

Signature · 1 line
Rafa?
author
#3 lore raw

Re: [PATCH 1/2] ARM: dts: bcm5301x: Add TWD WD Support to DT

Quoted 12 lines · Rafa? Mi?ecki

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

Quoted 6 lines · Jon Mason
arch/arm/boot/dts/bcm5301x.dtsi +1 -1
@@ -70,10 +70,19 @@
                        clocks = <&periph_clk>;
                };
 
-               local-timer at 20600 {
+               timer at 20600 {

Is there a reason for this rename? I don't really have preference for any name, it's just we shouldn't keep renaming this depending of personal preferences.

Quoted 6 lines

It also doesn't seem like adjusting to any schema:
bcm63138.dtsi uses local-timer at 1e600 bcm-nsp.dtsi uses twd-timer at 20600 berlin2cd.dtsi uses local-timer at ad0600 berlin2.dtsi uses local-timer at ad0600 berlin2q.dtsi uses local-timer at ad0600

This was a suggestion from Sergei Shtylyov
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-December/395160.html

Quoted 14 lines

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

Quoted 9 lines
arch/arm/boot/dts/bcm5301x.dtsi +5 -2
                        compatible = "arm,cortex-a9-twd-timer";
-                       reg = <0x20600 0x100>;
-                       interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
+                       reg = <0x20600 0x20>;
+                       interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) |
+                                                 IRQ_TYPE_LEVEL_HIGH)>;
+                       clocks = <&periph_clk>;
+               };

The rest looks OK, thanks! :)

--
Rafa?

#4 lore raw

Re: [PATCH 1/2] ARM: dts: bcm5301x: Add TWD WD Support to DT

Quoted 20 lines · Jon Mason
Quoted 12 lines · Rafa? Mi?ecki

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

Quoted 6 lines · Jon Mason
arch/arm/boot/dts/bcm5301x.dtsi +1 -1
@@ -70,10 +70,19 @@
                        clocks = <&periph_clk>;
                };
 
-               local-timer at 20600 {
+               timer at 20600 {

Is there a reason for this rename? I don't really have preference for any name, it's just we shouldn't keep renaming this depending of personal preferences.

Quoted 6 lines

It also doesn't seem like adjusting to any schema:
bcm63138.dtsi uses local-timer at 1e600 bcm-nsp.dtsi uses twd-timer at 20600 berlin2cd.dtsi uses local-timer at ad0600 berlin2.dtsi uses local-timer at ad0600 berlin2q.dtsi uses local-timer at ad0600

Quoted 2 lines

This was a suggestion from Sergei Shtylyov
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-December/395160.html

Good to know, thanks!

Signature · 1 line
Rafa?
#5 lore raw

Re: [PATCH 1/2] ARM: dts: bcm5301x: Add TWD WD Support to DT

In reply to Jon Mason
Quoted 19 lines · 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 +0 -0
index 4fbb089..3fbc450 100644
@@ -70,10 +70,19 @@
 			clocks = <&periph_clk>;
 		};
 

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

Quoted 10 lines
arch/arm/boot/dts/bcm5301x.dtsi +6 -3
-		local-timer at 20600 {
+		timer at 20600 {
 			compatible = "arm,cortex-a9-twd-timer";
-			reg = <0x20600 0x100>;
-			interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
+			reg = <0x20600 0x20>;
+			interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) |
+						  IRQ_TYPE_LEVEL_HIGH)>;
+			clocks = <&periph_clk>;
+		};

If you follow my recent e-mail thread:
BCM5301X: GIC: PPI11 is secure or misconfigured (same for PPI13) you'll see IRQ_TYPE_LEVEL_HIGH type isn't correct. It should be IRQ_TYPE_EDGE_RISING.

I believe patch switching to IRQ_TYPE_EDGE_RISING should be sent with Cc stable for kernels 4.8+.

The same change is needed for "arm,cortex-a9-global-timer".

Would you find time to revise this patch?

author
#6 lore raw

Re: [PATCH 1/2] ARM: dts: bcm5301x: Add TWD WD Support to DT

Quoted 39 lines · Rafał Miłecki
Quoted 21 lines · 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 +0 -1
index 4fbb089..3fbc450 100644
@@ -70,10 +70,19 @@
                        clocks = <&periph_clk>;
                };
 
-               local-timer@20600 {

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

Quoted 10 lines
arch/arm/boot/dts/bcm5301x.dtsi +6 -2
+               timer@20600 {
                        compatible = "arm,cortex-a9-twd-timer";
-                       reg = <0x20600 0x100>;
-                       interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
+                       reg = <0x20600 0x20>;
+                       interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) |
+                                                 IRQ_TYPE_LEVEL_HIGH)>;
+                       clocks = <&periph_clk>;
+               };
 

If you follow my recent e-mail thread:
BCM5301X: GIC: PPI11 is secure or misconfigured (same for PPI13) you'll see IRQ_TYPE_LEVEL_HIGH type isn't correct. It should be IRQ_TYPE_EDGE_RISING.

Quoted 8 lines

I believe patch switching to IRQ_TYPE_EDGE_RISING should be sent with Cc stable
for kernels 4.8+.

The same change is needed for "arm,cortex-a9-global-timer".

Would you find time to revise this patch?

I'll do 2 patches. One to revise this one and one to address the issue you've discovered. Will that be okay for you?

#7 lore raw

Re: [PATCH 1/2] ARM: dts: bcm5301x: Add TWD WD Support to DT

Quoted 46 lines · Jon Mason
Quoted 45 lines · Rafa? Mi?ecki
Quoted 29 lines · 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 +3 -3
index 4fbb089..3fbc450 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_LEVEL_HIGH>;
+                       reg = <0x20600 0x20>;
+                       interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2)

|

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

Quoted 3 lines
arch/arm/boot/dts/bcm5301x.dtsi +3 -0
+                                                 IRQ_TYPE_LEVEL_HIGH)>;
+                       clocks = <&periph_clk>;
+               };

If you follow my recent e-mail thread:
BCM5301X: GIC: PPI11 is secure or misconfigured (same for PPI13) you'll see IRQ_TYPE_LEVEL_HIGH type isn't correct. It should be IRQ_TYPE_EDGE_RISING.

I believe patch switching to IRQ_TYPE_EDGE_RISING should be sent with Cc stable
for kernels 4.8+.

Quoted 7 lines
Quoted 3 lines

The same change is needed for "arm,cortex-a9-global-timer".

Would you find time to revise this patch?

I'll do 2 patches. One to revise this one and one to address the issue you've discovered. Will that be okay for you?

Sure. Please make sure you switch to IRQ_TYPE_EDGE_RISING before doing other changes, so it can be applied cleanly to the stable kernels.

Signature · 1 line
Rafa?
author
#8 lore raw

PATCH 2/2 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 3fbc450..dd5c7ad 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