Skip to content

Commit

Permalink
Merge branch 'io-cleanup-for-3.4' of git://sources.calxeda.com/kernel…
Browse files Browse the repository at this point in the history
…/linux into next/cleanup2

* 'io-cleanup-for-3.4' of git://sources.calxeda.com/kernel/linux:
  ARM: __io abuse cleanup
  ARM: create a common IOMEM definition
  ARM: iop13xx: fix missing declaration of iop13xx_init_early
  ARM: fix ioremap/iounmap for !CONFIG_MMU
  • Loading branch information
olofj committed Mar 14, 2012
2 parents 708795c + a2a47ca commit accf709
Show file tree
Hide file tree
Showing 41 changed files with 56 additions and 126 deletions.
2 changes: 2 additions & 0 deletions arch/arm/include/asm/assembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <asm/ptrace.h>
#include <asm/domain.h>

#define IOMEM(x) (x)

/*
* Endian independent macros for shifting bytes within registers.
*/
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
return (void __iomem *)addr;
}

#define IOMEM(x) ((void __force __iomem *)(x))

/* IO barriers */
#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
#define __iormb() rmb()
Expand Down
1 change: 1 addition & 0 deletions arch/arm/kernel/debug.S
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* 32-bit debugging code
*/
#include <linux/linkage.h>
#include <asm/assembler.h>

.text

Expand Down
1 change: 1 addition & 0 deletions arch/arm/kernel/entry-armv.S
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* that causes it to save wrong values... Be aware!
*/

#include <asm/assembler.h>
#include <asm/memory.h>
#include <asm/glue-df.h>
#include <asm/glue-pf.h>
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mach-cns3xxx/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ void __init cns3xxx_map_io(void)
/* used by entry-macro.S */
void __init cns3xxx_init_irq(void)
{
gic_init(0, 29, __io(CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT),
__io(CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT));
gic_init(0, 29, IOMEM(CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT),
IOMEM(CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT));
}

