From 667afb3b91703dafd40acbcfd776c4b850e6925a Mon Sep 17 00:00:00 2001 From: Satoshi Togawa Date: Thu, 23 Jun 2022 16:51:01 +0900 Subject: [PATCH] sama5: add config SAMA5_SYSTEMRESET in arch/arm/src/Kconfig SAMA5D2 and SAMA5D4 does not support external reset. Some SAMA5 board's Kconfig contain item SAMA5_SYSTEMRESET, but it is better in arch/arm/src/Kconfig. --- arch/arm/src/sama5/Kconfig | 27 +++++++++++++++++++++++++++ boards/arm/sama5/giant-board/Kconfig | 4 ---- boards/arm/sama5/sama5d2-xult/Kconfig | 4 ---- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/arch/arm/src/sama5/Kconfig b/arch/arm/src/sama5/Kconfig index b5d583652a..0b27615e94 100644 --- a/arch/arm/src/sama5/Kconfig +++ b/arch/arm/src/sama5/Kconfig @@ -169,6 +169,10 @@ config SAMA5_HAVE_VDEC bool default n +config SAMA5_HAVE_RSTC_EXTRST + bool + default n + # Summary configurations config SAMA5_FLEXCOM @@ -228,6 +232,7 @@ config ARCH_CHIP_SAMA5D3 select SAMA5_HAVE_USART1 select SAMA5_HAVE_USART2 select SAMA5_HAVE_USART3 + select SAMA5_HAVE_RSTC_EXTRST config ARCH_CHIP_SAMA5D4 bool @@ -756,6 +761,28 @@ config SAMA5_VDEC endmenu # SAMA5 Peripheral Support +config SAMA5_SYSTEMRESET + bool "Enable System Reset" + select ARCH_HAVE_RESET + ---help--- + Enable up_systemreset + +if SAMA5_SYSTEMRESET && SAMA5_HAVE_RSTC_EXTRST + +config SAMA5_EXTRESET_ERST + int "Drive External nRST duration" + default 0 + range 0 16 + ---help--- + Define if the external reset (nRST) will be generated in up_systemreset + and for how long: + + - A value of 0 will not drive the external reset + - A value of 1-16 will drive the external reset for 2^SAMA5_EXTRESET_ERST + slow clock cycles. + +endif # SAMA5_SYSTEMRESET + config SAMA5_PIO_IRQ bool "PIO pin interrupts" ---help--- diff --git a/boards/arm/sama5/giant-board/Kconfig b/boards/arm/sama5/giant-board/Kconfig index 14e2481867..abd800b259 100644 --- a/boards/arm/sama5/giant-board/Kconfig +++ b/boards/arm/sama5/giant-board/Kconfig @@ -119,8 +119,4 @@ config SAMA5_SDMMC1_WIDTH_D1_D4 default y depends on SAMA5_SDMMC1 -config SAMA5_SYSTEMRESET - bool "Enable system reset - this will enable the nsh reboot command" - select BOARDCTL_RESET - endif # ARCH_BOARD_GIANT_BOARD diff --git a/boards/arm/sama5/sama5d2-xult/Kconfig b/boards/arm/sama5/sama5d2-xult/Kconfig index 4ee94b80b8..dbe2c5e475 100644 --- a/boards/arm/sama5/sama5d2-xult/Kconfig +++ b/boards/arm/sama5/sama5d2-xult/Kconfig @@ -127,8 +127,4 @@ config SAMA5_SDMMC1_WIDTH_D1_D4 default y depends on SAMA5_SDMMC1 -config SAMA5_SYSTEMRESET - bool "Enable system reset - this will enable the nsh reboot command" - select BOARDCTL_RESET - endif # ARCH_BOARD_SAMA5D2_XULT