Skip to contentSkip to conversation

Clean up ASPEED devicetree warnings

PATCH In review Andrew Jeffery 8 participants 31 messages Jul 26, 2019 – Aug 5, 2019

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

cover Clean up ASPEED devicetree warnings

Hello,

The aim of this series is to minimise/eliminate all the warnings from the ASPEED devicetrees. It mostly achieves its goal, as outlined below.

Using aspeed_g5_defconfig we started with the follow warning count:

    $ make dtbs 2>&1 >/dev/null | wc -l
    218

and after the full series is applied we have:

    $ make dtbs 2>&1 >/dev/null | wc -l
    2

for a 100x reduction.

Getting there though isn't without some potential controversy, which I've saved for the last half of the series. The following patches I think are in pretty good shape:

ARM: dts: aspeed-g5: Move EDAC node to APB
ARM: dts: aspeed-g5: Use recommended generic node name for SDMC
ARM: dts: aspeed-g5: Fix aspeed,external-nodes description
ARM: dts: vesnin: Add unit address for memory node
ARM: dts: fp5280g2: Cleanup gpio-keys-polled properties
ARM: dts: swift: Cleanup gpio-keys-polled properties
ARM: dts: witherspoon: Cleanup gpio-keys-polled properties
ARM: dts: aspeed: Cleanup lpc-ctrl and snoop regs
ARM: dts: ibm-power9-dual: Add a unit address for OCC nodes

With these patches applied we get to:

    $ make dtbs 2>&1 >/dev/null | wc -l
    144

So they make a dent, but fail to clean up the bulk of the issues. From here I've mixed in some binding and driver changes with subsequent updates to the devicetrees:

dt-bindings: pinctrl: aspeed: Add reg property as a hint
dt-bindings: misc: Document reg for aspeed,p2a-ctrl nodes
ARM: dts: aspeed: Add reg hints to syscon children
dt-bindings: ipmi: aspeed: Introduce a v2 binding for KCS
ipmi: kcs: Finish configuring ASPEED KCS device before enable
ipmi: kcs: aspeed: Implement v2 bindings
ARM: dts: aspeed-g5: Change KCS nodes to v2 binding
ARM: dts: aspeed-g5: Sort LPC child nodes by unit address

By dt-bindings: ipmi: aspeed: Introduce a v2 binding for KCS the warnings are reduced to:

    $ make dtbs 2>&1 >/dev/null | wc -l
    125

The bang-for-buck is in fixing up the KCS bindings which removes all-but-two of the remaining warnings (which we can't feasibly remove), but doing so forces code changes (which I'd avoided up until this point).

Reflecting broadly on the fixes, I think I've made a mistake way back by using syscon/simple-mfds to expose the innards of the SCU and LPC controllers in the devicetree. This series cleans up what's currently there, but I have half a mind to rev the SCU and LPC bindings to not use simple-mfd and instead have a driver implementation that uses platform_device_register_full() or similar to deal with the mess.

Rob - I'm looking for your thoughts here and on the series, I've never felt entirely comfortable with what I cooked up. Your advice would be appreciated.

Anyway, everyone, please let me know your thoughts on the bits relevant to you. If we can agree on a way forward I'll split up the series for subsequent submissions so it isn't such a spam-fest.

Cheers,

Andrew

Andrew Jeffery (17):
ARM: dts: aspeed-g5: Move EDAC node to APB
ARM: dts: aspeed-g5: Use recommended generic node name for SDMC
ARM: dts: aspeed-g5: Fix aspeed,external-nodes description
ARM: dts: vesnin: Add unit address for memory node
ARM: dts: fp5280g2: Cleanup gpio-keys-polled properties
ARM: dts: swift: Cleanup gpio-keys-polled properties
ARM: dts: witherspoon: Cleanup gpio-keys-polled properties
ARM: dts: aspeed: Cleanup lpc-ctrl and snoop regs
ARM: dts: ibm-power9-dual: Add a unit address for OCC nodes
dt-bindings: pinctrl: aspeed: Add reg property as a hint
dt-bindings: misc: Document reg for aspeed,p2a-ctrl nodes
ARM: dts: aspeed: Add reg hints to syscon children
dt-bindings: ipmi: aspeed: Introduce a v2 binding for KCS
ipmi: kcs: Finish configuring ASPEED KCS device before enable
ipmi: kcs: aspeed: Implement v2 bindings
ARM: dts: aspeed-g5: Change KCS nodes to v2 binding
ARM: dts: aspeed-g5: Sort LPC child nodes by unit address

 .../bindings/ipmi/aspeed-kcs-bmc.txt          |  20 ++-
 .../bindings/misc/aspeed-p2a-ctrl.txt         |   1 +
 .../pinctrl/aspeed,ast2400-pinctrl.yaml       |   3 +
 .../pinctrl/aspeed,ast2500-pinctrl.yaml       |   3 +
 .../dts/aspeed-bmc-arm-centriq2400-rep.dts    |   4 -
 .../aspeed-bmc-arm-stardragon4800-rep2.dts    |   4 -
 arch/arm/boot/dts/aspeed-bmc-facebook-cmm.dts |   4 -
 .../arm/boot/dts/aspeed-bmc-facebook-yamp.dts |   4 -
 .../boot/dts/aspeed-bmc-inspur-fp5280g2.dts   |   6 -
 .../arm/boot/dts/aspeed-bmc-intel-s2600wf.dts |   4 -
 arch/arm/boot/dts/aspeed-bmc-opp-lanyang.dts  |   4 -
 arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts  |   4 -
 arch/arm/boot/dts/aspeed-bmc-opp-swift.dts    |   6 -
 arch/arm/boot/dts/aspeed-bmc-opp-vesnin.dts   |   2 +-
 .../boot/dts/aspeed-bmc-opp-witherspoon.dts   |   6 -
 arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts    |   2 -
 arch/arm/boot/dts/aspeed-g4.dtsi              |  21 ++-
 arch/arm/boot/dts/aspeed-g5.dtsi              |  73 ++++----
 arch/arm/boot/dts/ibm-power9-dual.dtsi        |   4 +-
 drivers/char/ipmi/kcs_bmc_aspeed.c            | 163 ++++++++++++++----
 20 files changed, 205 insertions(+), 133 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/17 ARM: dts: aspeed-g5: Move EDAC node to APB

Previously the register interface was not attached to any internal bus, which is not correct - it lives on the APB.

Cc Stefan M Schaeckeler <[email protected]>
---
 arch/arm/boot/dts/aspeed-g5.dtsi | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
arch/arm/boot/dts/aspeed-g5.dtsi +7 -7
index 5b1ca265c2ce..7723afc7c249 100644
@@ -47,13 +47,6 @@
 		reg = <0x80000000 0>;
 	};
 
