linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: nicolas.pitre@linaro.org (Nicolas Pitre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 07/37] ARM: OMAP: move OMAP1 memory config from plat/memory.h to its mach/memory.h
Date: Tue, 05 Jul 2011 23:29:51 -0400	[thread overview]
Message-ID: <1309923021-23487-7-git-send-email-nicolas.pitre@linaro.org> (raw)
In-Reply-To: <1309923021-23487-1-git-send-email-nicolas.pitre@linaro.org>

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
---
 arch/arm/mach-omap1/include/mach/memory.h |   54 ++++++++++++++++++++++++++++-
 arch/arm/plat-omap/include/plat/memory.h  |   45 +-----------------------
 2 files changed, 54 insertions(+), 45 deletions(-)

diff --git a/arch/arm/mach-omap1/include/mach/memory.h b/arch/arm/mach-omap1/include/mach/memory.h
index e9b600c..5f96515 100644
--- a/arch/arm/mach-omap1/include/mach/memory.h
+++ b/arch/arm/mach-omap1/include/mach/memory.h
@@ -2,4 +2,56 @@
  * arch/arm/mach-omap1/include/mach/memory.h
  */
 
-#include <plat/memory.h>
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
+
+/*
+ * Physical DRAM offset.
+ */
+#define PLAT_PHYS_OFFSET		UL(0x10000000)
+
+/*
+ * Bus address is physical address, except for OMAP-1510 Local Bus.
+ * OMAP-1510 bus address is translated into a Local Bus address if the
+ * OMAP bus type is lbus. We do the address translation based on the
+ * device overriding the defaults used in the dma-mapping API.
+ * Note that the is_lbus_device() test is not very efficient on 1510
+ * because of the strncmp().
+ */
+#ifdef CONFIG_ARCH_OMAP15XX
+
+/*
+ * OMAP-1510 Local Bus address offset
+ */
+#define OMAP1510_LB_OFFSET	UL(0x30000000)
+
+#define virt_to_lbus(x)		((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET)
+#define lbus_to_virt(x)		((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET)
+#define is_lbus_device(dev)	(cpu_is_omap15xx() && dev && (strncmp(dev_name(dev), "ohci", 4) == 0))
+
+#define __arch_pfn_to_dma(dev, pfn)	\
+	({ dma_addr_t __dma = __pfn_to_phys(pfn); \
+	   if (is_lbus_device(dev)) \
+		__dma = __dma - PHYS_OFFSET + OMAP1510_LB_OFFSET; \
+	   __dma; })
+
+#define __arch_dma_to_pfn(dev, addr)	\
+	({ dma_addr_t __dma = addr;				\
+	   if (is_lbus_device(dev))				\
+		__dma += PHYS_OFFSET - OMAP1510_LB_OFFSET;	\
+	   __phys_to_pfn(__dma);				\
+	})
+
+#define __arch_dma_to_virt(dev, addr)	({ (void *) (is_lbus_device(dev) ? \
+						lbus_to_virt(addr) : \
+						__phys_to_virt(addr)); })
+
+#define __arch_virt_to_dma(dev, addr)	({ unsigned long __addr = (unsigned long)(addr); \
+					   (dma_addr_t) (is_lbus_device(dev) ? \
+						virt_to_lbus(__addr) : \
+						__virt_to_phys(__addr)); })
+
+#endif	/* CONFIG_ARCH_OMAP15XX */
+
+#endif
+
diff --git a/arch/arm/plat-omap/include/plat/memory.h b/arch/arm/plat-omap/include/plat/memory.h
index 7f9df6f..5b1a86d 100644
--- a/arch/arm/plat-omap/include/plat/memory.h
+++ b/arch/arm/plat-omap/include/plat/memory.h
@@ -37,53 +37,10 @@
  * Physical DRAM offset.
  */
 #if defined(CONFIG_ARCH_OMAP1)
-#define PLAT_PHYS_OFFSET		UL(0x10000000)
+#error "OMAP1 should not be including this"
 #else
 #define PLAT_PHYS_OFFSET		UL(0x80000000)
 #endif
 
-/*
- * Bus address is physical address, except for OMAP-1510 Local Bus.
- * OMAP-1510 bus address is translated into a Local Bus address if the
- * OMAP bus type is lbus. We do the address translation based on the
- * device overriding the defaults used in the dma-mapping API.
- * Note that the is_lbus_device() test is not very efficient on 1510
- * because of the strncmp().
- */
-#ifdef CONFIG_ARCH_OMAP15XX
-
-/*
- * OMAP-1510 Local Bus address offset
- */
-#define OMAP1510_LB_OFFSET	UL(0x30000000)
-
-#define virt_to_lbus(x)		((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET)
-#define lbus_to_virt(x)		((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET)
-#define is_lbus_device(dev)	(cpu_is_omap15xx() && dev && (strncmp(dev_name(dev), "ohci", 4) == 0))
-
-#define __arch_pfn_to_dma(dev, pfn)	\
-	({ dma_addr_t __dma = __pfn_to_phys(pfn); \
-	   if (is_lbus_device(dev)) \
-		__dma = __dma - PHYS_OFFSET + OMAP1510_LB_OFFSET; \
-	   __dma; })
-
-#define __arch_dma_to_pfn(dev, addr)	\
-	({ dma_addr_t __dma = addr;				\
-	   if (is_lbus_device(dev))				\
-		__dma += PHYS_OFFSET - OMAP1510_LB_OFFSET;	\
-	   __phys_to_pfn(__dma);				\
-	})
-
-#define __arch_dma_to_virt(dev, addr)	({ (void *) (is_lbus_device(dev) ? \
-						lbus_to_virt(addr) : \
-						__phys_to_virt(addr)); })
-
-#define __arch_virt_to_dma(dev, addr)	({ unsigned long __addr = (unsigned long)(addr); \
-					   (dma_addr_t) (is_lbus_device(dev) ? \
-						virt_to_lbus(__addr) : \
-						__virt_to_phys(__addr)); })
-
-#endif	/* CONFIG_ARCH_OMAP15XX */
-
 #endif
 
