[U-Boot] [PATCH v6 07/11] sysreset: enable driver support in SPL/TPL
Kever Yang
kever.yang at rock-chips.com
Tue Apr 2 12:41:25 UTC 2019
SPL/TPL also need use sysreset for some feature like panic callback.
Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
---
Changes in v6:
- update defconfig for stm32mp15_basic, am65x_evm_r5, mt7629_rfb,
x86, sandbox... to enable SPL_SYSRESET.
arch/Kconfig | 1 +
arch/arm/Kconfig | 1 +
configs/am65x_evm_a53_defconfig | 1 +
configs/am65x_evm_r5_defconfig | 1 +
configs/mt7629_rfb_defconfig | 1 +
configs/sandbox_spl_defconfig | 1 +
drivers/sysreset/Kconfig | 18 ++++++++++++++++++
drivers/sysreset/Makefile | 2 +-
8 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/arch/Kconfig b/arch/Kconfig
index 2f3d07c13a..562f9ea692 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -158,6 +158,7 @@ config X86
imply DM_USB
imply DM_VIDEO
imply SYSRESET
+ imply SPL_SYSRESET
imply SYSRESET_X86
imply USB_ETHER_ASIX
imply USB_ETHER_SMSC95XX
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 18e8d9355c..3f67d98755 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1433,6 +1433,7 @@ config ARCH_STM32MP
select SYSRESET
select SYS_THUMB_BUILD
imply CMD_DM
+ imply SPL_SYSRESET
help
Support for STM32MP SoC family developed by STMicroelectronics,
MPUs based on ARM cortex A core
diff --git a/configs/am65x_evm_a53_defconfig b/configs/am65x_evm_a53_defconfig
index 8f6fd25531..23db645c24 100644
--- a/configs/am65x_evm_a53_defconfig
+++ b/configs/am65x_evm_a53_defconfig
@@ -68,4 +68,5 @@ CONFIG_DM_RESET=y
CONFIG_RESET_TI_SCI=y
CONFIG_DM_SERIAL=y
CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
CONFIG_SYSRESET_TI_SCI=y
diff --git a/configs/am65x_evm_r5_defconfig b/configs/am65x_evm_r5_defconfig
index 49498b13b6..0371189688 100644
--- a/configs/am65x_evm_r5_defconfig
+++ b/configs/am65x_evm_r5_defconfig
@@ -82,6 +82,7 @@ CONFIG_DM_RESET=y
CONFIG_RESET_TI_SCI=y
CONFIG_DM_SERIAL=y
CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
CONFIG_SYSRESET_TI_SCI=y
CONFIG_TIMER=y
CONFIG_SPL_TIMER=y
diff --git a/configs/mt7629_rfb_defconfig b/configs/mt7629_rfb_defconfig
index 459c67827d..f9de4b26df 100644
--- a/configs/mt7629_rfb_defconfig
+++ b/configs/mt7629_rfb_defconfig
@@ -64,6 +64,7 @@ CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_MTK_QSPI=y
CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
CONFIG_SYSRESET_WATCHDOG=y
CONFIG_TIMER=y
CONFIG_SPL_TIMER=y
diff --git a/configs/sandbox_spl_defconfig b/configs/sandbox_spl_defconfig
index 012f3342ac..784a2fe4bb 100644
--- a/configs/sandbox_spl_defconfig
+++ b/configs/sandbox_spl_defconfig
@@ -174,6 +174,7 @@ CONFIG_SANDBOX_SPI=y
CONFIG_SPMI=y
CONFIG_SPMI_SANDBOX=y
CONFIG_SYSRESET=y
+CONFIG_SPL_SYSRESET=y
CONFIG_TIMER=y
CONFIG_TIMER_EARLY=y
CONFIG_SANDBOX_TIMER=y
diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig
index 8ce3e2e207..d456f0ce36 100644
--- a/drivers/sysreset/Kconfig
+++ b/drivers/sysreset/Kconfig
@@ -13,6 +13,24 @@ config SYSRESET
to effect a reset. The uclass will try all available drivers when
reset_walk() is called.
+config SPL_SYSRESET
+ bool "Enable support for system reset drivers in SPL mode"
+ depends on SYSRESET && SPL_DM
+ help
+ Enable system reset drivers which can be used to reset the CPU or
+ board. Each driver can provide a reset method which will be called
+ to effect a reset. The uclass will try all available drivers when
+ reset_walk() is called.
+
+config TPL_SYSRESET
+ bool "Enable support for system reset drivers in TPL mode"
+ depends on SYSRESET && TPL_DM
+ help
+ Enable system reset drivers which can be used to reset the CPU or
+ board. Each driver can provide a reset method which will be called
+ to effect a reset. The uclass will try all available drivers when
+ reset_walk() is called.
+
if SYSRESET
config SYSRESET_GPIO
diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
index b3728ac17f..8e1c845dfe 100644
--- a/drivers/sysreset/Makefile
+++ b/drivers/sysreset/Makefile
@@ -2,7 +2,7 @@
#
# (C) Copyright 2016 Cadence Design Systems Inc.
-obj-$(CONFIG_SYSRESET) += sysreset-uclass.o
+obj-$(CONFIG_$(SPL_TPL_)SYSRESET) += sysreset-uclass.o
obj-$(CONFIG_ARCH_ASPEED) += sysreset_ast.o
obj-$(CONFIG_ARCH_ROCKCHIP) += sysreset_rockchip.o
obj-$(CONFIG_ARCH_STI) += sysreset_sti.o
--
2.20.1
More information about the U-Boot
mailing list