Re: [PATCH 01/24] ARM: shmobile: use __iomem pointers for MMIO

2012-09-18 Thread Simon Horman
On Tue, Sep 18, 2012 at 04:04:49PM +, Arnd Bergmann wrote:
> On Tuesday 18 September 2012, Simon Horman wrote:
> > > I agree it's not nice to have to do this, but this is largely because
> > > of shmobile doing things differently from all other ARM platforms, on
> > > which the respective patches tend to clean up things and reduce the
> > > number of type casts.
> > > 
> > > The only alternative I can see is for shmobile to introduce its own
> > > mach/io.h file with the relaxed type checking, but that would only
> > > defer the problem until the point where you want shmobile to be part
> > > of the common multiplatform kernel binary.
> > 
> > If it is needed in the long term, then I'm happy with it going in now.
> > Could you remove the portion that Paul objected to?
> 
> Yes, I already did that.

Great, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 01/24] ARM: shmobile: use __iomem pointers for MMIO

2012-09-18 Thread Arnd Bergmann
On Tuesday 18 September 2012, Simon Horman wrote:
> > I agree it's not nice to have to do this, but this is largely because
> > of shmobile doing things differently from all other ARM platforms, on
> > which the respective patches tend to clean up things and reduce the
> > number of type casts.
> > 
> > The only alternative I can see is for shmobile to introduce its own
> > mach/io.h file with the relaxed type checking, but that would only
> > defer the problem until the point where you want shmobile to be part
> > of the common multiplatform kernel binary.
> 
> If it is needed in the long term, then I'm happy with it going in now.
> Could you remove the portion that Paul objected to?

Yes, I already did that.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 01/24] ARM: shmobile: use __iomem pointers for MMIO

2012-09-18 Thread Simon Horman
On Tue, Sep 18, 2012 at 08:31:06AM +, Arnd Bergmann wrote:
> On Tuesday 18 September 2012, Simon Horman wrote:
> > On Fri, Sep 14, 2012 at 11:34:29PM +0200, Arnd Bergmann wrote:
> > > ARM is moving to stricter checks on readl/write functions,
> > > so we need to use the correct types everywhere.
> > > 
> > > This patch is a bit ugly for shmobile, which is the only platform
> > > that just uses integer literals all over the place, but I can't
> > > see a better way to do this.
> > > 
> > > Cc: Magnus Damm 
> > > Cc: Kuninori Morimoto 
> > > Cc: Simon Horman 
> > > Cc: Paul Mundt 
> > > Cc: linux...@vger.kernel.org
> > > Signed-off-by: Arnd Bergmann 
> > 
> > Wow, thats a lot of chrun, but if we must
> > 
> > Acked-by: Simon Horman 
> > 
> 
> I agree it's not nice to have to do this, but this is largely because
> of shmobile doing things differently from all other ARM platforms, on
> which the respective patches tend to clean up things and reduce the
> number of type casts.
> 
> The only alternative I can see is for shmobile to introduce its own
> mach/io.h file with the relaxed type checking, but that would only
> defer the problem until the point where you want shmobile to be part
> of the common multiplatform kernel binary.

If it is needed in the long term, then I'm happy with it going in now.
Could you remove the portion that Paul objected to?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 01/24] ARM: shmobile: use __iomem pointers for MMIO

2012-09-18 Thread Arnd Bergmann
On Tuesday 18 September 2012, Simon Horman wrote:
> On Fri, Sep 14, 2012 at 11:34:29PM +0200, Arnd Bergmann wrote:
> > ARM is moving to stricter checks on readl/write functions,
> > so we need to use the correct types everywhere.
> > 
> > This patch is a bit ugly for shmobile, which is the only platform
> > that just uses integer literals all over the place, but I can't
> > see a better way to do this.
> > 
> > Cc: Magnus Damm 
> > Cc: Kuninori Morimoto 
> > Cc: Simon Horman 
> > Cc: Paul Mundt 
> > Cc: linux...@vger.kernel.org
> > Signed-off-by: Arnd Bergmann 
> 
> Wow, thats a lot of chrun, but if we must
> 
> Acked-by: Simon Horman 
> 

