Message ID | 1562923427-24992-1-git-send-email-sunil.m@techveda.org |
---|---|
State | Superseded |
Delegated to: | Tom Rini |
Headers | show |
Series | [U-Boot,1/2] watchdog: omap_wdt: Convert watchdog driver to use DT and DM | expand |
On Fri, Jul 12, 2019 at 02:53:47PM +0530, sunil.m@techveda.org wrote: > From: Suniel Mahesh <suniel.spartan@gmail.com> > > 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. > > Signed-off-by: Suniel Mahesh <sunil.m@techveda.org> 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.
On 17/07/19 22:58, Tom Rini wrote: > On Fri, Jul 12, 2019 at 02:53:47PM +0530, sunil.m@techveda.org wrote: > >> From: Suniel Mahesh <suniel.spartan@gmail.com> >> >> 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. >> >> Signed-off-by: Suniel Mahesh <sunil.m@techveda.org> > > 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 > 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 > "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
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..41c9aa7 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