-	edac: sdram at 1e6e0000 {
-		compatible = "aspeed,ast2500-sdram-edac";
-		reg = <0x1e6e0000 0x174>;
-		interrupts = <0>;
-		status = "disabled";
-	};
-
 	ahb {
 		compatible = "simple-bus";
 		#address-cells = <1>;
@@ -206,6 +199,13 @@
 			#size-cells = <1>;
 			ranges;
 
+			edac: sdram at 1e6e0000 {
+				compatible = "aspeed,ast2500-sdram-edac";
+				reg = <0x1e6e0000 0x174>;
+				interrupts = <0>;
+				status = "disabled";
+			};
+
 			syscon: syscon at 1e6e2000 {
 				compatible = "aspeed,ast2500-scu", "syscon", "simple-mfd";
 				reg = <0x1e6e2000 0x1a8>;
Signature · 1 line
2.20.1
Reviewed-by on v1 1/17
#2 lore raw

Re: [PATCH 01/17] ARM: dts: aspeed-g5: Move EDAC node to APB

Quoted 8 lines · Andrew Jeffery

Previously the register interface was not attached to any internal bus, which is not correct - it lives on the APB.

Cc Stefan M Schaeckeler <[email protected]>
---
 arch/arm/boot/dts/aspeed-g5.dtsi | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
#3 lore raw

PATCH 2/17 ARM: dts: aspeed-g5: Use recommended generic node name for SDMC

In reply to Andrew Jeffery

The EDAC is a sub-function of the SDRAM Memory Controller. Rename the node to the appropriate generic node name.

Cc Stefan M Schaeckeler <[email protected]>
---
 arch/arm/boot/dts/aspeed-g5.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/aspeed-g5.dtsi +1 -1
index 7723afc7c249..6e5b0c493f16 100644
@@ -199,7 +199,7 @@
 			#size-cells = <1>;
 			ranges;
 
-			edac: sdram at 1e6e0000 {
+			edac: memory-controller at 1e6e0000 {
 				compatible = "aspeed,ast2500-sdram-edac";
 				reg = <0x1e6e0000 0x174>;
 				interrupts = <0>;
Signature · 1 line
2.20.1
Reviewed-by on v1 2/17
#4 lore raw

Re: [PATCH 02/17] ARM: dts: aspeed-g5: Use recommended generic node name for SDMC

Quoted 8 lines · Andrew Jeffery

The EDAC is a sub-function of the SDRAM Memory Controller. Rename the node to the appropriate generic node name.

Cc Stefan M Schaeckeler <[email protected]>
---
 arch/arm/boot/dts/aspeed-g5.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#5 lore raw

PATCH 3/17 ARM: dts: aspeed-g5: Fix aspeed,external-nodes description

In reply to Andrew Jeffery

The existing approach lead to an error from the dtbs_check:

pinctrl: aspeed,external-nodes: [[8, 9]] is too short

Cc Adriana Kobylak <[email protected]>
Cc Brian Yang <[email protected]>
Cc Joel Stanley <[email protected]>
Cc John Wang <[email protected]>
Cc Ken Chen <[email protected]>
Cc Tao Ren <[email protected]>
Cc Xo Wang <[email protected]>
Cc Yuan Yao <[email protected]>
---
 arch/arm/boot/dts/aspeed-bmc-arm-centriq2400-rep.dts     | 4 ----
 arch/arm/boot/dts/aspeed-bmc-arm-stardragon4800-rep2.dts | 4 ----
 arch/arm/boot/dts/aspeed-bmc-facebook-cmm.dts            | 4 ----
 arch/arm/boot/dts/aspeed-bmc-facebook-yamp.dts           | 4 ----
 arch/arm/boot/dts/aspeed-bmc-inspur-fp5280g2.dts         | 4 ----
 arch/arm/boot/dts/aspeed-bmc-intel-s2600wf.dts           | 4 ----
 arch/arm/boot/dts/aspeed-bmc-opp-lanyang.dts             | 4 ----
 arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts             | 4 ----
 arch/arm/boot/dts/aspeed-bmc-opp-swift.dts               | 4 ----
 arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts         | 4 ----
 arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts               | 2 --
 arch/arm/boot/dts/aspeed-g5.dtsi                         | 3 +--
 12 files changed, 1 insertion(+), 44 deletions(-)
arch/arm/boot/dts/aspeed-bmc-arm-centriq2400-rep.dts +0 -4
index c2ece0b91885..de9612e49c69 100644
@@ -211,10 +211,6 @@
 	status = "okay";
 };
 
-&pinctrl {
-	aspeed,external-nodes = <&gfx &lhc>;
-};
-
 &gpio {
 	pin_gpio_c7 {
 		gpio-hog;
arch/arm/boot/dts/aspeed-bmc-arm-stardragon4800-rep2.dts +0 -4
index 521afbea2c5b..d122a8efcc66 100644
@@ -197,10 +197,6 @@
 	status = "okay";
 };
 
-&pinctrl {
-	aspeed,external-nodes = <&gfx &lhc>;
-};
-
 &gpio {
 	pin_gpio_c7 {
 		gpio-hog;
arch/arm/boot/dts/aspeed-bmc-facebook-cmm.dts +0 -4
index d519d307aa2a..dd2be50112a4 100644
@@ -64,10 +64,6 @@
 	};
 };
 
-&pinctrl {
-	aspeed,external-nodes = <&gfx &lhc>;
-};
-
 /*
  * Update reset type to "system" (full chip) to fix warm reboot hang issue
  * when reset type is set to default ("soc", gated by reset mask registers).
arch/arm/boot/dts/aspeed-bmc-facebook-yamp.dts +0 -4
index 4e09a9cf32b7..d4d2d0b48f83 100644
@@ -29,10 +29,6 @@
 	};
 };
 
-&pinctrl {
-	aspeed,external-nodes = <&gfx &lhc>;
-};
-
 /*
  * Update reset type to "system" (full chip) to fix warm reboot hang issue
  * when reset type is set to default ("soc", gated by reset mask registers).
arch/arm/boot/dts/aspeed-bmc-inspur-fp5280g2.dts +0 -4
index 628195b66d46..2dd664bff928 100644
@@ -745,10 +745,6 @@
 	memory-region = <&gfx_memory>;
 };
 
-&pinctrl {
-	aspeed,external-nodes = <&gfx &lhc>;
-};
-
 &gpio {
 	pin_gpio_b7 {
 		gpio-hog;
arch/arm/boot/dts/aspeed-bmc-intel-s2600wf.dts +0 -4
index 22dade6393d0..4e9c03d5e5a3 100644
@@ -115,10 +115,6 @@
 	status = "okay";
 };
 
-&pinctrl {
-	aspeed,external-nodes = <&gfx &lhc>;
-};
-
 &pwm_tacho {
 	status = "okay";
 	pinctrl-names = "default";
arch/arm/boot/dts/aspeed-bmc-opp-lanyang.dts +0 -4
index de95112e2a04..fe7965366f4a 100644
@@ -260,10 +260,6 @@
 	status = "okay";
 };
 
-&pinctrl {
-	aspeed,external-nodes = <&gfx &lhc>;
-};
-
 &gpio {
 	pin_gpio_b0 {
 		gpio-hog;
arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +0 -4
index 9628ecb879cf..2fa4f361ac6a 100644
@@ -255,10 +255,6 @@
 	memory-region = <&gfx_memory>;
 };
 
-&pinctrl {
-	aspeed,external-nodes = <&gfx &lhc>;
-};
-
 &pwm_tacho {
 	status = "okay";
 	pinctrl-names = "default";
arch/arm/boot/dts/aspeed-bmc-opp-swift.dts +0 -4
index caac895c60b4..2077e8d0e096 100644
@@ -937,10 +937,6 @@
 	memory-region = <&gfx_memory>;
 };
 
-&pinctrl {
-	aspeed,external-nodes = <&gfx &lhc>;
-};
-
 &wdt1 {
 	aspeed,reset-type = "none";
 	aspeed,external-signal;
arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts +0 -4
index 31ea34e14c79..08facb2120b2 100644
@@ -618,10 +618,6 @@
 	memory-region = <&gfx_memory>;
 };
 
-&pinctrl {
-	aspeed,external-nodes = <&gfx &lhc>;
-};
-
 &wdt1 {
 	aspeed,reset-type = "none";
 	aspeed,external-signal;
arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts +0 -2
index 30624378316d..c99113e69e43 100644
@@ -461,8 +461,6 @@
 };
 
 &pinctrl {
-	aspeed,external-nodes = <&gfx &lhc>;
-
 	pinctrl_gpioh_unbiased: gpioi_unbiased {
 		pins = "A8", "C7", "B7", "A7", "D7", "B6", "A6", "E7";
 		bias-disable;
arch/arm/boot/dts/aspeed-g5.dtsi +1 -2
index 6e5b0c493f16..3b4af88f9b80 100644
@@ -216,8 +216,7 @@
 
 				pinctrl: pinctrl {
 					compatible = "aspeed,g5-pinctrl";
-					aspeed,external-nodes = <&gfx &lhc>;
-
+					aspeed,external-nodes = <&gfx>, <&lhc>;
 				};
 
 				p2a: p2a-control {
Signature · 1 line
2.20.1
#6 lore raw

PATCH 4/17 ARM: dts: vesnin: Add unit address for memory node

In reply to Andrew Jeffery

Fixes the following warnings:

arch/arm/boot/dts/aspeed-bmc-opp-vesnin.dt.yaml: /: memory: False schema does not allow {'reg': [[1073741824, 536870912]]} arch/arm/boot/dts/aspeed-bmc-opp-vesnin.dt.yaml: memory: 'device_type' is a required property

Cc Alexander Filippov <[email protected]>
---
 arch/arm/boot/dts/aspeed-bmc-opp-vesnin.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/aspeed-bmc-opp-vesnin.dts +1 -1
index 0b9e29c3212e..81d9dcb752a0 100644
@@ -14,7 +14,7 @@
 		bootargs = "console=ttyS4,115200 earlyprintk";
 	};
 
-	memory {
+	memory at 40000000 {
 		reg = <0x40000000 0x20000000>;
 	};
 
Signature · 1 line
2.20.1
Tested-by on v1 4/17
#7 lore raw

Re: [PATCH 04/17] ARM: dts: vesnin: Add unit address for memory node

Quoted 27 lines · Andrew Jeffery

Fixes the following warnings:

arch/arm/boot/dts/aspeed-bmc-opp-vesnin.dt.yaml: /: memory: False schema does not allow {'reg': [[1073741824, 536870912]]} arch/arm/boot/dts/aspeed-bmc-opp-vesnin.dt.yaml: memory: 'device_type' is a required property

Cc Alexander Filippov <[email protected]>
---
 arch/arm/boot/dts/aspeed-bmc-opp-vesnin.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/aspeed-bmc-opp-vesnin.dts +1 -1
index 0b9e29c3212e..81d9dcb752a0 100644
@@ -14,7 +14,7 @@
 		bootargs = "console=ttyS4,115200 earlyprintk";
 	};
 
-	memory {
+	memory at 40000000 {
 		reg = <0x40000000 0x20000000>;
 	};
 
Signature · 1 line
2.20.1
#8 lore raw

PATCH 5/17 ARM: dts: fp5280g2: Cleanup gpio-keys-polled properties

In reply to Andrew Jeffery

dtbs_check gave the following warning:

Warning (avoid_unnecessary_addr_size): /gpio-keys-polled: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

---
 arch/arm/boot/dts/aspeed-bmc-inspur-fp5280g2.dts | 2 --
 1 file changed, 2 deletions(-)
arch/arm/boot/dts/aspeed-bmc-inspur-fp5280g2.dts +0 -2
index 2dd664bff928..aa5efd1dfa70 100644
@@ -94,8 +94,6 @@
 
 	gpio-keys-polled {
 		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
 		poll-interval = <1000>;
 
 		fan0-presence {
Signature · 1 line
2.20.1
#9 lore raw

PATCH 6/17 ARM: dts: swift: Cleanup gpio-keys-polled properties

In reply to Andrew Jeffery

dtbs_check gave the following warning:

Warning (avoid_unnecessary_addr_size): /gpio-keys-polled: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

---
 arch/arm/boot/dts/aspeed-bmc-opp-swift.dts | 2 --
 1 file changed, 2 deletions(-)
arch/arm/boot/dts/aspeed-bmc-opp-swift.dts +0 -2
index 2077e8d0e096..9f934509ca1b 100644
@@ -82,8 +82,6 @@
 
 	gpio-keys-polled {
 		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
 		poll-interval = <1000>;
 
 		scm0-presence {
Signature · 1 line
2.20.1
#10 lore raw

PATCH 6/17 ARM: dts: swift: Cleanup gpio-keys-polled properties

Andrew Jeffery <[email protected]> wrote on 07/26/2019 12:39:48 AM:

Quoted 10 lines

From: Andrew Jeffery <[email protected]>
To: linux-aspeed at lists.ozlabs.org
Cc: Andrew Jeffery <[email protected]>, robh+dt at kernel.org, mark.rutland at arm.com, joel at jms.id.au, devicetree at vger.kernel.org, linux-arm-kernel at lists.infradead.org, linux-kernel at vger.kernel.org, Adriana Kobylak <[email protected]>
Date: 07/26/2019 12:40 AM
Subject: [EXTERNAL] [PATCH 06/17] ARM: dts: swift: Cleanup gpio- keys-polled properties

Quoted 8 lines

dtbs_check gave the following warning:

Warning (avoid_unnecessary_addr_size): /gpio-keys-polled:
unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

Quoted 21 lines
---
 arch/arm/boot/dts/aspeed-bmc-opp-swift.dts | 2 --
 1 file changed, 2 deletions(-)
arch/arm/ renamed from arch/arm/boot/dts/aspeed-bmc-opp-swift.dts +0 -0

boot/dts/aspeed-bmc-opp-swift.dts
index 2077e8d0e096..9f934509ca1b 100644

arch/arm/boot/dts/aspeed-bmc-opp-swift.dts +0 -2
@@ -82,8 +82,6 @@
 
    gpio-keys-polled {
       compatible = "gpio-keys-polled";
-      #address-cells = <1>;
-      #size-cells = <0>;
       poll-interval = <1000>;
 
       scm0-presence {
Signature · 1 line
2.20.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20190726/a10d5722/attachment-0001.htm>

#11 lore raw

PATCH 7/17 ARM: dts: witherspoon: Cleanup gpio-keys-polled properties

In reply to Andrew Jeffery

dtbs_check gave the following warning:

Warning (avoid_unnecessary_addr_size): /gpio-keys-polled: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

---
 arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts | 2 --
 1 file changed, 2 deletions(-)
arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts +0 -2
index 08facb2120b2..06319c6771ca 100644
@@ -77,8 +77,6 @@
 
 	gpio-keys-polled {
 		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
 		poll-interval = <1000>;
 
 		fan0-presence {
Signature · 1 line
2.20.1
#12 lore raw

PATCH 8/17 ARM: dts: aspeed: Cleanup lpc-ctrl and snoop regs

In reply to Andrew Jeffery

Fix the following warning:

    arch/arm/boot/dts/aspeed-g5.dtsi:409.27-414.8: Warning (unique_unit_address): /ahb/apb/lpc at 1e789000/lpc-host at 80/lpc-ctrl at 0: duplicate unit-address (also used in node /ahb/apb/lpc at 1e789000/lpc-host at 80/lpc-snoop at 0)
---
 arch/arm/boot/dts/aspeed-g4.dtsi | 6 +++---
 arch/arm/boot/dts/aspeed-g5.dtsi | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
arch/arm/boot/dts/aspeed-g4.dtsi +3 -3
index dd4b0b15afcf..ed78020f6269 100644
@@ -296,14 +296,14 @@
 
 					lpc_ctrl: lpc-ctrl at 0 {
 						compatible = "aspeed,ast2400-lpc-ctrl";
-						reg = <0x0 0x80>;
+						reg = <0x0 0x10>;
 						clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
 						status = "disabled";
 					};
 
-					lpc_snoop: lpc-snoop at 0 {
+					lpc_snoop: lpc-snoop at 10 {
 						compatible = "aspeed,ast2400-lpc-snoop";
-						reg = <0x0 0x80>;
+						reg = <0x10 0x8>;
 						interrupts = <8>;
 						status = "disabled";
 					};
arch/arm/boot/dts/aspeed-g5.dtsi +3 -3
index 3b4af88f9b80..a8a593dd2240 100644
@@ -408,14 +408,14 @@
 
 					lpc_ctrl: lpc-ctrl at 0 {
 						compatible = "aspeed,ast2500-lpc-ctrl";
-						reg = <0x0 0x80>;
+						reg = <0x0 0x10>;
 						clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
 						status = "disabled";
 					};
 
-					lpc_snoop: lpc-snoop at 0 {
+					lpc_snoop: lpc-snoop at 10 {
 						compatible = "aspeed,ast2500-lpc-snoop";
-						reg = <0x0 0x80>;
+						reg = <0x10 0x8>;
 						interrupts = <8>;
 						status = "disabled";
 					};
Signature · 1 line
2.20.1
#13 lore raw

PATCH 9/17 ARM: dts: ibm-power9-dual: Add a unit address for OCC nodes

In reply to Andrew Jeffery

These temporarily have a unit address until userspace is fixed up as noted in comments elsewhere in the dtsi.

Fixes the following warning:

arch/arm/boot/dts/ibm-power9-dual.dtsi:89.18-91.6: Warning (unit_address_vs_reg): /gpio-fsi/cfam at 0,0/sbefifo at 2400/occ: node has a reg or ranges property, but no unit name arch/arm/boot/dts/ibm-power9-dual.dtsi:190.18-192.6: Warning (unit_address_vs_reg): /gpio-fsi/cfam at 0,0/hub at 3400/cfam at 1,0/sbefifo at 2400/occ: node has a reg or ranges property, but no unit name

---
 arch/arm/boot/dts/ibm-power9-dual.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/ibm-power9-dual.dtsi +2 -2
index 2abc42eda7b0..a0fa65b44b0f 100644
@@ -86,7 +86,7 @@
 			#address-cells = <1>;
 			#size-cells = <0>;
 
-			fsi_occ0: occ {
+			fsi_occ0: occ at 1 {
 				compatible = "ibm,p9-occ";
 			};
 		};
@@ -187,7 +187,7 @@
 			#address-cells = <1>;
 			#size-cells = <0>;
 
-			fsi_occ1: occ {
+			fsi_occ1: occ at 2 {
 				compatible = "ibm,p9-occ";
 			};
 		};
Signature · 1 line
2.20.1
#14 lore raw

RFC PATCH 10/17 dt-bindings: pinctrl: aspeed: Add reg property as a hint

In reply to Andrew Jeffery

The pinctrl node sits under a syscon device, and can assume offsets from the base of the syscon based on the compatible. However, for devicetree correctness allow a reg property to be specified, which an associated driver may choose to use to discover associated resources.

Cc Linus Walleij <[email protected]>
Cc linux-gpio at vger.kernel.org
---
 .../devicetree/bindings/pinctrl/aspeed,ast2400-pinctrl.yaml    | 3 +++
 .../devicetree/bindings/pinctrl/aspeed,ast2500-pinctrl.yaml    | 3 +++
 2 files changed, 6 insertions(+)
Documentation/devicetree/bindings/pinctrl/aspeed,ast2400-pinctrl.yaml +3 -0
index 125599a2dc5e..629a55c167ae 100644
@@ -25,6 +25,9 @@ properties:
     enum:
       - aspeed,ast2400-pinctrl
       - aspeed,g4-pinctrl
+  reg:
+    description: |
+      A hint for the memory regions associated with the pin-controller
 
 patternProperties:
   '^.*$':
Documentation/devicetree/bindings/pinctrl/aspeed,ast2500-pinctrl.yaml +3 -0
index 3e6d85318577..2e8971e23a02 100644
@@ -25,6 +25,9 @@ properties:
     enum:
       - aspeed,ast2500-pinctrl
       - aspeed,g5-pinctrl
+  reg:
+    description: |
+      A hint for the memory regions associated with the pin-controller
   aspeed,external-nodes:
     minItems: 2
     maxItems: 2
Signature · 1 line
2.20.1
#15 lore raw

RFC PATCH 11/17 dt-bindings: misc: Document reg for aspeed,p2a-ctrl nodes

In reply to Andrew Jeffery

The P2A controller node sits under a syscon device, and can assume offsets from the base of the syscon based on the compatible. However, for devicetree correctness allow a reg property to be specified, which an associated driver may choose to use to discover associated resources.

Cc Patrick Venture <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 Documentation/devicetree/bindings/misc/aspeed-p2a-ctrl.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/misc/aspeed-p2a-ctrl.txt +1 -0
index 854bd67ffec6..091d1c5ec58f 100644
@@ -18,6 +18,7 @@ Required properties:
 Optional properties:
 ===================
 
+- reg: A hint for the memory regions associated with the P2A controller
 - memory-region: A phandle to a reserved_memory region to be used for the PCI
 		to AHB mapping
 
Signature · 1 line
2.20.1
#16 lore raw

RFC PATCH 12/17 ARM: dts: aspeed: Add reg hints to syscon children

In reply to Andrew Jeffery

Fixes the following warnings:

arch/arm/boot/dts/aspeed-g5.dtsi:209.28-226.6: Warning (avoid_unnecessary_addr_size): /ahb/apb/syscon at 1e6e2000: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property arch/arm/boot/dts/aspeed-g4.dtsi:156.28-172.6: Warning (avoid_unnecessary_addr_size): /ahb/apb/syscon at 1e6e2000: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

---
 arch/arm/boot/dts/aspeed-g4.dtsi | 15 +++++++++------
 arch/arm/boot/dts/aspeed-g5.dtsi | 17 ++++++++++-------
 2 files changed, 19 insertions(+), 13 deletions(-)
arch/arm/boot/dts/aspeed-g4.dtsi +9 -6
index ed78020f6269..1515b56a1487 100644
@@ -157,18 +157,21 @@
 				compatible = "aspeed,ast2400-scu", "syscon", "simple-mfd";
 				reg = <0x1e6e2000 0x1a8>;
 				#address-cells = <1>;
-				#size-cells = <0>;
+				#size-cells = <1>;
+				ranges = <0 0x1e6e2000 0x1000>;
 				#clock-cells = <1>;
 				#reset-cells = <1>;
 
-				pinctrl: pinctrl {
-					compatible = "aspeed,g4-pinctrl";
-				};
-
-				p2a: p2a-control {
+				p2a: p2a-control at 2c {
+					reg = <0x2c 0x4>;
 					compatible = "aspeed,ast2400-p2a-ctrl";
 					status = "disabled";
 				};
+
+				pinctrl: pinctrl at 80 {
+					reg = <0x80 0x18>, <0xa0 0x10>;
+					compatible = "aspeed,g4-pinctrl";
+				};
 			};
 
 			rng: hwrng at 1e6e2078 {
arch/arm/boot/dts/aspeed-g5.dtsi +10 -7
index a8a593dd2240..92c659c50b4c 100644
@@ -210,19 +210,22 @@
 				compatible = "aspeed,ast2500-scu", "syscon", "simple-mfd";
 				reg = <0x1e6e2000 0x1a8>;
 				#address-cells = <1>;
-				#size-cells = <0>;
+				#size-cells = <1>;
+				ranges = <0 0x1e6e2000 0x1000>;
 				#clock-cells = <1>;
 				#reset-cells = <1>;
 
-				pinctrl: pinctrl {
-					compatible = "aspeed,g5-pinctrl";
-					aspeed,external-nodes = <&gfx>, <&lhc>;
-				};
-
-				p2a: p2a-control {
+				p2a: p2a-control at 2c {
 					compatible = "aspeed,ast2500-p2a-ctrl";
+					reg = <0x2c 0x4>;
 					status = "disabled";
 				};
+
+				pinctrl: pinctrl at 80 {
+					compatible = "aspeed,g5-pinctrl";
+					reg = <0x80 0x18>, <0xa0 0x10>;
+					aspeed,external-nodes = <&gfx>, <&lhc>;
+				};
 			};
 
 			rng: hwrng at 1e6e2078 {
Signature · 1 line
2.20.1
#17 lore raw

RFC PATCH 13/17 dt-bindings: ipmi: aspeed: Introduce a v2 binding for KCS

In reply to Andrew Jeffery

The v2 binding utilises reg and renames some of the v1 properties.

Cc Haiyue Wang <[email protected]>
Cc Corey Minyard <[email protected]>
Cc openipmi-developer at lists.sourceforge.net
---
 .../bindings/ipmi/aspeed-kcs-bmc.txt          | 20 +++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/ipmi/aspeed-kcs-bmc.txt +14 -6
index d98a9bf45d6c..76b180ebbde4 100644
@@ -1,9 +1,10 @@
-* Aspeed KCS (Keyboard Controller Style) IPMI interface
+# Aspeed KCS (Keyboard Controller Style) IPMI interface
 
 The Aspeed SOCs (AST2400 and AST2500) are commonly used as BMCs
 (Baseboard Management Controllers) and the KCS interface can be
 used to perform in-band IPMI communication with their host.
 
+## v1
 Required properties:
 - compatible : should be one of
     "aspeed,ast2400-kcs-bmc"
@@ -12,14 +13,21 @@ Required properties:
 - kcs_chan : The LPC channel number in the controller
 - kcs_addr : The host CPU IO map address
 
+## v2
+Required properties:
+- compatible : should be one of
+    "aspeed,ast2400-kcs-bmc-v2"
+    "aspeed,ast2500-kcs-bmc-v2"
+- reg : The address and size of the IDR, ODR and STR registers
+- interrupts : interrupt generated by the controller
+- slave-reg : The host CPU IO map address
 
 Example:
 
-    kcs3: kcs3 at 0 {
-        compatible = "aspeed,ast2500-kcs-bmc";
-        reg = <0x0 0x80>;
+    kcs3: kcs at 24 {
+        compatible = "aspeed,ast2500-kcs-bmc-v2";
+        reg = <0x24 0x1>, <0x30 0x1>, <0x3c 0x1>;
         interrupts = <8>;
-        kcs_chan = <3>;
-        kcs_addr = <0xCA2>;
+        slave-reg = <0xca2>;
         status = "okay";
     };
Signature · 1 line
2.20.1
#18 lore raw

RFC PATCH 14/17 ipmi: kcs: Finish configuring ASPEED KCS device before enable

In reply to Andrew Jeffery

The currently interrupts are configured after the channel was enabled.

Cc Haiyue Wang <[email protected]>
Cc Corey Minyard <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc openipmi-developer at lists.sourceforge.net
---
 drivers/char/ipmi/kcs_bmc_aspeed.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/char/ipmi/kcs_bmc_aspeed.c +4 -3
index 3c955946e647..e3dd09022589 100644
@@ -268,13 +268,14 @@ static int aspeed_kcs_probe(struct platform_device *pdev)
 	kcs_bmc->io_inputb = aspeed_kcs_inb;
 	kcs_bmc->io_outputb = aspeed_kcs_outb;
 
+	rc = aspeed_kcs_config_irq(kcs_bmc, pdev);
+	if (rc)
+		return rc;
+
 	dev_set_drvdata(dev, kcs_bmc);
 
 	aspeed_kcs_set_address(kcs_bmc, addr);
 	aspeed_kcs_enable_channel(kcs_bmc, true);
-	rc = aspeed_kcs_config_irq(kcs_bmc, pdev);
-	if (rc)
-		return rc;
 
 	rc = misc_register(&kcs_bmc->miscdev);
 	if (rc) {
Signature · 1 line
2.20.1
#19 lore raw

Re: [RFC PATCH 14/17] ipmi: kcs: Finish configuring ASPEED KCS device before enable

? 2019-07-26 13:39, Andrew Jeffery ??:

Quoted 17 lines

The currently interrupts are configured after the channel was enabled.

Cc Haiyue Wang<[email protected]>
Cc Corey Minyard<[email protected]>
Cc Arnd Bergmann<[email protected]>
Cc Greg Kroah-Hartman<[email protected]>
Cc openipmi-developer at lists.sourceforge.net
---
  drivers/char/ipmi/kcs_bmc_aspeed.c | 7 ++++---
  1 file changed, 4 insertions(+), 3 deletions(-)
drivers/char/ipmi/kcs_bmc_aspeed.c +0 -0
index 3c955946e647..e3dd09022589 100644

drivers/char/ipmi/kcs_bmc_aspeed.c static int aspeed_kcs_probe(struct platform_device *pdev) · line 275

Quoted 8 lines
drivers/char/ipmi/kcs_bmc_aspeed.c +4 -0
@@ -268,13 +268,14 @@ static int aspeed_kcs_probe(struct platform_device *pdev)
  	kcs_bmc->io_inputb = aspeed_kcs_inb;
  	kcs_bmc->io_outputb = aspeed_kcs_outb;
 
+	rc = aspeed_kcs_config_irq(kcs_bmc, pdev);
+	if (rc)
+		return rc;
+
  	dev_set_drvdata(dev, kcs_bmc);

Thanks for catching this, for not miss the data.

Reviewed-by
#20 lore raw

Re: [RFC PATCH 14/17] ipmi: kcs: Finish configuring ASPEED KCS device before enable

? 2019-07-27 01:04, Wang, Haiyue ??:

Quoted 22 lines

? 2019-07-26 13:39, Andrew Jeffery ??:

Quoted 21 lines

The currently interrupts are configured after the channel was enabled.

Cc Haiyue Wang<[email protected]>
Cc Corey Minyard<[email protected]>
Cc Arnd Bergmann<[email protected]>
Cc Greg Kroah-Hartman<[email protected]>
Cc openipmi-developer at lists.sourceforge.net

---
? drivers/char/ipmi/kcs_bmc_aspeed.c | 7 ++++---
? 1 file changed, 4 insertions(+), 3 deletions(-)

drivers/char/ipmi/kcs_bmc_aspeed.c +0 -0
index 3c955946e647..e3dd09022589 100644
@@ -268,13 +268,14 @@ static int aspeed_kcs_probe(struct 
 platform_device *pdev)
 ????? kcs_bmc->io_inputb = aspeed_kcs_inb;
 ????? kcs_bmc->io_outputb = aspeed_kcs_outb;
Quoted 9 lines

drivers/char/ipmi/kcs_bmc_aspeed.c static int aspeed_kcs_probe(struct · line 275

Quoted 5 lines
drivers/char/ipmi/kcs_bmc_aspeed.c +3 -0
 ? +??? rc = aspeed_kcs_config_irq(kcs_bmc, pdev);
+??? if (rc)
+??????? return rc;
+
 ????? dev_set_drvdata(dev, kcs_bmc);

Thanks for catching this, for not miss the data.

#21 lore raw

RFC PATCH 15/17 ipmi: kcs: aspeed: Implement v2 bindings

In reply to Andrew Jeffery

The v2 bindings allow us to extract the resources from the devicetree. The table in the driver is retained to derive the channel index, which removes the need for kcs_chan property from the v1 bindings. The v2 bindings allow us to reduce the number of warnings generated by the existing devicetree nodes.

Cc Haiyue Wang <[email protected]>
Cc Corey Minyard <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc openipmi-developer at lists.sourceforge.net
---
 drivers/char/ipmi/kcs_bmc_aspeed.c | 156 +++++++++++++++++++++++------
 1 file changed, 127 insertions(+), 29 deletions(-)
drivers/char/ipmi/kcs_bmc_aspeed.c +127 -29
index e3dd09022589..509e0d3c6eb1 100644
@@ -12,6 +12,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/platform_device.h>
 #include <linux/poll.h>
 #include <linux/regmap.h>
@@ -233,38 +234,133 @@ static const struct kcs_ioreg ast_kcs_bmc_ioregs[KCS_CHANNEL_MAX] = {
 	{ .idr = LPC_IDR4, .odr = LPC_ODR4, .str = LPC_STR4 },
 };
 
+static struct kcs_bmc *aspeed_kcs_probe_of_v1(struct platform_device *pdev)
+{
+	struct aspeed_kcs_bmc *priv;
+	struct device_node *np;
+	struct kcs_bmc *kcs;
+	u32 channel;
+	u32 slave;
+	int rc;
+
+	np = pdev->dev.of_node;
+
+	rc = of_property_read_u32(np, "kcs_chan", &channel);
+	if ((rc != 0) || (channel == 0 || channel > KCS_CHANNEL_MAX)) {
+		dev_err(&pdev->dev, "no valid 'kcs_chan' configured\n");
+		return ERR_PTR(-EINVAL);
+	}
+
+	kcs = kcs_bmc_alloc(&pdev->dev, sizeof(struct aspeed_kcs_bmc), channel);
+	if (!kcs)
+		return ERR_PTR(-ENOMEM);
+
+	priv = kcs_bmc_priv(kcs);
+	priv->map = syscon_node_to_regmap(pdev->dev.parent->of_node);
+	if (IS_ERR(priv->map)) {
+		dev_err(&pdev->dev, "Couldn't get regmap\n");
+		return ERR_PTR(-ENODEV);
+	}
+
+	rc = of_property_read_u32(np, "kcs_addr", &slave);
+	if (rc) {
+		dev_err(&pdev->dev, "no valid 'kcs_addr' configured\n");
+		return ERR_PTR(-EINVAL);
+	}
+
+	kcs->ioreg = ast_kcs_bmc_ioregs[channel - 1];
+	aspeed_kcs_set_address(kcs, slave);
+
+	return 0;
+}
+
+static int aspeed_kcs_calculate_channel(const struct kcs_ioreg *regs)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(ast_kcs_bmc_ioregs); i++) {
+		if (!memcmp(&ast_kcs_bmc_ioregs[i], regs, sizeof(*regs)))
+			return i + 1;
+	}
+
+	return -EINVAL;
+}
+
+static struct kcs_bmc *aspeed_kcs_probe_of_v2(struct platform_device *pdev)
+{
+	struct aspeed_kcs_bmc *priv;
+	struct device_node *np;
+	struct kcs_ioreg ioreg;
+	struct kcs_bmc *kcs;
+	const __be32 *reg;
+	int channel;
+	u32 slave;
+	int rc;
+
+	np = pdev->dev.of_node;
+
+	/* Don't translate addresses, we want offsets for the regmaps */
+	reg = of_get_address(np, 0, NULL, NULL);
+	if (!reg)
+		return ERR_PTR(-EINVAL);
+	ioreg.idr = be32_to_cpup(reg);
+
+	reg = of_get_address(np, 1, NULL, NULL);
+	if (!reg)
+		return ERR_PTR(-EINVAL);
+	ioreg.odr = be32_to_cpup(reg);
+
+	reg = of_get_address(np, 2, NULL, NULL);
+	if (!reg)
+		return ERR_PTR(-EINVAL);
+	ioreg.str = be32_to_cpup(reg);
+
+	channel = aspeed_kcs_calculate_channel(&ioreg);
+	if (channel < 0)
+		return ERR_PTR(channel);
+
+	kcs = kcs_bmc_alloc(&pdev->dev, sizeof(struct aspeed_kcs_bmc), channel);
+	if (!kcs)
+		return ERR_PTR(-ENOMEM);
+
+	kcs->ioreg = ioreg;
+
+	priv = kcs_bmc_priv(kcs);
+	priv->map = syscon_node_to_regmap(pdev->dev.parent->of_node);
+	if (IS_ERR(priv->map)) {
+		dev_err(&pdev->dev, "Couldn't get regmap\n");
+		return ERR_PTR(-ENODEV);
+	}
+
+	rc = of_property_read_u32(np, "slave-reg", &slave);
+	if (rc)
+		return ERR_PTR(rc);
+
+	aspeed_kcs_set_address(kcs, slave);
+
+	return kcs;
+}
+
 static int aspeed_kcs_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct aspeed_kcs_bmc *priv;
 	struct kcs_bmc *kcs_bmc;
-	u32 chan, addr;
+	struct device_node *np;
 	int rc;
 
-	rc = of_property_read_u32(dev->of_node, "kcs_chan", &chan);
-	if ((rc != 0) || (chan == 0 || chan > KCS_CHANNEL_MAX)) {
-		dev_err(dev, "no valid 'kcs_chan' configured\n");
-		return -ENODEV;
-	}
+	np = pdev->dev.of_node;
+	if (of_device_is_compatible(np, "aspeed,ast2400-kcs-bmc") ||
+			of_device_is_compatible(np, "aspeed,ast2500-kcs-bmc"))
+		kcs_bmc = aspeed_kcs_probe_of_v1(pdev);
+	else if (of_device_is_compatible(np, "aspeed,ast2400-kcs-bmc-v2") ||
+			of_device_is_compatible(np, "aspeed,ast2500-kcs-bmc-v2"))
+		kcs_bmc = aspeed_kcs_probe_of_v2(pdev);
+	else
+		return -EINVAL;
+
+	if (IS_ERR(kcs_bmc))
+		return PTR_ERR(kcs_bmc);
 
-	rc = of_property_read_u32(dev->of_node, "kcs_addr", &addr);
-	if (rc) {
-		dev_err(dev, "no valid 'kcs_addr' configured\n");
-		return -ENODEV;
-	}
-
-	kcs_bmc = kcs_bmc_alloc(dev, sizeof(*priv), chan);
-	if (!kcs_bmc)
-		return -ENOMEM;
-
-	priv = kcs_bmc_priv(kcs_bmc);
-	priv->map = syscon_node_to_regmap(dev->parent->of_node);
-	if (IS_ERR(priv->map)) {
-		dev_err(dev, "Couldn't get regmap\n");
-		return -ENODEV;
-	}
-
-	kcs_bmc->ioreg = ast_kcs_bmc_ioregs[chan - 1];
 	kcs_bmc->io_inputb = aspeed_kcs_inb;
 	kcs_bmc->io_outputb = aspeed_kcs_outb;
 
@@ -274,7 +370,6 @@ static int aspeed_kcs_probe(struct platform_device *pdev)
 
 	dev_set_drvdata(dev, kcs_bmc);
 
-	aspeed_kcs_set_address(kcs_bmc, addr);
 	aspeed_kcs_enable_channel(kcs_bmc, true);
 
 	rc = misc_register(&kcs_bmc->miscdev);
@@ -283,9 +378,10 @@ static int aspeed_kcs_probe(struct platform_device *pdev)
 		return rc;
 	}
 
-	pr_info("channel=%u addr=0x%x idr=0x%x odr=0x%x str=0x%x\n",
-		chan, addr,
-		kcs_bmc->ioreg.idr, kcs_bmc->ioreg.odr, kcs_bmc->ioreg.str);
+	dev_dbg(&pdev->dev,
+		"Probed KCS device %d (IDR=0x%x, ODR=0x%x, STR=0x%x)\n",
+		kcs_bmc->channel, kcs_bmc->ioreg.idr, kcs_bmc->ioreg.odr,
+		kcs_bmc->ioreg.str);
 
 	return 0;
 }
@@ -302,6 +398,8 @@ static int aspeed_kcs_remove(struct platform_device *pdev)
 static const struct of_device_id ast_kcs_bmc_match[] = {
 	{ .compatible = "aspeed,ast2400-kcs-bmc" },
 	{ .compatible = "aspeed,ast2500-kcs-bmc" },
+	{ .compatible = "aspeed,ast2400-kcs-bmc-v2" },
+	{ .compatible = "aspeed,ast2500-kcs-bmc-v2" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, ast_kcs_bmc_match);
Signature · 1 line
2.20.1
Reviewed-by on v1 15/17
#22 lore raw

Re: [RFC PATCH 15/17] ipmi: kcs: aspeed: Implement v2 bindings

? 2019-07-26 13:39, Andrew Jeffery ??:

Quoted 12 lines

The v2 bindings allow us to extract the resources from the devicetree. The table in the driver is retained to derive the channel index, which removes the need for kcs_chan property from the v1 bindings. The v2 bindings allow us to reduce the number of warnings generated by the existing devicetree nodes.

Cc Haiyue Wang<[email protected]>
Cc Corey Minyard<[email protected]>
Cc Arnd Bergmann<[email protected]>
Cc Greg Kroah-Hartman<[email protected]>
Cc openipmi-developer at lists.sourceforge.net
Quoted 3 lines
---
  drivers/char/ipmi/kcs_bmc_aspeed.c | 156 +++++++++++++++++++++++------
  1 file changed, 127 insertions(+), 29 deletions(-)

Looks good, thanks for the hard work, the code is more clean! :)

#23 lore raw

RFC PATCH 16/17 ARM: dts: aspeed-g5: Change KCS nodes to v2 binding

In reply to Andrew Jeffery

Fixes the following warnings:

    arch/arm/boot/dts/aspeed-g5.dtsi:376.19-381.8: Warning (unit_address_vs_reg): /ahb/apb/lpc at 1e789000/lpc-bmc at 0/kcs1 at 0: node has a unit name, but no reg property
    arch/arm/boot/dts/aspeed-g5.dtsi:382.19-387.8: Warning (unit_address_vs_reg): /ahb/apb/lpc at 1e789000/lpc-bmc at 0/kcs2 at 0: node has a unit name, but no reg property
    arch/arm/boot/dts/aspeed-g5.dtsi:388.19-393.8: Warning (unit_address_vs_reg): /ahb/apb/lpc at 1e789000/lpc-bmc at 0/kcs3 at 0: node has a unit name, but no reg property
    arch/arm/boot/dts/aspeed-g5.dtsi:405.19-410.8: Warning (unit_address_vs_reg): /ahb/apb/lpc at 1e789000/lpc-host at 80/kcs4 at 0: node has a unit name, but no reg property
    arch/arm/boot/dts/aspeed-g5.dtsi:376.19-381.8: Warning (unique_unit_address): /ahb/apb/lpc at 1e789000/lpc-bmc at 0/kcs1 at 0: duplicate unit-address (also used in node /ahb/apb/lpc at 1e789000/lpc-bmc at 0/kcs2 at 0)
    arch/arm/boot/dts/aspeed-g5.dtsi:376.19-381.8: Warning (unique_unit_address): /ahb/apb/lpc at 1e789000/lpc-bmc at 0/kcs1 at 0: duplicate unit-address (also used in node /ahb/apb/lpc at 1e789000/lpc-bmc at 0/kcs3 at 0)
    arch/arm/boot/dts/aspeed-g5.dtsi:382.19-387.8: Warning (unique_unit_address): /ahb/apb/lpc at 1e789000/lpc-bmc at 0/kcs2 at 0: duplicate unit-address (also used in node /ahb/apb/lpc at 1e789000/lpc-bmc at 0/kcs3 at 0)
    arch/arm/boot/dts/aspeed-g5.dtsi:405.19-410.8: Warning (unique_unit_address): /ahb/apb/lpc at 1e789000/lpc-host at 80/kcs4 at 0: duplicate unit-address (also used in node /ahb/apb/lpc at 1e789000/lpc-host at 80/lpc-ctrl at 0)
---
 arch/arm/boot/dts/aspeed-g5.dtsi | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
arch/arm/boot/dts/aspeed-g5.dtsi +12 -12
index 92c659c50b4c..50ba58dc5093 100644
@@ -373,22 +373,22 @@
 					#size-cells = <1>;
 					ranges = <0x0 0x0 0x80>;
 
-					kcs1: kcs1 at 0 {
-						compatible = "aspeed,ast2500-kcs-bmc";
+					kcs1: kcs at 24 {
+						compatible = "aspeed,ast2500-kcs-bmc-v2";
+						reg = <0x24 0x1>, <0x30 0x1>, <0x3c 0x1>;
 						interrupts = <8>;
-						kcs_chan = <1>;
 						status = "disabled";
 					};
-					kcs2: kcs2 at 0 {
-						compatible = "aspeed,ast2500-kcs-bmc";
+					kcs2: kcs at 28 {
+						compatible = "aspeed,ast2500-kcs-bmc-v2";
+						reg = <0x28 0x1>, <0x34 0x1>, <0x40 0x1>;
 						interrupts = <8>;
-						kcs_chan = <2>;
 						status = "disabled";
 					};
-					kcs3: kcs3 at 0 {
-						compatible = "aspeed,ast2500-kcs-bmc";
+					kcs3: kcs at 2c {
+						compatible = "aspeed,ast2500-kcs-bmc-v2";
+						reg = <0x2c 0x1>, <0x38 0x1>, <0x44 0x1>;
 						interrupts = <8>;
-						kcs_chan = <3>;
 						status = "disabled";
 					};
 				};
@@ -402,10 +402,10 @@
 					#size-cells = <1>;
 					ranges = <0x0 0x80 0x1e0>;
 
-					kcs4: kcs4 at 0 {
-						compatible = "aspeed,ast2500-kcs-bmc";
+					kcs4: kcs at 94 {
+						compatible = "aspeed,ast2500-kcs-bmc-v2";
+						reg = <0x94 0x1>, <0x98 0x1>, <0x9c 0x1>;
 						interrupts = <8>;
-						kcs_chan = <4>;
 						status = "disabled";
 					};
 
Signature · 1 line
2.20.1
#24 lore raw

RFC PATCH 17/17 ARM: dts: aspeed-g5: Sort LPC child nodes by unit address

In reply to Andrew Jeffery

Lets try to maintain some sort of sanity.

---
 arch/arm/boot/dts/aspeed-g5.dtsi | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
arch/arm/boot/dts/aspeed-g5.dtsi +6 -5
index 50ba58dc5093..99d2995a43db 100644
@@ -423,17 +423,18 @@
 						status = "disabled";
 					};
 
-					lhc: lhc at 20 {
-						compatible = "aspeed,ast2500-lhc";
-						reg = <0x20 0x24 0x48 0x8>;
-					};
-
 					lpc_reset: reset-controller at 18 {
 						compatible = "aspeed,ast2500-lpc-reset";
 						reg = <0x18 0x4>;
 						#reset-cells = <1>;
 					};
 
+					lhc: lhc at 20 {
+						compatible = "aspeed,ast2500-lhc";
+						reg = <0x20 0x24 0x48 0x8>;
+					};
+
+
 					ibt: ibt at c0 {
 						compatible = "aspeed,ast2500-ibt-bmc";
 						reg = <0xc0 0x18>;
Signature · 1 line
2.20.1
#26 lore raw
Quoted 7 lines · Linus Walleij
Quoted 2 lines · Andrew Jeffery

The aim of this series is to minimise/eliminate all the warnings from the ASPEED devicetrees. It mostly achieves its goal, as outlined below.

I suppose it will all be merged in the Aspeed tree?

Yeah, if you're happy for that. Thanks.

Andrew

#27 lore raw
In reply to Andrew Jeffery
Quoted 67 lines · Andrew Jeffery

Hello,

The aim of this series is to minimise/eliminate all the warnings from the ASPEED devicetrees. It mostly achieves its goal, as outlined below.

Using aspeed_g5_defconfig we started with the follow warning count:

    $ make dtbs 2>&1 >/dev/null | wc -l
    218

and after the full series is applied we have:

    $ make dtbs 2>&1 >/dev/null | wc -l
    2

for a 100x reduction.

Getting there though isn't without some potential controversy, which I've saved for the last half of the series. The following patches I think are in pretty good shape:

ARM: dts: aspeed-g5: Move EDAC node to APB
ARM: dts: aspeed-g5: Use recommended generic node name for SDMC
ARM: dts: aspeed-g5: Fix aspeed,external-nodes description
ARM: dts: vesnin: Add unit address for memory node
ARM: dts: fp5280g2: Cleanup gpio-keys-polled properties
ARM: dts: swift: Cleanup gpio-keys-polled properties
ARM: dts: witherspoon: Cleanup gpio-keys-polled properties
ARM: dts: aspeed: Cleanup lpc-ctrl and snoop regs
ARM: dts: ibm-power9-dual: Add a unit address for OCC nodes

With these patches applied we get to:

    $ make dtbs 2>&1 >/dev/null | wc -l
    144

So they make a dent, but fail to clean up the bulk of the issues. From here I've mixed in some binding and driver changes with subsequent updates to the devicetrees:

dt-bindings: pinctrl: aspeed: Add reg property as a hint
dt-bindings: misc: Document reg for aspeed,p2a-ctrl nodes
ARM: dts: aspeed: Add reg hints to syscon children
dt-bindings: ipmi: aspeed: Introduce a v2 binding for KCS
ipmi: kcs: Finish configuring ASPEED KCS device before enable
ipmi: kcs: aspeed: Implement v2 bindings
ARM: dts: aspeed-g5: Change KCS nodes to v2 binding
ARM: dts: aspeed-g5: Sort LPC child nodes by unit address

By dt-bindings: ipmi: aspeed: Introduce a v2 binding for KCS the warnings are reduced to:

    $ make dtbs 2>&1 >/dev/null | wc -l
    125

The bang-for-buck is in fixing up the KCS bindings which removes all-but-two of the remaining warnings (which we can't feasibly remove), but doing so forces code changes (which I'd avoided up until this point).

Reflecting broadly on the fixes, I think I've made a mistake way back by using syscon/simple-mfds to expose the innards of the SCU and LPC controllers in the devicetree. This series cleans up what's currently there, but I have half a mind to rev the SCU and LPC bindings to not use simple-mfd and instead have a driver implementation that uses platform_device_register_full() or similar to deal with the mess.

Quoted 2 lines

Rob - I'm looking for your thoughts here and on the series, I've never felt entirely comfortable with what I cooked up. Your advice would be appreciated.

The series generally looks fine to me from a quick scan. As far as dropping 'simple-mfd', having less fine grained description in DT is generally my preference. It comes down to whether what you have defined is maintainable. As most of it is just additions, I think what you have is fine. Maybe keep all this in mind for the next chip depending how the SCU and LPC change.

Rob

#28 lore raw
Quoted 71 lines · Rob Herring
Quoted 67 lines · Andrew Jeffery

Hello,

The aim of this series is to minimise/eliminate all the warnings from the ASPEED devicetrees. It mostly achieves its goal, as outlined below.

Using aspeed_g5_defconfig we started with the follow warning count:

    $ make dtbs 2>&1 >/dev/null | wc -l
    218

and after the full series is applied we have:

    $ make dtbs 2>&1 >/dev/null | wc -l
    2

for a 100x reduction.

Getting there though isn't without some potential controversy, which I've saved for the last half of the series. The following patches I think are in pretty good shape:

ARM: dts: aspeed-g5: Move EDAC node to APB
ARM: dts: aspeed-g5: Use recommended generic node name for SDMC
ARM: dts: aspeed-g5: Fix aspeed,external-nodes description
ARM: dts: vesnin: Add unit address for memory node
ARM: dts: fp5280g2: Cleanup gpio-keys-polled properties
ARM: dts: swift: Cleanup gpio-keys-polled properties
ARM: dts: witherspoon: Cleanup gpio-keys-polled properties
ARM: dts: aspeed: Cleanup lpc-ctrl and snoop regs
ARM: dts: ibm-power9-dual: Add a unit address for OCC nodes

With these patches applied we get to:

    $ make dtbs 2>&1 >/dev/null | wc -l
    144

So they make a dent, but fail to clean up the bulk of the issues. From here I've mixed in some binding and driver changes with subsequent updates to the devicetrees:

dt-bindings: pinctrl: aspeed: Add reg property as a hint
dt-bindings: misc: Document reg for aspeed,p2a-ctrl nodes
ARM: dts: aspeed: Add reg hints to syscon children
dt-bindings: ipmi: aspeed: Introduce a v2 binding for KCS
ipmi: kcs: Finish configuring ASPEED KCS device before enable
ipmi: kcs: aspeed: Implement v2 bindings
ARM: dts: aspeed-g5: Change KCS nodes to v2 binding
ARM: dts: aspeed-g5: Sort LPC child nodes by unit address

By dt-bindings: ipmi: aspeed: Introduce a v2 binding for KCS the warnings are reduced to:

    $ make dtbs 2>&1 >/dev/null | wc -l
    125

The bang-for-buck is in fixing up the KCS bindings which removes all-but-two of the remaining warnings (which we can't feasibly remove), but doing so forces code changes (which I'd avoided up until this point).

Reflecting broadly on the fixes, I think I've made a mistake way back by using syscon/simple-mfds to expose the innards of the SCU and LPC controllers in the devicetree. This series cleans up what's currently there, but I have half a mind to rev the SCU and LPC bindings to not use simple-mfd and instead have a driver implementation that uses platform_device_register_full() or similar to deal with the mess.

Quoted 2 lines

Rob - I'm looking for your thoughts here and on the series, I've never felt entirely comfortable with what I cooked up. Your advice would be appreciated.

Quoted 6 lines

The series generally looks fine to me from a quick scan. As far as dropping 'simple-mfd', having less fine grained description in DT is generally my preference. It comes down to whether what you have defined is maintainable. As most of it is just additions, I think what you have is fine. Maybe keep all this in mind for the next chip depending how the SCU and LPC change.

Okay, I think the timing of that suggestion is good given where things are with the AST2600. I'll keep that in mind.

Consensus so far seems to be that the series is fine. I'll split it up and send out the sub-series to the relevant lists with the acks accumulated here.

Thanks all for taking a look.

Andrew

maintainer Reviewed-by
#29 lore raw
Quoted 21 lines · Andrew Jeffery
Quoted 14 lines
Quoted 11 lines

The bang-for-buck is in fixing up the KCS bindings which removes all-but-two of the remaining warnings (which we can't feasibly remove), but doing so forces code changes (which I'd avoided up until this point).

Reflecting broadly on the fixes, I think I've made a mistake way back by using syscon/simple-mfds to expose the innards of the SCU and LPC controllers in the devicetree. This series cleans up what's currently there, but I have half a mind to rev the SCU and LPC bindings to not use simple-mfd and instead have a driver implementation that uses platform_device_register_full() or similar to deal with the mess.

Quoted 2 lines

Rob - I'm looking for your thoughts here and on the series, I've never felt entirely comfortable with what I cooked up. Your advice would be appreciated.

Quoted 6 lines

The series generally looks fine to me from a quick scan. As far as dropping 'simple-mfd', having less fine grained description in DT is generally my preference. It comes down to whether what you have defined is maintainable. As most of it is just additions, I think what you have is fine. Maybe keep all this in mind for the next chip depending how the SCU and LPC change.

Quoted 5 lines

Okay, I think the timing of that suggestion is good given where things are with the AST2600. I'll keep that in mind.

Consensus so far seems to be that the series is fine. I'll split it up and send out the sub-series to the relevant lists with the acks accumulated here.

The series look good. I suggest posting the KCS bindings and driver changes as their own series to go through the IPMI tree.

Please add my tag to all the patches except the OCC one, which I need to do some investigation in to.

The others can go via the aspeed tree. Perhaps post them as their own series too so I don't get confused and apply the wrong ones. That way if Rob wants to send his reviewed-by he can.

Cheers,

Joel

#30 lore raw
Quoted 23 lines · Joel Stanley
Quoted 21 lines · Andrew Jeffery
Quoted 20 lines
Quoted 11 lines

The bang-for-buck is in fixing up the KCS bindings which removes all-but-two of the remaining warnings (which we can't feasibly remove), but doing so forces code changes (which I'd avoided up until this point).

Reflecting broadly on the fixes, I think I've made a mistake way back by using syscon/simple-mfds to expose the innards of the SCU and LPC controllers in the devicetree. This series cleans up what's currently there, but I have half a mind to rev the SCU and LPC bindings to not use simple-mfd and instead have a driver implementation that uses platform_device_register_full() or similar to deal with the mess.

Quoted 2 lines

Rob - I'm looking for your thoughts here and on the series, I've never felt entirely comfortable with what I cooked up. Your advice would be appreciated.

The series generally looks fine to me from a quick scan. As far as dropping 'simple-mfd', having less fine grained description in DT is generally my preference. It comes down to whether what you have defined is maintainable. As most of it is just additions, I think what you have is fine. Maybe keep all this in mind for the next chip depending how the SCU and LPC change.

Quoted 8 lines
Quoted 5 lines

Okay, I think the timing of that suggestion is good given where things are with the AST2600. I'll keep that in mind.

Consensus so far seems to be that the series is fine. I'll split it up and send out the sub-series to the relevant lists with the acks accumulated here.

The series look good. I suggest posting the KCS bindings and driver changes as their own series to go through the IPMI tree.

Yeah, that was the plan.

Quoted 5 lines

Please add my tag to all the patches except the OCC one, which I need to do some investigation in to.

Thanks, will do.

Quoted 4 lines

The others can go via the aspeed tree. Perhaps post them as their own series too so I don't get confused and apply the wrong ones. That way if Rob wants to send his reviewed-by he can.

SGTM.

Cheers,

Andrew