CI: https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/22962

Dfu:
- Rely on device tree for spi speed/mode on spi flash

Android Image:
- Fix booting on platforms having > 4GiB of memory
- Decompress boot image to kernel_addr_r when compression is enabled
- Honor CONFIG_SYS_LOAD_ADDR when mkbootimg uses default address

Bcb:
- Rework bcb command to use U_BOOT_LONGHELP
- Move ab_select cmd to bcb cmd
- Implement ab_dump command in bcb
- bcb: Write '_<slot>' instead of '<slot>' to misc partition
This commit is contained in:
Tom Rini
2024-10-25 08:35:56 -06:00
24 changed files with 374 additions and 243 deletions

View File

@@ -18,7 +18,10 @@ struct disk_partition;
#define NUM_SLOTS 2
/**
* Select the slot where to boot from.
* ab_select_slot() - Select the slot where to boot from.
*
* @dev_desc: Place to store the device description pointer
* @part_info: Place to store the partition information
*
* On Android devices with more than one boot slot (multiple copies of the
* kernel and system images) selects which slot should be used to boot from and
@@ -28,11 +31,19 @@ struct disk_partition;
* registered before returning from this function so it isn't selected
* indefinitely.
*
* @param[in] dev_desc Place to store the device description pointer
* @param[in] part_info Place to store the partition information
* Return: The slot number (>= 0) on success, or a negative on error
*/
int ab_select_slot(struct blk_desc *dev_desc, struct disk_partition *part_info,
bool dec_tries);
/**
* ab_dump_abc() - Dump ABC information for specific partition.
*
* @dev_desc: Device description pointer
* @part_info: Partition information
*
* Return: 0 on success, or a negative on error
*/
int ab_dump_abc(struct blk_desc *dev_desc, struct disk_partition *part_info);
#endif /* __ANDROID_AB_H */

View File

@@ -348,7 +348,7 @@ struct andr_image_data {
ulong bootconfig_addr; /* bootconfig image address */
ulong bootconfig_size; /* bootconfig image size */
u32 kernel_addr; /* physical load addr */
ulong kernel_addr; /* physical load addr */
ulong ramdisk_addr; /* physical load addr */
ulong ramdisk_ptr; /* ramdisk address */
ulong dtb_load_addr; /* physical load address for DTB image */

View File

@@ -12,7 +12,7 @@
#define LOGO_UUID "43a3305d-150f-4cc9-bd3b-38fca8693846;"
#define ROOT_UUID "ddb8c3f6-d94d-4394-b633-3134139cc2e0;"
#if defined(CONFIG_CMD_AB_SELECT)
#if defined(CONFIG_CMD_BCB) && defined(CONFIG_ANDROID_AB)
#define PARTS_DEFAULT \
"uuid_disk=${uuid_gpt_disk};" \
"name=logo,start=512K,size=2M,uuid=" LOGO_UUID \

View File

@@ -12,7 +12,7 @@
#define LOGO_UUID "43a3305d-150f-4cc9-bd3b-38fca8693846;"
#define ROOT_UUID "ddb8c3f6-d94d-4394-b633-3134139cc2e0;"
#if defined(CONFIG_CMD_AB_SELECT)
#if defined(CONFIG_CMD_BCB) && defined(CONFIG_ANDROID_AB)
#define PARTS_DEFAULT \
"uuid_disk=${uuid_gpt_disk};" \
"name=logo,start=512K,size=2M,uuid=" LOGO_UUID \

View File

@@ -47,13 +47,13 @@
#define AVB_VERIFY_CMD ""
#endif
#if defined(CONFIG_CMD_AB_SELECT)
#if defined(CONFIG_CMD_BCB) && defined(CONFIG_ANDROID_AB)
#define ANDROIDBOOT_GET_CURRENT_SLOT_CMD "get_current_slot=" \
"if part number mmc ${mmcdev} " CONTROL_PARTITION " control_part_number; " \
"then " \
"echo " CONTROL_PARTITION \
" partition number:${control_part_number};" \
"ab_select current_slot mmc ${mmcdev}:${control_part_number};" \
"bcb ab_select current_slot mmc ${mmcdev}:${control_part_number};" \
"else " \
"echo " CONTROL_PARTITION " partition not found;" \
"fi;\0"

View File

@@ -93,13 +93,13 @@
#define CONTROL_PARTITION "misc"
#if defined(CONFIG_CMD_AB_SELECT)
#if defined(CONFIG_CMD_BCB) && defined(CONFIG_ANDROID_AB)
#define AB_SELECT_SLOT \
"if part number mmc 1 " CONTROL_PARTITION " control_part_number; " \
"then " \
"echo " CONTROL_PARTITION \
" partition number:${control_part_number};" \
"ab_select slot_name mmc ${mmcdev}:${control_part_number};" \
"bcb ab_select slot_name mmc ${mmcdev}:${control_part_number};" \
"else " \
"echo " CONTROL_PARTITION " partition not found;" \
"exit;" \

View File

@@ -139,6 +139,40 @@ int sandbox_sf_bind_emul(struct sandbox_state *state, int busnum, int cs,
void sandbox_sf_unbind_emul(struct sandbox_state *state, int busnum, int cs);
#else
/* Compatibility functions for when DM_SPI_FLASH is disabled */
static inline int spi_flash_probe_bus_cs(unsigned int busnum, unsigned int cs,
struct udevice **devp)
{
return -ENODEV;
}
static inline int spi_flash_read_dm(struct udevice *dev, u32 offset, size_t len,
void *buf)
{
return -ENODEV;
}
static inline int spi_flash_write_dm(struct udevice *dev, u32 offset, size_t len,
const void *buf)
{
return -ENODEV;
}
static inline int spi_flash_erase_dm(struct udevice *dev, u32 offset, size_t len)
{
return -ENODEV;
}
static inline int spl_flash_get_sw_write_prot(struct udevice *dev)
{
return -ENODEV;
}
static inline int spi_flash_std_probe(struct udevice *dev)
{
return -ENODEV;
}
struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
unsigned int max_hz, unsigned int spi_mode);