Skip to contentSkip to conversation

sysreset: Add Atmel/Microchip sysreset driver

PATCH In review Sergiu Moga 2 participants 7 messages Apr 1, 2022 – Apr 27, 2022

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

cover sysreset: Add Atmel/Microchip sysreset driver

This patch series implements the Atmel/Microchip sysreset driver. It also adds the missing RSTC node to the SAM9X60 and SAMA7G5 SoC files and removes the older default reset driver from armv7. The Makefile for arm926ejs has also been updated to ignore the default reset driver if SYSRESET is chosen. What is more, Atmel/Microchip defconfigs now enable sysreset by default.

Sergiu Moga (5):
ARM: dts: at91: Add RSTC node
sysreset: Add Atmel/Microchip sysreset driver
configs: at91: Enable SYSRESET for Atmel/Microchip's platforms
ARM: mach-at91: arm926ejs: Add SYSRESET conditional
ARM: mach-at91: armv7: Remove default reset driver

 arch/arm/dts/sam9x60.dtsi                     |  6 ++
 arch/arm/dts/sama7g5.dtsi                     |  7 ++
 arch/arm/mach-at91/arm926ejs/Makefile         |  2 +
 arch/arm/mach-at91/armv7/Makefile             |  3 -
 arch/arm/mach-at91/armv7/reset.c              | 31 --------
 configs/sam9x60ek_mmc_defconfig               |  3 +
 configs/sam9x60ek_nandflash_defconfig         |  3 +
 configs/sam9x60ek_qspiflash_defconfig         |  3 +
 configs/sama5d27_giantboard_defconfig         |  4 ++
 configs/sama5d27_som1_ek_mmc1_defconfig       |  4 ++
 configs/sama5d27_som1_ek_mmc_defconfig        |  4 ++
 configs/sama5d27_som1_ek_qspiflash_defconfig  |  4 ++
 configs/sama5d27_wlsom1_ek_mmc_defconfig      |  4 ++
 .../sama5d27_wlsom1_ek_qspiflash_defconfig    |  4 ++
 configs/sama5d2_icp_mmc_defconfig             |  4 ++
 configs/sama5d2_icp_qspiflash_defconfig       |  3 +
 configs/sama5d2_ptc_ek_mmc_defconfig          |  3 +
 configs/sama5d2_ptc_ek_nandflash_defconfig    |  3 +
 configs/sama5d2_xplained_emmc_defconfig       |  4 ++
 configs/sama5d2_xplained_mmc_defconfig        |  4 ++
 configs/sama5d2_xplained_qspiflash_defconfig  |  4 ++
 configs/sama5d2_xplained_spiflash_defconfig   |  4 ++
 configs/sama5d36ek_cmp_mmc_defconfig          |  3 +
 configs/sama5d36ek_cmp_nandflash_defconfig    |  3 +
 configs/sama5d36ek_cmp_spiflash_defconfig     |  3 +
 configs/sama5d3_xplained_mmc_defconfig        |  4 ++
 configs/sama5d3_xplained_nandflash_defconfig  |  4 ++
 configs/sama5d3xek_mmc_defconfig              |  4 ++
 configs/sama5d3xek_nandflash_defconfig        |  4 ++
 configs/sama5d3xek_spiflash_defconfig         |  4 ++
 configs/sama5d4_xplained_mmc_defconfig        |  4 ++
 configs/sama5d4_xplained_nandflash_defconfig  |  4 ++
 configs/sama5d4_xplained_spiflash_defconfig   |  4 ++
 configs/sama5d4ek_mmc_defconfig               |  4 ++
 configs/sama5d4ek_nandflash_defconfig         |  4 ++
 configs/sama5d4ek_spiflash_defconfig          |  4 ++
 configs/sama7g5ek_mmc1_defconfig              |  3 +
 configs/sama7g5ek_mmc_defconfig               |  3 +
 configs/vinco_defconfig                       |  3 +
 drivers/sysreset/Kconfig                      | 15 ++++
 drivers/sysreset/Makefile                     |  1 +
 drivers/sysreset/sysreset_at91.c              | 71 +++++++++++++++++++
 42 files changed, 226 insertions(+), 34 deletions(-)
 delete mode 100644 arch/arm/mach-at91/armv7/reset.c
 create mode 100644 drivers/sysreset/sysreset_at91.c
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/5 ARM: dts: at91: Add RSTC node