-- 
1.7.4

  parent reply	other threads:[~2011-07-06  3:29 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-06  3:29 [PATCH 01/37] ARM: prepare for removal of a bunch of <mach/memory.h> files Nicolas Pitre
2011-07-06  3:29 ` [PATCH 02/37] ARM: mach-dove: remove include/mach/memory.h Nicolas Pitre
2011-07-06  3:29 ` [PATCH 03/37] ARM: mach-kirkwood: remove mach/memory.h Nicolas Pitre
2011-07-06  3:29 ` [PATCH 04/37] ARM: mach-loki: " Nicolas Pitre
2011-07-06  3:29 ` [PATCH 05/37] ARM: mach-orion5x: " Nicolas Pitre
2011-07-06  3:29 ` [PATCH 06/37] ARM: plat-omap: remove CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE related code Nicolas Pitre
2011-07-07 14:30   ` Tony Lindgren
2011-07-06  3:29 ` Nicolas Pitre [this message]
2011-07-07 14:30   ` [PATCH 07/37] ARM: OMAP: move OMAP1 memory config from plat/memory.h to its mach/memory.h Tony Lindgren
2011-07-06  3:29 ` [PATCH 08/37] ARM: mach-omap2: remove mach/memory.h Nicolas Pitre
2011-07-07 14:29   ` Tony Lindgren
2011-07-07 15:08   ` Arnd Bergmann
2011-07-07 15:25     ` Nicolas Pitre
2011-07-07 15:46       ` Arnd Bergmann
2011-07-06  3:29 ` [PATCH 09/37] ARM: mach-iop33x: " Nicolas Pitre
2011-07-06  3:29 ` [PATCH 10/37] ARM: mach-ep93xx: remove mach/memory.h and Kconfig selection of SDRAM bank Nicolas Pitre
2011-07-07 16:46   ` H Hartley Sweeten
2011-07-07 17:18     ` Nicolas Pitre
2011-07-07 17:29       ` H Hartley Sweeten
2011-07-07 18:00         ` Nicolas Pitre
2011-07-06  3:29 ` [PATCH 11/37] ARM: mach-s3c2410: remove memory.h Nicolas Pitre
2011-07-06  3:29 ` [PATCH 12/37] ARM: mach-mv78xx0: remove mach/memory.h Nicolas Pitre
2011-07-06  3:29 ` [PATCH 13/37] ARM: mach-vexpress: " Nicolas Pitre
2011-07-06  3:29 ` [PATCH 14/37] ARM: mach-w90x900: " Nicolas Pitre
2011-07-06  3:29 ` [PATCH 15/37] ARM: mach-pnx4008: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 16/37] ARM: mach-iop32x: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 17/37] ARM: mach-nomadik: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 18/37] ARM: mach-ux500: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 19/37] ARM: mach-versatile: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 20/37] ARM: mach-netx: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 21/37] ARM: mach-lpc32xx: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 22/37] ARM: mach-gemini: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 23/37] ARM: mach-msm: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 24/37] ARM: spear: remove mach/memory.h and plat/memory.h Nicolas Pitre
2011-07-06  3:30 ` [PATCH 25/37] ARM: mach-mxs: remove mach/memory.h Nicolas Pitre
2011-07-06  3:30 ` [PATCH 26/37] ARM: mach-nuc93x: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 27/37] ARM: mach-cns3xxx: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 28/37] ARM: mach-mmp: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 29/37] ARM: plat-tcc: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 30/37] ARM: mach-tegra: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 31/37] ARM: mach-s5pc100: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 32/37] ARM: mach-vt8500: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 33/37] ARM: mach-shark: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 34/37] ARM: mach-ebsa110: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 35/37] ARM: mach-h720x: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 36/37] ARM: mach-ixp4xx: " Nicolas Pitre
2011-07-06  3:30 ` [PATCH 37/37] ARM: mach-pxa: " Nicolas Pitre
2011-07-06  6:38 ` [PATCH 01/37] ARM: prepare for removal of a bunch of <mach/memory.h> files Barry Song

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=1309923021-23487-7-git-send-email-nicolas.pitre@linaro.org \
    --to=nicolas.pitre@linaro.org \
    --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).