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.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 BA7C9C47094 for ; Thu, 10 Jun 2021 12:32:04 +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 8889F613C1 for ; Thu, 10 Jun 2021 12:32:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8889F613C1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.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 5BA9082D5E; Thu, 10 Jun 2021 14:32:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.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=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="q2eE9QIO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2667D82E55; Thu, 10 Jun 2021 14:31:58 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2061f.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaa::61f]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2907782D15 for ; Thu, 10 Jun 2021 14:31:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michals@xilinx.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oo9igQhnBrWiOuMKQafnCWaeYK7Xvra9G+IlOmlXy3fUhV9TO9nl525wwjhvpnYQ8topNPNHLb1hS9RCrNimB06FjrKO+3XxnH1UK22ybfu3+fWDd7OLzXWo9+mHSB/MaNgba+gMvrrCUjhS0OwF/zXh69Sc7xzAf1zDlVHFobn9GPvjLA+d5n9Iku5cNdGL0b519ujSB1b/jRnR+A9fSxMHlCS8AsgoKY7NFKWdteB6oGc8hXl4jEnxJLFRSVKPPo9N1ptTgj1+ELzDc6luYHmIzMjBC+/cWcBQYQV0Rrnj2V8Re/ILtxA9vgwGqkZRaV1XdzLQZy+Jr50i9PYVEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ycyG6ax7GbY+aEJyM8c9Oiqd2vXdcMnm988We72GUiY=; b=iMXaMeWUpJWxrrTHUFcYN+DAbzjSZKP2o2uHeeYEwVCcAjeHkRJ1BsKGStrIot7AgQY8hnkJCrzJKQ2Fng7EcyEYjU7pDQVxXjDMZARAdR9zpbLpSqL9GVk4WuIKDe0UytieZrzA0UKoJSc4pYcKvZfqTXwreqizjvP4YbAwPWc9Q8Sk3QTe7rlgHFzeapQvbOqjC3QBhiVQPwwcmuoyqHeFUTrpx9Do7Ajo0KjOv9Rj9COSCGSEnn3fG0tIwZcma34y5v7kIDd2AW+gkA2uoQwNWwaJliW1OnZikuFaA2RmfzfQMOCGMWaM3m7uq0yhtrZFNeXIZdkm7JmoMlEHJw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=chromium.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ycyG6ax7GbY+aEJyM8c9Oiqd2vXdcMnm988We72GUiY=; b=q2eE9QIO9sLPx3FKQZAenxCfqCZ7+WhEK0V5qfd7arZVmVXy7GmTojzaqEV4XXXaq+WiL6lxGMoY69cgHxoLylei/LEj5H+QTs9xE7zQEBOdADoG/hjdnDC3zVJjlWpONED8Gb6XB2spD+67f/T8yzFNojU6XEbCYsyryLhVDA8= Received: from SN4PR0501CA0067.namprd05.prod.outlook.com (2603:10b6:803:41::44) by BN0PR02MB8256.namprd02.prod.outlook.com (2603:10b6:408:157::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Thu, 10 Jun 2021 12:31:51 +0000 Received: from SN1NAM02FT0023.eop-nam02.prod.protection.outlook.com (2603:10b6:803:41:cafe::c6) by SN4PR0501CA0067.outlook.office365.com (2603:10b6:803:41::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.9 via Frontend Transport; Thu, 10 Jun 2021 12:31:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0023.mail.protection.outlook.com (10.97.4.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4219.21 via Frontend Transport; Thu, 10 Jun 2021 12:31:50 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 10 Jun 2021 05:31:49 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Thu, 10 Jun 2021 05:31:49 -0700 Envelope-to: sjg@chromium.org, ilias.apalodimas@linaro.org, u-boot@lists.denx.de, takahiro.akashi@linaro.org, sughosh.ganu@linaro.org, xypron.glpk@gmx.de Received: from [172.30.17.109] (port=53066) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lrJqf-0007GW-20; Thu, 10 Jun 2021 05:31:49 -0700 To: Heinrich Schuchardt , Sughosh Ganu , AKASHI Takahiro CC: U-Boot Mailing List , Ilias Apalodimas , Michal Simek , Simon Glass References: <9c57a3c7-e609-91e8-cf33-5637ce4f9340@xilinx.com> From: Michal Simek Subject: Re: EFI from usb HDD Message-ID: Date: Thu, 10 Jun 2021 14:31:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 695e69c1-2f74-409e-80f8-08d92c0bb8ff X-MS-TrafficTypeDiagnostic: BN0PR02MB8256: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:2150; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BGxwwwaAlQW9A9mQpct/3CVOG5gDLeJMBktc4UV22auWb86MVbhAKilh8KoBb9zdd0mIBmU+wyvNrVXRfLYDrFNbox3jhO6eFsuMCQ7tz8rVDS8fqw76sqYfSvWNQgUzi28KFGo+Lc5vao/8ozWKSx284bE/4yC5RUCk7n7GsOIbYpGnnYOl/LXyUW9eJExfOhCS7PuPlhfjmoaJ22nSyT6Scdbqkqmevs+9vdfLfmXnXCAYqpHcBNsNNWhxOYXxAEuTYbw4gpVUQW0QDBiRh/ZMH1wdx4Xqmrox6F9cAzUduv29j+W3abZ247RaNc2QBenq2BvAQ+6H7I9Rt2kHHRlB7il57vX37EhrUs1xJA9qrgfiiThO14mgjTeaOMSyKgu/CMZewWATSG8cpp66zYMw45YilNaJVTVTYkEtc7AUvK0/wyZAumDyJzGsM3bVrIfhQE8edNsdJ2bKpmfmnnJFwK+XG7aA9M/dz8q2yunxvUKxNSG+O9oaskKBChyKNh2nSN27ZIM7kRpEolwdSgB/Vd/cRj9v7tKhoQLT4qlFyGtE6qlJPCNgnXAfh4rZDc1ixhKR8m4P+8zuSUh4irqGO4h1y6sBSK0MfRxTAq/7SID+dO3Bwd0CU1CIs19POFrhUTZ0zkBspsq6aPYRdEW/sDpw0lXDC+853o2EpsIH+2kqv3v5ImYcdJM+2OuYntrsjv7WupykIMQ4KvvU9kUt1LpHvkKoBnPnQfgNkcjjJ+5XANmd0w5XtPt7TupsvNvquDYjG/59d1V3Bzlp43fWAKZj53qj2OLhxQolZA+1/s8YEjBwbmSgrk/DISkK7JOKDo3a1EtBcx1n9mdeLQ== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(346002)(376002)(396003)(39850400004)(136003)(46966006)(36840700001)(356005)(31686004)(83380400001)(426003)(5660300002)(82740400003)(7636003)(31696002)(4326008)(6666004)(186003)(336012)(36756003)(82310400003)(47076005)(3480700007)(70206006)(2616005)(44832011)(26005)(54906003)(36906005)(316002)(110136005)(45080400002)(9786002)(966005)(8676002)(2906002)(8936002)(53546011)(70586007)(478600001)(36860700001)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2021 12:31:50.8851 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 695e69c1-2f74-409e-80f8-08d92c0bb8ff X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0023.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR02MB8256 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:51 PM, Heinrich Schuchardt wrote: > 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=y. Do you have a TPMv2? This >>> 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 >>>> are >>>> the same. SOM doesn't have usb enabled by default (but I enabled it) >>>> but >>>> 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  --   Partition Type: EFI >>>> >>>> Part    Start LBA       End LBA         Name >>>>           Attributes >>>>           Type GUID >>>>           Partition GUID >>>>     1     0x00000800      0x001007fe      "Microsoft basic data" >>>>           attrs:  0x0000000000000000 >>>>           type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 >>>>           type:   data >>>>           guid:   0e7f8b3d-296b-4720-be9d-c4687d3c4a77 >>>>     2     0x00100800      0x001197fe      "Microsoft basic data" >>>>           attrs:  0x0000000000000000 >>>>           type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 >>>>           type:   data >>>>           guid:   8892eddc-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 >>> >>>      efidebug devices >>> >>> Until yesterday we had a problem with partition numbers >= 10, cf. >>> >>> efi_loader: partition numbers are hexadecimal >>> https://source.denx.de/u-boot/u-boot/-/commit/3dca77b1dc1b6dbf9c8b51572fe4b0553cef009f >>> >>> >>> >>> 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=y required by > CONFIG_EFI_CAPSULE_ON_DISK_EARLY. > > Why is USB initialized later then MMC? It is not just usb. SCSI/sata are behaving in the same way too. > > 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. Right. And also there are commands which can create MBR partitions and I expect when you write image to SD and then run rescan or so you could get other partitions too. Maybe hook via part_init()? with removing efi_disk_register. > >> 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) Thanks, Michal