10 Dec, 2020

1 commit


16 Jul, 2020

1 commit

  • According to Server Base System Architecture (SBSA) specification,
    the SBSA Generic Watchdog has two stage timeouts: the first signal
    (WS0) is for alerting the system by interrupt, the second one (WS1) is a
    real hardware reset.
    More details about the hardware specification of this device:
    ARM DEN0029B - Server Base System Architecture (SBSA)

    This driver can operate ARM SBSA Generic Watchdog as a single stage
    In the single stage mode, when the timeout is reached, your system
    will be reset by WS1. The first signal (WS0) is ignored.

    Signed-off-by: Zhao Qiang
    Signed-off-by: Biwen Li
    Reviewed-by: Stefan Roese

    Zhao Qiang
     

16 Mar, 2020

1 commit

  • On some platforms/architectures the value from get_timer() can wrap.
    This is particularly problematic when long-running code needs to measure
    a time difference as is the case with watchdog_reset() which tries to
    avoid tickling the watchdog too frequently.

    Use time_after() from time.h instead of a plain > comparison to avoid
    any issues with the time wrapping on a system that has been sitting in
    u-boot for a long time.

    Signed-off-by: Chris Packham
    Reviewed-by: Stefan Roese

    Chris Packham
     

13 Mar, 2020

1 commit


28 Feb, 2020

