Skip to contentSkip to conversation

add DM based reset driver for SiFive SoC's

PATCH Superseded Sagar Shrikant Kadam 3 participants 19 messages Jun 22, 2020 – Jun 24, 2020

Subsystems (5)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

cover add DM based reset driver for SiFive SoC's

The FU540-C000 support in U-Boot is missing DM based reset driver, and is handling reset's to sub-system within the prci driver itself. The series here adds a generic DM reset driver for SiFive SoC's so as to leverage the U-Boot's reset framework and binds the reset driver with prci driver.
The PRCI driver takes care of triggering the consumers reset signals appropriately.

Patch 1: Add necessary dt indexes for device reset register. Patch 2: Update macro's to use common dt indexes from binding header. Patch 3: Add reset producer and consumer entries within the device tree. Patch 4: Add reset dm driver and bind it within prci module. Patch 5: Add Kconfig, Makefile entries and enable the driver

This series is based on mainline U-Boot
commit 2b8692bac1e8 ("Merge tag 'efi-2020-07-rc5-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi")

Sagar Shrikant Kadam (5):
dt-bindings: prci: add indexes for reset signals available in prci
fu540: prci: use common reset indexes defined in binding header
fu540: dtsi: add reset producer and consumer entries
sifive: reset: add DM based reset driver for SiFive SoC's
configs: reset: fu540: enable dm reset framework for SiFive SoC

 arch/riscv/dts/fu540-c000-u-boot.dtsi         |  10 +++
 arch/riscv/include/asm/arch-fu540/reset.h     |  13 +++
 configs/sifive_fu540_defconfig                |   2 +
 drivers/clk/sifive/fu540-prci.c               |  89 +++++++++++++------
 drivers/reset/Kconfig                         |   9 ++
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-sifive.c                  | 118 ++++++++++++++++++++++++++
 include/dt-bindings/clock/sifive-fu540-prci.h |   8 ++
 8 files changed, 225 insertions(+), 25 deletions(-)
 create mode 100644 arch/riscv/include/asm/arch-fu540/reset.h
 create mode 100644 drivers/reset/reset-sifive.c
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/5 dt-bindings: prci: add indexes for reset signals available in prci

Add bit indexes for reset signals within the PRCI module on FU540-C000 SoC.
The DDR and ethernet sub-system's have reset signals indicated by these reset indexes.

---
 include/dt-bindings/clock/sifive-fu540-prci.h | 8 ++++++++
 1 file changed, 8 insertions(+)
include/dt-bindings/clock/sifive-fu540-prci.h +8 -0
index 6a0b70a..1c03b09 100644
@@ -15,4 +15,12 @@
 #define PRCI_CLK_GEMGXLPLL	       2
 #define PRCI_CLK_TLCLK		       3
 
+/* Reset bit indexes to be used by driver */
+#define PRCI_RST_DDR_CTRL_N	0
+#define PRCI_RST_DDR_AXI_N	1
+#define PRCI_RST_DDR_AHB_N	2
+#define PRCI_RST_DDR_PHY_N	3
+/* bit 4 is reserved bit */
+#define PRCI_RST_RSVD_N		4
+#define PRCI_RST_GEMGXL_N	5
 #endif
Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/5 dt-bindings: prci: add indexes for reset signals available in prci

Quoted 6 lines · Sagar Shrikant Kadam

Add bit indexes for reset signals within the PRCI module on FU540-C000 SoC.
The DDR and ethernet sub-system's have reset signals indicated by these reset indexes.

Quoted 6 lines
---
 include/dt-bindings/clock/sifive-fu540-prci.h | 8 ++++++++
 1 file changed, 8 insertions(+)
#3 lore raw

PATCH 2/5 fu540: prci: use common reset indexes defined in binding header

In reply to Sagar Shrikant Kadam

Indexes of reset signals available in PRCI driver are also defined in include/dt-bindings/clock/sifive-fu540-prci.h. So use those instead of defining new ones again within the fu540-prci driver.

---
 drivers/clk/sifive/fu540-prci.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
