AM620-Q1: rti_driver missing options

Part Number: AM620-Q1

Hello Experts,

I am working with the rti_wdt_driver (drivers/watchdog/rti_wdt.c) originally written around 2019/2020.

`// SPDX-License-Identifier: GPL-2.0
/*
* Watchdog driver for the K3 RTI module
*
* (c) Copyright 2019-2020 Texas Instruments Inc.
* All rights reserved.
*/`
 


I have a few concerns and questions : 
* Behavior on target : 
I wrote a small program, to query wether the last reboot was caused by the watchdog using the value of the option WDIOC_GETBOOTSTATUS (ioctl). 
`

int bootstatus = 0;
if (wdg_fd < 0)
return false;
if (ioctl(wdg_fd, WDIOC_GETBOOTSTATUS, &bootstatus) == 0) {
if (bootstatus != 0) {
printf("Last boot is caused by watchdog (bootstatus=0x%x)", bootstatus);
return true;
}
printf("Last boot not caused by watchdog (bootstatus=0x%x)", bootstatus);
return false;
}`

But it always returns 0, even when the system actually rebooted because of the watchdog.

Therefore, to investigate i tried checking which options the driver exposes.
I wrote a small test program, cross-compiled it and ran it on my target  board : 
eg : 
`
if (opts & WDIOF_MAGICCLOSE) printf(" WDIOF_MAGICCLOSE\n");
if (opts & WDIOF_KEEPALIVEPING) printf(" WDIOF_KEEPALIVEPING\n");
if (opts & WDIOF_PRETIMEOUT) printf(" WDIOF_PRETIMEOUT\n");
if (opts & WDIOC_GETBOOTSTATUS) printf(" WDIOC_GETBOOTSTATUS\n");
`
i did the same for all the options in this documentation : https://www.kernel.org/doc/Documentation/watchdog/watchdog-api.txt

The program reports  :
 `=== WATCHDOG INFO ===
Identity          : K3 RTI Watchdog
Firmware version  : 0
Options (raw)     : 0x00008000
Supported options:
  WDIOF_KEEPALIVEPING
`
I am not sure if this is normal behavior for this version of the driver or if it indicates that additions/patches are required.

* When reviewing the rti_wdt.c i found out that only KEEPALIVEPING option is available. 
`
static const struct watchdog_info rti_wdt_info = {
.options = WDIOF_KEEPALIVEPING,
.identity = "K3 RTI Watchdog",
}; 
`
I would like to know if these features were intentionaly left out in this version or if they are available in later releases.

* I am considering adding a patch to rti_wdt.c to expose additional options, but will they be correctly recognized by kernel and visible to userspace ? 

* Inputs : 
`target : "Linux am62xx-evm 6.1.80-rt26-ti-rt-g3c08dbfd7bfd #1 SMP PREEMPT_RT Wed Mar 20 14:44:35 UTC 2024 aarch64 GNU/Linux." to display all available driver options. 
in DTS, i modified rti0@main node to add status = "okay";  which is compatible = "ti,j7-rti-wdt";
DISTRO               = "arago"
DISTRO_VERSION       = "2023.10"
BB_VERSION           = "2.0.0"
`
Regards,
Ghofrane hamdouni