mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 01/14] dma: Use generic place for dma_addr_t typedef
Date: Fri, 22 May 2015 08:10:58 +0200	[thread overview]
Message-ID: <1432275071-28554-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1432275071-28554-1-git-send-email-s.hauer@pengutronix.de>

Instead of letting all architectures define their own dma_addr_t use
a common place in include/linux/types.h and use a Kconfig symbol that
architectures can select to define the width of dma_addr_t. The same
is done in the Kernel.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/include/asm/types.h      |  5 -----
 arch/blackfin/include/asm/types.h |  4 ----
 arch/efi/include/asm/types.h      |  4 ----
 arch/mips/Kconfig                 |  1 +
 arch/mips/include/asm/types.h     | 12 ------------
 arch/nios2/include/asm/types.h    |  3 ---
 arch/openrisc/include/asm/types.h |  4 ----
 arch/ppc/include/asm/types.h      |  3 ---
 arch/sandbox/include/asm/types.h  |  4 ----
 common/Kconfig                    |  3 +++
 include/linux/types.h             |  7 +++++++
 11 files changed, 11 insertions(+), 39 deletions(-)

diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h
index 81bd357..680e824 100644
--- a/arch/arm/include/asm/types.h
+++ b/arch/arm/include/asm/types.h
@@ -47,11 +47,6 @@ typedef unsigned int u32;
 typedef signed long long s64;
 typedef unsigned long long u64;
 
-/* Dma addresses are 32-bits wide.  */
-
-typedef u32 dma_addr_t;
-typedef u32 dma64_addr_t;
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
diff --git a/arch/blackfin/include/asm/types.h b/arch/blackfin/include/asm/types.h
index 3d2bd35..f1c2dc4 100644
--- a/arch/blackfin/include/asm/types.h
+++ b/arch/blackfin/include/asm/types.h
@@ -69,10 +69,6 @@ typedef unsigned int u32;
 typedef signed long long s64;
 typedef unsigned long long u64;
 
-/* Dma addresses are 32-bits wide. */
-
-typedef u32 dma_addr_t;
-
 #endif
 
 #endif /* __ASSEMBLY__ */
diff --git a/arch/efi/include/asm/types.h b/arch/efi/include/asm/types.h
index 3204448..05122ea 100644
--- a/arch/efi/include/asm/types.h
+++ b/arch/efi/include/asm/types.h
@@ -62,10 +62,6 @@ typedef unsigned long long u64;
 #define BITS_PER_LONG 32
 #endif
 
-/* Dma addresses are 32-bits wide.  */
-
-typedef u32 dma_addr_t;
-
 #endif /* __KERNEL__ */
 
 #endif
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index ed6e1ab..aeb5c04 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -269,6 +269,7 @@ config 32BIT
 config 64BIT
 	bool "64-bit barebox"
 	depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL
+	select ARCH_DMA_ADDR_T_64BIT
 	help
 	  Select this option if you want to build a 64-bit barebox.
 
diff --git a/arch/mips/include/asm/types.h b/arch/mips/include/asm/types.h
index b63687d..4140c92 100644
--- a/arch/mips/include/asm/types.h
+++ b/arch/mips/include/asm/types.h
@@ -13,18 +13,6 @@
 
 #include <asm-generic/int-ll64.h>
 
-#ifndef __ASSEMBLY__
-
-#if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \
-    || defined(CONFIG_64BIT)
-typedef u64 dma_addr_t;
-#else
-typedef u32 dma_addr_t;
-#endif
-typedef u64 dma64_addr_t;
-
-#endif /* __ASSEMBLY__ */
-
 /*
  * We don't use int-l64.h for the kernel anymore but still use it for
  * userspace to avoid code changes.
diff --git a/arch/nios2/include/asm/types.h b/arch/nios2/include/asm/types.h
index 21c3415..0067ea8 100644
--- a/arch/nios2/include/asm/types.h
+++ b/arch/nios2/include/asm/types.h
@@ -3,7 +3,4 @@
 
 #include <asm/int-ll64.h>
 
-typedef u32 dma_addr_t;
-
 #endif
-
diff --git a/arch/openrisc/include/asm/types.h b/arch/openrisc/include/asm/types.h
index 3338fcf..cacda42 100644
--- a/arch/openrisc/include/asm/types.h
+++ b/arch/openrisc/include/asm/types.h
@@ -64,10 +64,6 @@ typedef unsigned long long u64;
 
 #define BITS_PER_LONG 32
 
-/* Dma addresses are 32-bits wide.  */
-
-typedef u32 dma_addr_t;
-
 #endif /* __KERNEL__ */
 
 #endif /* _ASM_TYPES_H */
