]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/linux/mmc/sh_mmcif.h
Merge branches 'sh/memchunk' and 'common/mmcif' into sh-latest
[mv-sheeva.git] / include / linux / mmc / sh_mmcif.h
index 44fc5348fd5d7c33dec9f28f1c3227904f8776c1..bf173502d74418784c0c12128b43419a1242ceb3 100644 (file)
@@ -104,6 +104,9 @@ static inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val)
 
 #define SH_MMCIF_BBS 512 /* boot block size */
 
+enum { MMCIF_PROGRESS_ENTER, MMCIF_PROGRESS_INIT,
+       MMCIF_PROGRESS_LOAD, MMCIF_PROGRESS_DONE };
+
 static inline void sh_mmcif_boot_cmd_send(void __iomem *base,
                                          unsigned long cmd, unsigned long arg)
 {
@@ -166,6 +169,17 @@ static inline int sh_mmcif_boot_do_read(void __iomem *base,
        unsigned long k;
        int ret = 0;
 
+       /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */
+       sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL,
+                       CLK_ENABLE | CLKDIV_4 | SRSPTO_256 |
+                       SRBSYTO_29 | SRWDTO_29 | SCCSTO_29);
+
+       /* CMD9 - Get CSD */
+       sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000);
+
+       /* CMD7 - Select the card */
+       sh_mmcif_boot_cmd(base, 0x07400000, 0x00010000);
+
        /* CMD16 - Set the block size */
        sh_mmcif_boot_cmd(base, 0x10400000, SH_MMCIF_BBS);
 
@@ -209,27 +223,4 @@ static inline void sh_mmcif_boot_init(void __iomem *base)
        sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000);
 }
 
-static inline void sh_mmcif_boot_slurp(void __iomem *base,
-                                      unsigned char *buf,
-                                      unsigned long no_bytes)
-{
-       unsigned long tmp;
-
-       /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */
-       sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL,
-                       CLK_ENABLE | CLKDIV_4 | SRSPTO_256 |
-                       SRBSYTO_29 | SRWDTO_29 | SCCSTO_29);
-
-       /* CMD9 - Get CSD */
-       sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000);
-
-       /* CMD7 - Select the card */
-       sh_mmcif_boot_cmd(base, 0x07400000, 0x00010000);
-
-       tmp = no_bytes / SH_MMCIF_BBS;
-       tmp += (no_bytes % SH_MMCIF_BBS) ? 1 : 0;
-
-       sh_mmcif_boot_do_read(base, 512, tmp, buf);
-}
-
 #endif /* __SH_MMCIF_H__ */