drivers/clk/sifive/fu540-prci.c +6 -10
index fe6e0d4..57d811e 100644
@@ -131,21 +131,17 @@
 
 /* DEVICESRESETREG */
 #define PRCI_DEVICESRESETREG_OFFSET	0x28
-#define PRCI_DEVICESRESETREG_DDR_CTRL_RST_N_SHIFT 0
+
 #define PRCI_DEVICESRESETREG_DDR_CTRL_RST_N_MASK \
-			(0x1 << PRCI_DEVICESRESETREG_DDR_CTRL_RST_N_SHIFT)
-#define PRCI_DEVICESRESETREG_DDR_AXI_RST_N_SHIFT 1
+			(0x1 << PRCI_RST_DDR_CTRL_N)
 #define PRCI_DEVICESRESETREG_DDR_AXI_RST_N_MASK \
-			(0x1 << PRCI_DEVICESRESETREG_DDR_AXI_RST_N_SHIFT)
-#define PRCI_DEVICESRESETREG_DDR_AHB_RST_N_SHIFT 2
+			(0x1 << PRCI_RST_DDR_AXI_N)
 #define PRCI_DEVICESRESETREG_DDR_AHB_RST_N_MASK \
-			(0x1 << PRCI_DEVICESRESETREG_DDR_AHB_RST_N_SHIFT)
-#define PRCI_DEVICESRESETREG_DDR_PHY_RST_N_SHIFT 3
+			(0x1 << PRCI_RST_DDR_AHB_N)
 #define PRCI_DEVICESRESETREG_DDR_PHY_RST_N_MASK \
-			(0x1 << PRCI_DEVICESRESETREG_DDR_PHY_RST_N_SHIFT)
-#define PRCI_DEVICESRESETREG_GEMGXL_RST_N_SHIFT 5
+			(0x1 << PRCI_RST_DDR_PHY_N)
 #define PRCI_DEVICESRESETREG_GEMGXL_RST_N_MASK \
-			(0x1 << PRCI_DEVICESRESETREG_GEMGXL_RST_N_SHIFT)
+			(0x1 << PRCI_RST_GEMGXL_N)
 
 /* CLKMUXSTATUSREG */
 #define PRCI_CLKMUXSTATUSREG_OFFSET	0x2c
Signature · 1 line
2.7.4
#4 lore raw

PATCH 2/5 fu540: prci: use common reset indexes defined in binding header

Quoted 6 lines · Sagar Shrikant Kadam

Indexes of reset signals available in PRCI driver are also defined in include/dt-bindings/clock/sifive-fu540-prci.h. So use those instead of defining new ones again within the fu540-prci driver.

Quoted 6 lines
---
 drivers/clk/sifive/fu540-prci.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
#5 lore raw

PATCH 2/5 fu540: prci: use common reset indexes defined in binding header

Quoted 11 lines · Bin Meng
Quoted 8 lines · Sagar Shrikant Kadam

Indexes of reset signals available in PRCI driver are also defined in include/dt-bindings/clock/sifive-fu540-prci.h. So use those instead of defining new ones again within the fu540-prci driver.