I agree it's not nice to have to do this, but this is largely because
of shmobile doing things differently from all other ARM platforms, on
which the respective patches tend to clean up things and reduce the
number of type casts.

The only alternative I can see is for shmobile to introduce its own
mach/io.h file with the relaxed type checking, but that would only
defer the problem until the point where you want shmobile to be part
of the common multiplatform kernel binary.

Arnd

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 01/24] ARM: shmobile: use __iomem pointers for MMIO

2012-09-18 Thread Paul Mundt
On Fri, Sep 14, 2012 at 11:34:29PM +0200, Arnd Bergmann wrote:
> ARM is moving to stricter checks on readl/write functions,
> so we need to use the correct types everywhere.
> 
> This patch is a bit ugly for shmobile, which is the only platform
> that just uses integer literals all over the place, but I can't
> see a better way to do this.
> 
If you want to crap up the ARM side with this stuff, that's fine, but
leave sh-sci out of it.

So, NAK on this part:

> diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
> index eb763ad..d323290 100644
> --- a/include/linux/serial_sci.h
> +++ b/include/linux/serial_sci.h
> @@ -150,7 +150,7 @@ struct plat_sci_port {
>   int overrun_bit;
>   unsigned interror_mask;
>  
> - int port_reg;
> + void __iomem   *port_reg;
>   unsigned char   regshift;
>   unsigned char   regtype;
>  
but I don't mind if you cast the callsite in drivers/tty/serial/sh-sci.c
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 01/24] ARM: shmobile: use __iomem pointers for MMIO

2012-09-18 Thread Simon Horman
On Fri, Sep 14, 2012 at 11:34:29PM +0200, Arnd Bergmann wrote:
> ARM is moving to stricter checks on readl/write functions,
> so we need to use the correct types everywhere.
> 
> This patch is a bit ugly for shmobile, which is the only platform
> that just uses integer literals all over the place, but I can't
> see a better way to do this.
> 
> Cc: Magnus Damm 
> Cc: Kuninori Morimoto 
> Cc: Simon Horman 
> Cc: Paul Mundt 
> Cc: linux...@vger.kernel.org
> Signed-off-by: Arnd Bergmann 

Wow, thats a lot of chrun, but if we must

Acked-by: Simon Horman 

> ---
>  arch/arm/mach-shmobile/board-ap4evb.c  |   12 ++--
>  arch/arm/mach-shmobile/board-armadillo800eva.c |6 +-
>  arch/arm/mach-shmobile/board-bonito.c  |8 +--
>  arch/arm/mach-shmobile/board-g3evm.c   |   12 ++--
>  arch/arm/mach-shmobile/board-g4evm.c   |   30 +-
>  arch/arm/mach-shmobile/board-kzm9g.c   |8 +--
>  arch/arm/mach-shmobile/board-mackerel.c|   22 
>  arch/arm/mach-shmobile/clock-r8a7740.c |   46 
>  arch/arm/mach-shmobile/clock-sh7367.c  |   44 +++
>  arch/arm/mach-shmobile/clock-sh7372.c  |   60 ++--
>  arch/arm/mach-shmobile/clock-sh7377.c  |   50 -
>  arch/arm/mach-shmobile/clock-sh73a0.c  |   70 
> 
>  arch/arm/mach-shmobile/include/mach/gpio.h |6 +-
>  arch/arm/mach-shmobile/intc-r8a7779.c  |   14 ++---
>  arch/arm/mach-shmobile/intc-sh7372.c   |   27 +
>  arch/arm/mach-shmobile/intc-sh73a0.c   |   20 ---
>  arch/arm/mach-shmobile/pm-rmobile.c|6 +-
>  arch/arm/mach-shmobile/pm-sh7372.c |   57 +--
>  arch/arm/mach-shmobile/setup-sh7367.c  |2 +-
>  arch/arm/mach-shmobile/setup-sh7377.c  |2 +-
>  arch/arm/mach-shmobile/setup-sh73a0.c  |2 +-
>  include/linux/serial_sci.h |2 +-
>  22 files changed, 256 insertions(+), 250 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 01/24] ARM: shmobile: use __iomem pointers for MMIO

