Skip to content

Commit 9859465

Browse files
committed
Merge tag 'efi-2022-07-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2022-07-rc1-2 Documentation: * Describe env command UEFI * simplify Unicode string functions * clean up the usage of GUIDs for capsule updates
2 parents 7f418ea + 8bf5f9a commit 9859465

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1188
-279
lines changed

board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
#include <common.h>
88
#include <dwc3-uboot.h>
9+
#include <efi.h>
10+
#include <efi_loader.h>
911
#include <errno.h>
1012
#include <miiphy.h>
1113
#include <netdev.h>
@@ -21,6 +23,7 @@
2123
#include <asm/arch/clock.h>
2224
#include <asm/mach-imx/dma.h>
2325
#include <linux/delay.h>
26+
#include <linux/kernel.h>
2427
#include <power/pmic.h>
2528

2629
DECLARE_GLOBAL_DATA_PTR;
@@ -44,6 +47,32 @@ static void setup_gpmi_nand(void)
4447
}
4548
#endif
4649

50+
#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
51+
struct efi_fw_image fw_images[] = {
52+
#if defined(CONFIG_TARGET_IMX8MP_RSB3720A1_4G)
53+
{
54+
.image_type_id = IMX8MP_RSB3720A1_4G_FIT_IMAGE_GUID,
55+
.fw_name = u"IMX8MP-RSB3720-FIT",
56+
.image_index = 1,
57+
},
58+
#elif defined(CONFIG_TARGET_IMX8MP_RSB3720A1_6G)
59+
{
60+
.image_type_id = IMX8MP_RSB3720A1_6G_FIT_IMAGE_GUID,
61+
.fw_name = u"IMX8MP-RSB3720-FIT",
62+
.image_index = 1,
63+
},
64+
#endif
65+
};
66+
67+
struct efi_capsule_update_info update_info = {
68+
.dfu_string = "mmc 2=flash-bin raw 0 0x1B00 mmcpart 1",
69+
.images = fw_images,
70+
};
71+
72+
u8 num_image_type_guids = ARRAY_SIZE(fw_images);
73+
#endif /* EFI_HAVE_CAPSULE_SUPPORT */
74+
75+
4776
int board_early_init_f(void)
4877
{
4978
struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR;

board/compulab/imx8mm-cl-iot-gate/imx8mm-cl-iot-gate.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66

77
#include <common.h>
8+
#include <efi.h>
9+
#include <efi_loader.h>
810
#include <env.h>
911
#include <extension_board.h>
1012
#include <hang.h>
@@ -23,11 +25,37 @@
2325
#include <asm/mach-imx/gpio.h>
2426
#include <asm/mach-imx/mxc_i2c.h>
2527
#include <asm/sections.h>
28+
#include <linux/kernel.h>
2629

2730
#include "ddr/ddr.h"
2831

2932
DECLARE_GLOBAL_DATA_PTR;
3033

34+
#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
35+
struct efi_fw_image fw_images[] = {
36+
#if defined(CONFIG_TARGET_IMX8MM_CL_IOT_GATE)
37+
{
38+
.image_type_id = IMX8MM_CL_IOT_GATE_FIT_IMAGE_GUID,
39+
.fw_name = u"IMX8MM-CL-IOT-GATE-FIT",
40+
.image_index = 1,
41+
},
42+
#elif defined(CONFIG_TARGET_IMX8MM_CL_IOT_GATE_OPTEE)
43+
{
44+
.image_type_id = IMX8MM_CL_IOT_GATE_OPTEE_FIT_IMAGE_GUID,
45+
.fw_name = u"IMX8MM-CL-IOT-GATE-FIT",
46+
.image_index = 1,
47+
},
48+
#endif
49+
};
50+
51+
struct efi_capsule_update_info update_info = {
52+
.dfu_string = "mmc 2=flash-bin raw 0x42 0x1D00 mmcpart 1",
53+
.images = fw_images,
54+
};
55+
56+
u8 num_image_type_guids = ARRAY_SIZE(fw_images);
57+
#endif /* EFI_HAVE_CAPSULE_SUPPORT */
58+
3159
int board_phys_sdram_size(phys_size_t *size)
3260
{
3361
struct lpddr4_tcm_desc *lpddr4_tcm_desc =

board/emulation/common/qemu_dfu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ void set_dfu_alt_info(char *interface, char *devstr)
4444

4545
ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN);
4646

47-
if (env_get("dfu_alt_info"))
47+
if (!CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) &&
48+
env_get("dfu_alt_info"))
4849
return;
4950

5051
memset(buf, 0, sizeof(buf));

board/emulation/qemu-arm/qemu-arm.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,43 @@
66
#include <common.h>
77
#include <cpu_func.h>
88
#include <dm.h>
9+
#include <efi.h>
10+
#include <efi_loader.h>
911
#include <fdtdec.h>
1012
#include <init.h>
1113
#include <log.h>
1214
#include <virtio_types.h>
1315
#include <virtio.h>
1416