Forget to mention, please fix the [A in the next version

Quoted 6 lines
Quoted 4 lines
---
 drivers/clk/sifive/fu540-prci.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
#6 lore raw

PATCH 2/5 fu540: prci: use common reset indexes defined in binding header

Hi,

Quoted 31 lines

-----Original Message-----
From: Bin Meng <[email protected]>
Sent: Wednesday, June 24, 2020 8:33 AM
To: Sagar Kadam <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Rick Chen <[email protected]>; Paul Walmsley ( Sifive) <[email protected]>; Palmer Dabbelt <[email protected]>; Anup Patel <[email protected]>; Atish Patra <[email protected]>; Lukasz Majewski <[email protected]>; Pragnesh Patel <[email protected]>; Jagan Teki <[email protected]>; Simon Glass <[email protected]>; twoerner at gmail.com; Patrick Wildt <[email protected]>; Fabio Estevam <[email protected]>; Weijie Gao <[email protected]>; Eugeniy Paltsev <[email protected]>
Subject: Re: [PATCH 2/5] fu540: prci: use common reset indexes defined in binding header

[External Email] Do not click links or attachments unless you recognize the sender and know the content is safe

Quoted 9 lines · Bin Meng
Quoted 6 lines · Sagar Shrikant Kadam

Indexes of reset signals available in PRCI driver are also defined in include/dt-bindings/clock/sifive-fu540-prci.h.
So use those instead of defining new ones again within the fu540-prci driver.

Quoted 5 lines
Quoted 2 lines
Quoted 2 lines

Forget to mention, please fix the [A in the next version

I will update fix for "[A".

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
---
 drivers/clk/sifive/fu540-prci.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

Thanks & BR,
Sagar

#7 lore raw

PATCH 3/5 fu540: dtsi: add reset producer and consumer entries

In reply to Sagar Shrikant Kadam

The resets to DDR and ethernet sub-system are connected to PRCI device reset control register, these reset signals are active low and are held low at power-up. Add these reset producer and consumer details needed by the reset driver.

---
 arch/riscv/dts/fu540-c000-u-boot.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/riscv/dts/fu540-c000-u-boot.dtsi +10 -0
index 9bba554..b37241e 100644
@@ -59,6 +59,16 @@
 			reg = <0x0 0x2000000 0x0 0xc0000>;
 			u-boot,dm-spl;
 		};
+		prci: clock-controller at 10000000 {
+			#reset-cells = <1>;
+			resets = <&prci PRCI_RST_DDR_CTRL_N>,
+				 <&prci PRCI_RST_DDR_AXI_N>,
+				 <&prci PRCI_RST_DDR_AHB_N>,
+				 <&prci PRCI_RST_DDR_PHY_N>,
+				 <&prci PRCI_RST_GEMGXL_N>;
+			reset-names = "ddr_ctrl", "ddr_axi", "ddr_ahb",
+					"ddr_phy", "gemgxl_reset";
+		};
 		dmc: dmc at 100b0000 {
 			compatible = "sifive,fu540-c000-ddr";
 			reg = <0x0 0x100b0000 0x0 0x0800
Signature · 1 line
2.7.4
#8 lore raw

PATCH 3/5 fu540: dtsi: add reset producer and consumer entries

Quoted 6 lines · Sagar Shrikant Kadam

The resets to DDR and ethernet sub-system are connected to PRCI device reset control register, these reset signals are active low and are held low at power-up. Add these reset producer and consumer details needed by the reset driver.

Quoted 6 lines
---
 arch/riscv/dts/fu540-c000-u-boot.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
#9 lore raw

PATCH 3/5 fu540: dtsi: add reset producer and consumer entries

In reply to Sagar Shrikant Kadam
Quoted 16 lines · Sagar Shrikant Kadam

The resets to DDR and ethernet sub-system are connected to PRCI device reset control register, these reset signals are active low and are held low at power-up. Add these reset producer and consumer details needed by the reset driver.

---
 arch/riscv/dts/fu540-c000-u-boot.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/riscv/dts/fu540-c000-u-boot.dtsi +0 -0
index 9bba554..b37241e 100644

arch/riscv/dts/fu540-c000-u-boot.dtsi line 62

Quoted 4 lines
arch/riscv/dts/fu540-c000-u-boot.dtsi +1 -0
@@ -59,6 +59,16 @@
 			reg = <0x0 0x2000000 0x0 0xc0000>;
 			u-boot,dm-spl;
 		};
+		prci: clock-controller at 10000000 {

Shouldn't this have a compatible property?

arch/riscv/dts/fu540-c000-u-boot.dtsi line 74

Quoted 13 lines
arch/riscv/dts/fu540-c000-u-boot.dtsi +9 -0
+			#reset-cells = <1>;
+			resets = <&prci PRCI_RST_DDR_CTRL_N>,
+				 <&prci PRCI_RST_DDR_AXI_N>,
+				 <&prci PRCI_RST_DDR_AHB_N>,
+				 <&prci PRCI_RST_DDR_PHY_N>,
+				 <&prci PRCI_RST_GEMGXL_N>;
+			reset-names = "ddr_ctrl", "ddr_axi", "ddr_ahb",
+					"ddr_phy", "gemgxl_reset";
+		};
 		dmc: dmc at 100b0000 {
 			compatible = "sifive,fu540-c000-ddr";
 			reg = <0x0 0x100b0000 0x0 0x0800

--Sean

#10 lore raw

PATCH 3/5 fu540: dtsi: add reset producer and consumer entries

Hi Sean,

Quoted 13 lines · Sean Anderson
Quoted 11 lines · Sagar Shrikant Kadam

The resets to DDR and ethernet sub-system are connected to PRCI device reset control register, these reset signals are active low and are held low at power-up. Add these reset producer and consumer details needed by the reset driver.

---
 arch/riscv/dts/fu540-c000-u-boot.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
Quoted 11 lines

arch/riscv/dts/fu540-c000-u-boot.dtsi line 62

Quoted 9 lines
arch/riscv/dts/fu540-c000-u-boot.dtsi +1 -0
index 9bba554..b37241e 100644
@@ -59,6 +59,16 @@
                      reg = <0x0 0x2000000 0x0 0xc0000>;
                      u-boot,dm-spl;
              };
+             prci: clock-controller at 10000000 {

Shouldn't this have a compatible property?

This is the U-Boot specific dts fragment. See fu540-c000.dtsi

Quoted 13 lines

arch/riscv/dts/fu540-c000-u-boot.dtsi line 74

Quoted 13 lines
arch/riscv/dts/fu540-c000-u-boot.dtsi +9 -0
+                     #reset-cells = <1>;
+                     resets = <&prci PRCI_RST_DDR_CTRL_N>,
+                              <&prci PRCI_RST_DDR_AXI_N>,
+                              <&prci PRCI_RST_DDR_AHB_N>,
+                              <&prci PRCI_RST_DDR_PHY_N>,
+                              <&prci PRCI_RST_GEMGXL_N>;
+                     reset-names = "ddr_ctrl", "ddr_axi", "ddr_ahb",
+                                     "ddr_phy", "gemgxl_reset";
+             };
              dmc: dmc at 100b0000 {
                      compatible = "sifive,fu540-c000-ddr";
                      reg = <0x0 0x100b0000 0x0 0x0800

Regards,
Bin

#11 lore raw

PATCH 4/5 sifive: reset: add DM based reset driver for SiFive SoC's

In reply to Sagar Shrikant Kadam

PRCI module within SiFive SoC's has register with which we can reset the sub-systems within the SoC. The resets to DDR and ethernet sub systems within FU540-C000 SoC are active low, and are hold low by default on power-up. Currently these are directly asserted within prci driver via register read/write.
With the DM based reset driver support here, we bind the reset driver with clock (prci) driver and assert the reset signals of both sub-system's appropriately.

---
 arch/riscv/include/asm/arch-fu540/reset.h |  13 ++++
 drivers/clk/sifive/fu540-prci.c           |  73 ++++++++++++++----
 drivers/reset/reset-sifive.c              | 118 ++++++++++++++++++++++++++++++
 3 files changed, 189 insertions(+), 15 deletions(-)
 create mode 100644 arch/riscv/include/asm/arch-fu540/reset.h
 create mode 100644 drivers/reset/reset-sifive.c
arch/riscv/include/asm/arch-fu540/reset.h new file +13 -0
new file mode 100644
index 0000000..e42797a
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2020 SiFive, Inc.
+ *
+ * Author: Sagar Kadam <[email protected]>
+ */
+
+#ifndef __RESET_SIFIVE_H
+#define __RESET_SIFIVE_H
+
+int sifive_reset_bind(struct udevice *dev, ulong count);
+
+#endif
drivers/clk/sifive/fu540-prci.c +58 -15

122 lines not on this page · raw message

drivers/reset/reset-sifive.c new file +118 -0

118 lines not on this page · raw message

Signature · 1 line
2.7.4
#12 lore raw

PATCH 4/5 sifive: reset: add DM based reset driver for SiFive SoC's

Quoted 28 lines · Bin Meng

Hi Sean,

Quoted 13 lines · Sean Anderson
Quoted 11 lines · Sagar Shrikant Kadam

The resets to DDR and ethernet sub-system are connected to PRCI device reset control register, these reset signals are active low and are held low at power-up. Add these reset producer and consumer details needed by the reset driver.

---
 arch/riscv/dts/fu540-c000-u-boot.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
Quoted 11 lines

arch/riscv/dts/fu540-c000-u-boot.dtsi line 62

Quoted 9 lines
arch/riscv/dts/fu540-c000-u-boot.dtsi +1 -0
index 9bba554..b37241e 100644
@@ -59,6 +59,16 @@
                      reg = <0x0 0x2000000 0x0 0xc0000>;
                      u-boot,dm-spl;
              };
+             prci: clock-controller at 10000000 {

Shouldn't this have a compatible property?

Quoted 1 line

This is the U-Boot specific dts fragment. See fu540-c000.dtsi

I ask because this node sits in /soc, and all the other nodes in /soc have compatible strings. Since this device is bound by the clock driver, perhaps it should be located under /soc/prci instead.

--Sean

Quoted 18 lines
Quoted 14 lines
Quoted 4 lines
arch/riscv/dts/fu540-c000-u-boot.dtsi +2 -0
+                     #reset-cells = <1>;
+                     resets = <&prci PRCI_RST_DDR_CTRL_N>,

arch/riscv/dts/fu540-c000-u-boot.dtsi line 74

Quoted 10 lines
arch/riscv/dts/fu540-c000-u-boot.dtsi +7 -0
+                              <&prci PRCI_RST_DDR_AXI_N>,
+                              <&prci PRCI_RST_DDR_AHB_N>,
+                              <&prci PRCI_RST_DDR_PHY_N>,
+                              <&prci PRCI_RST_GEMGXL_N>;
+                     reset-names = "ddr_ctrl", "ddr_axi", "ddr_ahb",
+                                     "ddr_phy", "gemgxl_reset";
+             };
              dmc: dmc at 100b0000 {
                      compatible = "sifive,fu540-c000-ddr";
                      reg = <0x0 0x100b0000 0x0 0x0800

Regards,
Bin

#13 lore raw

PATCH 4/5 sifive: reset: add DM based reset driver for SiFive SoC's

Hi Sean,

Quoted 30 lines · Sean Anderson
Quoted 28 lines · Bin Meng

Hi Sean,

Quoted 24 lines · Sean Anderson
Quoted 16 lines · Sagar Shrikant Kadam

The resets to DDR and ethernet sub-system are connected to PRCI device reset control register, these reset signals are active low and are held low at power-up. Add these reset producer and consumer details needed by the reset driver.

---
 arch/riscv/dts/fu540-c000-u-boot.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/riscv/dts/fu540-c000-u-boot.dtsi +0 -0
index 9bba554..b37241e 100644

arch/riscv/dts/fu540-c000-u-boot.dtsi line 62

Quoted 4 lines
arch/riscv/dts/fu540-c000-u-boot.dtsi +1 -0
@@ -59,6 +59,16 @@
                      reg = <0x0 0x2000000 0x0 0xc0000>;
                      u-boot,dm-spl;
              };
+             prci: clock-controller at 10000000 {

Shouldn't this have a compatible property?

Quoted 5 lines
Quoted 1 line

This is the U-Boot specific dts fragment. See fu540-c000.dtsi

I ask because this node sits in /soc, and all the other nodes in /soc have compatible strings. Since this device is bound by the clock driver, perhaps it should be located under /soc/prci instead.

fu540-c000.dtsi has everything you asked.

Regards,
Bin

#14 lore raw

PATCH 4/5 sifive: reset: add DM based reset driver for SiFive SoC's

Quoted 33 lines · Bin Meng

Hi Sean,

Quoted 30 lines · Sean Anderson
Quoted 28 lines · Bin Meng

Hi Sean,

Quoted 24 lines · Sean Anderson
Quoted 16 lines · Sagar Shrikant Kadam

The resets to DDR and ethernet sub-system are connected to PRCI device reset control register, these reset signals are active low and are held low at power-up. Add these reset producer and consumer details needed by the reset driver.

---
 arch/riscv/dts/fu540-c000-u-boot.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/riscv/dts/fu540-c000-u-boot.dtsi +0 -0
index 9bba554..b37241e 100644

arch/riscv/dts/fu540-c000-u-boot.dtsi line 62

Quoted 4 lines
arch/riscv/dts/fu540-c000-u-boot.dtsi +1 -0
@@ -59,6 +59,16 @@
                      reg = <0x0 0x2000000 0x0 0xc0000>;
                      u-boot,dm-spl;
              };
+             prci: clock-controller at 10000000 {

Shouldn't this have a compatible property?

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

This is the U-Boot specific dts fragment. See fu540-c000.dtsi

I ask because this node sits in /soc, and all the other nodes in /soc have compatible strings. Since this device is bound by the clock driver, perhaps it should be located under /soc/prci instead.

fu540-c000.dtsi has everything you asked.

Ah, I didn't see that this was an extension. Looks good to me.

--Sean

#15 lore raw

PATCH 4/5 sifive: reset: add DM based reset driver for SiFive SoC's

Hi,

Quoted 63 lines

-----Original Message-----
From: Sean Anderson <[email protected]>
Sent: Wednesday, June 24, 2020 10:49 AM
To: Bin Meng <[email protected]>
Cc: Sagar Kadam <[email protected]>; U-Boot Mailing List <u- boot at lists.denx.de>; Rick Chen <[email protected]>; Paul Walmsley ( Sifive) <[email protected]>; Palmer Dabbelt <[email protected]>; Anup Patel <[email protected]>; Atish Patra <[email protected]>; Lukasz Majewski <[email protected]>; Pragnesh Patel <[email protected]>; Jagan Teki <[email protected]>; Simon Glass <[email protected]>; twoerner at gmail.com; Patrick Wildt <[email protected]>; Fabio Estevam <[email protected]>; Weijie Gao <[email protected]>; Eugeniy Paltsev <[email protected]>
Subject: Re: [PATCH 4/5] sifive: reset: add DM based reset driver for SiFive SoC's

[External Email] Do not click links or attachments unless you recognize the sender and know the content is safe

Quoted 3 lines · Bin Meng

Hi Sean,

On Wed, Jun 24, 2020 at 1:04 PM Sean Anderson <[email protected]>

Quoted 5 lines · wrote:
Quoted 5 lines · Bin Meng
Quoted 3 lines

Hi Sean,

On Wed, Jun 24, 2020 at 12:17 PM Sean Anderson

Quoted 32 lines · <[email protected]> wrote:
Quoted 31 lines
Quoted 26 lines
Quoted 13 lines · Sagar Shrikant Kadam
Quoted 11 lines

The resets to DDR and ethernet sub-system are connected to PRCI device reset control register, these reset signals are active low and are held low at power-up. Add these reset producer and consumer details needed by the reset driver.

---
 arch/riscv/dts/fu540-c000-u-boot.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
Quoted 12 lines

arch/riscv/dts/fu540-c000-u-boot.dtsi line 62

Quoted 10 lines
arch/riscv/dts/fu540-c000-u-boot.dtsi +1 -0
index 9bba554..b37241e 100644
@@ -59,6 +59,16 @@
                      reg = <0x0 0x2000000 0x0 0xc0000>;
                      u-boot,dm-spl;
              };
+             prci: clock-controller at 10000000 {

Shouldn't this have a compatible property?

Quoted 1 line

This is the U-Boot specific dts fragment. See fu540-c000.dtsi

I ask because this node sits in /soc, and all the other nodes in /soc have compatible strings. Since this device is bound by the clock driver, perhaps it should be located under /soc/prci instead.

Quoted 6 lines
Quoted 2 lines

fu540-c000.dtsi has everything you asked.

Ah, I didn't see that this was an extension. Looks good to me.

--Sean

Thanks Bin and Sean for looking at it.

BR,
Sagar Kadam

#16 lore raw

PATCH 4/5 sifive: reset: add DM based reset driver for SiFive SoC's

In reply to Sagar Shrikant Kadam
Quoted 12 lines · Sagar Shrikant Kadam

PRCI module within SiFive SoC's has register with which we can reset the sub-systems within the SoC. The resets to DDR and ethernet sub systems within FU540-C000 SoC are active low, and are hold low by default on power-up. Currently these are directly asserted within prci driver via register read/write.
With the DM based reset driver support here, we bind the reset driver with clock (prci) driver and assert the reset signals of both sub-system's appropriately.

Quoted 8 lines
---
 arch/riscv/include/asm/arch-fu540/reset.h |  13 ++++
 drivers/clk/sifive/fu540-prci.c           |  73 ++++++++++++++----
 drivers/reset/reset-sifive.c              | 118 ++++++++++++++++++++++++++++++
 3 files changed, 189 insertions(+), 15 deletions(-)
 create mode 100644 arch/riscv/include/asm/arch-fu540/reset.h
 create mode 100644 drivers/reset/reset-sifive.c
#17 lore raw

PATCH 5/5 configs: reset: fu540: enable dm reset framework for SiFive SoC

In reply to Sagar Shrikant Kadam

Add necessary defconfig and Kconfig entries to enable SiFive SoC's reset driver so as to utilise U-Boot's reset framework.

---
 configs/sifive_fu540_defconfig | 2 ++
 drivers/reset/Kconfig          | 9 +++++++++
 drivers/reset/Makefile         | 1 +
 3 files changed, 12 insertions(+)
configs/sifive_fu540_defconfig +2 -0
index 8d412f8..6d78943 100644
@@ -21,3 +21,5 @@ CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00"
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SPL_CLK=y
 CONFIG_DM_MTD=y
+CONFIG_SPL_DM_RESET=y
+CONFIG_DM_RESET=y
drivers/reset/Kconfig +9 -0
index 88d3be1..627f8e8 100644
@@ -148,4 +148,13 @@ config RESET_IMX7
 	help
 	  Support for reset controller on i.MX7/8 SoCs.
 
+config RESET_SIFIVE
+	bool "Reset Driver for SiFive SoC's"
+	depends on DM_RESET && CLK_SIFIVE_FU540_PRCI && TARGET_SIFIVE_FU540
+	default y
+	help
+	  PRCI module within SiFive SoC's provides mechanism to reset
+	  different hw blocks like DDR, gemgxl. With this driver we leverage
+	  U-Boot's reset framework to reset these hardware blocks.
+
 endmenu
drivers/reset/Makefile +1 -0
index 0a044d5..e3c27c4 100644
@@ -23,3 +23,4 @@ obj-$(CONFIG_RESET_MTMIPS) += reset-mtmips.o
 obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o
 obj-$(CONFIG_RESET_HISILICON) += reset-hisilicon.o
 obj-$(CONFIG_RESET_IMX7) += reset-imx7.o
+obj-$(CONFIG_RESET_SIFIVE) += reset-sifive.o
Signature · 1 line
2.7.4
#18 lore raw

PATCH 5/5 configs: reset: fu540: enable dm reset framework for SiFive SoC

Quoted 4 lines · Sagar Shrikant Kadam

Add necessary defconfig and Kconfig entries to enable SiFive SoC's reset driver so as to utilise U-Boot's reset framework.

Quoted 8 lines
---
 configs/sifive_fu540_defconfig | 2 ++
 drivers/reset/Kconfig          | 9 +++++++++
 drivers/reset/Makefile         | 1 +
 3 files changed, 12 insertions(+)