From: Hans de Goede <[email protected]>

Signed-off-by: Hans de Goede <[email protected]>
[[email protected]: use setbits_le32 for reset control, drop obsolete changes,
                squash "sunxi-mmc: sun6i has its fifo at a different address"]
Signed-off-by: Chen-Yu Tsai <[email protected]>
---
 arch/arm/include/asm/arch-sunxi/mmc.h | 2 --
 drivers/mmc/sunxi_mmc.c               | 9 +++++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-sunxi/mmc.h 
b/arch/arm/include/asm/arch-sunxi/mmc.h
index 53196e3..bafde4b 100644
--- a/arch/arm/include/asm/arch-sunxi/mmc.h
+++ b/arch/arm/include/asm/arch-sunxi/mmc.h
@@ -42,8 +42,6 @@ struct sunxi_mmc {
        u32 idie;               /* 0x8c internal DMA interrupt enable */
        u32 chda;               /* 0x90 */
        u32 cbda;               /* 0x94 */
-       u32 res1[26];
-       u32 fifo;               /* 0x100 FIFO access address */
 };
 
 #define SUNXI_MMC_CLK_POWERSAVE                (0x1 << 17)
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index d4e574f..b035bba 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -57,7 +57,11 @@ static int mmc_resource_init(int sdc_no)
                printf("Wrong mmc number %d\n", sdc_no);
                return -1;
        }
+#ifdef CONFIG_SUN6I
+       mmchost->database = (unsigned int)mmchost->reg + 0x200;
+#else
        mmchost->database = (unsigned int)mmchost->reg + 0x100;
+#endif
        mmchost->mmc_no = sdc_no;
 
        return 0;
@@ -75,6 +79,11 @@ static int mmc_clk_io_on(int sdc_no)
        /* config ahb clock */
        setbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_MMC(sdc_no));
 
+#if defined(CONFIG_SUN6I)
+       /* unassert reset */
+       setbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_RESET_OFFSET_MMC(sdc_no));
+#endif
+
        /* config mod clock */
        pll_clk = clock_get_pll6();
        /* should be close to 100 MHz but no more, so round up */
-- 
2.1.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to