mmc: host: rk_sdmmc: prepare for next Soc(s)
authorlintao <lintao@rock-chips.com>
Mon, 7 Jul 2014 08:41:49 +0000 (16:41 +0800)
committerlintao <lintao@rock-chips.com>
Mon, 7 Jul 2014 08:43:00 +0000 (16:43 +0800)
fix edma slave config phy regs

drivers/mmc/host/dw_mmc-pltfm.c
drivers/mmc/host/rk_sdmmc.c
include/linux/mmc/rk_mmc.h

index 93fc6a725dbae14e8a82964ea916097af0a6696b..527b2c8d86fdf259676880e2b0d04ab832406c6f 100755 (executable)
@@ -49,6 +49,9 @@ int dw_mci_pltfm_register(struct platform_device *pdev,
        host->irq_flags = 0;
        host->pdata = pdev->dev.platform_data;
        host->regs = devm_ioremap_resource(&pdev->dev, regs);
+        #ifdef CONFIG_MMC_DW_EDMAC
+        host->phy_regs = (void *)(regs->start);
+        #endif
        if (IS_ERR(host->regs))
                return PTR_ERR(host->regs);
 
index 634e88644f5cb7a433814a0d55a0a76d7fe44d6a..1bba0bfd8377adcc41343489d30a31abf7365a75 100755 (executable)
@@ -618,7 +618,7 @@ static void dw_mci_edmac_start_dma(struct dw_mci *host, unsigned int sg_len)
         int ret = 0;
 
         /* Set external dma config: burst size, burst width*/
-        slave_config.dst_addr = (dma_addr_t)(host->regs + host->data_offset);
+        slave_config.dst_addr = (dma_addr_t)(host->phy_regs + host->data_offset);
         slave_config.src_addr = slave_config.dst_addr;
         slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
         slave_config.src_addr_width = slave_config.dst_addr_width;
@@ -678,6 +678,7 @@ static int dw_mci_edmac_init(struct dw_mci *host)
                                 (unsigned int)(rockchip_soc_id & ROCKCHIP_CPU_MASK), mmc_hostname(host->mmc));
 
         /* 1) request external dma channel, SHOULD decide chn in dts */
+        host->dms = (struct dw_mci_dma_slave *)kmalloc(sizeof(struct dw_mci_dma_slave),GFP_KERNEL);
         host->dms->ch = dma_request_slave_channel(host->dev, "dw_mci");
         if (!host->dms->ch){
                 dev_err(host->dev, "Failed to get external DMA channel: channel id = %d\n",
@@ -1493,7 +1494,6 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
        else
                present = (mci_readl(slot->host, CDETECT) & (1 << slot->id))
                        == 0 ? 1 : 0;
-
        spin_lock_bh(&host->lock);
        if (present) {
                set_bit(DW_MMC_CARD_PRESENT, &slot->flags);
index abf91d0e9d86e088182764f4ad25cd9b30fef001..a54c31dab5d0944d431ec4ca809cd43e8d7d7af4 100755 (executable)
@@ -157,6 +157,7 @@ struct dw_mci {
 
 #ifdef CONFIG_MMC_DW_EDMAC
         struct dw_mci_dma_slave *dms;
+       void                    *phy_regs;
 #endif
        u32                     cmd_status;
        u32                     data_status;