diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 1b6e96b07..51e94be61 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -805,6 +805,11 @@ int mmc_part_switch_user(void) return ret; } +size_t mmc_boot_part_size(void) +{ + return mmc_ext_csd[CMD_EXTCSD_BOOT_SIZE_MULT] * SZ_128K; +} + size_t mmc_boot_part_read_blocks(int lba, uintptr_t buf, size_t size) { size_t size_read; diff --git a/include/drivers/mmc.h b/include/drivers/mmc.h index e973248f7..e94693dd7 100644 --- a/include/drivers/mmc.h +++ b/include/drivers/mmc.h @@ -62,6 +62,7 @@ #define CMD_EXTCSD_HS_TIMING 185 #define CMD_EXTCSD_PART_SWITCH_TIME 199 #define CMD_EXTCSD_SEC_CNT 212 +#define CMD_EXTCSD_BOOT_SIZE_MULT 226 #define EXT_CSD_PART_CONFIG_ACC_MASK GENMASK(2, 0) #define PART_CFG_BOOT_PARTITION1_ENABLE (U(1) << 3) @@ -262,6 +263,7 @@ size_t mmc_write_blocks(int lba, const uintptr_t buf, size_t size); size_t mmc_erase_blocks(int lba, size_t size); int mmc_part_switch_current_boot(void); int mmc_part_switch_user(void); +size_t mmc_boot_part_size(void); size_t mmc_boot_part_read_blocks(int lba, uintptr_t buf, size_t size); int mmc_init(const struct mmc_ops *ops_ptr, unsigned int clk, unsigned int width, unsigned int flags,