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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5AE75C4332F for ; Wed, 9 Nov 2022 05:22:46 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 94B4E84ED3; Wed, 9 Nov 2022 06:22:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="GN/3Z8MD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 68C5784EEF; Wed, 9 Nov 2022 06:22:41 +0100 (CET) Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) (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 341AB84E7F for ; Wed, 9 Nov 2022 06:22:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pf1-x433.google.com with SMTP id b29so15684477pfp.13 for ; Tue, 08 Nov 2022 21:22:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=KOYsr+I5jtQJnCBfR3KGji7Or34KJAgs6WuHQYWYx+I=; b=GN/3Z8MDeLv3Jgvu6e6dTOm04fBTxDOqcYZC30lmMrg7iF21ZrEPnY1eBkr1sxoanN WMF3RGjX600eOsfw8M+pRH10FLmJmMn1AVGIhwrfL8QRw7JnjvJU3Jyz1GI2Ey0JxSKb NsWnIFupSBER2whOqC3jq2OG7wdwnRqI3WkbwInJhIXbS3QkpU/G+cEVYpQk01dwPWZf IUWFcvIekqDluoPksNn0wYvdw5ryAtJ4FKQIHxagCmIJn9fOFGejqTv+N7G9z83D5hhl 5aXClS7vlAeKPV2xOT0BeP5rjGTCX9UJOu3w4hkfRCFfzKAfeyQVOOFkCjKDaRBlu+5S 2n5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KOYsr+I5jtQJnCBfR3KGji7Or34KJAgs6WuHQYWYx+I=; b=ksY8Lxe7VIAR6lonu/fbLTF5cW+HmRh7Jg9+dyiTUYJe0AvWRXX5qpZAVEj/APhttB 6lmrfl64+Tv3Ayl5TO4ad1aOnmYbeqaM0pt8xlYAJCwlCtx/5WL6YeGMA1KUTKjTIGHJ 54m+2Mzg3U7+o75YRQhXQ85aLyDr5BtBP7Plbv59NRk5b7yu+XVMexR2/fzluflHp0+5 8lLowtf2qUeAlt+JIeJpB+t4w9U9AoHXNsImk/oZ4OSbOpumtfr1x4L2UQ7lIHPi7zWg hNcXEDUkbdSaEeQhBmeTNRV1UrPj/u3Jv8D3Ll8Ik+lGU9BUExbKA9CdyKtoxKExyeqo 2+jw== X-Gm-Message-State: ACrzQf0RdtBmCQwi/G7eCKh7Y4JBD83fJBjx/u2oEawD1+Y6NaGg8oJF 8Lf7ZciRfDRNMWnjaE0iUuJNQQ== X-Google-Smtp-Source: AMsMyM5PCQ7LzTgA15PmutN4sEzDRK7MmT21Br6tXfVn4Ok04wH56O4e9k1WPm/IRdWyYNoi6vof+g== X-Received: by 2002:a63:e007:0:b0:46f:d715:3704 with SMTP id e7-20020a63e007000000b0046fd7153704mr39161477pgh.108.1667971356337; Tue, 08 Nov 2022 21:22:36 -0800 (PST) Received: from laputa ([2400:4050:c3e1:100:5593:2c95:b1cb:5570]) by smtp.gmail.com with ESMTPSA id m20-20020a635814000000b0046ff7db0984sm6669077pgb.72.2022.11.08.21.22.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 21:22:35 -0800 (PST) Date: Wed, 9 Nov 2022 14:22:31 +0900 From: AKASHI Takahiro To: Sughosh Ganu Cc: u-boot@lists.denx.de, Peter Robinson , Kever Yang , Tom Rini Subject: Re: [PATCH v4 2/3] rockpi4: board: Add firmware image information for capsule updates Message-ID: <20221109052231.GA24253@laputa> Mail-Followup-To: AKASHI Takahiro , Sughosh Ganu , u-boot@lists.denx.de, Peter Robinson , Kever Yang , Tom Rini References: <20221108072328.3650871-1-sughosh.ganu@linaro.org> <20221108072328.3650871-3-sughosh.ganu@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221108072328.3650871-3-sughosh.ganu@linaro.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean On Tue, Nov 08, 2022 at 12:53:27PM +0530, Sughosh Ganu wrote: > Add information that will be needed for enabling the UEFI capsule > update feature on the RockPi4 boards. With the feature enabled, it > would be possible to update the idbloader and u-boot.itb images on the > RockPi4B and RockPi4C variants. > > Signed-off-by: Sughosh Ganu > Reviewed-by: Kever Yang > --- > Changes since V3: None > > arch/arm/include/asm/arch-rockchip/misc.h | 1 + > board/rockchip/evb_rk3399/evb-rk3399.c | 55 ++++++++++++++++++++++- > include/configs/rk3399_common.h | 16 +++++++ > 3 files changed, 71 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/include/asm/arch-rockchip/misc.h b/arch/arm/include/asm/arch-rockchip/misc.h > index b6b03c934e..4155af8c3b 100644 > --- a/arch/arm/include/asm/arch-rockchip/misc.h > +++ b/arch/arm/include/asm/arch-rockchip/misc.h > @@ -11,3 +11,4 @@ int rockchip_cpuid_from_efuse(const u32 cpuid_offset, > u8 *cpuid); > int rockchip_cpuid_set(const u8 *cpuid, const u32 cpuid_length); > int rockchip_setup_macaddr(void); > +void rockchip_capsule_update_board_setup(void); > diff --git a/board/rockchip/evb_rk3399/evb-rk3399.c b/board/rockchip/evb_rk3399/evb-rk3399.c > index abb76585cf..769d374f86 100644 > --- a/board/rockchip/evb_rk3399/evb-rk3399.c > +++ b/board/rockchip/evb_rk3399/evb-rk3399.c > @@ -5,11 +5,25 @@ > > #include > #include > +#include > #include > #include > #include > +#include > #include > > +#define ROCKPI4_UPDATABLE_IMAGES 2 > + > +#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) > +struct efi_fw_image fw_images[ROCKPI4_UPDATABLE_IMAGES] = {0}; You don't have to expose this array as you can use update_info in your patch#1. > +struct efi_capsule_update_info update_info = { > + .images = fw_images, > +}; > + > +u8 num_image_type_guids = ARRAY_SIZE(fw_images); -> ROCKPI4_UPDATABLE_IMAGES I think we should put this variable in 'efi_capsule_update_info' so that we should expose 'update_info' only. -Takahiro Akashi > +#endif > + > #ifndef CONFIG_SPL_BUILD > int board_early_init_f(void) > { > @@ -29,4 +43,43 @@ int board_early_init_f(void) > out: > return 0; > } > -#endif > + > +#if defined(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) && defined(CONFIG_EFI_PARTITION) > +static bool board_is_rockpi_4b(void) > +{ > + return CONFIG_IS_ENABLED(TARGET_EVB_RK3399) && > + of_machine_is_compatible("radxa,rockpi4b"); > +} > + > +static bool board_is_rockpi_4c(void) > +{ > + return CONFIG_IS_ENABLED(TARGET_EVB_RK3399) && > + of_machine_is_compatible("radxa,rockpi4c"); > +} > + > +void rockchip_capsule_update_board_setup(void) > +{ > + if (board_is_rockpi_4b()) { > + efi_guid_t idbldr_image_type_guid = > + ROCKPI_4B_IDBLOADER_IMAGE_GUID; > + efi_guid_t uboot_image_type_guid = ROCKPI_4B_UBOOT_IMAGE_GUID; > + > + guidcpy(&fw_images[0].image_type_id, &idbldr_image_type_guid); > + guidcpy(&fw_images[1].image_type_id, &uboot_image_type_guid); > + > + fw_images[0].fw_name = u"ROCKPI4B-IDBLOADER"; > + fw_images[1].fw_name = u"ROCKPI4B-UBOOT"; > + } else if (board_is_rockpi_4c()) { > + efi_guid_t idbldr_image_type_guid = > + ROCKPI_4C_IDBLOADER_IMAGE_GUID; > + efi_guid_t uboot_image_type_guid = ROCKPI_4C_UBOOT_IMAGE_GUID; > + > + guidcpy(&fw_images[0].image_type_id, &idbldr_image_type_guid); > + guidcpy(&fw_images[1].image_type_id, &uboot_image_type_guid); > + > + fw_images[0].fw_name = u"ROCKPI4C-IDBLOADER"; > + fw_images[1].fw_name = u"ROCKPI4C-UBOOT"; > + } > +} > +#endif /* CONFIG_EFI_HAVE_CAPSULE_SUPPORT && CONFIG_EFI_PARTITION */ > +#endif /* !CONFIG_SPL_BUILD */ > diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h > index 2f9aee5819..f0a9ab8f83 100644 > --- a/include/configs/rk3399_common.h > +++ b/include/configs/rk3399_common.h > @@ -24,6 +24,22 @@ > #define CONFIG_SYS_SDRAM_BASE 0 > #define SDRAM_MAX_SIZE 0xf8000000 > > +#define ROCKPI_4B_IDBLOADER_IMAGE_GUID \ > + EFI_GUID(0x02f4d760, 0xcfd5, 0x43bd, 0x8e, 0x2d, \ > + 0xa4, 0x2a, 0xcb, 0x33, 0xc6, 0x60) > + > +#define ROCKPI_4B_UBOOT_IMAGE_GUID \ > + EFI_GUID(0x4ce292da, 0x1dd8, 0x428d, 0xa1, 0xc2, \ > + 0x77, 0x74, 0x3e, 0xf8, 0xb9, 0x6e) > + > +#define ROCKPI_4C_IDBLOADER_IMAGE_GUID \ > + EFI_GUID(0xfd68510c, 0x12d3, 0x4f0a, 0xb8, 0xd3, \ > + 0xd8, 0x79, 0xe1, 0xd3, 0xa5, 0x40) > + > +#define ROCKPI_4C_UBOOT_IMAGE_GUID \ > + EFI_GUID(0xb81fb4ae, 0xe4f3, 0x471b, 0x99, 0xb4, \ > + 0x0b, 0x3d, 0xa5, 0x49, 0xce, 0x13) > + > #ifndef CONFIG_SPL_BUILD > > #define ENV_MEM_LAYOUT_SETTINGS \ > -- > 2.34.1 >