Skip to contentSkip to conversation

PolarFire SoC dt for 5.19

PATCH Superseded Conor Dooley 4 participants 19 messages May 1, 2022 – May 4, 2022

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover PolarFire SoC dt for 5.19

Hey all,
Got a few PolarFire SoC device tree related changes here for 5.19.

Firstly, patches 1 & 2 of this series supersede [0] & are unchanged compared to that submission, figured it would just be easier to keep all the changes in one series.

As discussed on irc, patch 3 removes the duplicated "microchip" from the device tree files so that they follow a soc-board.dts & a soc{,-fabric}.dtsi format.

Patch 5 makes the fabric dtsi board specific by renaming the file to mpfs-icicle-kit-fabric.dtsi & including it in the dts rather than mpfs.dtsi. Additionally this will allow other boards to define their own reference fabric design. A revision specific compatible, added in patch 4, is added to the dt also.

The remainder of the series adds a bare minimum devicetree for the Sundance Polarberry.

Thanks,
Conor.

Changes since v2:
- make ,icicle-reference compatible with ,mpfs & put it inside the enum

Changes since v1:
- fixed whitespace problems in the polarberry dts
- disabled mac0 for the polarberry as its port is on the optional carrier board

[0] - https://lore.kernel.org/linux-riscv/[email protected]/

Conor Dooley (8):
riscv: dts: microchip: remove icicle memory clocks
riscv: dts: microchip: move sysctrlr out of soc bus
riscv: dts: microchip: remove soc vendor from filenames
dt-bindings: riscv: microchip: document icicle reference design
riscv: dts: microchip: make the fabric dtsi board specific
dt-bindings: vendor-prefixes: add Sundance DSP
dt-bindings: riscv: microchip: add polarberry compatible string
riscv: dts: microchip: add the sundance polarberry

 .../devicetree/bindings/riscv/microchip.yaml  |  3 +
 .../devicetree/bindings/vendor-prefixes.yaml  |  2 +
 arch/riscv/boot/dts/microchip/Makefile        |  3 +-
 ...abric.dtsi => mpfs-icicle-kit-fabric.dtsi} |  2 +
 ...pfs-icicle-kit.dts => mpfs-icicle-kit.dts} |  5 +-
 .../dts/microchip/mpfs-polarberry-fabric.dtsi | 16 ++++
 .../boot/dts/microchip/mpfs-polarberry.dts    | 95 +++++++++++++++++++
 .../{microchip-mpfs.dtsi => mpfs.dtsi}        | 11 +--
 8 files changed, 127 insertions(+), 10 deletions(-)
 rename arch/riscv/boot/dts/microchip/{microchip-mpfs-fabric.dtsi => mpfs-icicle-kit-fabric.dtsi} (91%)
 rename arch/riscv/boot/dts/microchip/{microchip-mpfs-icicle-kit.dts => mpfs-icicle-kit.dts} (95%)
 create mode 100644 arch/riscv/boot/dts/microchip/mpfs-polarberry-fabric.dtsi
 create mode 100644 arch/riscv/boot/dts/microchip/mpfs-polarberry.dts
 rename arch/riscv/boot/dts/microchip/{microchip-mpfs.dtsi => mpfs.dtsi} (98%)

base-commit: a91b05f6b928e8fab750fc953d7df0aa6dc43547

Signature · 1 line
2.36.0
#1 lore raw

PATCH v3 1/8 riscv: dts: microchip: remove icicle memory clocks

From: Conor Dooley <[email protected]>

The clock properties in the icicle kit's memory entries cause dtbs_check
errors:
arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dtb: /: memory@80000000: 'clocks' does not match any of the regexes: 'pinctrl-[0-9]+'

Get rid of the clocks to avoid the errors.

Fixes 0fa6107eca41 ("RISC-V: Initial DTS for Microchip ICICLE board")
Fixes 5b28df37d311 ("riscv: dts: microchip: update peripherals in icicle kit device tree")
---
 arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dts | 2 --
 1 file changed, 2 deletions(-)
arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dts +0 -2
index 3392153dd0f1..c71d6aa6137a 100644
@@ -32,14 +32,12 @@ cpus {
 	ddrc_cache_lo: memory@80000000 {
 		device_type = "memory";
 		reg = <0x0 0x80000000 0x0 0x2e000000>;
-		clocks = <&clkcfg CLK_DDRC>;
 		status = "okay";
 	};
 
 	ddrc_cache_hi: memory@1000000000 {
 		device_type = "memory";
 		reg = <0x10 0x0 0x0 0x40000000>;
-		clocks = <&clkcfg CLK_DDRC>;
 		status = "okay";
 	};
 };
Signature · 1 line
2.36.0
Reviewed-by on v3 1/8
#2 lore raw

Re: [PATCH v3 1/8] riscv: dts: microchip: remove icicle memory clocks

Am Sonntag, 1. Mai 2022, 21:25:52 CEST schrieb Conor Dooley:

Quoted 6 lines

From: Conor Dooley <[email protected]>

The clock properties in the icicle kit's memory entries cause dtbs_check
errors:
arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dtb: /: memory@80000000: 'clocks' does not match any of the regexes: 'pinctrl-[0-9]+'

Quoted 6 lines

Get rid of the clocks to avoid the errors.

