Skip to content

Commit

Permalink
ARM: pxa: Introduce pxa{25x,27x,3xx}_map_io()
Browse files Browse the repository at this point in the history
This patch introduces pxa2xx_map_io() and pxa3xx_map_io() to distinguish
between PXA25x/PXA27x and PXA3xx memory mapping.

Also, fixup for platforms broken after introducing pxa{25x,27x}_map_io()
and pxa3xx_map_io() is included.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
  • Loading branch information
Marek Vasut authored and Eric Miao committed Dec 16, 2010
1 parent 64ed267 commit 851982c
Show file tree
Hide file tree
Showing 53 changed files with 143 additions and 86 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/balloon3.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ static struct map_desc balloon3_io_desc[] __initdata = {

static void __init balloon3_map_io(void)
{
pxa_map_io();
pxa27x_map_io();
iotable_init(balloon3_io_desc, ARRAY_SIZE(balloon3_io_desc));
}

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/capc7117.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static void __init capc7117_init(void)
MACHINE_START(CAPC7117,
"Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa3xx_map_io,
.init_irq = pxa3xx_init_irq,
.timer = &pxa_timer,
.init_machine = capc7117_init
Expand Down
13 changes: 11 additions & 2 deletions arch/arm/mach-pxa/cm-x2xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,15 +498,24 @@ static struct map_desc cmx2xx_io_desc[] __initdata = {

static void __init cmx2xx_map_io(void)
{
pxa_map_io();
if (cpu_is_pxa25x())
pxa25x_map_io();

if (cpu_is_pxa27x())
pxa27x_map_io();

iotable_init(cmx2xx_io_desc, ARRAY_SIZE(cmx2xx_io_desc));

it8152_base_address = CMX2XX_IT8152_VIRT;
}
#else
static void __init cmx2xx_map_io(void)
{
pxa_map_io();
if (cpu_is_pxa25x())
pxa25x_map_io();

if (cpu_is_pxa27x())
pxa27x_map_io();
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/cm-x300.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags,

MACHINE_START(CM_X300, "CM-X300 module")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa3xx_map_io,
.init_irq = pxa3xx_init_irq,
.timer = &pxa_timer,
.init_machine = cm_x300_init,
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-pxa/colibri-pxa270.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,15 @@ static void __init colibri_pxa270_income_init(void)
MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
.boot_params = COLIBRI_SDRAM_BASE + 0x100,
.init_machine = colibri_pxa270_init,
.map_io = pxa_map_io,
.map_io = pxa27x_map_io,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
MACHINE_END

MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC")
.boot_params = 0xa0000100,
.init_machine = colibri_pxa270_income_init,
.map_io = pxa_map_io,
.map_io = pxa27x_map_io,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
MACHINE_END
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/colibri-pxa300.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void __init colibri_pxa300_init(void)
MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
.boot_params = COLIBRI_SDRAM_BASE + 0x100,
.init_machine = colibri_pxa300_init,
.map_io = pxa_map_io,
.map_io = pxa3xx_map_io,
.init_irq = pxa3xx_init_irq,
.timer = &pxa_timer,
MACHINE_END
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/colibri-pxa320.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ void __init colibri_pxa320_init(void)
MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
.boot_params = COLIBRI_SDRAM_BASE + 0x100,
.init_machine = colibri_pxa320_init,
.map_io = pxa_map_io,
.map_io = pxa3xx_map_io,
.init_irq = pxa3xx_init_irq,
.timer = &pxa_timer,
MACHINE_END
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-pxa/corgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ static void __init fixup_corgi(struct machine_desc *desc,
#ifdef CONFIG_MACH_CORGI
MACHINE_START(CORGI, "SHARP Corgi")
.fixup = fixup_corgi,
.map_io = pxa_map_io,
.map_io = pxa25x_map_io,
.init_irq = pxa25x_init_irq,
.init_machine = corgi_init,
.timer = &pxa_timer,
Expand All @@ -731,7 +731,7 @@ MACHINE_END
#ifdef CONFIG_MACH_SHEPHERD
MACHINE_START(SHEPHERD, "SHARP Shepherd")
.fixup = fixup_corgi,
.map_io = pxa_map_io,
.map_io = pxa25x_map_io,
.init_irq = pxa25x_init_irq,
.init_machine = corgi_init,
.timer = &pxa_timer,
Expand All @@ -741,7 +741,7 @@ MACHINE_END
#ifdef CONFIG_MACH_HUSKY
MACHINE_START(HUSKY, "SHARP Husky")
.fixup = fixup_corgi,
.map_io = pxa_map_io,
.map_io = pxa25x_map_io,
.init_irq = pxa25x_init_irq,
.init_machine = corgi_init,
.timer = &pxa_timer,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/csb726.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ static void __init csb726_init(void)

MACHINE_START(CSB726, "Cogent CSB726")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa27x_map_io,
.init_irq = pxa27x_init_irq,
.init_machine = csb726_init,
.timer = &pxa_timer,
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-pxa/em-x270.c
Original file line number Diff line number Diff line change
Expand Up @@ -1300,15 +1300,15 @@ static void __init em_x270_init(void)

MACHINE_START(EM_X270, "Compulab EM-X270")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa27x_map_io,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
.init_machine = em_x270_init,
MACHINE_END

MACHINE_START(EXEDA, "Compulab eXeda")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa27x_map_io,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
.init_machine = em_x270_init,
Expand Down
12 changes: 6 additions & 6 deletions arch/arm/mach-pxa/eseries.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static void __init e330_init(void)
MACHINE_START(E330, "Toshiba e330")
/* Maintainer: Ian Molton (spyro@f2s.com) */
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa25x_map_io,
.nr_irqs = ESERIES_NR_IRQS,
.init_irq = pxa25x_init_irq,
.fixup = eseries_fixup,
Expand Down Expand Up @@ -230,7 +230,7 @@ static void __init e350_init(void)
MACHINE_START(E350, "Toshiba e350")
/* Maintainer: Ian Molton (spyro@f2s.com) */
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa25x_map_io,
.nr_irqs = ESERIES_NR_IRQS,
.init_irq = pxa25x_init_irq,
.fixup = eseries_fixup,
Expand Down Expand Up @@ -352,7 +352,7 @@ static void __init e400_init(void)
MACHINE_START(E400, "Toshiba e400")
/* Maintainer: Ian Molton (spyro@f2s.com) */
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa25x_map_io,
.nr_irqs = ESERIES_NR_IRQS,
.init_irq = pxa25x_init_irq,
.fixup = eseries_fixup,
Expand Down Expand Up @@ -540,7 +540,7 @@ static void __init e740_init(void)
MACHINE_START(E740, "Toshiba e740")
/* Maintainer: Ian Molton (spyro@f2s.com) */
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa25x_map_io,
.nr_irqs = ESERIES_NR_IRQS,
.init_irq = pxa25x_init_irq,
.fixup = eseries_fixup,
Expand Down Expand Up @@ -731,7 +731,7 @@ static void __init e750_init(void)
MACHINE_START(E750, "Toshiba e750")
/* Maintainer: Ian Molton (spyro@f2s.com) */
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa25x_map_io,
.nr_irqs = ESERIES_NR_IRQS,
.init_irq = pxa25x_init_irq,
.fixup = eseries_fixup,
Expand Down Expand Up @@ -926,7 +926,7 @@ static void __init e800_init(void)
MACHINE_START(E800, "Toshiba e800")
/* Maintainer: Ian Molton (spyro@f2s.com) */
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa25x_map_io,
.nr_irqs = ESERIES_NR_IRQS,
.init_irq = pxa25x_init_irq,
.fixup = eseries_fixup,
Expand Down
12 changes: 6 additions & 6 deletions arch/arm/mach-pxa/ezx.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ static void __init a780_init(void)

MACHINE_START(EZX_A780, "Motorola EZX A780")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa27x_map_io,
.nr_irqs = EZX_NR_IRQS,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
Expand Down Expand Up @@ -863,7 +863,7 @@ static void __init e680_init(void)

MACHINE_START(EZX_E680, "Motorola EZX E680")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa27x_map_io,
.nr_irqs = EZX_NR_IRQS,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
Expand Down Expand Up @@ -928,7 +928,7 @@ static void __init a1200_init(void)

MACHINE_START(EZX_A1200, "Motorola EZX A1200")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa27x_map_io,
.nr_irqs = EZX_NR_IRQS,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
Expand Down Expand Up @@ -1118,7 +1118,7 @@ static void __init a910_init(void)

MACHINE_START(EZX_A910, "Motorola EZX A910")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa27x_map_io,
.nr_irqs = EZX_NR_IRQS,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
Expand Down Expand Up @@ -1183,7 +1183,7 @@ static void __init e6_init(void)

MACHINE_START(EZX_E6, "Motorola EZX E6")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa27x_map_io,
.nr_irqs = EZX_NR_IRQS,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
Expand Down Expand Up @@ -1222,7 +1222,7 @@ static void __init e2_init(void)

MACHINE_START(EZX_E2, "Motorola EZX E2")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa27x_map_io,
.nr_irqs = EZX_NR_IRQS,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
Expand Down
21 changes: 4 additions & 17 deletions arch/arm/mach-pxa/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,27 +86,15 @@ EXPORT_SYMBOL(get_memclk_frequency_10khz);
/*
* Intel PXA2xx internal register mapping.
*
* Note 1: not all PXA2xx variants implement all those addresses.
*
* Note 2: virtual 0xfffe0000-0xffffffff is reserved for the vector table
* and cache flush area.
* Note: virtual 0xfffe0000-0xffffffff is reserved for the vector table
* and cache flush area.
*/
static struct map_desc standard_io_desc[] __initdata = {
static struct map_desc common_io_desc[] __initdata = {
{ /* Devs */
.virtual = 0xf2000000,
.pfn = __phys_to_pfn(0x40000000),
.length = 0x02000000,
.type = MT_DEVICE
}, { /* Mem Ctl */
.virtual = 0xf6000000,
.pfn = __phys_to_pfn(0x48000000),
.length = 0x00200000,
.type = MT_DEVICE
}, { /* IMem ctl */
.virtual = 0xfe000000,
.pfn = __phys_to_pfn(0x58000000),
.length = 0x00100000,
.type = MT_DEVICE
}, { /* UNCACHED_PHYS_0 */
.virtual = 0xff000000,
.pfn = __phys_to_pfn(0x00000000),
Expand All @@ -117,6 +105,5 @@ static struct map_desc standard_io_desc[] __initdata = {

void __init pxa_map_io(void)
{
iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
get_clk_frequency_khz(1);
iotable_init(ARRAY_AND_SIZE(common_io_desc));
}
4 changes: 4 additions & 0 deletions arch/arm/mach-pxa/generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ extern void __init pxa26x_init_irq(void);
#endif
extern void __init pxa27x_init_irq(void);
extern void __init pxa3xx_init_irq(void);

extern void __init pxa_map_io(void);
extern void __init pxa25x_map_io(void);
extern void __init pxa27x_map_io(void);
extern void __init pxa3xx_map_io(void);

extern unsigned int get_clk_frequency_khz(int info);

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/gumstix.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ static void __init gumstix_init(void)

MACHINE_START(GUMSTIX, "Gumstix")
.boot_params = 0xa0000100, /* match u-boot bi_boot_params */
.map_io = pxa_map_io,
.map_io = pxa25x_map_io,
.init_irq = pxa25x_init_irq,
.timer = &pxa_timer,
.init_machine = gumstix_init,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/h5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ static void __init h5000_init(void)

MACHINE_START(H5400, "HP iPAQ H5000")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa25x_map_io,
.init_irq = pxa25x_init_irq,
.timer = &pxa_timer,
.init_machine = h5000_init,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/himalaya.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static void __init himalaya_init(void)

MACHINE_START(HIMALAYA, "HTC Himalaya")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa25x_map_io,
.init_irq = pxa25x_init_irq,
.init_machine = himalaya_init,
.timer = &pxa_timer,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/hx4700.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ static void __init hx4700_init(void)

MACHINE_START(H4700, "HP iPAQ HX4700")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa27x_map_io,
.nr_irqs = HX4700_NR_IRQS,
.init_irq = pxa27x_init_irq,
.init_machine = hx4700_init,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/icontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static void __init icontrol_init(void)

MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa3xx_map_io,
.init_irq = pxa3xx_init_irq,
.timer = &pxa_timer,
.init_machine = icontrol_init
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/idp.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static struct map_desc idp_io_desc[] __initdata = {

static void __init idp_map_io(void)
{
pxa_map_io();
pxa25x_map_io();
iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc));
}

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/littleton.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ static void __init littleton_init(void)

MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleton)")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa3xx_map_io,
.nr_irqs = LITTLETON_NR_IRQS,
.init_irq = pxa3xx_init_irq,
.timer = &pxa_timer,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/lpd270.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ static struct map_desc lpd270_io_desc[] __initdata = {

static void __init lpd270_map_io(void)
{
pxa_map_io();
pxa27x_map_io();
iotable_init(lpd270_io_desc, ARRAY_SIZE(lpd270_io_desc));

/* for use I SRAM as framebuffer. */
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/lubbock.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ static struct map_desc lubbock_io_desc[] __initdata = {

static void __init lubbock_map_io(void)
{
pxa_map_io();
pxa25x_map_io();
iotable_init(lubbock_io_desc, ARRAY_SIZE(lubbock_io_desc));

PCFR |= PCFR_OPDE;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/magician.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ static void __init magician_init(void)

MACHINE_START(MAGICIAN, "HTC Magician")
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.map_io = pxa27x_map_io,
.nr_irqs = MAGICIAN_NR_IRQS,
.init_irq = pxa27x_init_irq,
.init_machine = magician_init,
Expand Down
Loading

0 comments on commit 851982c

Please sign in to comment.