void cns3xxx_power_off(void)
{
u32 __iomem *pm_base = __io(CNS3XXX_PM_BASE_VIRT);
u32 __iomem *pm_base = IOMEM(CNS3XXX_PM_BASE_VIRT);
u32 clkctrl;

printk(KERN_INFO "powering system down...\n");
Expand Down Expand Up @@ -237,7 +237,7 @@ static void __init __cns3xxx_timer_init(unsigned int timer_irq)

static void __init cns3xxx_timer_init(void)
{
cns3xxx_tmr1 = __io(CNS3XXX_TIMER1_2_3_BASE_VIRT);
cns3xxx_tmr1 = IOMEM(CNS3XXX_TIMER1_2_3_BASE_VIRT);

__cns3xxx_timer_init(IRQ_CNS3XXX_TIMER0);
}
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-cns3xxx/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static struct platform_device cns3xxx_sdhci_pdev = {

void __init cns3xxx_sdhci_init(void)
{
u32 __iomem *gpioa = __io(CNS3XXX_MISC_BASE_VIRT + 0x0014);
u32 __iomem *gpioa = IOMEM(CNS3XXX_MISC_BASE_VIRT + 0x0014);
u32 gpioa_pins = __raw_readl(gpioa);

/* MMC/SD pins share with GPIOA */
Expand Down
6 changes: 0 additions & 6 deletions arch/arm/mach-davinci/include/mach/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,4 @@
#define __IO_ADDRESS(x) ((x) + IO_OFFSET)
#define IO_ADDRESS(pa) IOMEM(__IO_ADDRESS(pa))

#ifdef __ASSEMBLER__
#define IOMEM(x) x
#else
#define IOMEM(x) ((void __force __iomem *)(x))
#endif

#endif /* __ASM_ARCH_HARDWARE_H */
2 changes: 2 additions & 0 deletions arch/arm/mach-davinci/include/mach/uncompress.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#include <mach/serial.h>

#define IOMEM(x) ((void __force __iomem *)(x))

u32 *uart;

/* PORT_16C550A, in polled non-fifo mode */
Expand Down
9 changes: 0 additions & 9 deletions arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@
#ifndef __ASM_ARCH_EP93XX_REGS_H
#define __ASM_ARCH_EP93XX_REGS_H

/*
* A typesafe __io() variation for variable initialisers
*/
#ifdef __ASSEMBLER__
#define IOMEM(p) p
#else
#define IOMEM(p) ((void __iomem __force *)(p))
#endif

/*
* EP93xx Physical Memory Map:
*
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-iop13xx/include/mach/iop13xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/* The ATU offsets can change based on the strapping */
extern u32 iop13xx_atux_pmmr_offset;
extern u32 iop13xx_atue_pmmr_offset;
void iop13xx_init_early(void);
void iop13xx_init_irq(void);
void iop13xx_map_io(void);
void iop13xx_platform_init(void);
Expand Down
6 changes: 0 additions & 6 deletions arch/arm/mach-mmp/include/mach/addr-map.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
#ifndef __ASM_MACH_ADDR_MAP_H
#define __ASM_MACH_ADDR_MAP_H

#ifndef __ASSEMBLER__
#define IOMEM(x) ((void __iomem *)(x))
#else
#define IOMEM(x) (x)
#endif

/* APB - Application Subsystem Peripheral Bus
*
* NOTE: the DMA controller registers are actually on the AXI fabric #1
Expand Down
6 changes: 0 additions & 6 deletions arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@
*
*/

#ifdef __ASSEMBLY__
#define IOMEM(x) x
#else
#define IOMEM(x) ((void __force __iomem *)(x))
#endif

#define MSM_VIC_BASE IOMEM(0xE0000000)
#define MSM_VIC_PHYS 0xC0000000
#define MSM_VIC_SIZE SZ_4K
Expand Down
6 changes: 0 additions & 6 deletions arch/arm/mach-msm/include/mach/msm_iomap.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@
*
*/

#ifdef __ASSEMBLY__
#define IOMEM(x) x
#else
#define IOMEM(x) ((void __force __iomem *)(x))
#endif

#if defined(CONFIG_ARCH_MSM7X30)
#include "msm_iomap-7x30.h"
#elif defined(CONFIG_ARCH_QSD8X50)
Expand Down
6 changes: 0 additions & 6 deletions arch/arm/mach-mxs/include/mach/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,4 @@
#ifndef __MACH_MXS_HARDWARE_H__
#define __MACH_MXS_HARDWARE_H__

#ifdef __ASSEMBLER__
#define IOMEM(addr) (addr)
#else
#define IOMEM(addr) ((void __force __iomem *)(addr))
#endif

#endif /* __MACH_MXS_HARDWARE_H__ */
2 changes: 1 addition & 1 deletion arch/arm/mach-netx/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void __init netx_init_irq(void)
{
int irq;

vic_init(__io(io_p2v(NETX_PA_VIC)), 0, ~0, 0);
vic_init(io_p2v(NETX_PA_VIC), 0, ~0, 0);

for (irq = NETX_IRQ_HIF_CHAINED(0); irq <= NETX_IRQ_HIF_LAST; irq++) {
irq_set_chip_and_handler(irq, &netx_hif_chip,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-netx/include/mach/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#define XMAC_MEM_SIZE 0x1000
#define SRAM_MEM_SIZE 0x8000

#define io_p2v(x) ((x) - NETX_IO_PHYS + NETX_IO_VIRT)
#define io_p2v(x) IOMEM((x) - NETX_IO_PHYS + NETX_IO_VIRT)
#define io_v2p(x) ((x) - NETX_IO_VIRT + NETX_IO_PHYS)

#endif
16 changes: 8 additions & 8 deletions arch/arm/mach-netx/include/mach/netx-regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
*********************************/

/* Registers */
#define NETX_SYSTEM_REG(ofs) __io(NETX_VA_SYSTEM + (ofs))
#define NETX_SYSTEM_REG(ofs) IOMEM(NETX_VA_SYSTEM + (ofs))
#define NETX_SYSTEM_BOO_SR NETX_SYSTEM_REG(0x00)
#define NETX_SYSTEM_IOC_CR NETX_SYSTEM_REG(0x04)
#define NETX_SYSTEM_IOC_MR NETX_SYSTEM_REG(0x08)
Expand Down Expand Up @@ -185,7 +185,7 @@
*******************************/

/* Registers */
#define NETX_GPIO_REG(ofs) __io(NETX_VA_GPIO + (ofs))
#define NETX_GPIO_REG(ofs) IOMEM(NETX_VA_GPIO + (ofs))
#define NETX_GPIO_CFG(gpio) NETX_GPIO_REG(0x0 + ((gpio)<<2))
#define NETX_GPIO_THRESHOLD_CAPTURE(gpio) NETX_GPIO_REG(0x40 + ((gpio)<<2))
#define NETX_GPIO_COUNTER_CTRL(counter) NETX_GPIO_REG(0x80 + ((counter)<<2))
Expand Down Expand Up @@ -230,7 +230,7 @@
*******************************/

/* Registers */
#define NETX_PIO_REG(ofs) __io(NETX_VA_PIO + (ofs))
#define NETX_PIO_REG(ofs) IOMEM(NETX_VA_PIO + (ofs))
#define NETX_PIO_INPIO NETX_PIO_REG(0x0)
#define NETX_PIO_OUTPIO NETX_PIO_REG(0x4)
#define NETX_PIO_OEPIO NETX_PIO_REG(0x8)
Expand All @@ -240,7 +240,7 @@
*******************************/

/* Registers */
#define NETX_MIIMU __io(NETX_VA_MIIMU)
#define NETX_MIIMU IOMEM(NETX_VA_MIIMU)

/* Bits */
#define MIIMU_SNRDY (1<<0)
Expand Down Expand Up @@ -317,7 +317,7 @@
*******************************/

/* Registers */
#define NETX_PFIFO_REG(ofs) __io(NETX_VA_PFIFO + (ofs))
#define NETX_PFIFO_REG(ofs) IOMEM(NETX_VA_PFIFO + (ofs))
#define NETX_PFIFO_BASE(pfifo) NETX_PFIFO_REG(0x00 + ((pfifo)<<2))
#define NETX_PFIFO_BORDER_BASE(pfifo) NETX_PFIFO_REG(0x80 + ((pfifo)<<2))
#define NETX_PFIFO_RESET NETX_PFIFO_REG(0x100)
Expand All @@ -334,7 +334,7 @@
*******************************/

/* Registers */
#define NETX_MEMCR_REG(ofs) __io(NETX_VA_MEMCR + (ofs))
#define NETX_MEMCR_REG(ofs) IOMEM(NETX_VA_MEMCR + (ofs))
#define NETX_MEMCR_SRAM_CTRL(cs) NETX_MEMCR_REG(0x0 + 4 * (cs)) /* SRAM for CS 0..2 */
#define NETX_MEMCR_SDRAM_CFG_CTRL NETX_MEMCR_REG(0x40)
#define NETX_MEMCR_SDRAM_TIMING_CTRL NETX_MEMCR_REG(0x44)
Expand All @@ -355,7 +355,7 @@
*******************************/

/* Registers */
#define NETX_DPMAS_REG(ofs) __io(NETX_VA_DPMAS + (ofs))
#define NETX_DPMAS_REG(ofs) IOMEM(NETX_VA_DPMAS + (ofs))
#define NETX_DPMAS_SYS_STAT NETX_DPMAS_REG(0x4d8)
#define NETX_DPMAS_INT_STAT NETX_DPMAS_REG(0x4e0)
#define NETX_DPMAS_INT_EN NETX_DPMAS_REG(0x4f0)
Expand Down Expand Up @@ -425,7 +425,7 @@
/*******************************
* I2C *
*******************************/
#define NETX_I2C_REG(ofs) __io(NETX_VA_I2C, (ofs))
#define NETX_I2C_REG(ofs) IOMEM(NETX_VA_I2C, (ofs))
#define NETX_I2C_CTRL NETX_I2C_REG(0x0)
#define NETX_I2C_DATA NETX_I2C_REG(0x4)

Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-omap1/ams-delta-fiq-handler.S
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/

#include <linux/linkage.h>
#include <asm/assembler.h>

#include <plat/board-ams-delta.h>

Expand Down
6 changes: 0 additions & 6 deletions arch/arm/mach-omap1/iomap.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifdef __ASSEMBLER__
#define IOMEM(x) (x)
#else
#define IOMEM(x) ((void __force __iomem *)(x))
#endif

#define OMAP1_IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */
#define OMAP1_IO_ADDRESS(pa) IOMEM((pa) - OMAP1_IO_OFFSET)

Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-omap2/clock3xxx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/kernel.h>
#include <linux/clk.h>
#include <linux/list.h>
#include <linux/io.h>

#include <plat/hardware.h>
#include <plat/clkdev_omap.h>
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-omap2/clock44xx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/clk.h>
#include <linux/io.h>

#include <plat/hardware.h>
#include <plat/clkdev_omap.h>
Expand Down
6 changes: 0 additions & 6 deletions arch/arm/mach-omap2/iomap.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifdef __ASSEMBLER__
#define IOMEM(x) (x)
#else
#define IOMEM(x) ((void __force __iomem *)(x))
#endif

#define OMAP2_L3_IO_OFFSET 0x90000000
#define OMAP2_L3_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_L3_IO_OFFSET) /* L3 */

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-realview/include/mach/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
#else
#define IO_ADDRESS(x) (x)
#endif
#define __io_address(n) __io(IO_ADDRESS(n))
#define __io_address(n) IOMEM(IO_ADDRESS(n))

#endif
6 changes: 0 additions & 6 deletions arch/arm/mach-rpc/include/mach/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@

#include <mach/memory.h>

#ifndef __ASSEMBLY__
#define IOMEM(x) ((void __iomem *)(unsigned long)(x))
#else
#define IOMEM(x) x
#endif /* __ASSEMBLY__ */

/*
* What hardware must be present
*/
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-shmobile/board-ag5evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ static void __init ag5evm_init(void)

#ifdef CONFIG_CACHE_L2X0
/* Shared attribute override enable, 64K*8way */
l2x0_init(__io(0xf0100000), 0x00460000, 0xc2000fff);
l2x0_init(IOMEM(0xf0100000), 0x00460000, 0xc2000fff);
#endif
sh73a0_add_standard_devices();
platform_add_devices(ag5evm_devices, ARRAY_SIZE(ag5evm_devices));
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-shmobile/board-bonito.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ static void __init bonito_init(void)

#ifdef CONFIG_CACHE_L2X0
/* Early BRESP enable, Shared attribute override enable, 32K*8way */
l2x0_init(__io(0xf0002000), 0x40440000, 0x82000fff);
l2x0_init(IOMEM(0xf0002000), 0x40440000, 0x82000fff);
#endif

r8a7740_add_standard_devices();
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-shmobile/board-kota2.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ static void __init kota2_init(void)

#ifdef CONFIG_CACHE_L2X0
/* Early BRESP enable, Shared attribute override enable, 64K*8way */
l2x0_init(__io(0xf0100000), 0x40460000, 0x82000fff);
l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
#endif
sh73a0_add_standard_devices();
platform_add_devices(kota2_devices, ARRAY_SIZE(kota2_devices));
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-shmobile/intc-r8a7779.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ static int r8a7779_set_wake(struct irq_data *data, unsigned int on)

void __init r8a7779_init_irq(void)
{
void __iomem *gic_dist_base = __io(0xf0001000);
void __iomem *gic_cpu_base = __io(0xf0000100);
void __iomem *gic_dist_base = IOMEM(0xf0001000);
void __iomem *gic_cpu_base = IOMEM(0xf0000100);

/* use GIC to handle interrupts */
gic_init(0, 29, gic_dist_base, gic_cpu_base);
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-shmobile/intc-sh73a0.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ static irqreturn_t sh73a0_pint1_demux(int irq, void *dev_id)

void __init sh73a0_init_irq(void)
{
void __iomem *gic_dist_base = __io(0xf0001000);
void __iomem *gic_cpu_base = __io(0xf0000100);
void __iomem *gic_dist_base = IOMEM(0xf0001000);
void __iomem *gic_cpu_base = IOMEM(0xf0000100);
void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE);
int k, n;

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-shmobile/smp-r8a7779.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <asm/smp_twd.h>
#include <asm/hardware/gic.h>

#define AVECR 0xfe700040
#define AVECR IOMEM(0xfe700040)

static struct r8a7779_pm_ch r8a7779_ch_cpu1 = {
.chan_offs = 0x40, /* PWRSR0 .. PWRER0 */
Expand Down Expand Up @@ -140,7 +140,7 @@ void __init r8a7779_smp_prepare_cpus(void)
scu_enable(scu_base_addr());

/* Map the reset vector (in headsmp.S) */
__raw_writel(__pa(shmobile_secondary_vector), __io(AVECR));
__raw_writel(__pa(shmobile_secondary_vector), AVECR);

/* enable cache coherency on CPU0 */
modify_scu_cpu_psr(0, 3 << (cpu * 8));
Expand Down
Loading

0 comments on commit accf709

Please sign in to comment.