From: Suniel Mahesh Date: Wed, 31 Jul 2019 16:24:07 +0000 (+0530) Subject: watchdog: omap_wdt: Disable DM watchdog support in SPL X-Git-Tag: v2019.10-rc2~3^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6912f2a8ae9d98203cb2470c472d3f2fde78357b;p=platform%2Fkernel%2Fu-boot.git watchdog: omap_wdt: Disable DM watchdog support in SPL 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. Signed-off-by: Suniel Mahesh [trini: Fix watchdog.h logic] Signed-off-by: Tom Rini --- diff --git a/arch/arm/mach-omap2/boot-common.c b/arch/arm/mach-omap2/boot-common.c index c8b8ac6..c9549aa 100644 --- a/arch/arm/mach-omap2/boot-common.c +++ b/arch/arm/mach-omap2/boot-common.c @@ -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 diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig index fa6b030..c0f7ccc 100644 --- a/configs/am335x_evm_defconfig +++ b/configs/am335x_evm_defconfig @@ -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 diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index 86f7cf1..d5857be 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c @@ -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); diff --git a/include/watchdog.h b/include/watchdog.h index 3a357de..a4a4e8e 100644 --- a/include/watchdog.h +++ b/include/watchdog.h @@ -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