[GIT PULL] Please pull u-boot-amlogic-next-20241014
2
Hi Tom, New Libre Computer boards are added with UEFI Capsule Update support, plus various fixes for HDMI support, boot targets and android-mainline kernel support for khadas-vim3 android config. Thanks, Neil The following changes since commit 580fb5773634c4a01f907a164b2a05961840b4c0: Merge tag 'u-boot-imx-master-20241013' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx (2024-10-13 16:25:01 -0600) are available in the Git repository at: https://source.denx.de/u-boot/custodians/u-boot-amlogic.git tags/u-boot-amlogic-next-20241014 for you to fetch changes up to 315cad97a5ae09b1b975fff2413ce785b3b8592a: configs: meson64: Ensure commands for boot targets are available (2024-10-14 09:06:16 +0200) ---------------------------------------------------------------- - Add Libre Computer boards into proper libre-computer board directory - Add new Boards: - Libre Computer aml-s905d3-cc - Libre Computer aml-a311d-cc - Add capsule update to libretech-ac and the new boards since they have an onboard SPI nor flash - Fix HDMI support after sync to v6.11 and regulator enable from Marek - Fix khadas-vim3 android config for android-mainline kernel - Disable meson64 boot targets when configs are not eavailable ---------------------------------------------------------------- Callum Parsey (1): configs: meson64: Ensure commands for boot targets are available Mattijs Korpershoek (2): configs: khadas-vim3{l}: Increase boot/recovery partition size configs: meson64_android: Remove dtbo support Neil Armstrong (8): board: libretech-ac: move board support into dedicated directory board: libre-computer: aml-s805x-cc: Enable capsule updates ARM: meson: add support for Libre Computer aml-a311d-cc ARM: meson: add support for Libre Computer aml-s905d3-cc dts: meson-g12-common-u-boot: do not disable canvas video: meson: dw-hdmi: do not fail probe if HDMI regulator is already enabled clk: meson: gxbb: add HDMI clocks power/domain: meson-ee-pwrc: make sure to not enable a domain twice arch/arm/dts/meson-g12-common-u-boot.dtsi | 4 - .../dts/meson-g12b-a311d-libretech-cc-u-boot.dtsi | 15 +++ .../dts/meson-sm1-s905d3-libretech-cc-u-boot.dtsi | 15 +++ board/amlogic/p212/MAINTAINERS | 2 - board/libre-computer/aml-a311d-cc/MAINTAINERS | 7 ++ board/libre-computer/aml-a311d-cc/Makefile | 6 ++ board/libre-computer/aml-a311d-cc/aml-a311d-cc.c | 44 +++++++++ board/libre-computer/aml-s805x-ac/MAINTAINERS | 8 ++ board/libre-computer/aml-s805x-ac/Makefile | 6 ++ board/libre-computer/aml-s805x-ac/aml-s805x-ac.c | 71 ++++++++++++++ board/libre-computer/aml-s905d3-cc/MAINTAINERS | 7 ++ board/libre-computer/aml-s905d3-cc/Makefile | 6 ++ board/libre-computer/aml-s905d3-cc/aml-s905d3-cc.c | 44 +++++++++ configs/aml-a311d-cc_defconfig | 108 +++++++++++++++++++++ configs/aml-s905d3-cc_defconfig | 108 +++++++++++++++++++++ configs/libretech-ac_defconfig | 8 ++ doc/board/amlogic/aml-a311d-cc.rst | 46 +++++++++ doc/board/amlogic/aml-s905d3-cc.rst | 46 +++++++++ doc/board/amlogic/index.rst | 2 + drivers/clk/meson/gxbb.c | 50 +++++++++- drivers/power/domain/meson-ee-pwrc.c | 15 ++- drivers/video/meson/meson_dw_hdmi.c | 4 +- include/configs/khadas-vim3_android.h | 8 +- include/configs/khadas-vim3l_android.h | 8 +- include/configs/meson64.h | 28 +++++- include/configs/meson64_android.h | 26 +---- 26 files changed, 643 insertions(+), 49 deletions(-) create mode 100644 arch/arm/dts/meson-g12b-a311d-libretech-cc-u-boot.dtsi create mode 100644 arch/arm/dts/meson-sm1-s905d3-libretech-cc-u-boot.dtsi create mode 100644 board/libre-computer/aml-a311d-cc/MAINTAINERS create mode 100644 board/libre-computer/aml-a311d-cc/Makefile create mode 100644 board/libre-computer/aml-a311d-cc/aml-a311d-cc.c create mode 100644 board/libre-computer/aml-s805x-ac/MAINTAINERS create mode 100644 board/libre-computer/aml-s805x-ac/Makefile create mode 100644 board/libre-computer/aml-s805x-ac/aml-s805x-ac.c create mode 100644 board/libre-computer/aml-s905d3-cc/MAINTAINERS create mode 100644 board/libre-computer/aml-s905d3-cc/Makefile create mode 100644 board/libre-computer/aml-s905d3-cc/aml-s905d3-cc.c create mo
|
[PATCH v4 1/5] include/android_ab: move ab_select_slot() documentation to @ notation
There are new function documentation requirements in U-Boot, so apply these changes for android_ab. Reviewed-by: Mattijs Korpershoek <mkorpershoek@...> Reviewed-by: Simon Glass <sjg@...> Tested-by: Guillaume La Roque <glaroque@...> Signed-off-by: Dmitry Rokosov <ddrokosov@...> --- boot/android_ab.c | 43 ++++++++++++++++++++++++------------------- include/android_ab.h | 7 ++++--- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/boot/android_ab.c b/boot/android_ab.c index 1196a189ed5349ca5c088e3b6ef1796b11c69a84..0045c8133a8e164f1fdd4c0f9b683de0f13f26e0 100644 --- a/boot/android_ab.c +++ b/boot/android_ab.c @@ -13,13 +13,13 @@ #include <u-boot/crc.h> /** - * Compute the CRC-32 of the bootloader control struct. + * ab_control_compute_crc() - Compute the CRC32 of the bootloader control. + * + * @abc: Bootloader control block * * Only the bytes up to the crc32_le field are considered for the CRC-32 * calculation. * - * @param[in] abc bootloader control block - * * Return: crc32 sum */ static uint32_t ab_control_compute_crc(struct bootloader_control *abc) @@ -28,14 +28,14 @@ static uint32_t ab_control_compute_crc(struct bootloader_control *abc) } /** - * Initialize bootloader_control to the default value. + * ab_control_default() - Initialize bootloader_control to the default value. + * + * @abc: Bootloader control block * * It allows us to boot all slots in order from the first one. This value * should be used when the bootloader message is corrupted, but not when * a valid message indicates that all slots are unbootable. * - * @param[in] abc bootloader control block - * * Return: 0 on success and a negative on error */ static int ab_control_default(struct bootloader_control *abc) @@ -67,7 +67,13 @@ static int ab_control_default(struct bootloader_control *abc) } /** - * Load the boot_control struct from disk into newly allocated memory. + * ab_control_create_from_disk() - Load the boot_control from disk into memory. + * + * @dev_desc: Device where to read the boot_control struct from + * @part_info: Partition in 'dev_desc' where to read from, normally + * the "misc" partition should be used + * @abc: pointer to pointer to bootloader_control data + * @offset: boot_control struct offset * * This function allocates and returns an integer number of disk blocks, * based on the block size of the passed device to help performing a @@ -75,10 +81,6 @@ static int ab_control_default(struct bootloader_control *abc) * The boot_control struct offset (2 KiB) must be a multiple of the device * block size, for simplicity. * - * @param[in] dev_desc Device where to read the boot_control struct from - * @param[in] part_info Partition in 'dev_desc' where to read from, normally - * the "misc" partition should be used - * @param[out] pointer to pointer to bootloader_control data * Return: 0 on success and a negative on error */ static int ab_control_create_from_disk(struct blk_desc *dev_desc, @@ -122,15 +124,17 @@ static int ab_control_create_from_disk(struct blk_desc *dev_desc, } /** - * Store the loaded boot_control block. + * ab_control_store() - Store the loaded boot_control block. + * + * @dev_desc: Device where we should write the boot_control struct + * @part_info: Partition on the 'dev_desc' where to write + * @abc Pointer to the boot control struct and the extra bytes after + * it up to the nearest block boundary + * @offset: boot_control struct offset * * Store back to the same location it was read from with * ab_control_create_from_misc(). * - * @param[in] dev_desc Device where we should write the boot_control struct - * @param[in] part_info Partition on the 'dev_desc' where to write - * @param[in] abc Pointer to the boot control struct and the extra bytes after - * it up to the nearest block boundary * Return: 0 on success and a negative on error */ static int ab_control_store(struct blk_desc *dev_desc, @@ -160,12 +164,13 @@ static int ab_control_store(struct blk_desc *dev_desc, } /** - * Compare two slots. + * ab_compare_slots() - Compare two slots. + * + * @a: The first bootable slot metadata + * @b: The second bootable
|
[PATCH v4 4/5] cmd: bcb: introduce 'ab_dump' command to print BCB block content
It's really helpful to have the ability to dump BCB block for debugging A/B logic on the board supported this partition schema. Command 'bcb ab_dump' prints all fields of bootloader_control struct including slot_metadata for all presented slots. Output example: ===== > board# bcb ab_dump ubi 0#misc > Read 512 bytes from volume misc to 000000000bf07580 > Read 512 bytes from volume misc to 000000000bf42f40 > Bootloader Control: [misc] > Active Slot: _a > Magic Number: 0x42414342 > Version: 1 > Number of Slots: 2 > Recovery Tries Remaining: 0 > CRC: 0x2c8b50bc (Valid) > > Slot[0] Metadata: > - Priority: 15 > - Tries Remaining: 0 > - Successful Boot: 1 > - Verity Corrupted: 0 > > Slot[1] Metadata: > - Priority: 14 > - Tries Remaining: 7 > - Successful Boot: 0 > - Verity Corrupted: 0 ==== The ab_dump command allows you to display ABC data directly on the U-Boot console. During an A/B test execution, this test verifies the accuracy of each field within the ABC data. Reviewed-by: Mattijs Korpershoek <mkorpershoek@...> Reviewed-by: Simon Glass <sjg@...> Tested-by: Guillaume La Roque <glaroque@...> Signed-off-by: Dmitry Rokosov <ddrokosov@...> --- boot/android_ab.c | 68 +++++++++++++++++++++++++++++++++++ cmd/bcb.c | 35 ++++++++++++++++++ include/android_ab.h | 10 ++++++ test/py/tests/test_android/test_ab.py | 23 ++++++++++++ 4 files changed, 136 insertions(+) diff --git a/boot/android_ab.c b/boot/android_ab.c index 0045c8133a8e164f1fdd4c0f9b683de0f13f26e0..c93e51541019d0fe793303c4b3d5286df061906f 100644 --- a/boot/android_ab.c +++ b/boot/android_ab.c @@ -372,3 +372,71 @@ int ab_select_slot(struct blk_desc *dev_desc, struct disk_partition *part_info, return slot; } + +int ab_dump_abc(struct blk_desc *dev_desc, struct disk_partition *part_info) +{ + struct bootloader_control *abc; + u32 crc32_le; + int i, ret; + struct slot_metadata *slot; + + if (!dev_desc || !part_info) { + log_err("ANDROID: Empty device descriptor or partition info\n"); + return -EINVAL; + } + + ret = ab_control_create_from_disk(dev_desc, part_info, &abc, 0); + if (ret < 0) { + log_err("ANDROID: Cannot create bcb from disk %d\n", ret); + return ret; + } + + if (abc->magic != BOOT_CTRL_MAGIC) { + log_err("ANDROID: Unknown A/B metadata: %.8x\n", abc->magic); + ret = -ENODATA; + goto error; + } + + if (abc->version > BOOT_CTRL_VERSION) { + log_err("ANDROID: Unsupported A/B metadata version: %.8x\n", + abc->version); + ret = -ENODATA; + goto error; + } + + if (abc->nb_slot > ARRAY_SIZE(abc->slot_info)) { + log_err("ANDROID: Wrong number of slots %u, expected %zu\n", + abc->nb_slot, ARRAY_SIZE(abc->slot_info)); + ret = -ENODATA; + goto error; + } + + printf("Bootloader Control: [%s]\n", part_info->name); + printf("Active Slot: %s\n", abc->slot_suffix); + printf("Magic Number: 0x%x\n", abc->magic); + printf("Version: %u\n", abc->version); + printf("Number of Slots: %u\n", abc->nb_slot); + printf("Recovery Tries Remaining: %u\n", abc->recovery_tries_remaining); + + printf("CRC: 0x%.8x", abc->crc32_le); + + crc32_le = ab_control_compute_crc(abc); + if (abc->crc32_le != crc32_le) + printf(" (Invalid, Expected: 0x%.8x)\n", crc32_le); + else + printf(" (Valid)\n"); + + for (i = 0; i < abc->nb_slot; ++i) { + slot = &abc->slot_info[i]; + printf("\nSlot[%d] Metadata:\n", i); + printf("\t- Priority: %u\n", slot->priority); + printf("\t- Tries Remaining: %u\n", slot->tries_remaining); + printf("\t- Successful Boot: %u\n", slot->successful_boot); + printf("\t- Verity Corrupted: %u\n", slot->verity_corrupted); + } + +error: + free(abc); + + return ret; +} diff --git a/cmd/bcb.c b/cmd/bcb.c index 3935b7f8d535e87593020b91a6b37d7c5ef02a83..a0eff55c2ed4230e3964297a937c95f9eec3ec85 100644 --- a/cmd/bcb.c +++ b/cmd/bcb.c @@ -26,6 +26,7 @@ enum bcb_cmd { BCB_CMD_STORE, #ifdef CONFIG_ANDROID_AB BCB_CMD_AB_SELECT, + BCB_CMD_AB_DUMP, #endif }; @@ -59,6 +60,8 @@ static int bcb_cmd_get(char *cmd) #ifdef CONFIG_ANDROID_AB if (!strcmp(cmd, "ab_select")) return BCB_CMD_AB_SELECT; + if (!strcmp(cmd, "ab_dump")) + return BCB_CMD_AB_DUMP; #endif else return -1; @@ -98,6 +101,10 @@ static int bcb_
|
IBC Show & NAB Show Attendees Email List- 2024
Hi, Just checking in to see if you received my last email. Are you interested in discussing further? Looking forward to hearing from you. Best, Melanie Marketing Coordinator
|
[PATCH v4 2/5] treewide: bcb: move ab_select command to bcb subcommands
Hi Dmitry, Thank you for the patch. As discussed in https://lore.kernel.org/r/all/87ikttzhwd.fsf@.../, let's try to use CONFIG_IS_ENABLED. Let's continue the discussion in https://lore.kernel.org/r/all/87ikttzhwd.fsf@.../
|
[PATCH] configs: meson64: Ensure commands for boot targets are available
4
When populating BOOT_TARGET_DEVICES on Amlogic Meson platforms, verify that the shell commands for accessing the relevant media have been enabled in the build configuration. This was already being done for USB, NVME and SCSI devices, but not for MMC devices or network boot. This meant that configuring U-Boot without the networking or MMC subsystems/drivers would cause an error to be thrown during preprocessing. Signed-off-by: Callum Parsey <callum@...> --- include/configs/meson64.h | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/include/configs/meson64.h b/include/configs/meson64.h index ccb8ea2e71..f3275b37a5 100644 --- a/include/configs/meson64.h +++ b/include/configs/meson64.h @@ -77,6 +77,15 @@ #define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) #endif +#ifdef CONFIG_CMD_MMC + #define BOOT_TARGET_MMC(func) \ + func(MMC, mmc, 0) \ + func(MMC, mmc, 1) \ + func(MMC, mmc, 2) +#else + #define BOOT_TARGET_MMC(func) +#endif + #ifdef CONFIG_CMD_USB #define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) #else @@ -95,18 +104,27 @@ #define BOOT_TARGET_SCSI(func) #endif +#if defined(CONFIG_CMD_DHCP) && defined(CONFIG_CMD_PXE) + #define BOOT_TARGET_PXE(func) func(PXE, pxe, na) + #define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na) +#elif defined(CONFIG_CMD_DHCP) + #define BOOT_TARGET_PXE(func) + #define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na) +#else + #define BOOT_TARGET_PXE(func) + #define BOOT_TARGET_DHCP(func) +#endif + #ifndef BOOT_TARGET_DEVICES #define BOOT_TARGET_DEVICES(func) \ func(ROMUSB, romusb, na) \ func(USB_DFU, usbdfu, na) \ - func(MMC, mmc, 0) \ - func(MMC, mmc, 1) \ - func(MMC, mmc, 2) \ + BOOT_TARGET_MMC(func) \ BOOT_TARGET_DEVICES_USB(func) \ BOOT_TARGET_NVME(func) \ BOOT_TARGET_SCSI(func) \ - func(PXE, pxe, na) \ - func(DHCP, dhcp, na) + BOOT_TARGET_PXE(func) \ + BOOT_TARGET_DHCP(func) #endif #define BOOTM_SIZE __stringify(0x1700000) -- 2.46.2
|
[PATCH 0/2] configs: khadas-vim3{l}: Android bootflow updates
3
Hello, 2 small fixes for Khadas VIM3 and VIM3L to boot Android. Recently, some effort has been made to use the upstream android-mainline kernel on these boards [1]. To use android-mainline kernel, we should: * Increase the boot/recovery partition sizes (so that it fits) * Drop dtbo support, since these are not part of android-mainline [1] https://android-review.googlesource.com/c/kernel/common/+/3296472 Signed-off-by: Mattijs Korpershoek <mkorpershoek@...> --- Mattijs Korpershoek (2): configs: khadas-vim3{l}: Increase boot/recovery partition size configs: meson64_android: Remove dtbo support include/configs/khadas-vim3_android.h | 8 ++++---- include/configs/khadas-vim3l_android.h | 8 ++++---- include/configs/meson64_android.h | 26 +------------------------- 3 files changed, 9 insertions(+), 33 deletions(-) --- base-commit: a404065479be2c1fe1167c3c91367e8194a69d1b change-id: 20241011-yukawa-aosp-parts-77d255a19cda Best regards, -- Mattijs Korpershoek <mkorpershoek@...>
|
[PATCH v3 4/6] cmd: bcb: introduce 'ab_dump' command to print BCB block content
5
It's really helpful to have the ability to dump BCB block for debugging A/B logic on the board supported this partition schema. Command 'bcb ab_dump' prints all fields of bootloader_control struct including slot_metadata for all presented slots. Output example: ===== > board# bcb ab_dump ubi 0#misc > Read 512 bytes from volume misc to 000000000bf07580 > Read 512 bytes from volume misc to 000000000bf42f40 > Bootloader Control: [misc] > Active Slot: _a > Magic Number: 0x42414342 > Version: 1 > Number of Slots: 2 > Recovery Tries Remaining: 0 > CRC: 0x2c8b50bc (Valid) > > Slot[0] Metadata: > - Priority: 15 > - Tries Remaining: 0 > - Successful Boot: 1 > - Verity Corrupted: 0 > > Slot[1] Metadata: > - Priority: 14 > - Tries Remaining: 7 > - Successful Boot: 0 > - Verity Corrupted: 0 ==== Signed-off-by: Dmitry Rokosov <ddrokosov@...> --- boot/android_ab.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ cmd/bcb.c | 35 +++++++++++++++++++++++++++ include/android_ab.h | 10 ++++++++ 3 files changed, 113 insertions(+) diff --git a/boot/android_ab.c b/boot/android_ab.c index 0045c8133a8e164f1fdd4c0f9b683de0f13f26e0..c93e51541019d0fe793303c4b3d5286df061906f 100644 --- a/boot/android_ab.c +++ b/boot/android_ab.c @@ -372,3 +372,71 @@ int ab_select_slot(struct blk_desc *dev_desc, struct disk_partition *part_info, return slot; } + +int ab_dump_abc(struct blk_desc *dev_desc, struct disk_partition *part_info) +{ + struct bootloader_control *abc; + u32 crc32_le; + int i, ret; + struct slot_metadata *slot; + + if (!dev_desc || !part_info) { + log_err("ANDROID: Empty device descriptor or partition info\n"); + return -EINVAL; + } + + ret = ab_control_create_from_disk(dev_desc, part_info, &abc, 0); + if (ret < 0) { + log_err("ANDROID: Cannot create bcb from disk %d\n", ret); + return ret; + } + + if (abc->magic != BOOT_CTRL_MAGIC) { + log_err("ANDROID: Unknown A/B metadata: %.8x\n", abc->magic); + ret = -ENODATA; + goto error; + } + + if (abc->version > BOOT_CTRL_VERSION) { + log_err("ANDROID: Unsupported A/B metadata version: %.8x\n", + abc->version); + ret = -ENODATA; + goto error; + } + + if (abc->nb_slot > ARRAY_SIZE(abc->slot_info)) { + log_err("ANDROID: Wrong number of slots %u, expected %zu\n", + abc->nb_slot, ARRAY_SIZE(abc->slot_info)); + ret = -ENODATA; + goto error; + } + + printf("Bootloader Control: [%s]\n", part_info->name); + printf("Active Slot: %s\n", abc->slot_suffix); + printf("Magic Number: 0x%x\n", abc->magic); + printf("Version: %u\n", abc->version); + printf("Number of Slots: %u\n", abc->nb_slot); + printf("Recovery Tries Remaining: %u\n", abc->recovery_tries_remaining); + + printf("CRC: 0x%.8x", abc->crc32_le); + + crc32_le = ab_control_compute_crc(abc); + if (abc->crc32_le != crc32_le) + printf(" (Invalid, Expected: 0x%.8x)\n", crc32_le); + else + printf(" (Valid)\n"); + + for (i = 0; i < abc->nb_slot; ++i) { + slot = &abc->slot_info[i]; + printf("\nSlot[%d] Metadata:\n", i); + printf("\t- Priority: %u\n", slot->priority); + printf("\t- Tries Remaining: %u\n", slot->tries_remaining); + printf("\t- Successful Boot: %u\n", slot->successful_boot); + printf("\t- Verity Corrupted: %u\n", slot->verity_corrupted); + } + +error: + free(abc); + + return ret; +} diff --git a/cmd/bcb.c b/cmd/bcb.c index 970c58e56cba0e1bdff21b7cd099f69151f0c5b8..4fd32186ae654915b5a42c26d755e5727c211c63 100644 --- a/cmd/bcb.c +++ b/cmd/bcb.c @@ -25,6 +25,7 @@ enum bcb_cmd { BCB_CMD_FIELD_DUMP, BCB_CMD_STORE, BCB_CMD_AB_SELECT, + BCB_CMD_AB_DUMP, }; static const char * const fields[] = { @@ -56,6 +57,8 @@ static int bcb_cmd_get(char *cmd) return BCB_CMD_FIELD_DUMP; if (!strcmp(cmd, "ab_select")) return BCB_CMD_AB_SELECT; + if (!strcmp(cmd, "ab_dump")) + return BCB_CMD_AB_DUMP; else return -1; } @@ -93,6 +96,10 @@ static int bcb_is_misused(int argc, char *const argv[]) if (argc != 4 && argc != 5) goto err; return 0; + case BCB_CMD_AB_DUMP: + if (argc != 3) + goto err; + return 0; default: printf("Error: 'bcb %s' not supported\n", argv[0]); return -1; @@ -460,6 +467,28 @@ static int do_bcb_ab_select(struct cmd_tbl *cmdtp, int flag, int argc,
|
[PATCH v3 0/6] android_ab: introduce bcb ab_dump command and provide several bcb fixes
2
The patch series include changes: - move ab_select_slot() documentation to @ notation - move ab_select command to bcb subcommands - introduce the ab_dump command to print the content of the BCB block; it's useful for debugging A/B logic on supported boards - fix the slot suffix format in the ABC block to align with official Android BCB specifications - add a test for the ab_dump command to verify the accuracy of each field within the ABC data displayed, it's also useful for testing slot_suffix problem code paths Changes v3 since v2 at [2]: - return "Legend" block for bcb command - additionally, verify the CONFIG_ANDROID_AB configuration alongside CONFIG_CMD_BCB to ensure that the A/B scheme is used for the designated board. Changes v2 since v1 at [1]: - move ab_select_slot() documentation to @ notation - move ab_select command to bcb subcommands per Simon and Mattijs suggestions - redesign ab_dump as bcb subcommand - use spaces instead of tabs in the ab_dump command output - print hex values in the lowercase - add RvB tags Links: [1] https://lore.kernel.org/all/20240725194716.32232-1-ddrokosov@.../ [2] https://lore.kernel.org/all/20240911214945.15873-1-ddrokosov@.../ Signed-off-by: Dmitry Rokosov <ddrokosov@...> --- Dmitry Rokosov (6): include/android_ab: move ab_select_slot() documentation to @ notation treewide: bcb: move ab_select command to bcb subcommands cmd: bcb: change strcmp() usage style in the do_bcb_ab_select() cmd: bcb: introduce 'ab_dump' command to print BCB block content common: android_ab: fix slot suffix for abc block test/py: introduce test for ab_dump command MAINTAINERS | 1 - boot/android_ab.c | 116 ++++++++++++++++++++++++------ cmd/Kconfig | 15 +--- cmd/Makefile | 1 - cmd/ab_select.c | 66 ----------------- cmd/bcb.c | 98 +++++++++++++++++++++++++ configs/am57xx_hs_evm_usb_defconfig | 1 - configs/khadas-vim3_android_ab_defconfig | 1 - configs/khadas-vim3l_android_ab_defconfig | 1 - configs/sandbox64_defconfig | 4 +- configs/sandbox_defconfig | 4 +- doc/android/ab.rst | 12 ++-- include/android_ab.h | 17 ++++- include/configs/khadas-vim3_android.h | 2 +- include/configs/khadas-vim3l_android.h | 2 +- include/configs/meson64_android.h | 4 +- include/configs/ti_omap5_common.h | 4 +- test/py/tests/test_android/test_ab.py | 31 ++++++-- 18 files changed, 252 insertions(+), 128 deletions(-) --- base-commit: fbe16bc28014dc1ed957f5fee7e53d6eee781aa9 change-id: 20241008-android_ab_master-d86d71c839ae Best regards, -- Dmitry Rokosov <ddrokosov@...>
|
[PATCH v3 3/6] cmd: bcb: change strcmp() usage style in the do_bcb_ab_select()
In the entire cmd/bcb.c file, the return value of strcmp() is not directly compared to 0. Therefore, it would be better to maintain this style in the new do_bcb_ab_select() function as well. Reviewed-by: Mattijs Korpershoek <mkorpershoek@...> Reviewed-by: Simon Glass <sjg@...> Signed-off-by: Dmitry Rokosov <ddrokosov@...> --- cmd/bcb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/bcb.c b/cmd/bcb.c index 4f3b8a1538a1f05b8b4a1a51c8962c422981166a..970c58e56cba0e1bdff21b7cd099f69151f0c5b8 100644 --- a/cmd/bcb.c +++ b/cmd/bcb.c @@ -432,7 +432,7 @@ static int do_bcb_ab_select(struct cmd_tbl *cmdtp, int flag, int argc, bool dec_tries = true; for (int i = 4; i < argc; i++) { - if (strcmp(argv[i], "--no-dec") == 0) + if (!strcmp(argv[i], "--no-dec")) dec_tries = false; else return CMD_RET_USAGE; -- 2.43.0
|
[PATCH] video: meson: dw-hdmi: do not fail probe if HDMI regulator is already enabled
3
If the regulator is already enabled, this happens if the regulator is set in regulator-always-on, regulator_set_enable() return -EALREADY. Ignore the -EALREADY return since it's not an error. Signed-off-by: Neil Armstrong <neil.armstrong@...> --- drivers/video/meson/meson_dw_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/meson/meson_dw_hdmi.c b/drivers/video/meson/meson_dw_hdmi.c index 587df7beb9b..ee219ce6ec4 100644 --- a/drivers/video/meson/meson_dw_hdmi.c +++ b/drivers/video/meson/meson_dw_hdmi.c @@ -419,7 +419,7 @@ static int meson_dw_hdmi_probe(struct udevice *dev) if (!ret) { ret = regulator_set_enable(supply, true); - if (ret) + if (ret && ret != -EALREADY) return ret; } #endif --- base-commit: 28dc47038edc4e93f32d75a357131bcf01a18d85 change-id: 20241008-u-boot-video-fix-hdmi-supply-already-on-e6a9af27b1eb Best regards, -- Neil Armstrong <neil.armstrong@...>
|
[PATCH v3 4/6] cmd: bcb: introduce 'ab_dump' command to print BCB block content
5
Hi Dmitry, No need to resend a new version just for this, since it's already been reviewed. Keep the suggestion in mind for future series!
|
[PATCH v3 1/6] include/android_ab: move ab_select_slot() documentation to @ notation
There are new function documentation requirements in U-Boot, so apply these changes for android_ab. Reviewed-by: Mattijs Korpershoek <mkorpershoek@...> Reviewed-by: Simon Glass <sjg@...> Signed-off-by: Dmitry Rokosov <ddrokosov@...> --- boot/android_ab.c | 43 ++++++++++++++++++++++++------------------- include/android_ab.h | 7 ++++--- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/boot/android_ab.c b/boot/android_ab.c index 1196a189ed5349ca5c088e3b6ef1796b11c69a84..0045c8133a8e164f1fdd4c0f9b683de0f13f26e0 100644 --- a/boot/android_ab.c +++ b/boot/android_ab.c @@ -13,13 +13,13 @@ #include <u-boot/crc.h> /** - * Compute the CRC-32 of the bootloader control struct. + * ab_control_compute_crc() - Compute the CRC32 of the bootloader control. + * + * @abc: Bootloader control block * * Only the bytes up to the crc32_le field are considered for the CRC-32 * calculation. * - * @param[in] abc bootloader control block - * * Return: crc32 sum */ static uint32_t ab_control_compute_crc(struct bootloader_control *abc) @@ -28,14 +28,14 @@ static uint32_t ab_control_compute_crc(struct bootloader_control *abc) } /** - * Initialize bootloader_control to the default value. + * ab_control_default() - Initialize bootloader_control to the default value. + * + * @abc: Bootloader control block * * It allows us to boot all slots in order from the first one. This value * should be used when the bootloader message is corrupted, but not when * a valid message indicates that all slots are unbootable. * - * @param[in] abc bootloader control block - * * Return: 0 on success and a negative on error */ static int ab_control_default(struct bootloader_control *abc) @@ -67,7 +67,13 @@ static int ab_control_default(struct bootloader_control *abc) } /** - * Load the boot_control struct from disk into newly allocated memory. + * ab_control_create_from_disk() - Load the boot_control from disk into memory. + * + * @dev_desc: Device where to read the boot_control struct from + * @part_info: Partition in 'dev_desc' where to read from, normally + * the "misc" partition should be used + * @abc: pointer to pointer to bootloader_control data + * @offset: boot_control struct offset * * This function allocates and returns an integer number of disk blocks, * based on the block size of the passed device to help performing a @@ -75,10 +81,6 @@ static int ab_control_default(struct bootloader_control *abc) * The boot_control struct offset (2 KiB) must be a multiple of the device * block size, for simplicity. * - * @param[in] dev_desc Device where to read the boot_control struct from - * @param[in] part_info Partition in 'dev_desc' where to read from, normally - * the "misc" partition should be used - * @param[out] pointer to pointer to bootloader_control data * Return: 0 on success and a negative on error */ static int ab_control_create_from_disk(struct blk_desc *dev_desc, @@ -122,15 +124,17 @@ static int ab_control_create_from_disk(struct blk_desc *dev_desc, } /** - * Store the loaded boot_control block. + * ab_control_store() - Store the loaded boot_control block. + * + * @dev_desc: Device where we should write the boot_control struct + * @part_info: Partition on the 'dev_desc' where to write + * @abc Pointer to the boot control struct and the extra bytes after + * it up to the nearest block boundary + * @offset: boot_control struct offset * * Store back to the same location it was read from with * ab_control_create_from_misc(). * - * @param[in] dev_desc Device where we should write the boot_control struct - * @param[in] part_info Partition on the 'dev_desc' where to write - * @param[in] abc Pointer to the boot control struct and the extra bytes after - * it up to the nearest block boundary * Return: 0 on success and a negative on error */ static int ab_control_store(struct blk_desc *dev_desc, @@ -160,12 +164,13 @@ static int ab_control_store(struct blk_desc *dev_desc, } /** - * Compare two slots. + * ab_compare_slots() - Compare two slots. + * + * @a: The first bootable slot metadata + * @b: The second bootable slot metadata * * The function determines sl
|
[PATCH v3 2/6] treewide: bcb: move ab_select command to bcb subcommands
To enhance code organization, it is beneficial to consolidate all A/B BCB management routines into a single super-command. The 'bcb' command is an excellent candidate for this purpose. This patch integrates the separate 'ab_select' command into the 'bcb' group as the 'ab_select' subcommand, maintaining the same parameter list for consistency. Signed-off-by: Dmitry Rokosov <ddrokosov@...> --- MAINTAINERS | 1 - cmd/Kconfig | 15 +------ cmd/Makefile | 1 - cmd/ab_select.c | 66 ------------------------------- cmd/bcb.c | 63 +++++++++++++++++++++++++++++ configs/am57xx_hs_evm_usb_defconfig | 1 - configs/khadas-vim3_android_ab_defconfig | 1 - configs/khadas-vim3l_android_ab_defconfig | 1 - configs/sandbox64_defconfig | 4 +- configs/sandbox_defconfig | 4 +- doc/android/ab.rst | 12 +++--- include/configs/khadas-vim3_android.h | 2 +- include/configs/khadas-vim3l_android.h | 2 +- include/configs/meson64_android.h | 4 +- include/configs/ti_omap5_common.h | 4 +- test/py/tests/test_android/test_ab.py | 8 ++-- 16 files changed, 85 insertions(+), 104 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 7aefda93d017f07d616f0f6d191129914fbeb484..668ccec9ae6df47192b1af668e3fdbeb1dfa15ea 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -65,7 +65,6 @@ R: Sam Protsenko <semen.protsenko@...> S: Maintained T: git https://source.denx.de/u-boot/custodians/u-boot-dfu.git F: boot/android_ab.c -F: cmd/ab_select.c F: doc/android/ab.rst F: include/android_ab.h F: test/py/tests/test_android/test_ab.py diff --git a/cmd/Kconfig b/cmd/Kconfig index dd33266cec70a2b134b7244acae1b7f098b921e8..11e8d363dc9b137723a86a240412d82dd0dbccc5 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1067,6 +1067,7 @@ config CMD_ADC config CMD_BCB bool "bcb" depends on PARTITIONS + depends on ANDROID_AB help Read/modify/write the fields of Bootloader Control Block, usually stored on the flash "misc" partition with its structure defined in: @@ -1789,20 +1790,6 @@ config CMD_XXD endmenu -menu "Android support commands" - -config CMD_AB_SELECT - bool "ab_select" - depends on ANDROID_AB - help - On Android devices with more than one boot slot (multiple copies of - the kernel and system images) this provides a command to select which - slot should be used to boot from and register the boot attempt. This - is used by the new A/B update model where one slot is updated in the - background while running from the other slot. - -endmenu - if NET menuconfig CMD_NET diff --git a/cmd/Makefile b/cmd/Makefile index 91227f1249cbda5f7b383e8865c8cc23f3ad5f44..0fd7da3c0de91822c4299cc7034193c497d622b1 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -17,7 +17,6 @@ obj-$(CONFIG_CMD_2048) += 2048.o obj-$(CONFIG_CMD_ACPI) += acpi.o obj-$(CONFIG_CMD_ADDRMAP) += addrmap.o obj-$(CONFIG_CMD_AES) += aes.o -obj-$(CONFIG_CMD_AB_SELECT) += ab_select.o obj-$(CONFIG_CMD_ADC) += adc.o obj-$(CONFIG_CMD_ARMFLASH) += armflash.o obj-$(CONFIG_BLK) += blk_common.o diff --git a/cmd/ab_select.c b/cmd/ab_select.c deleted file mode 100644 index 7c178c728ca4c8b5bcba02a04eef2d6a7c86afb6..0000000000000000000000000000000000000000 --- a/cmd/ab_select.c +++ /dev/null @@ -1,66 +0,0 @@ -// SPDX-License-Identifier: BSD-2-Clause -/* - * Copyright (C) 2017 The Android Open Source Project - */ - -#include <android_ab.h> -#include <command.h> -#include <env.h> -#include <part.h> - -static int do_ab_select(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) -{ - int ret; - struct blk_desc *dev_desc; - struct disk_partition part_info; - char slot[2]; - bool dec_tries = true; - - if (argc < 4) - return CMD_RET_USAGE; - - for (int i = 4; i < argc; i++) { - if (strcmp(argv[i], "--no-dec") == 0) { - dec_tries = false; - } else { - return CMD_RET_USAGE; - } - } - - /* Lookup the "misc" partition from argv[2] and argv[3] */ - if (part_get_info_by_dev_and_name_or_num(argv[2], argv[3], - &dev_desc, &part_info, - false) < 0) { - return CMD_RET_FAILURE; - } - - ret = ab_select_slot(dev_desc, &part_info, dec_tries); - if (ret < 0) { - printf("Android boot failed, error %d.\n", ret); - return CMD_RET_FAILURE; - } - - /* Android standard
|
[PATCH v3 0/6] android_ab: introduce bcb ab_dump command and provide several bcb fixes
2
Hi, just test this series on Khadas vim3 board and it's working fine bcb ab_dump mmc 2#misc Bootloader Control: [misc] Active Slot: _a Magic Number: 0x42414342 Version: 1 Number of Slots: 2 Recovery Tries Remaining: 0 CRC: 0xd438d1b9 (Valid) Slot[0] Metadata: - Priority: 15 - Tries Remaining: 6 - Successful Boot: 0 - Verity Corrupted: 0 Slot[1] Metadata: - Priority: 15 - Tries Remaining: 7 - Successful Boot: 0 - Verity Corrupted: 0 Thanks for your patches. Tested-by: Guillaume La Roque <glaroque@...>
|
[PATCH v3 5/6] common: android_ab: fix slot suffix for abc block
To align with the official Android BCB (Bootloader Control Block) specifications, it's important to note that the slot_suffix should start with an underscore symbol. For a comprehensive understanding of the expected slot_suffix format in userspace, please refer to the provided reference [1]. Links: [1] - https://source.android.com/docs/core/architecture/bootloader/updating#slots Based-on: https://android-review.googlesource.com/c/platform/external/u-boot/+/1446439 Reviewed-by: Mattijs Korpershoek <mkorpershoek@...> Reviewed-by: Simon Glass <sjg@...> Signed-off-by: Dmitry Rokosov <ddrokosov@...> --- boot/android_ab.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/boot/android_ab.c b/boot/android_ab.c index c93e51541019d0fe793303c4b3d5286df061906f..a287eac04fe88ad08bdcf1b1b1d6e564d503d800 100644 --- a/boot/android_ab.c +++ b/boot/android_ab.c @@ -52,7 +52,7 @@ static int ab_control_default(struct bootloader_control *abc) if (!abc) return -EFAULT; - memcpy(abc->slot_suffix, "a\0\0\0", 4); + memcpy(abc->slot_suffix, "_a\0\0", 4); abc->magic = BOOT_CTRL_MAGIC; abc->version = BOOT_CTRL_VERSION; abc->nb_slot = NUM_SLOTS; @@ -328,7 +328,8 @@ int ab_select_slot(struct blk_desc *dev_desc, struct disk_partition *part_info, * or the device tree. */ memset(slot_suffix, 0, sizeof(slot_suffix)); - slot_suffix[0] = BOOT_SLOT_NAME(slot); + slot_suffix[0] = '_'; + slot_suffix[1] = BOOT_SLOT_NAME(slot); if (memcmp(abc->slot_suffix, slot_suffix, sizeof(slot_suffix))) { memcpy(abc->slot_suffix, slot_suffix, -- 2.43.0
|
[PATCH v3 6/6] test/py: introduce test for ab_dump command
The ab_dump command allows you to display ABC data directly on the U-Boot console. During an A/B test execution, this test verifies the accuracy of each field within the ABC data. Reviewed-by: Simon Glass <sjg@...> Reviewed-by: Mattijs Korpershoek <mkorpershoek@...> Signed-off-by: Dmitry Rokosov <ddrokosov@...> --- test/py/tests/test_android/test_ab.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/py/tests/test_android/test_ab.py b/test/py/tests/test_android/test_ab.py index 0d7b7995a9fab6e3daad748721818b9e4cfac452..9bf1a0eb00a6ae1edebf62f07fd162b9c8c02e49 100644 --- a/test/py/tests/test_android/test_ab.py +++ b/test/py/tests/test_android/test_ab.py @@ -54,6 +54,27 @@ def ab_disk_image(u_boot_console): di = ABTestDiskImage(u_boot_console) return di +def ab_dump(u_boot_console, slot_num, crc): + output = u_boot_console.run_command('bcb ab_dump host 0#misc') + header, slot0, slot1 = output.split('\r\r\n\r\r\n') + slots = [slot0, slot1] + slot_suffixes = ['_a', '_b'] + + header = dict(map(lambda x: map(str.strip, x.split(':')), header.split('\r\r\n'))) + assert header['Bootloader Control'] == '[misc]' + assert header['Active Slot'] == slot_suffixes[slot_num] + assert header['Magic Number'] == '0x42414342' + assert header['Version'] == '1' + assert header['Number of Slots'] == '2' + assert header['Recovery Tries Remaining'] == '0' + assert header['CRC'] == '{} (Valid)'.format(crc) + + slot = dict(map(lambda x: map(str.strip, x.split(':')), slots[slot_num].split('\r\r\n\t- ')[1:])) + assert slot['Priority'] == '15' + assert slot['Tries Remaining'] == '6' + assert slot['Successful Boot'] == '0' + assert slot['Verity Corrupted'] == '0' + @pytest.mark.boardspec('sandbox') @pytest.mark.buildconfigspec('android_ab') @pytest.mark.buildconfigspec('cmd_bcb') @@ -68,8 +89,10 @@ def test_ab(ab_disk_image, u_boot_console): assert 'Attempting slot a, tries remaining 7' in output output = u_boot_console.run_command('printenv slot_name') assert 'slot_name=a' in output + ab_dump(u_boot_console, 0, '0xd438d1b9') output = u_boot_console.run_command('bcb ab_select slot_name host 0:1') assert 'Attempting slot b, tries remaining 7' in output output = u_boot_console.run_command('printenv slot_name') assert 'slot_name=b' in output + ab_dump(u_boot_console, 1, '0x011ec016') -- 2.43.0
|
[PATCH v3 2/4] power: regulator: Convert regulators_enable_boot_on/off() to regulator_post_probe
6
Turn regulators_enable_boot_on() and regulators_enable_boot_off() into empty functions. Implement matching functionality in regulator_post_probe= () instead. The regulator_post_probe() is called for all regulators after th= ey probe, and regulators that have regulator-always-on or regulator-boot-on = DT properties now always probe due to DM_FLAG_PROBE_AFTER_BIND being set on such regulators in regulator_post_bind(). Finally, fold regulator_unset() functionality into regulator_autoset(). Signed-off-by: Marek Vasut <marex@...> --- Cc: Ben Wolsieffer <benwolsieffer@...> Cc: Caleb Connolly <caleb.connolly@...> Cc: Chris Morgan <macromorgan@...> Cc: Dragan Simic <dsimic@...> Cc: Eugen Hristev <eugen.hristev@...> Cc: Francesco Dolcini <francesco.dolcini@...> Cc: Heinrich Schuchardt <xypron.glpk@...> Cc: Jaehoon Chung <jh80.chung@...> Cc: Jagan Teki <jagan@...> Cc: Jonas Karlman <jonas@...> Cc: Kever Yang <kever.yang@...> Cc: Matteo Lisi <matteo.lisi@...> Cc: Mattijs Korpershoek <mkorpershoek@...> Cc: Max Krummenacher <max.krummenacher@...> Cc: Neil Armstrong <neil.armstrong@...> Cc: Patrice Chotard <patrice.chotard@...> Cc: Patrick Delaunay <patrick.delaunay@...> Cc: Philipp Tomsich <philipp.tomsich@...> Cc: Quentin Schulz <quentin.schulz@...> Cc: Sam Day <me@...> Cc: Simon Glass <sjg@...> Cc: Sumit Garg <sumit.garg@...> Cc: Svyatoslav Ryhel <clamor95@...> Cc: Thierry Reding <treding@...> Cc: Tom Rini <trini@...> Cc: Volodymyr Babchuk <Volodymyr_Babchuk@...> Cc: [email protected] Cc: [email protected] Cc: u-boot@... Cc: u-boot@... Cc: uboot-stm32@... --- V2: Rebase on current u-boot/next V3: No change --- drivers/power/regulator/regulator-uclass.c | 60 +++++++--------------- 1 file changed, 19 insertions(+), 41 deletions(-) diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/r= egulator/regulator-uclass.c index 1a970004540..9fcc4bd85b9 100644 --- a/drivers/power/regulator/regulator-uclass.c +++ b/drivers/power/regulator/regulator-uclass.c @@ -314,6 +314,11 @@ int regulator_autoset(struct udevice *dev) return ret; } =20 + if (uc_pdata->force_off) { + ret =3D regulator_set_enable(dev, false); + goto out; + } + if (!uc_pdata->always_on && !uc_pdata->boot_on) { ret =3D -EMEDIUMTYPE; goto out; @@ -518,56 +523,28 @@ static int regulator_pre_probe(struct udevice *dev) return 0; } =20 -int regulators_enable_boot_on(bool verbose) +static int regulator_post_probe(struct udevice *dev) { - struct udevice *dev; - struct uclass *uc; int ret; =20 - ret =3D uclass_get(UCLASS_REGULATOR, &uc); - if (ret) + ret =3D regulator_autoset(dev); + if (ret && ret !=3D -EMEDIUMTYPE && ret !=3D -EALREADY && ret !=3D ENOS= YS) return ret; - for (uclass_first_device(UCLASS_REGULATOR, &dev); - dev; - uclass_next_device(&dev)) { - ret =3D regulator_autoset(dev); - if (ret =3D=3D -EMEDIUMTYPE || ret =3D=3D -EALREADY) { - ret =3D 0; - continue; - } - if (verbose) - regulator_show(dev, ret); - if (ret =3D=3D -ENOSYS) - ret =3D 0; - } =20 - return ret; + if (_DEBUG) + regulator_show(dev, ret); + + return 0; } =20 -int regulators_enable_boot_off(bool verbose) +int regulators_enable_boot_on(bool verbose) { - struct udevice *dev; - struct uclass *uc; - int ret; - - ret =3D uclass_get(UCLASS_REGULATOR, &uc); - if (ret) - return ret; - for (uclass_first_device(UCLASS_REGULATOR, &dev); - dev; - uclass_next_device(&dev)) { - ret =3D regulator_unset(dev); - if (ret =3D=3D -EMEDIUMTYPE) { - ret =3D 0; - continue; - } - if (verbose) - regulator_show(dev, ret); - if (ret =3D=3D -ENOSYS) - ret =3D 0; - } + return 0; +} =20 - return ret; +int regulators_enable_boot_off(bool verbose) +{ + return 0; } =20 UCLASS_DRIVER(regulator) =3D { @@ -575,5 +552,6 @@ UCLASS_DRIVER(regulator) =3D { .name =3D "regulator", .post_bind =3D regulator_post_bind, .pre_probe =3D regulator_pre_probe, + .post_probe =3D regulator_post_probe, .per_device_plat_auto =3D sizeof(struct dm_regulator_uclass_plat), }; --=20 2.45.2
|
[PATCH 1/2] ARM: meson: add support for Libre Computer aml-a311d-cc
2
Add support for the Libre Computer aml-a311d-cc "Alta" board: https://libre.computer/products/aml-a311d-cc/ The Alta board has a Credit Card form factor, similar to the the prvevious "Le Potato" card, but with the Amlogic A311D SoC, MIPI DSI and CSI connectors. PoE header and a single USB2 Type-C connector replacing the microUSB one for power and USB 2.0. The board has an embedded SPI NOR flash, and EFI Capsule support is added. The GUID is dynamically generated for the board, to get it: => efidebug capsule esrt ======================================== ESRT: fw_resource_count=1 ESRT: fw_resource_count_max=1 ESRT: fw_resource_version=1 [entry 0]============================== ESRT: fw_class=17E07D9D-4D91-53F4-8780-1D91F279C1A5 ESRT: fw_type=unknown ESRT: fw_version=0 ESRT: lowest_supported_fw_version=0 ESRT: capsule_flags=0 ESRT: last_attempt_version=0 ESRT: last_attempt_status=success ======================================== On the host (with the aml_encrypt_g12a result binary): $ eficapsule --guid 17E07D9D-4D91-53F4-8780-1D91F279C1A5 -i 1 u-boot.bin u-boot.cap On the board (from USB disk containing u-boot.cap at root): => load usb 0:1 $kernel_addr_r u-boot.cap => efidebug capsule update $kernel_addr_r The binary will then be flashed on the SPI. Signed-off-by: Neil Armstrong <neil.armstrong@...> --- .../dts/meson-g12b-a311d-libretech-cc-u-boot.dtsi | 15 +++ board/libre-computer/aml-a311d-cc/MAINTAINERS | 7 ++ board/libre-computer/aml-a311d-cc/Makefile | 6 ++ board/libre-computer/aml-a311d-cc/aml-a311d-cc.c | 44 +++++++++ configs/aml-a311d-cc_defconfig | 108 +++++++++++++++++++++ doc/board/amlogic/aml-a311d-cc.rst | 46 +++++++++ doc/board/amlogic/index.rst | 1 + 7 files changed, 227 insertions(+) diff --git a/arch/arm/dts/meson-g12b-a311d-libretech-cc-u-boot.dtsi b/arch/arm/dts/meson-g12b-a311d-libretech-cc-u-boot.dtsi new file mode 100644 index 00000000000..cbada739042 --- /dev/null +++ b/arch/arm/dts/meson-g12b-a311d-libretech-cc-u-boot.dtsi @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2023 Neil Armstrong <neil.armstrong@...> + */ + +#include "meson-g12-common-u-boot.dtsi" + +&sd_emmc_c { + pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_4b_pins>; + bus-width = <4>; +}; + +&spifc { + status = "okay"; +}; diff --git a/board/libre-computer/aml-a311d-cc/MAINTAINERS b/board/libre-computer/aml-a311d-cc/MAINTAINERS new file mode 100644 index 00000000000..b4b77acd23b --- /dev/null +++ b/board/libre-computer/aml-a311d-cc/MAINTAINERS @@ -0,0 +1,7 @@ +LIBRE-COMPUTER AML-A311D-CC +M: Neil Armstrong <neil.armstrong@...> +S: Maintained +L: [email protected] +F: board/amlogic/aml-a311d-cc/ +F: configs/aml-a311d-cc_defconfig +F: doc/board/amlogic/aml-a311d-cc.rst diff --git a/board/libre-computer/aml-a311d-cc/Makefile b/board/libre-computer/aml-a311d-cc/Makefile new file mode 100644 index 00000000000..461955def3a --- /dev/null +++ b/board/libre-computer/aml-a311d-cc/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2016 BayLibre, SAS +# Author: Neil Armstrong <narmstrong@...> + +obj-y := aml-a311d-cc.o diff --git a/board/libre-computer/aml-a311d-cc/aml-a311d-cc.c b/board/libre-computer/aml-a311d-cc/aml-a311d-cc.c new file mode 100644 index 00000000000..e45cfd5d8a3 --- /dev/null +++ b/board/libre-computer/aml-a311d-cc/aml-a311d-cc.c @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2016 BayLibre, SAS + * Author: Neil Armstrong <narmstrong@...> + */ + +#include <dm.h> +#include <env.h> +#include <init.h> +#include <net.h> +#include <efi_loader.h> +#include <asm/io.h> +#include <asm/arch/eth.h> + +struct efi_fw_image fw_images[] = { + { + .fw_name = u"AML_A311D_CC_BOOT", + .image_index = 1, + }, +}; + +struct efi_capsule_update_info update_info = { + .dfu_string = "sf 0:0=u-boot-bin raw 0 0x10000", + .num_images = ARRAY_SIZE(fw_images), + .images = fw_images, +}; + + +#if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO) +void set_dfu_alt_info(char *interface, char *devstr) +{ + if (strcmp(interface, "ram") == 0) + env_set("dfu_alt_info", "fitimage ram
|
[PATCH 1/2] configs: khadas-vim3{l}: Increase boot/recovery partition size
2
The Android Common Kernel is over 34MiB now [1]. This does not include any kernel modules nor the Android ramdisk. To make sure we are future proof, increase both recovery and boot partitions to 64 MiB. [1] https://source.android.com/docs/core/architecture/kernel/gki-android15-6_6-release-builds Signed-off-by: Mattijs Korpershoek <mkorpershoek@...> --- include/configs/khadas-vim3_android.h | 8 ++++---- include/configs/khadas-vim3l_android.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/configs/khadas-vim3_android.h b/include/configs/khadas-vim3_android.h index da6adf6c413a..b76e049f09cc 100644 --- a/include/configs/khadas-vim3_android.h +++ b/include/configs/khadas-vim3_android.h @@ -21,8 +21,8 @@ "name=dtbo_b,size=8M,uuid=${uuid_gpt_dtbo_b};" \ "name=vbmeta_a,size=512K,uuid=${uuid_gpt_vbmeta_a};" \ "name=vbmeta_b,size=512K,uuid=${uuid_gpt_vbmeta_b};" \ - "name=boot_a,size=32M,bootable,uuid=${uuid_gpt_boot_a};" \ - "name=boot_b,size=32M,bootable,uuid=${uuid_gpt_boot_b};" \ + "name=boot_a,size=64M,bootable,uuid=${uuid_gpt_boot_a};" \ + "name=boot_b,size=64M,bootable,uuid=${uuid_gpt_boot_b};" \ "name=super,size=3072M,uuid=${uuid_gpt_super};" \ "name=userdata,size=11282M,uuid=${uuid_gpt_userdata};" \ "name=rootfs,size=-,uuid=" ROOT_UUID @@ -33,8 +33,8 @@ "name=misc,size=512K,uuid=${uuid_gpt_misc};" \ "name=dtbo,size=8M,uuid=${uuid_gpt_dtbo};" \ "name=vbmeta,size=512K,uuid=${uuid_gpt_vbmeta};" \ - "name=boot,size=32M,bootable,uuid=${uuid_gpt_boot};" \ - "name=recovery,size=32M,uuid=${uuid_gpt_recovery};" \ + "name=boot,size=64M,bootable,uuid=${uuid_gpt_boot};" \ + "name=recovery,size=64M,uuid=${uuid_gpt_recovery};" \ "name=cache,size=256M,uuid=${uuid_gpt_cache};" \ "name=super,size=1792M,uuid=${uuid_gpt_super};" \ "name=userdata,size=12786M,uuid=${uuid_gpt_userdata};" \ diff --git a/include/configs/khadas-vim3l_android.h b/include/configs/khadas-vim3l_android.h index b1768e2d8211..0ab8ffd372a4 100644 --- a/include/configs/khadas-vim3l_android.h +++ b/include/configs/khadas-vim3l_android.h @@ -21,8 +21,8 @@ "name=dtbo_b,size=8M,uuid=${uuid_gpt_dtbo_b};" \ "name=vbmeta_a,size=512K,uuid=${uuid_gpt_vbmeta_a};" \ "name=vbmeta_b,size=512K,uuid=${uuid_gpt_vbmeta_b};" \ - "name=boot_a,size=32M,bootable,uuid=${uuid_gpt_boot_a};" \ - "name=boot_b,size=32M,bootable,uuid=${uuid_gpt_boot_b};" \ + "name=boot_a,size=64M,bootable,uuid=${uuid_gpt_boot_a};" \ + "name=boot_b,size=64M,bootable,uuid=${uuid_gpt_boot_b};" \ "name=super,size=3072M,uuid=${uuid_gpt_super};" \ "name=userdata,size=11282M,uuid=${uuid_gpt_userdata};" \ "name=rootfs,size=-,uuid=" ROOT_UUID @@ -33,8 +33,8 @@ "name=misc,size=512K,uuid=${uuid_gpt_misc};" \ "name=dtbo,size=8M,uuid=${uuid_gpt_dtbo};" \ "name=vbmeta,size=512K,uuid=${uuid_gpt_vbmeta};" \ - "name=boot,size=32M,bootable,uuid=${uuid_gpt_boot};" \ - "name=recovery,size=32M,uuid=${uuid_gpt_recovery};" \ + "name=boot,size=64M,bootable,uuid=${uuid_gpt_boot};" \ + "name=recovery,size=64M,uuid=${uuid_gpt_recovery};" \ "name=cache,size=256M,uuid=${uuid_gpt_cache};" \ "name=super,size=1792M,uuid=${uuid_gpt_super};" \ "name=userdata,size=12786M,uuid=${uuid_gpt_userdata};" \ -- 2.46.2
|