diff options
author | Simon Horman <horms@verge.net.au> | 2010-12-05 19:12:45 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-12-08 02:24:28 -0500 |
commit | 54b384634f7083bcacf9a9ed2e6f4c3d0a246e49 (patch) | |
tree | 51a37b9fc454ff9e5fced781e433a23ccc3d11d7 | |
parent | 9f843706bb87837b823228467f4f83973fd110e9 (diff) |
mmc, sh: Remove sh_mmcif_boot_slurp()
As the only caller of sh_mmcif_boot_do_read() is
sh_mmcif_boot_slurp() the configuration portion of
sh_mmcif_boot_slurp() can be merged into sh_mmcif_boot_do_read().
Once this is done sh_mmcif_boot_slurp() is only a call
to sh_mmcif_boot_do_read() with platform specific information -
the offset that images are stored on MMC. So make the
sh_mmcif_boot_do_read() call directly from platform code
and remove sh_mmcif_boot_slurp() altogether.
Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/boot/romimage/mmcif-sh7724.c | 4 | ||||
-rw-r--r-- | include/linux/mmc/sh_mmcif.h | 34 |
2 files changed, 14 insertions, 24 deletions
diff --git a/arch/sh/boot/romimage/mmcif-sh7724.c b/arch/sh/boot/romimage/mmcif-sh7724.c index 16b9c6fa7de..c84e7831018 100644 --- a/arch/sh/boot/romimage/mmcif-sh7724.c +++ b/arch/sh/boot/romimage/mmcif-sh7724.c | |||
@@ -60,7 +60,9 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long no_bytes) | |||
60 | mmcif_update_progress(MMCIF_PROGRESS_LOAD); | 60 | mmcif_update_progress(MMCIF_PROGRESS_LOAD); |
61 | 61 | ||
62 | /* load kernel via MMCIF interface */ | 62 | /* load kernel via MMCIF interface */ |
63 | sh_mmcif_boot_slurp(MMCIF_BASE, buf, no_bytes); | 63 | sh_mmcif_boot_do_read(MMCIF_BASE, 512, |
64 | (no_bytes + SH_MMCIF_BBS - 1) / SH_MMCIF_BBS, | ||
65 | buf); | ||
64 | 66 | ||
65 | /* disable clock to the MMCIF hardware block */ | 67 | /* disable clock to the MMCIF hardware block */ |
66 | __raw_writel(__raw_readl(MSTPCR2) | 0x20000000, MSTPCR2); | 68 | __raw_writel(__raw_readl(MSTPCR2) | 0x20000000, MSTPCR2); |
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h index 6a98e97c49f..cfcc6e320e2 100644 --- a/include/linux/mmc/sh_mmcif.h +++ b/include/linux/mmc/sh_mmcif.h | |||
@@ -162,6 +162,17 @@ static inline int sh_mmcif_boot_do_read(void __iomem *base, | |||
162 | unsigned long k; | 162 | unsigned long k; |
163 | int ret = 0; | 163 | int ret = 0; |
164 | 164 | ||
165 | /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */ | ||
166 | sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, | ||
167 | CLK_ENABLE | CLKDIV_4 | SRSPTO_256 | | ||
168 | SRBSYTO_29 | SRWDTO_29 | SCCSTO_29); | ||
169 | |||
170 | /* CMD9 - Get CSD */ | ||
171 | sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000); | ||
172 | |||
173 | /* CMD7 - Select the card */ | ||
174 | sh_mmcif_boot_cmd(base, 0x07400000, 0x00010000); | ||
175 | |||
165 | /* CMD16 - Set the block size */ | 176 | /* CMD16 - Set the block size */ |
166 | sh_mmcif_boot_cmd(base, 0x10400000, SH_MMCIF_BBS); | 177 | sh_mmcif_boot_cmd(base, 0x10400000, SH_MMCIF_BBS); |
167 | 178 | ||
@@ -205,27 +216,4 @@ static inline void sh_mmcif_boot_init(void __iomem *base) | |||
205 | sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); | 216 | sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); |
206 | } | 217 | } |
207 | 218 | ||
208 | static inline void sh_mmcif_boot_slurp(void __iomem *base, | ||
209 | unsigned char *buf, | ||
210 | unsigned long no_bytes) | ||
211 | { | ||
212 | unsigned long tmp; | ||
213 | |||
214 | /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */ | ||
215 | sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, | ||
216 | CLK_ENABLE | CLKDIV_4 | SRSPTO_256 | | ||
217 | SRBSYTO_29 | SRWDTO_29 | SCCSTO_29); | ||
218 | |||
219 | /* CMD9 - Get CSD */ | ||
220 | sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000); | ||
221 | |||
222 | /* CMD7 - Select the card */ | ||
223 | sh_mmcif_boot_cmd(base, 0x07400000, 0x00010000); | ||
224 | |||
225 | tmp = no_bytes / SH_MMCIF_BBS; | ||
226 | tmp += (no_bytes % SH_MMCIF_BBS) ? 1 : 0; | ||
227 | |||
228 | sh_mmcif_boot_do_read(base, 512, tmp, buf); | ||
229 | } | ||
230 | |||
231 | #endif /* __SH_MMCIF_H__ */ | 219 | #endif /* __SH_MMCIF_H__ */ |