Merge from Linus' tree
authorPaul Mackerras <paulus@samba.org>
Wed, 12 Oct 2005 04:43:32 +0000 (14:43 +1000)
committerPaul Mackerras <paulus@samba.org>
Wed, 12 Oct 2005 04:43:32 +0000 (14:43 +1000)
22 files changed:
1  2 
arch/powerpc/platforms/pseries/pci.c
arch/ppc/platforms/4xx/ebony.c
arch/ppc/platforms/chestnut.c
arch/ppc/platforms/chrp_setup.c
arch/ppc/platforms/gemini_setup.c
arch/ppc/platforms/pmac_cpufreq.c
arch/ppc/platforms/pmac_feature.c
arch/ppc/platforms/pmac_setup.c
arch/ppc/platforms/pmac_time.c
arch/ppc/platforms/pplus.c
arch/ppc/platforms/radstone_ppc7d.c
arch/ppc/platforms/sandpoint.c
arch/ppc/syslib/open_pic.c
arch/ppc/syslib/open_pic2.c
arch/ppc/syslib/ppc4xx_setup.c
arch/ppc64/kernel/bpa_iommu.c
arch/ppc64/kernel/kprobes.c
arch/ppc64/kernel/pci_direct_iommu.c
arch/ppc64/kernel/pci_iommu.c
drivers/macintosh/smu.c
include/asm-ppc/io.h
include/asm-ppc64/iommu.h

index 2dd477eb1c53506b10ef4867e0dbe3c1a5a575ee,0000000000000000000000000000000000000000..c198656a3bb5723faae617ec52406a17a718ff02
mode 100644,000000..100644
--- /dev/null
@@@ -1,142 -1,0 +1,142 @@@
- static int __initdata s7a_workaround = -1;
 +/*
 + * arch/ppc64/kernel/pSeries_pci.c
 + *
 + * Copyright (C) 2001 Dave Engebretsen, IBM Corporation
 + * Copyright (C) 2003 Anton Blanchard <anton@au.ibm.com>, IBM
 + *
 + * pSeries specific routines for PCI.
 + * 
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License as published by
 + * the Free Software Foundation; either version 2 of the License, or
 + * (at your option) any later version.
 + *    
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + * 
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 + */
 +
 +#include <linux/init.h>
 +#include <linux/ioport.h>
 +#include <linux/kernel.h>
 +#include <linux/pci.h>
 +#include <linux/string.h>
 +
 +#include <asm/pci-bridge.h>
 +#include <asm/prom.h>
 +#include <asm/ppc-pci.h>
 +
- static void __init check_s7a(void)
++static int __devinitdata s7a_workaround = -1;
 +
 +#if 0
 +void pcibios_name_device(struct pci_dev *dev)
 +{
 +      struct device_node *dn;
 +
 +      /*
 +       * Add IBM loc code (slot) as a prefix to the device names for service
 +       */
 +      dn = pci_device_to_OF_node(dev);
 +      if (dn) {
 +              char *loc_code = get_property(dn, "ibm,loc-code", 0);
 +              if (loc_code) {
 +                      int loc_len = strlen(loc_code);
 +                      if (loc_len < sizeof(dev->dev.name)) {
 +                              memmove(dev->dev.name+loc_len+1, dev->dev.name,
 +                                      sizeof(dev->dev.name)-loc_len-1);
 +                              memcpy(dev->dev.name, loc_code, loc_len);
 +                              dev->dev.name[loc_len] = ' ';
 +                              dev->dev.name[sizeof(dev->dev.name)-1] = '\0';
 +                      }
 +              }
 +      }
 +}   
 +DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_name_device);
 +#endif
 +
++static void __devinit check_s7a(void)
 +{
 +      struct device_node *root;
 +      char *model;
 +
 +      s7a_workaround = 0;
 +      root = of_find_node_by_path("/");
 +      if (root) {
 +              model = get_property(root, "model", NULL);
 +              if (model && !strcmp(model, "IBM,7013-S7A"))
 +                      s7a_workaround = 1;
 +              of_node_put(root);
 +      }
 +}
 +
 +void __devinit pSeries_irq_bus_setup(struct pci_bus *bus)
 +{
 +      struct pci_dev *dev;
 +
 +      if (s7a_workaround < 0)
 +              check_s7a();
 +      list_for_each_entry(dev, &bus->devices, bus_list) {
 +              pci_read_irq_line(dev);
 +              if (s7a_workaround) {
 +                      if (dev->irq > 16) {
 +                              dev->irq -= 3;
 +                              pci_write_config_byte(dev, PCI_INTERRUPT_LINE,
 +                                      dev->irq);
 +                      }
 +              }
 +      }
 +}
 +
 +static void __init pSeries_request_regions(void)
 +{
 +      if (!isa_io_base)
 +              return;
 +
 +      request_region(0x20,0x20,"pic1");
 +      request_region(0xa0,0x20,"pic2");
 +      request_region(0x00,0x20,"dma1");
 +      request_region(0x40,0x20,"timer");
 +      request_region(0x80,0x10,"dma page reg");
 +      request_region(0xc0,0x20,"dma2");
 +}
 +
 +void __init pSeries_final_fixup(void)
 +{
 +      phbs_remap_io();
 +      pSeries_request_regions();
 +
 +      pci_addr_cache_build();
 +}
 +
 +/*
 + * Assume the winbond 82c105 is the IDE controller on a
 + * p610.  We should probably be more careful in case
 + * someone tries to plug in a similar adapter.
 + */
 +static void fixup_winbond_82c105(struct pci_dev* dev)
 +{
 +      int i;
 +      unsigned int reg;
 +
 +      if (!(systemcfg->platform & PLATFORM_PSERIES))
 +              return;
 +
 +      printk("Using INTC for W82c105 IDE controller.\n");
 +      pci_read_config_dword(dev, 0x40, &reg);
 +      /* Enable LEGIRQ to use INTC instead of ISA interrupts */
 +      pci_write_config_dword(dev, 0x40, reg | (1<<11));
 +
 +      for (i = 0; i < DEVICE_COUNT_RESOURCE; ++i) {
 +              /* zap the 2nd function of the winbond chip */
 +              if (dev->resource[i].flags & IORESOURCE_IO
 +                  && dev->bus->number == 0 && dev->devfn == 0x81)
 +                      dev->resource[i].flags &= ~IORESOURCE_IO;
 +      }
 +}
 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,
 +                       fixup_winbond_82c105);
index 9decb72e7aafba9705d38614031add34bcba4a25,27b778ab903b89b40c15ed354d3eb9cda471e887..d32ae112f63936ca754dd4abb12c049e3568e923
@@@ -30,7 -30,6 +30,6 @@@
  #include <linux/delay.h>
  #include <linux/ide.h>
  #include <linux/initrd.h>
- #include <linux/irq.h>
  #include <linux/seq_file.h>
  #include <linux/root_dev.h>
  #include <linux/tty.h>
@@@ -91,7 -90,7 +90,7 @@@ ebony_calibrate_decr(void
         * on Rev. C silicon then errata forces us to
         * use the internal clock.
         */
 -      if (strcmp(cur_cpu_spec[0]->cpu_name, "440GP Rev. B") == 0)
 +      if (strcmp(cur_cpu_spec->cpu_name, "440GP Rev. B") == 0)
                freq = EBONY_440GP_RB_SYSCLK;
        else
                freq = EBONY_440GP_RC_SYSCLK;
index b3d3bdb3936bb1b503992cb86f438f68180a156e,df6ff98c023ac048d387878ba937371cc0d9a531..48a4a510d598c812ad36896aba2ce629acdc2628
@@@ -35,7 -35,6 +35,6 @@@
  #include <asm/time.h>
  #include <asm/dma.h>
  #include <asm/io.h>
- #include <linux/irq.h>
  #include <asm/hw_irq.h>
  #include <asm/machdep.h>
  #include <asm/kgdb.h>
@@@ -542,6 -541,7 +541,6 @@@ platform_init(unsigned long r3, unsigne
  
        ppc_md.setup_arch = chestnut_setup_arch;
        ppc_md.show_cpuinfo = chestnut_show_cpuinfo;
 -      ppc_md.irq_canonicalize = NULL;
        ppc_md.init_IRQ = mv64360_init_irq;
        ppc_md.get_irq = mv64360_get_irq;
        ppc_md.init = NULL;
index a0cf1b6fdbfe4937138cec8fdce82a8a772be93c,66346f0de7ec14178b218146a75d7e716b0c3577..8c874e957a4b33ea559de56146535e02a5090494
@@@ -32,7 -32,6 +32,6 @@@
  #include <linux/module.h>
  #include <linux/delay.h>
  #include <linux/ide.h>
- #include <linux/irq.h>
  #include <linux/console.h>
  #include <linux/seq_file.h>
  #include <linux/root_dev.h>
@@@ -105,7 -104,7 +104,7 @@@ static const char *gg2_cachemodes[4] = 
        "Disabled", "Write-Through", "Copy-Back", "Transparent Mode"
  };
  
 -int __chrp
 +int
  chrp_show_cpuinfo(struct seq_file *m)
  {
        int i, sdramen;
@@@ -303,7 -302,7 +302,7 @@@ void __init chrp_setup_arch(void
        pci_create_OF_bus_map();
  }
  
 -void __chrp
 +void
  chrp_event_scan(void)
  {
        unsigned char log[1024];
        ppc_md.heartbeat_count = ppc_md.heartbeat_reset;
  }
  
 -void __chrp
 +void
  chrp_restart(char *cmd)
  {
        printk("RTAS system-reboot returned %d\n",
        for (;;);
  }
  
 -void __chrp
 +void
  chrp_power_off(void)
  {
        /* allow power on only with power button press */
        for (;;);
  }
  
 -void __chrp
 +void
  chrp_halt(void)
  {
        chrp_power_off();
  }
  
 -u_int __chrp
 -chrp_irq_canonicalize(u_int irq)
 -{
 -      if (irq == 2)
 -              return 9;
 -      return irq;
 -}
 -
  /*
   * Finds the open-pic node and sets OpenPIC_Addr based on its reg property.
   * Then checks if it has an interrupt-ranges property.  If it does then
@@@ -492,7 -499,6 +491,7 @@@ chrp_init(unsigned long r3, unsigned lo
        DMA_MODE_READ = 0x44;
        DMA_MODE_WRITE = 0x48;
        isa_io_base = CHRP_ISA_IO_BASE;         /* default value */
 +      ppc_do_canonicalize_irqs = 1;
  
        if (root)
                machine = get_property(root, "model", NULL);
        ppc_md.show_percpuinfo = of_show_percpuinfo;
        ppc_md.show_cpuinfo   = chrp_show_cpuinfo;
  
 -      ppc_md.irq_canonicalize = chrp_irq_canonicalize;
        ppc_md.init_IRQ       = chrp_init_IRQ;
        if (_chrp_type == _CHRP_Pegasos)
                ppc_md.get_irq        = i8259_irq;
        if (ppc_md.progress) ppc_md.progress("Linux/PPC "UTS_RELEASE"\n", 0x0);
  }
  
 -void __chrp
 +void
  rtas_display_progress(char *s, unsigned short hex)
  {
        int width;
        call_rtas( "display-character", 1, 1, NULL, ' ' );
  }
  
 -void __chrp
 +void
  rtas_indicator_progress(char *s, unsigned short hex)
  {
        call_rtas("set-indicator", 3, 1, NULL, 6, 0, hex);
index a2a09dc4b5e2f5de5f558485253c2501e9e02ac5,3a5ff9fb71d6e1cae9e8806cc2f63e3115e545c0..ec6aa04d001e967e9059e71f3a0277cf6a2fc22d
@@@ -21,7 -21,6 +21,6 @@@
  #include <linux/major.h>
  #include <linux/initrd.h>
  #include <linux/console.h>
- #include <linux/irq.h>
  #include <linux/seq_file.h>
  #include <linux/root_dev.h>
  #include <linux/bcd.h>
@@@ -36,7 -35,6 +35,7 @@@
  #include <asm/time.h>
  #include <asm/open_pic.h>
  #include <asm/bootinfo.h>
 +#include <asm/machdep.h>
  
  void gemini_find_bridges(void);
  static int gemini_get_clock_speed(void);
@@@ -557,6 -555,7 +556,6 @@@ void __init platform_init(unsigned lon
  
        ppc_md.setup_arch = gemini_setup_arch;
        ppc_md.show_cpuinfo = gemini_show_cpuinfo;
 -      ppc_md.irq_canonicalize = NULL;
        ppc_md.init_IRQ = gemini_init_IRQ;
        ppc_md.get_irq = openpic_get_irq;
        ppc_md.init = NULL;
index ebb8be9bf8aa783381ab3d4f20eb1e43fe476e05,d4bc5f67ec5358f42aa79c0f68b58ac1e55f7920..fba7e4d7c0bf543ba18f910dd30e2555f07510b6
@@@ -136,7 -136,7 +136,7 @@@ static inline void debug_calc_bogomips(
  
  /* Switch CPU speed under 750FX CPU control
   */
 -static int __pmac cpu_750fx_cpu_speed(int low_speed)
 +static int cpu_750fx_cpu_speed(int low_speed)
  {
        u32 hid2;
  
        return 0;
  }
  
 -static unsigned int __pmac cpu_750fx_get_cpu_speed(void)
 +static unsigned int cpu_750fx_get_cpu_speed(void)
  {
        if (mfspr(SPRN_HID1) & HID1_PS)
                return low_freq;
  }
  
  /* Switch CPU speed using DFS */
 -static int __pmac dfs_set_cpu_speed(int low_speed)
 +static int dfs_set_cpu_speed(int low_speed)
  {
        if (low_speed == 0) {
                /* ramping up, set voltage first */
        return 0;
  }
  
 -static unsigned int __pmac dfs_get_cpu_speed(void)
 +static unsigned int dfs_get_cpu_speed(void)
  {
        if (mfspr(SPRN_HID1) & HID1_DFS)
                return low_freq;
  
  /* Switch CPU speed using slewing GPIOs
   */
 -static int __pmac gpios_set_cpu_speed(int low_speed)
 +static int gpios_set_cpu_speed(int low_speed)
  {
        int gpio, timeout = 0;
  
  
  /* Switch CPU speed under PMU control
   */
 -static int __pmac pmu_set_cpu_speed(int low_speed)
 +static int pmu_set_cpu_speed(int low_speed)
  {
        struct adb_request req;
        unsigned long save_l2cr;
        return 0;
  }
  
 -static int __pmac do_set_cpu_speed(int speed_mode, int notify)
 +static int do_set_cpu_speed(int speed_mode, int notify)
  {
        struct cpufreq_freqs freqs;
        unsigned long l3cr;
        return 0;
  }
  
 -static unsigned int __pmac pmac_cpufreq_get_speed(unsigned int cpu)
 +static unsigned int pmac_cpufreq_get_speed(unsigned int cpu)
  {
        return cur_freq;
  }
  
 -static int __pmac pmac_cpufreq_verify(struct cpufreq_policy *policy)
 +static int pmac_cpufreq_verify(struct cpufreq_policy *policy)
  {
        return cpufreq_frequency_table_verify(policy, pmac_cpu_freqs);
  }
  
 -static int __pmac pmac_cpufreq_target(        struct cpufreq_policy *policy,
 +static int pmac_cpufreq_target(       struct cpufreq_policy *policy,
                                        unsigned int target_freq,
                                        unsigned int relation)
  {
        return do_set_cpu_speed(newstate, 1);
  }
  
 -unsigned int __pmac pmac_get_one_cpufreq(int i)
 +unsigned int pmac_get_one_cpufreq(int i)
  {
        /* Supports only one CPU for now */
        return (i == 0) ? cur_freq : 0;
  }
  
 -static int __pmac pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
 +static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
  {
        if (policy->cpu != 0)
                return -ENODEV;
        return cpufreq_frequency_table_cpuinfo(policy, pmac_cpu_freqs);
  }
  
 -static u32 __pmac read_gpio(struct device_node *np)
 +static u32 read_gpio(struct device_node *np)
  {
        u32 *reg = (u32 *)get_property(np, "reg", NULL);
        u32 offset;
        return offset;
  }
  
 -static int __pmac pmac_cpufreq_suspend(struct cpufreq_policy *policy, pm_message_t pmsg)
 +static int pmac_cpufreq_suspend(struct cpufreq_policy *policy, pm_message_t pmsg)
  {
        /* Ok, this could be made a bit smarter, but let's be robust for now. We
         * always force a speed change to high speed before sleep, to make sure
        return 0;
  }
  
 -static int __pmac pmac_cpufreq_resume(struct cpufreq_policy *policy)
 +static int pmac_cpufreq_resume(struct cpufreq_policy *policy)
  {
        /* If we resume, first check if we have a get() function */
        if (get_speed_proc)
@@@ -501,7 -501,7 +501,7 @@@ static struct cpufreq_driver pmac_cpufr
  };
  
  
 -static int __pmac pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
 +static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
  {
        struct device_node *volt_gpio_np = of_find_node_by_name(NULL,
                                                                "voltage-gpio");
        return 0;
  }
  
 -static int __pmac pmac_cpufreq_init_7447A(struct device_node *cpunode)
 +static int pmac_cpufreq_init_7447A(struct device_node *cpunode)
  {
        struct device_node *volt_gpio_np;
  
        return 0;
  }
  
 -static int __pmac pmac_cpufreq_init_750FX(struct device_node *cpunode)
 +static int pmac_cpufreq_init_750FX(struct device_node *cpunode)
  {
        struct device_node *volt_gpio_np;
        u32 pvr, *value;
@@@ -695,6 -695,13 +695,13 @@@ static int __init pmac_cpufreq_setup(vo
                set_speed_proc = pmu_set_cpu_speed;
                is_pmu_based = 1;
        }
+       /* Else check for TiPb 550 */
+       else if (machine_is_compatible("PowerBook3,3") && cur_freq == 550000) {
+               hi_freq = cur_freq;
+               low_freq = 500000;
+               set_speed_proc = pmu_set_cpu_speed;
+               is_pmu_based = 1;
+       }
        /* Else check for TiPb 400 & 500 */
        else if (machine_is_compatible("PowerBook3,2")) {
                /* We only know about the 400 MHz and the 500Mhz model
index e8cd0a8b6a76a3f013e3d4073b784574f97c38aa,dd6d45ae0501cac648d845ea701bb24faa21685c..58884a63ebdbed4983e509ff3d24dec6fe045468
@@@ -63,7 -63,7 +63,7 @@@ extern struct device_node *k2_skiplist[
   * We use a single global lock to protect accesses. Each driver has
   * to take care of its own locking
   */
 -static DEFINE_SPINLOCK(feature_lock  __pmacdata);
 +static DEFINE_SPINLOCK(feature_lock);
  
  #define LOCK(flags)   spin_lock_irqsave(&feature_lock, flags);
  #define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags);
@@@ -72,9 -72,9 +72,9 @@@
  /*
   * Instance of some macio stuffs
   */
 -struct macio_chip macio_chips[MAX_MACIO_CHIPS]  __pmacdata;
 +struct macio_chip macio_chips[MAX_MACIO_CHIPS];
  
 -struct macio_chip* __pmac macio_find(struct device_node* child, int type)
 +struct macio_chip* macio_find(struct device_node* child, int type)
  {
        while(child) {
                int     i;
@@@ -89,7 -89,7 +89,7 @@@
  }
  EXPORT_SYMBOL_GPL(macio_find);
  
 -static const char* macio_names[] __pmacdata =
 +static const char* macio_names[] =
  {
        "Unknown",
        "Grand Central",
  #define UN_BIS(r,v)   (UN_OUT((r), UN_IN(r) | (v)))
  #define UN_BIC(r,v)   (UN_OUT((r), UN_IN(r) & ~(v)))
  
 -static struct device_node* uninorth_node __pmacdata;
 -static u32 __iomem * uninorth_base __pmacdata;
 -static u32 uninorth_rev __pmacdata;
 -static int uninorth_u3 __pmacdata;
 +static struct device_node* uninorth_node;
 +static u32 __iomem * uninorth_base;
 +static u32 uninorth_rev;
 +static int uninorth_u3;
  static void __iomem *u3_ht;
  
  /*
@@@ -142,13 -142,13 +142,13 @@@ struct pmac_mb_de
        struct feature_table_entry*     features;
        unsigned long                   board_flags;
  };
 -static struct pmac_mb_def pmac_mb __pmacdata;
 +static struct pmac_mb_def pmac_mb;
  
  /*
   * Here are the chip specific feature functions
   */
  
 -static inline int __pmac
 +static inline int
  simple_feature_tweak(struct device_node* node, int type, int reg, u32 mask, int value)
  {
        struct macio_chip*      macio;
  
  #ifndef CONFIG_POWER4
  
 -static long __pmac
 +static long
  ohare_htw_scc_enable(struct device_node* node, long param, long value)
  {
        struct macio_chip*      macio;
        return 0;
  }
  
 -static long __pmac
 +static long
  ohare_floppy_enable(struct device_node* node, long param, long value)
  {
        return simple_feature_tweak(node, macio_ohare,
                OHARE_FCR, OH_FLOPPY_ENABLE, value);
  }
  
 -static long __pmac
 +static long
  ohare_mesh_enable(struct device_node* node, long param, long value)
  {
        return simple_feature_tweak(node, macio_ohare,
                OHARE_FCR, OH_MESH_ENABLE, value);
  }
  
 -static long __pmac
 +static long
  ohare_ide_enable(struct device_node* node, long param, long value)
  {
        switch(param) {
        }
  }
  
 -static long __pmac
 +static long
  ohare_ide_reset(struct device_node* node, long param, long value)
  {
        switch(param) {
        }
  }
  
 -static long __pmac
 +static long
  ohare_sleep_state(struct device_node* node, long param, long value)
  {
        struct macio_chip*      macio = &macio_chips[0];
        return 0;
  }
  
 -static long __pmac
 +static long
  heathrow_modem_enable(struct device_node* node, long param, long value)
  {
        struct macio_chip*      macio;
        return 0;
  }
  
 -static long __pmac
 +static long
  heathrow_floppy_enable(struct device_node* node, long param, long value)
  {
        return simple_feature_tweak(node, macio_unknown,
                value);
  }
  
 -static long __pmac
 +static long
  heathrow_mesh_enable(struct device_node* node, long param, long value)
  {
        struct macio_chip*      macio;
        return 0;
  }
  
 -static long __pmac
 +static long
  heathrow_ide_enable(struct device_node* node, long param, long value)
  {
        switch(param) {
        }
  }
  
 -static long __pmac
 +static long
  heathrow_ide_reset(struct device_node* node, long param, long value)
  {
        switch(param) {
        }
  }
  
 -static long __pmac
 +static long
  heathrow_bmac_enable(struct device_node* node, long param, long value)
  {
        struct macio_chip*      macio;
        return 0;
  }
  
 -static long __pmac
 +static long
  heathrow_sound_enable(struct device_node* node, long param, long value)
  {
        struct macio_chip*      macio;
        return 0;
  }
  
 -static u32 save_fcr[6] __pmacdata;
 -static u32 save_mbcr __pmacdata;
 -static u32 save_gpio_levels[2] __pmacdata;
 -static u8 save_gpio_extint[KEYLARGO_GPIO_EXTINT_CNT] __pmacdata;
 -static u8 save_gpio_normal[KEYLARGO_GPIO_CNT] __pmacdata;
 -static u32 save_unin_clock_ctl __pmacdata;
 -static struct dbdma_regs save_dbdma[13] __pmacdata;
 -static struct dbdma_regs save_alt_dbdma[13] __pmacdata;
 +static u32 save_fcr[6];
 +static u32 save_mbcr;
 +static u32 save_gpio_levels[2];
 +static u8 save_gpio_extint[KEYLARGO_GPIO_EXTINT_CNT];
 +static u8 save_gpio_normal[KEYLARGO_GPIO_CNT];
 +static u32 save_unin_clock_ctl;
 +static struct dbdma_regs save_dbdma[13];
 +static struct dbdma_regs save_alt_dbdma[13];
  
 -static void __pmac
 +static void
  dbdma_save(struct macio_chip* macio, struct dbdma_regs* save)
  {
        int i;
        }
  }
  
 -static void __pmac
 +static void
  dbdma_restore(struct macio_chip* macio, struct dbdma_regs* save)
  {
        int i;
        }
  }
  
 -static void __pmac
 +static void
  heathrow_sleep(struct macio_chip* macio, int secondary)
  {
        if (secondary) {
        (void)MACIO_IN32(HEATHROW_FCR);
  }
  
 -static void __pmac
 +static void
  heathrow_wakeup(struct macio_chip* macio, int secondary)
  {
        if (secondary) {
        }
  }
  
 -static long __pmac
 +static long
  heathrow_sleep_state(struct device_node* node, long param, long value)
  {
        if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0)
        return 0;
  }
  
 -static long __pmac
 +static long
  core99_scc_enable(struct device_node* node, long param, long value)
  {
        struct macio_chip*      macio;
        return 0;
  }
  
 -static long __pmac
 +static long
  core99_modem_enable(struct device_node* node, long param, long value)
  {
        struct macio_chip*      macio;
        return 0;
  }
  
 -static long __pmac
 +static long
  pangea_modem_enable(struct device_node* node, long param, long value)
  {
        struct macio_chip*      macio;
        return 0;
  }
  
 -static long __pmac
 +static long
  core99_ata100_enable(struct device_node* node, long value)
  {
        unsigned long flags;
        return 0;
  }
  
 -static long __pmac
 +static long
  core99_ide_enable(struct device_node* node, long param, long value)
  {
        /* Bus ID 0 to 2 are KeyLargo based IDE, busID 3 is U2
        }
  }
  
 -static long __pmac
 +static long
  core99_ide_reset(struct device_node* node, long param, long value)
  {
        switch(param) {
        }
  }
  
 -static long __pmac
 +static long
  core99_gmac_enable(struct device_node* node, long param, long value)
  {
        unsigned long flags;
        return 0;
  }
  
 -static long __pmac
 +static long
  core99_gmac_phy_reset(struct device_node* node, long param, long value)
  {
        unsigned long flags;
        return 0;
  }
  
 -static long __pmac
 +static long
  core99_sound_chip_enable(struct device_node* node, long param, long value)
  {
        struct macio_chip*      macio;
        return 0;
  }
  
 -static long __pmac
 +static long
  core99_airport_enable(struct device_node* node, long param, long value)
  {
        struct macio_chip*      macio;
  }
  
  #ifdef CONFIG_SMP
 -static long __pmac
 +static long
  core99_reset_cpu(struct device_node* node, long param, long value)
  {
        unsigned int reset_io = 0;
  }
  #endif /* CONFIG_SMP */
  
 -static long __pmac
 +static long
  core99_usb_enable(struct device_node* node, long param, long value)
  {
        struct macio_chip* macio;
        return 0;
  }
  
 -static long __pmac
 +static long
  core99_firewire_enable(struct device_node* node, long param, long value)
  {
        unsigned long flags;
        return 0;
  }
  
 -static long __pmac
 +static long
  core99_firewire_cable_power(struct device_node* node, long param, long value)
  {
        unsigned long flags;
        return 0;
  }
  
 -static long __pmac
 +static long
  intrepid_aack_delay_enable(struct device_node* node, long param, long value)
  {
        unsigned long flags;
  
  #endif /* CONFIG_POWER4 */
  
 -static long __pmac
 +static long
  core99_read_gpio(struct device_node* node, long param, long value)
  {
        struct macio_chip* macio = &macio_chips[0];
  }
  
  
 -static long __pmac
 +static long
  core99_write_gpio(struct device_node* node, long param, long value)
  {
        struct macio_chip* macio = &macio_chips[0];
  
  #ifdef CONFIG_POWER4
  
 -static long __pmac
 +static long
  g5_gmac_enable(struct device_node* node, long param, long value)
  {
        struct macio_chip* macio = &macio_chips[0];
        return 0;
  }
  
 -static long __pmac
 +static long
  g5_fw_enable(struct device_node* node, long param, long value)
  {
        struct macio_chip* macio = &macio_chips[0];
        return 0;
  }
  
 -static long __pmac
 +static long
  g5_mpic_enable(struct device_node* node, long param, long value)
  {
        unsigned long flags;
  }
  
  #ifdef CONFIG_SMP
 -static long __pmac
 +static long
  g5_reset_cpu(struct device_node* node, long param, long value)
  {
        unsigned int reset_io = 0;
   * This takes the second CPU off the bus on dual CPU machines
   * running UP
   */
 -void __pmac g5_phy_disable_cpu1(void)
 +void g5_phy_disable_cpu1(void)
  {
        UN_OUT(U3_API_PHY_CONFIG_1, 0);
  }
  
  #ifndef CONFIG_POWER4
  
 -static void __pmac
 +static void
  keylargo_shutdown(struct macio_chip* macio, int sleep_mode)
  {
        u32 temp;
        (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1);
  }
  
 -static void __pmac
 +static void
  pangea_shutdown(struct macio_chip* macio, int sleep_mode)
  {
        u32 temp;
        (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1);
  }
  
 -static void __pmac
 +static void
  intrepid_shutdown(struct macio_chip* macio, int sleep_mode)
  {
        u32 temp;
  }
  
  
 -void __pmac pmac_tweak_clock_spreading(int enable)
 +void pmac_tweak_clock_spreading(int enable)
  {
        struct macio_chip* macio = &macio_chips[0];
  
  }
  
  
 -static int __pmac
 +static int
  core99_sleep(void)
  {
        struct macio_chip* macio;
        return 0;
  }
  
 -static int __pmac
 +static int
  core99_wake_up(void)
  {
        struct macio_chip* macio;
        return 0;
  }
  
 -static long __pmac
 +static long
  core99_sleep_state(struct device_node* node, long param, long value)
  {
        /* Param == 1 means to enter the "fake sleep" mode that is
  
  #endif /* CONFIG_POWER4 */
  
 -static long __pmac
 +static long
  generic_dev_can_wake(struct device_node* node, long param, long value)
  {
        /* Todo: eventually check we are really dealing with on-board
        return 0;
  }
  
 -static long __pmac
 +static long
  generic_get_mb_info(struct device_node* node, long param, long value)
  {
        switch(param) {
  
  /* Used on any machine
   */
 -static struct feature_table_entry any_features[]  __pmacdata = {
 +static struct feature_table_entry any_features[] = {
        { PMAC_FTR_GET_MB_INFO,         generic_get_mb_info },
        { PMAC_FTR_DEVICE_CAN_WAKE,     generic_dev_can_wake },
        { 0, NULL }
   * 2400,3400 and 3500 series powerbooks. Some older desktops seem
   * to have issues with turning on/off those asic cells
   */
 -static struct feature_table_entry ohare_features[]  __pmacdata = {
 +static struct feature_table_entry ohare_features[] = {
        { PMAC_FTR_SCC_ENABLE,          ohare_htw_scc_enable },
        { PMAC_FTR_SWIM3_ENABLE,        ohare_floppy_enable },
        { PMAC_FTR_MESH_ENABLE,         ohare_mesh_enable },
   * Separated as some features couldn't be properly tested
   * and the serial port control bits appear to confuse it.
   */
 -static struct feature_table_entry heathrow_desktop_features[]  __pmacdata = {
 +static struct feature_table_entry heathrow_desktop_features[] = {
        { PMAC_FTR_SWIM3_ENABLE,        heathrow_floppy_enable },
        { PMAC_FTR_MESH_ENABLE,         heathrow_mesh_enable },
        { PMAC_FTR_IDE_ENABLE,          heathrow_ide_enable },
  /* Heathrow based laptop, that is the Wallstreet and mainstreet
   * powerbooks.
   */
 -static struct feature_table_entry heathrow_laptop_features[]  __pmacdata = {
 +static struct feature_table_entry heathrow_laptop_features[] = {
        { PMAC_FTR_SCC_ENABLE,          ohare_htw_scc_enable },
        { PMAC_FTR_MODEM_ENABLE,        heathrow_modem_enable },
        { PMAC_FTR_SWIM3_ENABLE,        heathrow_floppy_enable },
  /* Paddington based machines
   * The lombard (101) powerbook, first iMac models, B&W G3 and Yikes G4.
   */
 -static struct feature_table_entry paddington_features[]  __pmacdata = {
 +static struct feature_table_entry paddington_features[] = {
        { PMAC_FTR_SCC_ENABLE,          ohare_htw_scc_enable },
        { PMAC_FTR_MODEM_ENABLE,        heathrow_modem_enable },
        { PMAC_FTR_SWIM3_ENABLE,        heathrow_floppy_enable },
   * chipset. The pangea chipset is the "combo" UniNorth/KeyLargo
   * used on iBook2 & iMac "flow power".
   */
 -static struct feature_table_entry core99_features[]  __pmacdata = {
 +static struct feature_table_entry core99_features[] = {
        { PMAC_FTR_SCC_ENABLE,          core99_scc_enable },
        { PMAC_FTR_MODEM_ENABLE,        core99_modem_enable },
        { PMAC_FTR_IDE_ENABLE,          core99_ide_enable },
  
  /* RackMac
   */
 -static struct feature_table_entry rackmac_features[]  __pmacdata = {
 +static struct feature_table_entry rackmac_features[] = {
        { PMAC_FTR_SCC_ENABLE,          core99_scc_enable },
        { PMAC_FTR_IDE_ENABLE,          core99_ide_enable },
        { PMAC_FTR_IDE_RESET,           core99_ide_reset },
  
  /* Pangea features
   */
 -static struct feature_table_entry pangea_features[]  __pmacdata = {
 +static struct feature_table_entry pangea_features[] = {
        { PMAC_FTR_SCC_ENABLE,          core99_scc_enable },
        { PMAC_FTR_MODEM_ENABLE,        pangea_modem_enable },
        { PMAC_FTR_IDE_ENABLE,          core99_ide_enable },
  
  /* Intrepid features
   */
 -static struct feature_table_entry intrepid_features[]  __pmacdata = {
 +static struct feature_table_entry intrepid_features[] = {
        { PMAC_FTR_SCC_ENABLE,          core99_scc_enable },
        { PMAC_FTR_MODEM_ENABLE,        pangea_modem_enable },
        { PMAC_FTR_IDE_ENABLE,          core99_ide_enable },
  
  /* G5 features
   */
 -static struct feature_table_entry g5_features[]  __pmacdata = {
 +static struct feature_table_entry g5_features[] = {
        { PMAC_FTR_GMAC_ENABLE,         g5_gmac_enable },
        { PMAC_FTR_1394_ENABLE,         g5_fw_enable },
        { PMAC_FTR_ENABLE_MPIC,         g5_mpic_enable },
  
  #endif /* CONFIG_POWER4 */
  
 -static struct pmac_mb_def pmac_mb_defs[] __pmacdata = {
 +static struct pmac_mb_def pmac_mb_defs[] = {
  #ifndef CONFIG_POWER4
        /*
         * Desktops
                PMAC_TYPE_UNKNOWN_INTREPID,     intrepid_features,
                PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
        },
+       {       "PowerBook6,7",                 "iBook G4",
+               PMAC_TYPE_UNKNOWN_INTREPID,     intrepid_features,
+               PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
+       },
        {       "PowerBook6,8",                 "PowerBook G4 12\"",
                PMAC_TYPE_UNKNOWN_INTREPID,     intrepid_features,
                PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
  /*
   * The toplevel feature_call callback
   */
 -long __pmac
 +long
  pmac_do_feature_call(unsigned int selector, ...)
  {
        struct device_node* node;
@@@ -2935,8 -2939,8 +2939,8 @@@ void __init pmac_check_ht_link(void
   * Early video resume hook
   */
  
 -static void (*pmac_early_vresume_proc)(void *data) __pmacdata;
 -static void *pmac_early_vresume_data __pmacdata;
 +static void (*pmac_early_vresume_proc)(void *data);
 +static void *pmac_early_vresume_data;
  
  void pmac_set_early_video_resume(void (*proc)(void *data), void *data)
  {
  }
  EXPORT_SYMBOL(pmac_set_early_video_resume);
  
 -void __pmac pmac_call_early_video_resume(void)
 +void pmac_call_early_video_resume(void)
  {
        if (pmac_early_vresume_proc)
                pmac_early_vresume_proc(pmac_early_vresume_data);
   * AGP related suspend/resume code
   */
  
 -static struct pci_dev *pmac_agp_bridge __pmacdata;
 -static int (*pmac_agp_suspend)(struct pci_dev *bridge) __pmacdata;
 -static int (*pmac_agp_resume)(struct pci_dev *bridge) __pmacdata;
 +static struct pci_dev *pmac_agp_bridge;
 +static int (*pmac_agp_suspend)(struct pci_dev *bridge);
 +static int (*pmac_agp_resume)(struct pci_dev *bridge);
  
 -void __pmac pmac_register_agp_pm(struct pci_dev *bridge,
 +void pmac_register_agp_pm(struct pci_dev *bridge,
                                 int (*suspend)(struct pci_dev *bridge),
                                 int (*resume)(struct pci_dev *bridge))
  {
  }
  EXPORT_SYMBOL(pmac_register_agp_pm);
  
 -void __pmac pmac_suspend_agp_for_card(struct pci_dev *dev)
 +void pmac_suspend_agp_for_card(struct pci_dev *dev)
  {
        if (pmac_agp_bridge == NULL || pmac_agp_suspend == NULL)
                return;
  }
  EXPORT_SYMBOL(pmac_suspend_agp_for_card);
  
 -void __pmac pmac_resume_agp_for_card(struct pci_dev *dev)
 +void pmac_resume_agp_for_card(struct pci_dev *dev)
  {
        if (pmac_agp_bridge == NULL || pmac_agp_resume == NULL)
                return;
index 8e7b79b110e7976293eb710e55b7276759d8280a,d6356f480d906b97f8545ab69684743060e1b67e..74165684552a95c40763b7823f1c9f127c02a008
@@@ -48,7 -48,6 +48,6 @@@
  #include <linux/adb.h>
  #include <linux/cuda.h>
  #include <linux/pmu.h>
- #include <linux/irq.h>
  #include <linux/seq_file.h>
  #include <linux/root_dev.h>
  #include <linux/bitops.h>
@@@ -123,7 -122,7 +122,7 @@@ extern struct smp_ops_t psurge_smp_ops
  extern struct smp_ops_t core99_smp_ops;
  #endif /* CONFIG_SMP */
  
 -static int __pmac
 +static int
  pmac_show_cpuinfo(struct seq_file *m)
  {
        struct device_node *np;
        return 0;
  }
  
 -static int __openfirmware
 +static int
  pmac_show_percpuinfo(struct seq_file *m, int i)
  {
  #ifdef CONFIG_CPU_FREQ_PMAC
@@@ -448,7 -447,7 +447,7 @@@ static int pmac_pm_enter(suspend_state_
        enable_kernel_fp();
  
  #ifdef CONFIG_ALTIVEC
 -      if (cur_cpu_spec[0]->cpu_features & CPU_FTR_ALTIVEC)
 +      if (cur_cpu_spec->cpu_features & CPU_FTR_ALTIVEC)
                enable_kernel_altivec();
  #endif /* CONFIG_ALTIVEC */
  
@@@ -486,7 -485,7 +485,7 @@@ static int pmac_late_init(void
  late_initcall(pmac_late_init);
  
  /* can't be __init - can be called whenever a disk is first accessed */
 -void __pmac
 +void
  note_bootable_part(dev_t dev, int part, int goodness)
  {
        static int found_boot = 0;
        }
  }
  
 -static void __pmac
 +static void
  pmac_restart(char *cmd)
  {
  #ifdef CONFIG_ADB_CUDA
        }
  }
  
 -static void __pmac
 +static void
  pmac_power_off(void)
  {
  #ifdef CONFIG_ADB_CUDA
        }
  }
  
 -static void __pmac
 +static void
  pmac_halt(void)
  {
     pmac_power_off();
@@@ -662,6 -661,7 +661,6 @@@ pmac_init(unsigned long r3, unsigned lo
        ppc_md.setup_arch     = pmac_setup_arch;
        ppc_md.show_cpuinfo   = pmac_show_cpuinfo;
        ppc_md.show_percpuinfo = pmac_show_percpuinfo;
 -      ppc_md.irq_canonicalize = NULL;
        ppc_md.init_IRQ       = pmac_pic_init;
        ppc_md.get_irq        = pmac_get_irq; /* Changed later on ... */
  
index ff6adff36cb81e90412d8ab10891391c27e6b548,efb819f9490df1a7f90063647475fa35a010c4fe..edb9fcc64790c64526290fc9f50ad6e314cff489
@@@ -77,7 -77,7 +77,7 @@@ pmac_time_init(void
  #endif
  }
  
 -unsigned long __pmac
 +unsigned long
  pmac_get_rtc_time(void)
  {
  #if defined(CONFIG_ADB_CUDA) || defined(CONFIG_ADB_PMU)
        return 0;
  }
  
 -int __pmac
 +int
  pmac_set_rtc_time(unsigned long nowtime)
  {
  #if defined(CONFIG_ADB_CUDA) || defined(CONFIG_ADB_PMU)
@@@ -195,7 -195,7 +195,7 @@@ via_calibrate_decr(void
                ;
        dend = get_dec();
  
-       tb_ticks_per_jiffy = (dstart - dend) / (6 * (HZ/100));
+       tb_ticks_per_jiffy = (dstart - dend) / ((6 * HZ)/100);
        tb_to_us = mulhwu_scale_factor(dstart - dend, 60000);
  
        printk(KERN_INFO "via_calibrate_decr: ticks per jiffy = %u (%u ticks)\n",
  /*
   * Reset the time after a sleep.
   */
 -static int __pmac
 +static int
  time_sleep_notify(struct pmu_sleep_notifier *self, int when)
  {
        static unsigned long time_diff;
        return PBOOK_SLEEP_OK;
  }
  
 -static struct pmu_sleep_notifier time_sleep_notifier __pmacdata = {
 +static struct pmu_sleep_notifier time_sleep_notifier = {
        time_sleep_notify, SLEEP_LEVEL_MISC,
  };
  #endif /* CONFIG_PM */
index 93e9c7b889f7896c66b6a23da731567f1afb2199,e70aae20d6f9c3a83a5d3ba3d4f771e8e762eb73..c8803214405db32200a0861bad61fd3a199b3d44
@@@ -22,7 -22,6 +22,6 @@@
  #include <linux/ioport.h>
  #include <linux/console.h>
  #include <linux/pci.h>
- #include <linux/irq.h>
  #include <linux/ide.h>
  #include <linux/seq_file.h>
  #include <linux/root_dev.h>
@@@ -647,6 -646,14 +646,6 @@@ static void pplus_power_off(void
        pplus_halt();
  }
  
 -static unsigned int pplus_irq_canonicalize(u_int irq)
 -{
 -      if (irq == 2)
 -              return 9;
 -      else
 -              return irq;
 -}
 -
  static void __init pplus_init_IRQ(void)
  {
        int i;
@@@ -865,10 -872,10 +864,10 @@@ platform_init(unsigned long r3, unsigne
        ISA_DMA_THRESHOLD = 0x00ffffff;
        DMA_MODE_READ = 0x44;
        DMA_MODE_WRITE = 0x48;
 +      ppc_do_canonicalize_irqs = 1;
  
        ppc_md.setup_arch = pplus_setup_arch;
        ppc_md.show_cpuinfo = pplus_show_cpuinfo;
 -      ppc_md.irq_canonicalize = pplus_irq_canonicalize;
        ppc_md.init_IRQ = pplus_init_IRQ;
        /* this gets changed later on if we have an OpenPIC -- Cort */
        ppc_md.get_irq = i8259_irq;
index 3cf74aa5fed03166508388a051b07046b3842316,0376c8cff5d1e33bcd22e28d4dac37e4ceeb8921..5058568c13ec56f11a736316327a56336037a464
@@@ -32,7 -32,6 +32,6 @@@
  #include <linux/initrd.h>
  #include <linux/console.h>
  #include <linux/delay.h>
- #include <linux/irq.h>
  #include <linux/ide.h>
  #include <linux/seq_file.h>
  #include <linux/root_dev.h>
@@@ -59,7 -58,6 +58,6 @@@
  #include <asm/mpc10x.h>
  #include <asm/pci-bridge.h>
  #include <asm/mv64x60.h>
- #include <asm/i8259.h>
  
  #include "radstone_ppc7d.h"
  
@@@ -1185,18 -1183,18 +1183,18 @@@ static void __init ppc7d_setup_arch(voi
                ROOT_DEV = Root_HDA1;
  #endif
  
 -      if ((cur_cpu_spec[0]->cpu_features & CPU_FTR_SPEC7450) ||
 -          (cur_cpu_spec[0]->cpu_features & CPU_FTR_L3CR))
 +      if ((cur_cpu_spec->cpu_features & CPU_FTR_SPEC7450) ||
 +          (cur_cpu_spec->cpu_features & CPU_FTR_L3CR))
                /* 745x is different.  We only want to pass along enable. */
                _set_L2CR(L2CR_L2E);
 -      else if (cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR)
 +      else if (cur_cpu_spec->cpu_features & CPU_FTR_L2CR)
                /* All modules have 1MB of L2.  We also assume that an
                 * L2 divisor of 3 will work.
                 */
                _set_L2CR(L2CR_L2E | L2CR_L2SIZ_1MB | L2CR_L2CLK_DIV3
                          | L2CR_L2RAM_PIPE | L2CR_L2OH_1_0 | L2CR_L2DF);
  
 -      if (cur_cpu_spec[0]->cpu_features & CPU_FTR_L3CR)
 +      if (cur_cpu_spec->cpu_features & CPU_FTR_L3CR)
                /* No L3 cache */
                _set_L3CR(0);
  
@@@ -1426,7 -1424,6 +1424,7 @@@ void __init platform_init(unsigned lon
        ppc_md.setup_arch = ppc7d_setup_arch;
        ppc_md.init = ppc7d_init2;
        ppc_md.show_cpuinfo = ppc7d_show_cpuinfo;
 +      /* XXX this is broken... */
        ppc_md.irq_canonicalize = ppc7d_irq_canonicalize;
        ppc_md.init_IRQ = ppc7d_init_irq;
        ppc_md.get_irq = ppc7d_get_irq;
index 84c96cb9ac2b6b9689bf5b1a8ce9d154c1f7db15,5232283c1974a554658998de11cbf02d3a309b3a..d4c9781989fbbd4004996bb9a6a74e2307906566
@@@ -74,7 -74,6 +74,6 @@@
  #include <linux/initrd.h>
  #include <linux/console.h>
  #include <linux/delay.h>
- #include <linux/irq.h>
  #include <linux/ide.h>
  #include <linux/seq_file.h>
  #include <linux/root_dev.h>
@@@ -509,6 -508,15 +508,6 @@@ sandpoint_init_IRQ(void
        i8259_init(0xfef00000);
  }
  
 -static u32
 -sandpoint_irq_canonicalize(u32 irq)
 -{
 -      if (irq == 2)
 -              return 9;
 -      else
 -              return irq;
 -}
 -
  static unsigned long __init
  sandpoint_find_end_of_memory(void)
  {
@@@ -719,10 -727,10 +718,10 @@@ platform_init(unsigned long r3, unsigne
        ISA_DMA_THRESHOLD = 0x00ffffff;
        DMA_MODE_READ = 0x44;
        DMA_MODE_WRITE = 0x48;
 +      ppc_do_canonicalize_irqs = 1;
  
        ppc_md.setup_arch = sandpoint_setup_arch;
        ppc_md.show_cpuinfo = sandpoint_show_cpuinfo;
 -      ppc_md.irq_canonicalize = sandpoint_irq_canonicalize;
        ppc_md.init_IRQ = sandpoint_init_IRQ;
        ppc_md.get_irq = openpic_get_irq;
  
index df0f76dc0ce36f23a13347fc9fce21a1403f5b1b,1cf5de21a3fd3a0ffc6b3e26823d7fb236962163..361f113260d718acd562b0c26c356c2a542b24d4
@@@ -13,7 -13,6 +13,6 @@@
  #include <linux/kernel.h>
  #include <linux/sched.h>
  #include <linux/init.h>
- #include <linux/irq.h>
  #include <linux/interrupt.h>
  #include <linux/sysdev.h>
  #include <linux/errno.h>
@@@ -24,7 -23,6 +23,7 @@@
  #include <asm/sections.h>
  #include <asm/open_pic.h>
  #include <asm/i8259.h>
 +#include <asm/machdep.h>
  
  #include "open_pic_defs.h"
  
index ef365cc04bd9c3463603403b8ce86c9183677728,16cff91d9f41899cbbdb9ec525d26c0e889f42ec..1c40049b9a45b3fb53b9edb7e01a074fb706bc9e
@@@ -17,7 -17,6 +17,6 @@@
  #include <linux/kernel.h>
  #include <linux/sched.h>
  #include <linux/init.h>
- #include <linux/irq.h>
  #include <linux/interrupt.h>
  #include <linux/sysdev.h>
  #include <linux/errno.h>
@@@ -28,7 -27,6 +27,7 @@@
  #include <asm/sections.h>
  #include <asm/open_pic.h>
  #include <asm/i8259.h>
 +#include <asm/machdep.h>
  
  #include "open_pic_defs.h"
  
index def724b6e1c9af1b498196d0abf5cbeae92d74bf,bf83240689dc3b6b84ecde3afce81a6bfe0578b1..e83a83fd95e1dd93293dce60c59561e39e81aa17
@@@ -18,7 -18,6 +18,6 @@@
  #include <linux/smp.h>
  #include <linux/threads.h>
  #include <linux/spinlock.h>
- #include <linux/irq.h>
  #include <linux/reboot.h>
  #include <linux/param.h>
  #include <linux/string.h>
@@@ -279,7 -278,7 +278,7 @@@ ppc4xx_init(unsigned long r3, unsigned 
  #endif /* defined(CONFIG_PCI) && defined(CONFIG_IDE) */
  }
  
 -/* Called from MachineCheckException */
 +/* Called from machine_check_exception */
  void platform_machine_check(struct pt_regs *regs)
  {
  #if defined(DCRN_PLB0_BEAR)
index 45ebe5486c403bb6ca917785e17b3c265fc28753,5f2460090e03aa8e7de158344a0112ddd2b550bd..da1b4b7a32692cf3ce15414a99aad757a19d2faa
@@@ -39,8 -39,8 +39,8 @@@
  #include <asm/pmac_feature.h>
  #include <asm/abs_addr.h>
  #include <asm/system.h>
 +#include <asm/ppc-pci.h>
  
 -#include "pci.h"
  #include "bpa_iommu.h"
  
  static inline unsigned long 
@@@ -99,7 -99,11 +99,11 @@@ get_iost_entry(unsigned long iopt_base
                break;
  
        default: /* not a known compile time constant */
-               BUG_ON(1);
+               {
+                       /* BUILD_BUG_ON() is not usable here */
+                       extern void __get_iost_entry_bad_page_size(void);
+                       __get_iost_entry_bad_page_size();
+               }
                break;
        }
  
@@@ -306,7 -310,7 +310,7 @@@ static void bpa_map_iommu(void
  
  
  static void *bpa_alloc_coherent(struct device *hwdev, size_t size,
-                          dma_addr_t *dma_handle, unsigned int __nocast flag)
+                          dma_addr_t *dma_handle, gfp_t flag)
  {
        void *ret;
  
index abb90e67534a2299492b4ece45fd86c5c87471ff,9c6facc24f703240d1dd9fe0ecc3771d2c267dc1..ed876a5178ae6bedf663488915c0dc27cdd0ff83
@@@ -59,9 -59,9 +59,9 @@@ int __kprobes arch_prepare_kprobe(struc
  
        /* insn must be on a special executable page on ppc64 */
        if (!ret) {
-               up(&kprobe_mutex);
-               p->ainsn.insn = get_insn_slot();
                down(&kprobe_mutex);
+               p->ainsn.insn = get_insn_slot();
+               up(&kprobe_mutex);
                if (!p->ainsn.insn)
                        ret = -ENOMEM;
        }
@@@ -90,9 -90,9 +90,9 @@@ void __kprobes arch_disarm_kprobe(struc
  
  void __kprobes arch_remove_kprobe(struct kprobe *p)
  {
-       up(&kprobe_mutex);
-       free_insn_slot(p->ainsn.insn);
        down(&kprobe_mutex);
+       free_insn_slot(p->ainsn.insn);
+       up(&kprobe_mutex);
  }
  
  static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
@@@ -395,6 -395,7 +395,6 @@@ int __kprobes kprobe_exceptions_notify(
                if (post_kprobe_handler(args->regs))
                        ret = NOTIFY_STOP;
                break;
 -      case DIE_GPF:
        case DIE_PAGE_FAULT:
                if (kprobe_running() &&
                    kprobe_fault_handler(args->regs, args->trapnr))
index 57980a5674d772ce4a1e8c90b53cef3395719d9c,54055c81017a614b2379686e3d1b1a4a8bce7161..e1a32f802c0b38c1a7c065286ed4ed5e25495490
  #include <asm/machdep.h>
  #include <asm/pmac_feature.h>
  #include <asm/abs_addr.h>
 -
 -#include "pci.h"
 +#include <asm/ppc-pci.h>
  
  static void *pci_direct_alloc_coherent(struct device *hwdev, size_t size,
-                                  dma_addr_t *dma_handle, unsigned int __nocast flag)
+                                  dma_addr_t *dma_handle, gfp_t flag)
  {
        void *ret;
  
index 6c9dc67f59d821b3338c28f26a3f95b956a2e8f1,d9e33b7d4203b529ae7a365e9f7251a287b87fcd..2114dc9c59b5acdd60e7d6889426bee152209c5f
@@@ -37,7 -37,7 +37,7 @@@
  #include <asm/iommu.h>
  #include <asm/pci-bridge.h>
  #include <asm/machdep.h>
 -#include "pci.h"
 +#include <asm/ppc-pci.h>
  
  #ifdef CONFIG_PPC_ISERIES
  #include <asm/iSeries/iSeries_pci.h>
@@@ -61,7 -61,13 +61,7 @@@ static inline struct iommu_table *devno
        } else
                pdev = to_pci_dev(dev);
  
 -#ifdef CONFIG_PPC_ISERIES
 -      return ISERIES_DEVNODE(pdev)->iommu_table;
 -#endif /* CONFIG_PPC_ISERIES */
 -
 -#ifdef CONFIG_PPC_MULTIPLATFORM
        return PCI_DN(PCI_GET_DN(pdev))->iommu_table;
 -#endif /* CONFIG_PPC_MULTIPLATFORM */
  }
  
  
@@@ -70,7 -76,7 +70,7 @@@
   * to the dma address (mapping) of the first page.
   */
  static void *pci_iommu_alloc_coherent(struct device *hwdev, size_t size,
-                          dma_addr_t *dma_handle, unsigned int __nocast flag)
+                          dma_addr_t *dma_handle, gfp_t flag)
  {
        return iommu_alloc_coherent(devnode_table(hwdev), size, dma_handle,
                        flag);
diff --combined drivers/macintosh/smu.c
index 5f283529620bed654532fe053d37e3cf7ce6f533,9b38674fbf7558d689aab1e88e284df3e692f504..34f3c7e2d832921e783e21e9c22b806d07b71421
@@@ -153,8 -153,10 +153,10 @@@ static irqreturn_t smu_db_intr(int irq
        spin_lock_irqsave(&smu->lock, flags);
  
        gpio = pmac_do_feature_call(PMAC_FTR_READ_GPIO, NULL, smu->doorbell);
-       if ((gpio & 7) != 7)
+       if ((gpio & 7) != 7) {
+               spin_unlock_irqrestore(&smu->lock, flags);
                return IRQ_HANDLED;
+       }
  
        cmd = smu->cmd_cur;
        smu->cmd_cur = NULL;
@@@ -1092,7 -1094,7 +1094,7 @@@ static int smu_release(struct inode *in
  }
  
  
 -static struct file_operations smu_device_fops __pmacdata = {
 +static struct file_operations smu_device_fops = {
        .llseek         = no_llseek,
        .read           = smu_read,
        .write          = smu_write,
        .release        = smu_release,
  };
  
 -static struct miscdevice pmu_device __pmacdata = {
 +static struct miscdevice pmu_device = {
        MISC_DYNAMIC_MINOR, "smu", &smu_device_fops
  };
  
diff --combined include/asm-ppc/io.h
index 39caf067a31bd401e22dc2e0114b5224fce28939,94d83998a75912851f4a3ff4095d2b09f4408f67..f7f614dfc648170760cc31da3284b20ffcc717b6
@@@ -8,7 -8,6 +8,7 @@@
  
  #include <asm/page.h>
  #include <asm/byteorder.h>
 +#include <asm/synch.h>
  #include <asm/mmu.h>
  
  #define SIO_CONFIG_RA 0x398
@@@ -57,7 -56,7 +57,7 @@@ extern unsigned long pci_dram_offset
   * is actually performed (i.e. the data has come back) before we start
   * executing any following instructions.
   */
- extern inline int in_8(volatile unsigned char __iomem *addr)
+ extern inline int in_8(const volatile unsigned char __iomem *addr)
  {
        int ret;
  
@@@ -73,7 -72,7 +73,7 @@@ extern inline void out_8(volatile unsig
        __asm__ __volatile__("stb%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val));
  }
  
- extern inline int in_le16(volatile unsigned short __iomem *addr)
+ extern inline int in_le16(const volatile unsigned short __iomem *addr)
  {
        int ret;
  
@@@ -84,7 -83,7 +84,7 @@@
        return ret;
  }
  
- extern inline int in_be16(volatile unsigned short __iomem *addr)
+ extern inline int in_be16(const volatile unsigned short __iomem *addr)
  {
        int ret;
  
@@@ -105,7 -104,7 +105,7 @@@ extern inline void out_be16(volatile un
        __asm__ __volatile__("sth%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val));
  }
  
- extern inline unsigned in_le32(volatile unsigned __iomem *addr)
+ extern inline unsigned in_le32(const volatile unsigned __iomem *addr)
  {
        unsigned ret;
  
        return ret;
  }
  
- extern inline unsigned in_be32(volatile unsigned __iomem *addr)
+ extern inline unsigned in_be32(const volatile unsigned __iomem *addr)
  {
        unsigned ret;
  
@@@ -140,7 -139,7 +140,7 @@@ extern inline void out_be32(volatile un
  #define readb(addr) in_8((volatile u8 *)(addr))
  #define writeb(b,addr) out_8((volatile u8 *)(addr), (b))
  #else
- static inline __u8 readb(volatile void __iomem *addr)
+ static inline __u8 readb(const volatile void __iomem *addr)
  {
        return in_8(addr);
  }
@@@ -151,11 -150,11 +151,11 @@@ static inline void writeb(__u8 b, volat
  #endif
  
  #if defined(CONFIG_APUS)
- static inline __u16 readw(volatile void __iomem *addr)
+ static inline __u16 readw(const volatile void __iomem *addr)
  {
        return *(__force volatile __u16 *)(addr);
  }
- static inline __u32 readl(volatile void __iomem *addr)
+ static inline __u32 readl(const volatile void __iomem *addr)
  {
        return *(__force volatile __u32 *)(addr);
  }
@@@ -174,11 -173,11 +174,11 @@@ static inline void writel(__u32 b, vola
  #define writew(b,addr) out_le16((volatile u16 *)(addr),(b))
  #define writel(b,addr) out_le32((volatile u32 *)(addr),(b))
  #else
- static inline __u16 readw(volatile void __iomem *addr)
+ static inline __u16 readw(const volatile void __iomem *addr)
  {
        return in_le16(addr);
  }
- static inline __u32 readl(volatile void __iomem *addr)
+ static inline __u32 readl(const volatile void __iomem *addr)
  {
        return in_le32(addr);
  }
@@@ -441,6 -440,16 +441,6 @@@ extern inline void * phys_to_virt(unsig
  #define page_to_phys(page)    (page_to_pfn(page) << PAGE_SHIFT)
  #define page_to_bus(page)     (page_to_phys(page) + PCI_DRAM_OFFSET)
  
 -/*
 - * Enforce In-order Execution of I/O:
 - * Acts as a barrier to ensure all previous I/O accesses have
 - * completed before any further ones are issued.
 - */
 -extern inline void eieio(void)
 -{
 -      __asm__ __volatile__ ("eieio" : : : "memory");
 -}
 -
  /* Enforce in-order execution of data I/O.
   * No distinction between read/write on PPC; use eieio for all three.
   */
index d096faf4191e3b12fdabae710ae26e659dafccc1,c2f3b6e8a42fb8945a10f41cbc009e3f09e31682..f80ec8daf122bbbd79b5944294c5da8f532bc631
@@@ -1,4 -1,5 +1,4 @@@
  /*
 - * iommu.h
   * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation
   * Rewrite, cleanup:
   * Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation
  
  /*
   * IOMAP_MAX_ORDER defines the largest contiguous block
 - * of dma (tce) space we can get.  IOMAP_MAX_ORDER = 13
 + * of dma space we can get.  IOMAP_MAX_ORDER = 13
   * allows up to 2**12 pages (4096 * 4096) = 16 MB
   */
  #define IOMAP_MAX_ORDER 13
  
 -/*
 - * Tces come in two formats, one for the virtual bus and a different
 - * format for PCI
 - */
 -#define TCE_VB  0
 -#define TCE_PCI 1
 -
 -/* tce_entry
 - * Used by pSeries (SMP) and iSeries/pSeries LPAR, but there it's
 - * abstracted so layout is irrelevant.
 - */
 -union tce_entry {
 -      unsigned long te_word;
 -      struct {
 -              unsigned int  tb_cacheBits :6;  /* Cache hash bits - not used */
 -              unsigned int  tb_rsvd      :6;
 -              unsigned long tb_rpn       :40; /* Real page number */
 -              unsigned int  tb_valid     :1;  /* Tce is valid (vb only) */
 -              unsigned int  tb_allio     :1;  /* Tce is valid for all lps (vb only) */
 -              unsigned int  tb_lpindex   :8;  /* LpIndex for user of TCE (vb only) */
 -              unsigned int  tb_pciwr     :1;  /* Write allowed (pci only) */
 -              unsigned int  tb_rdwr      :1;  /* Read allowed  (pci), Write allowed (vb) */
 -      } te_bits;
 -#define te_cacheBits te_bits.tb_cacheBits
 -#define te_rpn       te_bits.tb_rpn
 -#define te_valid     te_bits.tb_valid
 -#define te_allio     te_bits.tb_allio
 -#define te_lpindex   te_bits.tb_lpindex
 -#define te_pciwr     te_bits.tb_pciwr
 -#define te_rdwr      te_bits.tb_rdwr
 -};
 -
 -
  struct iommu_table {
        unsigned long  it_busno;     /* Bus number this table belongs to */
        unsigned long  it_size;      /* Size of iommu table in entries */
@@@ -49,7 -83,6 +49,7 @@@
  };
  
  struct scatterlist;
 +struct device_node;
  
  #ifdef CONFIG_PPC_MULTIPLATFORM
  
@@@ -71,8 -104,9 +71,8 @@@ extern void iommu_devnode_init_pSeries(
  
  #ifdef CONFIG_PPC_ISERIES
  
 -struct iSeries_Device_Node;
  /* Creates table for an individual device node */
 -extern void iommu_devnode_init_iSeries(struct iSeries_Device_Node *dn);
 +extern void iommu_devnode_init_iSeries(struct device_node *dn);
  
  #endif /* CONFIG_PPC_ISERIES */
  
@@@ -88,7 -122,7 +88,7 @@@ extern void iommu_unmap_sg(struct iommu
                int nelems, enum dma_data_direction direction);
  
  extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
-               dma_addr_t *dma_handle, unsigned int __nocast flag);
+               dma_addr_t *dma_handle, gfp_t flag);
  extern void iommu_free_coherent(struct iommu_table *tbl, size_t size,
                void *vaddr, dma_addr_t dma_handle);
  extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,