[MIPS] Deforest the function pointer jungle in the time code.
[firefly-linux-kernel-4.4.55.git] / arch / mips / basler / excite / excite_setup.c
index 3d7670edd5cd50d996ec469875fa4dec429ab2bc..68be19d1802efbcbbd7d1dfee772970eb4e5e052 100644 (file)
@@ -19,7 +19,6 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -27,6 +26,7 @@
 #include <linux/tty.h>
 #include <linux/serial_core.h>
 #include <linux/serial.h>
+#include <linux/serial_8250.h>
 #include <linux/ioport.h>
 #include <linux/spinlock.h>
 #include <asm/bootinfo.h>
@@ -64,11 +64,11 @@ volatile void __iomem * const ocd_base = (void *) (EXCITE_ADDR_OCD);
 volatile void __iomem * const titan_base = (void *) (EXCITE_ADDR_TITAN);
 
 /* Protect access to shared GPI registers */
-spinlock_t titan_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(titan_lock);
 int titan_irqflags;
 
 
-static void excite_timer_init(void)
+void __init plat_time_init(void)
 {
        const u32 modebit5 = ocd_readl(0x00e4);
        unsigned int
@@ -79,7 +79,7 @@ static void excite_timer_init(void)
        mips_hpt_frequency = EXCITE_CPU_EXT_CLOCK * mult / div / 2;
 }
 
-static void excite_timer_setup(struct irqaction *irq)
+void __init plat_timer_setup(struct irqaction *irq)
 {
        /* The eXcite platform uses the alternate timer interrupt */
        set_c0_intcontrol(0x80);
@@ -113,7 +113,7 @@ static int __init excite_init_console(void)
        up.irq          = TITAN_IRQ;
        up.uartclk      = TITAN_UART_CLK;
        up.regshift     = 0;
-       up.iotype       = UPIO_MEM32;
+       up.iotype       = UPIO_RM9000;
        up.type         = PORT_RM9000;
        up.flags        = UPF_SHARE_IRQ;
        up.line         = 0;
@@ -261,10 +261,6 @@ void __init plat_mem_setup(void)
        /* Announce RAM to system */
        add_memory_region(0x00000000, memsize, BOOT_MEM_RAM);
 
-       /* Set up timer initialization hooks */
-       board_time_init = excite_timer_init;
-       board_timer_setup = excite_timer_setup;
-
        /* Set up the peripheral address map */
        *(boot_ocd_base + (LKB9 / sizeof (u32))) = 0;
        *(boot_ocd_base + (LKB10 / sizeof (u32))) = 0;