diff options
Diffstat (limited to 'drivers/mci/atmel_mci_common.c')
-rw-r--r-- | drivers/mci/atmel_mci_common.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/mci/atmel_mci_common.c b/drivers/mci/atmel_mci_common.c index 5c9e6f9c4d..7b11e9134e 100644 --- a/drivers/mci/atmel_mci_common.c +++ b/drivers/mci/atmel_mci_common.c @@ -68,7 +68,17 @@ static void atmci_set_clk_rate(struct atmel_mci *host, clock_min, host->bus_hz / (2 * 256)); clkdiv = 255; } - host->mode_reg = ATMCI_MR_CLKDIV(clkdiv); + + /* + * Older Atmels without CLKODD have the block length + * in the upper 16 bits of both MCI_MR and MCI_BLKR + * + * To avoid intermittent zeroing of the block length, + * just hardcode 512 here and have atmci_setup_data() + * change it as necessary. + */ + + host->mode_reg = ATMCI_MR_CLKDIV(clkdiv) | ATMCI_BLKLEN(512); } dev_dbg(host->hw_dev, "atmel_set_clk_rate: clkIn=%ld clkIos=%d divider=%d\n", @@ -90,8 +100,8 @@ static int atmci_poll_status(struct atmel_mci *host, u32 mask) u32 stat; int ret; - ret = read_poll_timeout(atmci_readl, stat, (stat & mask), SECOND, host, - ATMCI_SR); + ret = read_poll_timeout(atmci_readl, stat, (stat & mask), USEC_PER_SEC, + host, ATMCI_SR); if (ret < 0) { dev_err(host->hw_dev, "timeout\n"); host->need_reset = true; @@ -220,7 +230,7 @@ static void atmci_setup_data(struct atmel_mci *host, struct mci_data *data) host->data = data; - dev_dbg(host->hw_dev, "atmel_setup_data: nob=%d blksz=%d\n", + dev_vdbg(host->hw_dev, "atmel_setup_data: nob=%d blksz=%d\n", nob, blksz); atmci_writel(host, ATMCI_BLKR, ATMCI_BCNT(nob) @@ -315,7 +325,7 @@ static int atmci_start_cmd(struct atmel_mci *host, struct mci_cmd *cmd, flags |= ATMCI_CMDR_RSPTYP_NONE; break; default: - dev_err(host->hw_dev, "unhandled response type 0x%x\n", + dev_dbg(host->hw_dev, "unhandled response type 0x%x\n", cmd->resp_type); return -EINVAL; } @@ -329,7 +339,7 @@ static int atmci_start_cmd(struct atmel_mci *host, struct mci_cmd *cmd, } /** init the host interface */ -int atmci_reset(struct mci_host *mci, struct device_d *mci_dev) +int atmci_reset(struct mci_host *mci, struct device *mci_dev) { struct atmel_mci *host = to_mci_host(mci); @@ -437,7 +447,7 @@ void atmci_get_cap(struct atmel_mci *host) version = atmci_readl(host, ATMCI_VERSION) & 0x00000fff; host->version = version; - dev_info(host->hw_dev, "version: 0x%x\n", version); + dev_dbg(host->hw_dev, "version: 0x%x\n", version); host->caps.has_cfg_reg = 0; host->caps.has_highspeed = 0; |