Merge branch 'next/cleanup' into late/kirkwood
authorOlof Johansson <olof@lixom.net>
Sat, 22 Sep 2012 20:13:38 +0000 (13:13 -0700)
committerOlof Johansson <olof@lixom.net>
Sat, 22 Sep 2012 20:13:38 +0000 (13:13 -0700)
By Arnd Bergmann (21) and Wei Yongjun (1)
via Olof Johansson (2) and Haojian Zhuang (1)
* next/cleanup: (22 commits)
  ARM: mmp: using for_each_set_bit to simplify the code
  net: seeq: use __iomem pointers for MMIO
  video: da8xx-fb: use __iomem pointers for MMIO
  scsi: eesox: use __iomem pointers for MMIO
  serial: ks8695: use __iomem pointers for MMIO
  input: rpcmouse: use __iomem pointers for MMIO
  ARM: samsung: use __iomem pointers for MMIO
  ARM: spear13xx: use __iomem pointers for MMIO
  ARM: sa1100: use __iomem pointers for MMIO
  ARM: prima2: use __iomem pointers for MMIO
  ARM: nomadik: use __iomem pointers for MMIO
  ARM: msm: use __iomem pointers for MMIO
  ARM: lpc32xx: use __iomem pointers for MMIO
  ARM: ks8695: use __iomem pointers for MMIO
  ARM: ixp4xx: use __iomem pointers for MMIO
  ARM: iop32x: use __iomem pointers for MMIO
  ARM: iop13xx: use __iomem pointers for MMIO
  ARM: integrator: use __iomem pointers for MMIO
  ARM: imx: use __iomem pointers for MMIO
  ARM: ebsa110: use __iomem pointers for MMIO
  ...

1  2 
arch/arm/mach-shmobile/board-ap4evb.c
arch/arm/mach-shmobile/board-armadillo800eva.c
arch/arm/mach-shmobile/board-g4evm.c
arch/arm/mach-shmobile/board-kzm9g.c
arch/arm/mach-shmobile/board-mackerel.c
arch/arm/mach-shmobile/setup-sh73a0.c
arch/arm/mach-shmobile/sh-gpio.h

@@@ -66,8 -66,6 +66,8 @@@
  #include <asm/mach/arch.h>
  #include <asm/setup.h>
  
 +#include "sh-gpio.h"
 +
  /*
   * Address    Interface               BusWidth        note
   * ------------------------------------------------------------------
@@@ -434,7 -432,7 +434,7 @@@ static void usb1_host_port_power(int po
                return;
  
        /* set VBOUT/PWEN and EXTLP1 in DVSTCTR */
-       __raw_writew(__raw_readw(0xE68B0008) | 0x600, 0xE68B0008);
+       __raw_writew(__raw_readw(IOMEM(0xE68B0008)) | 0x600, IOMEM(0xE68B0008));
  }
  
  static struct r8a66597_platdata usb1_host_data = {
@@@ -1226,9 -1224,9 +1226,9 @@@ static struct i2c_board_info i2c1_devic
  };
  
  
