+}
--- /dev/null
+++ b/arch/mips/ath25/prom.c
-@@ -0,0 +1,40 @@
+@@ -0,0 +1,26 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ */
+
+#include <linux/init.h>
-+#include <generated/autoconf.h>
-+#include <linux/kernel.h>
-+#include <linux/string.h>
-+#include <linux/mm.h>
-+#include <linux/bootmem.h>
-+
+#include <asm/bootinfo.h>
-+#include <asm/addrspace.h>
-+#include "ar5312.h"
-+#include "ar2315.h"
-+#include "devices.h"
+
+void __init prom_init(void)
+{
-+ if (is_ar5312())
-+ ar5312_prom_init();
-+ else
-+ ar2315_prom_init();
+}
+
+void __init prom_free_prom_memory(void)
+#endif /* __ASM_MACH_ATH25_AR5312_REGS_H */
--- /dev/null
+++ b/arch/mips/ath25/ar5312.c
-@@ -0,0 +1,450 @@
+@@ -0,0 +1,449 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ mips_hpt_frequency = ar5312_cpu_frequency() / 2;
+}
+
-+void __init
-+ar5312_prom_init(void)
++void __init ar5312_plat_mem_setup(void)
+{
+ u32 memsize, memcfg, bank0AC, bank1AC;
+ u32 devid;
+ devid >>= AR5312_REV_WMAC_MIN_S;
+ devid &= AR5312_REV_CHIP;
+ ath25_board.devid = (u16)devid;
-+}
+
-+void __init ar5312_plat_mem_setup(void)
-+{
+ /* Clear any lingering AHB errors */
+ ar231x_read_reg(AR5312_PROCADDR);
+ ar231x_read_reg(AR5312_DMAADDR);
+ ar231x_write_reg(AR5312_WD_CTRL, AR5312_WD_CTRL_IGNORE_EXPIRATION);
+
+ _machine_restart = ar5312_restart;
++}
++
++void __init ar5312_arch_init(void)
++{
+ ath25_serial_setup(AR5312_UART0, AR5312_MISC_IRQ_UART0,
+ ar5312_sys_frequency());
+}
-+
--- /dev/null
+++ b/arch/mips/ath25/ar2315.c
@@ -0,0 +1,401 @@
+ mips_hpt_frequency = ar2315_cpu_frequency() / 2;
+}
+
-+void __init
-+ar2315_prom_init(void)
++void __init ar2315_plat_mem_setup(void)
+{
-+ u32 memsize, memcfg, devid;
++ u32 memsize, memcfg;
++ u32 devid;
++ u32 config;
+
+ memcfg = ar231x_read_reg(AR2315_MEM_CFG);
+ memsize = 1 + ((memcfg & SDRAM_DATA_WIDTH_M) >> SDRAM_DATA_WIDTH_S);
+ break;
+ }
+ ath25_board.devid = devid;
-+}
-+
-+void __init ar2315_plat_mem_setup(void)
-+{
-+ u32 config;
+
+ /* Clear any lingering AHB errors */
+ config = read_c0_config();
+ ar231x_write_reg(AR2315_WDC, AR2315_WDC_IGNORE_EXPIRATION);
+
+ _machine_restart = ar2315_restart;
++}
++
++void __init ar2315_arch_init(void)
++{
+ ath25_serial_setup(AR2315_UART0, AR2315_MISC_IRQ_UART0,
+ ar2315_apb_frequency());
+}
+void ar2315_arch_init_irq(void);
+void ar2315_init_devices(void);
+void ar2315_plat_time_init(void);
-+void ar2315_prom_init(void);
+void ar2315_plat_mem_setup(void);
++void ar2315_arch_init(void);
+
+#else
+
+{
+}
+
-+static inline void ar2315_prom_init(void)
++static inline void ar2315_plat_mem_setup(void)
+{
+}
+
-+static inline void ar2315_plat_mem_setup(void)
++static inline void ar2315_arch_init(void)
+{
+}
+
+void ar5312_arch_init_irq(void);
+void ar5312_init_devices(void);
+void ar5312_plat_time_init(void);
-+void ar5312_prom_init(void);
+void ar5312_plat_mem_setup(void);
++void ar5312_arch_init(void);
+
+#else
+
+{
+}
+
-+static inline void ar5312_prom_init(void)
++static inline void ar5312_plat_mem_setup(void)
+{
+}
+
-+static inline void ar5312_plat_mem_setup(void)
++static inline void ar5312_arch_init(void)
+{
+}
+
+#endif
--- /dev/null
+++ b/arch/mips/ath25/devices.c
-@@ -0,0 +1,180 @@
+@@ -0,0 +1,192 @@
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/serial.h>
+}
+
+device_initcall(ath25_register_devices);
++
++static int __init ath25_arch_init(void)
++{
++ if (is_ar5312())
++ ar5312_arch_init();
++ else
++ ar2315_arch_init();
++
++ return 0;
++}
++
++arch_initcall(ath25_arch_init);
else if (pending & CAUSEF_IP2)
do_IRQ(AR2315_IRQ_MISC_INTRS);
else if (pending & CAUSEF_IP7)
-@@ -428,3 +432,18 @@ void __init ar2315_plat_mem_setup(void)
+@@ -427,4 +431,10 @@ void __init ar2315_arch_init(void)
+ {
ath25_serial_setup(AR2315_UART0, AR2315_MISC_IRQ_UART0,
ar2315_apb_frequency());
- }
+
+#ifdef CONFIG_PCI_AR2315
-+static int __init ar2315_pci_init(void)
-+{
-+ struct platform_device *pdev;
-+
-+ if (!is_ar2315() || ath25_soc != ATH25_SOC_AR2315)
-+ return -ENODEV;
-+
-+ pdev = platform_device_register_simple("ar2315-pci", -1, NULL, 0);
-+
-+ return pdev ? 0 : -ENODEV;
-+}
-+arch_initcall(ar2315_pci_init);
++ if (ath25_soc == ATH25_SOC_AR2315) {
++ platform_device_register_simple("ar2315-pci", -1, NULL, 0);
++ }
+#endif
+ }