]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
[MIPS] checkfiles: Fix "need space after that ','" errors.
[mirror_ubuntu-artful-kernel.git] / arch / mips / tx4927 / toshiba_rbtx4927 / toshiba_rbtx4927_setup.c
index ea5a70b252a09c34a55ff6bb19131b115a9c7a03..acaf613358c7e4a0301708cfe6db079e0a91a2d4 100644 (file)
@@ -122,7 +122,7 @@ static const u32 toshiba_rbtx4927_setup_debug_flag =
            printk( "%s(%s:%u)::%s", __FUNCTION__, __FILE__, __LINE__, tmp ); \
         }
 #else
-#define TOSHIBA_RBTX4927_SETUP_DPRINTK(flag,str...)
+#define TOSHIBA_RBTX4927_SETUP_DPRINTK(flag, str...)
 #endif
 
 /* These functions are used for rebooting or halting the machine*/
@@ -151,7 +151,6 @@ unsigned long mips_memory_upper;
 static int tx4927_ccfg_toeon = 1;
 static int tx4927_pcic_trdyto = 0;     /* default: disabled */
 unsigned long tx4927_ce_base[8];
-void tx4927_pci_setup(void);
 void tx4927_reset_pci_pcic(void);
 int tx4927_pci66 = 0;          /* 0:auto */
 #endif
@@ -442,7 +441,7 @@ arch_initcall(tx4927_pcibios_init);
 extern struct resource pci_io_resource;
 extern struct resource pci_mem_resource;
 
-void tx4927_pci_setup(void)
+void __init tx4927_pci_setup(void)
 {
        static int called = 0;
        extern unsigned int tx4927_get_mem_size(void);
@@ -498,7 +497,7 @@ void tx4927_pci_setup(void)
                     "Internal");
                called = 1;
        }
-       printk("%s PCIC --%s PCICLK:",toshiba_name,
+       printk("%s PCIC --%s PCICLK:", toshiba_name,
               (tx4927_ccfgptr->ccfg & TX4927_CCFG_PCI66) ? " PCI66" : "");
        if (tx4927_ccfgptr->pcfg & TX4927_PCFG_PCICLKEN_ALL) {
                int pciclk = 0;
@@ -680,25 +679,30 @@ void tx4927_pci_setup(void)
 
 #endif /* CONFIG_PCI */
 
+static void __noreturn wait_forever(void)
+{
+       while (1)
+               if (cpu_wait)
+                       (*cpu_wait)();
+}
+
 void toshiba_rbtx4927_restart(char *command)
 {
        printk(KERN_NOTICE "System Rebooting...\n");
 
        /* enable the s/w reset register */
-       reg_wr08(RBTX4927_SW_RESET_ENABLE, RBTX4927_SW_RESET_ENABLE_SET);
+       writeb(RBTX4927_SW_RESET_ENABLE_SET, RBTX4927_SW_RESET_ENABLE);
 
        /* wait for enable to be seen */
-       while ((reg_rd08(RBTX4927_SW_RESET_ENABLE) &
+       while ((readb(RBTX4927_SW_RESET_ENABLE) &
                RBTX4927_SW_RESET_ENABLE_SET) == 0x00);
 
        /* do a s/w reset */
-       reg_wr08(RBTX4927_SW_RESET_DO, RBTX4927_SW_RESET_DO_SET);
+       writeb(RBTX4927_SW_RESET_DO_SET, RBTX4927_SW_RESET_DO);
 
        /* do something passive while waiting for reset */
        local_irq_disable();
-       while (1)
-               asm_wait();
-
+       wait_forever();
        /* no return */
 }
 
@@ -707,9 +711,7 @@ void toshiba_rbtx4927_halt(void)
 {
        printk(KERN_NOTICE "System Halted\n");
        local_irq_disable();
-       while (1) {
-               asm_wait();
-       }
+       wait_forever();
        /* no return */
 }
 
@@ -721,7 +723,7 @@ void toshiba_rbtx4927_power_off(void)
 
 void __init toshiba_rbtx4927_setup(void)
 {
-       vu32 cp0_config;
+       u32 cp0_config;
        char *argptr;
 
        printk("CPU is %s\n", toshiba_name);
@@ -748,21 +750,6 @@ void __init toshiba_rbtx4927_setup(void)
        }
 #endif
 
-       /* setup irq stuff */
-       TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
-                                      ":Setting up tx4927 pic.\n");
-       TX4927_WR(0xff1ff604, 0x00000400);      /* irq trigger */
-       TX4927_WR(0xff1ff608, 0x00000000);      /* irq trigger */
-
-       /* setup serial stuff */
-       TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
-                                      ":Setting up tx4927 sio.\n");
-       TX4927_WR(0xff1ff314, 0x00000000);      /* h/w flow control off */
-       TX4927_WR(0xff1ff414, 0x00000000);      /* h/w flow control off */
-
-       TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
-                                      "+\n");
-
        set_io_port_base(KSEG1 + TBTX4927_ISA_IO_OFFSET);
        TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
                                       ":mips_io_port_base=0x%08lx\n",
@@ -915,7 +902,7 @@ void __init toshiba_rbtx4927_setup(void)
                        req.iotype = UPIO_MEM;
                        req.membase = (char *)(0xff1ff300 + i * 0x100);
                        req.mapbase = 0xff1ff300 + i * 0x100;
-                       req.irq = 32 + i;
+                       req.irq = TX4927_IRQ_PIC_BEG + 8 + i;
                        req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/;
                        req.uartclk = 50000000;
                        early_serial_txx9_setup(&req);