URL
https://opencores.org/ocsvn/test_project/test_project/trunk
Subversion Repositories test_project
Compare Revisions
- This comparison shows the changes necessary to convert path
/test_project
- from Rev 69 to Rev 70
- ↔ Reverse comparison
Rev 69 → Rev 70
/trunk/linux_sd_driver/drivers/mmc/host/mmc_ocores.c
36,12 → 36,8
|
#define NR_SG 1 |
|
struct ocores_registers |
{ |
unsigned int normal_int_status; |
unsigned int error_int_status; |
}; |
|
|
struct ocores_host { |
struct mmc_host *mmc; |
spinlock_t lock; |
88,8 → 84,6
unsigned int cmd_arg, cmd_command=0; |
|
//struct mmc_data *data = cmd->data; |
|
|
//WARN_ON(host->cmd != NULL); |
host->cmd = cmd; |
|
96,39 → 90,39
//Set up command |
cmd_arg = cmd->arg; |
cmd_command |= cmd->opcode << 8; |
|
cmd_command |= host->word_cnt << 6; |
|
if ( mmc_resp_type(cmd) == MMC_RSP_CRC ) |
cmd_command |= CRCE; |
if ( mmc_resp_type(cmd) == MMC_RSP_OPCODE ) |
cmd_command |= CICE; |
|
switch (mmc_resp_type(cmd)) { |
case MMC_RSP_NONE: |
cmd_command |= MMCOC_RSP_NONE; |
case MMC_RSP_NONE: |
cmd_command |= MMCOC_RSP_NONE; |
break; |
case MMC_RSP_R1: |
cmd_command |= MMCOC_RSP_48; |
case MMC_RSP_R1: |
cmd_command |= MMCOC_RSP_48; |
break; |
case MMC_RSP_R1B: |
cmd_command |= MMCOC_RSP_48; |
case MMC_RSP_R1B: |
cmd_command |= MMCOC_RSP_48; |
break; |
case MMC_RSP_R2: |
cmd_command |= MMCOC_RSP_136; |
case MMC_RSP_R2: |
cmd_command |= MMCOC_RSP_136; |
break; |
case MMC_RSP_R3: |
cmd_command |= MMCOC_RSP_48; |
case MMC_RSP_R3: |
cmd_command |= MMCOC_RSP_48; |
break; |
|
default: |
default: |
printk(KERN_INFO "mmc_ocores: unhandled response type %02x\n", |
mmc_resp_type(cmd)); |
} |
|
if ( mmc_resp_type(cmd) == MMC_RSP_CRC ) |
cmd_command |= CRCE; |
if ( mmc_resp_type(cmd) == MMC_RSP_OPCODE ) |
cmd_command |= CICE; |
|
|
printk(KERN_ALERT "%s: cmd_arg = %08x\n", __FUNCTION__, cmd_arg); |
printk(KERN_ALERT "%s: cmd_command = %08x\n", __FUNCTION__, cmd_command); |
|
CMD_IRQ_ON (host,ECC); |
oc_host=host; |
|
CMD_IRQ_ON (host,(ECC|EEI)); |
writel(cmd_command, host->base + SD_COMMAND); |
wmb(); |
writel(cmd_arg, host->base + SD_ARG); |
136,7 → 130,8
} |
|
static void ocores_process_next(struct ocores_host *host) |
{ |
{ |
host->word_cnt=0; |
if (!(host->flags & FL_SENT_COMMAND)) { |
host->flags |= FL_SENT_COMMAND; |
ocores_start_cmd(host, host->mrq->cmd); |
221,25 → 216,24
|
static irqreturn_t ocores_irq_cmd(int irq, void *devid) |
{ |
struct ocores_host *host = oc_host; |
|
disable_irq(host->irq_cmd); |
|
//printk(KERN_ALERT "%s: IRQ START***** Normal In = %08x\n", __FUNCTION__, readl(host->base + SD_NORMAL_INT_STATUS)); |
|
host->registers.normal_int_status = readl(host->base + SD_NORMAL_INT_STATUS); |
rmb(); |
host->registers.error_int_status = readl(host->base + SD_ERROR_INT_STATUS); |
|
writel(0,host->base + SD_NORMAL_INT_STATUS); |
writel(0,host->base + SD_ERROR_INT_STATUS); |
|
printk(KERN_ALERT "%s: IRQ END***** Error In = %08x\n", __FUNCTION__, readl(host->base + SD_ERROR_INT_STATUS)); |
tasklet_schedule(&host->finish_cmd); |
CMD_IRQ_OFF (host,ECC); |
enable_irq(host->irq_cmd); |
|
return IRQ_HANDLED; |
struct ocores_host *host = oc_host; |
|
disable_irq(host->irq_cmd); |
|
//printk(KERN_ALERT "%s: IRQ START***** Normal In = %08x\n", __FUNCTION__, readl(host->base + SD_NORMAL_INT_STATUS)); |
|
host->registers.normal_int_status = readl(host->base + SD_NORMAL_INT_STATUS); |
rmb(); |
host->registers.error_int_status = readl(host->base + SD_ERROR_INT_STATUS); |
|
writel(0,host->base + SD_NORMAL_INT_STATUS); |
writel(0,host->base + SD_ERROR_INT_STATUS); |
|
//printk(KERN_ALERT "%s: IRQ END***** Error In = %08x\n", __FUNCTION__, readl(host->base + SD_ERROR_INT_STATUS)); |
tasklet_schedule(&host->finish_cmd); |
CMD_IRQ_OFF (host,(ECC|EEI)); |
enable_irq(host->irq_cmd); |
return IRQ_HANDLED; |
} |
|
static irqreturn_t ocores_irq_dat(int irq, void *dev_id) |
384,14 → 378,42
} |
} |
else |
{ |
host->mrq->cmd->error = 0 ; |
host->mrq->cmd->resp[0] = readl(host->base + SD_RESP1); |
printk(KERN_ALERT " CMD RSP * = %08x\n", host->mrq->cmd->resp[0]); |
{ |
if ( mmc_resp_type(host->mrq->cmd) == MMCOC_RSP_136 ) //Long response |
{ |
printk(KERN_ALERT "Long Response, Word Cnt * = %08x\n ",host->word_cnt); |
host->word_cnt+=1; |
switch(host->word_cnt-1) |
{ |
case (0): |
host->mrq->cmd->resp[3] = readl(host->base + SD_RESP1); |
ocores_start_cmd(host, host->mrq->cmd); |
break; |
case (1): |
host->mrq->cmd->resp[2] = readl(host->base + SD_RESP1); |
ocores_start_cmd(host, host->mrq->cmd); |
break; |
case (2): |
host->mrq->cmd->resp[1] = readl(host->base + SD_RESP1); |
ocores_start_cmd(host, host->mrq->cmd); |
break; |
case (3): |
host->mrq->cmd->resp[0] = readl(host->base + SD_RESP1); |
mmc_request_done(host->mmc, host->mrq); |
break; |
} |
} |
else //Short response |
{ |
host->mrq->cmd->error = 0 ; |
host->mrq->cmd->resp[0] = readl(host->base + SD_RESP1); |
printk(KERN_ALERT "Short Response CMD RSP * = %08x\n", host->mrq->cmd->resp[0]); |
mmc_request_done(host->mmc, host->mrq); |
} |
} |
|
mmc_request_done(host->mmc, host->mrq); |
|
|
} |
|
static int ocores_remove(struct platform_device *pdev) |