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 E6A7CC433EF for ; Tue, 26 Oct 2021 03:30:57 +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 577F660F90 for ; Tue, 26 Oct 2021 03:30:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 577F660F90 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.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 68B5B83576; Tue, 26 Oct 2021 05:30:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="lD1gtciM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F21AF83521; Tue, 26 Oct 2021 05:29:51 +0200 (CEST) Received: from mail-ua1-x92d.google.com (mail-ua1-x92d.google.com [IPv6:2607:f8b0:4864:20::92d]) (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 A65028353F for ; Tue, 26 Oct 2021 05:29:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-ua1-x92d.google.com with SMTP id e5so19307175uam.11 for ; Mon, 25 Oct 2021 20:29:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=05Rtelmic7ErtzwAHleDNyQdWN5Wtq7L2+v4NE9/z2M=; b=lD1gtciM6kEXKkXWTgr2RXwn5pdU9wCp5Bl0ZaqOzRGnla50sQHQfYGJHHnXFu5FMG TKRBHRPESjqlViase9uRfBpzgLjoUVNvgmGVvV8vSufBRjPLDtIWazRbT3GhELAGs52O 04+w6fQaLUj2hIED4CXZonkcNwylN/VYdRQhw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=05Rtelmic7ErtzwAHleDNyQdWN5Wtq7L2+v4NE9/z2M=; b=iQiF25jNK02jK9mK/T7W9xM6Pl0lltFeKVN6LhnZNboLXakx8FklWJjjUMmUqPe1xH nteIMHXgtfuBJRC7gHncabXx6bquQJxDgMeFjES+ctBKTqecElHJ4yP/RPNvosXWm1si oC8f00x05DlowbFv00786JSKydh8KCjaVW7HMvhLv2Xx4fa4Mpd3UNgvWonQzvW3t5il 3g2nalVniySJerg/2qc4IRQ4Y7m2TrEyg3dUvK8EmzUSUcNjvu4iDDW0NLN77pGOFNF4 ieccIoXKPmbN5m4s8nZ4PxYx8zlqkaLxFgPGWsnkO4l58GgcxxLqI09Sku2jwP0CJwOx JDkQ== X-Gm-Message-State: AOAM532MxeFS8qgQrzeH5o/SkXCDdqLVzhxDbpwYX60QavYLiTVvOdK5 ketsEoUVmJGZrlcmWRe4qFW8WBBR9tH4s7sQ3F6zrw== X-Google-Smtp-Source: ABdhPJwrDpHgn5T8kX+lTR1E1dgYiHpKJPieQToatFtaxJ3hEzHvDnDZWRznsrDqxw/gA1B0ENWDF9Vb0GzjUph3Dfc= X-Received: by 2002:ab0:22d0:: with SMTP id z16mr20079416uam.143.1635218983188; Mon, 25 Oct 2021 20:29:43 -0700 (PDT) MIME-Version: 1.0 References: <20210925003055.759305-1-sjg@chromium.org> <20210924183029.v2.5.I64a9f2e15201e8dba68a24e903cc1ac59237169e@changeid> In-Reply-To: From: Simon Glass Date: Mon, 25 Oct 2021 21:29:31 -0600 Message-ID: Subject: Re: [PATCH v2 05/39] x86: Show some EFI info with the bdinfo command To: Heinrich Schuchardt Cc: U-Boot Mailing List , Bin Meng , Christian Melki , Tom Rini , Ilias Apalodimas Content-Type: text/plain; charset="UTF-8" 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 Hi Heinrich, On Mon, 18 Oct 2021 at 11:15, Heinrich Schuchardt wrote: > > On 9/25/21 2:30 AM, Simon Glass wrote: > > It is useful to see some basic EFI info with the command as it forms part > > of the information about a board. > > > > Add a hook for this and show the table address as a start. > > > > While here, fix an invalid cast in setup_efi_info(). Note that this > > function is using a data structure defined by Linux so we cannot change > > it. Also note that ulong is used since this is the standard in U-Boot > > (>6k uses), despite there being quite a bit of the more verbose uintptr_t > > (930 uses). > > > > Signed-off-by: Simon Glass > > --- > > > > Changes in v2: > > - Update commit message to mention why the data structure is like it is > > - Update commit message to mention why ulong is used > > > > arch/x86/cpu/efi/payload.c | 13 +++++++++++-- > > arch/x86/include/asm/efi.h | 7 +++++++ > > arch/x86/lib/Makefile | 1 + > > arch/x86/lib/bdinfo.c | 22 ++++++++++++++++++++++ > > 4 files changed, 41 insertions(+), 2 deletions(-) > > create mode 100644 arch/x86/lib/bdinfo.c > > > > diff --git a/arch/x86/cpu/efi/payload.c b/arch/x86/cpu/efi/payload.c > > index 9a73b768e9b..3a9f7d72868 100644 > > --- a/arch/x86/cpu/efi/payload.c > > +++ b/arch/x86/cpu/efi/payload.c > > @@ -280,15 +280,24 @@ void setup_efi_info(struct efi_info *efi_info) > > } > > efi_info->efi_memdesc_size = map->desc_size; > > efi_info->efi_memdesc_version = map->version; > > - efi_info->efi_memmap = (u32)(map->desc); > > + efi_info->efi_memmap = (ulong)(map->desc); > > efi_info->efi_memmap_size = size - sizeof(struct efi_entry_memmap); > > > > #ifdef CONFIG_EFI_STUB_64BIT > > efi_info->efi_systab_hi = table->sys_table >> 32; > > - efi_info->efi_memmap_hi = (u64)(u32)(map->desc) >> 32; > > + efi_info->efi_memmap_hi = (u64)(ulong)map->desc >> 32; > > signature = EFI64_LOADER_SIGNATURE; > > #else > > signature = EFI32_LOADER_SIGNATURE; > > #endif > > memcpy(&efi_info->efi_loader_signature, signature, 4); > > } > > + > > +void efi_show_bdinfo(void) > > +{ > > + struct efi_entry_systable *table = NULL; > > + int size, ret; > > + > > + ret = efi_info_get(EFIET_SYS_TABLE, (void **)&table, &size); > > + bdinfo_print_num_l("efi_table", (ulong)table); > > Some properties of the UEFI API depend on the UEFI API version > (EFI_SYSTEM_TABLE.FirmwareRevision) OK I will add a patch. > > The revision of the EFI_FILE_PROTOCOL may also be relevant for U-Boot. > > Maybe you want to add this information in a later patch. This is tricky because the protocol version is no-longer available once the payload has loaded. [..] Regards, Simon