forked from espressif/esp-idf
change(sdmmc): enable UHS-1 support in test_app, swap slots on P4 EV board
This commit is contained in:
@@ -33,6 +33,7 @@ typedef struct {
|
|||||||
bool is_emmc; /*< True if this slot is connected to eMMC */
|
bool is_emmc; /*< True if this slot is connected to eMMC */
|
||||||
int bus_width; /*< SD interface width (1, 4 or 8) */
|
int bus_width; /*< SD interface width (1, 4 or 8) */
|
||||||
int max_freq_khz; /*< Max frequency (kHz) of SD interface, supported by the board */
|
int max_freq_khz; /*< Max frequency (kHz) of SD interface, supported by the board */
|
||||||
|
bool uhs1_supported; /*< Whether UHS-I mode is supported */
|
||||||
gpio_num_t clk; /*< CLK pin number */
|
gpio_num_t clk; /*< CLK pin number */
|
||||||
gpio_num_t cmd_mosi; /*< CMD pin number (SD mode) or MOSI (SPI mode) */
|
gpio_num_t cmd_mosi; /*< CMD pin number (SD mode) or MOSI (SPI mode) */
|
||||||
gpio_num_t d0_miso; /*< D0 pin number (SD mode) or MISO (SPI mode) */
|
gpio_num_t d0_miso; /*< D0 pin number (SD mode) or MISO (SPI mode) */
|
||||||
|
@@ -34,6 +34,9 @@ void sdmmc_test_board_get_config_sdmmc(int slot_index, sdmmc_host_t *out_host_co
|
|||||||
if (slot->max_freq_khz > 0) {
|
if (slot->max_freq_khz > 0) {
|
||||||
out_host_config->max_freq_khz = slot->max_freq_khz;
|
out_host_config->max_freq_khz = slot->max_freq_khz;
|
||||||
}
|
}
|
||||||
|
if (slot->uhs1_supported) {
|
||||||
|
out_host_config->flags |= SDMMC_HOST_FLAG_UHS1;
|
||||||
|
}
|
||||||
|
|
||||||
#if SOC_SDMMC_USE_GPIO_MATRIX
|
#if SOC_SDMMC_USE_GPIO_MATRIX
|
||||||
out_slot_config->clk = slot->clk;
|
out_slot_config->clk = slot->clk;
|
||||||
|
@@ -323,12 +323,10 @@ static const sdmmc_test_board_info_t s_board_info = {
|
|||||||
static const sdmmc_test_board_info_t s_board_info = {
|
static const sdmmc_test_board_info_t s_board_info = {
|
||||||
.name = "ESP32-P4 Function EV Board",
|
.name = "ESP32-P4 Function EV Board",
|
||||||
.slot = {
|
.slot = {
|
||||||
{
|
|
||||||
.slot_exists = false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
.slot_exists = true,
|
.slot_exists = true,
|
||||||
.bus_width = 4,
|
.bus_width = 4,
|
||||||
|
.uhs1_supported = true,
|
||||||
.clk = 43,
|
.clk = 43,
|
||||||
.cmd_mosi = 44,
|
.cmd_mosi = 44,
|
||||||
.d0_miso = 39,
|
.d0_miso = 39,
|
||||||
@@ -342,6 +340,9 @@ static const sdmmc_test_board_info_t s_board_info = {
|
|||||||
.cd = GPIO_NUM_NC,
|
.cd = GPIO_NUM_NC,
|
||||||
.wp = GPIO_NUM_NC,
|
.wp = GPIO_NUM_NC,
|
||||||
.unused_pin = 54,
|
.unused_pin = 54,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.slot_exists = false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@@ -58,6 +58,7 @@ void sdmmc_test_sd_begin(int slot, int width, int freq_khz, int ddr, sdmmc_card_
|
|||||||
}
|
}
|
||||||
|
|
||||||
config.max_freq_khz = freq_khz;
|
config.max_freq_khz = freq_khz;
|
||||||
|
bool slot_is_uhs1 = config.flags & SDMMC_HOST_FLAG_UHS1;
|
||||||
|
|
||||||
if (width == 1) {
|
if (width == 1) {
|
||||||
config.flags = SDMMC_HOST_FLAG_1BIT;
|
config.flags = SDMMC_HOST_FLAG_1BIT;
|
||||||
@@ -78,6 +79,10 @@ void sdmmc_test_sd_begin(int slot, int width, int freq_khz, int ddr, sdmmc_card_
|
|||||||
config.flags |= SDMMC_HOST_FLAG_DDR;
|
config.flags |= SDMMC_HOST_FLAG_DDR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (slot_is_uhs1) {
|
||||||
|
config.flags |= SDMMC_HOST_FLAG_UHS1;
|
||||||
|
}
|
||||||
|
|
||||||
#if SOC_SDMMC_IO_POWER_EXTERNAL
|
#if SOC_SDMMC_IO_POWER_EXTERNAL
|
||||||
#define SDMMC_PWR_LDO_CHANNEL 4
|
#define SDMMC_PWR_LDO_CHANNEL 4
|
||||||
sd_pwr_ctrl_ldo_config_t ldo_config = {
|
sd_pwr_ctrl_ldo_config_t ldo_config = {
|
||||||
|
Reference in New Issue
Block a user