Skip to content

Commit

Permalink
ARM: shmobile: use __iomem pointers for MMIO
Browse files Browse the repository at this point in the history
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.

Acked-by: Simon Horman <horms@verge.net.au>
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: linux-sh@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Arnd Bergmann committed Sep 18, 2012
1 parent 4cbe5a5 commit 0a4b04d
Show file tree
Hide file tree
Showing 21 changed files with 255 additions and 249 deletions.
12 changes: 6 additions & 6 deletions arch/arm/mach-shmobile/board-ap4evb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-shmobile/board-armadillo800eva.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
* usbhsf_power_ctrl()
*/
#define IRQ7 evt2irq(0x02e0)
#define USBCR1 0xe605810a
#define USBCR1 IOMEM(0xe605810a)
#define USBH 0xC6700000
#define USBH_USBCTR 0x10834

Expand Down Expand Up @@ -949,8 +949,8 @@ static void __init eva_clock_init(void)
/*
* 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;
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mach-shmobile/board-bonito.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_data *data)
Expand Down Expand Up @@ -361,8 +361,8 @@ static void __init bonito_map_io(void)
#define BIT_ON(sw, bit) (sw & (1 << bit))
#define BIT_OFF(sw, bit) (!(sw & (1 << bit)))

#define VCCQ1CR 0xE6058140
#define VCCQ1LCDCR 0xE6058186
#define VCCQ1CR IOMEM(0xE6058140)
#define VCCQ1LCDCR IOMEM(0xE6058186)

static void __init bonito_init(void)
{
Expand Down
12 changes: 6 additions & 6 deletions arch/arm/mach-shmobile/board-g3evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static void usb_host_port_power(int port, int power)
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 = {
Expand Down Expand Up @@ -279,10 +279,10 @@ static void __init g3evm_init(void)
gpio_request(GPIO_FN_IDIN, NULL);

/* setup USB phy */
__raw_writew(0x0300, 0xe605810a); /* USBCR1 */
__raw_writew(0x00e0, 0xe60581c0); /* CPFCH */
__raw_writew(0x6010, 0xe60581c6); /* CGPOSR */
__raw_writew(0x8a0a, 0xe605810c); /* USBCR2 */
__raw_writew(0x0300, IOMEM(0xe605810a)); /* USBCR1 */
__raw_writew(0x00e0, IOMEM(0xe60581c0)); /* CPFCH */
__raw_writew(0x6010, IOMEM(0xe60581c6)); /* CGPOSR */
__raw_writew(0x8a0a, IOMEM(0xe605810c)); /* USBCR2 */

/* KEYSC @ CN7 */
gpio_request(GPIO_FN_PORT42_KEYOUT0, NULL);
Expand Down Expand Up @@ -320,7 +320,7 @@ static void __init g3evm_init(void)
gpio_request(GPIO_FN_WE0_XWR0_FWE, NULL);
gpio_request(GPIO_FN_FRB, NULL);
/* FOE, FCDE, FSC on dedicated pins */
__raw_writel(__raw_readl(0xe6158048) & ~(1 << 15), 0xe6158048);
__raw_writel(__raw_readl(IOMEM(0xe6158048)) & ~(1 << 15), IOMEM(0xe6158048));