diff --git a/arch/ppc/include/asm/types.h b/arch/ppc/include/asm/types.h
index 4ebbb9e..37ef353 100644
--- a/arch/ppc/include/asm/types.h
+++ b/arch/ppc/include/asm/types.h
@@ -41,9 +41,6 @@ typedef unsigned long long u64;
 
 #define BITS_PER_LONG 32
 
-/* DMA addresses are 32-bits wide */
-typedef u32 dma_addr_t;
-
 #endif /* __KERNEL__ */
 #endif /* __ASSEMBLY__ */
 
diff --git a/arch/sandbox/include/asm/types.h b/arch/sandbox/include/asm/types.h
index d471d25..8944b47 100644
--- a/arch/sandbox/include/asm/types.h
+++ b/arch/sandbox/include/asm/types.h
@@ -56,10 +56,6 @@ typedef unsigned long long u64;
 
 #define BITS_PER_LONG 32
 
-/* Dma addresses are 32-bits wide.  */
-
-typedef u32 dma_addr_t;
-
 #endif /* __KERNEL__ */
 
 #endif
diff --git a/common/Kconfig b/common/Kconfig
index 1c5d14c..3dfb5ac 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -94,6 +94,9 @@ config EFI_DEVICEPATH
 config FILE_LIST
 	bool
 
+config ARCH_DMA_ADDR_T_64BIT
+	bool
+
 menu "General Settings"
 
 config LOCALVERSION
diff --git a/include/linux/types.h b/include/linux/types.h
index c11e148..9871a66 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -158,6 +158,13 @@ typedef __u32 __bitwise __wsum;
 #define __aligned_be64 __be64 __attribute__((aligned(8)))
 #define __aligned_le64 __le64 __attribute__((aligned(8)))
 
+/* A dma_addr_t can hold any valid DMA or bus address for the platform */
+#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
+typedef u64 dma_addr_t;
+#else
+typedef u32 dma_addr_t;
+#endif /* dma_addr_t */
+
 #ifdef CONFIG_PHYS_ADDR_T_64BIT
 typedef u64 phys_addr_t;
 typedef u64 phys_size_t;
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2015-05-22  6:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22  6:10 Introduce asm-generic/posix_types.h Sascha Hauer
2015-05-22  6:10 ` Sascha Hauer [this message]
2015-05-22  6:10 ` [PATCH 02/14] drop __BITS_PER_LONG Sascha Hauer
2015-05-22  6:11 ` [PATCH 03/14] introduce bitsperlong.h for remaining architectures Sascha Hauer
2015-05-22  6:11 ` [PATCH 04/14] introduce generic posix_types.h Sascha Hauer
2015-05-22  6:11 ` [PATCH 05/14] remove unused nlink_t Sascha Hauer
2015-05-22  6:11 ` [PATCH 06/14] ARM: use generic posix_types.h Sascha Hauer
2015-05-22  6:11 ` [PATCH 07/14] blackfin: " Sascha Hauer
2015-05-22  6:11 ` [PATCH 08/14] x86: " Sascha Hauer
2015-05-22  6:11 ` [PATCH 09/14] openrisc: " Sascha Hauer
2015-05-22  6:11 ` [PATCH 10/14] mips: " Sascha Hauer
2015-05-22  6:11 ` [PATCH 11/14] ppc: " Sascha Hauer
2015-05-22  6:11 ` [PATCH 12/14] sandbox: " Sascha Hauer
2015-05-22  6:11 ` [PATCH 13/14] efi: " Sascha Hauer
2015-05-22  6:11 ` [PATCH 14/14] nios2: " Sascha Hauer

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=1432275071-28554-2-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@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