linux-mips
[Top] [All Lists]

[PATCH 7/8] MIPS: Add a platform hook for swiotlb setup.

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH 7/8] MIPS: Add a platform hook for swiotlb setup.
From: David Daney <ddaney@caviumnetworks.com>
Date: Fri, 1 Oct 2010 13:27:33 -0700
Cc: David Daney <ddaney@caviumnetworks.com>
In-reply-to: <1285964854-28659-1-git-send-email-ddaney@caviumnetworks.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1285964854-28659-1-git-send-email-ddaney@caviumnetworks.com>
Sender: linux-mips-bounce@linux-mips.org
This allows platforms that are using the swiotlb to initialize it.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
---
 arch/mips/include/asm/bootinfo.h |   12 ++++++++++++
 arch/mips/kernel/setup.c         |    1 +
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/mips/include/asm/bootinfo.h b/arch/mips/include/asm/bootinfo.h
index 15a8ef0..35cd1ba 100644
--- a/arch/mips/include/asm/bootinfo.h
+++ b/arch/mips/include/asm/bootinfo.h
@@ -125,4 +125,16 @@ extern unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3;
  */
 extern void plat_mem_setup(void);
 
+#ifdef CONFIG_SWIOTLB
+/*
+ * Optional platform hook to call swiotlb_setup().
+ */
+extern void plat_swiotlb_setup(void);
+
+#else
+
+static inline void plat_swiotlb_setup(void) {}
+
+#endif /* CONFIG_SWIOTLB */
+
 #endif /* _ASM_BOOTINFO_H */
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 85aef3f..4e68a51 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -488,6 +488,7 @@ static void __init arch_mem_init(char **cmdline_p)
 
        bootmem_init();
        sparse_init();
+       plat_swiotlb_setup();
        paging_init();
 }
 
-- 
1.7.2.2


<Prev in Thread] Current Thread [Next in Thread>