summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorKaustabh Chakraborty <[email protected]>2026-02-24 21:07:10 +0530
committerMinkyu Kang <[email protected]>2026-02-25 10:47:03 +0900
commit0e61fc5364dc6b4af88b44ea2e1aa9d84c9f1ca7 (patch)
tree5f606be1f550db286a650c3a5edf27421ce8e349 /board
parentdb0fe21bd38f27f570ce16670ccad567efd596f4 (diff)
board: samsung: exynos-mobile: add EFI capsule update support
Add support for EFI capsule updates via U-Boot's DFU. This flashes the boot partition with the new image provided in the capsule. Signed-off-by: Kaustabh Chakraborty <[email protected]> Signed-off-by: Minkyu Kang <[email protected]>
Diffstat (limited to 'board')
-rw-r--r--board/samsung/exynos-mobile/exynos-mobile.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/board/samsung/exynos-mobile/exynos-mobile.c b/board/samsung/exynos-mobile/exynos-mobile.c
index c5e1b186ae3..6b2b1523663 100644
--- a/board/samsung/exynos-mobile/exynos-mobile.c
+++ b/board/samsung/exynos-mobile/exynos-mobile.c
@@ -10,6 +10,8 @@
#include <bootflow.h>
#include <ctype.h>
#include <dm/ofnode.h>
+#include <efi.h>
+#include <efi_loader.h>
#include <env.h>
#include <errno.h>
#include <init.h>
@@ -24,6 +26,19 @@ DECLARE_GLOBAL_DATA_PTR;
#define lmb_alloc(size, addr) \
lmb_alloc_mem(LMB_MEM_ALLOC_ANY, SZ_2M, addr, size, LMB_NONE)
+struct efi_fw_image fw_images[] = {
+ {
+ .fw_name = u"UBOOT_BOOT_PARTITION",
+ .image_index = 1,
+ },
+};
+
+struct efi_capsule_update_info update_info = {
+ .dfu_string = NULL,
+ .images = fw_images,
+ .num_images = ARRAY_SIZE(fw_images),
+};
+
/*
* The memory mapping includes all DRAM banks, along with the
* peripheral block, and a sentinel at the end. This is filled in
@@ -191,6 +206,7 @@ static int exynos_blk_env_setup(void)
struct blk_desc *blk_desc;
struct disk_partition info = {0};
unsigned long largest_part_start = 0, largest_part_size = 0;
+ static char dfu_string[32];
int i;
blk_ifname = "mmc";
@@ -204,6 +220,14 @@ static int exynos_blk_env_setup(void)
if (part_get_info(blk_desc, i, &info))
continue;
+ if (!update_info.dfu_string &&
+ !strncasecmp(info.name, "boot", strlen("boot"))) {
+ snprintf(dfu_string, sizeof(dfu_string),
+ "mmc %d=u-boot.bin part %d %d", blk_dev,
+ blk_dev, i);
+ update_info.dfu_string = dfu_string;
+ }
+
if (info.start > largest_part_size) {
largest_part_start = info.start;
largest_part_size = info.size;