- #define GPIO_PORT9CR  0xE6051009
- #define GPIO_PORT10CR 0xE605100A
- #define USCCR1                0xE6058144
+ #define GPIO_PORT9CR  IOMEM(0xE6051009)
+ #define GPIO_PORT10CR IOMEM(0xE605100A)
+ #define USCCR1                IOMEM(0xE6058144)
  static void __init ap4evb_init(void)
  {
        u32 srcr4;
        gpio_request(GPIO_FN_OVCN2_1,    NULL);
  
        /* setup USB phy */
-       __raw_writew(0x8a0a, 0xE6058130);       /* USBCR4 */
+       __raw_writew(0x8a0a, IOMEM(0xE6058130));        /* USBCR4 */
  
        /* enable FSI2 port A (ak4643) */
        gpio_request(GPIO_FN_FSIAIBT,   NULL);
        gpio_request(GPIO_FN_HDMI_CEC, NULL);
  
        /* Reset HDMI, must be held at least one EXTALR (32768Hz) period */
- #define SRCR4 0xe61580bc
+ #define SRCR4 IOMEM(0xe61580bc)
        srcr4 = __raw_readl(SRCR4);
        __raw_writel(srcr4 | (1 << 13), SRCR4);
        udelay(50);
@@@ -54,8 -54,6 +54,8 @@@
  #include <sound/sh_fsi.h>
  #include <sound/simple_card.h>
  
 +#include "sh-gpio.h"
 +
  /*
   * CON1               Camera Module
   * CON2               Extension Bus
   *    usbhsf_power_ctrl()
   */
  #define IRQ7          evt2irq(0x02e0)
- #define USBCR1                0xe605810a
+ #define USBCR1                IOMEM(0xe605810a)
  #define USBH          0xC6700000
  #define USBH_USBCTR   0x10834
  
@@@ -952,8 -950,8 +952,8 @@@ clock_error
  /*
   * board init
   */
- #define GPIO_PORT7CR  0xe6050007
- #define GPIO_PORT8CR  0xe6050008
+ #define GPIO_PORT7CR  IOMEM(0xe6050007)
+ #define GPIO_PORT8CR  IOMEM(0xe6050008)
  static void __init eva_init(void)
  {
        struct platform_device *usb = NULL;
@@@ -42,8 -42,6 +42,8 @@@
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  
 +#include "sh-gpio.h"
 +
  /*
   * SDHI
   *
@@@ -128,7 -126,7 +128,7 @@@ static void usb_host_port_power(int por
                return;
  
        /* set VBOUT/PWEN and EXTLP0 in DVSTCTR */
-       __raw_writew(__raw_readw(0xe6890008) | 0x600, 0xe6890008);
+       __raw_writew(__raw_readw(IOMEM(0xe6890008)) | 0x600, IOMEM(0xe6890008));
  }
  
  static struct r8a66597_platdata usb_host_data = {
@@@ -272,17 -270,17 +272,17 @@@ static struct platform_device *g4evm_de
        &sdhi1_device,
  };
  
- #define GPIO_SDHID0_D0        0xe60520fc
- #define GPIO_SDHID0_D1        0xe60520fd
- #define GPIO_SDHID0_D2        0xe60520fe
- #define GPIO_SDHID0_D3        0xe60520ff
- #define GPIO_SDHICMD0 0xe6052100
+ #define GPIO_SDHID0_D0        IOMEM(0xe60520fc)
+ #define GPIO_SDHID0_D1        IOMEM(0xe60520fd)
+ #define GPIO_SDHID0_D2        IOMEM(0xe60520fe)
+ #define GPIO_SDHID0_D3        IOMEM(0xe60520ff)
+ #define GPIO_SDHICMD0 IOMEM(0xe6052100)
  
- #define GPIO_SDHID1_D0        0xe6052103
- #define GPIO_SDHID1_D1        0xe6052104
- #define GPIO_SDHID1_D2        0xe6052105
- #define GPIO_SDHID1_D3        0xe6052106
- #define GPIO_SDHICMD1 0xe6052107
+ #define GPIO_SDHID1_D0        IOMEM(0xe6052103)
+ #define GPIO_SDHID1_D1        IOMEM(0xe6052104)
+ #define GPIO_SDHID1_D2        IOMEM(0xe6052105)
+ #define GPIO_SDHID1_D3        IOMEM(0xe6052106)
+ #define GPIO_SDHICMD1 IOMEM(0xe6052107)
  
  static void __init g4evm_init(void)
  {
        gpio_request(GPIO_FN_IDIN, NULL);
  
        /* setup USB phy */
-       __raw_writew(0x0200, 0xe605810a);       /* USBCR1 */
-       __raw_writew(0x00e0, 0xe60581c0);       /* CPFCH */
-       __raw_writew(0x6010, 0xe60581c6);       /* CGPOSR */
-       __raw_writew(0x8a0a, 0xe605810c);       /* USBCR2 */
+       __raw_writew(0x0200, IOMEM(0xe605810a));       /* USBCR1 */
+       __raw_writew(0x00e0, IOMEM(0xe60581c0));       /* CPFCH */
+       __raw_writew(0x6010, IOMEM(0xe60581c6));       /* CGPOSR */
+       __raw_writew(0x8a0a, IOMEM(0xe605810c));       /* USBCR2 */
  
        /* KEYSC @ CN31 */
        gpio_request(GPIO_FN_PORT60_KEYOUT5, NULL);
@@@ -133,8 -133,8 +133,8 @@@ static struct platform_device usb_host_
  
  /* USB Func CN17 */
  struct usbhs_private {
-       unsigned int phy;
-       unsigned int cr2;
+       void __iomem *phy;
+       void __iomem *cr2;
        struct renesas_usbhs_platform_info info;
  };
  
@@@ -232,8 -232,8 +232,8 @@@ static u32 usbhs_pipe_cfg[] = 
  };
  
  static struct usbhs_private usbhs_private = {
-       .phy    = 0xe60781e0,           /* USBPHYINT */
-       .cr2    = 0xe605810c,           /* USBCR2 */
+       .phy    = IOMEM(0xe60781e0),            /* USBPHYINT */
+       .cr2    = IOMEM(0xe605810c),            /* USBCR2 */
        .info = {
                .platform_callback = {
                        .hardware_init  = usbhs_hardware_init,
@@@ -763,20 -763,12 +763,20 @@@ static void __init kzm_init(void
        platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));
  }
  
 +static void kzm9g_restart(char mode, const char *cmd)
 +{
 +#define RESCNT2 0xe6188020
 +      /* Do soft power on reset */
 +      writel((1 << 31), RESCNT2);
 +}
 +
  static const char *kzm9g_boards_compat_dt[] __initdata = {
        "renesas,kzm9g",
        NULL,
  };
  
  DT_MACHINE_START(KZM9G_DT, "kzm9g")
 +      .smp            = smp_ops(sh73a0_smp_ops),
        .map_io         = sh73a0_map_io,
        .init_early     = sh73a0_add_early_devices,
        .nr_irqs        = NR_IRQS_LEGACY,
        .init_machine   = kzm_init,
        .init_late      = shmobile_init_late,
        .timer          = &shmobile_timer,
 +      .restart        = kzm9g_restart,
        .dt_compat      = kzm9g_boards_compat_dt,
  MACHINE_END
@@@ -64,8 -64,6 +64,8 @@@
  #include <asm/mach/arch.h>
  #include <asm/mach-types.h>
  
 +#include "sh-gpio.h"
 +
  /*
   * Address    Interface               BusWidth        note
   * ------------------------------------------------------------------
@@@ -585,8 -583,8 +585,8 @@@ out
  #define USBHS0_POLL_INTERVAL (HZ * 5)
  
  struct usbhs_private {
-       unsigned int usbphyaddr;
-       unsigned int usbcrcaddr;
+       void __iomem *usbphyaddr;
+       void __iomem *usbcrcaddr;
        struct renesas_usbhs_platform_info info;
        struct delayed_work work;
        struct platform_device *pdev;
@@@ -644,7 -642,7 +644,7 @@@ static void usbhs0_hardware_exit(struc
  }
  
  static struct usbhs_private usbhs0_private = {
-       .usbcrcaddr     = 0xe605810c,           /* USBCR2 */
+       .usbcrcaddr     = IOMEM(0xe605810c),            /* USBCR2 */
        .info = {
                .platform_callback = {
                        .hardware_init  = usbhs0_hardware_init,
@@@ -778,8 -776,8 +778,8 @@@ static u32 usbhs1_pipe_cfg[] = 
  };
  
  static struct usbhs_private usbhs1_private = {
-       .usbphyaddr     = 0xe60581e2,           /* USBPHY1INTAP */
-       .usbcrcaddr     = 0xe6058130,           /* USBCR4 */
+       .usbphyaddr     = IOMEM(0xe60581e2),    /* USBPHY1INTAP */
+       .usbcrcaddr     = IOMEM(0xe6058130),    /* USBCR4 */
        .info = {
                .platform_callback = {
                        .hardware_init  = usbhs1_hardware_init,
@@@ -1404,12 -1402,12 +1404,12 @@@ static struct i2c_board_info i2c1_devic
        },
  };
  
- #define GPIO_PORT9CR  0xE6051009
- #define GPIO_PORT10CR 0xE605100A
- #define GPIO_PORT167CR        0xE60520A7
- #define GPIO_PORT168CR        0xE60520A8
- #define SRCR4         0xe61580bc
- #define USCCR1                0xE6058144
+ #define GPIO_PORT9CR  IOMEM(0xE6051009)
+ #define GPIO_PORT10CR IOMEM(0xE605100A)
+ #define GPIO_PORT167CR        IOMEM(0xE60520A7)
+ #define GPIO_PORT168CR        IOMEM(0xE60520A8)
+ #define SRCR4         IOMEM(0xe61580bc)
+ #define USCCR1                IOMEM(0xE6058144)
  static void __init mackerel_init(void)
  {
        u32 srcr4;
@@@ -734,26 -734,6 +734,26 @@@ static struct platform_device mpdma0_de
        },
  };
  
 +static struct resource pmu_resources[] = {
 +      [0] = {
 +              .start  = gic_spi(55),
 +              .end    = gic_spi(55),
 +              .flags  = IORESOURCE_IRQ,
 +      },
 +      [1] = {
 +              .start  = gic_spi(56),
 +              .end    = gic_spi(56),
 +              .flags  = IORESOURCE_IRQ,
 +      },
 +};
 +
 +static struct platform_device pmu_device = {
 +      .name           = "arm-pmu",
 +      .id             = -1,
 +      .num_resources  = ARRAY_SIZE(pmu_resources),
 +      .resource       = pmu_resources,
 +};
 +
  static struct platform_device *sh73a0_early_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
@@@ -777,10 -757,9 +777,10 @@@ static struct platform_device *sh73a0_l
        &i2c4_device,
        &dma0_device,
        &mpdma0_device,
 +      &pmu_device,
  };
  
- #define SRCR2          0xe61580b0
+ #define SRCR2          IOMEM(0xe61580b0)
  
  void __init sh73a0_add_standard_devices(void)
  {
  
  #include <linux/kernel.h>
  #include <linux/errno.h>
 -#include <linux/sh_pfc.h>
  #include <linux/io.h>
  
 -#ifdef CONFIG_GPIOLIB
 -
 -static inline int irq_to_gpio(unsigned int irq)
 -{
 -      return -ENOSYS;
 -}
 -
 -#else
 -
 -#define __ARM_GPIOLIB_COMPLEX
 -
 -#endif /* CONFIG_GPIOLIB */
 -
  /*
   * FIXME !!
   *
   * the method to control only pull up/down/free.
   * this function should be replaced by correct gpio function
   */
- static inline void __init gpio_direction_none(u32 addr)
+ static inline void __init gpio_direction_none(void __iomem * addr)
  {
        __raw_writeb(0x00, addr);
  }
  
- static inline void __init gpio_request_pullup(u32 addr)
+ static inline void __init gpio_request_pullup(void __iomem * addr)
  {
        u8 data = __raw_readb(addr);
  
@@@ -35,7 -49,7 +35,7 @@@
        __raw_writeb(data, addr);
  }
  
- static inline void __init gpio_request_pulldown(u32 addr)
+ static inline void __init gpio_request_pulldown(void __iomem * addr)
  {
        u8 data = __raw_readb(addr);