Skip to contentSkip to conversation

Refactor AST2500 reset control

PATCH New Chia-Wei 3 participants 6 messages Oct 15, 2020 – Oct 23, 2020

Subsystems (3)
lore
Share & tools
lore

Chia-Wei

#0 lore raw

v3 cover Refactor AST2500 reset control

This patch series refactors the reset method to use the System Control Unit (SCU) reset control for simplicity.

In addition, the naming of reset driver and Kconfig option is also refined for future consistency.

v3:
- Fix Makefile to adapt to the renamed reset driver file

v2:
- Rebase patches to fix conflict

Chia-Wei, Wang (2):
reset: ast2500: Use SCU for reset control
cosmetic: reset: ast2500: Rename driver and configs

 arch/arm/dts/ast2500-u-boot.dtsi          |   7 +-
 drivers/reset/Kconfig                     |  11 +--
 drivers/reset/Makefile                    |   2 +-
 drivers/reset/ast2500-reset.c             | 104 ---------------------
 drivers/reset/reset-ast2500.c             | 109 ++++++++++++++++++++++
 include/dt-bindings/reset/ast2500-reset.h |  73 ++++++++-------
 6 files changed, 157 insertions(+), 149 deletions(-)
 delete mode 100644 drivers/reset/ast2500-reset.c
 create mode 100644 drivers/reset/reset-ast2500.c
Signature · 1 line
2.17.1
#1 lore raw

PATCH v3 1/2 reset: ast2500: Use SCU for reset control

The System Control Unit (SCU) controller of Aspeed SoCs provides the reset control for each peripheral.

This patch refactors the reset method to leverage the SCU reset control. Thus the driver dependency on watchdog including dedicated WDT API and reset flag encoding can be eliminated.

The Kconfig description is also updated accordingly.

---
 arch/arm/dts/ast2500-u-boot.dtsi          |  7 +-
 drivers/reset/Kconfig                     |  9 +--
 drivers/reset/ast2500-reset.c             | 97 ++++++++++++-----------
 include/dt-bindings/reset/ast2500-reset.h | 73 +++++++++--------
 4 files changed, 97 insertions(+), 89 deletions(-)
arch/arm/dts/ast2500-u-boot.dtsi +3 -4
index 51a5244766..ea60e4c8db 100644
@@ -16,7 +16,6 @@
 	rst: reset-controller {
 		u-boot,dm-pre-reloc;
 		compatible = "aspeed,ast2500-reset";
-		aspeed,wdt = <&wdt1>;
 		#reset-cells = <1>;
 	};
 
@@ -27,7 +26,7 @@
 			0x1e6e0200 0x1d4 >;
 		#reset-cells = <1>;
 		clocks = <&scu ASPEED_CLK_MPLL>;
-		resets = <&rst AST_RESET_SDRAM>;
+		resets = <&rst ASPEED_RESET_SDRAM>;
 	};
 
 	ahb {
@@ -41,7 +40,7 @@
 				reg = <0x1e740100>;
 				#reset-cells = <1>;
 				clocks = <&scu ASPEED_CLK_SDIO>;
-				resets = <&rst AST_RESET_SDIO>;
+				resets = <&rst ASPEED_RESET_SDIO>;
 			};
 
 			sdhci1: sdhci at 1e740200 {
@@ -49,7 +48,7 @@
 				reg = <0x1e740200>;
 				#reset-cells = <1>;
 				clocks = <&scu ASPEED_CLK_SDIO>;
-				resets = <&rst AST_RESET_SDIO>;
+				resets = <&rst ASPEED_RESET_SDIO>;
 			};
 		};
 
drivers/reset/Kconfig +4 -5
index b60e11f98b..8b243fdcc6 100644
@@ -74,13 +74,12 @@ config RESET_UNIPHIER
 
 config AST2500_RESET
 	bool "Reset controller driver for AST2500 SoCs"
-	depends on DM_RESET && WDT_ASPEED
+	depends on DM_RESET
 	default y if ASPEED_AST2500
 	help
-	  Support for reset controller on AST2500 SoC. This controller uses
-	  watchdog to reset different peripherals and thus only supports
-	  resets that are supported by watchdog. The main limitation though
-	  is that some reset signals, like I2C or MISC reset multiple devices.
+	  Support for reset controller on AST2500 SoC.
+	  Say Y if you want to control reset signals of different peripherals
+	  through System Control Unit (SCU).
 
 config RESET_ROCKCHIP
 	bool "Reset controller driver for Rockchip SoCs"
drivers/reset/ast2500-reset.c +51 -46

148 lines not on this page · raw message

include/dt-bindings/reset/ast2500-reset.h +39 -34

83 lines not on this page · raw message