Fixes 0fa6107eca41 ("RISC-V: Initial DTS for Microchip ICICLE board")
Fixes 5b28df37d311 ("riscv: dts: microchip: update peripherals in icicle kit device tree")

I guess the memory controller consuming this clock will be sitting somewhere in the io-area of the soc instead

Quoted 14 lines
---
 arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dts | 2 --
 1 file changed, 2 deletions(-)
arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dts +0 -1
index 3392153dd0f1..c71d6aa6137a 100644
@@ -32,14 +32,12 @@ cpus {
 	ddrc_cache_lo: memory@80000000 {
 		device_type = "memory";
 		reg = <0x0 0x80000000 0x0 0x2e000000>;
-		clocks = <&clkcfg CLK_DDRC>;

arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dts cpus { · line 43

Quoted 10 lines
arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dts +0 -1
 		status = "okay";
 	};
 
 	ddrc_cache_hi: memory@1000000000 {
 		device_type = "memory";
 		reg = <0x10 0x0 0x0 0x40000000>;
-		clocks = <&clkcfg CLK_DDRC>;
 		status = "okay";
 	};
 };

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#3 lore raw

PATCH v3 2/8 riscv: dts: microchip: move sysctrlr out of soc bus

In reply to Conor Dooley

From: Conor Dooley <[email protected]>

The MPFS system controller has no registers of its own, so move it out
of the soc node to avoid dtbs_check warnings:
arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dtb: soc: syscontroller: {'compatible': ['microchip,mpfs-sys-controller'], 'mboxes': [[15, 0]], 'status': ['okay']} should not be valid under {'type': 'object'}

Fixes 528a5b1f2556 ("riscv: dts: microchip: add new peripherals to icicle kit device tree")
---
 arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi +5 -5
index 746c4d4e7686..bf21a2edd180 100644
@@ -146,6 +146,11 @@ refclk: mssrefclk {
 		#clock-cells = <0>;
 	};
 
+	syscontroller: syscontroller {
+		compatible = "microchip,mpfs-sys-controller";
+		mboxes = <&mbox 0>;
+	};
+
 	soc {
 		#address-cells = <2>;
 		#size-cells = <2>;
@@ -446,10 +451,5 @@ mbox: mailbox@37020000 {
 			#mbox-cells = <1>;
 			status = "disabled";
 		};
-
-		syscontroller: syscontroller {
-			compatible = "microchip,mpfs-sys-controller";
-			mboxes = <&mbox 0>;
-		};
 	};
 };
Signature · 7 lines
2.36.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#4 lore raw

Re: [PATCH v3 2/8] riscv: dts: microchip: move sysctrlr out of soc bus

Am Sonntag, 1. Mai 2022, 21:25:53 CEST schrieb Conor Dooley:

Quoted 10 lines

From: Conor Dooley <[email protected]>

The MPFS system controller has no registers of its own, so move it out
of the soc node to avoid dtbs_check warnings:
arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dtb: soc: syscontroller: {'compatible': ['microchip,mpfs-sys-controller'], 'mboxes': [[15, 0]], 'status': ['okay']} should not be valid under {'type': 'object'}

Fixes 528a5b1f2556 ("riscv: dts: microchip: add new peripherals to icicle kit device tree")

What function does the "soc-bus" have at all? I.e. mailbox@37020000 also looks like a peripheral of the chip but is outside it.

And I remember getting the suggestion to not use soc-"busses" over in arm-land years ago [0].

[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c3030d30d9c99c057b5ddfa289cffa637a2775f5

Quoted 32 lines
---
 arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi +5 -5
index 746c4d4e7686..bf21a2edd180 100644
@@ -146,6 +146,11 @@ refclk: mssrefclk {
 		#clock-cells = <0>;
 	};
 
+	syscontroller: syscontroller {
+		compatible = "microchip,mpfs-sys-controller";
+		mboxes = <&mbox 0>;
+	};
+
 	soc {
 		#address-cells = <2>;
 		#size-cells = <2>;
@@ -446,10 +451,5 @@ mbox: mailbox@37020000 {
 			#mbox-cells = <1>;
 			status = "disabled";
 		};
-
-		syscontroller: syscontroller {
-			compatible = "microchip,mpfs-sys-controller";
-			mboxes = <&mbox 0>;
-		};
 	};
 };
#5 lore raw

Re: [PATCH v3 2/8] riscv: dts: microchip: move sysctrlr out of soc bus

Quoted 9 lines · Heiko Stuebner

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Am Sonntag, 1. Mai 2022, 21:25:53 CEST schrieb Conor Dooley:

Quoted 6 lines

From: Conor Dooley <[email protected]>

The MPFS system controller has no registers of its own, so move it out
of the soc node to avoid dtbs_check warnings:
arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dtb: soc: syscontroller: {'compatible': ['microchip,mpfs-sys-controller'], 'mboxes': [[15, 0]], 'status': ['okay']} should not be valid under {'type': 'object'}

Quoted 8 lines
Quoted 4 lines
Fixes 528a5b1f2556 ("riscv: dts: microchip: add new peripherals to icicle kit device tree")

What function does the "soc-bus" have at all? I.e. mailbox@37020000 also looks like a peripheral of the chip but is outside it.

I am not sure why a soc bus was chosen originally, splitting between axi and ahb would be more accurate.