/* IrDA */
gpio_request(GPIO_FN_IRDA_OUT, NULL);
Expand Down
30 changes: 15 additions & 15 deletions arch/arm/mach-shmobile/board-g4evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static void usb_host_port_power(int port, int power)
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 = {
Expand Down Expand Up @@ -270,17 +270,17 @@ static struct platform_device *g4evm_devices[] __initdata = {
&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)
{
Expand Down Expand Up @@ -318,10 +318,10 @@ 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);
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mach-shmobile/board-kzm9g.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ static struct platform_device usb_host_device = {

/* USB Func CN17 */
struct usbhs_private {
unsigned int phy;
unsigned int cr2;
void __iomem *phy;
void __iomem *cr2;
struct renesas_usbhs_platform_info info;
};

Expand Down Expand Up @@ -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,
Expand Down
22 changes: 11 additions & 11 deletions arch/arm/mach-shmobile/board-mackerel.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,8 @@ static void __init hdmi_init_pm_clock(void)
#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;
Expand Down Expand Up @@ -642,7 +642,7 @@ static void usbhs0_hardware_exit(struct platform_device *pdev)
}

static struct usbhs_private usbhs0_private = {
.usbcrcaddr = 0xe605810c, /* USBCR2 */
.usbcrcaddr = IOMEM(0xe605810c), /* USBCR2 */
.info = {
.platform_callback = {
.hardware_init = usbhs0_hardware_init,
Expand Down Expand Up @@ -775,8 +775,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,
Expand Down Expand Up @@ -1401,12 +1401,12 @@ static struct i2c_board_info i2c1_devices[] = {
},
};

#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;
Expand Down
46 changes: 23 additions & 23 deletions arch/arm/mach-shmobile/clock-r8a7740.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,29 @@
*/

/* CPG registers */
#define FRQCRA 0xe6150000
#define FRQCRB 0xe6150004
#define VCLKCR1 0xE6150008
#define VCLKCR2 0xE615000c
#define FRQCRC 0xe61500e0
#define FSIACKCR 0xe6150018
#define PLLC01CR 0xe6150028

#define SUBCKCR 0xe6150080
#define USBCKCR 0xe615008c

#define MSTPSR0 0xe6150030
#define MSTPSR1 0xe6150038
#define MSTPSR2 0xe6150040
#define MSTPSR3 0xe6150048
#define MSTPSR4 0xe615004c
#define FSIBCKCR 0xe6150090
#define HDMICKCR 0xe6150094
#define SMSTPCR0 0xe6150130
#define SMSTPCR1 0xe6150134
#define SMSTPCR2 0xe6150138
#define SMSTPCR3 0xe615013c
#define SMSTPCR4 0xe6150140
#define FRQCRA IOMEM(0xe6150000)
#define FRQCRB IOMEM(0xe6150004)
#define VCLKCR1 IOMEM(0xE6150008)
#define VCLKCR2 IOMEM(0xE615000c)
#define FRQCRC IOMEM(0xe61500e0)
#define FSIACKCR IOMEM(0xe6150018)
#define PLLC01CR IOMEM(0xe6150028)

#define SUBCKCR IOMEM(0xe6150080)
#define USBCKCR IOMEM(0xe615008c)

#define MSTPSR0 IOMEM(0xe6150030)
#define MSTPSR1 IOMEM(0xe6150038)
#define MSTPSR2 IOMEM(0xe6150040)
#define MSTPSR3 IOMEM(0xe6150048)
#define MSTPSR4 IOMEM(0xe615004c)
#define FSIBCKCR IOMEM(0xe6150090)
#define HDMICKCR IOMEM(0xe6150094)
#define SMSTPCR0 IOMEM(0xe6150130)
#define SMSTPCR1 IOMEM(0xe6150134)
#define SMSTPCR2 IOMEM(0xe6150138)
#define SMSTPCR3 IOMEM(0xe615013c)
#define SMSTPCR4 IOMEM(0xe6150140)

/* Fixed 32 KHz root clock from EXTALR pin */
static struct clk extalr_clk = {
Expand Down
44 changes: 22 additions & 22 deletions arch/arm/mach-shmobile/clock-sh7367.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,28 @@
#include <mach/common.h>

/* SH7367 registers */
#define RTFRQCR 0xe6150000
#define SYFRQCR 0xe6150004
#define CMFRQCR 0xe61500E0
#define VCLKCR1 0xe6150008
#define VCLKCR2 0xe615000C
#define VCLKCR3 0xe615001C
#define SCLKACR 0xe6150010
#define SCLKBCR 0xe6150014
#define SUBUSBCKCR 0xe6158080
#define SPUCKCR 0xe6150084
#define MSUCKCR 0xe6150088
#define MVI3CKCR 0xe6150090
#define VOUCKCR 0xe6150094
#define MFCK1CR 0xe6150098
#define MFCK2CR 0xe615009C
#define PLLC1CR 0xe6150028
#define PLLC2CR 0xe615002C
#define RTMSTPCR0 0xe6158030
#define RTMSTPCR2 0xe6158038
#define SYMSTPCR0 0xe6158040
#define SYMSTPCR2 0xe6158048
#define CMMSTPCR0 0xe615804c
#define RTFRQCR IOMEM(0xe6150000)
#define SYFRQCR IOMEM(0xe6150004)
#define CMFRQCR IOMEM(0xe61500E0)
#define VCLKCR1 IOMEM(0xe6150008)
#define VCLKCR2 IOMEM(0xe615000C)
#define VCLKCR3 IOMEM(0xe615001C)
#define SCLKACR IOMEM(0xe6150010)
#define SCLKBCR IOMEM(0xe6150014)
#define SUBUSBCKCR IOMEM(0xe6158080)
#define SPUCKCR IOMEM(0xe6150084)
#define MSUCKCR IOMEM(0xe6150088)
#define MVI3CKCR IOMEM(0xe6150090)
#define VOUCKCR IOMEM(0xe6150094)
#define MFCK1CR IOMEM(0xe6150098)
#define MFCK2CR IOMEM(0xe615009C)
#define PLLC1CR IOMEM(0xe6150028)
#define PLLC2CR IOMEM(0xe615002C)
#define RTMSTPCR0 IOMEM(0xe6158030)
#define RTMSTPCR2 IOMEM(0xe6158038)
#define SYMSTPCR0 IOMEM(0xe6158040)
#define SYMSTPCR2 IOMEM(0xe6158048)
#define CMMSTPCR0 IOMEM(0xe615804c)

/* Fixed 32 KHz root clock from EXTALR pin */
static struct clk r_clk = {
Expand Down
Loading

0 comments on commit 0a4b04d

Please sign in to comment.