*/
if (mmc->boot_config & 0x7) {
err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL,
- EXT_CSD_BOOT_BUS_WIDTH, 0x2);
+ EXT_CSD_BOOT_BUS_WIDTH, mmc->boot_buswidth);
if (err)
return err;
}
mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
- if (bus_width == 8)
+ if (bus_width == 8) {
mmc->host_caps = MMC_MODE_8BIT;
- else
+ mmc->boot_buswidth = MMC_BOOT_8BIT;
+ } else {
mmc->host_caps = MMC_MODE_4BIT;
+ mmc->boot_buswidth = MMC_BOOT_4BIT;
+ }
mmc->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS;
mmc->f_min = 400000;
#define MMC_MODE_HS_52MHz 0x010
#define MMC_MODE_4BIT 0x100
#define MMC_MODE_8BIT 0x200
+#define MMC_BOOT_4BIT 0x1
+#define MMC_BOOT_8BIT 0x2
#define SD_DATA_4BIT 0x00040000
u64 capacity;
block_dev_desc_t block_dev;
uint boot_config;
+ uint boot_buswidth;
int check_rev; /* check version 4.3+ or 4.41 (1: 4.3+, 0: 4.41) */
int (*send_cmd)(struct mmc *mmc,
struct mmc_cmd *cmd, struct mmc_data *data);