[MIPS] Remove mips_machtype for LASAT machines
authorThomas Bogendoerfer <tsbogend@alpha.franken.de>
Mon, 14 Jul 2008 14:58:47 +0000 (16:58 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 15 Jul 2008 17:44:39 +0000 (18:44 +0100)
This is the LASAT part of the mips_machtype removal.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/lasat/interrupt.c
arch/mips/lasat/lasat_board.c
arch/mips/lasat/prom.c
arch/mips/lasat/serial.c
arch/mips/lasat/setup.c
arch/mips/pci/pci-lasat.c
include/asm-mips/bootinfo.h
include/asm-mips/lasat/lasat.h

index a56c15026965ef06f859eac8844af98d6b48a8e0..d1ac7a25c85613635cdc14dc7858ff44d921e099 100644 (file)
@@ -22,8 +22,8 @@
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 
-#include <asm/bootinfo.h>
 #include <asm/irq_cpu.h>
+#include <asm/lasat/lasat.h>
 #include <asm/lasat/lasatint.h>
 
 #include <irq.h>
@@ -112,23 +112,18 @@ void __init arch_init_irq(void)
 {
        int i;
 
-       switch (mips_machtype) {
-       case MACH_LASAT_100:
-               lasat_int_status = (void *)LASAT_INT_STATUS_REG_100;
-               lasat_int_mask = (void *)LASAT_INT_MASK_REG_100;
-               lasat_int_mask_shift = LASATINT_MASK_SHIFT_100;
-               get_int_status = get_int_status_100;
-               *lasat_int_mask = 0;
-               break;
-       case MACH_LASAT_200:
+       if (IS_LASAT_200()) {
                lasat_int_status = (void *)LASAT_INT_STATUS_REG_200;
                lasat_int_mask = (void *)LASAT_INT_MASK_REG_200;
                lasat_int_mask_shift = LASATINT_MASK_SHIFT_200;
                get_int_status = get_int_status_200;
                *lasat_int_mask &= 0xffff;
-               break;
-       default:
-               panic("arch_init_irq: mips_machtype incorrect");
+       } else {
+               lasat_int_status = (void *)LASAT_INT_STATUS_REG_100;
+               lasat_int_mask = (void *)LASAT_INT_MASK_REG_100;
+               lasat_int_mask_shift = LASATINT_MASK_SHIFT_100;
+               get_int_status = get_int_status_100;
+               *lasat_int_mask = 0;
        }
 
        mips_cpu_irq_init();
index 31e328b3814df331be86a9a8ed346ca123d19910..577bb463a8711fd98fc6261ff1d9c7167ff77574 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/string.h>
 #include <linux/ctype.h>
 #include <linux/mutex.h>
-#include <asm/bootinfo.h>
 #include <asm/addrspace.h>
 #include "at93c.h"
 /* New model description table */
@@ -66,7 +65,7 @@ static void init_flash_sizes(void)
        ls[LASAT_MTD_SERVICE] = 0xC0000;
        ls[LASAT_MTD_NORMAL] = 0x100000;
 
-       if (mips_machtype == MACH_LASAT_100) {
+       if (!IS_LASAT_200()) {
                lasat_board_info.li_flash_base = 0x1e000000;
 
                lb[LASAT_MTD_BOOTLOADER] = 0x1e400000;
index 209edcc26f077e5dd643c5715e2e62708a3b7564..6acc6cb85f0ae8032e19af25dc85a79cf05a3760 100644 (file)
@@ -86,18 +86,16 @@ void __init prom_init(void)
 
        setup_prom_vectors();
 
-       if (current_cpu_data.cputype == CPU_R5000) {
+       if (IS_LASAT_200()) {
                printk(KERN_INFO "LASAT 200 board\n");
-               mips_machtype = MACH_LASAT_200;
                lasat_ndelay_divider = LASAT_200_DIVIDER;
+               at93c = &at93c_defs[1];
        } else {
                printk(KERN_INFO "LASAT 100 board\n");
-               mips_machtype = MACH_LASAT_100;
                lasat_ndelay_divider = LASAT_100_DIVIDER;
+               at93c = &at93c_defs[0];
        }
 
-       at93c = &at93c_defs[mips_machtype];
-
        lasat_init_board_info();                /* Read info from EEPROM */
 
        /* Get the command line */
index 205bd397d75bb7c5226f5dbe2015e57da5d45443..5bcb6e89ab78755282d2e53e73d7d56a1577c9ce 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/platform_device.h>
 #include <linux/serial_8250.h>
 
-#include <asm/bootinfo.h>
 #include <asm/lasat/lasat.h>
 #include <asm/lasat/serial.h>
 
@@ -47,7 +46,7 @@ static __init int lasat_uart_add(void)
        if (!pdev)
                return -ENOMEM;
 
-       if (mips_machtype == MACH_LASAT_100) {
+       if (!IS_LASAT_200()) {
                lasat_serial_res[0].start = KSEG1ADDR(LASAT_UART_REGS_BASE_100);
                lasat_serial_res[0].end = lasat_serial_res[0].start + LASAT_UART_REGS_SHIFT_100 * 8 - 1;
                lasat_serial_res[0].flags = IORESOURCE_MEM;
index e072da4ff3b3c6398e5f2cbb53ed8c7d402572e8..dbd3163a85c2fef53190e4646dbe832c17d6b212 100644 (file)
@@ -127,9 +127,11 @@ void __init plat_time_init(void)
 void __init plat_mem_setup(void)
 {
        int i;
-       lasat_misc  = &lasat_misc_info[mips_machtype];
+       int lasat_type = IS_LASAT_200() ? 1 : 0;
+
+       lasat_misc  = &lasat_misc_info[lasat_type];
 #ifdef CONFIG_PICVUE
-       picvue = &pvc_defs[mips_machtype];
+       picvue = &pvc_defs[lasat_type];
 #endif
 
        /* Set up panic notifier */
@@ -140,7 +142,7 @@ void __init plat_mem_setup(void)
        lasat_reboot_setup();
 
 #ifdef CONFIG_DS1603
-       ds1603 = &ds_defs[mips_machtype];
+       ds1603 = &ds_defs[lasat_type];
 #endif
 
 #ifdef DYNAMIC_SERIAL_INIT
index e70ae3236e0b4d045d974c0ee9c291c3e6185dc7..a98e543a514ab016e1f815e68fc572bc755f12fb 100644 (file)
@@ -10,7 +10,7 @@
 #include <linux/pci.h>
 #include <linux/types.h>
 
-#include <asm/bootinfo.h>
+#include <asm/lasat/lasat.h>
 
 #include <irq.h>
 
@@ -39,16 +39,10 @@ static int __init lasat_pci_setup(void)
 {
        printk(KERN_DEBUG "PCI: starting\n");
 
-       switch (mips_machtype) {
-       case MACH_LASAT_100:
-               lasat_pci_controller.pci_ops = &gt64xxx_pci0_ops;
-               break;
-       case MACH_LASAT_200:
+       if (IS_LASAT_200())
                lasat_pci_controller.pci_ops = &nile4_pci_ops;
-               break;
-       default:
-               panic("pcibios_init: mips_machtype incorrect");
-       }
+       else
+               lasat_pci_controller.pci_ops = &gt64xxx_pci0_ops;
 
        register_pci_controller(&lasat_pci_controller);
 
index 51dbec9dabfd6a5b2cf31e61943c78798c2ae6fc..d39e143b4a3c265f4b668b10dfd5ef8c31e9869c 100644 (file)
 #define  MACH_DS5800           9       /* DECsystem 5800               */
 #define  MACH_DS5900           10      /* DECsystem 5900               */
 
-/*
- * Valid machtype for group LASAT
- */
-#define  MACH_LASAT_100                0       /* Masquerade II/SP100/SP50/SP25 */
-#define  MACH_LASAT_200                1       /* Masquerade PRO/SP200 */
-
 /*
  * Valid machtype for group PMC-MSP
  */
index ea04d9262edc903aaa7a2e99877bc125a47cb888..caeba1e302a29c8b477348931e33be6284c009b2 100644 (file)
@@ -240,6 +240,8 @@ static inline void lasat_ndelay(unsigned int ns)
        __delay(ns / lasat_ndelay_divider);
 }
 
+#define IS_LASAT_200()     (current_cpu_data.cputype == CPU_R5000)
+
 #endif /* !defined (_LANGUAGE_ASSEMBLY) */
 
 #define LASAT_SERVICEMODE_MAGIC_1     0xdeadbeef