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=-10.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,MSGID_FROM_MTA_HEADER,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 043BEC4338F for ; Fri, 13 Aug 2021 07:57:29 +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 BFA486109D for ; Fri, 13 Aug 2021 07:57:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BFA486109D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=t2data.com 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 B517882C2D; Fri, 13 Aug 2021 09:57:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=t2data.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=t2datacom.onmicrosoft.com header.i=@t2datacom.onmicrosoft.com header.b="GaDayoe0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0592D82D91; Fri, 13 Aug 2021 09:57:23 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on062d.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0e::62d]) (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 7C3DA8201E for ; Fri, 13 Aug 2021 09:57:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=t2data.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=christian.melki@t2data.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DUmIT+d9bBeu5uEecnsCK5hD2mtfnrndlEXUBaIx+VmGRiJXypnfIzhTYoJuAVy4MUhi5rF4D3gq7JLVinhmnTE/m/xhT8Tphi3nMYSnDmWwGyYdscKZNeG46hWjR2msrWbRHP60lmFiG56shSIncU131tGvZLJELl1R5MJZ4SvjSNzxk6lFW1lpauV7yYspK4xtpjk9272dcIzKA/x3fiRGW1kNX/KUwGvxyDw/utpuEHGNpusJMGfchreG4kdqz5p8pWL5WlwInwBCSYPMBa1i97NbdL8TDr3yJh9U7rbT4C+v+kQMqz2Dj9k6KDBv0kQjOUbVLWfdddW142Xf0g== 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=i2qKvRbZNwGz/vGkUVioORkggQ+dvxsC1TImrE4/Ti4=; b=P54Y+QhMGtNprEyY53jmRGJW0iOTkMil/gGqFGTAIltrUiq+Ke2YMuWyTNAbt9R8qLS57OByYDVtNJSoGCSN8mdD1PZTe5cphE1HHrq3hAOG39/Hp6HV87za7/Smj0UVbYl/vipj4Em6GTUTuDR9Y1dviPCEq3fBW75s8RKB2JU4P5Agj2pXk+MtKjbOZBpeX+QgLYW1UY7k8ff8Nyj7wtxvKLRDm4iCvjSEvtG6XlG/9wBQSFxeT/3hRACK7iXBV3ArISSpBJ79N8mcvpDirjLXW3VEn9YcCDGU7NVSIBzAMb0cwe9kw+ueSzgrLtqYcqAfF7e8GZD5vCEWJWQR3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=t2data.com; dmarc=pass action=none header.from=t2data.com; dkim=pass header.d=t2data.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=t2datacom.onmicrosoft.com; s=selector1-t2datacom-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=i2qKvRbZNwGz/vGkUVioORkggQ+dvxsC1TImrE4/Ti4=; b=GaDayoe0P7Bqqn7FbVWGskPmnfp2O0i5WXcROzCz17nThXEhA7dB2d5zhldfO4/7rp2sjjJ2MxVsAfWxgDYXZ9aMwB5k4jLxm2RGTE9CmLKQLj0jMEwBdBtcNbdv4CUKt4jlJ82GEOvAS5q45lVkl147KoYbwJF1y04fLPF7xno= Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=t2data.com; Received: from AS8P251MB0167.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:403::21) by AS8P251MB0017.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:344::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15; Fri, 13 Aug 2021 07:57:17 +0000 Received: from AS8P251MB0167.EURP251.PROD.OUTLOOK.COM ([fe80::dd37:4003:79e5:4b70]) by AS8P251MB0167.EURP251.PROD.OUTLOOK.COM ([fe80::dd37:4003:79e5:4b70%6]) with mapi id 15.20.4415.019; Fri, 13 Aug 2021 07:57:16 +0000 Subject: Re: Hints on how to use efi_driver/efi_block_device.c To: Heinrich Schuchardt Cc: U-Boot Mailing List , Simon Glass , takahiro.akashi@linaro.org References: <63da56b7-85d2-c39e-2112-9d1296d87aad@t2data.com> <985f1960-868f-83b3-6b1e-a90f682be0a4@gmx.de> From: Christian Melki Message-ID: <24b70edf-dc17-f135-7fa7-260fc6127dc7@t2data.com> Date: Fri, 13 Aug 2021 09:56:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 In-Reply-To: <985f1960-868f-83b3-6b1e-a90f682be0a4@gmx.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: HE1PR0401CA0085.eurprd04.prod.outlook.com (2603:10a6:7:54::14) To AS8P251MB0167.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:403::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [172.16.234.94] (212.247.174.226) by HE1PR0401CA0085.eurprd04.prod.outlook.com (2603:10a6:7:54::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Fri, 13 Aug 2021 07:57:16 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bd41a838-f4bd-416d-ab09-08d95e2ff80a X-MS-TrafficTypeDiagnostic: AS8P251MB0017: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k1U16nZG85PZYzgkFSeVn51OB2okuD+grQsZpVd14XcagRbP4tz7lwo4NvHq8mXP0yYbTpOpw3l071AnPOD6wOp2XWmVZbmqHrpWNCqIMV6dKZrWz1ej2T9JyrzrY4cMN/Y+ct1hRD4+FVQ7gh1vrHWZXwUAX4SM8Fd54mqLh+ucxSSCbSNDFDy22jD116WLvRZagcMN8gi8zCCUf71U9VlxNKmdRGHd2391oNuRDFj3F3PrMfoS8TVlsG+3xxKwUchfTkIeaMtZKGfNNGookq/UMkQrjYDPCJuGThl7rWUgHEIv3/w1UvH6sR4FtGC5zggTvS7zRqfIWfHCqWW2F9MEofWJJJYjgc9789o/fkY+U9nhdT8uoSOHneISkFOQ9/n47yHdjEUIZ5VVbcB89m0l74oEGvXGlzxHYdnTcMErcWoWK7y8WwVXB/9lYnh/6jfnXBiqR1XLJHk+lhNKFX+UltIWt3UYiHJM+LNOs/GHnvJMUywXDOcvO8YZAe0yMHZ8UGnKkWAsnufwkYocJZtjRGvuQsbFseyauBZ+77GSM7tZGI0/q7BsqLuu66Ze28BbK3ujoy+ry/ia64OWZtpE8zVAyopefY20GiZZ29Tslwb7DRHks1l9YNOKpmjH8BAqzqFeMGxTr/lHRnFnKAmWsREAtl5ozlEDpumxC5mUQ0FYmulYnWtAdQP7E6TGUKEIPoozLORMAcSWB6Ew/F3KyPRNeCR5fEMPGbiyB8dNLOA73Pz3due8g42zEbDEpJN4bMI0NO9FHQBBHv2riH2M1AEqcAj/dIXh/b4MHDMXzyA9pnKDneJowRqIxx2in9mYRy4Q2Nqy0a4aIZSoFg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8P251MB0167.EURP251.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(42606007)(136003)(346002)(39830400003)(376002)(396003)(366004)(54906003)(316002)(16576012)(4326008)(52116002)(6916009)(31686004)(2616005)(66946007)(956004)(186003)(66476007)(8676002)(38100700002)(38350700002)(8936002)(66556008)(6486002)(966005)(5660300002)(36756003)(83380400001)(31696002)(26005)(6666004)(53546011)(2906002)(86362001)(508600001)(44832011)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eFZiTWdBNmJSMlduRFJ5WUVVTXJEL0ZadUs2UzVmSzlnYUQySzJQK3hTNWNt?= =?utf-8?B?QTEyLz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ab09-08d95e2ff80a X-MS-Exchange-CrossTenant-AuthSource: AS8P251MB0167.EURP251.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2021 07:57:16.8245 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 27928da5-aacd-4ba1-9566-c748a6863e6c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 55fVsAgIJNQK6iYbdtwhRPhB5Ynf6auDijnSNbRd9TdTFbl9HmBec67fQtwksB1qf8fV/VAcSdEgQFRCIZZw8dVnh9s5/2YI84NYw07RTKM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8P251MB0017 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 8/13/21 2:36 AM, Heinrich Schuchardt wrote: > On 8/12/21 11:49 PM, Simon Glass wrote: >> +Heinrich Schuchardt too >> >> On Thu, 12 Aug 2021 at 08:35, Christian Melki >> wrote: >>> >>> I was hoping that U-boot would detect BLOCK_IO devices provided by UEFI >>> automatically. But I can't see anything attached under lsblk or find >>> some other information about this. >>> For example, Barebox works just fine on both Virtualbox and real >>> hardware in this regard. >>> >>> Barebox does not have an emmc driver for the real hardware but >>> piggybacks off the UEFI protocol for this. > > Hello Christian, > > U-Boot can be used in two scenarios: > > 1) U-Boot is the firmware providing the UEFI API > 2) U-Boot is running as an application consuming the UEFI API. > > Barebox only supports scenario 2). > Ok. >>> >>> I'm sure that the idea with this U-boot driver is something like that, >>> but would appreciate some hints on how to use it. > > efi_driver/efi_block_device.c is used in scenario 1). > > When a UEFI payload like iPXE provides an EFI_BLOCK_IO_PROTOCOL on a > handle and calls ConnectController() U-Boot will install the > EFI_SIMPLE_FILE_PROTOCOL for each partition on the block device. > > You can find a detailed description of this use case in: > > * https://u-boot.readthedocs.io/en/latest/develop/uefi/iscsi.html > * https://archive.fosdem.org/2020/schedule/event/firmware_duwu/ > I read the fosdem presentation, but apparently did not understand it correctly, as I thought it could be used for presenting the UEFI block IO protocol. >>> >>> Ie, standard usage. UEFI boots of a drive, posts some handles(?) to a >>> block device and U-boot picks it up, not knowing more about the >>> abstracted hardware. > > Here you seem be referring to scenario 2). > > For scenario 2) support for UEFI block devices has not been implemented, > yet. As operating systems like Linux, BSD, Windows all can be booted via > UEFI there has not been any use case driving further development of this > scenario. > > Please, describe what you want to do with U-Boot. I have an x86 board (DFI GHF51, AMD Ryzen R1000) with an ACPI presented eMMC. AMDI0040. U-boot does not seem to recognize this device (Linux works fine. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/mmc/host/sdhci-acpi.c). So I thought the UEFI block IO protocol could come in handy as a generic abstraction. The device works fine under Barebox with this mechanism. So without a native or an UEFI block IO driver I have no disc access in U-boot. I know that UEFI can boot a EFI-stubbed kernel directly. But I am more comfortable with the U-boot "ecosystem" than UEFI, also it is easier to merge more platforms under the same (existing) boot mechanism/behavior/environment using U-boot as an intermediate than just UEFI (older ARM/PPC etc). So definitely an use-case for me. Thanks in advance, Christian > > Best regards > > Heinrich