watchdog: omap_wdt: Disable DM watchdog support in SPL
PATCH 2/2 watchdog: omap_wdt: Disable DM watchdog support in SPL
From: Suniel Mahesh <[email protected]>
This patch disables DM watchdog support for SPL builds and uses the legacy omap watchdog on TI AM335x chipsets.
The following build error is reported if DM watchdog support was enabled in SPL:
CC spl/drivers/usb/gadget/rndis.o LD spl/drivers/usb/gadget/built-in.o LD spl/drivers/usb/musb-new/built-in.o LD spl/drivers/built-in.o LD spl/u-boot-spl
arm-linux-ld.bfd: u-boot-spl section .u_boot_list will not fit in region .sram arm-linux-ld.bfd: region .sram overflowed by 440 bytes
make[1]: *** [spl/u-boot-spl] Error 1
make: *** [spl/u-boot-spl] Error 2
Tested on BeagleboneBlack board.
---
Notes:
- CONFIG_WATCHDOG replaces CONFIG_HW_WATCHDOG, earlier WATCHDOG_RESET macro used to point to hw_watchdog_reset() in include/watchdog.h. Now since we use CONFIG_WATCHDOG, here WATCHDOG_RESET macro points to watchdog_reset(). This watchdog_reset() is not defined anywhere and needs to be defined. Fixed this by simply calling hw_watchdog_reset() in watchdog_reset() (driver/watchdog/omap_wdt.c). Hope this is ok
- CONFIG_SPL_DM is disabled in board defconfig file. Hope this is ok
- there are 13 boards I think which are using AM335X SOC. All these board defconfig files to be changed if this gets accepted to follow DM/DT WDT in u-boot and non DM/DT in spl.
- This patch series is heavily dependant on:
https://patchwork.ozlabs.org/patch/1112591/
waiting for it to get applied.
--- arch/arm/mach-omap2/boot-common.c | 2 +- configs/am335x_evm_defconfig | 1 + drivers/watchdog/omap_wdt.c | 7 +++++++ include/watchdog.h | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/boot-common.c +1 -1
@@ -208,7 +208,7 @@ void spl_board_init(void)#if defined(CONFIG_AM33XX ) && defined(CONFIG_SPL_MUSB_NEW_SUPPORT )arch_misc_init ();#endif -#if defined(CONFIG_HW_WATCHDOG ) +#if defined(CONFIG_HW_WATCHDOG ) || defined(CONFIG_WATCHDOG )hw_watchdog_init ();#endif #ifdef CONFIG_AM33XX
configs/am335x_evm_defconfig +1 -0
@@ -60,6 +60,7 @@ CONFIG_TIMER=y CONFIG_OMAP_TIMER=y CONFIG_WDT=y CONFIG_WDT_OMAP3=y +# CONFIG_SPL_WDT is not set CONFIG_USB=y CONFIG_DM_USB=y CONFIG_DM_USB_GADGET=y
drivers/watchdog/omap_wdt.c +7 -0
@@ -138,7 +138,14 @@ void hw_watchdog_init(void)while ((readl (&wdt->wdtwwps)) &WDT_WWPS_PEND_WSPR ) ; } + +void watchdog_reset (void ) +{ +hw_watchdog_reset (); +} +#else +static int omap3_wdt_reset (struct udevice *dev) {struct omap3_wdt_priv *priv =dev_get_priv (dev);
include/watchdog.h +1 -1
@@ -77,7 +77,7 @@ int init_func_watchdog_reset(void);* Prototypes from $(CPU)/cpu.c. */ -#if defined(CONFIG_HW_WATCHDOG ) && !defined(__ASSEMBLY__) +#if defined(CONFIG_HW_WATCHDOG ) || defined(CONFIG_WATCHDOG ) && !defined(__ASSEMBLY__)void hw_watchdog_init (void );#endif
Signature · 1 line
1.9.1
PATCH 2/2 watchdog: omap_wdt: Disable DM watchdog support in SPL
Quoted 12 lines · sunil.m at techveda.org
From: Suniel Mahesh <[email protected]>
This patch disables DM watchdog support for SPL builds and uses the legacy omap watchdog on TI AM335x chipsets.
The following build error is reported if DM watchdog support was enabled in SPL:
CC spl/drivers/usb/gadget/rndis.o LD spl/drivers/usb/gadget/built-in.o LD spl/drivers/usb/musb-new/built-in.o LD spl/drivers/built-in.o LD spl/u-boot-spl
Quoted 8 lines
arm-linux-ld.bfd: u-boot-spl section .u_boot_list will not fit in region .sram arm-linux-ld.bfd: region .sram overflowed by 440 bytes
make[1]: *** [spl/u-boot-spl] Error 1
make: *** [spl/u-boot-spl] Error 2Tested on BeagleboneBlack board.
Signed-off-by Suniel Mahesh <[email protected]>
My concern here is that if we don't configure the watchdog we could now end up in the case where the WDT trips while we're doing a slow boot such as UART. As was mentioned elsewhere we might need to switch to using platdata so this still fits? And we will need the whole of "omap2" to build after this is applied, thanks.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190717/8c94b2be/attachment.sig>
PATCH 2/2 watchdog: omap_wdt: Disable DM watchdog support in SPL
Quoted 19 lines · Tom Rini
Quoted 17 lines · sunil.m at techveda.org
From: Suniel Mahesh <[email protected]>
This patch disables DM watchdog support for SPL builds and uses the legacy omap watchdog on TI AM335x chipsets.
The following build error is reported if DM watchdog support was enabled in SPL:
CC spl/drivers/usb/gadget/rndis.o LD spl/drivers/usb/gadget/built-in.o LD spl/drivers/usb/musb-new/built-in.o LD spl/drivers/built-in.o LD spl/u-boot-splarm-linux-ld.bfd: u-boot-spl section .u_boot_list will not fit in region .sram arm-linux-ld.bfd: region .sram overflowed by 440 bytes
make[1]: *** [spl/u-boot-spl] Error 1
make: *** [spl/u-boot-spl] Error 2
Quoted 7 lines
Quoted 3 lines
Tested on BeagleboneBlack board.
Signed-off-by Suniel Mahesh <[email protected]>My concern here is that if we don't configure the watchdog we could now end up in the case where the WDT trips while we're doing a slow boot such as UART.
Here in SPL, watchdog is configured but it doesn't use DT and DM. It uses legacy driver(non DT/non DM). I have also tested a slow boot(UART) as you indicated on AM335X based BeagleboneBlack board. Here are the results:
1. SPL trying to load u-boot via UART, if it can't find it, then we need to reset the board:
U-Boot SPL 2019.07-00058-g076875b-dirty (Jul 18 2019 - 10:39:43 +0530) Trying to boot from UART
CCCCCCCCCCspl: ymodem err - Timed out
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
2. if we provide u-boot-dtb.bin, then it loads without any problem.
Hope I gave some inputs here.
As was mentioned elsewhere we might need to switch to
Quoted 1 line
using platdata so this still fits?
right now watchdog driver in SPL is not using platdata, its just a plain driver. Do we need to convert the driver in SPL to use platdata ?
And we will need the whole of
Quoted 2 lines
"omap2" to build after this is applied, thanks.
yes this needs to be done, once all these are fixed and more over these patches are dependant on Marek Vasuts's patches.
https://patchwork.ozlabs.org/patch/1112591/
Regards
Sunil
PATCH v2 1/2 watchdog: omap_wdt: Convert watchdog driver to use DT and DM
In reply to Tom RiniFrom: Suniel Mahesh <[email protected]>
This patch adds device tree and driver model watchdog support, converts the legacy omap watchdog driver to driver model for TI AM335x chipsets. The following compile warning is removed:
===================== WARNING ====================== This board does not use CONFIG_WDT (DM watchdog support). Please update the board to use CONFIG_WDT before the v2019.10 release.
Failure to update by the deadline may result in board removal. See doc/driver-model/MIGRATION.txt for more info.
====================================================
CONFIG_HW_WATCHDOG is no more a default option for AM33XX devices after DT/DM conversion, adjusted kconfig accordingly.
DM watchdog support is enabled by default in SPL. The SPL image doesn't fit into SRAM because of size constraints and build breaks with an overflow. For this reason DM watchdog support should be disabled in SPL, driver code should be adjusted accordingly to serve this purpose.
Built and tested on AM335x device (BeagleboneBlack), compile tested for all other AM33xx based boards.
---
Changes for v2:
- changed description a bit to make more sense.
- Travis CI build is performed on am33xx, omap branches apart from others.
https://travis-ci.org/sunielmahesh/u-boot/builds/566028250?utm_medium=notification&utm_source=email"
--- arch/arm/include/asm/ti-common/omap_wdt.h | 5 ++ configs/am335x_evm_defconfig | 2 + drivers/watchdog/Kconfig | 9 ++- drivers/watchdog/Makefile | 1 + drivers/watchdog/omap_wdt.c | 114 ++++++++++++++++++++++++++++++ 5 files changed, 130 insertions(+), 1 deletion(-)
arch/arm/include/asm/ti-common/omap_wdt.h +5 -0
@@ -56,4 +56,9 @@ struct wd_timer { unsigned int wdt_unfr; /* offset 0x100 */ }; +struct omap3_wdt_priv { +struct wd_timer *regs; +unsigned int wdt_trgr_pattern; +}; +#endif /* __OMAP_WDT_H__ */
configs/am335x_evm_defconfig +2 -0
@@ -58,6 +58,8 @@ CONFIG_DM_SPI=y CONFIG_OMAP3_SPI=y CONFIG_TIMER=y CONFIG_OMAP_TIMER=y +CONFIG_WDT=y +CONFIG_WDT_OMAP3=y CONFIG_USB=y CONFIG_DM_USB=y CONFIG_DM_USB_GADGET=y
drivers/watchdog/Kconfig +8 -1
@@ -37,7 +37,6 @@ config OMAP_WATCHDOG bool "TI OMAP watchdog driver" depends on ARCH_OMAP2PLUS select HW_WATCHDOG - default y if AM33XX help Say Y here to enable the OMAP3+ watchdog driver.
@@ -122,6 +121,14 @@ config WDT_MTK The watchdog timer is stopped when initialized. It performs full SoC reset. +config WDT_OMAP3 + bool "TI OMAP watchdog timer support" + depends on WDT && ARCH_OMAP2PLUS + default y if AM33XX + help + This enables OMAP3+ watchdog timer driver, which can be + found on some TI chipsets and inline with driver model. + config WDT_ORION bool "Orion watchdog timer support" depends on WDT
drivers/watchdog/Makefile +1 -0
@@ -26,6 +26,7 @@ obj-$(CONFIG_WDT_CDNS) += cdns_wdt.o obj-$(CONFIG_WDT_MPC8xx) += mpc8xx_wdt.o obj-$(CONFIG_WDT_MT7621) += mt7621_wdt.o obj-$(CONFIG_WDT_MTK) += mtk_wdt.o +obj-$(CONFIG_WDT_OMAP3) += omap_wdt.o obj-$(CONFIG_WDT_SP805) += sp805_wdt.o obj-$(CONFIG_WDT_STM32MP) += stm32mp_wdt.o obj-$(CONFIG_WDT_TANGIER) += tangier_wdt.o
drivers/watchdog/omap_wdt.c +114 -0
127 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 2/2 watchdog: omap_wdt: Disable DM watchdog support in SPL
From: Suniel Mahesh <[email protected]>
This patch disables DM watchdog support for SPL builds and uses the legacy omap watchdog driver on TI AM335x chipsets.
The following build error is reported if DM watchdog support was enabled in SPL:
CC spl/drivers/usb/gadget/rndis.o LD spl/drivers/usb/gadget/built-in.o LD spl/drivers/usb/musb-new/built-in.o LD spl/drivers/built-in.o LD spl/u-boot-spl
arm-linux-ld.bfd: u-boot-spl section .u_boot_list will not fit in region .sram arm-linux-ld.bfd: region .sram overflowed by 440 bytes
make[1]: *** [spl/u-boot-spl] Error 1
make: *** [spl/u-boot-spl] Error 2
Adjusted WATCHDOG_RESET macro accordingly. Earlier it was pointing to hw_watchdog_reset. Since CONFIG_WATCHDOG replaces CONFIG_HW_WATCHDOG, now WATCHDOG_RESET macro points to watchdog_reset. This watchdog_reset is not defined anywhere for am33xx/omap2 and needs to be defined. Fixed this by simply calling hw_watchdog_reset in watchdog_reset.
Built and tested on AM335x device (BeagleboneBlack), compile tested for all other AM33xx/omap2 based boards.
---
Changes for v2:
- changed description a bit to make more sense.
- As suggested by Tom Rini, Travis CI build is performed on am33xx, omap branches apart from others, it is a success.
https://travis-ci.org/sunielmahesh/u-boot/builds/566028250?utm_medium=notification&utm_source=email"
--- arch/arm/mach-omap2/boot-common.c | 2 +- configs/am335x_evm_defconfig | 1 + drivers/watchdog/omap_wdt.c | 7 +++++++ include/watchdog.h | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/boot-common.c +1 -1
@@ -208,7 +208,7 @@ void spl_board_init(void)#if defined(CONFIG_AM33XX ) && defined(CONFIG_SPL_MUSB_NEW_SUPPORT )arch_misc_init ();#endif -#if defined(CONFIG_HW_WATCHDOG ) +#if defined(CONFIG_HW_WATCHDOG ) || defined(CONFIG_WATCHDOG )hw_watchdog_init ();#endif #ifdef CONFIG_AM33XX
configs/am335x_evm_defconfig +1 -0
@@ -60,6 +60,7 @@ CONFIG_TIMER=y CONFIG_OMAP_TIMER=y CONFIG_WDT=y CONFIG_WDT_OMAP3=y +# CONFIG_SPL_WDT is not set CONFIG_USB=y CONFIG_DM_USB=y CONFIG_DM_USB_GADGET=y
drivers/watchdog/omap_wdt.c +7 -0
@@ -138,7 +138,14 @@ void hw_watchdog_init(void)while ((readl (&wdt->wdtwwps)) &WDT_WWPS_PEND_WSPR ) ; } + +void watchdog_reset (void ) +{ +hw_watchdog_reset (); +} +#else +static int omap3_wdt_reset (struct udevice *dev) {struct omap3_wdt_priv *priv =dev_get_priv (dev);
include/watchdog.h +1 -1
@@ -77,7 +77,7 @@ int init_func_watchdog_reset(void);* Prototypes from $(CPU)/cpu.c. */ -#if defined(CONFIG_HW_WATCHDOG ) && !defined(__ASSEMBLY__) +#if defined(CONFIG_HW_WATCHDOG ) || defined(CONFIG_WATCHDOG ) && !defined(__ASSEMBLY__)void hw_watchdog_init (void );#endif
Signature · 1 line
2.7.4
PATCH v2 2/2 watchdog: omap_wdt: Disable DM watchdog support in SPL
Quoted 24 lines · sunil.m at techveda.org
From: Suniel Mahesh <[email protected]>
This patch disables DM watchdog support for SPL builds and uses the legacy omap watchdog driver on TI AM335x chipsets.
The following build error is reported if DM watchdog support was enabled in SPL:
CC spl/drivers/usb/gadget/rndis.o LD spl/drivers/usb/gadget/built-in.o LD spl/drivers/usb/musb-new/built-in.o LD spl/drivers/built-in.o LD spl/u-boot-splarm-linux-ld.bfd: u-boot-spl section .u_boot_list will not fit in region .sram arm-linux-ld.bfd: region .sram overflowed by 440 bytes
make[1]: *** [spl/u-boot-spl] Error 1
make: *** [spl/u-boot-spl] Error 2Adjusted
WATCHDOG_RESETmacro accordingly. Earlier it was pointing tohw_watchdog_reset. SinceCONFIG_WATCHDOGreplacesCONFIG_HW_WATCHDOG, nowWATCHDOG_RESETmacro points towatchdog_reset. Thiswatchdog_resetis not defined anywhere for am33xx/omap2 and needs to be defined. Fixed this by simply callinghw_watchdog_resetinwatchdog_reset.
Quoted 4 lines
Built and tested on AM335x device (BeagleboneBlack), compile tested for all other AM33xx/omap2 based boards.
Signed-off-by Suniel Mahesh <[email protected]>
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: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190813/39592896/attachment.sig>
PATCH v2 1/2 watchdog: omap_wdt: Convert watchdog driver to use DT and DM
In reply to sunil.m at techveda.orgQuoted 25 lines · sunil.m at techveda.org
From: Suniel Mahesh <[email protected]>
This patch adds device tree and driver model watchdog support, converts the legacy omap watchdog driver to driver model for TI AM335x chipsets. The following compile warning is removed:
===================== WARNING ====================== This board does not use
CONFIG_WDT(DM watchdog support). Please update the board to useCONFIG_WDTbefore the v2019.10 release.
Failure to update by the deadline may result in board removal. Seedoc/driver-model/MIGRATION.txtfor more info.
====================================================
CONFIG_HW_WATCHDOGis no more a default option for AM33XX devices after DT/DM conversion, adjusted kconfig accordingly.DM watchdog support is enabled by default in SPL. The SPL image doesn't fit into SRAM because of size constraints and build breaks with an overflow. For this reason DM watchdog support should be disabled in SPL, driver code should be adjusted accordingly to serve this purpose.
Built and tested on AM335x device (BeagleboneBlack), compile tested for all other AM33xx based boards.
Quoted 1 line
Signed-off-by Suniel Mahesh <[email protected]>
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: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190813/cc5e8752/attachment.sig>