[U-Boot] [PATCH] watchdog: Implement generic watchdog_reset() version

Michal Simek michal.simek at xilinx.com
Fri Apr 5 15:25:51 UTC 2019


On 05. 04. 19 17:23, Stefan Roese wrote:
> On 05.04.19 17:18, Michal Simek wrote:
>> On 05. 04. 19 15:00, Stefan Roese wrote:
>>> Hi Michal,
>>>
>>> On 05.04.19 14:07, Michal Simek wrote:
>>>
>>> <snip>
>>>
>>>>> +++ b/drivers/watchdog/wdt-uclass.c
>>>>> @@ -10,6 +10,12 @@
>>>>>    #include <dm/device-internal.h>
>>>>>    #include <dm/lists.h>
>>>>>    +#ifndef WDT_DEFAULT_TIMEOUT
>>>>> +#define WDT_DEFAULT_TIMEOUT    60
>>>>> +#endif
>>>>> +
>>>>> +DECLARE_GLOBAL_DATA_PTR;
>>>>> +
>>>>>    int wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
>>>>>    {
>>>>>        const struct wdt_ops *ops = device_get_ops(dev);
>>>>> @@ -63,6 +69,67 @@ int wdt_expire_now(struct udevice *dev, ulong
>>>>> flags)
>>>>>        return ret;
>>>>>    }
>>>>>    +#if defined(CONFIG_WATCHDOG)
>>>>
>>>> This is not enough because you can enable it just for full u-boot but
>>>> not for SPL.
>>>
>>> Why not? CONFIG_WATCHDOG can be enabled with or without
>>> CONFIG_SPL_WATCHDOG_SUPPORT being enabled.
>>>
>>>> It means you should also handle CONFIG_SPL_WATCHDOG_SUPPORT
>>>> macros.
>>>>
>>>> Just try to enable CADENCE_WDT, WDT and Watchdog for zcu100 and build
>>>
>>> I just tried this for xilinx_zynqmp_zcu100_revC_defconfig. Per default
>>> it has enabled:
>>
>> ah right. I have patch in my queue to disable it by default.
>>
>> Anyway this is what I am getting.
>>
>> [u-boot](mainline)$ git log -n 3 --oneline
>> 672eafbf08a0 watchdog: Implement generic watchdog_reset() version
>> 7b5b40e4858b watchdog: Move watchdog_dev to data section (BSS may not be
>> cleared)
>> 0e708abcbba1 Merge branch 'master' of git://git.denx.de/u-boot-usb
>> [u-boot](mainline)$ make xilinx_zynqmp_zcu100_revC_defconfig >/dev/null
>> && make -j >/dev/null
>> lib/built-in.o: In function `inflateReset':
>> /mnt/disk/u-boot/lib/zlib/inflate.c:28: undefined reference to
>> `watchdog_reset'
>> /mnt/disk/u-boot/lib/zlib/inflate.c:28:(.text.inflateReset+0x58):
>> relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
>> `watchdog_reset'
>> lib/built-in.o: In function `inflateEnd':
>> /mnt/disk/u-boot/lib/zlib/inflate.c:936: undefined reference to
>> `watchdog_reset'
>> /mnt/disk/u-boot/lib/zlib/inflate.c:936:(.text.inflateEnd+0x2c):
>> relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
>> `watchdog_reset'
>> lib/built-in.o: In function `inflate':
>> /mnt/disk/u-boot/lib/zlib/inflate.c:546: undefined reference to
>> `watchdog_reset'
>> /mnt/disk/u-boot/lib/zlib/inflate.c:546:(.text.inflate+0x7b4):
>> relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
>> `watchdog_reset'
>> /mnt/disk/u-boot/lib/zlib/inflate.c:724: undefined reference to
>> `watchdog_reset'
>> /mnt/disk/u-boot/lib/zlib/inflate.c:724:(.text.inflate+0xcc4):
>> relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
>> `watchdog_reset'
>> lib/built-in.o: In function `udelay':
>> /mnt/disk/u-boot/lib/time.c:167: undefined reference to `watchdog_reset'
>> /mnt/disk/u-boot/lib/time.c:167:(.text.udelay+0x1c): relocation
>> truncated to fit: R_AARCH64_CALL26 against undefined symbol
>> `watchdog_reset'
>> drivers/built-in.o:/mnt/disk/u-boot/drivers/serial/serial_zynq.c:230:
>> more undefined references to `watchdog_reset' follow
>> drivers/built-in.o: In function `_debug_uart_putc':
>> /mnt/disk/u-boot/drivers/serial/serial_zynq.c:230:(.text.printch+0x4c):
>> relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
>> `watchdog_reset'
>> /mnt/disk/u-boot/drivers/serial/serial_zynq.c:230:(.text.printch+0x54):
>> relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
>> `watchdog_reset'
>> /mnt/disk/u-boot/drivers/serial/serial_zynq.c:230:(.text.printascii+0x58):
>>
>> relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
>> `watchdog_reset'
>> /mnt/disk/u-boot/drivers/serial/serial_zynq.c:230:(.text.printascii+0x60):
>>
>> relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
>> `watchdog_reset'
>> make[1]: *** [spl/u-boot-spl] Error 1
>> make: *** [spl/u-boot-spl] Error 2
> 
> Yes. You're probably missing this patch here, which I listed as
> dependencies in the commit text:
> 
> [2] watchdog: Handle SPL build with watchdog disabled
> https://patchwork.ozlabs.org/patch/1074098/
> 
> Please test again with this patch applied.

Good catch. I didn't read it fully. Thought that only that first one you
sent recently is that dependency.

M



More information about the U-Boot mailing list