2 commits

  • Commit 06985289d452 ("watchdog: Implement generic watchdog_reset()
    version") introduced an automatic selection of CONFIG_WATCHDOG by
    CONFIG_WDT. But for boards selecting CONFIG_HW_WATCHDOG, like
    boards have a powerpc 8xx, CONFIG_WATCHDOG shall not be selected
    as they are mutually exclusive.

    Make CONFIG_WATCHDOG dependent on !CONFIG_HW_WATCHDOG

    Fixes: 06985289d452 ("watchdog: Implement generic watchdog_reset() version")
    Cc: Stefan Roese
    Signed-off-by: Christophe Leroy
    Reviewed-by: Stefan Roese

    Christophe Leroy
     
  • Commit f3729ba6e7b2 ("watchdog: mpc8xx_wdt: Watchdog driver and macros
    cleanup") switched the watchdog to CONFIG_WATCHDOG. But this is not
    compatible with the 8xx because it starts the watchdog HW timer at
    reset and must be serviced from the very beginning including while
    U-boot is executed in the firmware before relocation in RAM.

    Select CONFIG_HW_WATCHDOG and make hw_watchdog_reset() visible.

    Meanwhile, finalise the cleanup of arch/powerpc/cpu/mpc8xx/Kconfig by
    removing the lines put in comment in that commit, and also remove
    again the selection of CONFIG_MPC8xx_WATCHDOG which was removed by
    that commit and brought back by mistake by commit b3134ffbd944
    ("watchdog: Kconfig: Sort entry alphabetically")

    Note that there was an 'imply WATCHDOG' in the original commit but
    it disappeared in the Kconfig alphabetical sorting, so no need to
    remove it here.

    Fixes: f3729ba6e7b2 ("watchdog: mpc8xx_wdt: Watchdog driver and macros cleanup")
    Fixes: b3134ffbd944 ("watchdog: Kconfig: Sort entry alphabetically")
    Signed-off-by: Christophe Leroy
    Cc: Stefan Roese
    Cc: Patrice Chotard
    Reviewed-by: Stefan Roese

    Christophe Leroy
     

11 Feb, 2020

1 commit


08 Feb, 2020

1 commit


07 Feb, 2020

1 commit


06 Feb, 2020

2 commits

  • At present dm/device.h includes the linux-compatible features. This
    requires including linux/compat.h which in turn includes a lot of headers.
    One of these is malloc.h which we thus end up including in every file in
    U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
    which needs to use the system malloc() in some files.

    Move the compatibility features into a separate header file.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present devres.h is included in all files that include dm.h but few
    make use of it. Also this pulls in linux/compat which adds several more
    headers. Drop the automatic inclusion and require files to include devres
    themselves. This provides a good indication of which files use devres.

    Signed-off-by: Simon Glass
    Reviewed-by: Anatolij Gustschin

    Simon Glass
     

05 Feb, 2020

2 commits

  • Add optional support for fetching watchdog clock rate from DT
    and ungating reset via reset framework. This is optional as not
    all platforms using DW WDT support the clock and reset frameworks
    yet.

    Signed-off-by: Marek Vasut
    Cc: Chin Liang See
    Cc: Dalon Westergreen
    Cc: Dinh Nguyen
    Cc: Jagan Teki
    Cc: Ley Foon Tan
    Cc: Philipp Tomisch
    Cc: Simon Goldschmidt
    Cc: Tien Fong Chee
    Reviewed-by: Jagan Teki
    Tested-by: Jagan Teki # roc-rk3399-pc

    Marek Vasut
     
  • Convert the designware watchdog timer driver to DM and add DT probing
    support. Perform minor coding style clean up, like drop superfluous
    braces. These ought to be no functional change.

    Signed-off-by: Marek Vasut
    Cc: Chin Liang See
    Cc: Dalon Westergreen
    Cc: Dinh Nguyen
    Cc: Jagan Teki
    Cc: Ley Foon Tan
    Cc: Philipp Tomisch
    Cc: Simon Goldschmidt
    Cc: Tien Fong Chee
    Reviewed-by: Jagan Teki
    Tested-by: Jagan Teki # roc-rk3399-pc

    Marek Vasut
     

04 Feb, 2020

3 commits

  • Fix obvious coding style problems, no functional change.

    Signed-off-by: Marek Vasut
    Cc: Grygorii Strashko
    Cc: Sam Protsenko
    Cc: Suniel Mahesh
    Reviewed-by: Lokesh Vutla
    Signed-off-by: Lokesh Vutla

    Marek Vasut
     
  • The watchdog timer value was never updated in the hardware by this
    driver, so the watchdog triggered on some random stale value that
    was left in the hardware. The TI SPRUH37C says, quote:

    20.4.3.9 Modifying Timer Count/Load Values and Prescaler Setting
    ...
    After a write access, the load register value and prescaler ratio
    registers are updated immediately, but new values are considered
    only after the next consecutive counter overflow or after a new
    trigger command (the WDT_WTGR register).

    This means at least one trigger must happen. The driver probably
    depended on someone calling it's .reset() callback, however that
    is not guaranteed e.g. if the WDT operates without servicing.

    Add this missing trigger.

    Signed-off-by: Marek Vasut
    Cc: Grygorii Strashko
    Cc: Sam Protsenko
    Cc: Suniel Mahesh
    Reviewed-by: Lokesh Vutla
    Signed-off-by: Lokesh Vutla

    Marek Vasut
     
  • The timeout parameter of omap3_wdt_start() is in miliseconds, while
    GET_WLDR_VAL() expects parameter in seconds. Fix this so the WDT
    driver is actually usable.

    Signed-off-by: Marek Vasut
    Cc: Grygorii Strashko
    Cc: Sam Protsenko
    Cc: Suniel Mahesh
    Reviewed-by: Lokesh Vutla
    Signed-off-by: Lokesh Vutla

    Marek Vasut
     

03 Feb, 2020

1 commit

  • Migrate CONFIG_DESIGNWARE_WATCHDOG to Kconfig and update the headers
    accordingly, no functional change. The S10 enables the WDT only in
    SPL, but does not enable it in U-Boot itself, hence disable it in
    the config again.

    Signed-off-by: Marek Vasut
    Cc: Chin Liang See
    Cc: Dalon Westergreen
    Cc: Dinh Nguyen
    Cc: Jagan Teki
    Cc: Ley Foon Tan
    Cc: Philipp Tomisch
    Cc: Simon Goldschmidt
    Cc: Tien Fong Chee

    Marek Vasut
     

23 Jan, 2020

1 commit


18 Jan, 2020

2 commits


04 Nov, 2019

2 commits

  • The expire_now function was previously setting the watchdog timeout to
    minimum and waiting for the watchdog to expire. However, this watchdog
    also has bits to trigger immediate reset. Use those instead, like the
    Linux imx2_wdt driver does.

    Signed-off-by: Robert Hancock

    Robert Hancock
     
  • The Linux imx2_wdt driver uses a fsl,ext-reset-output boolean in the
    device tree to specify whether the board design should use the external
    reset instead of the internal reset. Use this boolean to determine which
    mode to use rather than using external reset unconditionally.

    For the legacy non-DM mode, the external reset is always used in order
    to maintain the previous behavior.

    Signed-off-by: Robert Hancock

    Robert Hancock
     

08 Oct, 2019

1 commit


20 Sep, 2019

1 commit

  • AM335X based beaglebone black target gets reset by DM converted watchdog
    if booted from emmc around 60sec. Fixed this by moving driver's private struct
    variable initialization at different places in the driver to driver's probe.
    Tested on Beaglebone Black.

    Cc: Grygorii Strashko
    Fixes: 7659ea32 ("watchdog: omap_wdt: Convert watchdog driver to use DT and DM")
    Reported-by: Sam Protsenko
    Signed-off-by: Suniel Mahesh
    Acked-by: Grygorii Strashko
    Reviewed-by: Sam Protsenko

    Suniel Mahesh
     

12 Sep, 2019

1 commit


13 Aug, 2019

1 commit

  • 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

    Suniel Mahesh
     

12 Aug, 2019

1 commit

  • 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.

    Signed-off-by: Suniel Mahesh

    Suniel Mahesh
     

05 Aug, 2019

2 commits


20 Jul, 2019

2 commits

  • Add DM and DT probing support to iMX watchdog driver. This should
    allow boards to move over to this driver, enable SYSRESET_WATCHDOG
    to handle cpu_reset() if required.

    Signed-off-by: Marek Vasut
    Cc: Peng Fan
    Cc: Stefano Babic
    Tested-by: Heiko Schocher

    Marek Vasut
     
  • Use CONFIG_IS_ENABLED(WDT) to permit use of WDT in SPL without DM,
    while the full U-Boot can use rich DM/DT WDT driver.

    Signed-off-by: Marek Vasut
    Cc: Peng Fan
    Cc: Stefano Babic
    Tested-by: Heiko Schocher
    Tested-by: Suniel Mahesh

    Marek Vasut
     

22 Jun, 2019

2 commits


20 Jun, 2019

2 commits

  • Signed-off-by: Shannon Barber

    Shannon Barber
     
  • The driver was using milliseconds and programming it into a register
    which takes ticks of the watchdog clock, which runs at 1MHz. This meant
    we were off by 1000 with the desired value.

    When 06985289d452 ("watchdog: Implement generic watchdog_reset()
    version") was added the aspeed board would leave the watchdog running,
    causing it to bite before u-boot was done.

    Discovered by booting in qemu:

    $ qemu-system-arm -M ast2500-evb -drive file=test.img,format=raw,if=mtd -nographic -no-reboot -d cpu_reset

    U-Boot 2019.07-rc3-00091-g2253e40caef5 (Jun 06 2019 - 16:53:23 +0930)

    Model: Aspeed BMC
    DRAM: 496 MiB
    WDT: Started with servicing (60s timeout)
    MMC:
    In: serial@1e784000
    Out: serial@1e784000
    Err: serial@1e784000
    Watchdog timer expired.

    Fixes: 06985289d452 ("watchdog: Implement generic watchdog_reset() version")
    Signed-off-by: Joel Stanley

    Joel Stanley
     

06 Jun, 2019

2 commits


22 May, 2019

1 commit


19 May, 2019

1 commit

  • The function bcm6345_wdt_start use the argument timeout
    as tick but it should be used as milliseconds.

    A clock is added as requirement for this driver.
    The frequency of the clock is then used to convert the
    millisecond to ticks in the function bcm6345_wdt_start.

    Signed-off-by: Philippe Reynes
    Reviewed-by: Stefan Roese

    Philippe Reynes
     

05 May, 2019

1 commit