Commit 78ed3204 authored by Bernard Blackham's avatar Bernard Blackham Committed by Kevin Hilman

DaVinci SD/MMC patch for git (take 2)

This is a forward port of the SD/MMC driver from the latest LSP,
melded into linux-2.6.23-git. I've tried to keep the style updates
that were merged recently. I've fixed the exit code (in
davinci_mmcsd_exit) to release clocks, and some failure paths in
davinci_mmcsd_init.

The driver as is performs ~6MB/s reads and ~1MB/s writes with a
block size of 512k (i.e. still needs help!). This patch just makes
the driver usable again.
Signed-off-by: default avatarBernard Blackham <bernard@largestprime.net>
Signed-off-by: default avatarKevin Hilman <khilman@mvista.com>
parent 5eff1f91
This diff is collapsed.
...@@ -132,6 +132,7 @@ struct mmc_davinci_host { ...@@ -132,6 +132,7 @@ struct mmc_davinci_host {
int power_pin; int power_pin;
int use_dma; int use_dma;
int do_dma;
struct completion dma_completion; struct completion dma_completion;
struct timer_list timer; struct timer_list timer;
...@@ -143,10 +144,16 @@ struct mmc_davinci_host { ...@@ -143,10 +144,16 @@ struct mmc_davinci_host {
edma_ch_mmcsd edma_ch_details; edma_ch_mmcsd edma_ch_details;
unsigned int sg_len;
int sg_idx;
unsigned int buffer_bytes_left;
unsigned int dma_len;
int dma_state;
}; };
typedef struct { typedef struct {
unsigned short rw_threshold; unsigned short rw_threshold;
unsigned short use_dma; unsigned short use_dma;
unsigned short use_4bit_mode;
} mmcsd_config_def; } mmcsd_config_def;
typedef enum { typedef enum {
...@@ -168,4 +175,20 @@ typedef enum { ...@@ -168,4 +175,20 @@ typedef enum {
#define MMCSD_EVENT_ERROR \ #define MMCSD_EVENT_ERROR \
(MMCSD_EVENT_TIMEOUT_ERROR | MMCSD_EVENT_CRC_ERROR) (MMCSD_EVENT_TIMEOUT_ERROR | MMCSD_EVENT_CRC_ERROR)
static void init_mmcsd_host(void);
static void davinci_fifo_data_trans(struct mmc_davinci_host *host);
static void mmc_davinci_sg_to_buf(struct mmc_davinci_host *host);
static int mmc_davinci_send_dma_request(struct mmc_davinci_host *host,
struct mmc_request *req);
static void mmc_davinci_xfer_done(struct mmc_davinci_host *host,
struct mmc_data *data);
static int mmc_davinci_get_ro(struct mmc_host *mmc);
static void davinci_abort_dma(struct mmc_davinci_host *host);
#endif /* DAVINCI_MMC_H_ */ #endif /* DAVINCI_MMC_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment