Commit 9d9659b6 authored by Simon Horman's avatar Simon Horman Committed by Paul Mundt

mmc: Add MMC_PROGRESS_*

This is my second attempt to make this enum generally available.
The first attempt added MMCIF_PROGRESS_* to include/linux/mmc/sh_mmcif.h.
However this is not sufficiently generic as the enum will be
used by SDHI boot code.
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent a6558c2d
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
*/ */
#include <linux/mmc/sh_mmcif.h> #include <linux/mmc/sh_mmcif.h>
#include <linux/mmc/boot.h>
#include <mach/mmc.h> #include <mach/mmc.h>
#define MMCIF_BASE (void __iomem *)0xe6bd0000 #define MMCIF_BASE (void __iomem *)0xe6bd0000
...@@ -42,7 +43,7 @@ ...@@ -42,7 +43,7 @@
asmlinkage void mmcif_loader(unsigned char *buf, unsigned long len) asmlinkage void mmcif_loader(unsigned char *buf, unsigned long len)
{ {
mmc_init_progress(); mmc_init_progress();
mmc_update_progress(MMCIF_PROGRESS_ENTER); mmc_update_progress(MMC_PROGRESS_ENTER);
/* Initialise MMC /* Initialise MMC
* registers: PORT84CR-PORT92CR * registers: PORT84CR-PORT92CR
...@@ -68,12 +69,12 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long len) ...@@ -68,12 +69,12 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long len)
/* Enable clock to MMC hardware block */ /* Enable clock to MMC hardware block */
__raw_writel(__raw_readl(SMSTPCR3) & ~(1 << 12), SMSTPCR3); __raw_writel(__raw_readl(SMSTPCR3) & ~(1 << 12), SMSTPCR3);
mmc_update_progress(MMCIF_PROGRESS_INIT); mmc_update_progress(MMC_PROGRESS_INIT);
/* setup MMCIF hardware */ /* setup MMCIF hardware */
sh_mmcif_boot_init(MMCIF_BASE); sh_mmcif_boot_init(MMCIF_BASE);
mmc_update_progress(MMCIF_PROGRESS_LOAD); mmc_update_progress(MMC_PROGRESS_LOAD);
/* load kernel via MMCIF interface */ /* load kernel via MMCIF interface */
sh_mmcif_boot_do_read(MMCIF_BASE, 2, /* Kernel is at block 2 */ sh_mmcif_boot_do_read(MMCIF_BASE, 2, /* Kernel is at block 2 */
...@@ -83,5 +84,5 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long len) ...@@ -83,5 +84,5 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long len)
/* Disable clock to MMC hardware block */ /* Disable clock to MMC hardware block */
__raw_writel(__raw_readl(SMSTPCR3) & (1 << 12), SMSTPCR3); __raw_writel(__raw_readl(SMSTPCR3) & (1 << 12), SMSTPCR3);
mmc_update_progress(MMCIF_PROGRESS_DONE); mmc_update_progress(MMC_PROGRESS_DONE);
} }
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include <linux/mmc/sh_mmcif.h> #include <linux/mmc/sh_mmcif.h>
#include <linux/mmc/boot.h>
#include <mach/romimage.h> #include <mach/romimage.h>
#define MMCIF_BASE (void __iomem *)0xa4ca0000 #define MMCIF_BASE (void __iomem *)0xa4ca0000
...@@ -29,7 +30,7 @@ ...@@ -29,7 +30,7 @@
*/ */
asmlinkage void mmcif_loader(unsigned char *buf, unsigned long no_bytes) asmlinkage void mmcif_loader(unsigned char *buf, unsigned long no_bytes)
{ {
mmcif_update_progress(MMCIF_PROGRESS_ENTER); mmcif_update_progress(MMC_PROGRESS_ENTER);
/* enable clock to the MMCIF hardware block */ /* enable clock to the MMCIF hardware block */
__raw_writel(__raw_readl(MSTPCR2) & ~0x20000000, MSTPCR2); __raw_writel(__raw_readl(MSTPCR2) & ~0x20000000, MSTPCR2);
...@@ -52,12 +53,12 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long no_bytes) ...@@ -52,12 +53,12 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long no_bytes)
/* high drive capability for MMC pins */ /* high drive capability for MMC pins */
__raw_writew(__raw_readw(DRVCRA) | 0x3000, DRVCRA); __raw_writew(__raw_readw(DRVCRA) | 0x3000, DRVCRA);
mmcif_update_progress(MMCIF_PROGRESS_INIT); mmcif_update_progress(MMC_PROGRESS_INIT);
/* setup MMCIF hardware */ /* setup MMCIF hardware */
sh_mmcif_boot_init(MMCIF_BASE); sh_mmcif_boot_init(MMCIF_BASE);
mmcif_update_progress(MMCIF_PROGRESS_LOAD); mmcif_update_progress(MMC_PROGRESS_LOAD);
/* load kernel via MMCIF interface */ /* load kernel via MMCIF interface */
sh_mmcif_boot_do_read(MMCIF_BASE, 512, sh_mmcif_boot_do_read(MMCIF_BASE, 512,
...@@ -67,5 +68,5 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long no_bytes) ...@@ -67,5 +68,5 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long no_bytes)
/* disable clock to the MMCIF hardware block */ /* disable clock to the MMCIF hardware block */
__raw_writel(__raw_readl(MSTPCR2) | 0x20000000, MSTPCR2); __raw_writel(__raw_readl(MSTPCR2) | 0x20000000, MSTPCR2);
mmcif_update_progress(MMCIF_PROGRESS_DONE); mmcif_update_progress(MMC_PROGRESS_DONE);
} }
#ifndef MMC_BOOT_H
#define MMC_BOOT_H
enum { MMC_PROGRESS_ENTER, MMC_PROGRESS_INIT,
MMC_PROGRESS_LOAD, MMC_PROGRESS_DONE };
#endif
...@@ -104,9 +104,6 @@ static inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val) ...@@ -104,9 +104,6 @@ static inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val)
#define SH_MMCIF_BBS 512 /* boot block size */ #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, static inline void sh_mmcif_boot_cmd_send(void __iomem *base,
unsigned long cmd, unsigned long arg) unsigned long cmd, unsigned long arg)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment