plat/poplar: migrate to mmc framework
Migrate from emmc framework to mmc framework. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
This commit is contained in:
parent
261e43b78f
commit
eba1b6b3c7
|
@ -10,9 +10,9 @@
|
||||||
#include <console.h>
|
#include <console.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <dw_mmc.h>
|
#include <dw_mmc.h>
|
||||||
#include <emmc.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <generic_delay_timer.h>
|
#include <generic_delay_timer.h>
|
||||||
|
#include <mmc.h>
|
||||||
#include <mmio.h>
|
#include <mmio.h>
|
||||||
#include <pl061_gpio.h>
|
#include <pl061_gpio.h>
|
||||||
#include <platform.h>
|
#include <platform.h>
|
||||||
|
@ -92,6 +92,7 @@ void bl1_plat_arch_setup(void)
|
||||||
void bl1_platform_setup(void)
|
void bl1_platform_setup(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
struct mmc_device_info info;
|
||||||
#if !POPLAR_RECOVERY
|
#if !POPLAR_RECOVERY
|
||||||
dw_mmc_params_t params = EMMC_INIT_PARAMS(POPLAR_EMMC_DESC_BASE);
|
dw_mmc_params_t params = EMMC_INIT_PARAMS(POPLAR_EMMC_DESC_BASE);
|
||||||
#endif
|
#endif
|
||||||
|
@ -105,7 +106,8 @@ void bl1_platform_setup(void)
|
||||||
#if !POPLAR_RECOVERY
|
#if !POPLAR_RECOVERY
|
||||||
/* SoC-specific emmc register are initialized/configured by bootrom */
|
/* SoC-specific emmc register are initialized/configured by bootrom */
|
||||||
INFO("BL1: initializing emmc\n");
|
INFO("BL1: initializing emmc\n");
|
||||||
dw_mmc_init(¶ms);
|
info.mmc_dev_type = MMC_IS_EMMC;
|
||||||
|
dw_mmc_init(¶ms, &info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
plat_io_setup();
|
plat_io_setup();
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <desc_image_load.h>
|
#include <desc_image_load.h>
|
||||||
#include <dw_mmc.h>
|
#include <dw_mmc.h>
|
||||||
#include <emmc.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <generic_delay_timer.h>
|
#include <generic_delay_timer.h>
|
||||||
|
#include <mmc.h>
|
||||||
#include <mmio.h>
|
#include <mmio.h>
|
||||||
#include <optee_utils.h>
|
#include <optee_utils.h>
|
||||||
#include <partition/partition.h>
|
#include <partition/partition.h>
|
||||||
|
@ -333,6 +333,8 @@ void bl2_plat_get_bl33_meminfo(meminfo_t *bl33_meminfo)
|
||||||
|
|
||||||
void bl2_early_platform_setup(meminfo_t *mem_layout)
|
void bl2_early_platform_setup(meminfo_t *mem_layout)
|
||||||
{
|
{
|
||||||
|
struct mmc_device_info info;
|
||||||
|
|
||||||
#if !POPLAR_RECOVERY
|
#if !POPLAR_RECOVERY
|
||||||
dw_mmc_params_t params = EMMC_INIT_PARAMS(POPLAR_EMMC_DESC_BASE);
|
dw_mmc_params_t params = EMMC_INIT_PARAMS(POPLAR_EMMC_DESC_BASE);
|
||||||
#endif
|
#endif
|
||||||
|
@ -347,7 +349,8 @@ void bl2_early_platform_setup(meminfo_t *mem_layout)
|
||||||
#if !POPLAR_RECOVERY
|
#if !POPLAR_RECOVERY
|
||||||
/* SoC-specific emmc register are initialized/configured by bootrom */
|
/* SoC-specific emmc register are initialized/configured by bootrom */
|
||||||
INFO("BL2: initializing emmc\n");
|
INFO("BL2: initializing emmc\n");
|
||||||
dw_mmc_init(¶ms);
|
info.mmc_dev_type = MMC_IS_EMMC;
|
||||||
|
dw_mmc_init(¶ms, &info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
plat_io_setup();
|
plat_io_setup();
|
||||||
|
|
|
@ -67,11 +67,11 @@
|
||||||
|
|
||||||
#define EMMC_DESC_SIZE U(0x00100000) /* 1MB */
|
#define EMMC_DESC_SIZE U(0x00100000) /* 1MB */
|
||||||
#define EMMC_INIT_PARAMS(base) \
|
#define EMMC_INIT_PARAMS(base) \
|
||||||
{ .bus_width = EMMC_BUS_WIDTH_8, \
|
{ .bus_width = MMC_BUS_WIDTH_8, \
|
||||||
.clk_rate = 25 * 1000 * 1000, \
|
.clk_rate = 25 * 1000 * 1000, \
|
||||||
.desc_base = (base), \
|
.desc_base = (base), \
|
||||||
.desc_size = EMMC_DESC_SIZE, \
|
.desc_size = EMMC_DESC_SIZE, \
|
||||||
.flags = EMMC_FLAG_CMD23, \
|
.flags = MMC_FLAG_CMD23, \
|
||||||
.reg_base = REG_BASE_MCI, \
|
.reg_base = REG_BASE_MCI, \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
#include <arch_helpers.h>
|
#include <arch_helpers.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <emmc.h>
|
|
||||||
#include <firmware_image_package.h>
|
#include <firmware_image_package.h>
|
||||||
#include <io_block.h>
|
#include <io_block.h>
|
||||||
#include <io_driver.h>
|
#include <io_driver.h>
|
||||||
#include <io_fip.h>
|
#include <io_fip.h>
|
||||||
#include <io_memmap.h>
|
#include <io_memmap.h>
|
||||||
#include <io_storage.h>
|
#include <io_storage.h>
|
||||||
|
#include <mmc.h>
|
||||||
#include <mmio.h>
|
#include <mmio.h>
|
||||||
#include <partition/partition.h>
|
#include <partition/partition.h>
|
||||||
#include <semihosting.h>
|
#include <semihosting.h>
|
||||||
|
@ -38,10 +38,10 @@ static const io_block_dev_spec_t emmc_dev_spec = {
|
||||||
.length = POPLAR_EMMC_DATA_SIZE,
|
.length = POPLAR_EMMC_DATA_SIZE,
|
||||||
},
|
},
|
||||||
.ops = {
|
.ops = {
|
||||||
.read = emmc_read_blocks,
|
.read = mmc_read_blocks,
|
||||||
.write = emmc_write_blocks,
|
.write = mmc_write_blocks,
|
||||||
},
|
},
|
||||||
.block_size = EMMC_BLOCK_SIZE,
|
.block_size = MMC_BLOCK_SIZE,
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
static const io_dev_connector_t *mmap_dev_con;
|
static const io_dev_connector_t *mmap_dev_con;
|
||||||
|
|
|
@ -82,7 +82,7 @@ PLAT_BL_COMMON_SOURCES := \
|
||||||
BL1_SOURCES += \
|
BL1_SOURCES += \
|
||||||
lib/cpus/aarch64/cortex_a53.S \
|
lib/cpus/aarch64/cortex_a53.S \
|
||||||
drivers/arm/pl061/pl061_gpio.c \
|
drivers/arm/pl061/pl061_gpio.c \
|
||||||
drivers/emmc/emmc.c \
|
drivers/mmc/mmc.c \
|
||||||
drivers/synopsys/emmc/dw_mmc.c \
|
drivers/synopsys/emmc/dw_mmc.c \
|
||||||
drivers/io/io_storage.c \
|
drivers/io/io_storage.c \
|
||||||
drivers/io/io_block.c \
|
drivers/io/io_block.c \
|
||||||
|
@ -94,7 +94,7 @@ BL1_SOURCES += \
|
||||||
|
|
||||||
BL2_SOURCES += \
|
BL2_SOURCES += \
|
||||||
drivers/arm/pl061/pl061_gpio.c \
|
drivers/arm/pl061/pl061_gpio.c \
|
||||||
drivers/emmc/emmc.c \
|
drivers/mmc/mmc.c \
|
||||||
drivers/synopsys/emmc/dw_mmc.c \
|
drivers/synopsys/emmc/dw_mmc.c \
|
||||||
drivers/io/io_storage.c \
|
drivers/io/io_storage.c \
|
||||||
drivers/io/io_block.c \
|
drivers/io/io_block.c \
|
||||||
|
|
Loading…
Reference in New Issue