Add node for RSTC.

---
 arch/arm/dts/sam9x60.dtsi | 6 ++++++
 arch/arm/dts/sama7g5.dtsi | 7 +++++++
 2 files changed, 13 insertions(+)
arch/arm/dts/sam9x60.dtsi +6 -0
index be44519934..733cc5cec9 100644
@@ -223,6 +223,12 @@
 				status = "okay";
 			};
 
+			reset_controller: rstc@fffffe00 {
+				compatible = "microchip,sam9x60-rstc";
+				reg = <0xfffffe00 0x10>;
+				clocks = <&clk32 0>;
+			};
+
 			pit: timer@fffffe40 {
 				compatible = "atmel,at91sam9260-pit";
 				reg = <0xfffffe40 0x10>;
arch/arm/dts/sama7g5.dtsi +7 -0
index b7c261ebe9..7015bd7f6d 100644
@@ -232,6 +232,13 @@
 			clocks = <&clk32k 0>;
 		};
 
+		reset_controller: rstc@e001d000 {
+			compatible = "microchip,sama7g5-rstc", "microchip,sam9x60-rstc";
+			reg = <0xe001d000 0xc>, <0xe001d0e4 0x4>;
+			#reset-cells = <1>;
+			clocks = <&clk32k 0>;
+		};
+
 		clk32k: clock-controller@e001d050 {
 			compatible = "microchip,sama7g5-sckc", "microchip,sam9x60-sckc";
 			reg = <0xe001d050 0x4>;
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/5 sysreset: Add Atmel/Microchip sysreset driver

In reply to Sergiu Moga

This patch adds a sysreset driver for Atmel/Microchip platforms.

---
 drivers/sysreset/Kconfig         | 15 +++++++
 drivers/sysreset/Makefile        |  1 +
 drivers/sysreset/sysreset_at91.c | 71 ++++++++++++++++++++++++++++++++
 3 files changed, 87 insertions(+)
 create mode 100644 drivers/sysreset/sysreset_at91.c
drivers/sysreset/Kconfig +15 -0
index f6d60038b8..25dd02c704 100644
@@ -77,6 +77,21 @@ config SYSRESET_OCTEON
 	  This enables the system reset driver support for Marvell Octeon
 	  SoCs.
 
+config SYSRESET_AT91
+	bool "Enable support for Microchip/Atmel reset driver"
+	depends on ARCH_AT91
+	select SYSRESET_SPL_AT91 if SPL && SPL_SYSRESET
+	help
+	  This enables the system reset driver support for Microchip/Atmel
+	  SoCs.
+
+config SYSRESET_SPL_AT91
+	bool "Enable support for Microchip/Atmel reset driver in SPL"
+	depends on ARCH_AT91
+	help
+	  This enables the system reset driver support for Microchip/Atmel
+	  SoCs in SPL.
+
 config SYSRESET_PSCI
 	bool "Enable support for PSCI System Reset"
 	depends on ARM_PSCI_FW
drivers/sysreset/Makefile +1 -0
index 8e00be0779..0ed3bbf356 100644
@@ -20,5 +20,6 @@ obj-$(CONFIG_SYSRESET_TI_SCI) += sysreset-ti-sci.o
 obj-$(CONFIG_SYSRESET_SYSCON) += sysreset_syscon.o
 obj-$(CONFIG_SYSRESET_WATCHDOG) += sysreset_watchdog.o
 obj-$(CONFIG_SYSRESET_RESETCTL) += sysreset_resetctl.o
+obj-$(CONFIG_SYSRESET_$(SPL_TPL_)AT91) += sysreset_at91.o
 obj-$(CONFIG_$(SPL_TPL_)SYSRESET_X86) += sysreset_x86.o
 obj-$(CONFIG_TARGET_XTFPGA) += sysreset_xtfpga.o
drivers/sysreset/sysreset_at91.c new file +71 -0

71 lines not on this page · raw message

Signature · 1 line
2.25.1
#4 lore raw

PATCH 4/5 ARM: mach-at91: arm926ejs: Add SYSRESET conditional

In reply to Sergiu Moga

This commit adds a condition to the Makefile so that whenever the SYSRESET option is chosen in the configuration, the default reset driver is ignored.

---
 arch/arm/mach-at91/arm926ejs/Makefile | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-at91/arm926ejs/Makefile +2 -0
index c1904d535b..72133e7f85 100644
@@ -19,7 +19,9 @@ obj-$(CONFIG_AT91_EFLASH)	+= eflash.o
 obj-$(CONFIG_AT91_LED)	+= led.o
 obj-y += clock.o
 obj-y += cpu.o
+ifndef CONFIG_$(SPL_TPL_)SYSRESET
 obj-y	+= reset.o
+endif
 ifneq ($(CONFIG_ATMEL_PIT_TIMER),y)
 ifneq ($(CONFIG_MCHP_PIT64B_TIMER),y)
 # old non-DM timer driver
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/5 configs: at91: Enable SYSRESET for Atmel/Microchip's platforms

In reply to Sergiu Moga

This commit enables SYSRESET in the defconfigs for the Atmel/Microchip platforms.

---
 configs/sam9x60ek_mmc_defconfig                | 3 +++
 configs/sam9x60ek_nandflash_defconfig          | 3 +++
 configs/sam9x60ek_qspiflash_defconfig          | 3 +++
 configs/sama5d27_giantboard_defconfig          | 4 ++++
 configs/sama5d27_som1_ek_mmc1_defconfig        | 4 ++++
 configs/sama5d27_som1_ek_mmc_defconfig         | 4 ++++
 configs/sama5d27_som1_ek_qspiflash_defconfig   | 4 ++++
 configs/sama5d27_wlsom1_ek_mmc_defconfig       | 4 ++++
 configs/sama5d27_wlsom1_ek_qspiflash_defconfig | 4 ++++
 configs/sama5d2_icp_mmc_defconfig              | 4 ++++
 configs/sama5d2_icp_qspiflash_defconfig        | 3 +++
 configs/sama5d2_ptc_ek_mmc_defconfig           | 3 +++
 configs/sama5d2_ptc_ek_nandflash_defconfig     | 3 +++
 configs/sama5d2_xplained_emmc_defconfig        | 4 ++++
 configs/sama5d2_xplained_mmc_defconfig         | 4 ++++
 configs/sama5d2_xplained_qspiflash_defconfig   | 4 ++++
 configs/sama5d2_xplained_spiflash_defconfig    | 4 ++++
 configs/sama5d36ek_cmp_mmc_defconfig           | 3 +++
 configs/sama5d36ek_cmp_nandflash_defconfig     | 3 +++
 configs/sama5d36ek_cmp_spiflash_defconfig      | 3 +++
 configs/sama5d3_xplained_mmc_defconfig         | 4 ++++
 configs/sama5d3_xplained_nandflash_defconfig   | 4 ++++
 configs/sama5d3xek_mmc_defconfig               | 4 ++++
 configs/sama5d3xek_nandflash_defconfig         | 4 ++++
 configs/sama5d3xek_spiflash_defconfig          | 4 ++++
 configs/sama5d4_xplained_mmc_defconfig         | 4 ++++
 configs/sama5d4_xplained_nandflash_defconfig   | 4 ++++
 configs/sama5d4_xplained_spiflash_defconfig    | 4 ++++
 configs/sama5d4ek_mmc_defconfig                | 4 ++++
 configs/sama5d4ek_nandflash_defconfig          | 4 ++++
 configs/sama5d4ek_spiflash_defconfig           | 4 ++++
 configs/sama7g5ek_mmc1_defconfig               | 3 +++
 configs/sama7g5ek_mmc_defconfig                | 3 +++
 configs/vinco_defconfig                        | 3 +++
 34 files changed, 124 insertions(+)
configs/sam9x60ek_mmc_defconfig +3 -0
index 238397f0ac..8bff8fc67d 100644
@@ -76,6 +76,9 @@ CONFIG_DM_SERIAL=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_W1=y
 CONFIG_W1_GPIO=y
configs/sam9x60ek_nandflash_defconfig +3 -0
index 0d3e9d0388..e77a297efa 100644
@@ -78,6 +78,9 @@ CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_W1=y
 CONFIG_W1_GPIO=y
 CONFIG_W1_EEPROM=y
configs/sam9x60ek_qspiflash_defconfig +3 -0
index b0f74e61c3..bddf07a636 100644
@@ -90,6 +90,9 @@ CONFIG_DM_SPI=y
 CONFIG_ATMEL_QSPI=y
 CONFIG_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_W1=y
 CONFIG_W1_GPIO=y
 CONFIG_W1_EEPROM=y
configs/sama5d27_giantboard_defconfig +4 -0
index 7d25474260..69b7e90aa6 100644
@@ -84,3 +84,7 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
 CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
configs/sama5d27_som1_ek_mmc1_defconfig +4 -0
index 1df7ae0897..1a9f7d58f4 100644
@@ -90,6 +90,10 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_QSPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d27_som1_ek_mmc_defconfig +4 -0
index adb6580f19..f94f1c76dc 100644
@@ -90,6 +90,10 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_QSPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d27_som1_ek_qspiflash_defconfig +4 -0
index cd5142521a..1b8ba65bf5 100644
@@ -89,6 +89,10 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_QSPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d27_wlsom1_ek_mmc_defconfig +4 -0
index 43be6fbeb3..097031fe04 100644
@@ -95,6 +95,10 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_QSPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d27_wlsom1_ek_qspiflash_defconfig +4 -0
index 574a67e07e..090ab26ef8 100644
@@ -99,6 +99,10 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_QSPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d2_icp_mmc_defconfig +4 -0
index 5b530f0da6..13503c1e7b 100644
@@ -81,6 +81,10 @@ CONFIG_DM_SERIAL=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_OF_LIBFDT_OVERLAY=y
configs/sama5d2_icp_qspiflash_defconfig +3 -0
index e103ae3dde..61c3b4d787 100644
@@ -88,6 +88,9 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_QSPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
configs/sama5d2_ptc_ek_mmc_defconfig +3 -0
index 609e202c34..307c285d1d 100644
@@ -71,6 +71,9 @@ CONFIG_DM_SERIAL=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
configs/sama5d2_ptc_ek_nandflash_defconfig +3 -0
index 132f31a3d4..09bee95f96 100644
@@ -71,6 +71,9 @@ CONFIG_DM_SERIAL=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
configs/sama5d2_xplained_emmc_defconfig +4 -0
index caacbabb7b..a0d59f42fc 100644
@@ -90,6 +90,10 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_QSPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d2_xplained_mmc_defconfig +4 -0
index de9fe9d13b..9891322c55 100644
@@ -92,6 +92,10 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_QSPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d2_xplained_qspiflash_defconfig +4 -0
index 24b509d062..ac10e7044d 100644
@@ -91,6 +91,10 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_QSPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d2_xplained_spiflash_defconfig +4 -0
index e4a2e45965..200b0891b8 100644
@@ -95,6 +95,10 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_ATMEL_QSPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d36ek_cmp_mmc_defconfig +3 -0
index 3732b68cce..6a069de80f 100644
@@ -66,6 +66,9 @@ CONFIG_ATMEL_USART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_DM_VIDEO=y
 # CONFIG_VIDEO_BPP8 is not set
configs/sama5d36ek_cmp_nandflash_defconfig +3 -0
index 2a261400b7..9c66c01e26 100644
@@ -68,6 +68,9 @@ CONFIG_ATMEL_USART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_DM_VIDEO=y
 # CONFIG_VIDEO_BPP8 is not set
configs/sama5d36ek_cmp_spiflash_defconfig +3 -0
index df62e0e85b..035a9e4fcd 100644
@@ -68,6 +68,9 @@ CONFIG_ATMEL_USART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_DM_VIDEO=y
 # CONFIG_VIDEO_BPP8 is not set
configs/sama5d3_xplained_mmc_defconfig +4 -0
index d89b6f3618..a2bbde9f47 100644
@@ -85,6 +85,10 @@ CONFIG_DM_SERIAL=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d3_xplained_nandflash_defconfig +4 -0
index a06f524d0c..64946f5d74 100644
@@ -88,6 +88,10 @@ CONFIG_DM_SERIAL=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d3xek_mmc_defconfig +4 -0
index 8bb3706076..2e640ffc99 100644
@@ -93,6 +93,10 @@ CONFIG_ATMEL_USART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d3xek_nandflash_defconfig +4 -0
index b4568cda31..f97faff02b 100644
@@ -95,6 +95,10 @@ CONFIG_ATMEL_USART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d3xek_spiflash_defconfig +4 -0
index 03c2b208b6..33a4550277 100644
@@ -94,6 +94,10 @@ CONFIG_ATMEL_USART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d4_xplained_mmc_defconfig +4 -0
index 878f3a316f..3e60b7c9d5 100644
@@ -86,6 +86,10 @@ CONFIG_ATMEL_USART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d4_xplained_nandflash_defconfig +4 -0
index 1061762579..c44d30cbe0 100644
@@ -90,6 +90,10 @@ CONFIG_ATMEL_USART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d4_xplained_spiflash_defconfig +4 -0
index 21e9fc3bf1..9567cb1218 100644
@@ -92,6 +92,10 @@ CONFIG_ATMEL_USART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d4ek_mmc_defconfig +4 -0
index 01b2a587df..e31599af3f 100644
@@ -84,6 +84,10 @@ CONFIG_ATMEL_USART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d4ek_nandflash_defconfig +4 -0
index 25e2b98893..0a6ae70cc9 100644
@@ -88,6 +88,10 @@ CONFIG_ATMEL_USART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama5d4ek_spiflash_defconfig +4 -0
index 484df6a4c6..ef659d1706 100644
@@ -87,6 +87,10 @@ CONFIG_ATMEL_USART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
configs/sama7g5ek_mmc1_defconfig +3 -0
index 4ad8115d3a..85e409a2a7 100644
@@ -71,6 +71,9 @@ CONFIG_DM_SERIAL=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_MCHP_PIT64B_TIMER=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 # CONFIG_EFI_LOADER_HII is not set
configs/sama7g5ek_mmc_defconfig +3 -0
index 7bbe6565ef..f6627b886e 100644
@@ -71,6 +71,9 @@ CONFIG_DM_SERIAL=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_TIMER=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
 CONFIG_MCHP_PIT64B_TIMER=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 # CONFIG_EFI_LOADER_HII is not set
configs/vinco_defconfig +3 -0
index 2eb22829ee..2908a2b976 100644
@@ -55,3 +55,6 @@ CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="L+G VInCo"
 CONFIG_USB_GADGET_ATMEL_USBA=y
 CONFIG_USB_ETHER=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_CMD_RESET=y
+CONFIG_SYSRESET_AT91=y
Signature · 1 line
2.25.1
#5 lore raw

PATCH 5/5 ARM: mach-at91: armv7: Remove default reset driver

In reply to Sergiu Moga

This commit removes the default reset driver for armv7, since it is no longer needed due to the presence of the SYSRESET driver.

---
 arch/arm/mach-at91/armv7/Makefile |  3 ---
 arch/arm/mach-at91/armv7/reset.c  | 31 -------------------------------
 2 files changed, 34 deletions(-)
 delete mode 100644 arch/arm/mach-at91/armv7/reset.c
arch/arm/mach-at91/armv7/Makefile +0 -3
index 246050b67b..41f2b2c60b 100644
@@ -11,9 +11,6 @@ obj-$(CONFIG_SAMA5D3)	+= sama5d3_devices.o clock.o
 obj-$(CONFIG_SAMA5D4)	+= sama5d4_devices.o clock.o
 obj-$(CONFIG_SAMA7G5)	+= sama7g5_devices.o
 obj-y += cpu.o
-ifndef CONFIG_$(SPL_TPL_)SYSRESET
-obj-y	+= reset.o
-endif
 ifneq ($(CONFIG_ATMEL_PIT_TIMER),y)
 ifneq ($(CONFIG_MCHP_PIT64B_TIMER),y)
 # old non-DM timer driver
arch/arm/mach-at91/armv7/reset.c deleted +0 -31
deleted file mode 100644
index 1ea415ea9e..0000000000
@@ -1,31 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2007-2008
- * Stelian Pop <[email protected]>
- * Lead Tech Design <www.leadtechdesign.com>
- *
- * (C) Copyright 2013
- * Bo Shen <[email protected]>
- */
-
-#include <common.h>
-#include <cpu_func.h>
-#include <asm/io.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/at91_rstc.h>
-
-/* Reset the cpu by telling the reset controller to do so */
-void reset_cpu(void)
-{
-	at91_rstc_t *rstc = (at91_rstc_t *)ATMEL_BASE_RSTC;
-
-	writel(AT91_RSTC_KEY
-		| AT91_RSTC_CR_PROCRST	/* Processor Reset */
-		| AT91_RSTC_CR_PERRST	/* Peripheral Reset */
-#ifdef CONFIG_AT91RESET_EXTRST
-		| AT91_RSTC_CR_EXTRST	/* External Reset (assert nRST pin) */
-#endif
-		, &rstc->cr);
-	/* never reached */
-	do { } while (1);
-}
Signature · 1 line
2.25.1
#6 lore raw
In reply to Sergiu Moga
Quoted 56 lines · Sergiu Moga

This patch series implements the Atmel/Microchip sysreset driver. It also adds the missing RSTC node to the SAM9X60 and SAMA7G5 SoC files and removes the older default reset driver from armv7. The Makefile for arm926ejs has also been updated to ignore the default reset driver if SYSRESET is chosen. What is more, Atmel/Microchip defconfigs now enable sysreset by default.

Sergiu Moga (5):
ARM: dts: at91: Add RSTC node
sysreset: Add Atmel/Microchip sysreset driver
configs: at91: Enable SYSRESET for Atmel/Microchip's platforms
ARM: mach-at91: arm926ejs: Add SYSRESET conditional
ARM: mach-at91: armv7: Remove default reset driver

  arch/arm/dts/sam9x60.dtsi                     |  6 ++
  arch/arm/dts/sama7g5.dtsi                     |  7 ++
  arch/arm/mach-at91/arm926ejs/Makefile         |  2 +
  arch/arm/mach-at91/armv7/Makefile             |  3 -
  arch/arm/mach-at91/armv7/reset.c              | 31 --------
  configs/sam9x60ek_mmc_defconfig               |  3 +
  configs/sam9x60ek_nandflash_defconfig         |  3 +
  configs/sam9x60ek_qspiflash_defconfig         |  3 +
  configs/sama5d27_giantboard_defconfig         |  4 ++
  configs/sama5d27_som1_ek_mmc1_defconfig       |  4 ++
  configs/sama5d27_som1_ek_mmc_defconfig        |  4 ++
  configs/sama5d27_som1_ek_qspiflash_defconfig  |  4 ++
  configs/sama5d27_wlsom1_ek_mmc_defconfig      |  4 ++
  .../sama5d27_wlsom1_ek_qspiflash_defconfig    |  4 ++
  configs/sama5d2_icp_mmc_defconfig             |  4 ++
  configs/sama5d2_icp_qspiflash_defconfig       |  3 +
  configs/sama5d2_ptc_ek_mmc_defconfig          |  3 +
  configs/sama5d2_ptc_ek_nandflash_defconfig    |  3 +
  configs/sama5d2_xplained_emmc_defconfig       |  4 ++
  configs/sama5d2_xplained_mmc_defconfig        |  4 ++
  configs/sama5d2_xplained_qspiflash_defconfig  |  4 ++
  configs/sama5d2_xplained_spiflash_defconfig   |  4 ++
  configs/sama5d36ek_cmp_mmc_defconfig          |  3 +
  configs/sama5d36ek_cmp_nandflash_defconfig    |  3 +
  configs/sama5d36ek_cmp_spiflash_defconfig     |  3 +
  configs/sama5d3_xplained_mmc_defconfig        |  4 ++
  configs/sama5d3_xplained_nandflash_defconfig  |  4 ++
  configs/sama5d3xek_mmc_defconfig              |  4 ++
  configs/sama5d3xek_nandflash_defconfig        |  4 ++
  configs/sama5d3xek_spiflash_defconfig         |  4 ++
  configs/sama5d4_xplained_mmc_defconfig        |  4 ++
  configs/sama5d4_xplained_nandflash_defconfig  |  4 ++
  configs/sama5d4_xplained_spiflash_defconfig   |  4 ++
  configs/sama5d4ek_mmc_defconfig               |  4 ++
  configs/sama5d4ek_nandflash_defconfig         |  4 ++
  configs/sama5d4ek_spiflash_defconfig          |  4 ++
  configs/sama7g5ek_mmc1_defconfig              |  3 +
  configs/sama7g5ek_mmc_defconfig               |  3 +
  configs/vinco_defconfig                       |  3 +
  drivers/sysreset/Kconfig                      | 15 ++++
  drivers/sysreset/Makefile                     |  1 +
  drivers/sysreset/sysreset_at91.c              | 71 +++++++++++++++++++
  42 files changed, 226 insertions(+), 34 deletions(-)
Quoted 3 lines

delete mode 100644 arch/arm/mach-at91/armv7/reset.c create mode 100644 drivers/sysreset/sysreset_at91.c

Applied to u-boot-at91/master , thanks !