From patchwork Thu Nov 10 09:19:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 623328 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp1278pvb; Thu, 10 Nov 2022 01:20:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf5cdzhWGsdmH6eGpWMfwSlAnW7ARyyszUZWklTwBhXf+hsfkij22hw9HrYzE6wCRgSaNBh3 X-Received: by 2002:a17:906:f159:b0:7ae:40b7:7fbe with SMTP id gw25-20020a170906f15900b007ae40b77fbemr2167083ejb.371.1668072018593; Thu, 10 Nov 2022 01:20:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668072018; cv=none; d=google.com; s=arc-20160816; b=JMEqsC3CPiUFwHswHU34lAdM4bVdTJSzAamfMG7WiOgUh41OjZb8w/3/F9hpG8FS/a 4FpNmD18RQBMgiJZEQiioO553K195kBj174TCixyYXYk0TPVSBnWJMmQYGA3fZ7IVEoC KY3N6KLorBJW5ZhqQ8R77ZGY4tLk+FI9fCf0kVw/jWo+6wQgT+Gecy2rSRcyYrcWCVXn CcR6oh5V/wDTwradbGXc1ogLu3X0hyaL9vssyj2WV5/kr57YaGdNIqeSK8wPc8zpXSC0 9950Tgtg01oF3btudvc5m8p29W8v0FrcHsdrBBMd3HaovOm5FsyvjrR59tdpzdLgRj2O cnbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=BWkidr7+6TvgHUrJ2dbE3u02WwI/deqUvuojxMR4zmU=; b=Ln87R00BFxEk5DrRHLSslGHNV0dPie32iUwY76pE9du8iyITyggmrDK0ZPfSkIFfDP 9ZVjEOZ1J4z92Sdipl31IPZDOHu+d5uwYSE3DwtUMCPnd4xrrLNugALzw+Km1oI8FOs7 hEZO8ASUABt4GpJ7SGjtUFuhYaRVpLjAhiDAh1iJ0jkrtNR+H6VxbzqLu0agUk8n3SML h/JC0GT4qaiV0xgqXq27IqAYvvBZUY+ejfDxIaQMqUb2SFZ6tNuXv/8HfN6WxA8vhZjJ PKTJvA3aNrqpe6eMT2/e5J6VrFn9QbVZc7dV5GVDNA/oIWZu0njnpcxj3ifCQIG9FErw Lmzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id ov4-20020a170906fc0400b0078de51e658esi13873577ejb.208.2022.11.10.01.20.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 01:20:18 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 878D5850B9; Thu, 10 Nov 2022 10:19:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id DF59F85104; Thu, 10 Nov 2022 10:19:53 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id B64F585104 for ; Thu, 10 Nov 2022 10:19:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2AF8623A; Thu, 10 Nov 2022 01:19:56 -0800 (PST) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.16.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 43BDF3F534; Thu, 10 Nov 2022 01:19:48 -0800 (PST) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Peter Robinson , Kever Yang , Tom Rini , Sughosh Ganu Subject: [PATCH v5 1/3] rockchip: capsule: Add functions for supporting capsule updates Date: Thu, 10 Nov 2022 14:49:15 +0530 Message-Id: <20221110091917.3966430-2-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221110091917.3966430-1-sughosh.ganu@linaro.org> References: <20221110091917.3966430-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 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 Add functions needed to support the UEFI capsule update feature on rockchip boards. Currently, the feature is being enabled on the RockPi4 boards with firmware images residing on GPT partitioned storage media. Signed-off-by: Sughosh Ganu Reviewed-by: Kever Yang --- Changes since V4: * Get the pointer to struct efi_fw_image through struct efi_capsule_update_info arch/arm/mach-rockchip/Kconfig | 1 + arch/arm/mach-rockchip/board.c | 153 +++++++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+) diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index 69d51ff378..4898260017 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -246,6 +246,7 @@ config ROCKCHIP_RK3399 select DM_PMIC select DM_REGULATOR_FIXED select BOARD_LATE_INIT + imply PARTITION_TYPE_GUID imply PRE_CONSOLE_BUFFER imply ROCKCHIP_COMMON_BOARD imply ROCKCHIP_SDRAM_COMMON diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c index cbe00d646c..6e05a8f76e 100644 --- a/arch/arm/mach-rockchip/board.c +++ b/arch/arm/mach-rockchip/board.c @@ -6,11 +6,15 @@ #include #include #include +#include #include #include #include +#include +#include #include #include +#include #include #include #include @@ -22,8 +26,157 @@ DECLARE_GLOBAL_DATA_PTR; +#if defined(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) && defined(CONFIG_EFI_PARTITION) + +#define DFU_ALT_BUF_LEN SZ_1K + +static struct efi_fw_image *fw_images; + +static bool updatable_image(struct disk_partition *info) +{ + int i; + bool ret = false; + efi_guid_t image_type_guid; + + uuid_str_to_bin(info->type_guid, image_type_guid.b, + UUID_STR_FORMAT_GUID); + + for (i = 0; i < num_image_type_guids; i++) { + if (!guidcmp(&fw_images[i].image_type_id, &image_type_guid)) { + ret = true; + break; + } + } + + return ret; +} + +static void set_image_index(struct disk_partition *info, int index) +{ + int i; + efi_guid_t image_type_guid; + + uuid_str_to_bin(info->type_guid, image_type_guid.b, + UUID_STR_FORMAT_GUID); + + for (i = 0; i < num_image_type_guids; i++) { + if (!guidcmp(&fw_images[i].image_type_id, &image_type_guid)) { + fw_images[i].image_index = index; + break; + } + } +} + +static int get_mmc_desc(struct blk_desc **desc) +{ + int ret; + struct mmc *mmc; + struct udevice *dev; + + /* + * For now the firmware images are assumed to + * be on the SD card + */ + ret = uclass_get_device(UCLASS_MMC, 1, &dev); + if (ret) + return -1; + + mmc = mmc_get_mmc_dev(dev); + if (!mmc) + return -ENODEV; + + if ((ret = mmc_init(mmc))) + return ret; + + *desc = mmc_get_blk_desc(mmc); + if (!*desc) + return -1; + + return 0; +} + +void set_dfu_alt_info(char *interface, char *devstr) +{ + const char *name; + bool first = true; + int p, len, devnum, ret; + char buf[DFU_ALT_BUF_LEN]; + struct disk_partition info; + struct blk_desc *desc = NULL; + + ret = get_mmc_desc(&desc); + if (ret) { + log_err("Unable to get mmc desc\n"); + return; + } + + memset(buf, 0, sizeof(buf)); + name = blk_get_uclass_name(desc->uclass_id); + devnum = desc->devnum; + len = strlen(buf); + + len += snprintf(buf + len, DFU_ALT_BUF_LEN - len, + "%s %d=", name, devnum); + + for (p = 1; p <= MAX_SEARCH_PARTITIONS; p++) { + if (part_get_info(desc, p, &info)) + continue; + + /* Add entry to dfu_alt_info only for updatable images */ + if (updatable_image(&info)) { + if (!first) + len += snprintf(buf + len, + DFU_ALT_BUF_LEN - len, ";"); + + len += snprintf(buf + len, DFU_ALT_BUF_LEN - len, + "%s%d_%s part %d %d", + name, devnum, info.name, devnum, p); + first = false; + } + } + + log_debug("dfu_alt_info => %s\n", buf); + env_set("dfu_alt_info", buf); +} + +static void gpt_capsule_update_setup(void) +{ + int p, i, ret; + struct disk_partition info; + struct blk_desc *desc = NULL; + + fw_images = update_info.images; + rockchip_capsule_update_board_setup(); + + ret = get_mmc_desc(&desc); + if (ret) { + log_err("Unable to get mmc desc\n"); + return; + } + + for (p = 1, i = 1; p <= MAX_SEARCH_PARTITIONS; p++) { + if (part_get_info(desc, p, &info)) + continue; + + /* + * Since we have a GPT partitioned device, the updatable + * images could be stored in any order. Populate the + * image_index at runtime. + */ + if (updatable_image(&info)) { + set_image_index(&info, i); + i++; + } + } +} +#endif /* CONFIG_EFI_HAVE_CAPSULE_SUPPORT && CONFIG_EFI_PARTITION */ + __weak int rk_board_late_init(void) { +#if defined(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) && defined(CONFIG_EFI_PARTITION) + gpt_capsule_update_setup(); +#endif + return 0; } From patchwork Thu Nov 10 09:19:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 623329 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp1360pvb; Thu, 10 Nov 2022 01:20:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf5ekbFs3HnPh7Ijr3m0tCBGDOIOOFoTRKESQuODvvdfZRsI3AoGiPoe5XYdl664gvaswDlA X-Received: by 2002:a17:906:2317:b0:7ae:6cdb:870 with SMTP id l23-20020a170906231700b007ae6cdb0870mr14658494eja.338.1668072031391; Thu, 10 Nov 2022 01:20:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668072031; cv=none; d=google.com; s=arc-20160816; b=H01v5Su7xhA2g21AjSiO/G1h1N7Q48hA5DA11nRpghPmd9lmHduVhFQBVBcObhaIIo r70fmwmdjQV2nN0rrGr67r1pYENWTarC5rv/JgQvjKDnTxIhmZsOV7F76reB+OTpLaDI sXXvljKD6ke3+QwL7VSkcsnHO1XYC1mkmlTJOuKvin79JD85cmjbLQVodkF1ojvEXXG8 nGm7LkD+IcryE/nTluqhqFIUyiPKAHGGXihklcJb9DelXCq2JOmE4PcxJ85cSCaxEayB alBxRNZXPu51hx51Y/jiBjXhckoqrlq+0ojIrQYafgQFWFw/Vzu7a/aR9+JAVao82ExD sKrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=LAjueBtA/EYWfbt4FIJiCA++i3UKwpzbdPaa1qZAfTk=; b=Fket+ka7N5peDDxNEYZz9wJoXtFBCVoME377pSIxH9IZA7AzEcclPPif8fY/p+lJtt bjR/+rBjhJKdyP6d+YKtwCKTBLtiydaTSKLskO3LTKoVGBB22u+9yVhAlKnjZibD2nl3 bUc6lSd+CAgf0PJctAxVm2qsPgv8JqhZJGrd+vrP7TMjEZYWiKkHnNOMPjzBgPvakDfh Oe8f8nNQqrVLrpXNBc3etmbdD61I54Wbw6aaEo3gYShgGNWCF2u/xuW5TLC1hMgi7gfv Emn9JCynyo9/jHJXYl67HxEYt/TxoRZEf6Fx+XFw19gipISuBSvT+VbCnoiGUA3v+0Uh Xjzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id go13-20020a1709070d8d00b007ae6076db43si19480775ejc.312.2022.11.10.01.20.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 01:20:31 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 879D985117; Thu, 10 Nov 2022 10:20:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 656AD85115; Thu, 10 Nov 2022 10:19:56 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id F306484D70 for ; Thu, 10 Nov 2022 10:19:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5C6D21FB; Thu, 10 Nov 2022 01:19:58 -0800 (PST) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.16.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 748C83F534; Thu, 10 Nov 2022 01:19:50 -0800 (PST) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Peter Robinson , Kever Yang , Tom Rini , Sughosh Ganu Subject: [PATCH v5 2/3] rockpi4: board: Add firmware image information for capsule updates Date: Thu, 10 Nov 2022 14:49:16 +0530 Message-Id: <20221110091917.3966430-3-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221110091917.3966430-1-sughosh.ganu@linaro.org> References: <20221110091917.3966430-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 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 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 V5: * Mark fw_images array as a static variable * Populate num_image_type_guids through ROCKPI4_UPDATABLE_IMAGES 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..f56b379b93 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) +static struct efi_fw_image fw_images[ROCKPI4_UPDATABLE_IMAGES] = {0}; + +struct efi_capsule_update_info update_info = { + .images = fw_images, +}; + +u8 num_image_type_guids = ROCKPI4_UPDATABLE_IMAGES; +#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 \ From patchwork Thu Nov 10 09:19:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 623330 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp1429pvb; Thu, 10 Nov 2022 01:20:43 -0800 (PST) X-Google-Smtp-Source: AMsMyM7MUE0sunPuvrFj+9i2ngE0iuENY4ic5oo2J6lONJrgrpT0seaZ+acNbMMUqi16K6Ebdle/ X-Received: by 2002:a17:906:11d6:b0:7ad:fd3e:2a01 with SMTP id o22-20020a17090611d600b007adfd3e2a01mr39788288eja.545.1668072043672; Thu, 10 Nov 2022 01:20:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668072043; cv=none; d=google.com; s=arc-20160816; b=J6WL4BCHnMg92LQP9Xj+vcz3qT/qawshogBQ1tfa48KZ/KykS9vhj8kpqmNuHZEdtD yericN9DUy6ZbWSHQzts1Iz6IFMs+9eQVsdXrhLiUY1V2t4JfThKKVqcmULoqJsFaZsa q0jicv4DIqEHCr4LBVULgOhtB4doryjVvzrY6/YFQBsvl2Y9K6n0ADSTBlSW+ZYi06Ti s+f+7WNgBEKSx1um1iSetKLxwqrVmCfaS3014daIHQVEKD2RFbFe+dz47GrINiMN/vK8 8hmHUJ9EdFbxMy1mBU9897j42EFmgqtguEs5JTshkU/khHGm0eqxX2M5b/Um5sZVksaQ h6qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=vuaXru6mbKqBGZxhN/4UHarmJ3kAJC3b8M9Wy1AVVbM=; b=ZUQUVnrLyHoLl77Owb4ULc7U4zWc7TyTFQxftZOba3xVlblF6tDQhSNqC8NJqqmdQE VareiyLC6ZqXlpmjsn4UrguLbBM//fcfjJOJzd2b5zBQ+Rb21BcgRMufOqer9WlcPMMx aMp05GEa7X/HrGMneed5AzZVfNdkCVteeYTQ8NaYwvD6h1Qm1ehgKnPNEx81nElCDb+s aNCMek72P0MlB5RaUYPDzmaXsRTgLZQqhNgzlMaPbxdU8YgTFMh9XtFIbfyCCGYPholr LWeXRwLSEPxTUocRuvYeelis3dNO/sI4OamSKCJLsi77T3yQbdW+bmKz0WqukUBIMCAI TWHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id m20-20020a056402431400b00463c5d64f30si6200127edc.557.2022.11.10.01.20.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 01:20:43 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 257508511C; Thu, 10 Nov 2022 10:20:20 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id C7B7B850DB; Thu, 10 Nov 2022 10:19:57 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id DB17985104 for ; Thu, 10 Nov 2022 10:19:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8EEBBD6E; Thu, 10 Nov 2022 01:20:00 -0800 (PST) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.16.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A64DE3F534; Thu, 10 Nov 2022 01:19:52 -0800 (PST) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Peter Robinson , Kever Yang , Tom Rini , Sughosh Ganu Subject: [PATCH v5 3/3] rockpi4: capsule: Enable UEFI capsule update on RockPi4 boards Date: Thu, 10 Nov 2022 14:49:17 +0530 Message-Id: <20221110091917.3966430-4-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221110091917.3966430-1-sughosh.ganu@linaro.org> References: <20221110091917.3966430-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 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 Enable the UEFI capsule update functionality on the RockPi4B and RockPi4C boards. Support is being enabled for updating the idbloader and u-boot firmware images residing on GPT partitioned uSD card storage device. Signed-off-by: Sughosh Ganu Reviewed-by: Kever Yang --- Changes since V5: None configs/rock-pi-4-rk3399_defconfig | 8 ++++++++ configs/rock-pi-4c-rk3399_defconfig | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/configs/rock-pi-4-rk3399_defconfig b/configs/rock-pi-4-rk3399_defconfig index 83721cedf3..b46f3f8c76 100644 --- a/configs/rock-pi-4-rk3399_defconfig +++ b/configs/rock-pi-4-rk3399_defconfig @@ -30,6 +30,7 @@ CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 CONFIG_TPL=y CONFIG_CMD_BOOTZ=y +CONFIG_CMD_DFU=y CONFIG_CMD_GPT=y CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y @@ -40,6 +41,7 @@ CONFIG_SPL_OF_CONTROL=y CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_DFU_MMC=y CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y CONFIG_MISC=y @@ -84,3 +86,9 @@ CONFIG_VIDEO_ROCKCHIP=y CONFIG_DISPLAY_ROCKCHIP_HDMI=y CONFIG_SPL_TINY_MEMSET=y CONFIG_ERRNO_STR=y +CONFIG_CMD_NVEDIT_EFI=y +CONFIG_CMD_EFIDEBUG=y +CONFIG_TOOLS_MKEFICAPSULE=y +CONFIG_HEXDUMP=y +CONFIG_EFI_CAPSULE_ON_DISK=y +CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y diff --git a/configs/rock-pi-4c-rk3399_defconfig b/configs/rock-pi-4c-rk3399_defconfig index ac9a3f9830..7075286a21 100644 --- a/configs/rock-pi-4c-rk3399_defconfig +++ b/configs/rock-pi-4c-rk3399_defconfig @@ -30,6 +30,7 @@ CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 CONFIG_TPL=y CONFIG_CMD_BOOTZ=y +CONFIG_CMD_DFU=y CONFIG_CMD_GPT=y CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y @@ -40,6 +41,7 @@ CONFIG_SPL_OF_CONTROL=y CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_DFU_MMC=y CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y CONFIG_MISC=y @@ -84,3 +86,9 @@ CONFIG_VIDEO_ROCKCHIP=y CONFIG_DISPLAY_ROCKCHIP_HDMI=y CONFIG_SPL_TINY_MEMSET=y CONFIG_ERRNO_STR=y +CONFIG_CMD_NVEDIT_EFI=y +CONFIG_CMD_EFIDEBUG=y +CONFIG_TOOLS_MKEFICAPSULE=y +CONFIG_HEXDUMP=y +CONFIG_EFI_CAPSULE_ON_DISK=y +CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y