Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / arch / ppc / platforms / prep_setup.c
index bc926be..e86f615 100644 (file)
@@ -1,6 +1,4 @@
 /*
- *  arch/ppc/platforms/setup.c
- *
  *  Copyright (C) 1995  Linus Torvalds
  *  Adapted from 'alpha' version by Gary Thomas
  *  Modified by Cort Dougan (cort@cs.nmt.edu)
 #include <asm/pci-bridge.h>
 #include <asm/todc.h>
 
+/* prep registers for L2 */
+#define CACHECRBA       0x80000823      /* Cache configuration register address */
+#define L2CACHE_MASK   0x03    /* Mask for 2 L2 Cache bits */
+#define L2CACHE_512KB  0x00    /* 512KB */
+#define L2CACHE_256KB  0x01    /* 256KB */
+#define L2CACHE_1MB    0x02    /* 1MB */
+#define L2CACHE_NONE   0x03    /* NONE */
+#define L2CACHE_PARITY  0x08    /* Mask for L2 Cache Parity Protected bit */
+
 TODC_ALLOC();
 
-unsigned char ucSystemType;
 unsigned char ucBoardRev;
 unsigned char ucBoardRevMaj, ucBoardRevMin;
 
@@ -89,9 +95,6 @@ extern void prep_tiger1_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi
 #define cached_21      (((char *)(ppc_cached_irq_mask))[3])
 #define cached_A1      (((char *)(ppc_cached_irq_mask))[2])
 
-/* for the mac fs */
-dev_t boot_dev;
-
 #ifdef CONFIG_SOUND_CS4232
 long ppc_cs4232_dma, ppc_cs4232_dma2;
 #endif
@@ -173,7 +176,7 @@ prep_carolina_enable_l2(void)
 }
 
 /* cpuinfo code common to all IBM PReP */
-static void __prep
+static void
 prep_ibm_cpuinfo(struct seq_file *m)
 {
        unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
@@ -209,14 +212,14 @@ prep_ibm_cpuinfo(struct seq_file *m)
        }
 }
 
-static int __prep
+static int
 prep_gen_cpuinfo(struct seq_file *m)
 {
        prep_ibm_cpuinfo(m);
        return 0;
 }
 
-static int __prep
+static int
 prep_sandalfoot_cpuinfo(struct seq_file *m)
 {
        unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
@@ -243,7 +246,7 @@ prep_sandalfoot_cpuinfo(struct seq_file *m)
        return 0;
 }
 
-static int __prep
+static int
 prep_thinkpad_cpuinfo(struct seq_file *m)
 {
        unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
@@ -314,7 +317,7 @@ prep_thinkpad_cpuinfo(struct seq_file *m)
        return 0;
 }
 
-static int __prep
+static int
 prep_carolina_cpuinfo(struct seq_file *m)
 {
        unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
@@ -350,7 +353,7 @@ prep_carolina_cpuinfo(struct seq_file *m)
        return 0;
 }
 
