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=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 2CACAC433EF for ; Wed, 22 Sep 2021 01:46:42 +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 62D8760F02 for ; Wed, 22 Sep 2021 01:46:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 62D8760F02 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 86998831A0; Wed, 22 Sep 2021 03:46:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bqx2otXg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CFF0E831BA; Wed, 22 Sep 2021 03:46:36 +0200 (CEST) Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) (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 67F3B83143 for ; Wed, 22 Sep 2021 03:46:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=grandpaul@gmail.com Received: by mail-pj1-x102c.google.com with SMTP id f3-20020a17090a638300b00199097ddf1aso3406039pjj.0 for ; Tue, 21 Sep 2021 18:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:to:cc:references:from:subject:message-id:date:user-agent :mime-version:in-reply-to; bh=MAIlcHrG2HqF9fHVmo5Xdj7wZROQ1LTuq/IXfbhA/fU=; b=bqx2otXgh4sowdVYjqVKo9RGmZluvhLXoCGBqww7Ehvpp6Xmlw+k+zXoTpodyf6aRH qruDvYNIiQDecP91ZpIH2Z/o3e1tf7z28uyfDXqrldpJh1AxKxqdmjsdc4Uezn64I5iH 5Hjd5Yrdgdk4a8YILfkjFlaG5mPHh8f3ho0SG9TEdfVO1/upF5jcYiELoP7Tpf+IBdad IAxY7i3NGzeBGvEpszS3G4gnpA3x4JqV/pjVxYQodI5iaraDnsxiUw0WUX1UE8Rfno/0 dLF7AmRDLWiWX/36Si7DTZIW52uyLVtMqBaUO6PtuTz8D+4CaI9nSLTPilijUEqXaAxj lQdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:to:cc:references:from:subject:message-id :date:user-agent:mime-version:in-reply-to; bh=MAIlcHrG2HqF9fHVmo5Xdj7wZROQ1LTuq/IXfbhA/fU=; b=WxhDKU+5j9c0E7GKkRREpIc0m8heURdVFZuTd0fm9uiCxeh73dz4JrdDqHl6YWQzMU LA7WBBc4EKIPDsCCnVsRrx85D47p+CcODZ4Qu6jgSZAnza2FS4mwUXvOQFblrG9G9upr 5WUnTgv30fsqpWu9soiuFoV3ftX4nhWtFLOfkpw1pi4TQrL6UMjIy69chpWz5EJL5uiW SdGqrqBmb4LCqzfLtBWCmiJlPlipo6/Mjl1WOMI568Fl5Uk4PCbJt2Khl6wU5hJto2vn 4cEKM0x2FgaodlmwyF7ifoVKy9iByRceWm96/qAmrX6nLP3pL41odFLJLkjz+0XYl+El 3XAw== X-Gm-Message-State: AOAM532sjOc2xbrucYIOoPH0i4OJZtnq7clMYEZA9lxIXifi1sBCbw4V Cp34rcmWLafUwJ8SK9v8C+o= X-Google-Smtp-Source: ABdhPJx/jTmY0JYBKNQ/ltAr74x0AhfExYIrR5S6OjOA3ZDrnCAwF18KzMLGhZKMtbYWKSXdThZWmw== X-Received: by 2002:a17:90a:bd18:: with SMTP id y24mr8590022pjr.83.1632275190294; Tue, 21 Sep 2021 18:46:30 -0700 (PDT) Received: from [192.168.66.10] (host-111-184-129-17.dynamic.kbtelecom.net. [111.184.129.17]) by smtp.gmail.com with ESMTPSA id d14sm353397pfq.61.2021.09.21.18.46.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Sep 2021 18:46:29 -0700 (PDT) To: Heinrich Schuchardt Cc: u-boot , Bill Mills , Boot Architecture Mailman List , =?UTF-8?Q?Fran=c3=a7ois_Ozog?= References: <0b1d9c1d-b432-368e-b60b-f11d1f57a3d3@gmx.de> From: "Ying-Chun Liu (PaulLiu)" Subject: Re: Question about extension board used in U-boot Message-ID: <0aad4f18-5489-25f2-d846-4192a4eb9997@debian.org> Date: Wed, 22 Sep 2021 09:46:24 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <0b1d9c1d-b432-368e-b60b-f11d1f57a3d3@gmx.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9vYzgg96Fh3YZqG6lAN9fnF83riSrFiuZ" 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 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9vYzgg96Fh3YZqG6lAN9fnF83riSrFiuZ Content-Type: multipart/mixed; boundary="WNDgGXpNic2vrRZgOwZnFIOUtmXtYEumV"; protected-headers="v1" From: "Ying-Chun Liu (PaulLiu)" To: Heinrich Schuchardt Cc: u-boot , Bill Mills , Boot Architecture Mailman List , =?UTF-8?Q?Fran=c3=a7ois_Ozog?= Message-ID: <0aad4f18-5489-25f2-d846-4192a4eb9997@debian.org> Subject: Re: Question about extension board used in U-boot References: <0b1d9c1d-b432-368e-b60b-f11d1f57a3d3@gmx.de> In-Reply-To: <0b1d9c1d-b432-368e-b60b-f11d1f57a3d3@gmx.de> --WNDgGXpNic2vrRZgOwZnFIOUtmXtYEumV Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US Hi Heinrich, I think I met some chicken and egg problem. Or I misunderstand something you mentioned. So I tried board_fdt_blob_setup() and board_fix_fdt(). Both are too early. I need i2c to be drived first. And then I can use dm_i2c_probe() on different address to detect which extension board it is= =2E However, in board_fdt_blob_setup() or board_fix_fdt(). i2c seems not working there. I can do the detection in board_late_init() but it is just too late for U-boot itself. Good for Linux kernel though. Sorry for my bad English. Measured boot is already working on my branch. But the way I implemented this is directly modify the dts of U-boot and assume the TPM extension board is always there. Thus this is not upstreamable. I think let me upstream some code by extension manager first (for linux kernel first). And then we can see how the detection is implemented and how to modify it for U-boot. Thanks, Paul Heinrich Schuchardt =E6=96=BC 2021/9/18 =E4=B8=8B=E5=8D=883:14 =E5=AF=AB=E9= =81=93: > > > On 9/18/21 8:54 AM, Fran=C3=A7ois Ozog wrote: >> Le sam. 18 sept. 2021 =C3=A0 08:49, Fran=C3=A7ois Ozog >> a >> =C3=A9crit : >> >>> Hi Paul >>> >>> Too posting because I think we also need to address this at a higher >>> level. >>> >>> i think we discussed this topic quite a while back. I may be wrong >>> but it >>> may be Bill Mills who proposed to have an eeprom on the extensions >>> that the >>> carrier board can use to detect and fetch proper overlay. Another >>> way would >>> be that the contract between the extension board and the carrier boar= d >>> includes an i2c accessible storage to fetch an overlay that would >>> identify >>> the board and give all details. >>> >> i just forgot to state that the mode is well known: SPD for DIMMs. >> >>> Bottom line, a software only solution seems not entirely satisfying. >>> In that suboptimal case, U-Boot shall be able to assemble a DT for >>> itself >>> and another for OS (may be same in some cases) through scripting. >>> And in >>> this case, come your questions=C2=A0 below >>> >>> . >>> >>> Le sam. 18 sept. 2021 =C3=A0 01:21, Ying-Chun Liu (PaulLiu) >>> >>> a =C3=A9crit : >>> >>>> Hi all, >>>> >>>> >>>> I have some questions about how to implement extension board usage. >>>> My case is on imx8mm-cl-iot-gate. It can add three different types o= f >>>> extension boards. >>>> One of the extension boards is SPI extension which have 3 empty slot= s. >>>> And you can add >>>> some small boards onto it. One of them is a "TPM2" module. > > You could implement the weak function board_fdt_blob_setup() to detect > your addon boards and extend the devicetree. > > >>>> >>>> >>>> My first question is if I want to use tpm2 in U-boot for measured >>>> boot. >>>> How to implement this right? Currently I just modify the dts used by= >>>> U-boot to let it drive > > Measured boot is provided in U-Boot v2021.10-rc4 based on TPMv2. Just > enable CONFIG_EFI_TCG2_PROTOCOL. > >>>> the extension board. And let it drive the TPM. But it is not good fo= r >>>> upstreaming because >>>> when other types of extension boards installed then it is not workin= g. >>>> Where to implement this? What is the best practice of this? >>> >>> >>>> The second question is about extension manager. >>>> I have read the extension.rst. I think I'll implement this anyway >>>> because then >>>> I can have a command to query what type of extension boards I have. >>>> And if the extension board is the 3 slots one. I can then detect whi= ch >>>> slot is the TPM. >>>> I'll implement this anyway because the "extension" command is >>>> convenient >>>> for users. >>>> But it seems to me that it only solves the problem for Linux kernel.= >>>> It can apply a DTB Overlay to Linux DTB to let Linux knows we have >>>> that >>>> extension board. >>>> But it is too late for U-boot itself, right? >>>> >>>> >>>> The third question is I'm also dong SystemReady IR certificate. >>>> That means >>>> the dtb for Linux is directly provided by U-boot. We use U-boot dtb >>>> directly to Linux >>>> kernel. In this case, how to modify that dts dynamically to feed to >>>> the >>>> Linux kernel by >>>> the extension manager? > > U-Boot has a fdt command which you could use to apply overlays. Or > implement function board_fdt_blob_setup(). > > Best regards > > Heinrich > >>>> What is the best practice if I want to use U-boot dts for Linux in >>>> implementation? >>>> >>>> >>>> Thanks a lot. >>>> >>>> >>>> Yours, >>>> Paul >>>> >>>> >>>> --=20 >>> Fran=C3=A7ois-Fr=C3=A9d=C3=A9ric Ozog | *Director Business Developmen= t* >>> T: +33.67221.6485 >>> francois.ozog@linaro.org | Skype: ffozog >>> >>> --=20 >> Fran=C3=A7ois-Fr=C3=A9d=C3=A9ric Ozog | *Director Business Development= * >> T: +33.67221.6485 >> francois.ozog@linaro.org | Skype: ffozog >> _______________________________________________ >> boot-architecture mailing list >> boot-architecture@lists.linaro.org >> https://lists.linaro.org/mailman/listinfo/boot-architecture >> --WNDgGXpNic2vrRZgOwZnFIOUtmXtYEumV-- --9vYzgg96Fh3YZqG6lAN9fnF83riSrFiuZ Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEEo2h49GQQhoFgDLZIRBc/oT0FiIgFAmFKivEFAwAAAAAACgkQRBc/oT0FiIgW ABAAx/k0GPS1aJJP1amuSKC05eOVTyQx5fB7SGBN4RMIiALNnFfXxrfRt4/gxQw374ueX0YJCgh2 WQbazU8BpWC5xrqAwODYTtA0kxPxUNvKQYp/FqnG6VcXLYGmfnBNCqbNc4TLAH7G1Zr+uzW3ev7s kq/4t85yG7IzYFi9Tu6s7TvozdftVkAnDrJCTMmRMEjwUG8eL89n9Rl1aV7k1XpUBDfChxY0Hloc C1sI9AlIKh/8VLQAq6CPhsAHddhN+tduQt656lCaPpK5wIRm3zdkr9KG+hzO1y2VA9c3j6pgUgmV WxhfJut88YZCNTyXDc2RZn14nxQr0d5uYOjxgMhy/ssef/ZRf3gMmwUcyysGcp3ntzQPSlthPD9e 20iYSf0SfGwhJ/ffvRp0tvNVwM0ll+aAgzkf490XaAEyrQTqRReG2Q2GkNMk+qzzVuZtjEJIcQWM oI1bTlSmUsjeT8olQcP30/VWpDYC5TE6s73Bbmfk3PU0VLzNmw1D3YkTo4Qq2gc+kksaQerR0LYu fcyDwSJ5FXCey4Z5kucN+/EpsDl2LrD9qXg1t4c1KPNRHBFOMEhpBNYZc6HgJCHxfylDWY/pfrLV VLyOXG1JmKyTyDM3vuTFdhz0swnw2SqGmt+DMsF7T86J7Apyf98NL+FhUtsVWPgR9BiJ50mhaEAu qDg= =O9Rq -----END PGP SIGNATURE----- --9vYzgg96Fh3YZqG6lAN9fnF83riSrFiuZ--