From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-22.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3721C48BC2 for ; Sun, 27 Jun 2021 19:34:32 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C2A8D61438 for ; Sun, 27 Jun 2021 19:34:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2A8D61438 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CA1E882C68; Sun, 27 Jun 2021 21:34:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="KhUR43UN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 27BCF82C6C; Sun, 27 Jun 2021 21:34:28 +0200 (CEST) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 95AD0829AE for ; Sun, 27 Jun 2021 21:34:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x82f.google.com with SMTP id t9so11911545qtw.7 for ; Sun, 27 Jun 2021 12:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ul8FG6RJjtf7UQSwo2NXAWe891rZVk2VpZo2gduzW5k=; b=KhUR43UNzL3Y9B61Btbj/G5lHL/52WFNR4oFO1A64nGoD8JCn88ymVmv9J7dMFTJ+R pj9fn2XmevQsS6ThyBBEgW7arjycyi/1iJUN8nl22sfEtrIaY1zN3la/k/plpJJNRsk+ 2Jp5L3C5NSO6w8POqoxj+zuO2orDtfbEMrm1Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ul8FG6RJjtf7UQSwo2NXAWe891rZVk2VpZo2gduzW5k=; b=LkRlhi+nWiJQuiiq1CVRTXq6tivJCp1Jjmzr2ntIOyvrCyvmp5LO4QFpZmqxcs5oMT 3HSjyye3LDRjGRzCxkBINqbRbx6Qio+GwOy+kQpplq8wtAt4jKTETkP8dHwRNw6Jx3ky del06xF3U5RN9iPJtIXwEVZHs/w6/VNzC9eKJfMxYxFfXOFFD0TsZAw5ktwq2pinBxGU jIE5iCE3Ky8B7Rd37gcr7L2vd/VZZS/JEqiKEEhC1V4SLTMTc6xIaOMSEo7+frh5poDO RASo6RnNrgJQhwb6TqVYMk9lRld9tEor4jo5JJ9fHDXc1WeY6GofGB++ZIQs2WPMds3s JC7A== X-Gm-Message-State: AOAM533amvGcQ+2y8c6dCbjeaOTOGoh3IFYzRSDWCXB/w6doXjWk41d1 mwGSpIGKniczgGp0gxLIATi+Mg== X-Google-Smtp-Source: ABdhPJxma5Ih9+/W3u14WTx7g0I9nab5XtVgSNQmgHvCzcCMqF8kbULeNELK0BHDMNEmFbOsag0iJw== X-Received: by 2002:ac8:65c8:: with SMTP id t8mr4003393qto.343.1624822463322; Sun, 27 Jun 2021 12:34:23 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-2808-537e-3f88-1d98.res6.spectrum.com. [2603:6081:7b01:cbda:2808:537e:3f88:1d98]) by smtp.gmail.com with ESMTPSA id k7sm5956883qtu.83.2021.06.27.12.34.21 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 27 Jun 2021 12:34:22 -0700 (PDT) Date: Sun, 27 Jun 2021 15:34:20 -0400 From: Tom Rini To: Simon Glass Cc: Jan Kiszka , Lokesh Vutla , U-Boot Mailing List , Le Jin , Bao Cheng Su , Nian Gao , Chao Zeng Subject: Re: [PATCH v2 4/5] watchdog: rti_wdt: Add support for loading firmware Message-ID: <20210627193420.GV9516@bill-the-cat> References: <88d7d3e323c27417d7109b8a92bf53a08ad77654.1622626660.git.jan.kiszka@siemens.com> <96039724-9a5f-dbb8-d46b-b268a0d9a8c2@ti.com> <20210607114007.GD9516@bill-the-cat> <20210611140831.GU9516@bill-the-cat> <54a75091-0499-8902-b7f5-b1f75ae0091c@siemens.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6Iz7u50GldpoYdAx" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --6Iz7u50GldpoYdAx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 27, 2021 at 12:18:09PM -0600, Simon Glass wrote: > Hi Jan, >=20 > On Sun, 27 Jun 2021 at 12:01, Jan Kiszka wrote: > > > > On 26.06.21 20:29, Simon Glass wrote: > > > Hi, > > > > > > On Fri, 11 Jun 2021 at 08:08, Tom Rini wrote: > > >> > > >> On Fri, Jun 11, 2021 at 07:14:21PM +0530, Lokesh Vutla wrote: > > >>> Hi Tom, > > >>> > > >>> On 09/06/21 6:47 pm, Jan Kiszka wrote: > > >>>> On 07.06.21 13:44, Jan Kiszka wrote: > > >>>>> On 07.06.21 13:40, Tom Rini wrote: > > >>>>>> On Mon, Jun 07, 2021 at 03:33:52PM +0530, Lokesh Vutla wrote: > > >>>>>>> +Tom, > > >>>>>>> > > >>>>>>> Hi Tom, > > >>>>>>> > > >>>>>>> On 02/06/21 3:07 pm, Jan Kiszka wrote: > > >>>>>>>> From: Jan Kiszka > > >>>>>>>> > > >>>>>>>> To avoid the need of extra boot scripting on AM65x for loading= a > > >>>>>>>> watchdog firmware, add the required rproc init and loading log= ic 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 firmwa= re 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 > > >>>>>>>> --- > > >>>>>>>> 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/Kconf= ig > > >>>>>>>> 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 h= andle the expiry > > >>>>>>>> + of the watchdog timer, typically by resetting the sy= stem. > > >>>>>>>> + > > >>>>>>>> +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 lin= ker file unders > > >>>>>>> drivers? > > >>>>>> > > >>>>>> Maybe? I suppose the first thing that springs to mind is why ar= en't we > > >>>>>> using binman and including this blob (which I happily see is GPL= v2) > > >>>>>> similar to how we do things with x86 for one example. > > >>>>>> > > >>>>> > > >>>>> See https://www.mail-archive.com/u-boot@lists.denx.de/msg377894.h= tml > > >>>>> > > >>>>> Jan > > >>>>> > > >>>> > > >>>> Did this help to answer open questions? Otherwise, please let me k= now. > > >>>> > > >>>> I'd also like to avoid that his patch alone blocks 1-3 of the seri= es > > >>>> needless - but I would also not mind getting everything in at once. > > >>> > > >>> Can you provide your reviewed-by if you are okay with this approach? > > >> > > >> I was kind of hoping Simon would chime in here on binman usage. So, > > >> re-re-reading the above URL, yes, fsloader wouldn't be the right cho= ice > > >> for watchdog firmware. But I think binman_entry_find() and related > > >> could work, in general, for this case of "need firmware blob embedde= d in > > >> to image". That said, this isn't just any firmware blob, it's the > > >> watchdog firmware. The less reliance on other things the safer it i= s. > > >> That means this would be an exception to the general firmware blob > > >> loading rule and yeah, OK, we can do it this way. Sorry for the del= ay. > > > > > > Yes I've been a little tied up recently. But I think this should use > > > binman. We really don't want to be building binary firmware into > > > U-Boot itself! > > > > > > Also Tom says, see x86 for a load of binaries of different types and > > > how they are accessed at runttime. This is what binman is for. > > > > > > > Please take the time and study my arguments. I'm open for better > > proposals, but they need to be concrete and addressing my points. >=20 > Do you mean 'properly hashed' and 'easy access', or something else? > What can binman not do? Well, as I said when ack'ing this, we're also talking about making sure the system watchdog works. It needs to be as dead simple as possible. --=20 Tom --6Iz7u50GldpoYdAx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDY0rgACgkQFHw5/5Y0 tyy8OQwAot+/P90xt083GyvFg1HYYN7pcUe4PYNfjGMvO9iJO0oTJOXADbyoaFhB UxqON5h4owtnnfaiQFILSdY+MdF22Rb4CNBATfpDw/9MrO4Hz4Xjf+hm3nU+v1zy p/lI88t/7m1dQzhPWHyDmTOaBZkJAaiHPLnfEr7IYQ6y48t/USJhvfWI+5PgRDe2 KC6l8VeHwqmJcb8CiQ4N31Ti3WKgYp5mIaYbJen2FNGbe6If0lxbDVmwk+wJVV7x kovOVsKVNxli1IHZrXh66FHWsA7wwxf5qKzaBPdWcb1hP0s2iHZmsVQCCxqktlsK rRiErUPfXWyGIkfrSE/ionvw3xyAXH080TEn0GmU/ieoQQ4Xys4QF++CO569Cqrl UPiTGN0byKmaS2yf7k78Cl9/4HBTns1XBCyuoEJ1sdveOlQj15Q5uvgRDTle/rhP MTzIbHsv8WHQR8HW28quHoB4G4gTLb0gZkMc66L5cRh3ebOtiyHiDxgQWs3ucbVp Qy2F32x9 =ebhf -----END PGP SIGNATURE----- --6Iz7u50GldpoYdAx--