-static int __prep
+static int
 prep_tiger1_cpuinfo(struct seq_file *m)
 {
        unsigned int l2_reg = inb(PREP_IBM_L2INFO);
@@ -393,7 +396,7 @@ prep_tiger1_cpuinfo(struct seq_file *m)
 
 
 /* Used by all Motorola PReP */
-static int __prep
+static int
 prep_mot_cpuinfo(struct seq_file *m)
 {
        unsigned int cachew = *((unsigned char *)CACHECRBA);
@@ -454,7 +457,7 @@ no_l2:
        return 0;
 }
 
-static void __prep
+static void
 prep_restart(char *cmd)
 {
 #define PREP_SP92      0x92    /* Special Port 92 */
@@ -473,7 +476,7 @@ prep_restart(char *cmd)
 #undef PREP_SP92
 }
 
-static void __prep
+static void
 prep_halt(void)
 {
        local_irq_disable(); /* no interrupts */
@@ -488,7 +491,7 @@ prep_halt(void)
 /* Carrera is the power manager in the Thinkpads. Unfortunately not much is
  * known about it, so we can't power down.
  */
-static void __prep
+static void
 prep_carrera_poweroff(void)
 {
        prep_halt();
@@ -501,7 +504,7 @@ prep_carrera_poweroff(void)
  * somewhat in the IBM Carolina Technical Specification.
  * -Hollis
  */
-static void __prep
+static void
 utah_sig87c750_setbit(unsigned int bytenum, unsigned int bitnum, int value)
 {
        /*
@@ -539,7 +542,7 @@ utah_sig87c750_setbit(unsigned int bytenum, unsigned int bitnum, int value)
        udelay(100);                            /* important: let controller recover */
 }
 
-static void __prep
+static void
 prep_sig750_poweroff(void)
 {
        /* tweak the power manager found in most IBM PRePs (except Thinkpads) */
@@ -554,7 +557,7 @@ prep_sig750_poweroff(void)
        /* not reached */
 }
 
-static int __prep
+static int
 prep_show_percpuinfo(struct seq_file *m, int i)
 {
        /* PREP's without residual data will give incorrect values here */
@@ -700,12 +703,12 @@ prep_set_bat(void)
 /*
  * IBM 3-digit status LED
  */
-static unsigned int ibm_statusled_base __prepdata;
+static unsigned int ibm_statusled_base;
 
-static void __prep
+static void
 ibm_statusled_progress(char *s, unsigned short hex);
 
-static int __prep
+static int
 ibm_statusled_panic(struct notifier_block *dummy1, unsigned long dummy2,
                    void * dummy3)
 {
@@ -713,13 +716,13 @@ ibm_statusled_panic(struct notifier_block *dummy1, unsigned long dummy2,
        return NOTIFY_DONE;
 }
 
-static struct notifier_block ibm_statusled_block __prepdata = {
+static struct notifier_block ibm_statusled_block = {
        ibm_statusled_panic,
        NULL,
        INT_MAX /* try to do it first */
 };
 
-static void __prep
+static void
 ibm_statusled_progress(char *s, unsigned short hex)
 {
        static int notifier_installed;
@@ -733,7 +736,7 @@ ibm_statusled_progress(char *s, unsigned short hex)
                hex = 0xfff;
                if (!notifier_installed) {
                        ++notifier_installed;
-                       notifier_chain_register(&panic_notifier_list,
+                       atomic_notifier_chain_register(&panic_notifier_list,
                                                &ibm_statusled_block);
                }
        }
@@ -945,23 +948,9 @@ prep_calibrate_decr(void)
                todc_calibrate_decr();
 }
 
-static unsigned int __prep
-prep_irq_canonicalize(u_int irq)
-{
-       if (irq == 2)
-       {
-               return 9;
-       }
-       else
-       {
-               return irq;
-       }
-}
-
 static void __init
 prep_init_IRQ(void)
 {
-       int i;
        unsigned int pci_viddid, pci_did;
 
        if (OpenPIC_Addr != NULL) {
@@ -970,11 +959,9 @@ prep_init_IRQ(void)
                openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
                                       i8259_irq);
        }
-       for ( i = 0 ; i < NUM_8259_INTERRUPTS ; i++ )
-               irq_desc[i].handler = &i8259_pic;
 
        if (have_residual_data) {
-               i8259_init(residual_isapic_addr());
+               i8259_init(residual_isapic_addr(), 0);
                return;
        }
 
@@ -985,18 +972,18 @@ prep_init_IRQ(void)
        if (((pci_viddid & 0xffff) == PCI_VENDOR_ID_MOTOROLA)
                        && ((pci_did == PCI_DEVICE_ID_MOTOROLA_RAVEN)
                                || (pci_did == PCI_DEVICE_ID_MOTOROLA_HAWK)))
-               i8259_init(0);
+               i8259_init(0, 0);
        else
                /* PCI interrupt ack address given in section 6.1.8 of the
                 * PReP specification. */
-               i8259_init(MPC10X_MAPA_PCI_INTACK_ADDR);
+               i8259_init(MPC10X_MAPA_PCI_INTACK_ADDR, 0);
 }
 
 #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
 /*
  * IDE stuff.
  */
-static int __prep
+static int
 prep_ide_default_irq(unsigned long base)
 {
        switch (base) {
@@ -1010,7 +997,7 @@ prep_ide_default_irq(unsigned long base)
        }
 }
 
-static unsigned long __prep
+static unsigned long
 prep_ide_default_io_base(int index)
 {
        switch (index) {
@@ -1055,7 +1042,7 @@ smp_prep_setup_cpu(int cpu_nr)
                do_openpic_setup_cpu();
 }
 
-static struct smp_ops_t prep_smp_ops __prepdata = {
+static struct smp_ops_t prep_smp_ops = {
        smp_openpic_message_pass,
        smp_prep_probe,
        smp_prep_kick_cpu,
@@ -1080,15 +1067,13 @@ prep_map_io(void)
 static int __init
 prep_request_io(void)
 {
-       if (_machine == _MACH_prep) {
 #ifdef CONFIG_NVRAM
-               request_region(PREP_NVRAM_AS0, 0x8, "nvram");
+       request_region(PREP_NVRAM_AS0, 0x8, "nvram");
 #endif
-               request_region(0x00,0x20,"dma1");
-               request_region(0x40,0x20,"timer");
-               request_region(0x80,0x10,"dma page reg");
-               request_region(0xc0,0x20,"dma2");
-       }
+       request_region(0x00,0x20,"dma1");
+       request_region(0x40,0x20,"timer");
+       request_region(0x80,0x10,"dma page reg");
+       request_region(0xc0,0x20,"dma2");
 
        return 0;
 }
@@ -1113,6 +1098,7 @@ prep_init(unsigned long r3, unsigned long r4, unsigned long r5,
        ISA_DMA_THRESHOLD = 0x00ffffff;
        DMA_MODE_READ = 0x44;
        DMA_MODE_WRITE = 0x48;
+       ppc_do_canonicalize_irqs = 1;
 
        /* figure out what kind of prep workstation we are */
        if (have_residual_data) {
@@ -1139,7 +1125,6 @@ prep_init(unsigned long r3, unsigned long r4, unsigned long r5,
        ppc_md.setup_arch     = prep_setup_arch;
        ppc_md.show_percpuinfo = prep_show_percpuinfo;
        ppc_md.show_cpuinfo   = NULL; /* set in prep_setup_arch() */
-       ppc_md.irq_canonicalize = prep_irq_canonicalize;
        ppc_md.init_IRQ       = prep_init_IRQ;
        /* this gets changed later on if we have an OpenPIC -- Cort */
        ppc_md.get_irq        = i8259_irq;
@@ -1176,6 +1161,6 @@ prep_init(unsigned long r3, unsigned long r4, unsigned long r5,
 #endif
 
 #ifdef CONFIG_SMP
-       ppc_md.smp_ops           = &prep_smp_ops;
+       smp_ops                  = &prep_smp_ops;
 #endif /* CONFIG_SMP */
 }