mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-02 09:36:15 +00:00

We load two boot image source descriptor structures from last two sectors in the SPI NOR flash and determine the boot source for loading the kernel/DTB images, then adjust the boot order for loading image from eMMC boot0 or boot1 partition. Signed-off-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Lukasz Majewski <lukma@denx.de>
27 lines
858 B
C
27 lines
858 B
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* Struct for boot image source description for placing in last
|
|
* two SPI NOR flash sectors on legcom.
|
|
*/
|
|
|
|
struct boot_img_src {
|
|
u8 magic; /* Must be 'B' = 0x42 */
|
|
u8 flags; /* flags to specify mmcblk[0|1] boot[0|1] */
|
|
u8 crc8; /* CRC-8 over above two bytes */
|
|
} __packed;
|
|
|
|
/*
|
|
* Bit definition in boot_img_src.flags:
|
|
* Bit 0: mmcblk device 0 or 1 (1 - if this bit set)
|
|
* Bit 1: mmcblk boot partition 0 or 1.
|
|
* for eMMC: boot0 if this bit is cleared, boot1 - if set
|
|
* for SD-card the boot partition value will always be 0
|
|
* (independent of the value of this bit)
|
|
*
|
|
*/
|
|
#define BOOT_SRC_MMC1 BIT(0)
|
|
#define BOOT_SRC_PART1 BIT(1)
|
|
|
|
/* Offset of the first boot image source descriptor in SPI NOR */
|
|
#define SPI_FLASH_BOOT_SRC_OFFS 0xFE0000
|
|
#define SPI_FLASH_SECTOR_SIZE 0x10000
|