diff options
author | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2014-04-08 09:25:08 +0200 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2014-04-08 09:25:08 +0200 |
commit | 519fdde9e6a6ebce7dc743b4f5621503d25b7a45 (patch) | |
tree | 29649f48b92b92342183f71565c34afeca0b1735 /drivers/mmc/bfin_sdh.c | |
parent | c71645ad2bd5179ad21e2501c26f574e9688f02a (diff) | |
parent | 04d2f0a9f33112bd70ce4d9c451fdca1682e3a59 (diff) | |
download | u-boot-imx-519fdde9e6a6ebce7dc743b4f5621503d25b7a45.zip u-boot-imx-519fdde9e6a6ebce7dc743b4f5621503d25b7a45.tar.gz u-boot-imx-519fdde9e6a6ebce7dc743b4f5621503d25b7a45.tar.bz2 |
Merge branch 'u-boot/master' into 'u-boot-arm/master'
Conflicts:
arch/arm/cpu/arm926ejs/mxs/Makefile
include/configs/trats.h
include/configs/trats2.h
include/mmc.h
Diffstat (limited to 'drivers/mmc/bfin_sdh.c')
-rw-r--r-- | drivers/mmc/bfin_sdh.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/mmc/bfin_sdh.c b/drivers/mmc/bfin_sdh.c index bd9b641..bcd6a3e 100644 --- a/drivers/mmc/bfin_sdh.c +++ b/drivers/mmc/bfin_sdh.c @@ -274,30 +274,30 @@ static int bfin_sdh_init(struct mmc *mmc) return 0; } +static const struct mmc_ops bfin_mmc_ops = { + .send_cmd = bfin_sdh_request, + .set_ios = bfin_sdh_set_ios, + .init = bfin_sdh_init, +}; + +static struct mmc_config bfin_mmc_cfg = { + .name = "Blackfin SDH", + .ops = &bfin_mmc_ops, + .host_caps = MMC_MODE_4BIT, + .voltages = MMC_VDD_32_33 | MMC_VDD_33_34, + .b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT, +}; int bfin_mmc_init(bd_t *bis) { - struct mmc *mmc = NULL; + struct mmc *mmc; - mmc = malloc(sizeof(struct mmc)); + bfin_mmc_cfg.f_max = get_sclk(); + bfin_mmc_cfg.f_min = bfin_mmc_cfg.f_max >> 9; - if (!mmc) - return -ENOMEM; - sprintf(mmc->name, "Blackfin SDH"); - mmc->send_cmd = bfin_sdh_request; - mmc->set_ios = bfin_sdh_set_ios; - mmc->init = bfin_sdh_init; - mmc->getcd = NULL; - mmc->getwp = NULL; - mmc->host_caps = MMC_MODE_4BIT; - - mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34; - mmc->f_max = get_sclk(); - mmc->f_min = mmc->f_max >> 9; - - mmc->b_max = 0; - - mmc_register(mmc); + mmc = mmc_create(&bfin_mmc_cfg, NULL); + if (mmc == NULL) + return -1; return 0; } |