mmc->selected_mode = mode;
mmc->tran_speed = mmc_mode2freq(mmc, mode);
mmc->ddr_mode = mmc_is_mode_ddr(mode);
- debug("selecting mode %s (freq : %d MHz)\n", mmc_mode_name(mode),
- mmc->tran_speed / 1000000);
+ pr_debug("selecting mode %s (freq : %d MHz)\n", mmc_mode_name(mode),
+ mmc->tran_speed / 1000000);
return 0;
}
}
if (mmc_set_blocklen(mmc, mmc->read_bl_len)) {
- debug("%s: Failed to set blocklen\n", __func__);
+ pr_debug("%s: Failed to set blocklen\n", __func__);
return 0;
}
cur = (blocks_todo > mmc->cfg->b_max) ?
mmc->cfg->b_max : blocks_todo;
if (mmc_read_blocks(mmc, dst, start, cur) != cur) {
- debug("%s: Failed to read blocks\n", __func__);
+ pr_debug("%s: Failed to read blocks\n", __func__);
return 0;
}
blocks_todo -= cur;
forbidden = MMC_CAP(MMC_HS_200);
if (MMC_CAP(mmc->selected_mode) & forbidden) {
- debug("selected mode (%s) is forbidden for part %d\n",
- mmc_mode_name(mmc->selected_mode), part_num);
+ pr_debug("selected mode (%s) is forbidden for part %d\n",
+ mmc_mode_name(mmc->selected_mode), part_num);
change = true;
} else if (mmc->selected_mode != mmc->best_mode) {
- debug("selected mode is not optimal\n");
+ pr_debug("selected mode is not optimal\n");
change = true;
}
mmc->ssr.erase_offset = eo * 1000;
}
} else {
- debug("Invalid Allocation Unit Size.\n");
+ pr_debug("Invalid Allocation Unit Size.\n");
}
return 0;
{
enum bus_mode mode;
- printf("%s: widths [", text);
+ pr_debug("%s: widths [", text);
if (caps & MMC_MODE_8BIT)
- printf("8, ");
+ pr_debug("8, ");
if (caps & MMC_MODE_4BIT)
- printf("4, ");
+ pr_debug("4, ");
if (caps & MMC_MODE_1BIT)
- printf("1, ");
- printf("\b\b] modes [");
+ pr_debug("1, ");
+ pr_debug("\b\b] modes [");
for (mode = MMC_LEGACY; mode < MMC_MODES_END; mode++)
if (MMC_CAP(mode) & caps)
- printf("%s, ", mmc_mode_name(mode));
- printf("\b\b]\n");
+ pr_debug("%s, ", mmc_mode_name(mode));
+ pr_debug("\b\b]\n");
}
#endif
mmc->signal_voltage = signal_voltage;
err = mmc_set_ios(mmc);
if (err)
- debug("unable to set voltage (err %d)\n", err);
+ pr_debug("unable to set voltage (err %d)\n", err);
return err;
}
for (w = widths; w < widths + ARRAY_SIZE(widths); w++) {
if (*w & caps & mwt->widths) {
- debug("trying mode %s width %d (at %d MHz)\n",
- mmc_mode_name(mwt->mode),
- bus_width(*w),
- mmc_mode2freq(mmc, mwt->mode) / 1000000);
+ pr_debug("trying mode %s width %d (at %d MHz)\n",
+ mmc_mode_name(mwt->mode),
+ bus_width(*w),
+ mmc_mode2freq(mmc, mwt->mode) / 1000000);
/* configure the bus width (card + host) */
err = sd_select_bus_width(mmc, bus_width(*w));
err = mmc_execute_tuning(mmc,
mwt->tuning);
if (err) {
- debug("tuning failed\n");
+ pr_debug("tuning failed\n");
goto error;
}
}
}
}
- printf("unable to select a mode\n");
+ pr_err("unable to select a mode\n");
return -ENOTSUPP;
}
return 0;
if (!mmc->ext_csd) {
- debug("No ext_csd found!\n"); /* this should enver happen */
+ pr_debug("No ext_csd found!\n"); /* this should enver happen */
return -ENOTSUPP;
}
for_each_supported_width(card_caps & mwt->widths,
mmc_is_mode_ddr(mwt->mode), ecbw) {
enum mmc_voltage old_voltage;
- debug("trying mode %s width %d (at %d MHz)\n",
- mmc_mode_name(mwt->mode),
- bus_width(ecbw->cap),
- mmc_mode2freq(mmc, mwt->mode) / 1000000);
+ pr_debug("trying mode %s width %d (at %d MHz)\n",
+ mmc_mode_name(mwt->mode),
+ bus_width(ecbw->cap),
+ mmc_mode2freq(mmc, mwt->mode) / 1000000);
old_voltage = mmc->signal_voltage;
err = mmc_set_lowest_voltage(mmc, mwt->mode,
MMC_ALL_SIGNAL_VOLTAGE);
if (mwt->tuning) {
err = mmc_execute_tuning(mmc, mwt->tuning);
if (err) {
- debug("tuning failed\n");
+ pr_debug("tuning failed\n");
goto error;
}
}
ret = device_get_supply_regulator(mmc->dev, "vmmc-supply",
&mmc->vmmc_supply);
if (ret)
- debug("%s: No vmmc supply\n", mmc->dev->name);
+ pr_debug("%s: No vmmc supply\n", mmc->dev->name);
ret = device_get_supply_regulator(mmc->dev, "vqmmc-supply",
&mmc->vqmmc_supply);
if (ret)
- debug("%s: No vqmmc supply\n", mmc->dev->name);
+ pr_debug("%s: No vqmmc supply\n", mmc->dev->name);
#endif
#else /* !CONFIG_DM_MMC */
/*
int ret = regulator_set_enable(mmc->vmmc_supply, false);
if (ret) {
- debug("Error disabling VMMC supply\n");
+ pr_debug("Error disabling VMMC supply\n");
return ret;
}
}
if (no_card) {
mmc->has_init = 0;
#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
- printf("MMC: no card present\n");
+ pr_err("MMC: no card present\n");
#endif
return -ENOMEDIUM;
}
* to use the UHS modes, because we wouldn't be able to
* recover from an error during the UHS initialization.
*/
- debug("Unable to do a full power cycle. Disabling the UHS modes for safety\n");
+ pr_debug("Unable to do a full power cycle. Disabling the UHS modes for safety\n");
uhs_en = false;
mmc->host_caps &= ~UHS_CAPS;
err = mmc_power_on(mmc);
if (!err)
err = mmc_complete_init(mmc);
if (err)
- printf("%s: %d, time %lu\n", __func__, err, get_timer(start));
+ pr_info("%s: %d, time %lu\n", __func__, err, get_timer(start));
return err;
}