From: Jan Kiszka <jan.kiszka@siemens.com>
To: Lokesh Vutla <lokeshvutla@ti.com>,
U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Le Jin <le.jin@siemens.com>,
Bao Cheng Su <baocheng.su@siemens.com>,
Nian Gao <nian.gao@siemens.com>,
Chao Zeng <chao.zeng@siemens.com>, Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH v2 4/5] watchdog: rti_wdt: Add support for loading firmware
Date: Mon, 7 Jun 2021 12:20:29 +0200 [thread overview]
Message-ID: <5c777240-9bc6-b655-f9b2-cabc758cda4c@siemens.com> (raw)
In-Reply-To: <96039724-9a5f-dbb8-d46b-b268a0d9a8c2@ti.com>
On 07.06.21 12:03, Lokesh Vutla wrote:
> +Tom,
>
> Hi Tom,
>
> On 02/06/21 3:07 pm, Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> To avoid the need of extra boot scripting on AM65x for loading a
>> watchdog firmware, add the required rproc init and loading logic for the
>> first R5F core to the watchdog start handler. In case the R5F cluster is
>> in lock-step mode, also initialize the second core. The firmware itself
>> is embedded into U-Boot binary to ease access to it and ensure it is
>> properly hashed in case of secure boot.
>>
>> One possible firmware source is https://github.com/siemens/k3-rti-wdt.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>> drivers/watchdog/Kconfig | 20 ++++++++++++
>> drivers/watchdog/Makefile | 5 +++
>> drivers/watchdog/rti_wdt.c | 58 ++++++++++++++++++++++++++++++++++-
>> drivers/watchdog/rti_wdt_fw.S | 20 ++++++++++++
>> 4 files changed, 102 insertions(+), 1 deletion(-)
>> create mode 100644 drivers/watchdog/rti_wdt_fw.S
>>
>> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
>> index f0ff2612a6..1a1fddfe9f 100644
>> --- a/drivers/watchdog/Kconfig
>> +++ b/drivers/watchdog/Kconfig
>> @@ -209,6 +209,26 @@ config WDT_K3_RTI
>> Say Y here if you want to include support for the K3 watchdog
>> timer (RTI module) available in the K3 generation of processors.
>>
>> +if WDT_K3_RTI
>> +
>> +config WDT_K3_RTI_LOAD_FW
>> + bool "Load watchdog firmware"
>> + depends on REMOTEPROC
>> + help
>> + Automatically load the specified firmware image into the MCU R5F
>> + core 0. On the AM65x, this firmware is supposed to handle the expiry
>> + of the watchdog timer, typically by resetting the system.
>> +
>> +config WDT_K3_RTI_FW_FILE
>> + string "Watchdog firmware image file"
>> + default "k3-rti-wdt.fw"
>> + depends on WDT_K3_RTI_LOAD_FW
>> + help
>> + Firmware image to be embedded into U-Boot and loaded on watchdog
>> + start.
>
> I need your input on this proach. Is it okay to include the linker file unders
> drivers?
>
>> +
>> +endif
>> +
>> config WDT_SANDBOX
>> bool "Enable Watchdog Timer support for Sandbox"
>> depends on SANDBOX && WDT
>> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
>> index 5c7ef593fe..5016ee4708 100644
>> --- a/drivers/watchdog/Makefile
>> +++ b/drivers/watchdog/Makefile
>> @@ -33,7 +33,12 @@ obj-$(CONFIG_WDT_OCTEONTX) += octeontx_wdt.o
>> obj-$(CONFIG_WDT_OMAP3) += omap_wdt.o
>> obj-$(CONFIG_WDT_SBSA) += sbsa_gwdt.o
>> obj-$(CONFIG_WDT_K3_RTI) += rti_wdt.o
>> +obj-$(CONFIG_WDT_K3_RTI_LOAD_FW) += rti_wdt_fw.o
>> obj-$(CONFIG_WDT_SP805) += sp805_wdt.o
>> obj-$(CONFIG_WDT_STM32MP) += stm32mp_wdt.o
>> obj-$(CONFIG_WDT_TANGIER) += tangier_wdt.o
>> obj-$(CONFIG_WDT_XILINX) += xilinx_wwdt.o
>> +
>
> [...snip..]
>
>> timer_margin = timeout_ms * priv->clk_khz / 1000;
>> timer_margin >>= WDT_PRELOAD_SHIFT;
>> if (timer_margin > WDT_PRELOAD_MAX)
>> diff --git a/drivers/watchdog/rti_wdt_fw.S b/drivers/watchdog/rti_wdt_fw.S
>> new file mode 100644
>> index 0000000000..78d99ff9f2
>> --- /dev/null
>> +++ b/drivers/watchdog/rti_wdt_fw.S
>
> Isn't this usecase specific? IMHO, drivers might not be the right place. Did I
> misunderstand something?
>
It's specific to this driver - on a subset of supported hardware
platforms, namely AM65x SR1.0.
Jan
--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2021-06-07 10:20 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-02 9:37 [PATCH v2 0/5] Add SIMATIC IOT2050 board support Jan Kiszka
2021-06-02 9:37 ` [PATCH v2 1/5] arm: dts: Add IOT2050 device tree files Jan Kiszka
2021-06-02 9:37 ` [PATCH v2 2/5] board: siemens: Add support for SIMATIC IOT2050 devices Jan Kiszka
2021-06-02 9:37 ` [PATCH v2 3/5] arm64: dts: ti: k3-am65-mcu: Add RTI watchdog entry Jan Kiszka
2021-06-02 9:37 ` [PATCH v2 4/5] watchdog: rti_wdt: Add support for loading firmware Jan Kiszka
2021-06-07 10:03 ` Lokesh Vutla
2021-06-07 10:20 ` Jan Kiszka [this message]
2021-06-07 11:40 ` Tom Rini
2021-06-07 11:44 ` Jan Kiszka
2021-06-09 13:17 ` Jan Kiszka
2021-06-11 13:44 ` Lokesh Vutla
2021-06-11 14:08 ` Tom Rini
2021-06-26 18:29 ` Simon Glass
2021-06-27 18:01 ` Jan Kiszka
2021-06-27 18:18 ` Simon Glass
2021-06-27 19:34 ` Tom Rini
2021-06-27 20:37 ` Simon Glass
2021-06-28 5:40 ` Jan Kiszka
2021-07-05 15:29 ` Simon Glass
2021-07-14 9:53 ` Jan Kiszka
2021-07-14 14:15 ` Simon Glass
2021-07-20 12:57 ` Jan Kiszka
2021-07-20 16:14 ` Jan Kiszka
2021-07-20 17:33 ` Simon Glass
2021-06-02 9:37 ` [PATCH v2 5/5] configs: iot2050: Enable watchdog support, but do not auto-start it Jan Kiszka
2021-06-11 14:30 ` [PATCH v2 0/5] Add SIMATIC IOT2050 board support Lokesh Vutla
2021-06-11 14:53 ` Tom Rini
2021-06-11 18:20 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5c777240-9bc6-b655-f9b2-cabc758cda4c@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=baocheng.su@siemens.com \
--cc=chao.zeng@siemens.com \
--cc=le.jin@siemens.com \
--cc=lokeshvutla@ti.com \
--cc=nian.gao@siemens.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).