linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] omap: Disable omap_read/write functions for omap2+
Date: Tue, 7 Dec 2010 17:29:34 -0800	[thread overview]
Message-ID: <20101208012933.GI17435@atomide.com> (raw)
In-Reply-To: <20101204213651.32208.8915.stgit@baageli.muru.com>

* Tony Lindgren <tony@atomide.com> [101204 13:27]:
> These should be now long gone and break multi-omap support for omap1
> as the cpu_class_is_omap1() won't work until the SOC is detected.
> 
> So just disable and warn for omap2+ in case somebody still attampts
> to use these.

Heh this was totally not working and had several copy paste bugs..
Instead of including more files, let's just make them dummy inline
functions.

Tony


From: Tony Lindgren <tony@atomide.com>
Date: Tue, 7 Dec 2010 16:57:01 -0800
Subject: [PATCH] omap: Disable omap_read/write functions for omap2+

These should be now long gone and break multi-omap support for omap1
as the cpu_class_is_omap1() won't work until the SOC is detected.
So just disable them for omap2+.

Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h
index 128b549..0e3b907 100644
--- a/arch/arm/plat-omap/include/plat/io.h
+++ b/arch/arm/plat-omap/include/plat/io.h
@@ -247,6 +247,8 @@
  * NOTE: Please use ioremap + __raw_read/write where possible instead of these
  */
 
+#ifdef CONFIG_ARCH_OMAP1
+
 extern u8 omap_readb(u32 pa);
 extern u16 omap_readw(u32 pa);
 extern u32 omap_readl(u32 pa);
@@ -254,6 +256,36 @@ extern void omap_writeb(u8 v, u32 pa);
 extern void omap_writew(u16 v, u32 pa);
 extern void omap_writel(u32 v, u32 pa);
 
+#else
+
+static inline u8 omap_readb(u32 pa)
+{
+	return 0;
+}
+
+static inline u16 omap_readw(u32 pa)
+{
+	return 0;
+}
+
+static inline u32 omap_readl(u32 pa)
+{
+	return 0;
+}
+
+static inline void omap_writeb(u8 v, u32 pa)
+{
+}
+
+static inline void omap_writew(u16 v, u32 pa)
+{
+}
+
+static inline void omap_writel(u32 v, u32 pa)
+{
+}
+#endif
+
 struct omap_sdrc_params;
 
 extern void omap1_map_common_io(void);
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c
index b0078cf..b89182b 100644
--- a/arch/arm/plat-omap/io.c
+++ b/arch/arm/plat-omap/io.c
@@ -138,59 +138,45 @@ void omap_iounmap(volatile void __iomem *addr)
 EXPORT_SYMBOL(omap_iounmap);
 
 /*
- * NOTE: Please use ioremap + __raw_read/write where possible instead of these
+ * NOTE: Please use ioremap + __raw_read/write where possible instead of these.
+ * These are only working for omap1 and will disappear eventually.
  */
+#ifdef CONFIG_ARCH_OMAP1
 
 u8 omap_readb(u32 pa)
 {
-	if (cpu_class_is_omap1())
-		return __raw_readb(OMAP1_IO_ADDRESS(pa));
-	else
-		return __raw_readb(OMAP2_L4_IO_ADDRESS(pa));
+	return __raw_readb(OMAP1_IO_ADDRESS(pa));
 }
 EXPORT_SYMBOL(omap_readb);
 
 u16 omap_readw(u32 pa)
 {
-	if (cpu_class_is_omap1())
-		return __raw_readw(OMAP1_IO_ADDRESS(pa));
-	else
-		return __raw_readw(OMAP2_L4_IO_ADDRESS(pa));
+	return __raw_readw(OMAP1_IO_ADDRESS(pa));
 }
 EXPORT_SYMBOL(omap_readw);
 
 u32 omap_readl(u32 pa)
 {
-	if (cpu_class_is_omap1())
-		return __raw_readl(OMAP1_IO_ADDRESS(pa));
-	else
-		return __raw_readl(OMAP2_L4_IO_ADDRESS(pa));
+	return __raw_readl(OMAP1_IO_ADDRESS(pa));
 }
 EXPORT_SYMBOL(omap_readl);
 
 void omap_writeb(u8 v, u32 pa)
 {
-	if (cpu_class_is_omap1())
-		__raw_writeb(v, OMAP1_IO_ADDRESS(pa));
-	else
-		__raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa));
+	__raw_writeb(v, OMAP1_IO_ADDRESS(pa));
 }
 EXPORT_SYMBOL(omap_writeb);
 
 void omap_writew(u16 v, u32 pa)
 {
-	if (cpu_class_is_omap1())
-		__raw_writew(v, OMAP1_IO_ADDRESS(pa));
-	else
-		__raw_writew(v, OMAP2_L4_IO_ADDRESS(pa));
+	__raw_writew(v, OMAP1_IO_ADDRESS(pa));
 }
 EXPORT_SYMBOL(omap_writew);
 
 void omap_writel(u32 v, u32 pa)
 {
-	if (cpu_class_is_omap1())
-		__raw_writel(v, OMAP1_IO_ADDRESS(pa));
-	else
-		__raw_writel(v, OMAP2_L4_IO_ADDRESS(pa));
+	__raw_writel(v, OMAP1_IO_ADDRESS(pa));
 }
 EXPORT_SYMBOL(omap_writel);
+
+#endif

  reply	other threads:[~2010-12-08  1:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-04 21:36 [PATCH 0/4] Create omap1_defconfig, remove other omap1 configs Tony Lindgren
2010-12-04 21:36 ` [PATCH 1/4] omap: Disable omap_read/write functions for omap2+ Tony Lindgren
2010-12-08  1:29   ` Tony Lindgren [this message]
2010-12-08  4:17     ` Tony Lindgren
2010-12-04 21:36 ` [PATCH 2/4] omap1: Add initcall checks for omap1 and booted board Tony Lindgren
2010-12-10 16:02   ` Janusz Krzysztofik
2010-12-10 19:26     ` Tony Lindgren
2010-12-04 21:36 ` [PATCH 3/4] omap1: Add omap1_defconfig Tony Lindgren
2010-12-07 12:38   ` Felipe Contreras
2010-12-08  2:00     ` Tony Lindgren
2010-12-04 21:37 ` [PATCH 4/4] omap1: Delete old defconfigs Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101208012933.GI17435@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).