* mmc: zboot helpers
@ 2011-03-24 7:04 Simon Horman
2011-03-24 7:04 ` [PATCH 1/2] mmc, ARM: Rename SuperH Mobile ARM " Simon Horman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Simon Horman @ 2011-03-24 7:04 UTC (permalink / raw)
To: linux-arm-kernel
[ repost as I included a bogus email address in my previous attempt ]
Hi Paul,
please consider merging the following two patches.
They are both pre-requisites for
"mmc, ARM: Add zboot from eSD support for SuperH Mobile ARM"
which I plan to submit to Russell King.
These patches were originally submitted in a for patch series
however they do not depend on any of the other patches in the series
so I am posting them independently.
These patches apply against Linus's current tree
and I am not aware of any particular prerequisites for them
other than that the 2nd patch depends on the 1st one.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] mmc, ARM: Rename SuperH Mobile ARM zboot helpers
2011-03-24 7:04 mmc: zboot helpers Simon Horman
@ 2011-03-24 7:04 ` Simon Horman
2011-03-24 7:04 ` [PATCH 2/2] mmc: Add MMC_PROGRESS_* Simon Horman
2011-03-24 16:27 ` mmc: zboot helpers Paul Mundt
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2011-03-24 7:04 UTC (permalink / raw)
To: linux-arm-kernel
These headers and helpers will also be used for SDHI boot
so the mmcif name will start to make a lot less sense.
Signed-off-by: Simon Horman <horms@verge.net.au>
---
arch/arm/boot/compressed/mmcif-sh7372.c | 12 +++---
arch/arm/mach-shmobile/include/mach/mmc-ap4eb.h | 29 +++++++++++++++
arch/arm/mach-shmobile/include/mach/mmc-mackerel.h | 38 +++++++++++++++++++
arch/arm/mach-shmobile/include/mach/mmc.h | 18 +++++++++
arch/arm/mach-shmobile/include/mach/mmcif-ap4eb.h | 29 ---------------
.../mach-shmobile/include/mach/mmcif-mackerel.h | 39 --------------------
arch/arm/mach-shmobile/include/mach/mmcif.h | 18 ---------
7 files changed, 91 insertions(+), 92 deletions(-)
create mode 100644 arch/arm/mach-shmobile/include/mach/mmc-ap4eb.h
create mode 100644 arch/arm/mach-shmobile/include/mach/mmc-mackerel.h
create mode 100644 arch/arm/mach-shmobile/include/mach/mmc.h
delete mode 100644 arch/arm/mach-shmobile/include/mach/mmcif-ap4eb.h
delete mode 100644 arch/arm/mach-shmobile/include/mach/mmcif-mackerel.h
delete mode 100644 arch/arm/mach-shmobile/include/mach/mmcif.h
diff --git a/arch/arm/boot/compressed/mmcif-sh7372.c b/arch/arm/boot/compressed/mmcif-sh7372.c
index e6180af..28bcf3c 100644
--- a/arch/arm/boot/compressed/mmcif-sh7372.c
+++ b/arch/arm/boot/compressed/mmcif-sh7372.c
@@ -10,7 +10,7 @@
*/
#include <linux/mmc/sh_mmcif.h>
-#include <mach/mmcif.h>
+#include <mach/mmc.h>
#define MMCIF_BASE (void __iomem *)0xe6bd0000
@@ -41,8 +41,8 @@
*/
asmlinkage void mmcif_loader(unsigned char *buf, unsigned long len)
{
- mmcif_init_progress();
- mmcif_update_progress(MMCIF_PROGRESS_ENTER);
+ mmc_init_progress();
+ mmc_update_progress(MMCIF_PROGRESS_ENTER);
/* Initialise MMC
* registers: PORT84CR-PORT92CR
@@ -68,12 +68,12 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long len)
/* Enable clock to MMC hardware block */
__raw_writel(__raw_readl(SMSTPCR3) & ~(1 << 12), SMSTPCR3);
- mmcif_update_progress(MMCIF_PROGRESS_INIT);
+ mmc_update_progress(MMCIF_PROGRESS_INIT);
/* setup MMCIF hardware */
sh_mmcif_boot_init(MMCIF_BASE);
- mmcif_update_progress(MMCIF_PROGRESS_LOAD);
+ mmc_update_progress(MMCIF_PROGRESS_LOAD);
/* load kernel via MMCIF interface */
sh_mmcif_boot_do_read(MMCIF_BASE, 2, /* Kernel is at block 2 */
@@ -83,5 +83,5 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long len)
/* Disable clock to MMC hardware block */
__raw_writel(__raw_readl(SMSTPCR3) & (1 << 12), SMSTPCR3);
- mmcif_update_progress(MMCIF_PROGRESS_DONE);
+ mmc_update_progress(MMCIF_PROGRESS_DONE);
}
diff --git a/arch/arm/mach-shmobile/include/mach/mmc-ap4eb.h b/arch/arm/mach-shmobile/include/mach/mmc-ap4eb.h
new file mode 100644
index 0000000..db59fdb
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/mmc-ap4eb.h
@@ -0,0 +1,29 @@
+#ifndef MMC_AP4EB_H
+#define MMC_AP4EB_H
+
+#define PORT185CR (void __iomem *)0xe60520b9
+#define PORT186CR (void __iomem *)0xe60520ba
+#define PORT187CR (void __iomem *)0xe60520bb
+#define PORT188CR (void __iomem *)0xe60520bc
+
+#define PORTR191_160DR (void __iomem *)0xe6056014
+
+static inline void mmc_init_progress(void)
+{
+ /* Initialise LEDS1-4
+ * registers: PORT185CR-PORT188CR (LED1-LED4 Control)
+ * value: 0x10 - enable output
+ */
+ __raw_writeb(0x10, PORT185CR);
+ __raw_writeb(0x10, PORT186CR);
+ __raw_writeb(0x10, PORT187CR);
+ __raw_writeb(0x10, PORT188CR);
+}
+
+static inline void mmc_update_progress(int n)
+{
+ __raw_writel((__raw_readl(PORTR191_160DR) & ~(0xf << 25)) |
+ (1 << (25 + n)), PORTR191_160DR);
+}
+
+#endif /* MMC_AP4EB_H */
diff --git a/arch/arm/mach-shmobile/include/mach/mmc-mackerel.h b/arch/arm/mach-shmobile/include/mach/mmc-mackerel.h
new file mode 100644
index 0000000..15d3a9e
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/mmc-mackerel.h
@@ -0,0 +1,38 @@
+#ifndef MMC_MACKEREL_H
+#define MMC_MACKEREL_H
+
+#define PORT0CR (void __iomem *)0xe6051000
+#define PORT1CR (void __iomem *)0xe6051001
+#define PORT2CR (void __iomem *)0xe6051002
+#define PORT159CR (void __iomem *)0xe605009f
+
+#define PORTR031_000DR (void __iomem *)0xe6055000
+#define PORTL159_128DR (void __iomem *)0xe6054010
+
+static inline void mmc_init_progress(void)
+{
+ /* Initialise LEDS0-3
+ * registers: PORT0CR-PORT2CR,PORT159CR (LED0-LED3 Control)
+ * value: 0x10 - enable output
+ */
+ __raw_writeb(0x10, PORT0CR);
+ __raw_writeb(0x10, PORT1CR);
+ __raw_writeb(0x10, PORT2CR);
+ __raw_writeb(0x10, PORT159CR);
+}
+
+static inline void mmc_update_progress(int n)
+{
+ unsigned a = 0, b = 0;
+
+ if (n < 3)
+ a = 1 << n;
+ else
+ b = 1 << 31;
+
+ __raw_writel((__raw_readl(PORTR031_000DR) & ~0x7) | a,
+ PORTR031_000DR);
+ __raw_writel((__raw_readl(PORTL159_128DR) & ~(1 << 31)) | b,
+ PORTL159_128DR);
+}
+#endif /* MMC_MACKEREL_H */
diff --git a/arch/arm/mach-shmobile/include/mach/mmc.h b/arch/arm/mach-shmobile/include/mach/mmc.h
new file mode 100644
index 0000000..e11560a
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/mmc.h
@@ -0,0 +1,18 @@
+#ifndef MMC_H
+#define MMC_H
+
+/**************************************************
+ *
+ * board specific settings
+ *
+ **************************************************/
+
+#ifdef CONFIG_MACH_AP4EVB
+#include "mach/mmc-ap4eb.h"
+#elif CONFIG_MACH_MACKEREL
+#include "mach/mmc-mackerel.h"
+#else
+#error "unsupported board."
+#endif
+
+#endif /* MMC_H */
diff --git a/arch/arm/mach-shmobile/include/mach/mmcif-ap4eb.h b/arch/arm/mach-shmobile/include/mach/mmcif-ap4eb.h
deleted file mode 100644
index a8d02be..0000000
--- a/arch/arm/mach-shmobile/include/mach/mmcif-ap4eb.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef MMCIF_AP4EB_H
-#define MMCIF_AP4EB_H
-
-#define PORT185CR (void __iomem *)0xe60520b9
-#define PORT186CR (void __iomem *)0xe60520ba
-#define PORT187CR (void __iomem *)0xe60520bb
-#define PORT188CR (void __iomem *)0xe60520bc
-
-#define PORTR191_160DR (void __iomem *)0xe6056014
-
-static inline void mmcif_init_progress(void)
-{
- /* Initialise LEDS1-4
- * registers: PORT185CR-PORT188CR (LED1-LED4 Control)
- * value: 0x10 - enable output
- */
- __raw_writeb(0x10, PORT185CR);
- __raw_writeb(0x10, PORT186CR);
- __raw_writeb(0x10, PORT187CR);
- __raw_writeb(0x10, PORT188CR);
-}
-
-static inline void mmcif_update_progress(int n)
-{
- __raw_writel((__raw_readl(PORTR191_160DR) & ~(0xf << 25)) |
- (1 << (25 + n)), PORTR191_160DR);
-}
-
-#endif /* MMCIF_AP4EB_H */
diff --git a/arch/arm/mach-shmobile/include/mach/mmcif-mackerel.h b/arch/arm/mach-shmobile/include/mach/mmcif-mackerel.h
deleted file mode 100644
index 4b4f694..0000000
--- a/arch/arm/mach-shmobile/include/mach/mmcif-mackerel.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef MMCIF_MACKEREL_H
-#define MMCIF_MACKEREL_H
-
-#define PORT0CR (void __iomem *)0xe6051000
-#define PORT1CR (void __iomem *)0xe6051001
-#define PORT2CR (void __iomem *)0xe6051002
-#define PORT159CR (void __iomem *)0xe605009f
-
-#define PORTR031_000DR (void __iomem *)0xe6055000
-#define PORTL159_128DR (void __iomem *)0xe6054010
-
-static inline void mmcif_init_progress(void)
-{
- /* Initialise LEDS0-3
- * registers: PORT0CR-PORT2CR,PORT159CR (LED0-LED3 Control)
- * value: 0x10 - enable output
- */
- __raw_writeb(0x10, PORT0CR);
- __raw_writeb(0x10, PORT1CR);
- __raw_writeb(0x10, PORT2CR);
- __raw_writeb(0x10, PORT159CR);
-}
-
-static inline void mmcif_update_progress(int n)
-{
- unsigned a = 0, b = 0;
-
- if (n < 3)
- a = 1 << n;
- else
- b = 1 << 31;
-
- __raw_writel((__raw_readl(PORTR031_000DR) & ~0x7) | a,
- PORTR031_000DR);
- __raw_writel((__raw_readl(PORTL159_128DR) & ~(1 << 31)) | b,
- PORTL159_128DR);
-}
-
-#endif /* MMCIF_MACKEREL_H */
diff --git a/arch/arm/mach-shmobile/include/mach/mmcif.h b/arch/arm/mach-shmobile/include/mach/mmcif.h
deleted file mode 100644
index f4dc327..0000000
--- a/arch/arm/mach-shmobile/include/mach/mmcif.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef MMCIF_H
-#define MMCIF_H
-
-/**************************************************
- *
- * board specific settings
- *
- **************************************************/
-
-#ifdef CONFIG_MACH_AP4EVB
-#include "mach/mmcif-ap4eb.h"
-#elif CONFIG_MACH_MACKEREL
-#include "mach/mmcif-mackerel.h"
-#else
-#error "unsupported board."
-#endif
-
-#endif /* MMCIF_H */
--
1.7.2.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] mmc: Add MMC_PROGRESS_*
2011-03-24 7:04 mmc: zboot helpers Simon Horman
2011-03-24 7:04 ` [PATCH 1/2] mmc, ARM: Rename SuperH Mobile ARM " Simon Horman
@ 2011-03-24 7:04 ` Simon Horman
2011-03-24 16:27 ` mmc: zboot helpers Paul Mundt
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2011-03-24 7:04 UTC (permalink / raw)
To: linux-arm-kernel
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: Simon Horman <horms@verge.net.au>
---
This patch depends on
mmc, ARM: Rename SuperH Mobile ARM zboot helpers
v2
* Include linux/mmc/boot.h in arch/sh/boot/romimage/mmcif-sh7724.c and
arch/arm/boot/compressed/mmcif-sh7372.c to avoid introducing a build failure
---
arch/arm/boot/compressed/mmcif-sh7372.c | 9 +++++----
arch/sh/boot/romimage/mmcif-sh7724.c | 9 +++++----
include/linux/mmc/boot.h | 7 +++++++
include/linux/mmc/sh_mmcif.h | 3 ---
4 files changed, 17 insertions(+), 11 deletions(-)
create mode 100644 include/linux/mmc/boot.h
diff --git a/arch/arm/boot/compressed/mmcif-sh7372.c b/arch/arm/boot/compressed/mmcif-sh7372.c
index 28bcf3c..7453c83 100644
--- a/arch/arm/boot/compressed/mmcif-sh7372.c
+++ b/arch/arm/boot/compressed/mmcif-sh7372.c
@@ -10,6 +10,7 @@
*/
#include <linux/mmc/sh_mmcif.h>
+#include <linux/mmc/boot.h>
#include <mach/mmc.h>
#define MMCIF_BASE (void __iomem *)0xe6bd0000
@@ -42,7 +43,7 @@
asmlinkage void mmcif_loader(unsigned char *buf, unsigned long len)
{
mmc_init_progress();
- mmc_update_progress(MMCIF_PROGRESS_ENTER);
+ mmc_update_progress(MMC_PROGRESS_ENTER);
/* Initialise MMC
* registers: PORT84CR-PORT92CR
@@ -68,12 +69,12 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long len)
/* Enable clock to MMC hardware block */
__raw_writel(__raw_readl(SMSTPCR3) & ~(1 << 12), SMSTPCR3);
- mmc_update_progress(MMCIF_PROGRESS_INIT);
+ mmc_update_progress(MMC_PROGRESS_INIT);
/* setup MMCIF hardware */
sh_mmcif_boot_init(MMCIF_BASE);
- mmc_update_progress(MMCIF_PROGRESS_LOAD);
+ mmc_update_progress(MMC_PROGRESS_LOAD);
/* load kernel via MMCIF interface */
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)
/* Disable clock to MMC hardware block */
__raw_writel(__raw_readl(SMSTPCR3) & (1 << 12), SMSTPCR3);
- mmc_update_progress(MMCIF_PROGRESS_DONE);
+ mmc_update_progress(MMC_PROGRESS_DONE);
}
diff --git a/arch/sh/boot/romimage/mmcif-sh7724.c b/arch/sh/boot/romimage/mmcif-sh7724.c
index c84e783..16b1225 100644
--- a/arch/sh/boot/romimage/mmcif-sh7724.c
+++ b/arch/sh/boot/romimage/mmcif-sh7724.c
@@ -9,6 +9,7 @@
*/
#include <linux/mmc/sh_mmcif.h>
+#include <linux/mmc/boot.h>
#include <mach/romimage.h>
#define MMCIF_BASE (void __iomem *)0xa4ca0000
@@ -29,7 +30,7 @@
*/
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 */
__raw_writel(__raw_readl(MSTPCR2) & ~0x20000000, MSTPCR2);
@@ -52,12 +53,12 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long no_bytes)
/* high drive capability for MMC pins */
__raw_writew(__raw_readw(DRVCRA) | 0x3000, DRVCRA);
- mmcif_update_progress(MMCIF_PROGRESS_INIT);
+ mmcif_update_progress(MMC_PROGRESS_INIT);
/* setup MMCIF hardware */
sh_mmcif_boot_init(MMCIF_BASE);
- mmcif_update_progress(MMCIF_PROGRESS_LOAD);
+ mmcif_update_progress(MMC_PROGRESS_LOAD);
/* load kernel via MMCIF interface */
sh_mmcif_boot_do_read(MMCIF_BASE, 512,
@@ -67,5 +68,5 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long no_bytes)
/* disable clock to the MMCIF hardware block */
__raw_writel(__raw_readl(MSTPCR2) | 0x20000000, MSTPCR2);
- mmcif_update_progress(MMCIF_PROGRESS_DONE);
+ mmcif_update_progress(MMC_PROGRESS_DONE);
}
diff --git a/include/linux/mmc/boot.h b/include/linux/mmc/boot.h
new file mode 100644
index 0000000..39d787c
--- /dev/null
+++ b/include/linux/mmc/boot.h
@@ -0,0 +1,7 @@
+#ifndef MMC_BOOT_H
+#define MMC_BOOT_H
+
+enum { MMC_PROGRESS_ENTER, MMC_PROGRESS_INIT,
+ MMC_PROGRESS_LOAD, MMC_PROGRESS_DONE };
+
+#endif
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
index 38d3930..9eb9b4b 100644
--- a/include/linux/mmc/sh_mmcif.h
+++ b/include/linux/mmc/sh_mmcif.h
@@ -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 */
-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)
{
--
1.7.2.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: mmc: zboot helpers
2011-03-24 7:04 mmc: zboot helpers Simon Horman
2011-03-24 7:04 ` [PATCH 1/2] mmc, ARM: Rename SuperH Mobile ARM " Simon Horman
2011-03-24 7:04 ` [PATCH 2/2] mmc: Add MMC_PROGRESS_* Simon Horman
@ 2011-03-24 16:27 ` Paul Mundt
2 siblings, 0 replies; 4+ messages in thread
From: Paul Mundt @ 2011-03-24 16:27 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 24, 2011 at 04:04:36PM +0900, Simon Horman wrote:
> [ repost as I included a bogus email address in my previous attempt ]
>
> Hi Paul,
>
> please consider merging the following two patches.
> They are both pre-requisites for
> "mmc, ARM: Add zboot from eSD support for SuperH Mobile ARM"
> which I plan to submit to Russell King.
>
> These patches were originally submitted in a for patch series
> however they do not depend on any of the other patches in the series
> so I am posting them independently.
>
> These patches apply against Linus's current tree
> and I am not aware of any particular prerequisites for them
> other than that the 2nd patch depends on the 1st one.
>
Ok, I'll queue them up and send them along.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-03-24 16:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-24 7:04 mmc: zboot helpers Simon Horman
2011-03-24 7:04 ` [PATCH 1/2] mmc, ARM: Rename SuperH Mobile ARM " Simon Horman
2011-03-24 7:04 ` [PATCH 2/2] mmc: Add MMC_PROGRESS_* Simon Horman
2011-03-24 16:27 ` mmc: zboot helpers Paul Mundt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).