Commit 4c9b7493 authored by Russell King's avatar Russell King Committed by Tony Lindgren

omap: Fix IO_ADDRESS() macros

Modified version of Russell's patch 40c0133a904466ec5423d1088d3c85598ac9e030
to apply to linux-omap tree.

OMAP1_IO_ADDRESS(), OMAP2_IO_ADDRESS() and IO_ADDRESS() returns cookies
for use with __raw_{read|write}* for accessing registers.  Therefore,
these macros should return (void __iomem *) cookies, not integer values.

Doing this improves typechecking, and means we can find those places
where, eg, DMA controllers are incorrectly given virtual addresses to
DMA to, or physical addresses are thrown through a virtual to physical
address translation.
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 90b0032b
...@@ -67,8 +67,8 @@ static void __init omap_serial_reset(struct plat_serial8250_port *p) ...@@ -67,8 +67,8 @@ static void __init omap_serial_reset(struct plat_serial8250_port *p)
static struct plat_serial8250_port serial_platform_data[] = { static struct plat_serial8250_port serial_platform_data[] = {
{ {
.membase = (char*)IO_ADDRESS(OMAP_UART1_BASE), .membase = IO_ADDRESS(OMAP_UART1_BASE),
.mapbase = (unsigned long)OMAP_UART1_BASE, .mapbase = OMAP_UART1_BASE,
.irq = INT_UART1, .irq = INT_UART1,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.iotype = UPIO_MEM, .iotype = UPIO_MEM,
...@@ -76,8 +76,8 @@ static struct plat_serial8250_port serial_platform_data[] = { ...@@ -76,8 +76,8 @@ static struct plat_serial8250_port serial_platform_data[] = {
.uartclk = OMAP16XX_BASE_BAUD * 16, .uartclk = OMAP16XX_BASE_BAUD * 16,
}, },
{ {
.membase = (char*)IO_ADDRESS(OMAP_UART2_BASE), .membase = IO_ADDRESS(OMAP_UART2_BASE),
.mapbase = (unsigned long)OMAP_UART2_BASE, .mapbase = OMAP_UART2_BASE,
.irq = INT_UART2, .irq = INT_UART2,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.iotype = UPIO_MEM, .iotype = UPIO_MEM,
...@@ -85,8 +85,8 @@ static struct plat_serial8250_port serial_platform_data[] = { ...@@ -85,8 +85,8 @@ static struct plat_serial8250_port serial_platform_data[] = {
.uartclk = OMAP16XX_BASE_BAUD * 16, .uartclk = OMAP16XX_BASE_BAUD * 16,
}, },
{ {
.membase = (char*)IO_ADDRESS(OMAP_UART3_BASE), .membase = IO_ADDRESS(OMAP_UART3_BASE),
.mapbase = (unsigned long)OMAP_UART3_BASE, .mapbase = OMAP_UART3_BASE,
.irq = INT_UART3, .irq = INT_UART3,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.iotype = UPIO_MEM, .iotype = UPIO_MEM,
......
...@@ -65,28 +65,28 @@ static struct clk *gpmc_l3_clk; ...@@ -65,28 +65,28 @@ static struct clk *gpmc_l3_clk;
static void gpmc_write_reg(int idx, u32 val) static void gpmc_write_reg(int idx, u32 val)
{ {
__raw_writel(val, (__force void __iomem *)(gpmc_base + idx)); __raw_writel(val, gpmc_base + idx);
} }
static u32 gpmc_read_reg(int idx) static u32 gpmc_read_reg(int idx)
{ {
return __raw_readl((__force void __iomem *)(gpmc_base + idx)); return __raw_readl(gpmc_base + idx);
} }
void gpmc_cs_write_reg(int cs, int idx, u32 val) void gpmc_cs_write_reg(int cs, int idx, u32 val)
{ {
u32 reg_addr; void __iomem *reg_addr;
reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx; reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
__raw_writel(val, (__force void __iomem *)reg_addr); __raw_writel(val, reg_addr);
} }
u32 gpmc_cs_read_reg(int cs, int idx) u32 gpmc_cs_read_reg(int cs, int idx)
{ {
u32 reg_addr; void __iomem *reg_addr;
reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx; reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
return __raw_readl((__force void __iomem *)reg_addr); return __raw_readl(reg_addr);
} }
/* TODO: Add support for gpmc_fck to clock framework and use it */ /* TODO: Add support for gpmc_fck to clock framework and use it */
...@@ -417,12 +417,12 @@ void __init gpmc_init(void) ...@@ -417,12 +417,12 @@ void __init gpmc_init(void)
if (cpu_is_omap24xx()) { if (cpu_is_omap24xx()) {
gpmc_l3_clk = clk_get(NULL, "core_l3_ck"); gpmc_l3_clk = clk_get(NULL, "core_l3_ck");
if (cpu_is_omap2420()) if (cpu_is_omap2420())
gpmc_base = io_p2v(OMAP2420_GPMC_BASE); gpmc_base = OMAP2_IO_ADDRESS(OMAP2420_GPMC_BASE);
else if (cpu_is_omap2430()) else if (cpu_is_omap2430())
gpmc_base = io_p2v(OMAP243X_GPMC_BASE); gpmc_base = OMAP2_IO_ADDRESS(OMAP243X_GPMC_BASE);
} else if (cpu_is_omap34xx()) { } else if (cpu_is_omap34xx()) {
gpmc_l3_clk = clk_get(NULL, "gpmc_fck"); gpmc_l3_clk = clk_get(NULL, "gpmc_fck");
gpmc_base = io_p2v(OMAP34XX_GPMC_BASE); gpmc_base = OMAP2_IO_ADDRESS(OMAP34XX_GPMC_BASE);
} }
BUG_ON(IS_ERR(gpmc_l3_clk)); BUG_ON(IS_ERR(gpmc_l3_clk));
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
* for each bank.. when in doubt, consult the TRM. * for each bank.. when in doubt, consult the TRM.
*/ */
static struct omap_irq_bank { static struct omap_irq_bank {
unsigned long base_reg; void __iomem *base_reg;
unsigned int nr_irqs; unsigned int nr_irqs;
} __attribute__ ((aligned(4))) irq_banks[] = { } __attribute__ ((aligned(4))) irq_banks[] = {
{ {
...@@ -102,7 +102,7 @@ static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank) ...@@ -102,7 +102,7 @@ static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
unsigned long tmp; unsigned long tmp;
tmp = intc_bank_read_reg(bank, INTC_REVISION) & 0xff; tmp = intc_bank_read_reg(bank, INTC_REVISION) & 0xff;
printk(KERN_INFO "IRQ: Found an INTC at 0x%08lx " printk(KERN_INFO "IRQ: Found an INTC at 0x%p "
"(revision %ld.%ld) with %d interrupts\n", "(revision %ld.%ld) with %d interrupts\n",
bank->base_reg, tmp >> 4, tmp & 0xf, bank->nr_irqs); bank->base_reg, tmp >> 4, tmp & 0xf, bank->nr_irqs);
...@@ -147,9 +147,9 @@ void __init omap_init_irq(void) ...@@ -147,9 +147,9 @@ void __init omap_init_irq(void)
struct omap_irq_bank *bank = irq_banks + i; struct omap_irq_bank *bank = irq_banks + i;
if (cpu_is_omap24xx()) if (cpu_is_omap24xx())
bank->base_reg = io_p2v(OMAP24XX_IC_BASE); bank->base_reg = OMAP2_IO_ADDRESS(OMAP24XX_IC_BASE);
else if (cpu_is_omap34xx()) else if (cpu_is_omap34xx())
bank->base_reg = io_p2v(OMAP34XX_IC_BASE); bank->base_reg = OMAP2_IO_ADDRESS(OMAP34XX_IC_BASE);
omap_irq_bank_init_one(bank); omap_irq_bank_init_one(bank);
......
...@@ -28,24 +28,24 @@ static struct clk *uart_fck[OMAP_MAX_NR_PORTS]; ...@@ -28,24 +28,24 @@ static struct clk *uart_fck[OMAP_MAX_NR_PORTS];
static struct plat_serial8250_port serial_platform_data[] = { static struct plat_serial8250_port serial_platform_data[] = {
{ {
.membase = (void __iomem *)IO_ADDRESS(OMAP_UART1_BASE), .membase = IO_ADDRESS(OMAP_UART1_BASE),
.mapbase = (unsigned long)OMAP_UART1_BASE, .mapbase = OMAP_UART1_BASE,
.irq = 72, .irq = 72,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.iotype = UPIO_MEM, .iotype = UPIO_MEM,
.regshift = 2, .regshift = 2,
.uartclk = OMAP24XX_BASE_BAUD * 16, .uartclk = OMAP24XX_BASE_BAUD * 16,
}, { }, {
.membase = (void __iomem *)IO_ADDRESS(OMAP_UART2_BASE), .membase = IO_ADDRESS(OMAP_UART2_BASE),
.mapbase = (unsigned long)OMAP_UART2_BASE, .mapbase = OMAP_UART2_BASE,
.irq = 73, .irq = 73,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.iotype = UPIO_MEM, .iotype = UPIO_MEM,
.regshift = 2, .regshift = 2,
.uartclk = OMAP24XX_BASE_BAUD * 16, .uartclk = OMAP24XX_BASE_BAUD * 16,
}, { }, {
.membase = (void __iomem *)IO_ADDRESS(OMAP_UART3_BASE), .membase = IO_ADDRESS(OMAP_UART3_BASE),
.mapbase = (unsigned long)OMAP_UART3_BASE, .mapbase = OMAP_UART3_BASE,
.irq = 74, .irq = 74,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.iotype = UPIO_MEM, .iotype = UPIO_MEM,
......
...@@ -281,12 +281,12 @@ static void __init __omap2_set_globals(void) ...@@ -281,12 +281,12 @@ static void __init __omap2_set_globals(void)
static struct omap_globals omap242x_globals = { static struct omap_globals omap242x_globals = {
.class = OMAP242X_CLASS, .class = OMAP242X_CLASS,
.tap = (__force void __iomem *)OMAP2_IO_ADDRESS(0x48014000), .tap = OMAP2_IO_ADDRESS(0x48014000),
.sdrc = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_SDRC_BASE), .sdrc = OMAP2_IO_ADDRESS(OMAP2420_SDRC_BASE),
.sms = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_SMS_BASE), .sms = OMAP2_IO_ADDRESS(OMAP2420_SMS_BASE),
.ctrl = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_CTRL_BASE), .ctrl = OMAP2_IO_ADDRESS(OMAP2420_CTRL_BASE),
.prm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_PRM_BASE), .prm = OMAP2_IO_ADDRESS(OMAP2420_PRM_BASE),
.cm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_CM_BASE), .cm = OMAP2_IO_ADDRESS(OMAP2420_CM_BASE),
}; };
void __init omap2_set_globals_242x(void) void __init omap2_set_globals_242x(void)
...@@ -300,12 +300,12 @@ void __init omap2_set_globals_242x(void) ...@@ -300,12 +300,12 @@ void __init omap2_set_globals_242x(void)
static struct omap_globals omap243x_globals = { static struct omap_globals omap243x_globals = {
.class = OMAP243X_CLASS, .class = OMAP243X_CLASS,
.tap = (__force void __iomem *)OMAP2_IO_ADDRESS(0x4900a000), .tap = OMAP2_IO_ADDRESS(0x4900a000),
.sdrc = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP243X_SDRC_BASE), .sdrc = OMAP2_IO_ADDRESS(OMAP243X_SDRC_BASE),
.sms = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP243X_SMS_BASE), .sms = OMAP2_IO_ADDRESS(OMAP243X_SMS_BASE),
.ctrl = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP243X_CTRL_BASE), .ctrl = OMAP2_IO_ADDRESS(OMAP243X_CTRL_BASE),
.prm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2430_PRM_BASE), .prm = OMAP2_IO_ADDRESS(OMAP2430_PRM_BASE),
.cm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2430_CM_BASE), .cm = OMAP2_IO_ADDRESS(OMAP2430_CM_BASE),
}; };
void __init omap2_set_globals_243x(void) void __init omap2_set_globals_243x(void)
...@@ -319,12 +319,12 @@ void __init omap2_set_globals_243x(void) ...@@ -319,12 +319,12 @@ void __init omap2_set_globals_243x(void)
static struct omap_globals omap343x_globals = { static struct omap_globals omap343x_globals = {
.class = OMAP343X_CLASS, .class = OMAP343X_CLASS,
.tap = (__force void __iomem *)OMAP2_IO_ADDRESS(0x4830A000), .tap = OMAP2_IO_ADDRESS(0x4830A000),
.sdrc = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE), .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
.sms = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE), .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
.ctrl = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE), .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
.prm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE), .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
.cm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP3430_CM_BASE), .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
}; };
void __init omap2_set_globals_343x(void) void __init omap2_set_globals_343x(void)
......
...@@ -2298,13 +2298,13 @@ static int __init omap_init_dma(void) ...@@ -2298,13 +2298,13 @@ static int __init omap_init_dma(void)
int ch, r; int ch, r;
if (cpu_class_is_omap1()) { if (cpu_class_is_omap1()) {
omap_dma_base = (void __iomem *)IO_ADDRESS(OMAP1_DMA_BASE); omap_dma_base = IO_ADDRESS(OMAP1_DMA_BASE);
dma_lch_count = OMAP1_LOGICAL_DMA_CH_COUNT; dma_lch_count = OMAP1_LOGICAL_DMA_CH_COUNT;
} else if (cpu_is_omap24xx()) { } else if (cpu_is_omap24xx()) {
omap_dma_base = (void __iomem *)IO_ADDRESS(OMAP24XX_DMA4_BASE); omap_dma_base = IO_ADDRESS(OMAP24XX_DMA4_BASE);
dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT;
} else if (cpu_is_omap34xx()) { } else if (cpu_is_omap34xx()) {
omap_dma_base = (void __iomem *)IO_ADDRESS(OMAP34XX_DMA4_BASE); omap_dma_base = IO_ADDRESS(OMAP34XX_DMA4_BASE);
dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT;
} else { } else {
pr_err("DMA init failed for unsupported omap\n"); pr_err("DMA init failed for unsupported omap\n");
......
...@@ -693,7 +693,7 @@ int __init omap_dm_timer_init(void) ...@@ -693,7 +693,7 @@ int __init omap_dm_timer_init(void)
for (i = 0; i < dm_timer_count; i++) { for (i = 0; i < dm_timer_count; i++) {
timer = &dm_timers[i]; timer = &dm_timers[i];
timer->io_base = (void __iomem *)io_p2v(timer->phys_base); timer->io_base = IO_ADDRESS(timer->phys_base);
#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
if (cpu_class_is_omap2()) { if (cpu_class_is_omap2()) {
char clk_name[16]; char clk_name[16];
......
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#define OMAP242X_CTRL_REGADDR(reg) \ #define OMAP242X_CTRL_REGADDR(reg) \
(void __iomem *)IO_ADDRESS(OMAP242X_CTRL_BASE + (reg)) IO_ADDRESS(OMAP242X_CTRL_BASE + (reg))
#define OMAP243X_CTRL_REGADDR(reg) \ #define OMAP243X_CTRL_REGADDR(reg) \
(void __iomem *)IO_ADDRESS(OMAP243X_CTRL_BASE + (reg)) IO_ADDRESS(OMAP243X_CTRL_BASE + (reg))
#define OMAP343X_CTRL_REGADDR(reg) \ #define OMAP343X_CTRL_REGADDR(reg) \
(void __iomem *)IO_ADDRESS(OMAP343X_CTRL_BASE + (reg)) IO_ADDRESS(OMAP343X_CTRL_BASE + (reg))
#else #else
#define OMAP242X_CTRL_REGADDR(reg) IO_ADDRESS(OMAP242X_CTRL_BASE + (reg)) #define OMAP242X_CTRL_REGADDR(reg) IO_ADDRESS(OMAP242X_CTRL_BASE + (reg))
#define OMAP243X_CTRL_REGADDR(reg) IO_ADDRESS(OMAP243X_CTRL_BASE + (reg)) #define OMAP243X_CTRL_REGADDR(reg) IO_ADDRESS(OMAP243X_CTRL_BASE + (reg))
......
...@@ -59,9 +59,8 @@ ...@@ -59,9 +59,8 @@
#define IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */ #define IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */
#define IO_SIZE 0x40000 #define IO_SIZE 0x40000
#define IO_VIRT (IO_PHYS - IO_OFFSET) #define IO_VIRT (IO_PHYS - IO_OFFSET)
#define IO_ADDRESS(pa) ((pa) - IO_OFFSET) #define __IO_ADDRESS(pa) ((pa) - IO_OFFSET)
#define OMAP1_IO_ADDRESS(pa) ((pa) - IO_OFFSET) #define __OMAP1_IO_ADDRESS(pa) ((pa) - IO_OFFSET)
#define io_p2v(pa) ((pa) - IO_OFFSET)
#define io_v2p(va) ((va) + IO_OFFSET) #define io_v2p(va) ((va) + IO_OFFSET)
#elif defined(CONFIG_ARCH_OMAP2) #elif defined(CONFIG_ARCH_OMAP2)
...@@ -88,9 +87,8 @@ ...@@ -88,9 +87,8 @@
#define OMAP243X_SMS_SIZE SZ_1M #define OMAP243X_SMS_SIZE SZ_1M
#define IO_OFFSET 0x90000000 #define IO_OFFSET 0x90000000
#define IO_ADDRESS(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */ #define __IO_ADDRESS(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */
#define OMAP2_IO_ADDRESS(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */ #define __OMAP2_IO_ADDRESS(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */
#define io_p2v(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */
#define io_v2p(va) ((va) - IO_OFFSET) /* Works for L3 and L4 */ #define io_v2p(va) ((va) - IO_OFFSET) /* Works for L3 and L4 */
/* DSP */ /* DSP */
...@@ -146,9 +144,8 @@ ...@@ -146,9 +144,8 @@
#define IO_OFFSET 0x90000000 #define IO_OFFSET 0x90000000
#define IO_ADDRESS(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */ #define __IO_ADDRESS(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */
#define OMAP2_IO_ADDRESS(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */ #define __OMAP2_IO_ADDRESS(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */
#define io_p2v(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */
#define io_v2p(va) ((va) - IO_OFFSET)/* Works for L3 and L4 */ #define io_v2p(va) ((va) - IO_OFFSET)/* Works for L3 and L4 */
/* DSP */ /* DSP */
...@@ -164,7 +161,17 @@ ...@@ -164,7 +161,17 @@
#endif #endif
#ifndef __ASSEMBLER__ #ifdef __ASSEMBLER__
#define IO_ADDRESS(pa) __IO_ADDRESS(pa)
#define OMAP1_IO_ADDRESS(pa) __OMAP1_IO_ADDRESS(pa)
#define OMAP2_IO_ADDRESS(pa) __OMAP2_IO_ADDRESS(pa)
#else
#define IO_ADDRESS(pa) ((void __iomem *)__IO_ADDRESS(pa))
#define OMAP1_IO_ADDRESS(pa) ((void __iomem *)__OMAP1_IO_ADDRESS(pa))
#define OMAP2_IO_ADDRESS(pa) ((void __iomem *)__OMAP2_IO_ADDRESS(pa))
/* /*
* Functions to access the OMAP IO region * Functions to access the OMAP IO region
...@@ -175,13 +182,13 @@ ...@@ -175,13 +182,13 @@
* - DO NOT use hardcoded virtual addresses to allow changing the * - DO NOT use hardcoded virtual addresses to allow changing the
* IO address space again if needed * IO address space again if needed
*/ */
#define omap_readb(a) (*(volatile unsigned char *)IO_ADDRESS(a)) #define omap_readb(a) __raw_readb(IO_ADDRESS(a))
#define omap_readw(a) (*(volatile unsigned short *)IO_ADDRESS(a)) #define omap_readw(a) __raw_readw(IO_ADDRESS(a))
#define omap_readl(a) (*(volatile unsigned int *)IO_ADDRESS(a)) #define omap_readl(a) __raw_readl(IO_ADDRESS(a))
#define omap_writeb(v,a) (*(volatile unsigned char *)IO_ADDRESS(a) = (v)) #define omap_writeb(v,a) __raw_writeb(v, IO_ADDRESS(a))
#define omap_writew(v,a) (*(volatile unsigned short *)IO_ADDRESS(a) = (v)) #define omap_writew(v,a) __raw_writew(v, IO_ADDRESS(a))
#define omap_writel(v,a) (*(volatile unsigned int *)IO_ADDRESS(a) = (v)) #define omap_writel(v,a) __raw_writel(v, IO_ADDRESS(a))
struct omap_sdrc_params; struct omap_sdrc_params;
......
...@@ -39,11 +39,11 @@ ...@@ -39,11 +39,11 @@
* Register and offset definitions to be used in PM assembler code * Register and offset definitions to be used in PM assembler code
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
#define CLKGEN_REG_ASM_BASE io_p2v(0xfffece00) #define CLKGEN_REG_ASM_BASE IO_ADDRESS(0xfffece00)
#define ARM_IDLECT1_ASM_OFFSET 0x04 #define ARM_IDLECT1_ASM_OFFSET 0x04
#define ARM_IDLECT2_ASM_OFFSET 0x08 #define ARM_IDLECT2_ASM_OFFSET 0x08
#define TCMIF_ASM_BASE io_p2v(0xfffecc00) #define TCMIF_ASM_BASE IO_ADDRESS(0xfffecc00)
#define EMIFS_CONFIG_ASM_OFFSET 0x0c #define EMIFS_CONFIG_ASM_OFFSET 0x0c
#define EMIFF_SDRAM_CONFIG_ASM_OFFSET 0x20 #define EMIFF_SDRAM_CONFIG_ASM_OFFSET 0x20
......
...@@ -75,12 +75,9 @@ ...@@ -75,12 +75,9 @@
* SMS register access * SMS register access
*/ */
#define OMAP242X_SMS_REGADDR(reg) \ #define OMAP242X_SMS_REGADDR(reg) IO_ADDRESS(OMAP2420_SMS_BASE + reg)
(void __iomem *)IO_ADDRESS(OMAP2420_SMS_BASE + reg) #define OMAP243X_SMS_REGADDR(reg) IO_ADDRESS(OMAP243X_SMS_BASE + reg)
#define OMAP243X_SMS_REGADDR(reg) \ #define OMAP343X_SMS_REGADDR(reg) IO_ADDRESS(OMAP343X_SMS_BASE + reg)
(void __iomem *)IO_ADDRESS(OMAP243X_SMS_BASE + reg)
#define OMAP343X_SMS_REGADDR(reg) \
(void __iomem *)IO_ADDRESS(OMAP343X_SMS_BASE + reg)
/* SMS register offsets - read/write with sms_{read,write}_reg() */ /* SMS register offsets - read/write with sms_{read,write}_reg() */
......
...@@ -212,9 +212,9 @@ static void enable_rfbi_mode(int enable) ...@@ -212,9 +212,9 @@ static void enable_rfbi_mode(int enable)
dispc_write_reg(DISPC_CONTROL, l); dispc_write_reg(DISPC_CONTROL, l);
/* Set bypass mode in RFBI module */ /* Set bypass mode in RFBI module */
l = __raw_readl(io_p2v(RFBI_CONTROL)); l = __raw_readl(IO_ADDRESS(RFBI_CONTROL));
l |= enable ? 0 : (1 << 1); l |= enable ? 0 : (1 << 1);
__raw_writel(l, io_p2v(RFBI_CONTROL)); __raw_writel(l, IO_ADDRESS(RFBI_CONTROL));
} }
static void set_lcd_data_lines(int data_lines) static void set_lcd_data_lines(int data_lines)
...@@ -1422,7 +1422,7 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode, ...@@ -1422,7 +1422,7 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
} }
/* L3 firewall setting: enable access to OCM RAM */ /* L3 firewall setting: enable access to OCM RAM */
__raw_writel(0x402000b0, io_p2v(0x680050a0)); __raw_writel(0x402000b0, IO_ADDRESS(0x680050a0));
if ((r = alloc_palette_ram()) < 0) if ((r = alloc_palette_ram()) < 0)
goto fail2; goto fail2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment