summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2008-12-15 16:11:42 +0000
committerGabor Juhos <juhosg@openwrt.org>2008-12-15 16:11:42 +0000
commitd49e66360ca32775082cd01203caadaf54f399a3 (patch)
tree37bb3bdae5a06a04ac8e9d8a4742d5c37f9e20c1
parenta5f66cd0e8b7eed1cece500530b7d142d70391b6 (diff)
downloadmtk-20170518-d49e66360ca32775082cd01203caadaf54f399a3.zip
mtk-20170518-d49e66360ca32775082cd01203caadaf54f399a3.tar.gz
mtk-20170518-d49e66360ca32775082cd01203caadaf54f399a3.tar.bz2
move machine setup code
SVN-Revision: 13656
-rw-r--r--target/linux/ar71xx/files-2.6.28/arch/mips/include/asm/mach-ar71xx/platform.h8
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/platform.c20
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/setup.c14
-rw-r--r--target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/platform.h8
4 files changed, 32 insertions, 18 deletions
diff --git a/target/linux/ar71xx/files-2.6.28/arch/mips/include/asm/mach-ar71xx/platform.h b/target/linux/ar71xx/files-2.6.28/arch/mips/include/asm/mach-ar71xx/platform.h
index 750418a..a82d621 100644
--- a/target/linux/ar71xx/files-2.6.28/arch/mips/include/asm/mach-ar71xx/platform.h
+++ b/target/linux/ar71xx/files-2.6.28/arch/mips/include/asm/mach-ar71xx/platform.h
@@ -74,4 +74,12 @@ extern void ar71xx_add_device_gpio_buttons(int id,
unsigned nbuttons,
struct gpio_button *buttons) __init;
+#ifdef CONFIG_AR71XX_EARLY_SERIAL
+static inline void ar71xx_add_device_uart(void) {}
+#else
+extern void ar71xx_add_device_uart(void) __init;
+#endif
+
+extern void ar71xx_add_device_wdt(void) __init;
+
#endif /* __ASM_MACH_AR71XX_PLATFORM_H */
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c b/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c
index 5c8791b..ab9cabb 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c
@@ -18,7 +18,6 @@
#include <linux/platform_device.h>
#include <linux/serial_8250.h>
-#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include <asm/mach-ar71xx/platform.h>
@@ -138,9 +137,7 @@ void __init ar71xx_add_device_usb(void)
}
}
-#ifdef CONFIG_AR71XX_EARLY_SERIAL
-static void __init ar71xx_add_device_uart(void) {};
-#else
+#ifndef CONFIG_AR71XX_EARLY_SERIAL
static struct resource ar71xx_uart_resources[] = {
{
.start = AR71XX_UART_BASE,
@@ -172,7 +169,7 @@ static struct platform_device ar71xx_uart_device = {
},
};
-static void __init ar71xx_add_device_uart(void)
+void __init ar71xx_add_device_uart(void)
{
ar71xx_uart_data[0].uartclk = ar71xx_ahb_freq;
platform_device_register(&ar71xx_uart_device);
@@ -597,16 +594,3 @@ void __init ar71xx_parse_mac_addr(char *mac_str)
printk(KERN_DEBUG "ar71xx: failed to parse mac address "
"\"%s\"\n", mac_str);
}
-
-static int __init ar71xx_machine_setup(void)
-{
- ar71xx_gpio_init();
-
- ar71xx_add_device_uart();
- ar71xx_add_device_wdt();
-
- mips_machine_setup(ar71xx_mach_type);
- return 0;
-}
-
-arch_initcall(ar71xx_machine_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/setup.c b/target/linux/ar71xx/files/arch/mips/ar71xx/setup.c
index 5d3f2a8..25ef3de 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/setup.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/setup.c
@@ -23,6 +23,7 @@
#include <asm/traps.h>
#include <asm/time.h> /* for mips_hpt_frequency */
#include <asm/reboot.h> /* for _machine_{restart,halt} */
+#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include <asm/mach-ar71xx/pci.h>
@@ -270,3 +271,16 @@ void __init plat_time_init(void)
{
mips_hpt_frequency = ar71xx_cpu_freq / 2;
}
+
+static int __init ar71xx_machine_setup(void)
+{
+ ar71xx_gpio_init();
+
+ ar71xx_add_device_uart();
+ ar71xx_add_device_wdt();
+
+ mips_machine_setup(ar71xx_mach_type);
+ return 0;
+}
+
+arch_initcall(ar71xx_machine_setup);
diff --git a/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/platform.h b/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/platform.h
index 750418a..a82d621 100644
--- a/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/platform.h
+++ b/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/platform.h
@@ -74,4 +74,12 @@ extern void ar71xx_add_device_gpio_buttons(int id,
unsigned nbuttons,
struct gpio_button *buttons) __init;
+#ifdef CONFIG_AR71XX_EARLY_SERIAL
+static inline void ar71xx_add_device_uart(void) {}
+#else
+extern void ar71xx_add_device_uart(void) __init;
+#endif
+
+extern void ar71xx_add_device_wdt(void) __init;
+
#endif /* __ASM_MACH_AR71XX_PLATFORM_H */