Signature · 1 line
2.17.1
#3 lore raw

PATCH v3 2/2 cosmetic: reset: ast2500: Rename driver and configs

In reply to Chia-Wei

1. Rename AST2500 reset driver from ast2500-reset.c to reset-ast2500.c
2. Rename AST2500 reset kconfig option from AST2500_RESET to RESET_AST2500

---
 drivers/reset/Kconfig                              | 2 +-
 drivers/reset/Makefile                             | 2 +-
 drivers/reset/{ast2500-reset.c => reset-ast2500.c} | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename drivers/reset/{ast2500-reset.c => reset-ast2500.c} (100%)
drivers/reset/Kconfig +1 -1
index 8b243fdcc6..33c2736554 100644
@@ -72,7 +72,7 @@ config RESET_UNIPHIER
 	  Say Y if you want to control reset signals provided by System Control
 	  block, Media I/O block, Peripheral Block.
 
-config AST2500_RESET
+config RESET_AST2500
 	bool "Reset controller driver for AST2500 SoCs"
 	depends on DM_RESET
 	default y if ASPEED_AST2500
drivers/reset/Makefile +1 -1
index 10a7973f82..fa52aa3329 100644
@@ -14,7 +14,7 @@ obj-$(CONFIG_RESET_TI_SCI) += reset-ti-sci.o
 obj-$(CONFIG_RESET_HSDK) += reset-hsdk.o
 obj-$(CONFIG_RESET_BCM6345) += reset-bcm6345.o
 obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o
-obj-$(CONFIG_AST2500_RESET) += ast2500-reset.o
+obj-$(CONFIG_RESET_AST2500) += reset-ast2500.o
 obj-$(CONFIG_RESET_ROCKCHIP) += reset-rockchip.o
 obj-$(CONFIG_RESET_MESON) += reset-meson.o
 obj-$(CONFIG_RESET_SOCFPGA) += reset-socfpga.o
drivers/reset/reset-ast2500.c renamed from drivers/reset/ast2500-reset.c +0 -0
similarity index 100%
rename from drivers/reset/ast2500-reset.c
rename to drivers/reset/reset-ast2500.c
Signature · 1 line
2.17.1
#5 lore raw

v3 cover Refactor AST2500 reset control

In reply to Chia-Wei

Hi Tom,

The patches has been rebased onto the up-to-date U-Boot master.
A makefile error is also fixed in the revised version and verified with an AST2500 EVB.

Thanks,
Chiawei

Quoted 36 lines

-----Original Message-----
From: ChiaWei Wang <[email protected]>
Sent: Thursday, October 15, 2020 10:25 AM
To: trini at konsulko.com; u-boot at lists.denx.de; maxims at google.com
Subject: [v3 0/2] Refactor AST2500 reset control

This patch series refactors the reset method to use the System Control Unit (SCU) reset control for simplicity.

In addition, the naming of reset driver and Kconfig option is also refined for future consistency.

v3:
- Fix Makefile to adapt to the renamed reset driver file

v2:
- Rebase patches to fix conflict

Chia-Wei, Wang (2):
reset: ast2500: Use SCU for reset control
cosmetic: reset: ast2500: Rename driver and configs

 arch/arm/dts/ast2500-u-boot.dtsi          |   7 +-
 drivers/reset/Kconfig                     |  11 +--
 drivers/reset/Makefile                    |   2 +-
 drivers/reset/ast2500-reset.c             | 104 ---------------------
 drivers/reset/reset-ast2500.c             | 109
++++++++++++++++++++++
 include/dt-bindings/reset/ast2500-reset.h |  73 ++++++++-------
 6 files changed, 157 insertions(+), 149 deletions(-)  delete mode 100644

drivers/reset/ast2500-reset.c create mode 100644
drivers/reset/reset-ast2500.c

--
2.17.1

#2 lore raw

PATCH v3 1/2 reset: ast2500: Use SCU for reset control

In reply to Chia-Wei
Quoted 8 lines · Wang

The System Control Unit (SCU) controller of Aspeed SoCs provides the reset control for each peripheral.

This patch refactors the reset method to leverage the SCU reset control. Thus the driver dependency on watchdog including dedicated WDT API and reset flag encoding can be eliminated.

Quoted 4 lines

The Kconfig description is also updated accordingly.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201022/5ce85757/attachment.sig>
#4 lore raw

PATCH v3 2/2 cosmetic: reset: ast2500: Rename driver and configs

In reply to Chia-Wei
Quoted 7 lines · Wang

1. Rename AST2500 reset driver from ast2500-reset.c to reset-ast2500.c
2. Rename AST2500 reset kconfig option from AST2500_RESET to RESET_AST2500

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201022/1a257ac9/attachment.sig>