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=-2.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 41FCEC47094 for ; Thu, 10 Jun 2021 10:51:46 +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 6A84A613DF for ; Thu, 10 Jun 2021 10:51:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A84A613DF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmx.de 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 76B0D82D3C; Thu, 10 Jun 2021 12:51:38 +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="ZsFuckDe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5916582D5E; Thu, 10 Jun 2021 12:51:37 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (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 2A50482D15 for ; Thu, 10 Jun 2021 12:51:34 +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=1623322291; bh=emOj62rAsXKi9pJ3C2OLanxVaUnQt+jLg2hTc7C1+S0=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=ZsFuckDeqw6pWyPVIVO3Xy6YxAU79LeOampqiAagbE5cy1f+Re6u5JclV+r9Xeylq HJnAGpcDMM12m8bPB2r+I2b1mBlx2freBSoCWhqXAoRW2w8xlb4m3/6btRtCP78Abn R98045GnPbYjuDfRZNd6+XNiWYiieJIWO5P1TOuc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.35] ([62.143.247.63]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MQMyZ-1ldllj3H4j-00MIuH; Thu, 10 Jun 2021 12:51:30 +0200 Subject: Re: EFI from usb HDD To: Sughosh Ganu , AKASHI Takahiro Cc: U-Boot Mailing List , Ilias Apalodimas , Michal Simek , Simon Glass References: <9c57a3c7-e609-91e8-cf33-5637ce4f9340@xilinx.com> From: Heinrich Schuchardt Message-ID: Date: Thu, 10 Jun 2021 12:51:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <9c57a3c7-e609-91e8-cf33-5637ce4f9340@xilinx.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:GIbU4t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+H7DCXuQSyZ4d 6CHZCJswW78phD1HoJF2ykpDQyqpFvzOnoCvRQNgAqAvVaWnbPuY/CtHDoRMQ8nbROcyVhLjt +6lux+B39Gy9e2dzGUGWdlO1qxKZwiL/JytOf4lht39s/8zc0Fv9h/g+o0w9BZUK68FnoZzTU qlAgS4Me37gP9OXsk+CNFWznVQfFz0ap0INjzNZdFxJksWjjIg64xY4tqnhAPPcLBe+1J1y6i E4VT84wYElZhcUdrFx2PSi7WnfY0QkOL+ujSUiP16Mlltimnu5lEylQsZMS5lhcMKq3pz48Vs HPy0koc+ZoCgo4X5N/7Es3S7rrJ78SWnm0g 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.102.4 at phobos.denx.de X-Virus-Status: Clean On 6/10/21 12:04 PM, Michal Simek wrote: > Hi, > > On 6/10/21 11:47 AM, Heinrich Schuchardt wrote: >> On 6/10/21 10:44 AM, Michal Simek wrote: >>> Hi, >>> >>> I am playing with booting from USB via EFI. And I see very weird >>> behavior. I have burnt image with grub to USB flashdisk and I have >>> tested it on 3 zynqmp boards. zcu102, zcu104 and SOM Kria board. >>> On zcu102 grub is going to boot menu and everything is working fine as >>> expected. >>> On zcu104 and SOM Kria I am able to get grub not to menu. When I list >>> partitions in grub I see that only SDs are listed: >>> grub> ls >>> (hd0) (hd0,msdos1) (hd1) (hd1,msdos1) >> >> Hello Michal, >> >> thanks for sharing your observations. >> >> What devices do hd0 and hd1 relate to? >> >>> >>> On zcu102(working board) I also see usb(gpt) partitions and SD. >>> grub> ls >>> (hd0) (hd0,gpt2) (hd0,gpt1) (hd1) (hd1,msdos1) >>> >> >> GPT and MBR partitioning are independent of the device type. >> >>> >>> On zcu104 I see one more error message >>> "PE image measurement failed" >> >> This is related to CONFIG_EFI_TCG2_PROTOCOL=3Dy. Do you have a TPMv2? T= his >> will not stop disk enumeration. >> >>> But I can't see it on SOM. >>> >>> U-Boot image is just the same for all boards. I am using generic >>> xilinx_zynqmp_virt_defconfig. >>> >>> When I compare DT description for USB between zcu102 and zcu104 they a= re >>> the same. SOM doesn't have usb enabled by default (but I enabled it) b= ut >>> grub starts which means that communication with USB is fine. >>> >>> It is based on my latest patches available here. >>> u-boot/custodians/u-boot-microblaze.git (usb-efi-issue branch) >>> >>> Also when I list usb I see all partitions just fine. >>> ZynqMP> part list usb 0 >>> >>> Partition Map for USB device 0=C2=A0 --=C2=A0=C2=A0 Partition Type: EF= I >>> >>> Part=C2=A0=C2=A0=C2=A0 Start LBA=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 E= nd LBA=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Name >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Attributes >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Type GUID >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Partition GUID >>> =C2=A0=C2=A0 1=C2=A0=C2=A0=C2=A0=C2=A0 0x00000800=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 0x001007fe=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "Microsoft basic dat= a" >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 attrs:=C2=A0 0x00000= 00000000000 >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 type:=C2=A0=C2=A0 eb= d0a0a2-b9e5-4433-87c0-68b6b72699c7 >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 type:=C2=A0=C2=A0 da= ta >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 guid:=C2=A0=C2=A0 0e= 7f8b3d-296b-4720-be9d-c4687d3c4a77 >>> =C2=A0=C2=A0 2=C2=A0=C2=A0=C2=A0=C2=A0 0x00100800=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 0x001197fe=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "Microsoft basic dat= a" >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 attrs:=C2=A0 0x00000= 00000000000 >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 type:=C2=A0=C2=A0 eb= d0a0a2-b9e5-4433-87c0-68b6b72699c7 >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 type:=C2=A0=C2=A0 da= ta >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 guid:=C2=A0=C2=A0 88= 92eddc-231a-4e6e-a5e1-c310f4482fb7 >>> >>> >>> Do you have any idea why on one system is working fine to get to menu >>> and on others there is an issue to get all partitions even u-boot is >>> able to see them and can work with them. >>> >>> Thanks, >>> Michal >>> >> >> Where is the GRUB binary? - If it is in EFI/boot/bootaa64.efi, it could >> be that the USB sub-system is simply not initialized yet when the boot >> manager is called by distroboot. >> >> For testing partition detection in the UEFI sub-system it is enough to = run >> >> =C2=A0=C2=A0=C2=A0 efidebug devices >> >> Until yesterday we had a problem with partition numbers >=3D 10, cf. >> >> efi_loader: partition numbers are hexadecimal >> https://source.denx.de/u-boot/u-boot/-/commit/3dca77b1dc1b6dbf9c8b51572= fe4b0553cef009f >> >> >> Block devices are enumerated in efi_disk_register(). Please, try to add >> debug output there to elucidate the problem. > > I found where the problem is. First of all zcu102 didn't use the same > image as others (it wasn't updated properly). > When you have CONFIG_EFI_CAPSULE_ON_DISK_EARLY that efi_disk_register() > is called before usb block devices are detected and registered that's > why grub doesn't see them. The problem is CONFIG_EFI_SETUP_EARLY=3Dy required by CONFIG_EFI_CAPSULE_ON_DISK_EARLY. Why is USB initialized later then MMC? Overall we have a deficiency in the UEFI implementation in that we cannot deal with block devices added or removed after initialization. Here integration with the driver model is missing. > I was looking at adding usb start in preboot but preboot is called later= . > How this should be solved? Any idea? > > Thanks, > Michal > > +cc Sughosh, Takahiro (who have developed the capsule code) Best regards Heinrich