2012-09-14 Thread Arnd Bergmann
ARM is moving to stricter checks on readl/write functions,
so we need to use the correct types everywhere.

This patch is a bit ugly for shmobile, which is the only platform
that just uses integer literals all over the place, but I can't
see a better way to do this.

Cc: Magnus Damm 
Cc: Kuninori Morimoto 
Cc: Simon Horman 
Cc: Paul Mundt 
Cc: linux...@vger.kernel.org
Signed-off-by: Arnd Bergmann 
---
 arch/arm/mach-shmobile/board-ap4evb.c  |   12 ++--
 arch/arm/mach-shmobile/board-armadillo800eva.c |6 +-
 arch/arm/mach-shmobile/board-bonito.c  |8 +--
 arch/arm/mach-shmobile/board-g3evm.c   |   12 ++--
 arch/arm/mach-shmobile/board-g4evm.c   |   30 +-
 arch/arm/mach-shmobile/board-kzm9g.c   |8 +--
 arch/arm/mach-shmobile/board-mackerel.c|   22 
 arch/arm/mach-shmobile/clock-r8a7740.c |   46 
 arch/arm/mach-shmobile/clock-sh7367.c  |   44 +++
 arch/arm/mach-shmobile/clock-sh7372.c  |   60 ++--
 arch/arm/mach-shmobile/clock-sh7377.c  |   50 -
 arch/arm/mach-shmobile/clock-sh73a0.c  |   70 
 arch/arm/mach-shmobile/include/mach/gpio.h |6 +-
 arch/arm/mach-shmobile/intc-r8a7779.c  |   14 ++---
 arch/arm/mach-shmobile/intc-sh7372.c   |   27 +
 arch/arm/mach-shmobile/intc-sh73a0.c   |   20 ---
 arch/arm/mach-shmobile/pm-rmobile.c|6 +-
 arch/arm/mach-shmobile/pm-sh7372.c |   57 +--
 arch/arm/mach-shmobile/setup-sh7367.c  |2 +-
 arch/arm/mach-shmobile/setup-sh7377.c  |2 +-
 arch/arm/mach-shmobile/setup-sh73a0.c  |2 +-
 include/linux/serial_sci.h |2 +-
 22 files changed, 256 insertions(+), 250 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-ap4evb.c 
b/arch/arm/mach-shmobile/board-ap4evb.c
index f172ca8..1089ee5 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -432,7 +432,7 @@ static void usb1_host_port_power(int port, int power)
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 = {
@@ -1224,9 +1224,9 @@ static struct i2c_board_info i2c1_devices[] = {
 };
 
 
-#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;
@@ -1304,7 +1304,7 @@ static void __init ap4evb_init(void)
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);
@@ -1453,7 +1453,7 @@ static void __init ap4evb_init(void)
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);
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c 
b/arch/arm/mach-shmobile/board-armadillo800eva.c
index cf10f92..2f32aa6 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -135,7 +135,7 @@
  * usbhsf_power_ctrl()
  */
 #define IRQ7   evt2irq(0x02e0)
-#define USBCR1 0xe605810a
+#define USBCR1 IOMEM(0xe605810a)
 #define USBH   0xC670
 #define USBH_USBCTR0x10834
 
@@ -949,8 +949,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;
diff --git a/arch/arm/mach-shmobile/board-bonito.c 
b/arch/arm/mach-shmobile/board-bonito.c
index 4129008..cb8c994 100644
--- a/arch/arm/mach-shmobile/board-bonito.c
+++ b/arch/arm/mach-shmobile/board-bonito.c
@@ -108,12 +108,12 @@ static struct regulator_consumer_supply dummy_supplies[] 
= {
 #define FPGA_ETH_IRQ   (FPGA_IRQ0 + 15)
 static u16 bonito_fpga_read(u32 offset)
 {
-   return __raw_readw(0xf0003000 + offset);
+   return __raw_readw(IOMEM(0xf0003000) + offset);
 }
 
 static void bonito_fpga_write(u32 offset, u16 val)
 {
-   __raw_writew(val, 0xf0003000 + offset);
+   __raw_writew(val, IOMEM(0xf0003000) + offset);
 }
 
 static void bonito_fpga_irq_disable(struct irq_dat