Enable tegra wdt in cboot

Hi! I need to enable the tegra wdt before u-boot and kernel start. I saw that cboot enables the tegra wdt when the odm data bit (0x8000 mask) is set. I enabled this bit, and I verified that the wdt using the memory display utility in u-boot. In addition, I stopped the kernel loading in u-boot and it did reset after 500 seconds (which is after the fifth expiry of the watchdog, and each expiry occurres after 100 seconds as stated in wdtcr register - set in mb1 misc bct). After I let u-boot to load the kernel the jetson had a reset after about 4 seconds. There is no error in the boot logs and everything seems OK. I saw that the reset reason is indeed the LCCPLEX wdt. Any suggestion how to fix this issue? Thanks!

Hi,

Sorry that I don’t get what is the exact error here…
Didn’t you already enable WDT in cboot?

The error is that after 4 seconds from kernel boot, the board is reset because of LCCPLEX wdt

Could you share the steps to reproduce this issue?

I mean is this error caused by any configuration from you or it is just reboot without any modification?

I changed the odm data from 0x1090000 to 0x1098000. I saw in cboot source that this bit that was set is the bit that enables the tegra wdt. There was no other change to the configuration

Hi Linus,

Bit number 16 in odmdata is for denver watchdog. and that is already set in default software we ship. You don’t need to do anything to enable tegra wdt, its enabled by default.

thanks
Bibek

Hi!

Sorry for the late reply. I am using uboot to read the registers of the watchdog and it clearly say that it is disabled. I need to enable it before the kernel boots, so in case of boot failure - reset would occur.

Hi Linus,

Could you share the exact steps to reproduce the error you have here?

Hi,

There are no too many steps. As I said above, I only changed the odm data from 0x1090000 to 0x1098000. Then, the kernel got reset after 4 seconds since the boot, because of lccplex wdt. Bibek said that you enable the wdt without this configuration, which is incorrect if you read the relevant registers using uboot (with memory display utility). Maybe I am just missing something

. Then, the kernel got reset after 4 seconds since the boot

Are you saying that the kernel would reboot automatically in the first boot up after you flash new ODMDATA?

yes

Then what is role of uboot here? Did you try anything in uboot?

I used uboot only to see if the watchdog is enabled

We tried the same setup as yours today but didn’t see any reboot happened in kernel. Could you share us the log from serial console? Need to see the error log when reboot triggers.

Hi!

I started everything from scratch:

  1. I downloaded jetpack 4.4 for jetson-tx2i.
  2. I changed the odm data from 0x1090000 to 0x1098000.
  3. I checked in uboot if the wdt is enabled:

Tegra186 (P2771-0000-500) # md 0x30d0000 4
030d0000: 00710640 00000610 00000000 0000c45a @.q…Z…

As you can see the wdt is not enabled but configured. If you do not change the odmdata then the wdt is not configured and the output of uboot is:

Tegra186 (P2771-0000-500) # md 0x30d0000 4
030d0000: 00710640 00000000 00000000 0000c45a @.q…Z…

  1. I enabled the wdt using the following command:

Tegra186 (P2771-0000-500) # mm 0x30d0008
030d0008: 00000000 ? 1
030d000c: 0000c45a ? .
Tegra186 (P2771-0000-500) # md 0x30d0000 4
030d0000: 00710640 000005c1 00000000 0000c45a @.q…Z…

  1. Then I booted the kernel and the following happened:

Starting kernel …
ERROR: ARI request timed out: req 89 on CPU 4
ASSERT: plat/nvidia/tegra/soc/t186/drivers/mce/ari.c <127> : retries != 0U

In addition, I looked at the source code of cboot and it seems that the wdt should be enabled after changing the odm data, so I don’t know why it does not in cboot that is shipped with l4t.

Thanks!

Hi Linus,

Watchdog is by default enabled in CBOOT and in Kernel. In uboot it’s not enabled. Does not have the support.

So, what you can do is
disable uboot buy setting the flag USE_UBOOT=0 in p2771-0000.conf.common flashing folder

or, take the cboot open source code from here https://developer.nvidia.com/cboot-src-t18x
edit the file partner/t18x/cboot/platform/t186/platform.c

function:
void platform_uninit(void)
{
#if defined(CONFIG_ENABLE_WDT)
/* disable cpu-wdt before kernel handoff /
- tegrabl_wdt_disable(TEGRABL_WDT_LCCPLEX);
+ tegrabl_wdt_load_or_disable(TEGRABL_WDT_LCCPLEX, 0);
#endif /
CONFIG_ENABLE_WDT */

compile
and use cboot.bin
this will make sure that when control is handed over from cboot to uboot, watchdog is enabled and if not pegged by kernel, system will reboot

thanks
Bibek

Hi!

Thanks for your reply. Removing the wdt_disable in cboot is actually equivalent to enabling it in uboot as I did above. Did you try to change this in cboot as you said and it worked?