Quoted 42 lines

And I remember getting the suggestion to not use soc-"busses" over in arm-land years ago [0].

[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c3030d30d9c99c057b5ddfa289cffa637a2775f5

Quoted 32 lines
---
  arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi +5 -5
index 746c4d4e7686..bf21a2edd180 100644
@@ -146,6 +146,11 @@ refclk: mssrefclk {
               #clock-cells = <0>;
       };
 
+     syscontroller: syscontroller {
+             compatible = "microchip,mpfs-sys-controller";
+             mboxes = <&mbox 0>;
+     };
+
       soc {
               #address-cells = <2>;
               #size-cells = <2>;
@@ -446,10 +451,5 @@ mbox: mailbox@37020000 {
                       #mbox-cells = <1>;
                       status = "disabled";
               };
-
-             syscontroller: syscontroller {
-                     compatible = "microchip,mpfs-sys-controller";
-                     mboxes = <&mbox 0>;
-             };
       };
  };
#6 lore raw

PATCH v3 3/8 riscv: dts: microchip: remove soc vendor from filenames

In reply to Conor Dooley

From: Conor Dooley <[email protected]>

Having the SoC vendor both as the directory and in the filename adds little. Remove microchip from the filenames so that the files will resemble the other directories in riscv (and arm64). The new names follow a soc-board.dts & soc{,-fabric}.dtsi pattern.

---
 arch/riscv/boot/dts/microchip/Makefile                          | 2 +-
 .../microchip/{microchip-mpfs-fabric.dtsi => mpfs-fabric.dtsi}  | 0
 .../{microchip-mpfs-icicle-kit.dts => mpfs-icicle-kit.dts}      | 2 +-
 .../riscv/boot/dts/microchip/{microchip-mpfs.dtsi => mpfs.dtsi} | 2 +-
 4 files changed, 3 insertions(+), 3 deletions(-)
 rename arch/riscv/boot/dts/microchip/{microchip-mpfs-fabric.dtsi => mpfs-fabric.dtsi} (100%)
 rename arch/riscv/boot/dts/microchip/{microchip-mpfs-icicle-kit.dts => mpfs-icicle-kit.dts} (98%)
 rename arch/riscv/boot/dts/microchip/{microchip-mpfs.dtsi => mpfs.dtsi} (99%)
arch/riscv/boot/dts/microchip/Makefile +1 -1
index 855c1502d912..af3a5059b350 100644
@@ -1,3 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0
-dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += microchip-mpfs-icicle-kit.dtb
+dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += mpfs-icicle-kit.dtb
 obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
arch/riscv/boot/dts/microchip/mpfs-fabric.dtsi renamed from arch/riscv/boot/dts/microchip/microchip-mpfs-fabric.dtsi +0 -0
similarity index 100%
rename from arch/riscv/boot/dts/microchip/microchip-mpfs-fabric.dtsi
rename to arch/riscv/boot/dts/microchip/mpfs-fabric.dtsi
arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts renamed from arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dts +1 -1
similarity index 98%
rename from arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dts
rename to arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts
index c71d6aa6137a..84b0015dfd47 100644
@@ -3,7 +3,7 @@
 
 /dts-v1/;
 
-#include "microchip-mpfs.dtsi"
+#include "mpfs.dtsi"
 
 /* Clock frequency (in Hz) of the rtcclk */
 #define RTCCLK_FREQ		1000000
arch/riscv/boot/dts/microchip/mpfs.dtsi renamed from arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi +1 -1
similarity index 99%
rename from arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi
rename to arch/riscv/boot/dts/microchip/mpfs.dtsi
index bf21a2edd180..cc3386068c2d 100644
@@ -3,7 +3,7 @@
 
 /dts-v1/;
 #include "dt-bindings/clock/microchip,mpfs-clock.h"
