.getcd = tegra_mmc_getcd,
};
-static int do_mmc_init(int dev_index)
+static int do_mmc_init(int dev_index, bool removable)
{
struct mmc_host *host;
struct mmc *mmc;
host->cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
mmc = mmc_create(&host->cfg, host);
+ mmc->block_dev.removable = removable;
if (mmc == NULL)
return -1;
* @param node Device index (0-3)
* @param host Structure to fill in (reg, width, mmc_id)
*/
-static int mmc_get_config(const void *blob, int node, struct mmc_host *host)
+static int mmc_get_config(const void *blob, int node, struct mmc_host *host,
+ bool *removablep)
{
debug("%s: node = %d\n", __func__, node);
GPIOD_IS_IN);
gpio_request_by_name_nodev(blob, node, "power-gpios", 0,
&host->pwr_gpio, GPIOD_IS_OUT);
+ *removablep = !fdtdec_get_bool(blob, node, "non-removable");
debug("%s: found controller at %p, width = %d, periph_id = %d\n",
__func__, host->reg, host->width, host->mmc_id);
static int process_nodes(const void *blob, int node_list[], int count)
{
struct mmc_host *host;
+ bool removable;
int i, node;
debug("%s: count = %d\n", __func__, count);
host = &mmc_host[i];
host->id = i;
- if (mmc_get_config(blob, node, host)) {
+ if (mmc_get_config(blob, node, host, &removable)) {
printf("%s: failed to decode dev %d\n", __func__, i);
return -1;
}
- do_mmc_init(i);
+ do_mmc_init(i, removable);
}
return 0;
}