Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255193
b: refs/heads/master
c: b86d825
h: refs/heads/master
i:
  255191: f90ca04
v: v3
  • Loading branch information
James Hogan authored and Chris Ball committed Jul 20, 2011
1 parent f19fd03 commit fe66fc6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 892b1e312b179139026e366a9d70065a7f897dbc
refs/heads/master: b86d825323b4c5d0c406e5b1a85af614acf0cf5a
23 changes: 18 additions & 5 deletions trunk/drivers/mmc/host/dw_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,8 +1116,8 @@ static void dw_mci_write_data_pio(struct dw_mci *host)
unsigned int nbytes = 0, len;

do {
len = SDMMC_FIFO_SZ -
(SDMMC_GET_FCNT(mci_readl(host, STATUS)) << shift);
len = (host->fifo_depth -
SDMMC_GET_FCNT(mci_readl(host, STATUS))) << shift;
if (offset + len <= sg->length) {
host->push_data(host, (void *)(buf + offset), len);

Expand Down Expand Up @@ -1659,8 +1659,19 @@ static int dw_mci_probe(struct platform_device *pdev)
* FIFO threshold settings RxMark = fifo_size / 2 - 1,
* Tx Mark = fifo_size / 2 DMA Size = 8
*/
fifo_size = mci_readl(host, FIFOTH);
fifo_size = (fifo_size >> 16) & 0x7ff;
if (!host->pdata->fifo_depth) {
/*
* Power-on value of RX_WMark is FIFO_DEPTH-1, but this may
* have been overwritten by the bootloader, just like we're
* about to do, so if you know the value for your hardware, you
* should put it in the platform data.
*/
fifo_size = mci_readl(host, FIFOTH);
fifo_size = 1 + ((fifo_size >> 16) & 0x7ff);
} else {
fifo_size = host->pdata->fifo_depth;
}
host->fifo_depth = fifo_size;
host->fifoth_val = ((0x2 << 28) | ((fifo_size/2 - 1) << 16) |
((fifo_size/2) << 0));
mci_writel(host, FIFOTH, host->fifoth_val);
Expand Down Expand Up @@ -1707,7 +1718,9 @@ static int dw_mci_probe(struct platform_device *pdev)
mci_writel(host, CTRL, SDMMC_CTRL_INT_ENABLE); /* Enable mci interrupt */

dev_info(&pdev->dev, "DW MMC controller at irq %d, "
"%d bit host data width\n", irq, width);
"%d bit host data width, "
"%u deep fifo\n",
irq, width, fifo_size);
if (host->quirks & DW_MCI_QUIRK_IDMAC_DTO)
dev_info(&pdev->dev, "Internal DMAC interrupt fix enabled.\n");

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/mmc/host/dw_mmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
#define SDMMC_CMD_INDX(n) ((n) & 0x1F)
/* Status register defines */
#define SDMMC_GET_FCNT(x) (((x)>>17) & 0x1FF)
#define SDMMC_FIFO_SZ 32
/* Internal DMAC interrupt defines */
#define SDMMC_IDMAC_INT_AI BIT(9)
#define SDMMC_IDMAC_INT_NI BIT(8)
Expand Down
8 changes: 8 additions & 0 deletions trunk/include/linux/mmc/dw_mmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ struct mmc_data;
* @pdev: Platform device associated with the MMC controller.
* @pdata: Platform data associated with the MMC controller.
* @slot: Slots sharing this MMC controller.
* @fifo_depth: depth of FIFO.
* @data_shift: log2 of FIFO item size.
* @push_data: Pointer to FIFO push function.
* @pull_data: Pointer to FIFO pull function.
Expand Down Expand Up @@ -146,6 +147,7 @@ struct dw_mci {
struct dw_mci_slot *slot[MAX_MCI_SLOTS];

/* FIFO push and pull */
int fifo_depth;
int data_shift;
void (*push_data)(struct dw_mci *host, void *buf, int cnt);
void (*pull_data)(struct dw_mci *host, void *buf, int cnt);
Expand Down Expand Up @@ -196,6 +198,12 @@ struct dw_mci_board {
unsigned int bus_hz; /* Bus speed */

unsigned int caps; /* Capabilities */
/*
* Override fifo depth. If 0, autodetect it from the FIFOTH register,
* but note that this may not be reliable after a bootloader has used
* it.
*/
unsigned int fifo_depth;

/* delay in mS before detecting cards after interrupt */
u32 detect_delay_ms;
Expand Down

0 comments on commit fe66fc6

Please sign in to comment.