MIPS: Add a platform hook for swiotlb setup.
authorDavid Daney <ddaney@caviumnetworks.com>
Fri, 1 Oct 2010 20:27:33 +0000 (13:27 -0700)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 29 Oct 2010 18:08:32 +0000 (19:08 +0100)
This allows platforms that are using the swiotlb to initialize it.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Patchwork: http://patchwork.linux-mips.org/patch/1638/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/bootinfo.h
arch/mips/kernel/setup.c

index 15a8ef0707c695538fa5463d1ac05893e91f55b4..35cd1bab69c3c23d81015da791d2e7609526d962 100644 (file)
@@ -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 */
index a6b900f2962bb2dff92f93a4f53206a2c52bc812..acd3f2c49c069fa04af112d8c30dc008cf869351 100644 (file)
@@ -490,6 +490,7 @@ static void __init arch_mem_init(char **cmdline_p)
        bootmem_init();
        device_tree_init();
        sparse_init();
+       plat_swiotlb_setup();
        paging_init();
 }