fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / mips / pmc-sierra / yosemite / setup.c
index 7225bbf..1b9b0d3 100644 (file)
@@ -46,7 +46,6 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/processor.h>
-#include <asm/ptrace.h>
 #include <asm/reboot.h>
 #include <asm/serial.h>
 #include <asm/titan_dep.h>
@@ -73,7 +72,9 @@ void __init bus_error_init(void)
 unsigned long m48t37y_get_time(void)
 {
        unsigned int year, month, day, hour, min, sec;
+       unsigned long flags;
 
+       spin_lock_irqsave(&rtc_lock, flags);
        /* Stop the update to the time */
        m48t37_base->control = 0x40;
 
@@ -88,6 +89,7 @@ unsigned long m48t37y_get_time(void)
 
        /* Start the update to the time again */
        m48t37_base->control = 0x00;
+       spin_unlock_irqrestore(&rtc_lock, flags);
 
        return mktime(year, month, day, hour, min, sec);
 }
@@ -95,11 +97,13 @@ unsigned long m48t37y_get_time(void)
 int m48t37y_set_time(unsigned long sec)
 {
        struct rtc_time tm;
+       unsigned long flags;
 
        /* convert to a more useful format -- note months count from 0 */
        to_tm(sec, &tm);
        tm.tm_mon += 1;
 
+       spin_lock_irqsave(&rtc_lock, flags);
        /* enable writing */
        m48t37_base->control = 0x80;
 
@@ -123,18 +127,18 @@ int m48t37y_set_time(unsigned long sec)
 
        /* disable writing */
        m48t37_base->control = 0x00;
+       spin_unlock_irqrestore(&rtc_lock, flags);
 
        return 0;
 }
 
-void yosemite_timer_setup(struct irqaction *irq)
+void __init plat_timer_setup(struct irqaction *irq)
 {
        setup_irq(7, irq);
 }
 
 void yosemite_time_init(void)
 {
-       board_timer_setup = yosemite_timer_setup;
        mips_hpt_frequency = cpu_clock / 2;
 mips_hpt_frequency = 33000000 * 3 * 5;
 }
@@ -179,7 +183,7 @@ static void __init py_uart_setup(void)
        up.uartclk      = TITAN_UART_CLK;
        up.regshift     = 0;
        up.iotype       = UPIO_MEM;
-       up.flags        = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
+       up.flags        = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
        up.line         = 0;
 
        if (early_serial_setup(&up))
@@ -192,8 +196,8 @@ static void __init py_rtc_setup(void)
        if (!m48t37_base)
                printk(KERN_ERR "Mapping the RTC failed\n");
 
-       rtc_get_time = m48t37y_get_time;
-       rtc_set_time = m48t37y_set_time;
+       rtc_mips_get_time = m48t37y_get_time;
+       rtc_mips_set_time = m48t37y_set_time;
 
        write_seqlock(&xtime_lock);
        xtime.tv_sec = m48t37y_get_time();
@@ -212,7 +216,7 @@ static void __init py_late_time_init(void)
        py_rtc_setup();
 }
 
-static int __init pmc_yosemite_setup(void)
+void __init plat_mem_setup(void)
 {
        board_time_init = yosemite_time_init;
        late_time_init = py_late_time_init;
@@ -228,8 +232,4 @@ static int __init pmc_yosemite_setup(void)
        OCD_WRITE(RM9000x2_OCD_HTBAR0, HYPERTRANSPORT_BAR0_ADDR);
        OCD_WRITE(RM9000x2_OCD_HTMASK0, HYPERTRANSPORT_SIZE0);
 #endif
-
-       return 0;
 }
-
-early_initcall(pmc_yosemite_setup);