17+
#include <linux/kernel.h>
18+
1519
#ifdef CONFIG_ARM64
1620
#include <asm/armv8/mmu.h>
1721

22+
#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
23+
struct efi_fw_image fw_images[] = {
24+
#if defined(CONFIG_TARGET_QEMU_ARM_32BIT)
25+
{
26+
.image_type_id = QEMU_ARM_UBOOT_IMAGE_GUID,
27+
.fw_name = u"Qemu-Arm-UBOOT",
28+
.image_index = 1,
29+
},
30+
#elif defined(CONFIG_TARGET_QEMU_ARM_64BIT)
31+
{
32+
.image_type_id = QEMU_ARM64_UBOOT_IMAGE_GUID,
33+
.fw_name = u"Qemu-Arm-UBOOT",
34+
.image_index = 1,
35+
},
36+
#endif
37+
};
38+
39+
struct efi_capsule_update_info update_info = {
40+
.images = fw_images,
41+
};
42+
43+
u8 num_image_type_guids = ARRAY_SIZE(fw_images);
44+
#endif /* EFI_HAVE_CAPSULE_SUPPORT */
45+
1846
static struct mm_region qemu_arm64_mem_map[] = {
1947
{
2048
/* Flash */

board/kontron/pitx_imx8m/pitx_imx8m.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include "pitx_misc.h"
44
#include <common.h>
5+
#include <efi.h>
6+
#include <efi_loader.h>
57
#include <init.h>
68
#include <mmc.h>
79
#include <miiphy.h>
@@ -12,7 +14,7 @@
1214
#include <asm/mach-imx/gpio.h>
1315
#include <asm/mach-imx/iomux-v3.h>
1416
#include <linux/delay.h>
15-
17+
#include <linux/kernel.h>
1618

1719
DECLARE_GLOBAL_DATA_PTR;
1820

@@ -30,6 +32,23 @@ static iomux_v3_cfg_t const uart_pads[] = {
3032
IMX8MQ_PAD_ECSPI1_MISO__UART3_CTS_B | MUX_PAD_CTRL(UART_PAD_CTRL),
3133
};
3234

35+
#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
36+
struct efi_fw_image fw_images[] = {
37+
{
38+
.image_type_id = KONTRON_PITX_IMX8M_FIT_IMAGE_GUID,
39+
.fw_name = u"KONTRON-PITX-IMX8M-UBOOT",
40+
.image_index = 1,
41+
},
42+
};
43+
44+
struct efi_capsule_update_info update_info = {
45+
.dfu_string = "mmc 0=flash-bin raw 0x42 0x1000 mmcpart 1",
46+
.images = fw_images,
47+
};
48+
49+
u8 num_image_type_guids = ARRAY_SIZE(fw_images);
50+
#endif /* EFI_HAVE_CAPSULE_SUPPORT */
51+
3352
int board_early_init_f(void)
3453
{
3554
struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR;

board/kontron/sl-mx8mm/sl-mx8mm.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,32 @@
66
#include <asm/arch/imx-regs.h>
77
#include <asm/global_data.h>
88
#include <asm/io.h>
9+
#include <efi.h>
10+
#include <efi_loader.h>
911
#include <fdt_support.h>
1012
#include <linux/errno.h>
13+
#include <linux/kernel.h>
1114
#include <net.h>
1215

1316
DECLARE_GLOBAL_DATA_PTR;
1417

18+
#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
19+
struct efi_fw_image fw_images[] = {
20+
{
21+
.image_type_id = KONTRON_SL_MX8MM_FIT_IMAGE_GUID,
22+
.fw_name = u"KONTROL-SL-MX8MM-UBOOT",
23+
.image_index = 1,
24+
},
25+
};
26+
27+
struct efi_capsule_update_info update_info = {
28+
.dfu_string = "sf 0:0=flash-bin raw 0x400 0x1f0000",
29+
.images = fw_images,
30+
};
31+
32+
u8 num_image_type_guids = ARRAY_SIZE(fw_images);
33+
#endif /* EFI_HAVE_CAPSULE_SUPPORT */
34+
1535
int board_phys_sdram_size(phys_size_t *size)
1636
{
1737
u32 ddr_size = readl(M4_BOOTROM_BASE_ADDR);

board/kontron/sl28/sl28.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
#include <common.h>
44
#include <dm.h>
55
#include <malloc.h>
6+
#include <efi.h>
7+
#include <efi_loader.h>
68
#include <errno.h>
79
#include <fsl_ddr.h>
810
#include <fdt_support.h>
911
#include <asm/global_data.h>
1012
#include <linux/libfdt.h>
13+
#include <linux/kernel.h>
1114
#include <env_internal.h>
1215
#include <asm/arch-fsl-layerscape/soc.h>
1316
#include <asm/arch-fsl-layerscape/fsl_icid.h>
@@ -23,6 +26,24 @@
2326

2427
DECLARE_GLOBAL_DATA_PTR;
2528

29+
#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
30+
struct efi_fw_image fw_images[] = {
31+
{
32+
.image_type_id = KONTRON_SL28_FIT_IMAGE_GUID,
33+
.fw_name = u"KONTRON-SL28-FIT",
34+
.image_index = 1,
35+
},
36+
};
37+
38+
struct efi_capsule_update_info update_info = {
39+
.dfu_string = "sf 0:0=u-boot-bin raw 0x210000 0x1d0000;"
40+
"u-boot-env raw 0x3e0000 0x20000",
41+
.images = fw_images,
42+
};
43+
44+
u8 num_image_type_guids = ARRAY_SIZE(fw_images);
45+
#endif /* EFI_HAVE_CAPSULE_SUPPORT */
46+
2647
int board_early_init_f(void)
2748
{
2849
fsl_lsch3_early_init_f();

board/sandbox/sandbox.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
#include <cpu_func.h>
88
#include <cros_ec.h>
99
#include <dm.h>
10+
#include <efi.h>
11+
#include <efi_loader.h>
1012
#include <env_internal.h>
1113
#include <init.h>
1214
#include <led.h>
1315
#include <os.h>
1416
#include <asm/global_data.h>
1517
#include <asm/test.h>
1618
#include <asm/u-boot-sandbox.h>
19+
#include <linux/kernel.h>
1720
#include <malloc.h>
1821

1922
#include <extension_board.h>
@@ -25,6 +28,37 @@
2528
*/
2629
gd_t *gd;
2730

31+
#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
32+
struct efi_fw_image fw_images[] = {
33+
#if defined(CONFIG_EFI_CAPSULE_FIRMWARE_RAW)
34+
{
35+
.image_type_id = SANDBOX_UBOOT_IMAGE_GUID,
36+
.fw_name = u"SANDBOX-UBOOT",
37+
.image_index = 1,
38+
},
39+
{
40+
.image_type_id = SANDBOX_UBOOT_ENV_IMAGE_GUID,
41+
.fw_name = u"SANDBOX-UBOOT-ENV",
42+
.image_index = 2,
43+
},
44+
#elif defined(CONFIG_EFI_CAPSULE_FIRMWARE_FIT)
45+
{
46+
.image_type_id = SANDBOX_FIT_IMAGE_GUID,
47+
.fw_name = u"SANDBOX-FIT",
48+
.image_index = 1,
49+
},
50+
#endif
51+
};
52+
53+
struct efi_capsule_update_info update_info = {
54+
.dfu_string = "sf 0:0=u-boot-bin raw 0x100000 0x50000;"
55+
"u-boot-env raw 0x150000 0x200000",
56+
.images = fw_images,
57+
};
58+
59+
u8 num_image_type_guids = ARRAY_SIZE(fw_images);
60+
#endif /* EFI_HAVE_CAPSULE_SUPPORT */
61+
2862
#if !CONFIG_IS_ENABLED(OF_PLATDATA)
2963
/*
3064
* Add a simple GPIO device (don't use with of-platdata as it interferes with

board/socionext/developerbox/developerbox.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,43 @@
1010
#include <asm/global_data.h>
1111
#include <asm/io.h>
1212
#include <common.h>
13+
#include <efi.h>
14+
#include <efi_loader.h>
1315
#include <env_internal.h>
1416
#include <fdt_support.h>
1517
#include <log.h>
1618

19+
#include <linux/kernel.h>
20+
21+
#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
22+
struct efi_fw_image fw_images[] = {
23+
{
24+
.image_type_id = DEVELOPERBOX_UBOOT_IMAGE_GUID,
25+
.fw_name = u"DEVELOPERBOX-UBOOT",
26+
.image_index = 1,
27+
},
28+
{
29+
.image_type_id = DEVELOPERBOX_FIP_IMAGE_GUID,
30+
.fw_name = u"DEVELOPERBOX-FIP",
31+
.image_index = 2,
32+
},
33+
{
34+
.image_type_id = DEVELOPERBOX_OPTEE_IMAGE_GUID,
35+
.fw_name = u"DEVELOPERBOX-OPTEE",
36+
.image_index = 3,
37+
},
38+
};
39+
40+
struct efi_capsule_update_info update_info = {
41+
.dfu_string = "mtd nor1=u-boot.bin raw 200000 100000;"
42+
"fip.bin raw 180000 78000;"
43+
"optee.bin raw 500000 100000",
44+
.images = fw_images,
45+
};
46+
47+
u8 num_image_type_guids = ARRAY_SIZE(fw_images);
48+
#endif /* EFI_HAVE_CAPSULE_SUPPORT */
49+
1750
static struct mm_region sc2a11_mem_map[] = {
1851
{
1952
.virt = 0x0UL,

0 commit comments

Comments
 (0)