-#include "microchip-mpfs-fabric.dtsi"
+#include "mpfs-fabric.dtsi"
 
 / {
 	#address-cells = <2>;
Signature · 1 line
2.36.0
Reviewed-by on v3 3/8
#7 lore raw

Re: [PATCH v3 3/8] riscv: dts: microchip: remove soc vendor from filenames

Am Sonntag, 1. Mai 2022, 21:25:54 CEST schrieb Conor Dooley:

Quoted 8 lines

From: Conor Dooley <[email protected]>

Having the SoC vendor both as the directory and in the filename adds little. Remove microchip from the filenames so that the files will resemble the other directories in riscv (and arm64). The new names follow a soc-board.dts & soc{,-fabric}.dtsi pattern.

Nice cleanup

Quoted 56 lines
---
 arch/riscv/boot/dts/microchip/Makefile                          | 2 +-
 .../microchip/{microchip-mpfs-fabric.dtsi => mpfs-fabric.dtsi}  | 0
 .../{microchip-mpfs-icicle-kit.dts => mpfs-icicle-kit.dts}      | 2 +-
 .../riscv/boot/dts/microchip/{microchip-mpfs.dtsi => mpfs.dtsi} | 2 +-
 4 files changed, 3 insertions(+), 3 deletions(-)
 rename arch/riscv/boot/dts/microchip/{microchip-mpfs-fabric.dtsi => mpfs-fabric.dtsi} (100%)
 rename arch/riscv/boot/dts/microchip/{microchip-mpfs-icicle-kit.dts => mpfs-icicle-kit.dts} (98%)
 rename arch/riscv/boot/dts/microchip/{microchip-mpfs.dtsi => mpfs.dtsi} (99%)
arch/riscv/boot/dts/microchip/Makefile +1 -1
index 855c1502d912..af3a5059b350 100644
@@ -1,3 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0
-dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += microchip-mpfs-icicle-kit.dtb
+dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += mpfs-icicle-kit.dtb
 obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
arch/riscv/boot/dts/microchip/mpfs-fabric.dtsi renamed from arch/riscv/boot/dts/microchip/microchip-mpfs-fabric.dtsi +0 -0
similarity index 100%
rename from arch/riscv/boot/dts/microchip/microchip-mpfs-fabric.dtsi
rename to arch/riscv/boot/dts/microchip/mpfs-fabric.dtsi
arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts renamed from arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dts +1 -1
similarity index 98%
rename from arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dts
rename to arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts
index c71d6aa6137a..84b0015dfd47 100644
@@ -3,7 +3,7 @@
 
 /dts-v1/;
 
-#include "microchip-mpfs.dtsi"
+#include "mpfs.dtsi"
 
 /* Clock frequency (in Hz) of the rtcclk */
 #define RTCCLK_FREQ		1000000
arch/riscv/boot/dts/microchip/mpfs.dtsi renamed from arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi +1 -1
similarity index 99%
rename from arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi
rename to arch/riscv/boot/dts/microchip/mpfs.dtsi
index bf21a2edd180..cc3386068c2d 100644
@@ -3,7 +3,7 @@
 
 /dts-v1/;
 #include "dt-bindings/clock/microchip,mpfs-clock.h"
-#include "microchip-mpfs-fabric.dtsi"
+#include "mpfs-fabric.dtsi"
 
 / {
 	#address-cells = <2>;
#8 lore raw

PATCH v3 4/8 dt-bindings: riscv: microchip: document icicle reference design

In reply to Conor Dooley

From: Conor Dooley <[email protected]>

Add a compatible for the icicle kit's reference design. This represents the FPGA fabric's contents & is versioned to denote which release of the reference design it applies to.

---
 Documentation/devicetree/bindings/riscv/microchip.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/riscv/microchip.yaml +2 -0
index 3f981e897126..7a1f883a39b5 100644
@@ -20,8 +20,10 @@ properties:
     items:
       - enum:
           - microchip,mpfs-icicle-kit
+          - microchip,mpfs-icicle-reference-rtlv2203
       - const: microchip,mpfs
 
+
 additionalProperties: true
 
 ...
Signature · 7 lines
2.36.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Acked-by on v3 4/8
#9 lore raw

Re: [PATCH v3 4/8] dt-bindings: riscv: microchip: document icicle reference design

Quoted 16 lines · Conor Dooley

From: Conor Dooley <[email protected]>

Add a compatible for the icicle kit's reference design. This represents the FPGA fabric's contents & is versioned to denote which release of the reference design it applies to.

---
 Documentation/devicetree/bindings/riscv/microchip.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/riscv/microchip.yaml +0 -0
index 3f981e897126..7a1f883a39b5 100644

Documentation/devicetree/bindings/riscv/microchip.yaml properties: · line 26

Quoted 7 lines
Documentation/devicetree/bindings/riscv/microchip.yaml +2 -0
@@ -20,8 +20,10 @@ properties:
     items:
       - enum:
           - microchip,mpfs-icicle-kit
+          - microchip,mpfs-icicle-reference-rtlv2203
       - const: microchip,mpfs
 
+

No need for this line break.

Documentation/devicetree/bindings/riscv/microchip.yaml properties: · line 28

Quoted 3 lines
Documentation/devicetree/bindings/riscv/microchip.yaml +0 -0
 additionalProperties: true
 
...

Best regards,
Krzysztof

#10 lore raw

PATCH v3 5/8 riscv: dts: microchip: make the fabric dtsi board specific

In reply to Conor Dooley

From: Conor Dooley <[email protected]>

Currently mpfs-fabric.dtsi is included by mpfs.dtsi - which is fine currently since there is only one board with this SoC upstream.

However if another board was added, it would include the fabric contents of the Icicle Kit's reference design. To avoid this, rename mpfs-fabric.dtsi to mpfs-icicle-kit-fabric.dtsi & include it in the dts rather than mpfs.dtsi.

---
 .../microchip/{mpfs-fabric.dtsi => mpfs-icicle-kit-fabric.dtsi} | 2 ++
 arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts               | 1 +
 arch/riscv/boot/dts/microchip/mpfs.dtsi                         | 1 -
 3 files changed, 3 insertions(+), 1 deletion(-)
 rename arch/riscv/boot/dts/microchip/{mpfs-fabric.dtsi => mpfs-icicle-kit-fabric.dtsi} (91%)
arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi renamed from arch/riscv/boot/dts/microchip/mpfs-fabric.dtsi +2 -0
similarity index 91%
rename from arch/riscv/boot/dts/microchip/mpfs-fabric.dtsi
rename to arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi
index ccaac3371cf9..0d28858b83f2 100644
@@ -2,6 +2,8 @@
 /* Copyright (c) 2020-2021 Microchip Technology Inc */
 
 / {
+	compatible = "microchip,mpfs-icicle-reference-rtlv2203", "microchip,mpfs";
+
 	core_pwm0: pwm@41000000 {
 		compatible = "microchip,corepwm-rtl-v4";
 		reg = <0x0 0x41000000 0x0 0xF0>;
arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts +1 -0
index 84b0015dfd47..739dfa52bed1 100644
@@ -4,6 +4,7 @@
 /dts-v1/;
 
 #include "mpfs.dtsi"
+#include "mpfs-icicle-kit-fabric.dtsi"
 
 /* Clock frequency (in Hz) of the rtcclk */
 #define RTCCLK_FREQ		1000000
arch/riscv/boot/dts/microchip/mpfs.dtsi +0 -1
index cc3386068c2d..695c4e2807f5 100644
@@ -3,7 +3,6 @@
 
 /dts-v1/;
 #include "dt-bindings/clock/microchip,mpfs-clock.h"
-#include "mpfs-fabric.dtsi"
 
 / {
 	#address-cells = <2>;
Signature · 1 line
2.36.0
#11 lore raw

Re: [PATCH v3 5/8] riscv: dts: microchip: make the fabric dtsi board specific

Am Sonntag, 1. Mai 2022, 21:25:56 CEST schrieb Conor Dooley:

Quoted 26 lines

From: Conor Dooley <[email protected]>

Currently mpfs-fabric.dtsi is included by mpfs.dtsi - which is fine currently since there is only one board with this SoC upstream.

However if another board was added, it would include the fabric contents of the Icicle Kit's reference design. To avoid this, rename mpfs-fabric.dtsi to mpfs-icicle-kit-fabric.dtsi & include it in the dts rather than mpfs.dtsi.

---
 .../microchip/{mpfs-fabric.dtsi => mpfs-icicle-kit-fabric.dtsi} | 2 ++
 arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts               | 1 +
 arch/riscv/boot/dts/microchip/mpfs.dtsi                         | 1 -
 3 files changed, 3 insertions(+), 1 deletion(-)
 rename arch/riscv/boot/dts/microchip/{mpfs-fabric.dtsi => mpfs-icicle-kit-fabric.dtsi} (91%)
arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi renamed from arch/riscv/boot/dts/microchip/mpfs-fabric.dtsi +0 -0
similarity index 91%
rename from arch/riscv/boot/dts/microchip/mpfs-fabric.dtsi
rename to arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi
index ccaac3371cf9..0d28858b83f2 100644

arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi line 6

Quoted 5 lines
arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi renamed from arch/riscv/boot/dts/microchip/mpfs-fabric.dtsi +2 -0
@@ -2,6 +2,8 @@
 /* Copyright (c) 2020-2021 Microchip Technology Inc */
 
 / {
+	compatible = "microchip,mpfs-icicle-reference-rtlv2203", "microchip,mpfs";
+

I don't really understand the meaning of the added compatible yet. It will get overridden by the compatible in the dts and also the fabric dtsi for the polarberry does not contain a similar thing.

Quoted 28 lines
arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi renamed from arch/riscv/boot/dts/microchip/mpfs-fabric.dtsi +0 -0
 	core_pwm0: pwm@41000000 {
 		compatible = "microchip,corepwm-rtl-v4";
 		reg = <0x0 0x41000000 0x0 0xF0>;
arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts +1 -0
index 84b0015dfd47..739dfa52bed1 100644
@@ -4,6 +4,7 @@
 /dts-v1/;
 
 #include "mpfs.dtsi"
+#include "mpfs-icicle-kit-fabric.dtsi"
 
 /* Clock frequency (in Hz) of the rtcclk */
 #define RTCCLK_FREQ		1000000
arch/riscv/boot/dts/microchip/mpfs.dtsi +0 -1
index cc3386068c2d..695c4e2807f5 100644
@@ -3,7 +3,6 @@
 
 /dts-v1/;
 #include "dt-bindings/clock/microchip,mpfs-clock.h"
-#include "mpfs-fabric.dtsi"
 
 / {
 	#address-cells = <2>;
#12 lore raw

Re: [PATCH v3 5/8] riscv: dts: microchip: make the fabric dtsi board specific

Quoted 31 lines · Heiko Stuebner

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Am Sonntag, 1. Mai 2022, 21:25:56 CEST schrieb Conor Dooley:

Quoted 28 lines

From: Conor Dooley <[email protected]>

Currently mpfs-fabric.dtsi is included by mpfs.dtsi - which is fine currently since there is only one board with this SoC upstream.

However if another board was added, it would include the fabric contents of the Icicle Kit's reference design. To avoid this, rename mpfs-fabric.dtsi to mpfs-icicle-kit-fabric.dtsi & include it in the dts rather than mpfs.dtsi.

---
  .../microchip/{mpfs-fabric.dtsi => mpfs-icicle-kit-fabric.dtsi} | 2 ++
  arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts               | 1 +
  arch/riscv/boot/dts/microchip/mpfs.dtsi                         | 1 -
  3 files changed, 3 insertions(+), 1 deletion(-)

rename arch/riscv/boot/dts/microchip/{mpfs-fabric.dtsi => mpfs-icicle-kit-fabric.dtsi} (91%)

arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi renamed from arch/riscv/boot/dts/microchip/mpfs-fabric.dtsi +0 -0
similarity index 91%
rename from arch/riscv/boot/dts/microchip/mpfs-fabric.dtsi
rename to arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi
index ccaac3371cf9..0d28858b83f2 100644
@@ -2,6 +2,8 @@
  /* Copyright (c) 2020-2021 Microchip Technology Inc */
 
Quoted 5 lines

arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi line 6

Quoted 3 lines
arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi renamed from arch/riscv/boot/dts/microchip/mpfs-fabric.dtsi +2 -0
  / {
+     compatible = "microchip,mpfs-icicle-reference-rtlv2203", "microchip,mpfs";
+

I don't really understand the meaning of the added compatible yet.

I added it for informational purposes more than anything else. The contents of this file match the 22.03 reference design for the icicle kit's FPGA fabric & an older version of the design may not have the i2c or pwm devices.

Quoted 2 lines

It will get overridden by the compatible in the dts and also the fabric dtsi for the polarberry does not contain a similar thing.

I did not add one for the polarberry b/c it has (to my knowledge) no versioning scheme nor fabric peripherals in the design given to customers.

Thanks,
Conor.

Reviewed-by
#13 lore raw

Re: [PATCH v3 5/8] riscv: dts: microchip: make the fabric dtsi board specific

Am Mittwoch, 4. Mai 2022, 08:48:24 CEST schrieb [email protected]:

Quoted 39 lines · Heiko Stuebner
Quoted 31 lines

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Am Sonntag, 1. Mai 2022, 21:25:56 CEST schrieb Conor Dooley:

Quoted 28 lines

From: Conor Dooley <[email protected]>

Currently mpfs-fabric.dtsi is included by mpfs.dtsi - which is fine currently since there is only one board with this SoC upstream.

However if another board was added, it would include the fabric contents of the Icicle Kit's reference design. To avoid this, rename mpfs-fabric.dtsi to mpfs-icicle-kit-fabric.dtsi & include it in the dts rather than mpfs.dtsi.

---
  .../microchip/{mpfs-fabric.dtsi => mpfs-icicle-kit-fabric.dtsi} | 2 ++
  arch/riscv/boot/dts/microchip/mpfs-icicle-kit.dts               | 1 +
  arch/riscv/boot/dts/microchip/mpfs.dtsi                         | 1 -
  3 files changed, 3 insertions(+), 1 deletion(-)

rename arch/riscv/boot/dts/microchip/{mpfs-fabric.dtsi => mpfs-icicle-kit-fabric.dtsi} (91%)

arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi renamed from arch/riscv/boot/dts/microchip/mpfs-fabric.dtsi +0 -0
similarity index 91%
rename from arch/riscv/boot/dts/microchip/mpfs-fabric.dtsi
rename to arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi
index ccaac3371cf9..0d28858b83f2 100644
@@ -2,6 +2,8 @@
  /* Copyright (c) 2020-2021 Microchip Technology Inc */
 
Quoted 5 lines

arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi line 6

Quoted 3 lines
arch/riscv/boot/dts/microchip/mpfs-icicle-kit-fabric.dtsi renamed from arch/riscv/boot/dts/microchip/mpfs-fabric.dtsi +2 -0
  / {
+     compatible = "microchip,mpfs-icicle-reference-rtlv2203", "microchip,mpfs";
+

I don't really understand the meaning of the added compatible yet.

Quoted 4 lines

I added it for informational purposes more than anything else. The contents of this file match the 22.03 reference design for the icicle kit's FPGA fabric & an older version of the design may not have the i2c or pwm devices.

that makes sense, thanks for the explanation :-)

Quoted 10 lines
Quoted 2 lines

It will get overridden by the compatible in the dts and also the fabric dtsi for the polarberry does not contain a similar thing.

I did not add one for the polarberry b/c it has (to my knowledge) no versioning scheme nor fabric peripherals in the design given to customers.

Thanks,
Conor.

#14 lore raw

PATCH v3 6/8 dt-bindings: vendor-prefixes: add Sundance DSP

In reply to Conor Dooley

From: Conor Dooley <[email protected]>

Sundance DSP Inc. (https://www.sundancedsp.com/) is a supplier of high-performance DSP and FPGA processor boards and I/O modules.

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 01430973ecec..1d47a38c2a2e 100644
@@ -1197,6 +1197,8 @@ patternProperties:
     description: Summit microelectronics
   "^sunchip,.*":
     description: Shenzhen Sunchip Technology Co., Ltd
+  "^sundance,.*":
+    description: Sundance DSP Inc.
   "^sunplus,.*":
     description: Sunplus Technology Co., Ltd.
   "^SUNW,.*":
Signature · 1 line
2.36.0
#15 lore raw

PATCH v3 7/8 dt-bindings: riscv: microchip: add polarberry compatible string

In reply to Conor Dooley

From: Conor Dooley <[email protected]>

Add a binding for the Sundance Polarberry board.

---
 Documentation/devicetree/bindings/riscv/microchip.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/riscv/microchip.yaml +1 -0
index 7a1f883a39b5..3ac611689441 100644
@@ -21,6 +21,7 @@ properties:
       - enum:
           - microchip,mpfs-icicle-kit
           - microchip,mpfs-icicle-reference-rtlv2203
+          - sundance,polarberry
       - const: microchip,mpfs
 
 
Signature · 1 line
2.36.0
#16 lore raw

PATCH v3 8/8 riscv: dts: microchip: add the sundance polarberry

In reply to Conor Dooley

From: Conor Dooley <[email protected]>

Add a minimal device tree for the PolarFire SoC based Sundance PolarBerry.

---
 arch/riscv/boot/dts/microchip/Makefile        |  1 +
 .../dts/microchip/mpfs-polarberry-fabric.dtsi | 16 ++++
 .../boot/dts/microchip/mpfs-polarberry.dts    | 95 +++++++++++++++++++
 3 files changed, 112 insertions(+)
 create mode 100644 arch/riscv/boot/dts/microchip/mpfs-polarberry-fabric.dtsi
 create mode 100644 arch/riscv/boot/dts/microchip/mpfs-polarberry.dts
arch/riscv/boot/dts/microchip/Makefile +1 -0
index af3a5059b350..39aae7b04f1c 100644
@@ -1,3 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
 dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += mpfs-icicle-kit.dtb
+dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += mpfs-polarberry.dtb
 obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
arch/riscv/boot/dts/microchip/mpfs-polarberry-fabric.dtsi new file +16 -0
new file mode 100644
index 000000000000..49380c428ec9
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/* Copyright (c) 2020-2022 Microchip Technology Inc */
+
+/ {
+	fabric_clk3: fabric-clk3 {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <62500000>;
+	};
+
+	fabric_clk1: fabric-clk1 {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <125000000>;
+	};
+};
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +95 -0

95 lines not on this page · raw message

Signature · 1 line
2.36.0
#17 lore raw

Re: [PATCH v3 8/8] riscv: dts: microchip: add the sundance polarberry

Am Sonntag, 1. Mai 2022, 21:25:59 CEST schrieb Conor Dooley:

Quoted 6 lines

From: Conor Dooley <[email protected]>

Add a minimal device tree for the PolarFire SoC based Sundance PolarBerry.

[...]

Quoted 14 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +8 -0
new file mode 100644
index 000000000000..96ec589d1571
@@ -0,0 +1,95 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/* Copyright (c) 2020-2022 Microchip Technology Inc */
+
+/dts-v1/;
+
+#include "mpfs.dtsi"
+#include "mpfs-polarberry-fabric.dtsi"
+

arch/riscv/boot/dts/microchip/mpfs-polarberry.dts line 18

Quoted 10 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +10 -0
+/* Clock frequency (in Hz) of the rtcclk */
+#define MTIMER_FREQ	1000000
+
+/ {
+	model = "Sundance PolarBerry";
+	compatible = "sundance,polarberry", "microchip,mpfs";
+
+	aliases {
+		serial0 = &mmuart0;
+		ethernet0 = &mac1;

I guess you could sort them alphabetically (ethernet above serial0)

Quoted 4 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +4 -0
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";

arch/riscv/boot/dts/microchip/mpfs-polarberry.dts line 32

Quoted 10 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +10 -0
+	};
+
+	cpus {
+		timebase-frequency = <MTIMER_FREQ>;
+	};
+
+	ddrc_cache_lo: memory@80000000 {
+		device_type = "memory";
+		reg = <0x0 0x80000000 0x0 0x2e000000>;
+		status = "okay";

"okay" is implied I think, so when you only add the node here, you probably don't need to specify the status.

Quoted 9 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +9 -0
+	};
+
+	ddrc_cache_hi: memory@1000000000 {
+		device_type = "memory";
+		reg = <0x10 0x00000000 0x0 0xC0000000>;
+		status = "okay";
+	};
+};
+

arch/riscv/boot/dts/microchip/mpfs-polarberry.dts line 51

Quoted 10 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +10 -0
+&refclk {
+	clock-frequency = <125000000>;
+};
+
+&mmuart0 {
+	status = "okay";
+};
+
+&mmc {
+	status = "okay";

having the status property last (below sd-uhssdr104) can be helpful for readability, as readers would know where to expect it.

Quoted 19 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +19 -0
+	bus-width = <4>;
+	disable-wp;
+	cap-sd-highspeed;
+	cap-mmc-highspeed;
+	card-detect-delay = <200>;
+	mmc-ddr-1_8v;
+	mmc-hs200-1_8v;
+	sd-uhs-sdr12;
+	sd-uhs-sdr25;
+	sd-uhs-sdr50;
+	sd-uhs-sdr104;
+};
+
+&mac1 {
+	status = "okay";
+	phy-mode = "sgmii";
+	phy-handle = <&phy1>;
+	phy1: ethernet-phy@5 {
+		reg = <5>;

arch/riscv/boot/dts/microchip/mpfs-polarberry.dts line 80

Quoted 10 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +10 -0
+		ti,fifo-depth = <0x01>;
+	};
+	phy0: ethernet-phy@4 {
+		reg = <4>;
+		ti,fifo-depth = <0x01>;
+	};
+};
+
+&mac0 {
+	status = "disabled";

mac0 is already disabled in the mpfs.dtsi, so you either don't need to duplicate it here, or if it's a reminder of something, I guess a comment for the "why" would be helpful.

Quoted 5 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +5 -0
+	phy-mode = "sgmii";
+	phy-handle = <&phy0>;
+};
+
+&rtc {

arch/riscv/boot/dts/microchip/mpfs-polarberry.dts line 95

Quoted 10 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +10 -0
+	status = "okay";
+};
+
+&mbox {
+	status = "okay";
+};
+
+&syscontroller {
+	status = "okay";
+};

My personal preference would be alphabetical sorting also for phandles, so

&mac0 {}
&mac1 {}
&mbox {}
&refclk {}
&rtc {}

etc - makes finding things a lot easier in the long run especially when files get longer.

Heiko

#18 lore raw

Re: [PATCH v3 8/8] riscv: dts: microchip: add the sundance polarberry

Quoted 30 lines · Heiko Stuebner

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Am Sonntag, 1. Mai 2022, 21:25:59 CEST schrieb Conor Dooley:

Quoted 6 lines

From: Conor Dooley <[email protected]>

Add a minimal device tree for the PolarFire SoC based Sundance PolarBerry.

[...]

Quoted 18 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +12 -0
new file mode 100644
index 000000000000..96ec589d1571
@@ -0,0 +1,95 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/* Copyright (c) 2020-2022 Microchip Technology Inc */
+
+/dts-v1/;
+
+#include "mpfs.dtsi"
+#include "mpfs-polarberry-fabric.dtsi"
+
+/* Clock frequency (in Hz) of the rtcclk */
+#define MTIMER_FREQ  1000000
+
+/ {
Quoted 9 lines

arch/riscv/boot/dts/microchip/mpfs-polarberry.dts line 18

Quoted 6 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +6 -0
+     model = "Sundance PolarBerry";
+     compatible = "sundance,polarberry", "microchip,mpfs";
+
+     aliases {
+             serial0 = &mmuart0;
+             ethernet0 = &mac1;

I guess you could sort them alphabetically (ethernet above serial0)

I suppose so. I had just matched the order in the icicle but sure.

Quoted 9 lines
Quoted 9 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +9 -0
+     };
+
+     chosen {
+             stdout-path = "serial0:115200n8";
+     };
+
+     cpus {
+             timebase-frequency = <MTIMER_FREQ>;
+     };
Quoted 9 lines

arch/riscv/boot/dts/microchip/mpfs-polarberry.dts line 32

Quoted 5 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +5 -0
+
+     ddrc_cache_lo: memory@80000000 {
+             device_type = "memory";
+             reg = <0x0 0x80000000 0x0 0x2e000000>;
+             status = "okay";

"okay" is implied I think, so when you only add the node here, you probably don't need to specify the status.

Good point.

Quoted 14 lines
Quoted 14 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +14 -0
+     };
+
+     ddrc_cache_hi: memory@1000000000 {
+             device_type = "memory";
+             reg = <0x10 0x00000000 0x0 0xC0000000>;
+             status = "okay";
+     };
+};
+
+&refclk {
+     clock-frequency = <125000000>;
+};
+
+&mmuart0 {
Quoted 8 lines

arch/riscv/boot/dts/microchip/mpfs-polarberry.dts line 51

Quoted 5 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +5 -0
+     status = "okay";
+};
+
+&mmc {
+     status = "okay";

having the status property last (below sd-uhssdr104) can be helpful for readability, as readers would know where to expect it.

Ditto

Quoted 26 lines
Quoted 26 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +25 -0
+     bus-width = <4>;
+     disable-wp;
+     cap-sd-highspeed;
+     cap-mmc-highspeed;
+     card-detect-delay = <200>;
+     mmc-ddr-1_8v;
+     mmc-hs200-1_8v;
+     sd-uhs-sdr12;
+     sd-uhs-sdr25;
+     sd-uhs-sdr50;
+     sd-uhs-sdr104;
+};
+
+&mac1 {
+     status = "okay";
+     phy-mode = "sgmii";
+     phy-handle = <&phy1>;
+     phy1: ethernet-phy@5 {
+             reg = <5>;
+             ti,fifo-depth = <0x01>;
+     };
+     phy0: ethernet-phy@4 {
+             reg = <4>;
+             ti,fifo-depth = <0x01>;
+     };
Quoted 8 lines

arch/riscv/boot/dts/microchip/mpfs-polarberry.dts line 80

Quoted 4 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +4 -0
+};
+
+&mac0 {
+     status = "disabled";

mac0 is already disabled in the mpfs.dtsi, so you either don't need to duplicate it here, or if it's a reminder of something, I guess a comment for the "why" would be helpful.

It's a reminder that the SoM does not have a second ethernet port but the phy is wired up (and usable with the carrier). I will add a comment.

Quoted 20 lines
Quoted 6 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +5 -0
+     phy-mode = "sgmii";
+     phy-handle = <&phy0>;
+};
+
+&rtc {

arch/riscv/boot/dts/microchip/mpfs-polarberry.dts line 95

Quoted 10 lines
arch/riscv/boot/dts/microchip/mpfs-polarberry.dts new file +10 -0
+     status = "okay";
+};
+
+&mbox {
+     status = "okay";
+};
+
+&syscontroller {
+     status = "okay";
+};

My personal preference would be alphabetical sorting also for phandles, so

Quoted 8 lines

&mac0 {}
&mac1 {}
&mbox {}
&refclk {}
&rtc {}

etc - makes finding things a lot easier in the long run especially when files get longer.

Sure, why not.

Thanks for the review,
Conor.