mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-23 13:36:05 +00:00
Merge changes from topic "stm32_io_update" into integration
* changes: refactor(plat/st): add stm32image_io_setup fix(plat/st): panic if boot interface is wrong
This commit is contained in:
commit
23b7ad5cc0
1 changed files with 19 additions and 32 deletions
|
@ -321,6 +321,19 @@ static void print_boot_device(boot_api_context_t *boot_context)
|
|||
}
|
||||
}
|
||||
|
||||
static void stm32image_io_setup(void)
|
||||
{
|
||||
int io_result __unused;
|
||||
|
||||
io_result = register_io_dev_stm32image(&stm32image_dev_con);
|
||||
assert(io_result == 0);
|
||||
|
||||
io_result = io_dev_open(stm32image_dev_con,
|
||||
(uintptr_t)&stm32image_dev_info_spec,
|
||||
&image_dev_handle);
|
||||
assert(io_result == 0);
|
||||
}
|
||||
|
||||
#if STM32MP_SDMMC || STM32MP_EMMC
|
||||
static void boot_mmc(enum mmc_device_type mmc_dev_type,
|
||||
uint16_t boot_interface_instance)
|
||||
|
@ -422,14 +435,6 @@ emmc_boot:
|
|||
io_result = io_dev_open(mmc_dev_con, (uintptr_t)&mmc_device_spec,
|
||||
&storage_dev_handle);
|
||||
assert(io_result == 0);
|
||||
|
||||
io_result = register_io_dev_stm32image(&stm32image_dev_con);
|
||||
assert(io_result == 0);
|
||||
|
||||
io_result = io_dev_open(stm32image_dev_con,
|
||||
(uintptr_t)&stm32image_dev_info_spec,
|
||||
&image_dev_handle);
|
||||
assert(io_result == 0);
|
||||
}
|
||||
#endif /* STM32MP_SDMMC || STM32MP_EMMC */
|
||||
|
||||
|
@ -475,14 +480,6 @@ static void boot_spi_nor(boot_api_context_t *boot_context)
|
|||
part->part_offset = STM32MP_NOR_TEEX_OFFSET;
|
||||
part->bkp_offset = 0U;
|
||||
#endif
|
||||
|
||||
io_result = register_io_dev_stm32image(&stm32image_dev_con);
|
||||
assert(io_result == 0);
|
||||
|
||||
io_result = io_dev_open(stm32image_dev_con,
|
||||
(uintptr_t)&stm32image_dev_info_spec,
|
||||
&image_dev_handle);
|
||||
assert(io_result == 0);
|
||||
}
|
||||
#endif /* STM32MP_SPI_NOR */
|
||||
|
||||
|
@ -528,14 +525,6 @@ static void boot_fmc2_nand(boot_api_context_t *boot_context)
|
|||
part->part_offset = STM32MP_NAND_TEEX_OFFSET;
|
||||
part->bkp_offset = nand_dev_spec.erase_size;
|
||||
#endif
|
||||
|
||||
io_result = register_io_dev_stm32image(&stm32image_dev_con);
|
||||
assert(io_result == 0);
|
||||
|
||||
io_result = io_dev_open(stm32image_dev_con,
|
||||
(uintptr_t)&stm32image_dev_info_spec,
|
||||
&image_dev_handle);
|
||||
assert(io_result == 0);
|
||||
}
|
||||
#endif /* STM32MP_RAW_NAND */
|
||||
|
||||
|
@ -582,14 +571,6 @@ static void boot_spi_nand(boot_api_context_t *boot_context)
|
|||
part->part_offset = STM32MP_NAND_TEEX_OFFSET;
|
||||
part->bkp_offset = spi_nand_dev_spec.erase_size;
|
||||
#endif
|
||||
|
||||
io_result = register_io_dev_stm32image(&stm32image_dev_con);
|
||||
assert(io_result == 0);
|
||||
|
||||
io_result = io_dev_open(stm32image_dev_con,
|
||||
(uintptr_t)&stm32image_dev_info_spec,
|
||||
&image_dev_handle);
|
||||
assert(io_result == 0);
|
||||
}
|
||||
#endif /* STM32MP_SPI_NAND */
|
||||
|
||||
|
@ -621,36 +602,42 @@ void stm32mp_io_setup(void)
|
|||
case BOOT_API_CTX_BOOT_INTERFACE_SEL_FLASH_SD:
|
||||
dmbsy();
|
||||
boot_mmc(MMC_IS_SD, boot_context->boot_interface_instance);
|
||||
stm32image_io_setup();
|
||||
break;
|
||||
#endif
|
||||
#if STM32MP_EMMC
|
||||
case BOOT_API_CTX_BOOT_INTERFACE_SEL_FLASH_EMMC:
|
||||
dmbsy();
|
||||
boot_mmc(MMC_IS_EMMC, boot_context->boot_interface_instance);
|
||||
stm32image_io_setup();
|
||||
break;
|
||||
#endif
|
||||
#if STM32MP_SPI_NOR
|
||||
case BOOT_API_CTX_BOOT_INTERFACE_SEL_FLASH_NOR_QSPI:
|
||||
dmbsy();
|
||||
boot_spi_nor(boot_context);
|
||||
stm32image_io_setup();
|
||||
break;
|
||||
#endif
|
||||
#if STM32MP_RAW_NAND
|
||||
case BOOT_API_CTX_BOOT_INTERFACE_SEL_FLASH_NAND_FMC:
|
||||
dmbsy();
|
||||
boot_fmc2_nand(boot_context);
|
||||
stm32image_io_setup();
|
||||
break;
|
||||
#endif
|
||||
#if STM32MP_SPI_NAND
|
||||
case BOOT_API_CTX_BOOT_INTERFACE_SEL_FLASH_NAND_QSPI:
|
||||
dmbsy();
|
||||
boot_spi_nand(boot_context);
|
||||
stm32image_io_setup();
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
ERROR("Boot interface %d not supported\n",
|
||||
boot_context->boot_interface_selected);
|
||||
panic();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue