Merge branches 'pxa-core' and 'pxa-machines' into pxa-all
Russell King [Tue, 7 Oct 2008 18:08:56 +0000 (19:08 +0100)]
Conflicts:

arch/arm/mach-pxa/Kconfig
arch/arm/mach-pxa/pxa25x.c
arch/arm/mach-pxa/pxa27x.c

1  2 
arch/arm/mach-pxa/pxa25x.c
arch/arm/mach-pxa/pxa27x.c

  #include "devices.h"
  #include "clock.h"
  
 +int cpu_is_pxa26x(void)
 +{
 +      return cpu_is_pxa250() && ((BOOT_DEF & 0x8) == 0);
 +}
 +EXPORT_SYMBOL_GPL(cpu_is_pxa26x);
 +
  /*
   * Various clock factors driven by the CCCR register.
   */
@@@ -209,45 -203,24 +209,21 @@@ static struct clk pxa25x_clks[] = 
   * More ones like CP and general purpose register values are preserved
   * with the stack pointer in sleep.S.
   */
- enum {        SLEEP_SAVE_PGSR0, SLEEP_SAVE_PGSR1, SLEEP_SAVE_PGSR2,
-       SLEEP_SAVE_GAFR0_L, SLEEP_SAVE_GAFR0_U,
-       SLEEP_SAVE_GAFR1_L, SLEEP_SAVE_GAFR1_U,
-       SLEEP_SAVE_GAFR2_L, SLEEP_SAVE_GAFR2_U,
+ enum {
        SLEEP_SAVE_PSTR,
        SLEEP_SAVE_CKEN,
        SLEEP_SAVE_COUNT
  };
  
  
  static void pxa25x_cpu_pm_save(unsigned long *sleep_save)
  {
-       SAVE(PGSR0); SAVE(PGSR1); SAVE(PGSR2);
-       SAVE(GAFR0_L); SAVE(GAFR0_U);
-       SAVE(GAFR1_L); SAVE(GAFR1_U);
-       SAVE(GAFR2_L); SAVE(GAFR2_U);
        SAVE(CKEN);
        SAVE(PSTR);
-       /* Clear GPIO transition detect bits */
-       GEDR0 = GEDR0; GEDR1 = GEDR1; GEDR2 = GEDR2;
  }
  
  static void pxa25x_cpu_pm_restore(unsigned long *sleep_save)
  {
-       /* restore registers */
-       RESTORE(GAFR0_L); RESTORE(GAFR0_U);
-       RESTORE(GAFR1_L); RESTORE(GAFR1_U);
-       RESTORE(GAFR2_L); RESTORE(GAFR2_U);
-       RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2);
-       PSSR = PSSR_RDH | PSSR_PH;
 -      /* ensure not to come back here if it wasn't intended */
 -      PSPR = 0;
 -
        RESTORE(CKEN);
        RESTORE(PSTR);
  }
@@@ -259,32 -232,19 +235,32 @@@ static void pxa25x_cpu_pm_enter(suspend
  
        switch (state) {
        case PM_SUSPEND_MEM:
 -              /* set resume return address */
 -              PSPR = virt_to_phys(pxa_cpu_resume);
                pxa25x_cpu_suspend(PWRMODE_SLEEP);
                break;
        }
  }
  
 +static int pxa25x_cpu_pm_prepare(void)
 +{
 +      /* set resume return address */
 +      PSPR = virt_to_phys(pxa_cpu_resume);
 +      return 0;
 +}
 +
 +static void pxa25x_cpu_pm_finish(void)
 +{
 +      /* ensure not to come back here if it wasn't intended */
 +      PSPR = 0;
 +}
 +
  static struct pxa_cpu_pm_fns pxa25x_cpu_pm_fns = {
        .save_count     = SLEEP_SAVE_COUNT,
        .valid          = suspend_valid_only_mem,
        .save           = pxa25x_cpu_pm_save,
        .restore        = pxa25x_cpu_pm_restore,
        .enter          = pxa25x_cpu_pm_enter,
 +      .prepare        = pxa25x_cpu_pm_prepare,
 +      .finish         = pxa25x_cpu_pm_finish,
  };
  
  static void __init pxa25x_init_pm(void)
@@@ -346,6 -306,8 +322,8 @@@ static struct sys_device pxa25x_sysdev[
        {
                .cls    = &pxa_irq_sysclass,
        }, {
+               .cls    = &pxa2xx_mfp_sysclass,
+       }, {
                .cls    = &pxa_gpio_sysclass,
        },
  };
@@@ -354,7 -316,11 +332,7 @@@ static int __init pxa25x_init(void
  {
        int i, ret = 0;
  
 -      /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */
 -      if (cpu_is_pxa255())
 -              clks_register(&pxa25x_hwuart_clk, 1);
 -
 -      if (cpu_is_pxa21x() || cpu_is_pxa25x()) {
 +      if (cpu_is_pxa25x()) {
  
                reset_status = RCSR;
  
                        return ret;
        }
  
 -      /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */
 -      if (cpu_is_pxa255())
 +      /* Only add HWUART for PXA255/26x; PXA210/250 do not have it. */
 +      if (cpu_is_pxa255() || cpu_is_pxa26x()) {
 +              clks_register(&pxa25x_hwuart_clk, 1);
                ret = platform_device_register(&pxa_device_hwuart);
 +      }
  
        return ret;
  }
@@@ -183,36 -183,18 +183,18 @@@ static struct clk pxa27x_clks[] = 
   * More ones like CP and general purpose register values are preserved
   * with the stack pointer in sleep.S.
   */
- enum {        SLEEP_SAVE_PGSR0, SLEEP_SAVE_PGSR1, SLEEP_SAVE_PGSR2, SLEEP_SAVE_PGSR3,
-       SLEEP_SAVE_GAFR0_L, SLEEP_SAVE_GAFR0_U,
-       SLEEP_SAVE_GAFR1_L, SLEEP_SAVE_GAFR1_U,
-       SLEEP_SAVE_GAFR2_L, SLEEP_SAVE_GAFR2_U,
-       SLEEP_SAVE_GAFR3_L, SLEEP_SAVE_GAFR3_U,
+ enum {
        SLEEP_SAVE_PSTR,
        SLEEP_SAVE_CKEN,
        SLEEP_SAVE_MDREFR,
-       SLEEP_SAVE_PWER, SLEEP_SAVE_PCFR, SLEEP_SAVE_PRER,
-       SLEEP_SAVE_PFER, SLEEP_SAVE_PKWR,
+       SLEEP_SAVE_PCFR,
        SLEEP_SAVE_COUNT
  };
  
  void pxa27x_cpu_pm_save(unsigned long *sleep_save)
  {
-       SAVE(PGSR0); SAVE(PGSR1); SAVE(PGSR2); SAVE(PGSR3);
-       SAVE(GAFR0_L); SAVE(GAFR0_U);
-       SAVE(GAFR1_L); SAVE(GAFR1_U);
-       SAVE(GAFR2_L); SAVE(GAFR2_U);
-       SAVE(GAFR3_L); SAVE(GAFR3_U);
        SAVE(MDREFR);
-       SAVE(PWER); SAVE(PCFR); SAVE(PRER);
-       SAVE(PFER); SAVE(PKWR);
+       SAVE(PCFR);
  
        SAVE(CKEN);
        SAVE(PSTR);
  
  void pxa27x_cpu_pm_restore(unsigned long *sleep_save)
  {
-       /* restore registers */
-       RESTORE(GAFR0_L); RESTORE(GAFR0_U);
-       RESTORE(GAFR1_L); RESTORE(GAFR1_U);
-       RESTORE(GAFR2_L); RESTORE(GAFR2_U);
-       RESTORE(GAFR3_L); RESTORE(GAFR3_U);
-       RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2); RESTORE(PGSR3);
 -      /* ensure not to come back here if it wasn't intended */
 -      PSPR = 0;
 -
        RESTORE(MDREFR);
-       RESTORE(PWER); RESTORE(PCFR); RESTORE(PRER);
-       RESTORE(PFER); RESTORE(PKWR);
+       RESTORE(PCFR);
  
        PSSR = PSSR_RDH | PSSR_PH;
  
        RESTORE(CKEN);
        RESTORE(PSTR);
  }
  
@@@ -256,6 -232,8 +229,6 @@@ void pxa27x_cpu_pm_enter(suspend_state_
                pxa_cpu_standby();
                break;
        case PM_SUSPEND_MEM:
 -              /* set resume return address */
 -              PSPR = virt_to_phys(pxa_cpu_resume);
                pxa27x_cpu_suspend(PWRMODE_SLEEP);
                break;
        }
@@@ -266,27 -244,12 +239,27 @@@ static int pxa27x_cpu_pm_valid(suspend_
        return state == PM_SUSPEND_MEM || state == PM_SUSPEND_STANDBY;
  }
  
 +static int pxa27x_cpu_pm_prepare(void)
 +{
 +      /* set resume return address */
 +      PSPR = virt_to_phys(pxa_cpu_resume);
 +      return 0;
 +}
 +
 +static void pxa27x_cpu_pm_finish(void)
 +{
 +      /* ensure not to come back here if it wasn't intended */
 +      PSPR = 0;
 +}
 +
  static struct pxa_cpu_pm_fns pxa27x_cpu_pm_fns = {
        .save_count     = SLEEP_SAVE_COUNT,
        .save           = pxa27x_cpu_pm_save,
        .restore        = pxa27x_cpu_pm_restore,
        .valid          = pxa27x_cpu_pm_valid,
        .enter          = pxa27x_cpu_pm_enter,
 +      .prepare        = pxa27x_cpu_pm_prepare,
 +      .finish         = pxa27x_cpu_pm_finish,
  };
  
  static void __init pxa27x_init_pm(void)
@@@ -359,7 -322,7 +332,7 @@@ struct platform_device pxa27x_device_i2
        .num_resources  = ARRAY_SIZE(i2c_power_resources),
  };
  
 -void __init pxa_set_i2c_power_info(struct i2c_pxa_platform_data *info)
 +void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
  {
        local_irq_disable();
        PCFR |= PCFR_PI2CEN;
@@@ -386,6 -349,8 +359,8 @@@ static struct sys_device pxa27x_sysdev[
        {
                .cls    = &pxa_irq_sysclass,
        }, {
+               .cls    = &pxa2xx_mfp_sysclass,
+       }, {
                .cls    = &pxa_gpio_sysclass,
        },
  };