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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3A0AC433EF for ; Fri, 1 Oct 2021 07:56:19 +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 C855D619F7 for ; Fri, 1 Oct 2021 07:56:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C855D619F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmx.de 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 2FF8581F0B; Fri, 1 Oct 2021 09:56:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmx.de 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; secure) header.d=gmx.net header.i=@gmx.net header.b="PMS9Il5h"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D49BB82128; Fri, 1 Oct 2021 09:56:13 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 754768187B for ; Fri, 1 Oct 2021 09:56:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1633074968; bh=rj/vE+hh994+DJya2q2k+OpeR/wUcJWrJP1Ti5QNx6U=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References:In-Reply-To; b=PMS9Il5hvNZcjR/wR5z9ggmfJWfbZBJAgkflgoQTtxVvWLud8Ot3B5jn+/Hb7aWjr I0mhST0kEhvN0Ae8fuTCo3HQu9R3JI4fCAua2tpt2S+KOnpTxcUOyxVTSYlFugAezA n7+rU2t0lUUn1Lr2Ta9qWr5Qlex/XRRBPGZz8b00= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.55] ([88.152.144.157]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MN5eX-1mDr4P2753-00J1pn; Fri, 01 Oct 2021 09:56:08 +0200 Message-ID: <337aa907-df73-942d-9335-8745dcd845a8@gmx.de> Date: Fri, 1 Oct 2021 09:56:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.1 Subject: Re: [RFC 01/22] part: call part_init() in blk_get_device_by_str() only for MMC Content-Language: en-US From: Heinrich Schuchardt To: AKASHI Takahiro Cc: u-boot@lists.denx.de, agraf@csgraf.de, sjg@chromium.org, ilias.apalodimas@linaro.org References: <20211001050228.55183-1-takahiro.akashi@linaro.org> <20211001050228.55183-2-takahiro.akashi@linaro.org> <5fcb7f04-a1e5-ed16-b785-e624a74e5e11@gmx.de> In-Reply-To: <5fcb7f04-a1e5-ed16-b785-e624a74e5e11@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:dSWTlAb2A2BTna2PLZoCMMTmAqR1LkpSkVwWBE92JmRUraGFb6i Ow38kfBnr43J8cZhZawedSbgz0JOk1CDCElM9W0v7ftW7ZBr3KVg2VHWXPQSwhj10kfP392 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MWf/OUuAnm89oDCGPU7/dOYxFpefr19b20m79Dreq oa+6tLigtUxeuqXbnp11JFAgWlxhKUG320cUD0aeCq2d4hBub6SetjjSQzzZUDSCa+EsMgEsj BuY0R4rILYnReY9rDheHRcw9r3Vsox83vB+YwZd4mKIQmr1SlT0e7lsQEIn/3ecaUzkW03Yir gU9q0vN8M+3TIo= 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 On 10/1/21 08:41, Heinrich Schuchardt wrote: > > > On 10/1/21 7:01 AM, AKASHI Takahiro wrote: >> In blk_get_device_by_str(), the comment says: "Updates the partition >> table >> for the specified hw partition." >> Since hw partition is supported only on MMC, it makes no sense to do so >> for other devices. >> >> Signed-off-by: AKASHI Takahiro >> --- >> =C2=A0 disk/part.c | 3 ++- >> =C2=A0 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/disk/part.c b/disk/part.c >> index a6a8f7052bd3..b330103a5bc0 100644 >> --- a/disk/part.c >> +++ b/disk/part.c >> @@ -427,7 +427,8 @@ int blk_get_device_by_str(const char *ifname, >> const char *dev_hwpart_str, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * Always should be done, otherwise= hw partition 0 will return >> stale >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * data after displaying a non-zero= hw partition. >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ >> -=C2=A0=C2=A0=C2=A0 part_init(*dev_desc); >> +=C2=A0=C2=A0=C2=A0 if ((*dev_desc)->if_type =3D=3D IF_TYPE_MMC) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 part_init(*dev_desc); > > For an eMMC the following logical levels exist: > > * device > * hardware partition > * software partition > > Linux might show the following: > > /dev/mmcblk0 - user data area > /dev/mmcblk0boot0 - boot hardware partition 0 > /dev/mmcblk0boot1 - boot hardware partition 1 > /dev/mmcblk0rpmb - replay protected memory block > > How are the different hardware partition modeled in the UEFI device path= ? This is a list of block devices with their Linux name and the device path in EDK II as seen on my MacchicatoBIN board: /dev/mmcblk0 VenHw(0D51905B-B77E-452A-A2C0-ECA0CC8D514A,00006EF00000000000)/eMMC(0x0)/C= trl(0x0) /dev/mmcblk0p1 VenHw(0D51905B-B77E-452A-A2C0-ECA0CC8D514A,00006EF00000000000)/eMMC(0x0)/C= trl(0x0)/HD(1,GPT,C53259E6-9B1D-40CD-B4EF-39520011EF2B,0x2000,0x3FE001) /dev/mmcblk0p2 VenHw(0D51905B-B77E-452A-A2C0-ECA0CC8D514A,00006EF00000000000)/eMMC(0x0)/C= trl(0x0)/HD(2,GPT,A0AE9901-B847-4150-B947-6C8FF69529A7,0x400800,0xA8F7DF) /dev/mmcblk0boot0 VenHw(0D51905B-B77E-452A-A2C0-ECA0CC8D514A,00006EF00000000000)/eMMC(0x0)/C= trl(0x1) /dev/mmcblk0boot1 VenHw(0D51905B-B77E-452A-A2C0-ECA0CC8D514A,00006EF00000000000)/eMMC(0x0)/C= trl(0x2) > Should each hardware partition be a separate udevice? We need a udevice matching the hardware partition. These child devices should be created when the eMMC device is probed. Best regards Heinrich > > For NOR flash we also have an extra level: > > =3D> setenv mtdparts > mtdparts=3D30bb0000.qspi:1m(U-Boot),512k(Env),512k(DTB),2m(User_FS),12m(= Data_FS),4m(Factory_FS),34m(Ramdisk),10m(Linux) > > =3D> mtd > > device nor0 <30bb0000.qspi>, # parts =3D 8 > =C2=A0#: name=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 size=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 offset=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 mask_flags > =C2=A00: U-Boot=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 0x00100000=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x000000= 00=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0 > =C2=A01: Env=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x00080000=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 0x00100000=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0 > =C2=A02: DTB=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x00080000=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 0x00180000=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0 > =C2=A03: User_FS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 0x00200000=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x00200000=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 0 > =C2=A04: Data_FS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 0x00c00000=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x00400000=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 0 > =C2=A05: Factory_FS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 0x00400000=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x01000000=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 0 > =C2=A06: Ramdisk=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 0x02200000=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x01400000=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 0 > =C2=A07: Linux=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 0x00a00000=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x036= 00000=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0 > > active partition: nor0,0 - (U-Boot) 0x00100000 @ 0x00000000 > > Has part_info() to be called here too? What is the if_type? > What are the devicepaths for these partitions? > > Best regards > > Heinrich > >> =C2=A0 #endif >> >> =C2=A0 cleanup: >>