ARM: ixp4xx: use runtime ioremap hook
Convert ixp4xx platforms to use run-time ioremap hook instead of the compile time hook. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Cc: Imre Kaloz <kaloz@openwrt.org> Cc: Krzysztof Halasa <khc@pm.waw.pl>
This commit is contained in:
parent
1dfe34ae79
commit
f449588c65
|
@ -165,6 +165,7 @@ static void __init avila_init(void)
|
||||||
MACHINE_START(AVILA, "Gateworks Avila Network Platform")
|
MACHINE_START(AVILA, "Gateworks Avila Network Platform")
|
||||||
/* Maintainer: Deepak Saxena <dsaxena@plexity.net> */
|
/* Maintainer: Deepak Saxena <dsaxena@plexity.net> */
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
|
@ -184,6 +185,7 @@ MACHINE_END
|
||||||
MACHINE_START(LOFT, "Giant Shoulder Inc Loft board")
|
MACHINE_START(LOFT, "Giant Shoulder Inc Loft board")
|
||||||
/* Maintainer: Tom Billman <kernel@giantshoulderinc.com> */
|
/* Maintainer: Tom Billman <kernel@giantshoulderinc.com> */
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
#include <mach/udc.h>
|
#include <mach/udc.h>
|
||||||
#include <mach/hardware.h>
|
#include <mach/hardware.h>
|
||||||
|
#include <mach/io.h>
|
||||||
#include <asm/uaccess.h>
|
#include <asm/uaccess.h>
|
||||||
#include <asm/pgtable.h>
|
#include <asm/pgtable.h>
|
||||||
#include <asm/page.h>
|
#include <asm/page.h>
|
||||||
|
@ -517,3 +518,35 @@ void ixp4xx_restart(char mode, const char *cmd)
|
||||||
*IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE;
|
*IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_IXP4XX_INDIRECT_PCI
|
||||||
|
/*
|
||||||
|
* In the case of using indirect PCI, we simply return the actual PCI
|
||||||
|
* address and our read/write implementation use that to drive the
|
||||||
|
* access registers. If something outside of PCI is ioremap'd, we
|
||||||
|
* fallback to the default.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void __iomem *ixp4xx_ioremap_caller(unsigned long addr, size_t size,
|
||||||
|
unsigned int mtype, void *caller)
|
||||||
|
{
|
||||||
|
if (!is_pci_memory(addr))
|
||||||
|
return __arm_ioremap_caller(addr, size, mtype, caller);
|
||||||
|
|
||||||
|
return (void __iomem *)addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ixp4xx_iounmap(void __iomem *addr)
|
||||||
|
{
|
||||||
|
if (!is_pci_memory((__force u32)addr))
|
||||||
|
__iounmap(addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void __init ixp4xx_init_early(void)
|
||||||
|
{
|
||||||
|
arch_ioremap_caller = ixp4xx_ioremap_caller;
|
||||||
|
arch_iounmap = ixp4xx_iounmap;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
void __init ixp4xx_init_early(void) {}
|
||||||
|
#endif
|
||||||
|
|
|
@ -110,6 +110,7 @@ static void __init coyote_init(void)
|
||||||
MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
|
MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
|
||||||
/* Maintainer: MontaVista Software, Inc. */
|
/* Maintainer: MontaVista Software, Inc. */
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
|
@ -129,6 +130,7 @@ MACHINE_END
|
||||||
MACHINE_START(IXDPG425, "Intel IXDPG425")
|
MACHINE_START(IXDPG425, "Intel IXDPG425")
|
||||||
/* Maintainer: MontaVista Software, Inc. */
|
/* Maintainer: MontaVista Software, Inc. */
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
|
|
|
@ -280,6 +280,7 @@ MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
|
||||||
/* Maintainer: www.nslu2-linux.org */
|
/* Maintainer: www.nslu2-linux.org */
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &dsmg600_timer,
|
.timer = &dsmg600_timer,
|
||||||
.init_machine = dsmg600_init,
|
.init_machine = dsmg600_init,
|
||||||
|
|
|
@ -270,6 +270,7 @@ static void __init fsg_init(void)
|
||||||
MACHINE_START(FSG, "Freecom FSG-3")
|
MACHINE_START(FSG, "Freecom FSG-3")
|
||||||
/* Maintainer: www.nslu2-linux.org */
|
/* Maintainer: www.nslu2-linux.org */
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
|
|
|
@ -97,6 +97,7 @@ static void __init gateway7001_init(void)
|
||||||
MACHINE_START(GATEWAY7001, "Gateway 7001 AP")
|
MACHINE_START(GATEWAY7001, "Gateway 7001 AP")
|
||||||
/* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
|
/* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
|
|
|
@ -497,6 +497,7 @@ subsys_initcall(gmlr_pci_init);
|
||||||
MACHINE_START(GORAMO_MLR, "MultiLink")
|
MACHINE_START(GORAMO_MLR, "MultiLink")
|
||||||
/* Maintainer: Krzysztof Halasa */
|
/* Maintainer: Krzysztof Halasa */
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
|
|
|
@ -165,6 +165,7 @@ static void __init gtwx5715_init(void)
|
||||||
MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")
|
MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")
|
||||||
/* Maintainer: George Joseph */
|
/* Maintainer: George Joseph */
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
|
|
|
@ -57,24 +57,6 @@ static inline int is_pci_memory(u32 addr)
|
||||||
return (addr >= PCIBIOS_MIN_MEM) && (addr <= 0x4FFFFFFF);
|
return (addr >= PCIBIOS_MIN_MEM) && (addr <= 0x4FFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void __iomem * __indirect_ioremap(unsigned long addr, size_t size,
|
|
||||||
unsigned int mtype)
|
|
||||||
{
|
|
||||||
if (!is_pci_memory(addr))
|
|
||||||
return __arm_ioremap(addr, size, mtype);
|
|
||||||
|
|
||||||
return (void __iomem *)addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void __indirect_iounmap(void __iomem *addr)
|
|
||||||
{
|
|
||||||
if (!is_pci_memory((__force u32)addr))
|
|
||||||
__iounmap(addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define __arch_ioremap __indirect_ioremap
|
|
||||||
#define __arch_iounmap __indirect_iounmap
|
|
||||||
|
|
||||||
#define writeb(v, p) __indirect_writeb(v, p)
|
#define writeb(v, p) __indirect_writeb(v, p)
|
||||||
#define writew(v, p) __indirect_writew(v, p)
|
#define writew(v, p) __indirect_writew(v, p)
|
||||||
#define writel(v, p) __indirect_writel(v, p)
|
#define writel(v, p) __indirect_writel(v, p)
|
||||||
|
|
|
@ -121,6 +121,7 @@ extern unsigned long ixp4xx_timer_freq;
|
||||||
* Functions used by platform-level setup code
|
* Functions used by platform-level setup code
|
||||||
*/
|
*/
|
||||||
extern void ixp4xx_map_io(void);
|
extern void ixp4xx_map_io(void);
|
||||||
|
extern void ixp4xx_init_early(void);
|
||||||
extern void ixp4xx_init_irq(void);
|
extern void ixp4xx_init_irq(void);
|
||||||
extern void ixp4xx_sys_init(void);
|
extern void ixp4xx_sys_init(void);
|
||||||
extern void ixp4xx_timer_init(void);
|
extern void ixp4xx_timer_init(void);
|
||||||
|
|
|
@ -254,6 +254,7 @@ static void __init ixdp425_init(void)
|
||||||
MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
|
MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
|
||||||
/* Maintainer: MontaVista Software, Inc. */
|
/* Maintainer: MontaVista Software, Inc. */
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
|
@ -269,6 +270,7 @@ MACHINE_END
|
||||||
MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
|
MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
|
||||||
/* Maintainer: MontaVista Software, Inc. */
|
/* Maintainer: MontaVista Software, Inc. */
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
|
@ -283,6 +285,7 @@ MACHINE_END
|
||||||
MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
|
MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
|
||||||
/* Maintainer: MontaVista Software, Inc. */
|
/* Maintainer: MontaVista Software, Inc. */
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
|
@ -297,6 +300,7 @@ MACHINE_END
|
||||||
MACHINE_START(KIXRP435, "Intel KIXRP435 Reference Platform")
|
MACHINE_START(KIXRP435, "Intel KIXRP435 Reference Platform")
|
||||||
/* Maintainer: MontaVista Software, Inc. */
|
/* Maintainer: MontaVista Software, Inc. */
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
|
|
|
@ -315,6 +315,7 @@ MACHINE_START(NAS100D, "Iomega NAS 100d")
|
||||||
/* Maintainer: www.nslu2-linux.org */
|
/* Maintainer: www.nslu2-linux.org */
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.init_machine = nas100d_init,
|
.init_machine = nas100d_init,
|
||||||
|
|
|
@ -301,6 +301,7 @@ MACHINE_START(NSLU2, "Linksys NSLU2")
|
||||||
/* Maintainer: www.nslu2-linux.org */
|
/* Maintainer: www.nslu2-linux.org */
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &nslu2_timer,
|
.timer = &nslu2_timer,
|
||||||
.init_machine = nslu2_init,
|
.init_machine = nslu2_init,
|
||||||
|
|
|
@ -243,6 +243,7 @@ static void __init omixp_init(void)
|
||||||
MACHINE_START(DEVIXP, "Omicron DEVIXP")
|
MACHINE_START(DEVIXP, "Omicron DEVIXP")
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.init_machine = omixp_init,
|
.init_machine = omixp_init,
|
||||||
|
@ -254,6 +255,7 @@ MACHINE_END
|
||||||
MACHINE_START(MICCPT, "Omicron MICCPT")
|
MACHINE_START(MICCPT, "Omicron MICCPT")
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.init_machine = omixp_init,
|
.init_machine = omixp_init,
|
||||||
|
@ -268,6 +270,7 @@ MACHINE_END
|
||||||
MACHINE_START(MIC256, "Omicron MIC256")
|
MACHINE_START(MIC256, "Omicron MIC256")
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.init_machine = omixp_init,
|
.init_machine = omixp_init,
|
||||||
|
|
|
@ -237,6 +237,7 @@ static void __init vulcan_init(void)
|
||||||
MACHINE_START(ARCOM_VULCAN, "Arcom/Eurotech Vulcan")
|
MACHINE_START(ARCOM_VULCAN, "Arcom/Eurotech Vulcan")
|
||||||
/* Maintainer: Marc Zyngier <maz@misterjones.org> */
|
/* Maintainer: Marc Zyngier <maz@misterjones.org> */
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
|
|
|
@ -98,6 +98,7 @@ static void __init wg302v2_init(void)
|
||||||
MACHINE_START(WG302V2, "Netgear WG302 v2 / WAG302 v2")
|
MACHINE_START(WG302V2, "Netgear WG302 v2 / WAG302 v2")
|
||||||
/* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
|
/* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
|
||||||
.map_io = ixp4xx_map_io,
|
.map_io = ixp4xx_map_io,
|
||||||
|
.init_early = ixp4xx_init_early,
|
||||||
.init_irq = ixp4xx_init_irq,
|
.init_irq = ixp4xx_init_irq,
|
||||||
.timer = &ixp4xx_timer,
|
.timer = &ixp4xx_timer,
|
||||||
.atag_offset = 0x100,
|
.atag_offset = 0x100,
|
||||||
|
|
Loading…
Reference in a new issue