projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fsl_esdhc: Always stop clock before changing frequency
[oweals/u-boot.git]
/
drivers
/
mmc
/
atmel_mci.c
diff --git
a/drivers/mmc/atmel_mci.c
b/drivers/mmc/atmel_mci.c
index 61aa1849c24a3374776eea5487f5eb630ca22f1d..3946ffeebea2343f8cc6c2d5fc8f1fcbb21d6ce7 100644
(file)
--- a/
drivers/mmc/atmel_mci.c
+++ b/
drivers/mmc/atmel_mci.c
@@
-38,16
+38,16
@@
#define pr_debug(...) do { } while(0)
#endif
#define pr_debug(...) do { } while(0)
#endif
-#ifndef C
FG
_MMC_CLK_OD
-#define C
FG_MMC_CLK_OD
150000
+#ifndef C
ONFIG_SYS
_MMC_CLK_OD
+#define C
ONFIG_SYS_MMC_CLK_OD
150000
#endif
#endif
-#ifndef C
FG
_MMC_CLK_PP
-#define C
FG_MMC_CLK_PP
5000000
+#ifndef C
ONFIG_SYS
_MMC_CLK_PP
+#define C
ONFIG_SYS_MMC_CLK_PP
5000000
#endif
#endif
-#ifndef C
FG
_MMC_OP_COND
-#define C
FG_MMC_OP_COND
0x00100000
+#ifndef C
ONFIG_SYS
_MMC_OP_COND
+#define C
ONFIG_SYS_MMC_OP_COND
0x00100000
#endif
#define MMC_DEFAULT_BLKLEN 512
#endif
#define MMC_DEFAULT_BLKLEN 512
@@
-135,10
+135,10
@@
mmc_cmd(unsigned long cmd, unsigned long arg,
status = mmci_readl(SR);
} while (!(status & MMCI_BIT(CMDRDY)));
status = mmci_readl(SR);
} while (!(status & MMCI_BIT(CMDRDY)));
- pr_debug("mmc: status 0x%08
l
x\n", status);
+ pr_debug("mmc: status 0x%08x\n", status);
if (status & error_flags) {
if (status & error_flags) {
- printf("mmc: command %lu failed (status: 0x%08
l
x)\n",
+ printf("mmc: command %lu failed (status: 0x%08x)\n",
cmd, status);
return -EIO;
}
cmd, status);
return -EIO;
}
@@
-245,7
+245,7
@@
out:
read_error:
mmc_cmd(MMC_CMD_SEND_STATUS, mmc_rca << 16, &card_status, R1 | NCR);
read_error:
mmc_cmd(MMC_CMD_SEND_STATUS, mmc_rca << 16, &card_status, R1 | NCR);
- printf("mmc: bread failed, status = %08x, card status = %08x\n",
+ printf("mmc: bread failed, status = %08x, card status = %08
l
x\n",
status, card_status);
goto out;
}
status, card_status);
goto out;
}
@@
-284,13
+284,13
@@
static void sd_parse_cid(struct mmc_cid *cid, unsigned long *resp)
static void mmc_dump_cid(const struct mmc_cid *cid)
{
static void mmc_dump_cid(const struct mmc_cid *cid)
{
- printf("Manufacturer ID: %02
l
X\n", cid->mid);
- printf("OEM/Application ID: %04
l
X\n", cid->oid);
+ printf("Manufacturer ID: %02X\n", cid->mid);
+ printf("OEM/Application ID: %04X\n", cid->oid);
printf("Product name: %s\n", cid->pnm);
printf("Product name: %s\n", cid->pnm);
- printf("Product Revision: %
lu.%l
u\n",
+ printf("Product Revision: %
u.%
u\n",
cid->prv >> 4, cid->prv & 0x0f);
printf("Product Serial Number: %lu\n", cid->psn);
cid->prv >> 4, cid->prv & 0x0f);
printf("Product Serial Number: %lu\n", cid->psn);
- printf("Manufacturing Date: %02
lu/%02l
u\n",
+ printf("Manufacturing Date: %02
u/%02
u\n",
cid->mdt >> 4, cid->mdt & 0x0f);
}
cid->mdt >> 4, cid->mdt & 0x0f);
}
@@
-349,7
+349,7
@@
static int sd_init_card(struct mmc_cid *cid, int verbose)
mmc_idle_cards();
for (i = 0; i < 1000; i++) {
mmc_idle_cards();
for (i = 0; i < 1000; i++) {
- ret = mmc_acmd(SD_CMD_APP_SEND_OP_COND, C
FG
_MMC_OP_COND,
+ ret = mmc_acmd(SD_CMD_APP_SEND_OP_COND, C
ONFIG_SYS
_MMC_OP_COND,
resp, R3 | NID);
if (ret || (resp[0] & 0x80000000))
break;
resp, R3 | NID);
if (ret || (resp[0] & 0x80000000))
break;
@@
-385,7
+385,7
@@
static int mmc_init_card(struct mmc_cid *cid, int verbose)
mmc_idle_cards();
for (i = 0; i < 1000; i++) {
mmc_idle_cards();
for (i = 0; i < 1000; i++) {
- ret = mmc_cmd(MMC_CMD_SEND_OP_COND, C
FG
_MMC_OP_COND, resp,
+ ret = mmc_cmd(MMC_CMD_SEND_OP_COND, C
ONFIG_SYS
_MMC_OP_COND, resp,
R3 | NID | OPEN_DRAIN);
if (ret || (resp[0] & 0x80000000))
break;
R3 | NID | OPEN_DRAIN);
if (ret || (resp[0] & 0x80000000))
break;
@@
-434,7
+434,7
@@
static void mci_set_data_timeout(struct mmc_csd *csd)
timeout_clks = csd->nsac * 100;
timeout_clks += (((timeout_ns + 9) / 10)
timeout_clks = csd->nsac * 100;
timeout_clks += (((timeout_ns + 9) / 10)
- * ((C
FG
_MMC_CLK_PP + 99999) / 100000) + 9999) / 10000;
+ * ((C
ONFIG_SYS
_MMC_CLK_PP + 99999) / 100000) + 9999) / 10000;
if (!mmc_card_is_sd)
timeout_clks *= 10;
else
if (!mmc_card_is_sd)
timeout_clks *= 10;
else
@@
-463,7
+463,7
@@
static void mci_set_data_timeout(struct mmc_csd *csd)
dtocyc << shift, dtor);
}
dtocyc << shift, dtor);
}
-int mmc_init(int verbose)
+int mmc_
legacy_
init(int verbose)
{
struct mmc_cid cid;
struct mmc_csd csd;
{
struct mmc_cid cid;
struct mmc_csd csd;
@@
-475,7
+475,7
@@
int mmc_init(int verbose)
mmci_writel(CR, MMCI_BIT(MCIEN));
mmci_writel(DTOR, 0x5f);
mmci_writel(IDR, ~0UL);
mmci_writel(CR, MMCI_BIT(MCIEN));
mmci_writel(DTOR, 0x5f);
mmci_writel(IDR, ~0UL);
- mci_set_mode(C
FG
_MMC_CLK_OD, MMC_DEFAULT_BLKLEN);
+ mci_set_mode(C
ONFIG_SYS
_MMC_CLK_OD, MMC_DEFAULT_BLKLEN);
mmc_card_is_sd = 0;
mmc_card_is_sd = 0;
@@
-501,7
+501,7
@@
int mmc_init(int verbose)
mmc_blkdev.part_type = PART_TYPE_DOS;
mmc_blkdev.block_read = mmc_bread;
sprintf((char *)mmc_blkdev.vendor,
mmc_blkdev.part_type = PART_TYPE_DOS;
mmc_blkdev.block_read = mmc_bread;
sprintf((char *)mmc_blkdev.vendor,
- "Man %02x%04x Snr %08x",
+ "Man %02x%04x Snr %08
l
x",
cid.mid, cid.oid, cid.psn);
strncpy((char *)mmc_blkdev.product, cid.pnm,
sizeof(mmc_blkdev.product));
cid.mid, cid.oid, cid.psn);
strncpy((char *)mmc_blkdev.product, cid.pnm,
sizeof(mmc_blkdev.product));
@@
-520,7
+520,7
@@
int mmc_init(int verbose)
mmc_blkdev.blksz = 512;
mmc_blkdev.lba = (csd.c_size + 1) * (1 << (csd.c_size_mult + 2));
mmc_blkdev.blksz = 512;
mmc_blkdev.lba = (csd.c_size + 1) * (1 << (csd.c_size_mult + 2));
- mci_set_mode(C
FG
_MMC_CLK_PP, mmc_blkdev.blksz);
+ mci_set_mode(C
ONFIG_SYS
_MMC_CLK_PP, mmc_blkdev.blksz);
#if 0
if (fat_register_device(&mmc_blkdev, 1))
#if 0
if (fat_register_device(&mmc_blkdev, 1))
@@
-531,18
+531,3
@@
int mmc_init(int verbose)
return 0;
}
return 0;
}
-
-int mmc_read(ulong src, uchar *dst, int size)
-{
- return -ENOSYS;
-}
-
-int mmc_write(uchar *src, ulong dst, int size)
-{
- return -ENOSYS;
-}
-
-int mmc2info(ulong addr)
-{
- return 0;
-}