aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/Kconfig24
-rw-r--r--arch/arm/mach-pxa/Makefile10
-rw-r--r--arch/arm/mach-pxa/balloon3.c59
-rw-r--r--arch/arm/mach-pxa/capc7117.c2
-rw-r--r--arch/arm/mach-pxa/clock-pxa2xx.c64
-rw-r--r--arch/arm/mach-pxa/clock-pxa3xx.c218
-rw-r--r--arch/arm/mach-pxa/clock.c27
-rw-r--r--arch/arm/mach-pxa/clock.h47
-rw-r--r--arch/arm/mach-pxa/cm-x2xx.c26
-rw-r--r--arch/arm/mach-pxa/cm-x300.c2
-rw-r--r--arch/arm/mach-pxa/colibri-evalboard.c (renamed from arch/arm/mach-pxa/colibri-pxa270-evalboard.c)96
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270-income.c47
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270.c108
-rw-r--r--arch/arm/mach-pxa/colibri-pxa300.c73
-rw-r--r--arch/arm/mach-pxa/colibri-pxa320.c139
-rw-r--r--arch/arm/mach-pxa/colibri-pxa3xx.c49
-rw-r--r--arch/arm/mach-pxa/corgi.c6
-rw-r--r--arch/arm/mach-pxa/cpufreq-pxa2xx.c10
-rw-r--r--arch/arm/mach-pxa/csb726.c9
-rw-r--r--arch/arm/mach-pxa/devices.c247
-rw-r--r--arch/arm/mach-pxa/em-x270.c4
-rw-r--r--arch/arm/mach-pxa/eseries.c12
-rw-r--r--arch/arm/mach-pxa/ezx.c12
-rw-r--r--arch/arm/mach-pxa/generic.c48
-rw-r--r--arch/arm/mach-pxa/generic.h11
-rw-r--r--arch/arm/mach-pxa/gumstix.c2
-rw-r--r--arch/arm/mach-pxa/h5000.c11
-rw-r--r--arch/arm/mach-pxa/himalaya.c2
-rw-r--r--arch/arm/mach-pxa/hx4700.c2
-rw-r--r--arch/arm/mach-pxa/icontrol.c2
-rw-r--r--arch/arm/mach-pxa/idp.c2
-rw-r--r--arch/arm/mach-pxa/include/mach/addr-map.h48
-rw-r--r--arch/arm/mach-pxa/include/mach/balloon3.h6
-rw-r--r--arch/arm/mach-pxa/include/mach/colibri.h14
-rw-r--r--arch/arm/mach-pxa/include/mach/hardware.h47
-rw-r--r--arch/arm/mach-pxa/include/mach/irqs.h48
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa2xx-regs.h66
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa3xx-regs.h9
-rw-r--r--arch/arm/mach-pxa/include/mach/regs-intc.h4
-rw-r--r--arch/arm/mach-pxa/include/mach/smemc.h74
-rw-r--r--arch/arm/mach-pxa/irq.c129
-rw-r--r--arch/arm/mach-pxa/littleton.c2
-rw-r--r--arch/arm/mach-pxa/lpd270.c5
-rw-r--r--arch/arm/mach-pxa/lubbock.c5
-rw-r--r--arch/arm/mach-pxa/magician.c2
-rw-r--r--arch/arm/mach-pxa/mainstone.c5
-rw-r--r--arch/arm/mach-pxa/mioa701.c2
-rw-r--r--arch/arm/mach-pxa/mp900.c2
-rw-r--r--arch/arm/mach-pxa/palmld.c2
-rw-r--r--arch/arm/mach-pxa/palmt5.c2
-rw-r--r--arch/arm/mach-pxa/palmtc.c190
-rw-r--r--arch/arm/mach-pxa/palmte2.c2
-rw-r--r--arch/arm/mach-pxa/palmtreo.c4
-rw-r--r--arch/arm/mach-pxa/palmtx.c2
-rw-r--r--arch/arm/mach-pxa/palmz72.c2
-rw-r--r--arch/arm/mach-pxa/pcm027.c2
-rw-r--r--arch/arm/mach-pxa/poodle.c2
-rw-r--r--arch/arm/mach-pxa/pxa25x.c86
-rw-r--r--arch/arm/mach-pxa/pxa27x.c102
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c234
-rw-r--r--arch/arm/mach-pxa/pxa930.c2
-rw-r--r--arch/arm/mach-pxa/pxa95x.c308
-rw-r--r--arch/arm/mach-pxa/raumfeld.c11
-rw-r--r--arch/arm/mach-pxa/saar.c2
-rw-r--r--arch/arm/mach-pxa/saarb.c114
-rw-r--r--arch/arm/mach-pxa/sleep.S2
-rw-r--r--arch/arm/mach-pxa/smemc.c51
-rw-r--r--arch/arm/mach-pxa/spitz.c13
-rw-r--r--arch/arm/mach-pxa/stargate2.c7
-rw-r--r--arch/arm/mach-pxa/tavorevb.c2
-rw-r--r--arch/arm/mach-pxa/tavorevb3.c2
-rw-r--r--arch/arm/mach-pxa/tosa.c9
-rw-r--r--arch/arm/mach-pxa/trizeps4.c5
-rw-r--r--arch/arm/mach-pxa/viper.c2
-rw-r--r--arch/arm/mach-pxa/vpac270.c2
-rw-r--r--arch/arm/mach-pxa/xcep.c7
-rw-r--r--arch/arm/mach-pxa/z2.c2
-rw-r--r--arch/arm/mach-pxa/zeus.c10
-rw-r--r--arch/arm/mach-pxa/zylonite.c2
79 files changed, 1921 insertions, 1101 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index c98d81ff250c..2fc9f94cdd29 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -50,6 +50,10 @@ config MACH_SAAR
50 select PXA3xx 50 select PXA3xx
51 select CPU_PXA930 51 select CPU_PXA930
52 52
53config MACH_SAARB
54 bool "PXA955 Handheld Platform (aka SAARB)"
55 select CPU_PXA955
56
53comment "Third Party Dev Platforms (sorted by vendor name)" 57comment "Third Party Dev Platforms (sorted by vendor name)"
54 58
55config ARCH_PXA_IDP 59config ARCH_PXA_IDP
@@ -233,10 +237,6 @@ config MACH_COLIBRI
233 bool "Toradex Colibri PXA270" 237 bool "Toradex Colibri PXA270"
234 select PXA27x 238 select PXA27x
235 239
236config MACH_COLIBRI_PXA270_EVALBOARD
237 bool "Toradex Colibri Evaluation Carrier Board support (PXA270)"
238 depends on MACH_COLIBRI
239
240config MACH_COLIBRI_PXA270_INCOME 240config MACH_COLIBRI_PXA270_INCOME
241 bool "Income s.r.o. PXA270 SBC" 241 bool "Income s.r.o. PXA270 SBC"
242 depends on MACH_COLIBRI 242 depends on MACH_COLIBRI
@@ -254,6 +254,10 @@ config MACH_COLIBRI320
254 select PXA3xx 254 select PXA3xx
255 select CPU_PXA320 255 select CPU_PXA320
256 256
257config MACH_COLIBRI_EVALBOARD
258 bool "Toradex Colibri Evaluation Carrier Board support"
259 depends on MACH_COLIBRI || MACH_COLIBRI300 || MACH_COLIBRI320
260
257config MACH_VPAC270 261config MACH_VPAC270
258 bool "Voipac PXA270" 262 bool "Voipac PXA270"
259 select PXA27x 263 select PXA27x
@@ -653,11 +657,17 @@ config CPU_PXA935
653 help 657 help
654 PXA935 (codename Tavor-P65) 658 PXA935 (codename Tavor-P65)
655 659
656config CPU_PXA950 660config PXA95x
657 bool 661 bool
658 select CPU_PXA930 662 select CPU_PJ4
663 help
664 Select code specific to PXA95x variants
665
666config CPU_PXA955
667 bool
668 select PXA95x
659 help 669 help
660 PXA950 (codename Tavor-PV2) 670 PXA950 (codename MG1)
661 671
662config PXA_SHARP_C7xx 672config PXA_SHARP_C7xx
663 bool 673 bool
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index e2f89c2c6f49..cc39d17b2e07 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -16,9 +16,10 @@ endif
16# Generic drivers that other drivers may depend upon 16# Generic drivers that other drivers may depend upon
17 17
18# SoC-specific code 18# SoC-specific code
19obj-$(CONFIG_PXA25x) += mfp-pxa2xx.o pxa2xx.o pxa25x.o 19obj-$(CONFIG_PXA25x) += mfp-pxa2xx.o clock-pxa2xx.o pxa2xx.o pxa25x.o
20obj-$(CONFIG_PXA27x) += mfp-pxa2xx.o pxa2xx.o pxa27x.o 20obj-$(CONFIG_PXA27x) += mfp-pxa2xx.o clock-pxa2xx.o pxa2xx.o pxa27x.o
21obj-$(CONFIG_PXA3xx) += mfp-pxa3xx.o pxa3xx.o smemc.o pxa3xx-ulpi.o 21obj-$(CONFIG_PXA3xx) += mfp-pxa3xx.o clock-pxa3xx.o pxa3xx.o smemc.o pxa3xx-ulpi.o
22obj-$(CONFIG_PXA95x) += mfp-pxa3xx.o clock-pxa3xx.o pxa95x.o smemc.o
22obj-$(CONFIG_CPU_PXA300) += pxa300.o 23obj-$(CONFIG_CPU_PXA300) += pxa300.o
23obj-$(CONFIG_CPU_PXA320) += pxa320.o 24obj-$(CONFIG_CPU_PXA320) += pxa320.o
24obj-$(CONFIG_CPU_PXA930) += pxa930.o 25obj-$(CONFIG_CPU_PXA930) += pxa930.o
@@ -34,6 +35,7 @@ obj-$(CONFIG_MACH_LITTLETON) += littleton.o
34obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o 35obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o
35obj-$(CONFIG_MACH_TAVOREVB3) += tavorevb3.o 36obj-$(CONFIG_MACH_TAVOREVB3) += tavorevb3.o
36obj-$(CONFIG_MACH_SAAR) += saar.o 37obj-$(CONFIG_MACH_SAAR) += saar.o
38obj-$(CONFIG_MACH_SAARB) += saarb.o
37 39
38# 3rd Party Dev Platforms 40# 3rd Party Dev Platforms
39obj-$(CONFIG_ARCH_PXA_IDP) += idp.o 41obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
@@ -60,7 +62,7 @@ obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o
60obj-$(CONFIG_MACH_PCM027) += pcm027.o 62obj-$(CONFIG_MACH_PCM027) += pcm027.o
61obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o 63obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o
62obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o 64obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o
63obj-$(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD) += colibri-pxa270-evalboard.o 65obj-$(CONFIG_MACH_COLIBRI_EVALBOARD) += colibri-evalboard.o
64obj-$(CONFIG_MACH_COLIBRI_PXA270_INCOME) += colibri-pxa270-income.o 66obj-$(CONFIG_MACH_COLIBRI_PXA270_INCOME) += colibri-pxa270-income.o
65obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o 67obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o
66obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o 68obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index 21e188901935..ccb2d0cebcc3 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -567,27 +567,29 @@ static inline void balloon3_i2c_init(void) {}
567 * NAND 567 * NAND
568 ******************************************************************************/ 568 ******************************************************************************/
569#if defined(CONFIG_MTD_NAND_PLATFORM)||defined(CONFIG_MTD_NAND_PLATFORM_MODULE) 569#if defined(CONFIG_MTD_NAND_PLATFORM)||defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
570static uint16_t balloon3_ctl =
571 BALLOON3_NAND_CONTROL_FLCE0 | BALLOON3_NAND_CONTROL_FLCE1 |
572 BALLOON3_NAND_CONTROL_FLCE2 | BALLOON3_NAND_CONTROL_FLCE3 |
573 BALLOON3_NAND_CONTROL_FLWP;
574
575static void balloon3_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl) 570static void balloon3_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
576{ 571{
577 struct nand_chip *this = mtd->priv; 572 struct nand_chip *this = mtd->priv;
573 uint8_t balloon3_ctl_set = 0, balloon3_ctl_clr = 0;
578 574
579 if (ctrl & NAND_CTRL_CHANGE) { 575 if (ctrl & NAND_CTRL_CHANGE) {
580 if (ctrl & NAND_CLE) 576 if (ctrl & NAND_CLE)
581 balloon3_ctl |= BALLOON3_NAND_CONTROL_FLCLE; 577 balloon3_ctl_set |= BALLOON3_NAND_CONTROL_FLCLE;
582 else 578 else
583 balloon3_ctl &= ~BALLOON3_NAND_CONTROL_FLCLE; 579 balloon3_ctl_clr |= BALLOON3_NAND_CONTROL_FLCLE;
584 580
585 if (ctrl & NAND_ALE) 581 if (ctrl & NAND_ALE)
586 balloon3_ctl |= BALLOON3_NAND_CONTROL_FLALE; 582 balloon3_ctl_set |= BALLOON3_NAND_CONTROL_FLALE;
587 else 583 else
588 balloon3_ctl &= ~BALLOON3_NAND_CONTROL_FLALE; 584 balloon3_ctl_clr |= BALLOON3_NAND_CONTROL_FLALE;
589 585
590 __raw_writel(balloon3_ctl, BALLOON3_NAND_CONTROL_REG); 586 if (balloon3_ctl_clr)
587 __raw_writel(balloon3_ctl_clr,
588 BALLOON3_NAND_CONTROL_REG);
589 if (balloon3_ctl_set)
590 __raw_writel(balloon3_ctl_set,
591 BALLOON3_NAND_CONTROL_REG |
592 BALLOON3_FPGA_SETnCLR);
591 } 593 }
592 594
593 if (cmd != NAND_CMD_NONE) 595 if (cmd != NAND_CMD_NONE)
@@ -599,28 +601,33 @@ static void balloon3_nand_select_chip(struct mtd_info *mtd, int chip)
599 if (chip < 0 || chip > 3) 601 if (chip < 0 || chip > 3)
600 return; 602 return;
601 603
602 balloon3_ctl |= BALLOON3_NAND_CONTROL_FLCE0 | 604 /* Assert all nCE lines */
603 BALLOON3_NAND_CONTROL_FLCE1 | 605 __raw_writew(
604 BALLOON3_NAND_CONTROL_FLCE2 | 606 BALLOON3_NAND_CONTROL_FLCE0 | BALLOON3_NAND_CONTROL_FLCE1 |
605 BALLOON3_NAND_CONTROL_FLCE3; 607 BALLOON3_NAND_CONTROL_FLCE2 | BALLOON3_NAND_CONTROL_FLCE3,
608 BALLOON3_NAND_CONTROL_REG | BALLOON3_FPGA_SETnCLR);
606 609
607 /* Deassert correct nCE line */ 610 /* Deassert correct nCE line */
608 balloon3_ctl &= ~(BALLOON3_NAND_CONTROL_FLCE0 << chip); 611 __raw_writew(BALLOON3_NAND_CONTROL_FLCE0 << chip,
612 BALLOON3_NAND_CONTROL_REG);
613}
609 614
610 __raw_writew(balloon3_ctl, BALLOON3_NAND_CONTROL_REG); 615static int balloon3_nand_dev_ready(struct mtd_info *mtd)
616{
617 return __raw_readl(BALLOON3_NAND_STAT_REG) & BALLOON3_NAND_STAT_RNB;
611} 618}
612 619
613static int balloon3_nand_probe(struct platform_device *pdev) 620static int balloon3_nand_probe(struct platform_device *pdev)
614{ 621{
615 void __iomem *temp_map;
616 uint16_t ver; 622 uint16_t ver;
617 int ret; 623 int ret;
618 624
619 __raw_writew(BALLOON3_NAND_CONTROL2_16BIT, BALLOON3_NAND_CONTROL2_REG); 625 __raw_writew(BALLOON3_NAND_CONTROL2_16BIT,
626 BALLOON3_NAND_CONTROL2_REG | BALLOON3_FPGA_SETnCLR);
620 627
621 ver = __raw_readw(BALLOON3_FPGA_VER); 628 ver = __raw_readw(BALLOON3_FPGA_VER);
622 if (ver > 0x0201) 629 if (ver < 0x4f08)
623 pr_warn("The FPGA code, version 0x%04x, is newer than rel-0.3. " 630 pr_warn("The FPGA code, version 0x%04x, is too old. "
624 "NAND support might be broken in this version!", ver); 631 "NAND support might be broken in this version!", ver);
625 632
626 /* Power up the NAND chips */ 633 /* Power up the NAND chips */
@@ -635,7 +642,11 @@ static int balloon3_nand_probe(struct platform_device *pdev)
635 gpio_set_value(BALLOON3_GPIO_RUN_NAND, 1); 642 gpio_set_value(BALLOON3_GPIO_RUN_NAND, 1);
636 643
637 /* Deassert all nCE lines and write protect line */ 644 /* Deassert all nCE lines and write protect line */
638 __raw_writel(balloon3_ctl, BALLOON3_NAND_CONTROL_REG); 645 __raw_writel(
646 BALLOON3_NAND_CONTROL_FLCE0 | BALLOON3_NAND_CONTROL_FLCE1 |
647 BALLOON3_NAND_CONTROL_FLCE2 | BALLOON3_NAND_CONTROL_FLCE3 |
648 BALLOON3_NAND_CONTROL_FLWP,
649 BALLOON3_NAND_CONTROL_REG | BALLOON3_FPGA_SETnCLR);
639 return 0; 650 return 0;
640 651
641err2: 652err2:
@@ -677,7 +688,7 @@ struct platform_nand_data balloon3_nand_pdata = {
677 }, 688 },
678 .ctrl = { 689 .ctrl = {
679 .hwcontrol = 0, 690 .hwcontrol = 0,
680 .dev_ready = 0, 691 .dev_ready = balloon3_nand_dev_ready,
681 .select_chip = balloon3_nand_select_chip, 692 .select_chip = balloon3_nand_select_chip,
682 .cmd_ctrl = balloon3_nand_cmd_ctl, 693 .cmd_ctrl = balloon3_nand_cmd_ctl,
683 .probe = balloon3_nand_probe, 694 .probe = balloon3_nand_probe,
@@ -802,7 +813,7 @@ static struct map_desc balloon3_io_desc[] __initdata = {
802 813
803static void __init balloon3_map_io(void) 814static void __init balloon3_map_io(void)
804{ 815{
805 pxa_map_io(); 816 pxa27x_map_io();
806 iotable_init(balloon3_io_desc, ARRAY_SIZE(balloon3_io_desc)); 817 iotable_init(balloon3_io_desc, ARRAY_SIZE(balloon3_io_desc));
807} 818}
808 819
diff --git a/arch/arm/mach-pxa/capc7117.c b/arch/arm/mach-pxa/capc7117.c
index 4bd7a3cda48c..4284513f396a 100644
--- a/arch/arm/mach-pxa/capc7117.c
+++ b/arch/arm/mach-pxa/capc7117.c
@@ -149,7 +149,7 @@ static void __init capc7117_init(void)
149MACHINE_START(CAPC7117, 149MACHINE_START(CAPC7117,
150 "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM") 150 "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM")
151 .boot_params = 0xa0000100, 151 .boot_params = 0xa0000100,
152 .map_io = pxa_map_io, 152 .map_io = pxa3xx_map_io,
153 .init_irq = pxa3xx_init_irq, 153 .init_irq = pxa3xx_init_irq,
154 .timer = &pxa_timer, 154 .timer = &pxa_timer,
155 .init_machine = capc7117_init 155 .init_machine = capc7117_init
diff --git a/arch/arm/mach-pxa/clock-pxa2xx.c b/arch/arm/mach-pxa/clock-pxa2xx.c
new file mode 100644
index 000000000000..1ce090448493
--- /dev/null
+++ b/arch/arm/mach-pxa/clock-pxa2xx.c
@@ -0,0 +1,64 @@
1/*
2 * linux/arch/arm/mach-pxa/clock-pxa2xx.c
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/module.h>
10#include <linux/kernel.h>
11#include <linux/init.h>
12#include <linux/sysdev.h>
13
14#include <mach/pxa2xx-regs.h>
15
16#include "clock.h"
17
18void clk_pxa2xx_cken_enable(struct clk *clk)
19{
20 CKEN |= 1 << clk->cken;
21}
22
23void clk_pxa2xx_cken_disable(struct clk *clk)
24{
25 CKEN &= ~(1 << clk->cken);
26}
27
28const struct clkops clk_pxa2xx_cken_ops = {
29 .enable = clk_pxa2xx_cken_enable,
30 .disable = clk_pxa2xx_cken_disable,
31};
32
33#ifdef CONFIG_PM
34static uint32_t saved_cken;
35
36static int pxa2xx_clock_suspend(struct sys_device *d, pm_message_t state)
37{
38 saved_cken = CKEN;
39 return 0;
40}
41
42static int pxa2xx_clock_resume(struct sys_device *d)
43{
44 CKEN = saved_cken;
45 return 0;
46}
47#else
48#define pxa2xx_clock_suspend NULL
49#define pxa2xx_clock_resume NULL
50#endif
51
52struct sysdev_class pxa2xx_clock_sysclass = {
53 .name = "pxa2xx-clock",
54 .suspend = pxa2xx_clock_suspend,
55 .resume = pxa2xx_clock_resume,
56};
57
58static int __init pxa2xx_clock_init(void)
59{
60 if (cpu_is_pxa2xx())
61 return sysdev_class_register(&pxa2xx_clock_sysclass);
62 return 0;
63}
64postcore_initcall(pxa2xx_clock_init);
diff --git a/arch/arm/mach-pxa/clock-pxa3xx.c b/arch/arm/mach-pxa/clock-pxa3xx.c
new file mode 100644
index 000000000000..1b08a34ab234
--- /dev/null
+++ b/arch/arm/mach-pxa/clock-pxa3xx.c
@@ -0,0 +1,218 @@
1/*
2 * linux/arch/arm/mach-pxa/clock-pxa3xx.c
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/module.h>
10#include <linux/kernel.h>
11#include <linux/init.h>
12#include <linux/io.h>
13
14#include <mach/smemc.h>
15#include <mach/pxa3xx-regs.h>
16
17#include "clock.h"
18
19/* Crystal clock: 13MHz */
20#define BASE_CLK 13000000
21
22/* Ring Oscillator Clock: 60MHz */
23#define RO_CLK 60000000
24
25#define ACCR_D0CS (1 << 26)
26#define ACCR_PCCE (1 << 11)
27
28/* crystal frequency to HSIO bus frequency multiplier (HSS) */
29static unsigned char hss_mult[4] = { 8, 12, 16, 24 };
30
31/*
32 * Get the clock frequency as reflected by CCSR and the turbo flag.
33 * We assume these values have been applied via a fcs.
34 * If info is not 0 we also display the current settings.
35 */
36unsigned int pxa3xx_get_clk_frequency_khz(int info)
37{
38 unsigned long acsr, xclkcfg;
39 unsigned int t, xl, xn, hss, ro, XL, XN, CLK, HSS;
40
41 /* Read XCLKCFG register turbo bit */
42 __asm__ __volatile__("mrc\tp14, 0, %0, c6, c0, 0" : "=r"(xclkcfg));
43 t = xclkcfg & 0x1;
44
45 acsr = ACSR;
46
47 xl = acsr & 0x1f;
48 xn = (acsr >> 8) & 0x7;
49 hss = (acsr >> 14) & 0x3;
50
51 XL = xl * BASE_CLK;
52 XN = xn * XL;
53
54 ro = acsr & ACCR_D0CS;
55
56 CLK = (ro) ? RO_CLK : ((t) ? XN : XL);
57 HSS = (ro) ? RO_CLK : hss_mult[hss] * BASE_CLK;
58
59 if (info) {
60 pr_info("RO Mode clock: %d.%02dMHz (%sactive)\n",
61 RO_CLK / 1000000, (RO_CLK % 1000000) / 10000,
62 (ro) ? "" : "in");
63 pr_info("Run Mode clock: %d.%02dMHz (*%d)\n",
64 XL / 1000000, (XL % 1000000) / 10000, xl);
65 pr_info("Turbo Mode clock: %d.%02dMHz (*%d, %sactive)\n",
66 XN / 1000000, (XN % 1000000) / 10000, xn,
67 (t) ? "" : "in");
68 pr_info("HSIO bus clock: %d.%02dMHz\n",
69 HSS / 1000000, (HSS % 1000000) / 10000);
70 }
71
72 return CLK / 1000;
73}
74
75/*
76 * Return the current AC97 clock frequency.
77 */
78static unsigned long clk_pxa3xx_ac97_getrate(struct clk *clk)
79{
80 unsigned long rate = 312000000;
81 unsigned long ac97_div;
82
83 ac97_div = AC97_DIV;
84
85 /* This may loose precision for some rates but won't for the
86 * standard 24.576MHz.
87 */
88 rate /= (ac97_div >> 12) & 0x7fff;
89 rate *= (ac97_div & 0xfff);
90
91 return rate;
92}
93
94/*
95 * Return the current HSIO bus clock frequency
96 */
97static unsigned long clk_pxa3xx_hsio_getrate(struct clk *clk)
98{
99 unsigned long acsr;
100 unsigned int hss, hsio_clk;
101
102 acsr = ACSR;
103
104 hss = (acsr >> 14) & 0x3;
105 hsio_clk = (acsr & ACCR_D0CS) ? RO_CLK : hss_mult[hss] * BASE_CLK;
106
107 return hsio_clk;
108}
109
110/* crystal frequency to static memory controller multiplier (SMCFS) */
111static unsigned int smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, };
112static unsigned int df_clkdiv[4] = { 1, 2, 4, 1 };
113
114static unsigned long clk_pxa3xx_smemc_getrate(struct clk *clk)
115{
116 unsigned long acsr = ACSR;
117 unsigned long memclkcfg = __raw_readl(MEMCLKCFG);
118 unsigned int smcfs = (acsr >> 23) & 0x7;
119
120 return BASE_CLK * smcfs_mult[(acsr >> 23) & 0x7] /
121 df_clkdiv[(memclkcfg >> 16) & 0x3];
122}
123
124void clk_pxa3xx_cken_enable(struct clk *clk)
125{
126 unsigned long mask = 1ul << (clk->cken & 0x1f);
127
128 if (clk->cken < 32)
129 CKENA |= mask;
130 else
131 CKENB |= mask;
132}
133
134void clk_pxa3xx_cken_disable(struct clk *clk)
135{
136 unsigned long mask = 1ul << (clk->cken & 0x1f);
137
138 if (clk->cken < 32)
139 CKENA &= ~mask;
140 else
141 CKENB &= ~mask;
142}
143
144const struct clkops clk_pxa3xx_cken_ops = {
145 .enable = clk_pxa3xx_cken_enable,
146 .disable = clk_pxa3xx_cken_disable,
147};
148
149const struct clkops clk_pxa3xx_hsio_ops = {
150 .enable = clk_pxa3xx_cken_enable,
151 .disable = clk_pxa3xx_cken_disable,
152 .getrate = clk_pxa3xx_hsio_getrate,
153};
154
155const struct clkops clk_pxa3xx_ac97_ops = {
156 .enable = clk_pxa3xx_cken_enable,
157 .disable = clk_pxa3xx_cken_disable,
158 .getrate = clk_pxa3xx_ac97_getrate,
159};
160
161const struct clkops clk_pxa3xx_smemc_ops = {
162 .enable = clk_pxa3xx_cken_enable,
163 .disable = clk_pxa3xx_cken_disable,
164 .getrate = clk_pxa3xx_smemc_getrate,
165};
166
167static void clk_pout_enable(struct clk *clk)
168{
169 OSCC |= OSCC_PEN;
170}
171
172static void clk_pout_disable(struct clk *clk)
173{
174 OSCC &= ~OSCC_PEN;
175}
176
177const struct clkops clk_pxa3xx_pout_ops = {
178 .enable = clk_pout_enable,
179 .disable = clk_pout_disable,
180};
181
182#ifdef CONFIG_PM
183static uint32_t cken[2];
184static uint32_t accr;
185
186static int pxa3xx_clock_suspend(struct sys_device *d, pm_message_t state)
187{
188 cken[0] = CKENA;
189 cken[1] = CKENB;
190 accr = ACCR;
191 return 0;
192}
193
194static int pxa3xx_clock_resume(struct sys_device *d)
195{
196 ACCR = accr;
197 CKENA = cken[0];
198 CKENB = cken[1];
199 return 0;
200}
201#else
202#define pxa3xx_clock_suspend NULL
203#define pxa3xx_clock_resume NULL
204#endif
205
206struct sysdev_class pxa3xx_clock_sysclass = {
207 .name = "pxa3xx-clock",
208 .suspend = pxa3xx_clock_suspend,
209 .resume = pxa3xx_clock_resume,
210};
211
212static int __init pxa3xx_clock_init(void)
213{
214 if (cpu_is_pxa3xx() || cpu_is_pxa95x())
215 return sysdev_class_register(&pxa3xx_clock_sysclass);
216 return 0;
217}
218postcore_initcall(pxa3xx_clock_init);
diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c
index 4e4a84be96ba..d5152220ce94 100644
--- a/arch/arm/mach-pxa/clock.c
+++ b/arch/arm/mach-pxa/clock.c
@@ -3,21 +3,11 @@
3 */ 3 */
4#include <linux/module.h> 4#include <linux/module.h>
5#include <linux/kernel.h> 5#include <linux/kernel.h>
6#include <linux/list.h>
7#include <linux/errno.h>
8#include <linux/err.h>
9#include <linux/string.h>
10#include <linux/clk.h> 6#include <linux/clk.h>
11#include <linux/spinlock.h> 7#include <linux/spinlock.h>
12#include <linux/platform_device.h>
13#include <linux/delay.h> 8#include <linux/delay.h>
14#include <linux/clkdev.h> 9#include <linux/clkdev.h>
15 10
16#include <mach/pxa2xx-regs.h>
17#include <mach/hardware.h>
18
19#include "devices.h"
20#include "generic.h"
21#include "clock.h" 11#include "clock.h"
22 12
23static DEFINE_SPINLOCK(clocks_lock); 13static DEFINE_SPINLOCK(clocks_lock);
@@ -63,18 +53,19 @@ unsigned long clk_get_rate(struct clk *clk)
63} 53}
64EXPORT_SYMBOL(clk_get_rate); 54EXPORT_SYMBOL(clk_get_rate);
65 55
66 56void clk_dummy_enable(struct clk *clk)
67void clk_cken_enable(struct clk *clk)
68{ 57{
69 CKEN |= 1 << clk->cken;
70} 58}
71 59
72void clk_cken_disable(struct clk *clk) 60void clk_dummy_disable(struct clk *clk)
73{ 61{
74 CKEN &= ~(1 << clk->cken);
75} 62}
76 63
77const struct clkops clk_cken_ops = { 64const struct clkops clk_dummy_ops = {
78 .enable = clk_cken_enable, 65 .enable = clk_dummy_enable,
79 .disable = clk_cken_disable, 66 .disable = clk_dummy_disable,
67};
68
69struct clk clk_dummy = {
70 .ops = &clk_dummy_ops,
80}; 71};
diff --git a/arch/arm/mach-pxa/clock.h b/arch/arm/mach-pxa/clock.h
index 12cc0e87e6c4..f9f349a21b54 100644
--- a/arch/arm/mach-pxa/clock.h
+++ b/arch/arm/mach-pxa/clock.h
@@ -1,4 +1,5 @@
1#include <linux/clkdev.h> 1#include <linux/clkdev.h>
2#include <linux/sysdev.h>
2 3
3struct clkops { 4struct clkops {
4 void (*enable)(struct clk *); 5 void (*enable)(struct clk *);
@@ -14,6 +15,12 @@ struct clk {
14 unsigned int enabled; 15 unsigned int enabled;
15}; 16};
16 17
18void clk_dummy_enable(struct clk *);
19void clk_dummy_disable(struct clk *);
20
21extern const struct clkops clk_dummy_ops;
22extern struct clk clk_dummy;
23
17#define INIT_CLKREG(_clk,_devname,_conname) \ 24#define INIT_CLKREG(_clk,_devname,_conname) \
18 { \ 25 { \
19 .clk = _clk, \ 26 .clk = _clk, \
@@ -21,14 +28,6 @@ struct clk {
21 .con_id = _conname, \ 28 .con_id = _conname, \
22 } 29 }
23 30
24#define DEFINE_CKEN(_name, _cken, _rate, _delay) \
25struct clk clk_##_name = { \
26 .ops = &clk_cken_ops, \
27 .rate = _rate, \
28 .cken = CKEN_##_cken, \
29 .delay = _delay, \
30 }
31
32#define DEFINE_CK(_name, _cken, _ops) \ 31#define DEFINE_CK(_name, _cken, _ops) \
33struct clk clk_##_name = { \ 32struct clk clk_##_name = { \
34 .ops = _ops, \ 33 .ops = _ops, \
@@ -42,28 +41,38 @@ struct clk clk_##_name = { \
42 .delay = _delay, \ 41 .delay = _delay, \
43 } 42 }
44 43
45extern const struct clkops clk_cken_ops; 44#define DEFINE_PXA2_CKEN(_name, _cken, _rate, _delay) \
46
47void clk_cken_enable(struct clk *clk);
48void clk_cken_disable(struct clk *clk);
49
50#ifdef CONFIG_PXA3xx
51#define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay) \
52struct clk clk_##_name = { \ 45struct clk clk_##_name = { \
53 .ops = &clk_pxa3xx_cken_ops, \ 46 .ops = &clk_pxa2xx_cken_ops, \
54 .rate = _rate, \ 47 .rate = _rate, \
55 .cken = CKEN_##_cken, \ 48 .cken = CKEN_##_cken, \
56 .delay = _delay, \ 49 .delay = _delay, \
57 } 50 }
58 51
59#define DEFINE_PXA3_CK(_name, _cken, _ops) \ 52extern const struct clkops clk_pxa2xx_cken_ops;
53
54void clk_pxa2xx_cken_enable(struct clk *clk);
55void clk_pxa2xx_cken_disable(struct clk *clk);
56
57extern struct sysdev_class pxa2xx_clock_sysclass;
58
59#if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x)
60#define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay) \
60struct clk clk_##_name = { \ 61struct clk clk_##_name = { \
61 .ops = _ops, \ 62 .ops = &clk_pxa3xx_cken_ops, \
63 .rate = _rate, \
62 .cken = CKEN_##_cken, \ 64 .cken = CKEN_##_cken, \
65 .delay = _delay, \
63 } 66 }
64 67
65extern const struct clkops clk_pxa3xx_cken_ops; 68extern const struct clkops clk_pxa3xx_cken_ops;
69extern const struct clkops clk_pxa3xx_hsio_ops;
70extern const struct clkops clk_pxa3xx_ac97_ops;
71extern const struct clkops clk_pxa3xx_pout_ops;
72extern const struct clkops clk_pxa3xx_smemc_ops;
73
66extern void clk_pxa3xx_cken_enable(struct clk *); 74extern void clk_pxa3xx_cken_enable(struct clk *);
67extern void clk_pxa3xx_cken_disable(struct clk *); 75extern void clk_pxa3xx_cken_disable(struct clk *);
68#endif
69 76
77extern struct sysdev_class pxa3xx_clock_sysclass;
78#endif
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c
index d34b99febeb9..b734d8468168 100644
--- a/arch/arm/mach-pxa/cm-x2xx.c
+++ b/arch/arm/mach-pxa/cm-x2xx.c
@@ -24,6 +24,7 @@
24#include <mach/pxa2xx-regs.h> 24#include <mach/pxa2xx-regs.h>
25#include <mach/audio.h> 25#include <mach/audio.h>
26#include <mach/pxafb.h> 26#include <mach/pxafb.h>
27#include <mach/smemc.h>
27 28
28#include <asm/hardware/it8152.h> 29#include <asm/hardware/it8152.h>
29 30
@@ -392,9 +393,9 @@ static int cmx2xx_suspend(struct sys_device *dev, pm_message_t state)
392 cmx2xx_pci_suspend(); 393 cmx2xx_pci_suspend();
393 394
394 /* save MSC registers */ 395 /* save MSC registers */
395 sleep_save_msc[0] = MSC0; 396 sleep_save_msc[0] = __raw_readl(MSC0);
396 sleep_save_msc[1] = MSC1; 397 sleep_save_msc[1] = __raw_readl(MSC1);
397 sleep_save_msc[2] = MSC2; 398 sleep_save_msc[2] = __raw_readl(MSC2);
398 399
399 /* setup power saving mode registers */ 400 /* setup power saving mode registers */
400 PCFR = 0x0; 401 PCFR = 0x0;
@@ -416,9 +417,9 @@ static int cmx2xx_resume(struct sys_device *dev)
416 cmx2xx_pci_resume(); 417 cmx2xx_pci_resume();
417 418
418 /* restore MSC registers */ 419 /* restore MSC registers */
419 MSC0 = sleep_save_msc[0]; 420 __raw_writel(sleep_save_msc[0], MSC0);
420 MSC1 = sleep_save_msc[1]; 421 __raw_writel(sleep_save_msc[1], MSC1);
421 MSC2 = sleep_save_msc[2]; 422 __raw_writel(sleep_save_msc[2], MSC2);
422 423
423 return 0; 424 return 0;
424} 425}
@@ -498,7 +499,12 @@ static struct map_desc cmx2xx_io_desc[] __initdata = {
498 499
499static void __init cmx2xx_map_io(void) 500static void __init cmx2xx_map_io(void)
500{ 501{
501 pxa_map_io(); 502 if (cpu_is_pxa25x())
503 pxa25x_map_io();
504
505 if (cpu_is_pxa27x())
506 pxa27x_map_io();
507
502 iotable_init(cmx2xx_io_desc, ARRAY_SIZE(cmx2xx_io_desc)); 508 iotable_init(cmx2xx_io_desc, ARRAY_SIZE(cmx2xx_io_desc));
503 509
504 it8152_base_address = CMX2XX_IT8152_VIRT; 510 it8152_base_address = CMX2XX_IT8152_VIRT;
@@ -506,7 +512,11 @@ static void __init cmx2xx_map_io(void)
506#else 512#else
507static void __init cmx2xx_map_io(void) 513static void __init cmx2xx_map_io(void)
508{ 514{
509 pxa_map_io(); 515 if (cpu_is_pxa25x())
516 pxa25x_map_io();
517
518 if (cpu_is_pxa27x())
519 pxa27x_map_io();
510} 520}
511#endif 521#endif
512 522
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index 922b1075b9de..7984268508b6 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -857,7 +857,7 @@ static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags,
857 857
858MACHINE_START(CM_X300, "CM-X300 module") 858MACHINE_START(CM_X300, "CM-X300 module")
859 .boot_params = 0xa0000100, 859 .boot_params = 0xa0000100,
860 .map_io = pxa_map_io, 860 .map_io = pxa3xx_map_io,
861 .init_irq = pxa3xx_init_irq, 861 .init_irq = pxa3xx_init_irq,
862 .timer = &pxa_timer, 862 .timer = &pxa_timer,
863 .init_machine = cm_x300_init, 863 .init_machine = cm_x300_init,
diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-evalboard.c
index 0f3b632c3b14..6b2c800a1133 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
+++ b/arch/arm/mach-pxa/colibri-evalboard.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/arch/arm/mach-pxa/colibri-pxa270-evalboard.c 2 * linux/arch/arm/mach-pxa/colibri-evalboard.c
3 * 3 *
4 * Support for Toradex PXA270 based Colibri Evaluation Carrier Board 4 * Support for Toradex Colibri Evaluation Carrier Board
5 * Daniel Mack <daniel@caiaq.de> 5 * Daniel Mack <daniel@caiaq.de>
6 * Marek Vasut <marek.vasut@gmail.com> 6 * Marek Vasut <marek.vasut@gmail.com>
7 * 7 *
@@ -19,6 +19,7 @@
19#include <asm/mach-types.h> 19#include <asm/mach-types.h>
20#include <mach/hardware.h> 20#include <mach/hardware.h>
21#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
22#include <linux/i2c.h>
22 23
23#include <mach/pxa27x.h> 24#include <mach/pxa27x.h>
24#include <mach/colibri.h> 25#include <mach/colibri.h>
@@ -26,86 +27,95 @@
26#include <mach/ohci.h> 27#include <mach/ohci.h>
27#include <mach/pxa27x-udc.h> 28#include <mach/pxa27x-udc.h>
28 29
30#include <plat/i2c.h>
31
29#include "generic.h" 32#include "generic.h"
30#include "devices.h" 33#include "devices.h"
31 34
32/****************************************************************************** 35/******************************************************************************
33 * Pin configuration
34 ******************************************************************************/
35static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {
36 /* MMC */
37 GPIO32_MMC_CLK,
38 GPIO92_MMC_DAT_0,
39 GPIO109_MMC_DAT_1,
40 GPIO110_MMC_DAT_2,
41 GPIO111_MMC_DAT_3,
42 GPIO112_MMC_CMD,
43 GPIO0_GPIO, /* SD detect */
44
45 /* FFUART */
46 GPIO39_FFUART_TXD,
47 GPIO34_FFUART_RXD,
48
49 /* UHC */
50 GPIO88_USBH1_PWR,
51 GPIO89_USBH1_PEN,
52 GPIO119_USBH2_PWR,
53 GPIO120_USBH2_PEN,
54};
55
56/******************************************************************************
57 * SD/MMC card controller 36 * SD/MMC card controller
58 ******************************************************************************/ 37 ******************************************************************************/
59#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) 38#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
60static struct pxamci_platform_data colibri_pxa270_mci_platform_data = { 39static struct pxamci_platform_data colibri_mci_platform_data = {
61 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, 40 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
62 .gpio_power = -1, 41 .gpio_power = -1,
63 .gpio_card_detect = GPIO0_COLIBRI_PXA270_SD_DETECT,
64 .gpio_card_ro = -1, 42 .gpio_card_ro = -1,
65 .detect_delay_ms = 200, 43 .detect_delay_ms = 200,
66}; 44};
67 45
68static void __init colibri_pxa270_mmc_init(void) 46static void __init colibri_mmc_init(void)
69{ 47{
70 pxa_set_mci_info(&colibri_pxa270_mci_platform_data); 48 if (machine_is_colibri()) /* PXA270 Colibri */
49 colibri_mci_platform_data.gpio_card_detect =
50 GPIO0_COLIBRI_PXA270_SD_DETECT;
51 if (machine_is_colibri300()) /* PXA300 Colibri */
52 colibri_mci_platform_data.gpio_card_detect =
53 GPIO39_COLIBRI_PXA300_SD_DETECT;
54 else /* PXA320 Colibri */
55 colibri_mci_platform_data.gpio_card_detect =
56 GPIO28_COLIBRI_PXA320_SD_DETECT;
57
58 pxa_set_mci_info(&colibri_mci_platform_data);
71} 59}
72#else 60#else
73static inline void colibri_pxa270_mmc_init(void) {} 61static inline void colibri_mmc_init(void) {}
74#endif 62#endif
75 63
76/****************************************************************************** 64/******************************************************************************
77 * USB Host 65 * USB Host
78 ******************************************************************************/ 66 ******************************************************************************/
79#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) 67#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
80static int colibri_pxa270_ohci_init(struct device *dev) 68static int colibri_ohci_init(struct device *dev)
81{ 69{
82 UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE; 70 UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
83 return 0; 71 return 0;
84} 72}
85 73
86static struct pxaohci_platform_data colibri_pxa270_ohci_info = { 74static struct pxaohci_platform_data colibri_ohci_info = {
87 .port_mode = PMM_PERPORT_MODE, 75 .port_mode = PMM_PERPORT_MODE,
88 .flags = ENABLE_PORT1 | ENABLE_PORT2 | 76 .flags = ENABLE_PORT1 |
89 POWER_CONTROL_LOW | POWER_SENSE_LOW, 77 POWER_CONTROL_LOW | POWER_SENSE_LOW,
90 .init = colibri_pxa270_ohci_init, 78 .init = colibri_ohci_init,
91}; 79};
92 80
93static void __init colibri_pxa270_uhc_init(void) 81static void __init colibri_uhc_init(void)
94{ 82{
95 pxa_set_ohci_info(&colibri_pxa270_ohci_info); 83 /* Colibri PXA270 has two usb ports, TBA for 320 */
84 if (machine_is_colibri())
85 colibri_ohci_info.flags |= ENABLE_PORT2;
86
87 pxa_set_ohci_info(&colibri_ohci_info);
96} 88}
97#else 89#else
98static inline void colibri_pxa270_uhc_init(void) {} 90static inline void colibri_uhc_init(void) {}
99#endif 91#endif
100 92
101void __init colibri_pxa270_evalboard_init(void) 93/******************************************************************************
94 * I2C RTC
95 ******************************************************************************/
96#if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE)
97static struct i2c_board_info __initdata colibri_i2c_devs[] = {
98 {
99 I2C_BOARD_INFO("m41t00", 0x68),
100 },
101};
102
103static void __init colibri_rtc_init(void)
104{
105 pxa_set_i2c_info(NULL);
106 i2c_register_board_info(0, ARRAY_AND_SIZE(colibri_i2c_devs));
107}
108#else
109static inline void colibri_rtc_init(void) {}
110#endif
111
112void __init colibri_evalboard_init(void)
102{ 113{
103 pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_evalboard_pin_config));
104 pxa_set_ffuart_info(NULL); 114 pxa_set_ffuart_info(NULL);
105 pxa_set_btuart_info(NULL); 115 pxa_set_btuart_info(NULL);
106 pxa_set_stuart_info(NULL); 116 pxa_set_stuart_info(NULL);
107 117
108 colibri_pxa270_mmc_init(); 118 colibri_mmc_init();
109 colibri_pxa270_uhc_init(); 119 colibri_uhc_init();
120 colibri_rtc_init();
110} 121}
111
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c
index 37f0f3ed7c61..07b62a096f17 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-income.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-income.c
@@ -46,52 +46,6 @@
46#define GPIO113_INCOME_TS_IRQ (113) 46#define GPIO113_INCOME_TS_IRQ (113)
47 47
48/****************************************************************************** 48/******************************************************************************
49 * Pin configuration
50 ******************************************************************************/
51static mfp_cfg_t income_pin_config[] __initdata = {
52 /* MMC */
53 GPIO32_MMC_CLK,
54 GPIO92_MMC_DAT_0,
55 GPIO109_MMC_DAT_1,
56 GPIO110_MMC_DAT_2,
57 GPIO111_MMC_DAT_3,
58 GPIO112_MMC_CMD,
59 GPIO0_GPIO, /* SD detect */
60 GPIO1_GPIO, /* SD read-only */
61
62 /* FFUART */
63 GPIO39_FFUART_TXD,
64 GPIO34_FFUART_RXD,
65
66 /* BFUART */
67 GPIO42_BTUART_RXD,
68 GPIO43_BTUART_TXD,
69 GPIO45_BTUART_RTS,
70
71 /* STUART */
72 GPIO46_STUART_RXD,
73 GPIO47_STUART_TXD,
74
75 /* UHC */
76 GPIO88_USBH1_PWR,
77 GPIO89_USBH1_PEN,
78
79 /* LCD */
80 GPIOxx_LCD_TFT_16BPP,
81
82 /* PWM */
83 GPIO16_PWM0_OUT,
84
85 /* I2C */
86 GPIO117_I2C_SCL,
87 GPIO118_I2C_SDA,
88
89 /* LED */
90 GPIO54_GPIO, /* LED A */
91 GPIO55_GPIO, /* LED B */
92};
93
94/******************************************************************************
95 * SD/MMC card controller 49 * SD/MMC card controller
96 ******************************************************************************/ 50 ******************************************************************************/
97#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) 51#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
@@ -257,7 +211,6 @@ static inline void income_pwm_init(void) {}
257 211
258void __init colibri_pxa270_income_boardinit(void) 212void __init colibri_pxa270_income_boardinit(void)
259{ 213{
260 pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config));
261 pxa_set_ffuart_info(NULL); 214 pxa_set_ffuart_info(NULL);
262 pxa_set_btuart_info(NULL); 215 pxa_set_btuart_info(NULL);
263 pxa_set_stuart_info(NULL); 216 pxa_set_stuart_info(NULL);
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index bc045100ec15..6fc5d328ba7f 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -33,6 +33,103 @@
33#include "generic.h" 33#include "generic.h"
34 34
35/****************************************************************************** 35/******************************************************************************
36 * Evaluation board MFP
37 ******************************************************************************/
38#ifdef CONFIG_MACH_COLIBRI_EVALBOARD
39static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {
40 /* MMC */
41 GPIO32_MMC_CLK,
42 GPIO92_MMC_DAT_0,
43 GPIO109_MMC_DAT_1,
44 GPIO110_MMC_DAT_2,
45 GPIO111_MMC_DAT_3,
46 GPIO112_MMC_CMD,
47 GPIO0_GPIO, /* SD detect */
48
49 /* FFUART */
50 GPIO39_FFUART_TXD,
51 GPIO34_FFUART_RXD,
52
53 /* UHC */
54 GPIO88_USBH1_PWR,
55 GPIO89_USBH1_PEN,
56 GPIO119_USBH2_PWR,
57 GPIO120_USBH2_PEN,
58
59 /* PCMCIA */
60 GPIO85_nPCE_1,
61 GPIO54_nPCE_2,
62 GPIO55_nPREG,
63 GPIO50_nPIOR,
64 GPIO51_nPIOW,
65 GPIO49_nPWE,
66 GPIO48_nPOE,
67 GPIO57_nIOIS16,
68 GPIO56_nPWAIT,
69 GPIO104_PSKTSEL,
70 GPIO53_GPIO, /* RESET */
71 GPIO83_GPIO, /* BVD1 */
72 GPIO82_GPIO, /* BVD2 */
73 GPIO1_GPIO, /* READY */
74 GPIO84_GPIO, /* DETECT */
75 GPIO107_GPIO, /* PPEN */
76
77 /* I2C */
78 GPIO117_I2C_SCL,
79 GPIO118_I2C_SDA,
80};
81#else
82static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {};
83#endif
84
85#ifdef CONFIG_MACH_COLIBRI_PXA270_INCOME
86static mfp_cfg_t income_pin_config[] __initdata = {
87 /* MMC */
88 GPIO32_MMC_CLK,
89 GPIO92_MMC_DAT_0,
90 GPIO109_MMC_DAT_1,
91 GPIO110_MMC_DAT_2,
92 GPIO111_MMC_DAT_3,
93 GPIO112_MMC_CMD,
94 GPIO0_GPIO, /* SD detect */
95 GPIO1_GPIO, /* SD read-only */
96
97 /* FFUART */
98 GPIO39_FFUART_TXD,
99 GPIO34_FFUART_RXD,
100
101 /* BFUART */
102 GPIO42_BTUART_RXD,
103 GPIO43_BTUART_TXD,
104 GPIO45_BTUART_RTS,
105
106 /* STUART */
107 GPIO46_STUART_RXD,
108 GPIO47_STUART_TXD,
109
110 /* UHC */
111 GPIO88_USBH1_PWR,
112 GPIO89_USBH1_PEN,
113
114 /* LCD */
115 GPIOxx_LCD_TFT_16BPP,
116
117 /* PWM */
118 GPIO16_PWM0_OUT,
119
120 /* I2C */
121 GPIO117_I2C_SCL,
122 GPIO118_I2C_SDA,
123
124 /* LED */
125 GPIO54_GPIO, /* LED A */
126 GPIO55_GPIO, /* LED B */
127};
128#else
129static mfp_cfg_t income_pin_config[] __initdata = {};
130#endif
131
132/******************************************************************************
36 * Pin configuration 133 * Pin configuration
37 ******************************************************************************/ 134 ******************************************************************************/
38static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = { 135static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
@@ -184,10 +281,13 @@ static void __init colibri_pxa270_init(void)
184 colibri_pxa270_tsc_init(); 281 colibri_pxa270_tsc_init();
185 282
186 switch (colibri_pxa270_baseboard) { 283 switch (colibri_pxa270_baseboard) {
187 case COLIBRI_PXA270_EVALBOARD: 284 case COLIBRI_EVALBOARD:
188 colibri_pxa270_evalboard_init(); 285 pxa2xx_mfp_config(ARRAY_AND_SIZE(
286 colibri_pxa270_evalboard_pin_config));
287 colibri_evalboard_init();
189 break; 288 break;
190 case COLIBRI_PXA270_INCOME: 289 case COLIBRI_PXA270_INCOME:
290 pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config));
191 colibri_pxa270_income_boardinit(); 291 colibri_pxa270_income_boardinit();
192 break; 292 break;
193 default: 293 default:
@@ -209,7 +309,7 @@ static void __init colibri_pxa270_income_init(void)
209MACHINE_START(COLIBRI, "Toradex Colibri PXA270") 309MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
210 .boot_params = COLIBRI_SDRAM_BASE + 0x100, 310 .boot_params = COLIBRI_SDRAM_BASE + 0x100,
211 .init_machine = colibri_pxa270_init, 311 .init_machine = colibri_pxa270_init,
212 .map_io = pxa_map_io, 312 .map_io = pxa27x_map_io,
213 .init_irq = pxa27x_init_irq, 313 .init_irq = pxa27x_init_irq,
214 .timer = &pxa_timer, 314 .timer = &pxa_timer,
215MACHINE_END 315MACHINE_END
@@ -217,7 +317,7 @@ MACHINE_END
217MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC") 317MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC")
218 .boot_params = 0xa0000100, 318 .boot_params = 0xa0000100,
219 .init_machine = colibri_pxa270_income_init, 319 .init_machine = colibri_pxa270_income_init,
220 .map_io = pxa_map_io, 320 .map_io = pxa27x_map_io,
221 .init_irq = pxa27x_init_irq, 321 .init_irq = pxa27x_init_irq,
222 .timer = &pxa_timer, 322 .timer = &pxa_timer,
223MACHINE_END 323MACHINE_END
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
index a70b256591e6..fddb16d07eb0 100644
--- a/arch/arm/mach-pxa/colibri-pxa300.c
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -31,9 +31,38 @@
31#include "generic.h" 31#include "generic.h"
32#include "devices.h" 32#include "devices.h"
33 33
34
35#ifdef CONFIG_MACH_COLIBRI_EVALBOARD
36static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {
37 /* MMC */
38 GPIO7_MMC1_CLK,
39 GPIO14_MMC1_CMD,
40 GPIO3_MMC1_DAT0,
41 GPIO4_MMC1_DAT1,
42 GPIO5_MMC1_DAT2,
43 GPIO6_MMC1_DAT3,
44 GPIO39_GPIO, /* SD detect */
45
46 /* UHC */
47 GPIO0_2_USBH_PEN,
48 GPIO1_2_USBH_PWR,
49 GPIO77_USB_P3_1,
50 GPIO78_USB_P3_2,
51 GPIO79_USB_P3_3,
52 GPIO80_USB_P3_4,
53 GPIO81_USB_P3_5,
54 GPIO82_USB_P3_6,
55
56 /* I2C */
57 GPIO21_I2C_SCL,
58 GPIO22_I2C_SDA,
59};
60#else
61static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {};
62#endif
63
34#if defined(CONFIG_AX88796) 64#if defined(CONFIG_AX88796)
35#define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO) 65#define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO)
36
37/* 66/*
38 * Asix AX88796 Ethernet 67 * Asix AX88796 Ethernet
39 */ 68 */
@@ -80,35 +109,6 @@ static void __init colibri_pxa300_init_eth(void)
80static inline void __init colibri_pxa300_init_eth(void) {} 109static inline void __init colibri_pxa300_init_eth(void) {}
81#endif /* CONFIG_AX88796 */ 110#endif /* CONFIG_AX88796 */
82 111
83#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
84static mfp_cfg_t colibri_pxa300_usb_pin_config[] __initdata = {
85 GPIO0_2_USBH_PEN,
86 GPIO1_2_USBH_PWR,
87};
88
89static struct pxaohci_platform_data colibri_pxa300_ohci_info = {
90 .port_mode = PMM_GLOBAL_MODE,
91 .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
92};
93
94void __init colibri_pxa300_init_ohci(void)
95{
96 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_usb_pin_config));
97 pxa_set_ohci_info(&colibri_pxa300_ohci_info);
98}
99#else
100static inline void colibri_pxa300_init_ohci(void) {}
101#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */
102
103static mfp_cfg_t colibri_pxa300_mmc_pin_config[] __initdata = {
104 GPIO7_MMC1_CLK,
105 GPIO14_MMC1_CMD,
106 GPIO3_MMC1_DAT0,
107 GPIO4_MMC1_DAT1,
108 GPIO5_MMC1_DAT2,
109 GPIO6_MMC1_DAT3,
110};
111
112#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) 112#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
113static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = { 113static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = {
114 GPIO54_LCD_LDD_0, 114 GPIO54_LCD_LDD_0,
@@ -171,24 +171,21 @@ static inline void colibri_pxa310_init_ac97(void) {}
171 171
172void __init colibri_pxa300_init(void) 172void __init colibri_pxa300_init(void)
173{ 173{
174 pxa_set_ffuart_info(NULL);
175 pxa_set_btuart_info(NULL);
176 pxa_set_stuart_info(NULL);
177
178 colibri_pxa300_init_eth(); 174 colibri_pxa300_init_eth();
179 colibri_pxa300_init_ohci();
180 colibri_pxa3xx_init_nand(); 175 colibri_pxa3xx_init_nand();
181 colibri_pxa300_init_lcd(); 176 colibri_pxa300_init_lcd();
182 colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO)); 177 colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO));
183 colibri_pxa310_init_ac97(); 178 colibri_pxa310_init_ac97();
184 colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa300_mmc_pin_config), 179
185 mfp_to_gpio(MFP_PIN_GPIO13)); 180 /* Evalboard init */
181 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_evalboard_pin_config));
182 colibri_evalboard_init();
186} 183}
187 184
188MACHINE_START(COLIBRI300, "Toradex Colibri PXA300") 185MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
189 .boot_params = COLIBRI_SDRAM_BASE + 0x100, 186 .boot_params = COLIBRI_SDRAM_BASE + 0x100,
190 .init_machine = colibri_pxa300_init, 187 .init_machine = colibri_pxa300_init,
191 .map_io = pxa_map_io, 188 .map_io = pxa3xx_map_io,
192 .init_irq = pxa3xx_init_irq, 189 .init_irq = pxa3xx_init_irq,
193 .timer = &pxa_timer, 190 .timer = &pxa_timer,
194MACHINE_END 191MACHINE_END
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
index ca5f29e2e9cd..ff9ff5f4fc47 100644
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -35,9 +35,72 @@
35#include "generic.h" 35#include "generic.h"
36#include "devices.h" 36#include "devices.h"
37 37
38#ifdef CONFIG_MACH_COLIBRI_EVALBOARD
39static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {
40 /* MMC */
41 GPIO22_MMC1_CLK,
42 GPIO23_MMC1_CMD,
43 GPIO18_MMC1_DAT0,
44 GPIO19_MMC1_DAT1,
45 GPIO20_MMC1_DAT2,
46 GPIO21_MMC1_DAT3,
47 GPIO28_GPIO, /* SD detect */
48
49 /* UART 1 configuration (may be set by bootloader) */
50 GPIO99_UART1_CTS,
51 GPIO104_UART1_RTS,
52 GPIO97_UART1_RXD,
53 GPIO98_UART1_TXD,
54 GPIO101_UART1_DTR,
55 GPIO103_UART1_DSR,
56 GPIO100_UART1_DCD,
57 GPIO102_UART1_RI,
58
59 /* UART 2 configuration */
60 GPIO109_UART2_CTS,
61 GPIO112_UART2_RTS,
62 GPIO110_UART2_RXD,
63 GPIO111_UART2_TXD,
64
65 /* UART 3 configuration */
66 GPIO30_UART3_RXD,
67 GPIO31_UART3_TXD,
68
69 /* UHC */
70 GPIO2_2_USBH_PEN,
71 GPIO3_2_USBH_PWR,
72
73 /* I2C */
74 GPIO32_I2C_SCL,
75 GPIO33_I2C_SDA,
76
77 /* PCMCIA */
78 MFP_CFG(GPIO59, AF7), /* PRST ; AF7 to tristate */
79 MFP_CFG(GPIO61, AF7), /* PCE1 ; AF7 to tristate */
80 MFP_CFG(GPIO60, AF7), /* PCE2 ; AF7 to tristate */
81 MFP_CFG(GPIO62, AF7), /* PCD ; AF7 to tristate */
82 MFP_CFG(GPIO56, AF7), /* PSKTSEL ; AF7 to tristate */
83 GPIO27_GPIO, /* RDnWR ; input/tristate */
84 GPIO50_GPIO, /* PREG ; input/tristate */
85 GPIO2_RDY,
86 GPIO5_NPIOR,
87 GPIO6_NPIOW,
88 GPIO7_NPIOS16,
89 GPIO8_NPWAIT,
90 GPIO29_GPIO, /* PRDY (READY GPIO) */
91 GPIO57_GPIO, /* PPEN (POWER GPIO) */
92 GPIO81_GPIO, /* PCD (DETECT GPIO) */
93 GPIO77_GPIO, /* PRST (RESET GPIO) */
94 GPIO53_GPIO, /* PBVD1 */
95 GPIO79_GPIO, /* PBVD2 */
96 GPIO54_GPIO, /* POE */
97};
98#else
99static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {};
100#endif
101
38#if defined(CONFIG_AX88796) 102#if defined(CONFIG_AX88796)
39#define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO36_GPIO) 103#define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO36_GPIO)
40
41/* 104/*
42 * Asix AX88796 Ethernet 105 * Asix AX88796 Ethernet
43 */ 106 */
@@ -84,26 +147,6 @@ static void __init colibri_pxa320_init_eth(void)
84static inline void __init colibri_pxa320_init_eth(void) {} 147static inline void __init colibri_pxa320_init_eth(void) {}
85#endif /* CONFIG_AX88796 */ 148#endif /* CONFIG_AX88796 */
86 149
87#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
88static mfp_cfg_t colibri_pxa320_usb_pin_config[] __initdata = {
89 GPIO2_2_USBH_PEN,
90 GPIO3_2_USBH_PWR,
91};
92
93static struct pxaohci_platform_data colibri_pxa320_ohci_info = {
94 .port_mode = PMM_GLOBAL_MODE,
95 .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
96};
97
98void __init colibri_pxa320_init_ohci(void)
99{
100 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_usb_pin_config));
101 pxa_set_ohci_info(&colibri_pxa320_ohci_info);
102}
103#else
104static inline void colibri_pxa320_init_ohci(void) {}
105#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */
106
107#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) 150#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE)
108static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = { 151static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = {
109 .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96), 152 .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96),
@@ -140,15 +183,6 @@ static void __init colibri_pxa320_init_udc(void)
140static inline void colibri_pxa320_init_udc(void) {} 183static inline void colibri_pxa320_init_udc(void) {}
141#endif 184#endif
142 185
143static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = {
144 GPIO22_MMC1_CLK,
145 GPIO23_MMC1_CMD,
146 GPIO18_MMC1_DAT0,
147 GPIO19_MMC1_DAT1,
148 GPIO20_MMC1_DAT2,
149 GPIO21_MMC1_DAT3
150};
151
152#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) 186#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
153static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = { 187static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = {
154 GPIO6_2_LCD_LDD_0, 188 GPIO6_2_LCD_LDD_0,
@@ -205,59 +239,24 @@ static inline void __init colibri_pxa320_init_ac97(void)
205static inline void colibri_pxa320_init_ac97(void) {} 239static inline void colibri_pxa320_init_ac97(void) {}
206#endif 240#endif
207 241
208/*
209 * The following configuration is verified to work with the Toradex Orchid
210 * carrier board
211 */
212static mfp_cfg_t colibri_pxa320_uart_pin_config[] __initdata = {
213 /* UART 1 configuration (may be set by bootloader) */
214 GPIO99_UART1_CTS,
215 GPIO104_UART1_RTS,
216 GPIO97_UART1_RXD,
217 GPIO98_UART1_TXD,
218 GPIO101_UART1_DTR,
219 GPIO103_UART1_DSR,
220 GPIO100_UART1_DCD,
221 GPIO102_UART1_RI,
222
223 /* UART 2 configuration */
224 GPIO109_UART2_CTS,
225 GPIO112_UART2_RTS,
226 GPIO110_UART2_RXD,
227 GPIO111_UART2_TXD,
228
229 /* UART 3 configuration */
230 GPIO30_UART3_RXD,
231 GPIO31_UART3_TXD,
232};
233
234static void __init colibri_pxa320_init_uart(void)
235{
236 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_uart_pin_config));
237}
238
239void __init colibri_pxa320_init(void) 242void __init colibri_pxa320_init(void)
240{ 243{
241 pxa_set_ffuart_info(NULL);
242 pxa_set_btuart_info(NULL);
243 pxa_set_stuart_info(NULL);
244
245 colibri_pxa320_init_eth(); 244 colibri_pxa320_init_eth();
246 colibri_pxa320_init_ohci();
247 colibri_pxa3xx_init_nand(); 245 colibri_pxa3xx_init_nand();
248 colibri_pxa320_init_lcd(); 246 colibri_pxa320_init_lcd();
249 colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO)); 247 colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO));
250 colibri_pxa320_init_ac97(); 248 colibri_pxa320_init_ac97();
251 colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config),
252 mfp_to_gpio(MFP_PIN_GPIO28));
253 colibri_pxa320_init_uart();
254 colibri_pxa320_init_udc(); 249 colibri_pxa320_init_udc();
250
251 /* Evalboard init */
252 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_evalboard_pin_config));
253 colibri_evalboard_init();
255} 254}
256 255
257MACHINE_START(COLIBRI320, "Toradex Colibri PXA320") 256MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
258 .boot_params = COLIBRI_SDRAM_BASE + 0x100, 257 .boot_params = COLIBRI_SDRAM_BASE + 0x100,
259 .init_machine = colibri_pxa320_init, 258 .init_machine = colibri_pxa320_init,
260 .map_io = pxa_map_io, 259 .map_io = pxa3xx_map_io,
261 .init_irq = pxa3xx_init_irq, 260 .init_irq = pxa3xx_init_irq,
262 .timer = &pxa_timer, 261 .timer = &pxa_timer,
263MACHINE_END 262MACHINE_END
diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c
index 199afa2ae303..96b2d9fbfef0 100644
--- a/arch/arm/mach-pxa/colibri-pxa3xx.c
+++ b/arch/arm/mach-pxa/colibri-pxa3xx.c
@@ -64,55 +64,6 @@ void __init colibri_pxa3xx_init_eth(struct ax_plat_data *plat_data)
64} 64}
65#endif 65#endif
66 66
67#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
68static int mmc_detect_pin;
69
70static int colibri_pxa3xx_mci_init(struct device *dev,
71 irq_handler_t colibri_mmc_detect_int,
72 void *data)
73{
74 int ret;
75
76 ret = gpio_request(mmc_detect_pin, "mmc card detect");
77 if (ret)
78 return ret;
79
80 gpio_direction_input(mmc_detect_pin);
81 ret = request_irq(gpio_to_irq(mmc_detect_pin), colibri_mmc_detect_int,
82 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
83 "MMC card detect", data);
84 if (ret) {
85 gpio_free(mmc_detect_pin);
86 return ret;
87 }
88
89 return 0;
90}
91
92static void colibri_pxa3xx_mci_exit(struct device *dev, void *data)
93{
94 free_irq(mmc_detect_pin, data);
95 gpio_free(gpio_to_irq(mmc_detect_pin));
96}
97
98static struct pxamci_platform_data colibri_pxa3xx_mci_platform_data = {
99 .detect_delay_ms = 200,
100 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
101 .init = colibri_pxa3xx_mci_init,
102 .exit = colibri_pxa3xx_mci_exit,
103 .gpio_card_detect = -1,
104 .gpio_card_ro = -1,
105 .gpio_power = -1,
106};
107
108void __init colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin)
109{
110 pxa3xx_mfp_config(pins, len);
111 mmc_detect_pin = detect_pin;
112 pxa_set_mci_info(&colibri_pxa3xx_mci_platform_data);
113}
114#endif /* CONFIG_MMC_PXA || CONFIG_MMC_PXA_MODULE */
115
116#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) 67#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
117static int lcd_bl_pin; 68static int lcd_bl_pin;
118 69
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 821229acabe6..9f3e5af0a0db 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -721,7 +721,7 @@ static void __init fixup_corgi(struct machine_desc *desc,
721#ifdef CONFIG_MACH_CORGI 721#ifdef CONFIG_MACH_CORGI
722MACHINE_START(CORGI, "SHARP Corgi") 722MACHINE_START(CORGI, "SHARP Corgi")
723 .fixup = fixup_corgi, 723 .fixup = fixup_corgi,
724 .map_io = pxa_map_io, 724 .map_io = pxa25x_map_io,
725 .init_irq = pxa25x_init_irq, 725 .init_irq = pxa25x_init_irq,
726 .init_machine = corgi_init, 726 .init_machine = corgi_init,
727 .timer = &pxa_timer, 727 .timer = &pxa_timer,
@@ -731,7 +731,7 @@ MACHINE_END
731#ifdef CONFIG_MACH_SHEPHERD 731#ifdef CONFIG_MACH_SHEPHERD
732MACHINE_START(SHEPHERD, "SHARP Shepherd") 732MACHINE_START(SHEPHERD, "SHARP Shepherd")
733 .fixup = fixup_corgi, 733 .fixup = fixup_corgi,
734 .map_io = pxa_map_io, 734 .map_io = pxa25x_map_io,
735 .init_irq = pxa25x_init_irq, 735 .init_irq = pxa25x_init_irq,
736 .init_machine = corgi_init, 736 .init_machine = corgi_init,
737 .timer = &pxa_timer, 737 .timer = &pxa_timer,
@@ -741,7 +741,7 @@ MACHINE_END
741#ifdef CONFIG_MACH_HUSKY 741#ifdef CONFIG_MACH_HUSKY
742MACHINE_START(HUSKY, "SHARP Husky") 742MACHINE_START(HUSKY, "SHARP Husky")
743 .fixup = fixup_corgi, 743 .fixup = fixup_corgi,
744 .map_io = pxa_map_io, 744 .map_io = pxa25x_map_io,
745 .init_irq = pxa25x_init_irq, 745 .init_irq = pxa25x_init_irq,
746 .init_machine = corgi_init, 746 .init_machine = corgi_init,
747 .timer = &pxa_timer, 747 .timer = &pxa_timer,
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
index 58093d9e07be..6a7aeab42f6c 100644
--- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
+++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
@@ -38,8 +38,10 @@
38#include <linux/cpufreq.h> 38#include <linux/cpufreq.h>
39#include <linux/err.h> 39#include <linux/err.h>
40#include <linux/regulator/consumer.h> 40#include <linux/regulator/consumer.h>
41#include <linux/io.h>
41 42
42#include <mach/pxa2xx-regs.h> 43#include <mach/pxa2xx-regs.h>
44#include <mach/smemc.h>
43 45
44#ifdef DEBUG 46#ifdef DEBUG
45static unsigned int freq_debug; 47static unsigned int freq_debug;
@@ -242,7 +244,7 @@ static void pxa27x_guess_max_freq(void)
242 244
243static void init_sdram_rows(void) 245static void init_sdram_rows(void)
244{ 246{
245 uint32_t mdcnfg = MDCNFG; 247 uint32_t mdcnfg = __raw_readl(MDCNFG);
246 unsigned int drac2 = 0, drac0 = 0; 248 unsigned int drac2 = 0, drac0 = 0;
247 249
248 if (mdcnfg & (MDCNFG_DE2 | MDCNFG_DE3)) 250 if (mdcnfg & (MDCNFG_DE2 | MDCNFG_DE3))
@@ -331,8 +333,8 @@ static int pxa_set_target(struct cpufreq_policy *policy,
331 * we need to preset the smaller DRI before the change. If we're 333 * we need to preset the smaller DRI before the change. If we're
332 * speeding up we need to set the larger DRI value after the change. 334 * speeding up we need to set the larger DRI value after the change.
333 */ 335 */
334 preset_mdrefr = postset_mdrefr = MDREFR; 336 preset_mdrefr = postset_mdrefr = __raw_readl(MDREFR);
335 if ((MDREFR & MDREFR_DRI_MASK) > mdrefr_dri(new_freq_mem)) { 337 if ((preset_mdrefr & MDREFR_DRI_MASK) > mdrefr_dri(new_freq_mem)) {
336 preset_mdrefr = (preset_mdrefr & ~MDREFR_DRI_MASK); 338 preset_mdrefr = (preset_mdrefr & ~MDREFR_DRI_MASK);
337 preset_mdrefr |= mdrefr_dri(new_freq_mem); 339 preset_mdrefr |= mdrefr_dri(new_freq_mem);
338 } 340 }
@@ -370,7 +372,7 @@ static int pxa_set_target(struct cpufreq_policy *policy,
3703: nop \n\ 3723: nop \n\
371 " 373 "
372 : "=&r" (unused) 374 : "=&r" (unused)
373 : "r" (&MDREFR), "r" (cclkcfg), 375 : "r" (MDREFR), "r" (cclkcfg),
374 "r" (preset_mdrefr), "r" (postset_mdrefr) 376 "r" (preset_mdrefr), "r" (postset_mdrefr)
375 : "r4", "r5"); 377 : "r4", "r5");
376 local_irq_restore(flags); 378 local_irq_restore(flags);
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c
index 57cacaff194d..a305424a967d 100644
--- a/arch/arm/mach-pxa/csb726.c
+++ b/arch/arm/mach-pxa/csb726.c
@@ -27,6 +27,7 @@
27#include <mach/ohci.h> 27#include <mach/ohci.h>
28#include <mach/pxa2xx-regs.h> 28#include <mach/pxa2xx-regs.h>
29#include <mach/audio.h> 29#include <mach/audio.h>
30#include <mach/smemc.h>
30 31
31#include "generic.h" 32#include "generic.h"
32#include "devices.h" 33#include "devices.h"
@@ -255,9 +256,9 @@ static struct platform_device *devices[] __initdata = {
255static void __init csb726_init(void) 256static void __init csb726_init(void)
256{ 257{
257 pxa2xx_mfp_config(ARRAY_AND_SIZE(csb726_pin_config)); 258 pxa2xx_mfp_config(ARRAY_AND_SIZE(csb726_pin_config));
258/* MSC1 = 0x7ffc3ffc; *//* LAN9215/EXP_CS */ 259/* __raw_writel(0x7ffc3ffc, MSC1); *//* LAN9215/EXP_CS */
259/* MSC2 = 0x06697ff4; *//* none/SM501 */ 260/* __raw_writel(0x06697ff4, MSC2); *//* none/SM501 */
260 MSC2 = (MSC2 & ~0xffff) | 0x7ff4; /* SM501 */ 261 __raw_writel((__raw_readl(MSC2) & ~0xffff) | 0x7ff4, MSC2); /* SM501 */
261 262
262 pxa_set_ffuart_info(NULL); 263 pxa_set_ffuart_info(NULL);
263 pxa_set_btuart_info(NULL); 264 pxa_set_btuart_info(NULL);
@@ -273,7 +274,7 @@ static void __init csb726_init(void)
273 274
274MACHINE_START(CSB726, "Cogent CSB726") 275MACHINE_START(CSB726, "Cogent CSB726")
275 .boot_params = 0xa0000100, 276 .boot_params = 0xa0000100,
276 .map_io = pxa_map_io, 277 .map_io = pxa27x_map_io,
277 .init_irq = pxa27x_init_irq, 278 .init_irq = pxa27x_init_irq,
278 .init_machine = csb726_init, 279 .init_machine = csb726_init,
279 .timer = &pxa_timer, 280 .timer = &pxa_timer,
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index aaa1166df964..022c2fa4af04 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -342,27 +342,6 @@ struct platform_device pxa27x_device_i2c_power = {
342}; 342};
343#endif 343#endif
344 344
345#ifdef CONFIG_PXA3xx
346static struct resource pxa3xx_resources_i2c_power[] = {
347 {
348 .start = 0x40f500c0,
349 .end = 0x40f500d3,
350 .flags = IORESOURCE_MEM,
351 }, {
352 .start = IRQ_PWRI2C,
353 .end = IRQ_PWRI2C,
354 .flags = IORESOURCE_IRQ,
355 },
356};
357
358struct platform_device pxa3xx_device_i2c_power = {
359 .name = "pxa3xx-pwri2c",
360 .id = 1,
361 .resource = pxa3xx_resources_i2c_power,
362 .num_resources = ARRAY_SIZE(pxa3xx_resources_i2c_power),
363};
364#endif
365
366static struct resource pxai2s_resources[] = { 345static struct resource pxai2s_resources[] = {
367 { 346 {
368 .start = 0x40400000, 347 .start = 0x40400000,
@@ -633,30 +612,35 @@ struct platform_device pxa25x_device_assp = {
633#endif /* CONFIG_PXA25x */ 612#endif /* CONFIG_PXA25x */
634 613
635#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) 614#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
636 615static struct resource pxa27x_resource_camera[] = {
637static struct resource pxa27x_resource_keypad[] = {
638 [0] = { 616 [0] = {
639 .start = 0x41500000, 617 .start = 0x50000000,
640 .end = 0x4150004c, 618 .end = 0x50000fff,
641 .flags = IORESOURCE_MEM, 619 .flags = IORESOURCE_MEM,
642 }, 620 },
643 [1] = { 621 [1] = {
644 .start = IRQ_KEYPAD, 622 .start = IRQ_CAMERA,
645 .end = IRQ_KEYPAD, 623 .end = IRQ_CAMERA,
646 .flags = IORESOURCE_IRQ, 624 .flags = IORESOURCE_IRQ,
647 }, 625 },
648}; 626};
649 627
650struct platform_device pxa27x_device_keypad = { 628static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32);
651 .name = "pxa27x-keypad", 629
652 .id = -1, 630static struct platform_device pxa27x_device_camera = {
653 .resource = pxa27x_resource_keypad, 631 .name = "pxa27x-camera",
654 .num_resources = ARRAY_SIZE(pxa27x_resource_keypad), 632 .id = 0, /* This is used to put cameras on this interface */
633 .dev = {
634 .dma_mask = &pxa27x_dma_mask_camera,
635 .coherent_dma_mask = 0xffffffff,
636 },
637 .num_resources = ARRAY_SIZE(pxa27x_resource_camera),
638 .resource = pxa27x_resource_camera,
655}; 639};
656 640
657void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info) 641void __init pxa_set_camera_info(struct pxacamera_platform_data *info)
658{ 642{
659 pxa_register_device(&pxa27x_device_keypad, info); 643 pxa_register_device(&pxa27x_device_camera, info);
660} 644}
661 645
662static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32); 646static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32);
@@ -689,6 +673,33 @@ void __init pxa_set_ohci_info(struct pxaohci_platform_data *info)
689{ 673{
690 pxa_register_device(&pxa27x_device_ohci, info); 674 pxa_register_device(&pxa27x_device_ohci, info);
691} 675}
676#endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
677
678#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x)
679static struct resource pxa27x_resource_keypad[] = {
680 [0] = {
681 .start = 0x41500000,
682 .end = 0x4150004c,
683 .flags = IORESOURCE_MEM,
684 },
685 [1] = {
686 .start = IRQ_KEYPAD,
687 .end = IRQ_KEYPAD,
688 .flags = IORESOURCE_IRQ,
689 },
690};
691
692struct platform_device pxa27x_device_keypad = {
693 .name = "pxa27x-keypad",
694 .id = -1,
695 .resource = pxa27x_resource_keypad,
696 .num_resources = ARRAY_SIZE(pxa27x_resource_keypad),
697};
698
699void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info)
700{
701 pxa_register_device(&pxa27x_device_keypad, info);
702}
692 703
693static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32); 704static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32);
694 705
@@ -833,79 +844,9 @@ struct platform_device pxa27x_device_pwm1 = {
833 .resource = pxa27x_resource_pwm1, 844 .resource = pxa27x_resource_pwm1,
834 .num_resources = ARRAY_SIZE(pxa27x_resource_pwm1), 845 .num_resources = ARRAY_SIZE(pxa27x_resource_pwm1),
835}; 846};
836 847#endif /* CONFIG_PXA27x || CONFIG_PXA3xx || CONFIG_PXA95x*/
837static struct resource pxa27x_resource_camera[] = {
838 [0] = {
839 .start = 0x50000000,
840 .end = 0x50000fff,
841 .flags = IORESOURCE_MEM,
842 },
843 [1] = {
844 .start = IRQ_CAMERA,
845 .end = IRQ_CAMERA,
846 .flags = IORESOURCE_IRQ,
847 },
848};
849
850static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32);
851
852static struct platform_device pxa27x_device_camera = {
853 .name = "pxa27x-camera",
854 .id = 0, /* This is used to put cameras on this interface */
855 .dev = {
856 .dma_mask = &pxa27x_dma_mask_camera,
857 .coherent_dma_mask = 0xffffffff,
858 },
859 .num_resources = ARRAY_SIZE(pxa27x_resource_camera),
860 .resource = pxa27x_resource_camera,
861};
862
863void __init pxa_set_camera_info(struct pxacamera_platform_data *info)
864{
865 pxa_register_device(&pxa27x_device_camera, info);
866}
867#endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
868 848
869#ifdef CONFIG_PXA3xx 849#ifdef CONFIG_PXA3xx
870static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32);
871
872static struct resource pxa3xx_resource_ssp4[] = {
873 [0] = {
874 .start = 0x41a00000,
875 .end = 0x41a0003f,
876 .flags = IORESOURCE_MEM,
877 },
878 [1] = {
879 .start = IRQ_SSP4,
880 .end = IRQ_SSP4,
881 .flags = IORESOURCE_IRQ,
882 },
883 [2] = {
884 /* DRCMR for RX */
885 .start = 2,
886 .end = 2,
887 .flags = IORESOURCE_DMA,
888 },
889 [3] = {
890 /* DRCMR for TX */
891 .start = 3,
892 .end = 3,
893 .flags = IORESOURCE_DMA,
894 },
895};
896
897struct platform_device pxa3xx_device_ssp4 = {
898 /* PXA3xx SSP is basically equivalent to PXA27x */
899 .name = "pxa27x-ssp",
900 .id = 3,
901 .dev = {
902 .dma_mask = &pxa3xx_ssp4_dma_mask,
903 .coherent_dma_mask = DMA_BIT_MASK(32),
904 },
905 .resource = pxa3xx_resource_ssp4,
906 .num_resources = ARRAY_SIZE(pxa3xx_resource_ssp4),
907};
908
909static struct resource pxa3xx_resources_mci2[] = { 850static struct resource pxa3xx_resources_mci2[] = {
910 [0] = { 851 [0] = {
911 .start = 0x42000000, 852 .start = 0x42000000,
@@ -984,6 +925,54 @@ void __init pxa3xx_set_mci3_info(struct pxamci_platform_data *info)
984 pxa_register_device(&pxa3xx_device_mci3, info); 925 pxa_register_device(&pxa3xx_device_mci3, info);
985} 926}
986 927
928static struct resource pxa3xx_resources_gcu[] = {
929 {
930 .start = 0x54000000,
931 .end = 0x54000fff,
932 .flags = IORESOURCE_MEM,
933 },
934 {
935 .start = IRQ_GCU,
936 .end = IRQ_GCU,
937 .flags = IORESOURCE_IRQ,
938 },
939};
940
941static u64 pxa3xx_gcu_dmamask = DMA_BIT_MASK(32);
942
943struct platform_device pxa3xx_device_gcu = {
944 .name = "pxa3xx-gcu",
945 .id = -1,
946 .num_resources = ARRAY_SIZE(pxa3xx_resources_gcu),
947 .resource = pxa3xx_resources_gcu,
948 .dev = {
949 .dma_mask = &pxa3xx_gcu_dmamask,
950 .coherent_dma_mask = 0xffffffff,
951 },
952};
953
954#endif /* CONFIG_PXA3xx */
955
956#if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x)
957static struct resource pxa3xx_resources_i2c_power[] = {
958 {
959 .start = 0x40f500c0,
960 .end = 0x40f500d3,
961 .flags = IORESOURCE_MEM,
962 }, {
963 .start = IRQ_PWRI2C,
964 .end = IRQ_PWRI2C,
965 .flags = IORESOURCE_IRQ,
966 },
967};
968
969struct platform_device pxa3xx_device_i2c_power = {
970 .name = "pxa3xx-pwri2c",
971 .id = 1,
972 .resource = pxa3xx_resources_i2c_power,
973 .num_resources = ARRAY_SIZE(pxa3xx_resources_i2c_power),
974};
975
987static struct resource pxa3xx_resources_nand[] = { 976static struct resource pxa3xx_resources_nand[] = {
988 [0] = { 977 [0] = {
989 .start = 0x43100000, 978 .start = 0x43100000,
@@ -1027,33 +1016,45 @@ void __init pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info)
1027 pxa_register_device(&pxa3xx_device_nand, info); 1016 pxa_register_device(&pxa3xx_device_nand, info);
1028} 1017}
1029 1018
1030static struct resource pxa3xx_resources_gcu[] = { 1019static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32);
1031 { 1020
1032 .start = 0x54000000, 1021static struct resource pxa3xx_resource_ssp4[] = {
1033 .end = 0x54000fff, 1022 [0] = {
1023 .start = 0x41a00000,
1024 .end = 0x41a0003f,
1034 .flags = IORESOURCE_MEM, 1025 .flags = IORESOURCE_MEM,
1035 }, 1026 },
1036 { 1027 [1] = {
1037 .start = IRQ_GCU, 1028 .start = IRQ_SSP4,
1038 .end = IRQ_GCU, 1029 .end = IRQ_SSP4,
1039 .flags = IORESOURCE_IRQ, 1030 .flags = IORESOURCE_IRQ,
1040 }, 1031 },
1032 [2] = {
1033 /* DRCMR for RX */
1034 .start = 2,
1035 .end = 2,
1036 .flags = IORESOURCE_DMA,
1037 },
1038 [3] = {
1039 /* DRCMR for TX */
1040 .start = 3,
1041 .end = 3,
1042 .flags = IORESOURCE_DMA,
1043 },
1041}; 1044};
1042 1045
1043static u64 pxa3xx_gcu_dmamask = DMA_BIT_MASK(32); 1046struct platform_device pxa3xx_device_ssp4 = {
1044 1047 /* PXA3xx SSP is basically equivalent to PXA27x */
1045struct platform_device pxa3xx_device_gcu = { 1048 .name = "pxa27x-ssp",
1046 .name = "pxa3xx-gcu", 1049 .id = 3,
1047 .id = -1,
1048 .num_resources = ARRAY_SIZE(pxa3xx_resources_gcu),
1049 .resource = pxa3xx_resources_gcu,
1050 .dev = { 1050 .dev = {
1051 .dma_mask = &pxa3xx_gcu_dmamask, 1051 .dma_mask = &pxa3xx_ssp4_dma_mask,
1052 .coherent_dma_mask = 0xffffffff, 1052 .coherent_dma_mask = DMA_BIT_MASK(32),
1053 }, 1053 },
1054 .resource = pxa3xx_resource_ssp4,
1055 .num_resources = ARRAY_SIZE(pxa3xx_resource_ssp4),
1054}; 1056};
1055 1057#endif /* CONFIG_PXA3xx || CONFIG_PXA95x */
1056#endif /* CONFIG_PXA3xx */
1057 1058
1058/* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1. 1059/* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1.
1059 * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */ 1060 * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index ed0dbfdb22ed..4cefd1d18afd 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -1300,7 +1300,7 @@ static void __init em_x270_init(void)
1300 1300
1301MACHINE_START(EM_X270, "Compulab EM-X270") 1301MACHINE_START(EM_X270, "Compulab EM-X270")
1302 .boot_params = 0xa0000100, 1302 .boot_params = 0xa0000100,
1303 .map_io = pxa_map_io, 1303 .map_io = pxa27x_map_io,
1304 .init_irq = pxa27x_init_irq, 1304 .init_irq = pxa27x_init_irq,
1305 .timer = &pxa_timer, 1305 .timer = &pxa_timer,
1306 .init_machine = em_x270_init, 1306 .init_machine = em_x270_init,
@@ -1308,7 +1308,7 @@ MACHINE_END
1308 1308
1309MACHINE_START(EXEDA, "Compulab eXeda") 1309MACHINE_START(EXEDA, "Compulab eXeda")
1310 .boot_params = 0xa0000100, 1310 .boot_params = 0xa0000100,
1311 .map_io = pxa_map_io, 1311 .map_io = pxa27x_map_io,
1312 .init_irq = pxa27x_init_irq, 1312 .init_irq = pxa27x_init_irq,
1313 .timer = &pxa_timer, 1313 .timer = &pxa_timer,
1314 .init_machine = em_x270_init, 1314 .init_machine = em_x270_init,
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c
index b25690ccadc4..edca0a043293 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -181,7 +181,7 @@ static void __init e330_init(void)
181MACHINE_START(E330, "Toshiba e330") 181MACHINE_START(E330, "Toshiba e330")
182 /* Maintainer: Ian Molton (spyro@f2s.com) */ 182 /* Maintainer: Ian Molton (spyro@f2s.com) */
183 .boot_params = 0xa0000100, 183 .boot_params = 0xa0000100,
184 .map_io = pxa_map_io, 184 .map_io = pxa25x_map_io,
185 .nr_irqs = ESERIES_NR_IRQS, 185 .nr_irqs = ESERIES_NR_IRQS,
186 .init_irq = pxa25x_init_irq, 186 .init_irq = pxa25x_init_irq,
187 .fixup = eseries_fixup, 187 .fixup = eseries_fixup,
@@ -230,7 +230,7 @@ static void __init e350_init(void)
230MACHINE_START(E350, "Toshiba e350") 230MACHINE_START(E350, "Toshiba e350")
231 /* Maintainer: Ian Molton (spyro@f2s.com) */ 231 /* Maintainer: Ian Molton (spyro@f2s.com) */
232 .boot_params = 0xa0000100, 232 .boot_params = 0xa0000100,
233 .map_io = pxa_map_io, 233 .map_io = pxa25x_map_io,
234 .nr_irqs = ESERIES_NR_IRQS, 234 .nr_irqs = ESERIES_NR_IRQS,
235 .init_irq = pxa25x_init_irq, 235 .init_irq = pxa25x_init_irq,
236 .fixup = eseries_fixup, 236 .fixup = eseries_fixup,
@@ -352,7 +352,7 @@ static void __init e400_init(void)
352MACHINE_START(E400, "Toshiba e400") 352MACHINE_START(E400, "Toshiba e400")
353 /* Maintainer: Ian Molton (spyro@f2s.com) */ 353 /* Maintainer: Ian Molton (spyro@f2s.com) */
354 .boot_params = 0xa0000100, 354 .boot_params = 0xa0000100,
355 .map_io = pxa_map_io, 355 .map_io = pxa25x_map_io,
356 .nr_irqs = ESERIES_NR_IRQS, 356 .nr_irqs = ESERIES_NR_IRQS,
357 .init_irq = pxa25x_init_irq, 357 .init_irq = pxa25x_init_irq,
358 .fixup = eseries_fixup, 358 .fixup = eseries_fixup,
@@ -540,7 +540,7 @@ static void __init e740_init(void)
540MACHINE_START(E740, "Toshiba e740") 540MACHINE_START(E740, "Toshiba e740")
541 /* Maintainer: Ian Molton (spyro@f2s.com) */ 541 /* Maintainer: Ian Molton (spyro@f2s.com) */
542 .boot_params = 0xa0000100, 542 .boot_params = 0xa0000100,
543 .map_io = pxa_map_io, 543 .map_io = pxa25x_map_io,
544 .nr_irqs = ESERIES_NR_IRQS, 544 .nr_irqs = ESERIES_NR_IRQS,
545 .init_irq = pxa25x_init_irq, 545 .init_irq = pxa25x_init_irq,
546 .fixup = eseries_fixup, 546 .fixup = eseries_fixup,
@@ -731,7 +731,7 @@ static void __init e750_init(void)
731MACHINE_START(E750, "Toshiba e750") 731MACHINE_START(E750, "Toshiba e750")
732 /* Maintainer: Ian Molton (spyro@f2s.com) */ 732 /* Maintainer: Ian Molton (spyro@f2s.com) */
733 .boot_params = 0xa0000100, 733 .boot_params = 0xa0000100,
734 .map_io = pxa_map_io, 734 .map_io = pxa25x_map_io,
735 .nr_irqs = ESERIES_NR_IRQS, 735 .nr_irqs = ESERIES_NR_IRQS,
736 .init_irq = pxa25x_init_irq, 736 .init_irq = pxa25x_init_irq,
737 .fixup = eseries_fixup, 737 .fixup = eseries_fixup,
@@ -926,7 +926,7 @@ static void __init e800_init(void)
926MACHINE_START(E800, "Toshiba e800") 926MACHINE_START(E800, "Toshiba e800")
927 /* Maintainer: Ian Molton (spyro@f2s.com) */ 927 /* Maintainer: Ian Molton (spyro@f2s.com) */
928 .boot_params = 0xa0000100, 928 .boot_params = 0xa0000100,
929 .map_io = pxa_map_io, 929 .map_io = pxa25x_map_io,
930 .nr_irqs = ESERIES_NR_IRQS, 930 .nr_irqs = ESERIES_NR_IRQS,
931 .init_irq = pxa25x_init_irq, 931 .init_irq = pxa25x_init_irq,
932 .fixup = eseries_fixup, 932 .fixup = eseries_fixup,
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 142c711f4cda..87cec0abe5b0 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -798,7 +798,7 @@ static void __init a780_init(void)
798 798
799MACHINE_START(EZX_A780, "Motorola EZX A780") 799MACHINE_START(EZX_A780, "Motorola EZX A780")
800 .boot_params = 0xa0000100, 800 .boot_params = 0xa0000100,
801 .map_io = pxa_map_io, 801 .map_io = pxa27x_map_io,
802 .nr_irqs = EZX_NR_IRQS, 802 .nr_irqs = EZX_NR_IRQS,
803 .init_irq = pxa27x_init_irq, 803 .init_irq = pxa27x_init_irq,
804 .timer = &pxa_timer, 804 .timer = &pxa_timer,
@@ -863,7 +863,7 @@ static void __init e680_init(void)
863 863
864MACHINE_START(EZX_E680, "Motorola EZX E680") 864MACHINE_START(EZX_E680, "Motorola EZX E680")
865 .boot_params = 0xa0000100, 865 .boot_params = 0xa0000100,
866 .map_io = pxa_map_io, 866 .map_io = pxa27x_map_io,
867 .nr_irqs = EZX_NR_IRQS, 867 .nr_irqs = EZX_NR_IRQS,
868 .init_irq = pxa27x_init_irq, 868 .init_irq = pxa27x_init_irq,
869 .timer = &pxa_timer, 869 .timer = &pxa_timer,
@@ -928,7 +928,7 @@ static void __init a1200_init(void)
928 928
929MACHINE_START(EZX_A1200, "Motorola EZX A1200") 929MACHINE_START(EZX_A1200, "Motorola EZX A1200")
930 .boot_params = 0xa0000100, 930 .boot_params = 0xa0000100,
931 .map_io = pxa_map_io, 931 .map_io = pxa27x_map_io,
932 .nr_irqs = EZX_NR_IRQS, 932 .nr_irqs = EZX_NR_IRQS,
933 .init_irq = pxa27x_init_irq, 933 .init_irq = pxa27x_init_irq,
934 .timer = &pxa_timer, 934 .timer = &pxa_timer,
@@ -1118,7 +1118,7 @@ static void __init a910_init(void)
1118 1118
1119MACHINE_START(EZX_A910, "Motorola EZX A910") 1119MACHINE_START(EZX_A910, "Motorola EZX A910")
1120 .boot_params = 0xa0000100, 1120 .boot_params = 0xa0000100,
1121 .map_io = pxa_map_io, 1121 .map_io = pxa27x_map_io,
1122 .nr_irqs = EZX_NR_IRQS, 1122 .nr_irqs = EZX_NR_IRQS,
1123 .init_irq = pxa27x_init_irq, 1123 .init_irq = pxa27x_init_irq,
1124 .timer = &pxa_timer, 1124 .timer = &pxa_timer,
@@ -1183,7 +1183,7 @@ static void __init e6_init(void)
1183 1183
1184MACHINE_START(EZX_E6, "Motorola EZX E6") 1184MACHINE_START(EZX_E6, "Motorola EZX E6")
1185 .boot_params = 0xa0000100, 1185 .boot_params = 0xa0000100,
1186 .map_io = pxa_map_io, 1186 .map_io = pxa27x_map_io,
1187 .nr_irqs = EZX_NR_IRQS, 1187 .nr_irqs = EZX_NR_IRQS,
1188 .init_irq = pxa27x_init_irq, 1188 .init_irq = pxa27x_init_irq,
1189 .timer = &pxa_timer, 1189 .timer = &pxa_timer,
@@ -1222,7 +1222,7 @@ static void __init e2_init(void)
1222 1222
1223MACHINE_START(EZX_E2, "Motorola EZX E2") 1223MACHINE_START(EZX_E2, "Motorola EZX E2")
1224 .boot_params = 0xa0000100, 1224 .boot_params = 0xa0000100,
1225 .map_io = pxa_map_io, 1225 .map_io = pxa27x_map_io,
1226 .nr_irqs = EZX_NR_IRQS, 1226 .nr_irqs = EZX_NR_IRQS,
1227 .init_irq = pxa27x_init_irq, 1227 .init_irq = pxa27x_init_irq,
1228 .timer = &pxa_timer, 1228 .timer = &pxa_timer,
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 6451e9c3a93f..d6e15f71fc09 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -28,6 +28,8 @@
28 28
29#include <mach/reset.h> 29#include <mach/reset.h>
30#include <mach/gpio.h> 30#include <mach/gpio.h>
31#include <mach/smemc.h>
32#include <mach/pxa3xx-regs.h>
31 33
32#include "generic.h" 34#include "generic.h"
33 35
@@ -35,9 +37,10 @@ void clear_reset_status(unsigned int mask)
35{ 37{
36 if (cpu_is_pxa2xx()) 38 if (cpu_is_pxa2xx())
37 pxa2xx_clear_reset_status(mask); 39 pxa2xx_clear_reset_status(mask);
38 40 else {
39 if (cpu_is_pxa3xx()) 41 /* RESET_STATUS_* has a 1:1 mapping with ARSR */
40 pxa3xx_clear_reset_status(mask); 42 ARSR = mask;
43 }
41} 44}
42 45
43unsigned long get_clock_tick_rate(void) 46unsigned long get_clock_tick_rate(void)
@@ -71,47 +74,17 @@ unsigned int get_clk_frequency_khz(int info)
71EXPORT_SYMBOL(get_clk_frequency_khz); 74EXPORT_SYMBOL(get_clk_frequency_khz);
72 75
73/* 76/*
74 * Return the current memory clock frequency in units of 10kHz
75 */
76unsigned int get_memclk_frequency_10khz(void)
77{
78 if (cpu_is_pxa25x())
79 return pxa25x_get_memclk_frequency_10khz();
80 else if (cpu_is_pxa27x())
81 return pxa27x_get_memclk_frequency_10khz();
82 return 0;
83}
84EXPORT_SYMBOL(get_memclk_frequency_10khz);
85
86/*
87 * Intel PXA2xx internal register mapping. 77 * Intel PXA2xx internal register mapping.
88 * 78 *
89 * Note 1: not all PXA2xx variants implement all those addresses. 79 * Note: virtual 0xfffe0000-0xffffffff is reserved for the vector table
90 * 80 * and cache flush area.
91 * Note 2: virtual 0xfffe0000-0xffffffff is reserved for the vector table
92 * and cache flush area.
93 */ 81 */
94static struct map_desc standard_io_desc[] __initdata = { 82static struct map_desc common_io_desc[] __initdata = {
95 { /* Devs */ 83 { /* Devs */
96 .virtual = 0xf2000000, 84 .virtual = 0xf2000000,
97 .pfn = __phys_to_pfn(0x40000000), 85 .pfn = __phys_to_pfn(0x40000000),
98 .length = 0x02000000, 86 .length = 0x02000000,
99 .type = MT_DEVICE 87 .type = MT_DEVICE
100 }, { /* Mem Ctl */
101 .virtual = 0xf6000000,
102 .pfn = __phys_to_pfn(0x48000000),
103 .length = 0x00200000,
104 .type = MT_DEVICE
105 }, { /* Camera */
106 .virtual = 0xfa000000,
107 .pfn = __phys_to_pfn(0x50000000),
108 .length = 0x00100000,
109 .type = MT_DEVICE
110 }, { /* IMem ctl */
111 .virtual = 0xfe000000,
112 .pfn = __phys_to_pfn(0x58000000),
113 .length = 0x00100000,
114 .type = MT_DEVICE
115 }, { /* UNCACHED_PHYS_0 */ 88 }, { /* UNCACHED_PHYS_0 */
116 .virtual = 0xff000000, 89 .virtual = 0xff000000,
117 .pfn = __phys_to_pfn(0x00000000), 90 .pfn = __phys_to_pfn(0x00000000),
@@ -122,6 +95,5 @@ static struct map_desc standard_io_desc[] __initdata = {
122 95
123void __init pxa_map_io(void) 96void __init pxa_map_io(void)
124{ 97{
125 iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc)); 98 iotable_init(ARRAY_AND_SIZE(common_io_desc));
126 get_clk_frequency_khz(1);
127} 99}
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h
index 4b1ad2769ed7..6205dc9a2b9d 100644
--- a/arch/arm/mach-pxa/generic.h
+++ b/arch/arm/mach-pxa/generic.h
@@ -20,7 +20,12 @@ extern void __init pxa26x_init_irq(void);
20#endif 20#endif
21extern void __init pxa27x_init_irq(void); 21extern void __init pxa27x_init_irq(void);
22extern void __init pxa3xx_init_irq(void); 22extern void __init pxa3xx_init_irq(void);
23extern void __init pxa95x_init_irq(void);
24
23extern void __init pxa_map_io(void); 25extern void __init pxa_map_io(void);
26extern void __init pxa25x_map_io(void);
27extern void __init pxa27x_map_io(void);
28extern void __init pxa3xx_map_io(void);
24 29
25extern unsigned int get_clk_frequency_khz(int info); 30extern unsigned int get_clk_frequency_khz(int info);
26 31
@@ -32,18 +37,14 @@ extern unsigned int get_clk_frequency_khz(int info);
32 37
33#ifdef CONFIG_PXA25x 38#ifdef CONFIG_PXA25x
34extern unsigned pxa25x_get_clk_frequency_khz(int); 39extern unsigned pxa25x_get_clk_frequency_khz(int);
35extern unsigned pxa25x_get_memclk_frequency_10khz(void);
36#else 40#else
37#define pxa25x_get_clk_frequency_khz(x) (0) 41#define pxa25x_get_clk_frequency_khz(x) (0)
38#define pxa25x_get_memclk_frequency_10khz() (0)
39#endif 42#endif
40 43
41#ifdef CONFIG_PXA27x 44#ifdef CONFIG_PXA27x
42extern unsigned pxa27x_get_clk_frequency_khz(int); 45extern unsigned pxa27x_get_clk_frequency_khz(int);
43extern unsigned pxa27x_get_memclk_frequency_10khz(void);
44#else 46#else
45#define pxa27x_get_clk_frequency_khz(x) (0) 47#define pxa27x_get_clk_frequency_khz(x) (0)
46#define pxa27x_get_memclk_frequency_10khz() (0)
47#endif 48#endif
48 49
49#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) 50#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)
@@ -54,10 +55,8 @@ static inline void pxa2xx_clear_reset_status(unsigned int mask) {}
54 55
55#ifdef CONFIG_PXA3xx 56#ifdef CONFIG_PXA3xx
56extern unsigned pxa3xx_get_clk_frequency_khz(int); 57extern unsigned pxa3xx_get_clk_frequency_khz(int);
57extern void pxa3xx_clear_reset_status(unsigned int);
58#else 58#else
59#define pxa3xx_get_clk_frequency_khz(x) (0) 59#define pxa3xx_get_clk_frequency_khz(x) (0)
60static inline void pxa3xx_clear_reset_status(unsigned int mask) {}
61#endif 60#endif
62 61
63extern struct sysdev_class pxa_irq_sysclass; 62extern struct sysdev_class pxa_irq_sysclass;
diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c
index 1e2a9a13aec1..6fd319ea5284 100644
--- a/arch/arm/mach-pxa/gumstix.c
+++ b/arch/arm/mach-pxa/gumstix.c
@@ -225,7 +225,7 @@ static void __init gumstix_init(void)
225 225
226MACHINE_START(GUMSTIX, "Gumstix") 226MACHINE_START(GUMSTIX, "Gumstix")
227 .boot_params = 0xa0000100, /* match u-boot bi_boot_params */ 227 .boot_params = 0xa0000100, /* match u-boot bi_boot_params */
228 .map_io = pxa_map_io, 228 .map_io = pxa25x_map_io,
229 .init_irq = pxa25x_init_irq, 229 .init_irq = pxa25x_init_irq,
230 .timer = &pxa_timer, 230 .timer = &pxa_timer,
231 .init_machine = gumstix_init, 231 .init_machine = gumstix_init,
diff --git a/arch/arm/mach-pxa/h5000.c b/arch/arm/mach-pxa/h5000.c
index 7057a1f46db4..657db469de1f 100644
--- a/arch/arm/mach-pxa/h5000.c
+++ b/arch/arm/mach-pxa/h5000.c
@@ -32,6 +32,7 @@
32#include <mach/pxa25x.h> 32#include <mach/pxa25x.h>
33#include <mach/h5000.h> 33#include <mach/h5000.h>
34#include <mach/udc.h> 34#include <mach/udc.h>
35#include <mach/smemc.h>
35 36
36#include "generic.h" 37#include "generic.h"
37 38
@@ -172,11 +173,11 @@ static unsigned long h5000_pin_config[] __initdata = {
172 173
173static void fix_msc(void) 174static void fix_msc(void)
174{ 175{
175 MSC0 = 0x129c24f2; 176 __raw_writel(0x129c24f2, MSC0);
176 MSC1 = 0x7ff424fa; 177 __raw_writel(0x7ff424fa, MSC1);
177 MSC2 = 0x7ff47ff4; 178 __raw_writel(0x7ff47ff4, MSC2);
178 179
179 MDREFR |= 0x02080000; 180 __raw_writel(__raw_readl(MDREFR) | 0x02080000, MDREFR);
180} 181}
181 182
182/* 183/*
@@ -202,7 +203,7 @@ static void __init h5000_init(void)
202 203
203MACHINE_START(H5400, "HP iPAQ H5000") 204MACHINE_START(H5400, "HP iPAQ H5000")
204 .boot_params = 0xa0000100, 205 .boot_params = 0xa0000100,
205 .map_io = pxa_map_io, 206 .map_io = pxa25x_map_io,
206 .init_irq = pxa25x_init_irq, 207 .init_irq = pxa25x_init_irq,
207 .timer = &pxa_timer, 208 .timer = &pxa_timer,
208 .init_machine = h5000_init, 209 .init_machine = h5000_init,
diff --git a/arch/arm/mach-pxa/himalaya.c b/arch/arm/mach-pxa/himalaya.c
index 01b7f07ebad2..e8603eba54bd 100644
--- a/arch/arm/mach-pxa/himalaya.c
+++ b/arch/arm/mach-pxa/himalaya.c
@@ -160,7 +160,7 @@ static void __init himalaya_init(void)
160 160
161MACHINE_START(HIMALAYA, "HTC Himalaya") 161MACHINE_START(HIMALAYA, "HTC Himalaya")
162 .boot_params = 0xa0000100, 162 .boot_params = 0xa0000100,
163 .map_io = pxa_map_io, 163 .map_io = pxa25x_map_io,
164 .init_irq = pxa25x_init_irq, 164 .init_irq = pxa25x_init_irq,
165 .init_machine = himalaya_init, 165 .init_machine = himalaya_init,
166 .timer = &pxa_timer, 166 .timer = &pxa_timer,
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index 76d93a25bab6..cacb21b7014d 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -871,7 +871,7 @@ static void __init hx4700_init(void)
871 871
872MACHINE_START(H4700, "HP iPAQ HX4700") 872MACHINE_START(H4700, "HP iPAQ HX4700")
873 .boot_params = 0xa0000100, 873 .boot_params = 0xa0000100,
874 .map_io = pxa_map_io, 874 .map_io = pxa27x_map_io,
875 .nr_irqs = HX4700_NR_IRQS, 875 .nr_irqs = HX4700_NR_IRQS,
876 .init_irq = pxa27x_init_irq, 876 .init_irq = pxa27x_init_irq,
877 .init_machine = hx4700_init, 877 .init_machine = hx4700_init,
diff --git a/arch/arm/mach-pxa/icontrol.c b/arch/arm/mach-pxa/icontrol.c
index d51ee3d25e70..ac6ee12e400e 100644
--- a/arch/arm/mach-pxa/icontrol.c
+++ b/arch/arm/mach-pxa/icontrol.c
@@ -192,7 +192,7 @@ static void __init icontrol_init(void)
192 192
193MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM") 193MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM")
194 .boot_params = 0xa0000100, 194 .boot_params = 0xa0000100,
195 .map_io = pxa_map_io, 195 .map_io = pxa3xx_map_io,
196 .init_irq = pxa3xx_init_irq, 196 .init_irq = pxa3xx_init_irq,
197 .timer = &pxa_timer, 197 .timer = &pxa_timer,
198 .init_machine = icontrol_init 198 .init_machine = icontrol_init
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c
index e773dceeabc6..dd40e4a9291c 100644
--- a/arch/arm/mach-pxa/idp.c
+++ b/arch/arm/mach-pxa/idp.c
@@ -187,7 +187,7 @@ static struct map_desc idp_io_desc[] __initdata = {
187 187
188static void __init idp_map_io(void) 188static void __init idp_map_io(void)
189{ 189{
190 pxa_map_io(); 190 pxa25x_map_io();
191 iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc)); 191 iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc));
192} 192}
193 193
diff --git a/arch/arm/mach-pxa/include/mach/addr-map.h b/arch/arm/mach-pxa/include/mach/addr-map.h
new file mode 100644
index 000000000000..f4c03659168c
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/addr-map.h
@@ -0,0 +1,48 @@
1#ifndef __ASM_MACH_ADDR_MAP_H
2#define __ASM_MACH_ADDR_MAP_H
3
4/*
5 * Chip Selects
6 */
7#define PXA_CS0_PHYS 0x00000000
8#define PXA_CS1_PHYS 0x04000000
9#define PXA_CS2_PHYS 0x08000000
10#define PXA_CS3_PHYS 0x0C000000
11#define PXA_CS4_PHYS 0x10000000
12#define PXA_CS5_PHYS 0x14000000
13
14#define PXA300_CS0_PHYS 0x00000000 /* PXA300/PXA310 _only_ */
15#define PXA300_CS1_PHYS 0x30000000 /* PXA300/PXA310 _only_ */
16#define PXA3xx_CS2_PHYS 0x10000000
17#define PXA3xx_CS3_PHYS 0x14000000
18
19/*
20 * Peripheral Bus
21 */
22#define PERIPH_PHYS 0x40000000
23#define PERIPH_VIRT 0xf2000000
24#define PERIPH_SIZE 0x02000000
25
26/*
27 * Static Memory Controller (w/ SDRAM controls on PXA25x/PXA27x)
28 */
29#define PXA2XX_SMEMC_PHYS 0x48000000
30#define PXA3XX_SMEMC_PHYS 0x4a000000
31#define SMEMC_VIRT 0xf6000000
32#define SMEMC_SIZE 0x00100000
33
34/*
35 * Dynamic Memory Controller (only on PXA3xx)
36 */
37#define DMEMC_PHYS 0x48100000
38#define DMEMC_VIRT 0xf6100000
39#define DMEMC_SIZE 0x00100000
40
41/*
42 * Internal Memory Controller (PXA27x and later)
43 */
44#define IMEMC_PHYS 0x58000000
45#define IMEMC_VIRT 0xfe000000
46#define IMEMC_SIZE 0x00100000
47
48#endif /* __ASM_MACH_ADDR_MAP_H */
diff --git a/arch/arm/mach-pxa/include/mach/balloon3.h b/arch/arm/mach-pxa/include/mach/balloon3.h
index 561562b4360b..7074e76146c9 100644
--- a/arch/arm/mach-pxa/include/mach/balloon3.h
+++ b/arch/arm/mach-pxa/include/mach/balloon3.h
@@ -26,6 +26,8 @@ enum balloon3_features {
26#define BALLOON3_FPGA_VIRT (0xf1000000) /* as per balloon2 */ 26#define BALLOON3_FPGA_VIRT (0xf1000000) /* as per balloon2 */
27#define BALLOON3_FPGA_LENGTH 0x01000000 27#define BALLOON3_FPGA_LENGTH 0x01000000
28 28
29#define BALLOON3_FPGA_SETnCLR (0x1000)
30
29/* FPGA / CPLD registers for CF socket */ 31/* FPGA / CPLD registers for CF socket */
30#define BALLOON3_CF_STATUS_REG (BALLOON3_FPGA_VIRT + 0x00e00008) 32#define BALLOON3_CF_STATUS_REG (BALLOON3_FPGA_VIRT + 0x00e00008)
31#define BALLOON3_CF_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00008) 33#define BALLOON3_CF_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00008)
@@ -35,7 +37,7 @@ enum balloon3_features {
35#define BALLOON3_NAND_BASE (PXA_CS4_PHYS + 0x00e00000) 37#define BALLOON3_NAND_BASE (PXA_CS4_PHYS + 0x00e00000)
36#define BALLOON3_NAND_IO_REG (BALLOON3_FPGA_VIRT + 0x00e00000) 38#define BALLOON3_NAND_IO_REG (BALLOON3_FPGA_VIRT + 0x00e00000)
37#define BALLOON3_NAND_CONTROL2_REG (BALLOON3_FPGA_VIRT + 0x00e00010) 39#define BALLOON3_NAND_CONTROL2_REG (BALLOON3_FPGA_VIRT + 0x00e00010)
38#define BALLOON3_NAND_STAT_REG (BALLOON3_FPGA_VIRT + 0x00e00010) 40#define BALLOON3_NAND_STAT_REG (BALLOON3_FPGA_VIRT + 0x00e00014)
39#define BALLOON3_NAND_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00014) 41#define BALLOON3_NAND_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00014)
40 42
41/* fpga/cpld interrupt control register */ 43/* fpga/cpld interrupt control register */
@@ -174,7 +176,7 @@ enum balloon3_features {
174#define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ) 176#define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ)
175#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD) 177#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD)
176 178
177#define BALLOON3_NR_IRQS (IRQ_BOARD_START + 4) 179#define BALLOON3_NR_IRQS (IRQ_BOARD_START + 16)
178 180
179extern int balloon3_has(enum balloon3_features feature); 181extern int balloon3_has(enum balloon3_features feature);
180 182
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
index 58dada11054f..388a96f1ef93 100644
--- a/arch/arm/mach-pxa/include/mach/colibri.h
+++ b/arch/arm/mach-pxa/include/mach/colibri.h
@@ -9,14 +9,14 @@
9 */ 9 */
10 10
11enum { 11enum {
12 COLIBRI_PXA270_EVALBOARD = 0, 12 COLIBRI_EVALBOARD = 0,
13 COLIBRI_PXA270_INCOME, 13 COLIBRI_PXA270_INCOME,
14}; 14};
15 15
16#if defined(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD) 16#if defined(CONFIG_MACH_COLIBRI_EVALBOARD)
17extern void colibri_pxa270_evalboard_init(void); 17extern void colibri_evalboard_init(void);
18#else 18#else
19static inline void colibri_pxa270_evalboard_init(void) {} 19static inline void colibri_evalboard_init(void) {}
20#endif 20#endif
21 21
22#if defined(CONFIG_MACH_COLIBRI_PXA270_INCOME) 22#if defined(CONFIG_MACH_COLIBRI_PXA270_INCOME)
@@ -59,5 +59,11 @@ static inline void colibri_pxa3xx_init_nand(void) {}
59#define GPIO0_COLIBRI_PXA270_SD_DETECT 0 59#define GPIO0_COLIBRI_PXA270_SD_DETECT 0
60#define GPIO113_COLIBRI_PXA270_TS_IRQ 113 60#define GPIO113_COLIBRI_PXA270_TS_IRQ 113
61 61
62/* GPIO definitions for Colibri PXA300/310 */
63#define GPIO39_COLIBRI_PXA300_SD_DETECT 39
64
65/* GPIO definitions for Colibri PXA320 */
66#define GPIO28_COLIBRI_PXA320_SD_DETECT 28
67
62#endif /* _COLIBRI_H_ */ 68#endif /* _COLIBRI_H_ */
63 69
diff --git a/arch/arm/mach-pxa/include/mach/hardware.h b/arch/arm/mach-pxa/include/mach/hardware.h
index 814f1458a06a..6957ba56025b 100644
--- a/arch/arm/mach-pxa/include/mach/hardware.h
+++ b/arch/arm/mach-pxa/include/mach/hardware.h
@@ -13,6 +13,8 @@
13#ifndef __ASM_ARCH_HARDWARE_H 13#ifndef __ASM_ARCH_HARDWARE_H
14#define __ASM_ARCH_HARDWARE_H 14#define __ASM_ARCH_HARDWARE_H
15 15
16#include <mach/addr-map.h>
17
16/* 18/*
17 * Workarounds for at least 2 errata so far require this. 19 * Workarounds for at least 2 errata so far require this.
18 * The mapping is set in mach-pxa/generic.c. 20 * The mapping is set in mach-pxa/generic.c.
@@ -193,14 +195,15 @@
193#define __cpu_is_pxa935(id) (0) 195#define __cpu_is_pxa935(id) (0)
194#endif 196#endif
195 197
196#ifdef CONFIG_CPU_PXA950 198#ifdef CONFIG_CPU_PXA955
197#define __cpu_is_pxa950(id) \ 199#define __cpu_is_pxa955(id) \
198 ({ \ 200 ({ \
199 unsigned int _id = (id) >> 4 & 0xfff; \ 201 unsigned int _id = (id) >> 4 & 0xfff; \
200 _id == 0x697; \ 202 _id == 0x581 || _id == 0xc08 \
201 }) 203 || _id == 0xb76; \
204 })
202#else 205#else
203#define __cpu_is_pxa950(id) (0) 206#define __cpu_is_pxa955(id) (0)
204#endif 207#endif
205 208
206#define cpu_is_pxa210() \ 209#define cpu_is_pxa210() \
@@ -253,16 +256,15 @@
253 __cpu_is_pxa935(read_cpuid_id()); \ 256 __cpu_is_pxa935(read_cpuid_id()); \
254 }) 257 })
255 258
256#define cpu_is_pxa950() \ 259#define cpu_is_pxa955() \
257 ({ \ 260 ({ \
258 __cpu_is_pxa950(read_cpuid_id()); \ 261 __cpu_is_pxa955(read_cpuid_id()); \
259 }) 262 })
260 263
261 264
262/* 265/*
263 * CPUID Core Generation Bit 266 * CPUID Core Generation Bit
264 * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x 267 * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x
265 * == 0x3 for pxa300/pxa310/pxa320
266 */ 268 */
267#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) 269#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)
268#define __cpu_is_pxa2xx(id) \ 270#define __cpu_is_pxa2xx(id) \
@@ -277,8 +279,10 @@
277#ifdef CONFIG_PXA3xx 279#ifdef CONFIG_PXA3xx
278#define __cpu_is_pxa3xx(id) \ 280#define __cpu_is_pxa3xx(id) \
279 ({ \ 281 ({ \
280 unsigned int _id = (id) >> 13 & 0x7; \ 282 __cpu_is_pxa300(id) \
281 _id == 0x3; \ 283 || __cpu_is_pxa310(id) \
284 || __cpu_is_pxa320(id) \
285 || __cpu_is_pxa93x(id); \
282 }) 286 })
283#else 287#else
284#define __cpu_is_pxa3xx(id) (0) 288#define __cpu_is_pxa3xx(id) (0)
@@ -287,13 +291,22 @@
287#if defined(CONFIG_CPU_PXA930) || defined(CONFIG_CPU_PXA935) 291#if defined(CONFIG_CPU_PXA930) || defined(CONFIG_CPU_PXA935)
288#define __cpu_is_pxa93x(id) \ 292#define __cpu_is_pxa93x(id) \
289 ({ \ 293 ({ \
290 unsigned int _id = (id) >> 4 & 0xfff; \ 294 __cpu_is_pxa930(id) \
291 _id == 0x683 || _id == 0x693; \ 295 || __cpu_is_pxa935(id); \
292 }) 296 })
293#else 297#else
294#define __cpu_is_pxa93x(id) (0) 298#define __cpu_is_pxa93x(id) (0)
295#endif 299#endif
296 300
301#ifdef CONFIG_PXA95x
302#define __cpu_is_pxa95x(id) \
303 ({ \
304 __cpu_is_pxa955(id); \
305 })
306#else
307#define __cpu_is_pxa95x(id) (0)
308#endif
309
297#define cpu_is_pxa2xx() \ 310#define cpu_is_pxa2xx() \
298 ({ \ 311 ({ \
299 __cpu_is_pxa2xx(read_cpuid_id()); \ 312 __cpu_is_pxa2xx(read_cpuid_id()); \
@@ -308,6 +321,12 @@
308 ({ \ 321 ({ \
309 __cpu_is_pxa93x(read_cpuid_id()); \ 322 __cpu_is_pxa93x(read_cpuid_id()); \
310 }) 323 })
324
325#define cpu_is_pxa95x() \
326 ({ \
327 __cpu_is_pxa95x(read_cpuid_id()); \
328 })
329
311/* 330/*
312 * return current memory and LCD clock frequency in units of 10kHz 331 * return current memory and LCD clock frequency in units of 10kHz
313 */ 332 */
diff --git a/arch/arm/mach-pxa/include/mach/irqs.h b/arch/arm/mach-pxa/include/mach/irqs.h
index d372caa75dc7..a4285fc00878 100644
--- a/arch/arm/mach-pxa/include/mach/irqs.h
+++ b/arch/arm/mach-pxa/include/mach/irqs.h
@@ -21,16 +21,14 @@
21 21
22#define PXA_IRQ(x) (PXA_ISA_IRQ_NUM + (x)) 22#define PXA_IRQ(x) (PXA_ISA_IRQ_NUM + (x))
23 23
24#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
25#define IRQ_SSP3 PXA_IRQ(0) /* SSP3 service request */ 24#define IRQ_SSP3 PXA_IRQ(0) /* SSP3 service request */
26#define IRQ_MSL PXA_IRQ(1) /* MSL Interface interrupt */ 25#define IRQ_MSL PXA_IRQ(1) /* MSL Interface interrupt */
27#define IRQ_USBH2 PXA_IRQ(2) /* USB Host interrupt 1 (OHCI) */ 26#define IRQ_USBH2 PXA_IRQ(2) /* USB Host interrupt 1 (OHCI,PXA27x) */
28#define IRQ_USBH1 PXA_IRQ(3) /* USB Host interrupt 2 (non-OHCI) */ 27#define IRQ_USBH1 PXA_IRQ(3) /* USB Host interrupt 2 (non-OHCI,PXA27x) */
29#define IRQ_KEYPAD PXA_IRQ(4) /* Key pad controller */ 28#define IRQ_KEYPAD PXA_IRQ(4) /* Key pad controller */
30#define IRQ_MEMSTK PXA_IRQ(5) /* Memory Stick interrupt */ 29#define IRQ_MEMSTK PXA_IRQ(5) /* Memory Stick interrupt (PXA27x) */
30#define IRQ_ACIPC0 PXA_IRQ(5) /* AP-CP Communication (PXA930) */
31#define IRQ_PWRI2C PXA_IRQ(6) /* Power I2C interrupt */ 31#define IRQ_PWRI2C PXA_IRQ(6) /* Power I2C interrupt */
32#endif
33
34#define IRQ_HWUART PXA_IRQ(7) /* HWUART Transmit/Receive/Error (PXA26x) */ 32#define IRQ_HWUART PXA_IRQ(7) /* HWUART Transmit/Receive/Error (PXA26x) */
35#define IRQ_OST_4_11 PXA_IRQ(7) /* OS timer 4-11 matches (PXA27x) */ 33#define IRQ_OST_4_11 PXA_IRQ(7) /* OS timer 4-11 matches (PXA27x) */
36#define IRQ_GPIO0 PXA_IRQ(8) /* GPIO0 Edge Detect */ 34#define IRQ_GPIO0 PXA_IRQ(8) /* GPIO0 Edge Detect */
@@ -38,7 +36,8 @@
38#define IRQ_GPIO_2_x PXA_IRQ(10) /* GPIO[2-x] Edge Detect */ 36#define IRQ_GPIO_2_x PXA_IRQ(10) /* GPIO[2-x] Edge Detect */
39#define IRQ_USB PXA_IRQ(11) /* USB Service */ 37#define IRQ_USB PXA_IRQ(11) /* USB Service */
40#define IRQ_PMU PXA_IRQ(12) /* Performance Monitoring Unit */ 38#define IRQ_PMU PXA_IRQ(12) /* Performance Monitoring Unit */
41#define IRQ_I2S PXA_IRQ(13) /* I2S Interrupt */ 39#define IRQ_I2S PXA_IRQ(13) /* I2S Interrupt (PXA27x) */
40#define IRQ_SSP4 PXA_IRQ(13) /* SSP4 service request (PXA3xx) */
42#define IRQ_AC97 PXA_IRQ(14) /* AC97 Interrupt */ 41#define IRQ_AC97 PXA_IRQ(14) /* AC97 Interrupt */
43#define IRQ_ASSP PXA_IRQ(15) /* Audio SSP Service Request (PXA25x) */ 42#define IRQ_ASSP PXA_IRQ(15) /* Audio SSP Service Request (PXA25x) */
44#define IRQ_USIM PXA_IRQ(15) /* Smart Card interface interrupt (PXA27x) */ 43#define IRQ_USIM PXA_IRQ(15) /* Smart Card interface interrupt (PXA27x) */
@@ -47,6 +46,7 @@
47#define IRQ_LCD PXA_IRQ(17) /* LCD Controller Service Request */ 46#define IRQ_LCD PXA_IRQ(17) /* LCD Controller Service Request */
48#define IRQ_I2C PXA_IRQ(18) /* I2C Service Request */ 47#define IRQ_I2C PXA_IRQ(18) /* I2C Service Request */
49#define IRQ_ICP PXA_IRQ(19) /* ICP Transmit/Receive/Error */ 48#define IRQ_ICP PXA_IRQ(19) /* ICP Transmit/Receive/Error */
49#define IRQ_ACIPC2 PXA_IRQ(19) /* AP-CP Communication (PXA930) */
50#define IRQ_STUART PXA_IRQ(20) /* STUART Transmit/Receive/Error */ 50#define IRQ_STUART PXA_IRQ(20) /* STUART Transmit/Receive/Error */
51#define IRQ_BTUART PXA_IRQ(21) /* BTUART Transmit/Receive/Error */ 51#define IRQ_BTUART PXA_IRQ(21) /* BTUART Transmit/Receive/Error */
52#define IRQ_FFUART PXA_IRQ(22) /* FFUART Transmit/Receive/Error*/ 52#define IRQ_FFUART PXA_IRQ(22) /* FFUART Transmit/Receive/Error*/
@@ -60,19 +60,17 @@
60#define IRQ_RTC1Hz PXA_IRQ(30) /* RTC HZ Clock Tick */ 60#define IRQ_RTC1Hz PXA_IRQ(30) /* RTC HZ Clock Tick */
61#define IRQ_RTCAlrm PXA_IRQ(31) /* RTC Alarm */ 61#define IRQ_RTCAlrm PXA_IRQ(31) /* RTC Alarm */
62 62
63#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
64#define IRQ_TPM PXA_IRQ(32) /* TPM interrupt */ 63#define IRQ_TPM PXA_IRQ(32) /* TPM interrupt */
65#define IRQ_CAMERA PXA_IRQ(33) /* Camera Interface */ 64#define IRQ_CAMERA PXA_IRQ(33) /* Camera Interface */
66#endif
67
68#ifdef CONFIG_PXA3xx
69#define IRQ_SSP4 PXA_IRQ(13) /* SSP4 service request */
70#define IRQ_CIR PXA_IRQ(34) /* Consumer IR */ 65#define IRQ_CIR PXA_IRQ(34) /* Consumer IR */
71#define IRQ_COMM_WDT PXA_IRQ(35) /* Comm WDT interrupt */ 66#define IRQ_COMM_WDT PXA_IRQ(35) /* Comm WDT interrupt */
72#define IRQ_TSI PXA_IRQ(36) /* Touch Screen Interface (PXA320) */ 67#define IRQ_TSI PXA_IRQ(36) /* Touch Screen Interface (PXA320) */
68#define IRQ_ENHROT PXA_IRQ(37) /* Enhanced Rotary (PXA930) */
73#define IRQ_USIM2 PXA_IRQ(38) /* USIM2 Controller */ 69#define IRQ_USIM2 PXA_IRQ(38) /* USIM2 Controller */
74#define IRQ_GCU PXA_IRQ(39) /* Graphics Controller */ 70#define IRQ_GCU PXA_IRQ(39) /* Graphics Controller (PXA3xx) */
71#define IRQ_ACIPC1 PXA_IRQ(40) /* AP-CP Communication (PXA930) */
75#define IRQ_MMC2 PXA_IRQ(41) /* MMC2 Controller */ 72#define IRQ_MMC2 PXA_IRQ(41) /* MMC2 Controller */
73#define IRQ_TRKBALL PXA_IRQ(43) /* Track Ball (PXA930) */
76#define IRQ_1WIRE PXA_IRQ(44) /* 1-Wire Controller */ 74#define IRQ_1WIRE PXA_IRQ(44) /* 1-Wire Controller */
77#define IRQ_NAND PXA_IRQ(45) /* NAND Controller */ 75#define IRQ_NAND PXA_IRQ(45) /* NAND Controller */
78#define IRQ_USB2 PXA_IRQ(46) /* USB 2.0 Device Controller */ 76#define IRQ_USB2 PXA_IRQ(46) /* USB 2.0 Device Controller */
@@ -80,30 +78,14 @@
80#define IRQ_WAKEUP1 PXA_IRQ(50) /* EXT_WAKEUP1 */ 78#define IRQ_WAKEUP1 PXA_IRQ(50) /* EXT_WAKEUP1 */
81#define IRQ_DMEMC PXA_IRQ(51) /* Dynamic Memory Controller */ 79#define IRQ_DMEMC PXA_IRQ(51) /* Dynamic Memory Controller */
82#define IRQ_MMC3 PXA_IRQ(55) /* MMC3 Controller (PXA310) */ 80#define IRQ_MMC3 PXA_IRQ(55) /* MMC3 Controller (PXA310) */
83#endif
84 81
85#ifdef CONFIG_CPU_PXA935
86#define IRQ_U2O PXA_IRQ(64) /* USB OTG 2.0 Controller (PXA935) */ 82#define IRQ_U2O PXA_IRQ(64) /* USB OTG 2.0 Controller (PXA935) */
87#define IRQ_U2H PXA_IRQ(65) /* USB Host 2.0 Controller (PXA935) */ 83#define IRQ_U2H PXA_IRQ(65) /* USB Host 2.0 Controller (PXA935) */
88 84#define IRQ_PXA935_MMC0 PXA_IRQ(72) /* MMC0 Controller (PXA935) */
89#define IRQ_MMC3_PXA935 PXA_IRQ(72) /* MMC3 Controller (PXA935) */ 85#define IRQ_PXA935_MMC1 PXA_IRQ(73) /* MMC1 Controller (PXA935) */
90#define IRQ_MMC4_PXA935 PXA_IRQ(73) /* MMC4 Controller (PXA935) */ 86#define IRQ_PXA935_MMC2 PXA_IRQ(74) /* MMC2 Controller (PXA935) */
91#define IRQ_MMC5_PXA935 PXA_IRQ(74) /* MMC5 Controller (PXA935) */ 87#define IRQ_PXA955_MMC3 PXA_IRQ(75) /* MMC3 Controller (PXA955) */
92
93#define IRQ_U2P PXA_IRQ(93) /* USB PHY D+/D- Lines (PXA935) */ 88#define IRQ_U2P PXA_IRQ(93) /* USB PHY D+/D- Lines (PXA935) */
94#endif
95
96#ifdef CONFIG_CPU_PXA930
97#define IRQ_ENHROT PXA_IRQ(37) /* Enhanced Rotary (PXA930) */
98#define IRQ_ACIPC0 PXA_IRQ(5)
99#define IRQ_ACIPC1 PXA_IRQ(40)
100#define IRQ_ACIPC2 PXA_IRQ(19)
101#define IRQ_TRKBALL PXA_IRQ(43) /* Track Ball */
102#endif
103
104#ifdef CONFIG_CPU_PXA950
105#define IRQ_GC500 PXA_IRQ(70) /* Graphics Controller (PXA950) */
106#endif
107 89
108#define PXA_GPIO_IRQ_BASE PXA_IRQ(96) 90#define PXA_GPIO_IRQ_BASE PXA_IRQ(96)
109#define PXA_GPIO_IRQ_NUM (192) 91#define PXA_GPIO_IRQ_NUM (192)
diff --git a/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h b/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h
index 4fcddd9cab76..ee6ced1cea7f 100644
--- a/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h
+++ b/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h
@@ -17,72 +17,6 @@
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18 18
19/* 19/*
20 * PXA Chip selects
21 */
22
23#define PXA_CS0_PHYS 0x00000000
24#define PXA_CS1_PHYS 0x04000000
25#define PXA_CS2_PHYS 0x08000000
26#define PXA_CS3_PHYS 0x0C000000
27#define PXA_CS4_PHYS 0x10000000
28#define PXA_CS5_PHYS 0x14000000
29
30/*
31 * Memory controller
32 */
33
34#define MDCNFG __REG(0x48000000) /* SDRAM Configuration Register 0 */
35#define MDREFR __REG(0x48000004) /* SDRAM Refresh Control Register */
36#define MSC0 __REG(0x48000008) /* Static Memory Control Register 0 */
37#define MSC1 __REG(0x4800000C) /* Static Memory Control Register 1 */
38#define MSC2 __REG(0x48000010) /* Static Memory Control Register 2 */
39#define MECR __REG(0x48000014) /* Expansion Memory (PCMCIA/Compact Flash) Bus Configuration */
40#define SXLCR __REG(0x48000018) /* LCR value to be written to SDRAM-Timing Synchronous Flash */
41#define SXCNFG __REG(0x4800001C) /* Synchronous Static Memory Control Register */
42#define SXMRS __REG(0x48000024) /* MRS value to be written to Synchronous Flash or SMROM */
43#define MCMEM0 __REG(0x48000028) /* Card interface Common Memory Space Socket 0 Timing */
44#define MCMEM1 __REG(0x4800002C) /* Card interface Common Memory Space Socket 1 Timing */
45#define MCATT0 __REG(0x48000030) /* Card interface Attribute Space Socket 0 Timing Configuration */
46#define MCATT1 __REG(0x48000034) /* Card interface Attribute Space Socket 1 Timing Configuration */
47#define MCIO0 __REG(0x48000038) /* Card interface I/O Space Socket 0 Timing Configuration */
48#define MCIO1 __REG(0x4800003C) /* Card interface I/O Space Socket 1 Timing Configuration */
49#define MDMRS __REG(0x48000040) /* MRS value to be written to SDRAM */
50#define BOOT_DEF __REG(0x48000044) /* Read-Only Boot-Time Register. Contains BOOT_SEL and PKG_SEL */
51
52/*
53 * More handy macros for PCMCIA
54 *
55 * Arg is socket number
56 */
57#define MCMEM(s) __REG2(0x48000028, (s)<<2 ) /* Card interface Common Memory Space Socket s Timing */
58#define MCATT(s) __REG2(0x48000030, (s)<<2 ) /* Card interface Attribute Space Socket s Timing Configuration */
59#define MCIO(s) __REG2(0x48000038, (s)<<2 ) /* Card interface I/O Space Socket s Timing Configuration */
60
61/* MECR register defines */
62#define MECR_NOS (1 << 0) /* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */
63#define MECR_CIT (1 << 1) /* Card Is There: 0 -> no card, 1 -> card inserted */
64
65#define MDCNFG_DE0 (1 << 0) /* SDRAM Bank 0 Enable */
66#define MDCNFG_DE1 (1 << 1) /* SDRAM Bank 1 Enable */
67#define MDCNFG_DE2 (1 << 16) /* SDRAM Bank 2 Enable */
68#define MDCNFG_DE3 (1 << 17) /* SDRAM Bank 3 Enable */
69
70#define MDREFR_K0DB4 (1 << 29) /* SDCLK0 Divide by 4 Control/Status */
71#define MDREFR_K2FREE (1 << 25) /* SDRAM Free-Running Control */
72#define MDREFR_K1FREE (1 << 24) /* SDRAM Free-Running Control */
73#define MDREFR_K0FREE (1 << 23) /* SDRAM Free-Running Control */
74#define MDREFR_SLFRSH (1 << 22) /* SDRAM Self-Refresh Control/Status */
75#define MDREFR_APD (1 << 20) /* SDRAM/SSRAM Auto-Power-Down Enable */
76#define MDREFR_K2DB2 (1 << 19) /* SDCLK2 Divide by 2 Control/Status */
77#define MDREFR_K2RUN (1 << 18) /* SDCLK2 Run Control/Status */
78#define MDREFR_K1DB2 (1 << 17) /* SDCLK1 Divide by 2 Control/Status */
79#define MDREFR_K1RUN (1 << 16) /* SDCLK1 Run Control/Status */
80#define MDREFR_E1PIN (1 << 15) /* SDCKE1 Level Control/Status */
81#define MDREFR_K0DB2 (1 << 14) /* SDCLK0 Divide by 2 Control/Status */
82#define MDREFR_K0RUN (1 << 13) /* SDCLK0 Run Control/Status */
83#define MDREFR_E0PIN (1 << 12) /* SDCKE0 Level Control/Status */
84
85/*
86 * Power Manager 20 * Power Manager
87 */ 21 */
88 22
diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h
index e91d63cfe811..e4fb4668c26e 100644
--- a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h
+++ b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h
@@ -16,15 +16,6 @@
16#include <mach/hardware.h> 16#include <mach/hardware.h>
17 17
18/* 18/*
19 * Static Chip Selects
20 */
21
22#define PXA300_CS0_PHYS (0x00000000) /* PXA300/PXA310 _only_ */
23#define PXA300_CS1_PHYS (0x30000000) /* PXA300/PXA310 _only_ */
24#define PXA3xx_CS2_PHYS (0x10000000)
25#define PXA3xx_CS3_PHYS (0x14000000)
26
27/*
28 * Oscillator Configuration Register (OSCC) 19 * Oscillator Configuration Register (OSCC)
29 */ 20 */
30#define OSCC __REG(0x41350000) /* Oscillator Configuration Register */ 21#define OSCC __REG(0x41350000) /* Oscillator Configuration Register */
diff --git a/arch/arm/mach-pxa/include/mach/regs-intc.h b/arch/arm/mach-pxa/include/mach/regs-intc.h
index 68464ce1c1ea..662288eb6f95 100644
--- a/arch/arm/mach-pxa/include/mach/regs-intc.h
+++ b/arch/arm/mach-pxa/include/mach/regs-intc.h
@@ -27,8 +27,4 @@
27#define ICFP3 __REG(0x40D0013C) /* Interrupt Controller FIQ Pending Register 3 */ 27#define ICFP3 __REG(0x40D0013C) /* Interrupt Controller FIQ Pending Register 3 */
28#define ICPR3 __REG(0x40D00140) /* Interrupt Controller Pending Register 3 */ 28#define ICPR3 __REG(0x40D00140) /* Interrupt Controller Pending Register 3 */
29 29
30#define IPR(x) __REG(0x40D0001C + (x < 32 ? (x << 2) \
31 : (x < 64 ? (0x94 + ((x - 32) << 2)) \
32 : (0x128 + ((x - 64) << 2)))))
33
34#endif /* __ASM_MACH_REGS_INTC_H */ 30#endif /* __ASM_MACH_REGS_INTC_H */
diff --git a/arch/arm/mach-pxa/include/mach/smemc.h b/arch/arm/mach-pxa/include/mach/smemc.h
new file mode 100644
index 000000000000..654adc90c9a0
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/smemc.h
@@ -0,0 +1,74 @@
1/*
2 * Static memory controller register definitions for PXA CPUs
3 *
4 * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __SMEMC_REGS_H
12#define __SMEMC_REGS_H
13
14#define PXA2XX_SMEMC_BASE 0x48000000
15#define PXA3XX_SMEMC_BASE 0x4a000000
16#define SMEMC_VIRT 0xf6000000
17
18#define MDCNFG (SMEMC_VIRT + 0x00) /* SDRAM Configuration Register 0 */
19#define MDREFR (SMEMC_VIRT + 0x04) /* SDRAM Refresh Control Register */
20#define MSC0 (SMEMC_VIRT + 0x08) /* Static Memory Control Register 0 */
21#define MSC1 (SMEMC_VIRT + 0x0C) /* Static Memory Control Register 1 */
22#define MSC2 (SMEMC_VIRT + 0x10) /* Static Memory Control Register 2 */
23#define MECR (SMEMC_VIRT + 0x14) /* Expansion Memory (PCMCIA/Compact Flash) Bus Configuration */
24#define SXLCR (SMEMC_VIRT + 0x18) /* LCR value to be written to SDRAM-Timing Synchronous Flash */
25#define SXCNFG (SMEMC_VIRT + 0x1C) /* Synchronous Static Memory Control Register */
26#define SXMRS (SMEMC_VIRT + 0x24) /* MRS value to be written to Synchronous Flash or SMROM */
27#define MCMEM0 (SMEMC_VIRT + 0x28) /* Card interface Common Memory Space Socket 0 Timing */
28#define MCMEM1 (SMEMC_VIRT + 0x2C) /* Card interface Common Memory Space Socket 1 Timing */
29#define MCATT0 (SMEMC_VIRT + 0x30) /* Card interface Attribute Space Socket 0 Timing Configuration */
30#define MCATT1 (SMEMC_VIRT + 0x34) /* Card interface Attribute Space Socket 1 Timing Configuration */
31#define MCIO0 (SMEMC_VIRT + 0x38) /* Card interface I/O Space Socket 0 Timing Configuration */
32#define MCIO1 (SMEMC_VIRT + 0x3C) /* Card interface I/O Space Socket 1 Timing Configuration */
33#define MDMRS (SMEMC_VIRT + 0x40) /* MRS value to be written to SDRAM */
34#define BOOT_DEF (SMEMC_VIRT + 0x44) /* Read-Only Boot-Time Register. Contains BOOT_SEL and PKG_SEL */
35#define MEMCLKCFG (SMEMC_VIRT + 0x68) /* Clock Configuration */
36#define CSADRCFG0 (SMEMC_VIRT + 0x80) /* Address Configuration Register for CS0 */
37#define CSADRCFG1 (SMEMC_VIRT + 0x84) /* Address Configuration Register for CS1 */
38#define CSADRCFG2 (SMEMC_VIRT + 0x88) /* Address Configuration Register for CS2 */
39#define CSADRCFG3 (SMEMC_VIRT + 0x8C) /* Address Configuration Register for CS3 */
40
41/*
42 * More handy macros for PCMCIA
43 *
44 * Arg is socket number
45 */
46#define MCMEM(s) (SMEMC_VIRT + 0x28 + ((s)<<2)) /* Card interface Common Memory Space Socket s Timing */
47#define MCATT(s) (SMEMC_VIRT + 0x30 + ((s)<<2)) /* Card interface Attribute Space Socket s Timing Configuration */
48#define MCIO(s) (SMEMC_VIRT + 0x38 + ((s)<<2)) /* Card interface I/O Space Socket s Timing Configuration */
49
50/* MECR register defines */
51#define MECR_NOS (1 << 0) /* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */
52#define MECR_CIT (1 << 1) /* Card Is There: 0 -> no card, 1 -> card inserted */
53
54#define MDCNFG_DE0 (1 << 0) /* SDRAM Bank 0 Enable */
55#define MDCNFG_DE1 (1 << 1) /* SDRAM Bank 1 Enable */
56#define MDCNFG_DE2 (1 << 16) /* SDRAM Bank 2 Enable */
57#define MDCNFG_DE3 (1 << 17) /* SDRAM Bank 3 Enable */
58
59#define MDREFR_K0DB4 (1 << 29) /* SDCLK0 Divide by 4 Control/Status */
60#define MDREFR_K2FREE (1 << 25) /* SDRAM Free-Running Control */
61#define MDREFR_K1FREE (1 << 24) /* SDRAM Free-Running Control */
62#define MDREFR_K0FREE (1 << 23) /* SDRAM Free-Running Control */
63#define MDREFR_SLFRSH (1 << 22) /* SDRAM Self-Refresh Control/Status */
64#define MDREFR_APD (1 << 20) /* SDRAM/SSRAM Auto-Power-Down Enable */
65#define MDREFR_K2DB2 (1 << 19) /* SDCLK2 Divide by 2 Control/Status */
66#define MDREFR_K2RUN (1 << 18) /* SDCLK2 Run Control/Status */
67#define MDREFR_K1DB2 (1 << 17) /* SDCLK1 Divide by 2 Control/Status */
68#define MDREFR_K1RUN (1 << 16) /* SDCLK1 Run Control/Status */
69#define MDREFR_E1PIN (1 << 15) /* SDCKE1 Level Control/Status */
70#define MDREFR_K0DB2 (1 << 14) /* SDCLK0 Divide by 2 Control/Status */
71#define MDREFR_K0RUN (1 << 13) /* SDCLK0 Run Control/Status */
72#define MDREFR_E0PIN (1 << 12) /* SDCKE0 Level Control/Status */
73
74#endif
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index 1beb40f692fc..54e91c9e71c8 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -16,20 +16,31 @@
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/sysdev.h> 18#include <linux/sysdev.h>
19#include <linux/io.h>
20#include <linux/irq.h>
19 21
20#include <mach/hardware.h> 22#include <mach/hardware.h>
21#include <asm/irq.h> 23#include <mach/irqs.h>
22#include <asm/mach/irq.h>
23#include <mach/gpio.h> 24#include <mach/gpio.h>
24#include <mach/regs-intc.h>
25 25
26#include "generic.h" 26#include "generic.h"
27 27
28#define MAX_INTERNAL_IRQS 128 28#define IRQ_BASE (void __iomem *)io_p2v(0x40d00000)
29
30#define ICIP (0x000)
31#define ICMR (0x004)
32#define ICLR (0x008)
33#define ICFR (0x00c)
34#define ICPR (0x010)
35#define ICCR (0x014)
36#define ICHP (0x018)
37#define IPR(i) (((i) < 32) ? (0x01c + ((i) << 2)) : \
38 ((i) < 64) ? (0x0b0 + (((i) - 32) << 2)) : \
39 (0x144 + (((i) - 64) << 2)))
40#define IPR_VALID (1 << 31)
41#define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f)
29 42
30#define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f) 43#define MAX_INTERNAL_IRQS 128
31#define _ICMR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICMR2 : &ICMR))
32#define _ICLR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICLR2 : &ICLR))
33 44
34/* 45/*
35 * This is for peripheral IRQs internal to the PXA chip. 46 * This is for peripheral IRQs internal to the PXA chip.
@@ -37,14 +48,27 @@
37 48
38static int pxa_internal_irq_nr; 49static int pxa_internal_irq_nr;
39 50
51static inline int cpu_has_ipr(void)
52{
53 return !cpu_is_pxa25x();
54}
55
40static void pxa_mask_irq(unsigned int irq) 56static void pxa_mask_irq(unsigned int irq)
41{ 57{
42 _ICMR(irq) &= ~(1 << IRQ_BIT(irq)); 58 void __iomem *base = get_irq_chip_data(irq);
59 uint32_t icmr = __raw_readl(base + ICMR);
60
61 icmr &= ~(1 << IRQ_BIT(irq));
62 __raw_writel(icmr, base + ICMR);
43} 63}
44 64
45static void pxa_unmask_irq(unsigned int irq) 65static void pxa_unmask_irq(unsigned int irq)
46{ 66{
47 _ICMR(irq) |= 1 << IRQ_BIT(irq); 67 void __iomem *base = get_irq_chip_data(irq);
68 uint32_t icmr = __raw_readl(base + ICMR);
69
70 icmr |= 1 << IRQ_BIT(irq);
71 __raw_writel(icmr, base + ICMR);
48} 72}
49 73
50static struct irq_chip pxa_internal_irq_chip = { 74static struct irq_chip pxa_internal_irq_chip = {
@@ -86,12 +110,16 @@ static void pxa_ack_low_gpio(unsigned int irq)
86 110
87static void pxa_mask_low_gpio(unsigned int irq) 111static void pxa_mask_low_gpio(unsigned int irq)
88{ 112{
89 ICMR &= ~(1 << (irq - PXA_IRQ(0))); 113 struct irq_desc *desc = irq_to_desc(irq);
114
115 desc->chip->mask(irq);
90} 116}
91 117
92static void pxa_unmask_low_gpio(unsigned int irq) 118static void pxa_unmask_low_gpio(unsigned int irq)
93{ 119{
94 ICMR |= 1 << (irq - PXA_IRQ(0)); 120 struct irq_desc *desc = irq_to_desc(irq);
121
122 desc->chip->unmask(irq);
95} 123}
96 124
97static struct irq_chip pxa_low_gpio_chip = { 125static struct irq_chip pxa_low_gpio_chip = {
@@ -120,33 +148,45 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
120 pxa_low_gpio_chip.set_wake = fn; 148 pxa_low_gpio_chip.set_wake = fn;
121} 149}
122 150
151static inline void __iomem *irq_base(int i)
152{
153 static unsigned long phys_base[] = {
154 0x40d00000,
155 0x40d0009c,
156 0x40d00130,
157 };
158
159 return (void __iomem *)io_p2v(phys_base[i >> 5]);
160}
161
123void __init pxa_init_irq(int irq_nr, set_wake_t fn) 162void __init pxa_init_irq(int irq_nr, set_wake_t fn)
124{ 163{
125 int irq, i; 164 int irq, i, n;
126 165
127 BUG_ON(irq_nr > MAX_INTERNAL_IRQS); 166 BUG_ON(irq_nr > MAX_INTERNAL_IRQS);
128 167
129 pxa_internal_irq_nr = irq_nr; 168 pxa_internal_irq_nr = irq_nr;
130 169
131 for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq += 32) { 170 for (n = 0; n < irq_nr; n += 32) {
132 _ICMR(irq) = 0; /* disable all IRQs */ 171 void __iomem *base = irq_base(n);
133 _ICLR(irq) = 0; /* all IRQs are IRQ, not FIQ */ 172
134 } 173 __raw_writel(0, base + ICMR); /* disable all IRQs */
135 174 __raw_writel(0, base + ICLR); /* all IRQs are IRQ, not FIQ */
136 /* initialize interrupt priority */ 175 for (i = n; (i < (n + 32)) && (i < irq_nr); i++) {
137 if (cpu_is_pxa27x() || cpu_is_pxa3xx()) { 176 /* initialize interrupt priority */
138 for (i = 0; i < irq_nr; i++) 177 if (cpu_has_ipr())
139 IPR(i) = i | (1 << 31); 178 __raw_writel(i | IPR_VALID, IRQ_BASE + IPR(i));
179
180 irq = PXA_IRQ(i);
181 set_irq_chip(irq, &pxa_internal_irq_chip);
182 set_irq_chip_data(irq, base);
183 set_irq_handler(irq, handle_level_irq);
184 set_irq_flags(irq, IRQF_VALID);
185 }
140 } 186 }
141 187
142 /* only unmasked interrupts kick us out of idle */ 188 /* only unmasked interrupts kick us out of idle */
143 ICCR = 1; 189 __raw_writel(1, irq_base(0) + ICCR);
144
145 for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq++) {
146 set_irq_chip(irq, &pxa_internal_irq_chip);
147 set_irq_handler(irq, handle_level_irq);
148 set_irq_flags(irq, IRQF_VALID);
149 }
150 190
151 pxa_internal_irq_chip.set_wake = fn; 191 pxa_internal_irq_chip.set_wake = fn;
152 pxa_init_low_gpio_irq(fn); 192 pxa_init_low_gpio_irq(fn);
@@ -158,16 +198,18 @@ static unsigned long saved_ipr[MAX_INTERNAL_IRQS];
158 198
159static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) 199static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
160{ 200{
161 int i, irq = PXA_IRQ(0); 201 int i;
162 202
163 for (i = 0; irq < PXA_IRQ(pxa_internal_irq_nr); i++, irq += 32) { 203 for (i = 0; i < pxa_internal_irq_nr; i += 32) {
164 saved_icmr[i] = _ICMR(irq); 204 void __iomem *base = irq_base(i);
165 _ICMR(irq) = 0; 205
206 saved_icmr[i] = __raw_readl(base + ICMR);
207 __raw_writel(0, base + ICMR);
166 } 208 }
167 209
168 if (cpu_is_pxa27x() || cpu_is_pxa3xx()) { 210 if (cpu_has_ipr()) {
169 for (i = 0; i < pxa_internal_irq_nr; i++) 211 for (i = 0; i < pxa_internal_irq_nr; i++)
170 saved_ipr[i] = IPR(i); 212 saved_ipr[i] = __raw_readl(IRQ_BASE + IPR(i));
171 } 213 }
172 214
173 return 0; 215 return 0;
@@ -175,19 +217,20 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
175 217
176static int pxa_irq_resume(struct sys_device *dev) 218static int pxa_irq_resume(struct sys_device *dev)
177{ 219{
178 int i, irq = PXA_IRQ(0); 220 int i;
179 221
180 if (cpu_is_pxa27x() || cpu_is_pxa3xx()) { 222 for (i = 0; i < pxa_internal_irq_nr; i += 32) {
181 for (i = 0; i < pxa_internal_irq_nr; i++) 223 void __iomem *base = irq_base(i);
182 IPR(i) = saved_ipr[i];
183 }
184 224
185 for (i = 0; irq < PXA_IRQ(pxa_internal_irq_nr); i++, irq += 32) { 225 __raw_writel(saved_icmr[i], base + ICMR);
186 _ICMR(irq) = saved_icmr[i]; 226 __raw_writel(0, base + ICLR);
187 _ICLR(irq) = 0;
188 } 227 }
189 228
190 ICCR = 1; 229 if (!cpu_is_pxa25x())
230 for (i = 0; i < pxa_internal_irq_nr; i++)
231 __raw_writel(saved_ipr[i], IRQ_BASE + IPR(i));
232
233 __raw_writel(1, IRQ_BASE + ICCR);
191 return 0; 234 return 0;
192} 235}
193#else 236#else
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c
index 41aa89e35772..719c260597e7 100644
--- a/arch/arm/mach-pxa/littleton.c
+++ b/arch/arm/mach-pxa/littleton.c
@@ -438,7 +438,7 @@ static void __init littleton_init(void)
438 438
439MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleton)") 439MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleton)")
440 .boot_params = 0xa0000100, 440 .boot_params = 0xa0000100,
441 .map_io = pxa_map_io, 441 .map_io = pxa3xx_map_io,
442 .nr_irqs = LITTLETON_NR_IRQS, 442 .nr_irqs = LITTLETON_NR_IRQS,
443 .init_irq = pxa3xx_init_irq, 443 .init_irq = pxa3xx_init_irq,
444 .timer = &pxa_timer, 444 .timer = &pxa_timer,
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index 623af0232a54..8ab62a677807 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -46,6 +46,7 @@
46#include <mach/mmc.h> 46#include <mach/mmc.h>
47#include <mach/irda.h> 47#include <mach/irda.h>
48#include <mach/ohci.h> 48#include <mach/ohci.h>
49#include <mach/smemc.h>
49 50
50#include "generic.h" 51#include "generic.h"
51#include "devices.h" 52#include "devices.h"
@@ -463,7 +464,7 @@ static void __init lpd270_init(void)
463 pxa_set_btuart_info(NULL); 464 pxa_set_btuart_info(NULL);
464 pxa_set_stuart_info(NULL); 465 pxa_set_stuart_info(NULL);
465 466
466 lpd270_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4; 467 lpd270_flash_data[0].width = (__raw_readl(BOOT_DEF) & 1) ? 2 : 4;
467 lpd270_flash_data[1].width = 4; 468 lpd270_flash_data[1].width = 4;
468 469
469 /* 470 /*
@@ -495,7 +496,7 @@ static struct map_desc lpd270_io_desc[] __initdata = {
495 496
496static void __init lpd270_map_io(void) 497static void __init lpd270_map_io(void)
497{ 498{
498 pxa_map_io(); 499 pxa27x_map_io();
499 iotable_init(lpd270_io_desc, ARRAY_SIZE(lpd270_io_desc)); 500 iotable_init(lpd270_io_desc, ARRAY_SIZE(lpd270_io_desc));
500 501
501 /* for use I SRAM as framebuffer. */ 502 /* for use I SRAM as framebuffer. */
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 1499493cd070..d3375486c8cd 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -50,6 +50,7 @@
50#include <mach/pxafb.h> 50#include <mach/pxafb.h>
51#include <mach/mmc.h> 51#include <mach/mmc.h>
52#include <mach/pm.h> 52#include <mach/pm.h>
53#include <mach/smemc.h>
53 54
54#include "generic.h" 55#include "generic.h"
55#include "clock.h" 56#include "clock.h"
@@ -525,7 +526,7 @@ static void __init lubbock_init(void)
525 pxa_set_ac97_info(NULL); 526 pxa_set_ac97_info(NULL);
526 527
527 lubbock_flash_data[0].width = lubbock_flash_data[1].width = 528 lubbock_flash_data[0].width = lubbock_flash_data[1].width =
528 (BOOT_DEF & 1) ? 2 : 4; 529 (__raw_readl(BOOT_DEF) & 1) ? 2 : 4;
529 /* Compensate for the nROMBT switch which swaps the flash banks */ 530 /* Compensate for the nROMBT switch which swaps the flash banks */
530 printk(KERN_NOTICE "Lubbock configured to boot from %s (bank %d)\n", 531 printk(KERN_NOTICE "Lubbock configured to boot from %s (bank %d)\n",
531 flashboot?"Flash":"ROM", flashboot); 532 flashboot?"Flash":"ROM", flashboot);
@@ -549,7 +550,7 @@ static struct map_desc lubbock_io_desc[] __initdata = {
549 550
550static void __init lubbock_map_io(void) 551static void __init lubbock_map_io(void)
551{ 552{
552 pxa_map_io(); 553 pxa25x_map_io();
553 iotable_init(lubbock_io_desc, ARRAY_SIZE(lubbock_io_desc)); 554 iotable_init(lubbock_io_desc, ARRAY_SIZE(lubbock_io_desc));
554 555
555 PCFR |= PCFR_OPDE; 556 PCFR |= PCFR_OPDE;
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 90663760307a..41198f0dc3ac 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -765,7 +765,7 @@ static void __init magician_init(void)
765 765
766MACHINE_START(MAGICIAN, "HTC Magician") 766MACHINE_START(MAGICIAN, "HTC Magician")
767 .boot_params = 0xa0000100, 767 .boot_params = 0xa0000100,
768 .map_io = pxa_map_io, 768 .map_io = pxa27x_map_io,
769 .nr_irqs = MAGICIAN_NR_IRQS, 769 .nr_irqs = MAGICIAN_NR_IRQS,
770 .init_irq = pxa27x_init_irq, 770 .init_irq = pxa27x_init_irq,
771 .init_machine = magician_init, 771 .init_machine = magician_init,
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index a980a5c93e49..740c03590e3b 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -51,6 +51,7 @@
51#include <mach/irda.h> 51#include <mach/irda.h>
52#include <mach/ohci.h> 52#include <mach/ohci.h>
53#include <plat/pxa27x_keypad.h> 53#include <plat/pxa27x_keypad.h>
54#include <mach/smemc.h>
54 55
55#include "generic.h" 56#include "generic.h"
56#include "devices.h" 57#include "devices.h"
@@ -565,7 +566,7 @@ static void __init mainstone_init(void)
565 pxa_set_btuart_info(NULL); 566 pxa_set_btuart_info(NULL);
566 pxa_set_stuart_info(NULL); 567 pxa_set_stuart_info(NULL);
567 568
568 mst_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4; 569 mst_flash_data[0].width = (__raw_readl(BOOT_DEF) & 1) ? 2 : 4;
569 mst_flash_data[1].width = 4; 570 mst_flash_data[1].width = 4;
570 571
571 /* Compensate for SW7 which swaps the flash banks */ 572 /* Compensate for SW7 which swaps the flash banks */
@@ -614,7 +615,7 @@ static struct map_desc mainstone_io_desc[] __initdata = {
614 615
615static void __init mainstone_map_io(void) 616static void __init mainstone_map_io(void)
616{ 617{
617 pxa_map_io(); 618 pxa27x_map_io();
618 iotable_init(mainstone_io_desc, ARRAY_SIZE(mainstone_io_desc)); 619 iotable_init(mainstone_io_desc, ARRAY_SIZE(mainstone_io_desc));
619 620
620 /* for use I SRAM as framebuffer. */ 621 /* for use I SRAM as framebuffer. */
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index f5fb915e1315..faafea3542fb 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -819,7 +819,7 @@ static void mioa701_machine_exit(void)
819 819
820MACHINE_START(MIOA701, "MIO A701") 820MACHINE_START(MIOA701, "MIO A701")
821 .boot_params = 0xa0000100, 821 .boot_params = 0xa0000100,
822 .map_io = &pxa_map_io, 822 .map_io = &pxa27x_map_io,
823 .init_irq = &pxa27x_init_irq, 823 .init_irq = &pxa27x_init_irq,
824 .init_machine = mioa701_machine_init, 824 .init_machine = mioa701_machine_init,
825 .timer = &pxa_timer, 825 .timer = &pxa_timer,
diff --git a/arch/arm/mach-pxa/mp900.c b/arch/arm/mach-pxa/mp900.c
index 116167aaba68..59cce78aebd1 100644
--- a/arch/arm/mach-pxa/mp900.c
+++ b/arch/arm/mach-pxa/mp900.c
@@ -94,7 +94,7 @@ static void __init mp900c_init(void)
94MACHINE_START(NEC_MP900, "MobilePro900/C") 94MACHINE_START(NEC_MP900, "MobilePro900/C")
95 .boot_params = 0xa0220100, 95 .boot_params = 0xa0220100,
96 .timer = &pxa_timer, 96 .timer = &pxa_timer,
97 .map_io = pxa_map_io, 97 .map_io = pxa25x_map_io,
98 .init_irq = pxa25x_init_irq, 98 .init_irq = pxa25x_init_irq,
99 .init_machine = mp900c_init, 99 .init_machine = mp900c_init,
100MACHINE_END 100MACHINE_END
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c
index ce092c521e6d..a6f898cbfac9 100644
--- a/arch/arm/mach-pxa/palmld.c
+++ b/arch/arm/mach-pxa/palmld.c
@@ -313,7 +313,7 @@ static struct map_desc palmld_io_desc[] __initdata = {
313 313
314static void __init palmld_map_io(void) 314static void __init palmld_map_io(void)
315{ 315{
316 pxa_map_io(); 316 pxa27x_map_io();
317 iotable_init(palmld_io_desc, ARRAY_SIZE(palmld_io_desc)); 317 iotable_init(palmld_io_desc, ARRAY_SIZE(palmld_io_desc));
318} 318}
319 319
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c
index 862da812cd10..df4d7d009fbb 100644
--- a/arch/arm/mach-pxa/palmt5.c
+++ b/arch/arm/mach-pxa/palmt5.c
@@ -203,7 +203,7 @@ static void __init palmt5_init(void)
203 203
204MACHINE_START(PALMT5, "Palm Tungsten|T5") 204MACHINE_START(PALMT5, "Palm Tungsten|T5")
205 .boot_params = 0xa0000100, 205 .boot_params = 0xa0000100,
206 .map_io = pxa_map_io, 206 .map_io = pxa27x_map_io,
207 .reserve = palmt5_reserve, 207 .reserve = palmt5_reserve,
208 .init_irq = pxa27x_init_irq, 208 .init_irq = pxa27x_init_irq,
209 .timer = &pxa_timer, 209 .timer = &pxa_timer,
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index 2131d5860919..a09a2374697b 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -25,6 +25,7 @@
25#include <linux/power_supply.h> 25#include <linux/power_supply.h>
26#include <linux/gpio_keys.h> 26#include <linux/gpio_keys.h>
27#include <linux/mtd/physmap.h> 27#include <linux/mtd/physmap.h>
28#include <linux/usb/gpio_vbus.h>
28 29
29#include <asm/mach-types.h> 30#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
@@ -116,6 +117,7 @@ static unsigned long palmtc_pin_config[] __initdata = {
116/****************************************************************************** 117/******************************************************************************
117 * SD/MMC card controller 118 * SD/MMC card controller
118 ******************************************************************************/ 119 ******************************************************************************/
120#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
119static struct pxamci_platform_data palmtc_mci_platform_data = { 121static struct pxamci_platform_data palmtc_mci_platform_data = {
120 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, 122 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
121 .gpio_power = GPIO_NR_PALMTC_SD_POWER, 123 .gpio_power = GPIO_NR_PALMTC_SD_POWER,
@@ -124,9 +126,18 @@ static struct pxamci_platform_data palmtc_mci_platform_data = {
124 .detect_delay_ms = 200, 126 .detect_delay_ms = 200,
125}; 127};
126 128
129static void __init palmtc_mmc_init(void)
130{
131 pxa_set_mci_info(&palmtc_mci_platform_data);
132}
133#else
134static inline void palmtc_mmc_init(void) {}
135#endif
136
127/****************************************************************************** 137/******************************************************************************
128 * GPIO keys 138 * GPIO keys
129 ******************************************************************************/ 139 ******************************************************************************/
140#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
130static struct gpio_keys_button palmtc_pxa_buttons[] = { 141static struct gpio_keys_button palmtc_pxa_buttons[] = {
131 {KEY_F8, GPIO_NR_PALMTC_HOTSYNC_BUTTON, 1, "HotSync Button", EV_KEY, 1}, 142 {KEY_F8, GPIO_NR_PALMTC_HOTSYNC_BUTTON, 1, "HotSync Button", EV_KEY, 1},
132}; 143};
@@ -144,9 +155,18 @@ static struct platform_device palmtc_pxa_keys = {
144 }, 155 },
145}; 156};
146 157
158static void __init palmtc_keys_init(void)
159{
160 platform_device_register(&palmtc_pxa_keys);
161}
162#else
163static inline void palmtc_keys_init(void) {}
164#endif
165
147/****************************************************************************** 166/******************************************************************************
148 * Backlight 167 * Backlight
149 ******************************************************************************/ 168 ******************************************************************************/
169#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
150static int palmtc_backlight_init(struct device *dev) 170static int palmtc_backlight_init(struct device *dev)
151{ 171{
152 int ret; 172 int ret;
@@ -196,17 +216,35 @@ static struct platform_device palmtc_backlight = {
196 }, 216 },
197}; 217};
198 218
219static void __init palmtc_pwm_init(void)
220{
221 platform_device_register(&palmtc_backlight);
222}
223#else
224static inline void palmtc_pwm_init(void) {}
225#endif
226
199/****************************************************************************** 227/******************************************************************************
200 * IrDA 228 * IrDA
201 ******************************************************************************/ 229 ******************************************************************************/
230#if defined(CONFIG_IRDA) || defined(CONFIG_IRDA_MODULE)
202static struct pxaficp_platform_data palmtc_ficp_platform_data = { 231static struct pxaficp_platform_data palmtc_ficp_platform_data = {
203 .gpio_pwdown = GPIO_NR_PALMTC_IR_DISABLE, 232 .gpio_pwdown = GPIO_NR_PALMTC_IR_DISABLE,
204 .transceiver_cap = IR_SIRMODE | IR_OFF, 233 .transceiver_cap = IR_SIRMODE | IR_OFF,
205}; 234};
206 235
236static void __init palmtc_irda_init(void)
237{
238 pxa_set_ficp_info(&palmtc_ficp_platform_data);
239}
240#else
241static inline void palmtc_irda_init(void) {}
242#endif
243
207/****************************************************************************** 244/******************************************************************************
208 * Keyboard 245 * Keyboard
209 ******************************************************************************/ 246 ******************************************************************************/
247#if defined(CONFIG_KEYBOARD_MATRIX) || defined(CONFIG_KEYBOARD_MATRIX_MODULE)
210static const uint32_t palmtc_matrix_keys[] = { 248static const uint32_t palmtc_matrix_keys[] = {
211 KEY(0, 0, KEY_F1), 249 KEY(0, 0, KEY_F1),
212 KEY(0, 1, KEY_X), 250 KEY(0, 1, KEY_X),
@@ -290,27 +328,103 @@ static struct platform_device palmtc_keyboard = {
290 .platform_data = &palmtc_keypad_platform_data, 328 .platform_data = &palmtc_keypad_platform_data,
291 }, 329 },
292}; 330};
331static void __init palmtc_mkp_init(void)
332{
333 platform_device_register(&palmtc_keyboard);
334}
335#else
336static inline void palmtc_mkp_init(void) {}
337#endif
293 338
294/****************************************************************************** 339/******************************************************************************
295 * UDC 340 * UDC
296 ******************************************************************************/ 341 ******************************************************************************/
297static struct pxa2xx_udc_mach_info palmtc_udc_info __initdata = { 342#if defined(CONFIG_USB_GADGET_PXA25X)||defined(CONFIG_USB_GADGET_PXA25X_MODULE)
343static struct gpio_vbus_mach_info palmtc_udc_info = {
298 .gpio_vbus = GPIO_NR_PALMTC_USB_DETECT_N, 344 .gpio_vbus = GPIO_NR_PALMTC_USB_DETECT_N,
299 .gpio_vbus_inverted = 1, 345 .gpio_vbus_inverted = 1,
300 .gpio_pullup = GPIO_NR_PALMTC_USB_POWER, 346 .gpio_pullup = GPIO_NR_PALMTC_USB_POWER,
301}; 347};
302 348
349static struct platform_device palmtc_gpio_vbus = {
350 .name = "gpio-vbus",
351 .id = -1,
352 .dev = {
353 .platform_data = &palmtc_udc_info,
354 },
355};
356
357static void __init palmtc_udc_init(void)
358{
359 platform_device_register(&palmtc_gpio_vbus);
360};
361#else
362static inline void palmtc_udc_init(void) {}
363#endif
364
303/****************************************************************************** 365/******************************************************************************
304 * Touchscreen / Battery / GPIO-extender 366 * Touchscreen / Battery / GPIO-extender
305 ******************************************************************************/ 367 ******************************************************************************/
306static struct platform_device palmtc_ucb1400_core = { 368#if defined(CONFIG_TOUCHSCREEN_UCB1400) || \
369 defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
370static struct platform_device palmtc_ucb1400_device = {
307 .name = "ucb1400_core", 371 .name = "ucb1400_core",
308 .id = -1, 372 .id = -1,
309}; 373};
310 374
375static void __init palmtc_ts_init(void)
376{
377 pxa_set_ac97_info(NULL);
378 platform_device_register(&palmtc_ucb1400_device);
379}
380#else
381static inline void palmtc_ts_init(void) {}
382#endif
383
384/******************************************************************************
385 * LEDs
386 ******************************************************************************/
387#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
388struct gpio_led palmtc_gpio_leds[] = {
389{
390 .name = "palmtc:green:user",
391 .default_trigger = "none",
392 .gpio = GPIO_NR_PALMTC_LED_POWER,
393 .active_low = 1,
394}, {
395 .name = "palmtc:vibra:vibra",
396 .default_trigger = "none",
397 .gpio = GPIO_NR_PALMTC_VIBRA_POWER,
398 .active_low = 1,
399}
400
401};
402
403static struct gpio_led_platform_data palmtc_gpio_led_info = {
404 .leds = palmtc_gpio_leds,
405 .num_leds = ARRAY_SIZE(palmtc_gpio_leds),
406};
407
408static struct platform_device palmtc_leds = {
409 .name = "leds-gpio",
410 .id = -1,
411 .dev = {
412 .platform_data = &palmtc_gpio_led_info,
413 }
414};
415
416static void __init palmtc_leds_init(void)
417{
418 platform_device_register(&palmtc_leds);
419}
420#else
421static inline void palmtc_leds_init(void) {}
422#endif
423
311/****************************************************************************** 424/******************************************************************************
312 * NOR Flash 425 * NOR Flash
313 ******************************************************************************/ 426 ******************************************************************************/
427#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
314static struct resource palmtc_flash_resource = { 428static struct resource palmtc_flash_resource = {
315 .start = PXA_CS0_PHYS, 429 .start = PXA_CS0_PHYS,
316 .end = PXA_CS0_PHYS + SZ_16M - 1, 430 .end = PXA_CS0_PHYS + SZ_16M - 1,
@@ -356,24 +470,33 @@ static struct platform_device palmtc_flash = {
356 }, 470 },
357}; 471};
358 472
473static void __init palmtc_nor_init(void)
474{
475 platform_device_register(&palmtc_flash);
476}
477#else
478static inline void palmtc_nor_init(void) {}
479#endif
480
359/****************************************************************************** 481/******************************************************************************
360 * Framebuffer 482 * Framebuffer
361 ******************************************************************************/ 483 ******************************************************************************/
484#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
362static struct pxafb_mode_info palmtc_lcd_modes[] = { 485static struct pxafb_mode_info palmtc_lcd_modes[] = {
363{ 486 {
364 .pixclock = 115384, 487 .pixclock = 115384,
365 .xres = 320, 488 .xres = 320,
366 .yres = 320, 489 .yres = 320,
367 .bpp = 16, 490 .bpp = 16,
368 491
369 .left_margin = 27, 492 .left_margin = 27,
370 .right_margin = 7, 493 .right_margin = 7,
371 .upper_margin = 7, 494 .upper_margin = 7,
372 .lower_margin = 8, 495 .lower_margin = 8,
373 496
374 .hsync_len = 6, 497 .hsync_len = 6,
375 .vsync_len = 1, 498 .vsync_len = 1,
376}, 499 },
377}; 500};
378 501
379static struct pxafb_mach_info palmtc_lcd_screen = { 502static struct pxafb_mach_info palmtc_lcd_screen = {
@@ -382,17 +505,17 @@ static struct pxafb_mach_info palmtc_lcd_screen = {
382 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, 505 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
383}; 506};
384 507
508static void __init palmtc_lcd_init(void)
509{
510 set_pxa_fb_info(&palmtc_lcd_screen);
511}
512#else
513static inline void palmtc_lcd_init(void) {}
514#endif
515
385/****************************************************************************** 516/******************************************************************************
386 * Machine init 517 * Machine init
387 ******************************************************************************/ 518 ******************************************************************************/
388static struct platform_device *devices[] __initdata = {
389 &palmtc_backlight,
390 &palmtc_ucb1400_core,
391 &palmtc_keyboard,
392 &palmtc_pxa_keys,
393 &palmtc_flash,
394};
395
396static void __init palmtc_init(void) 519static void __init palmtc_init(void)
397{ 520{
398 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtc_pin_config)); 521 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtc_pin_config));
@@ -402,18 +525,21 @@ static void __init palmtc_init(void)
402 pxa_set_stuart_info(NULL); 525 pxa_set_stuart_info(NULL);
403 pxa_set_hwuart_info(NULL); 526 pxa_set_hwuart_info(NULL);
404 527
405 set_pxa_fb_info(&palmtc_lcd_screen); 528 palmtc_mmc_init();
406 pxa_set_mci_info(&palmtc_mci_platform_data); 529 palmtc_keys_init();
407 pxa_set_udc_info(&palmtc_udc_info); 530 palmtc_pwm_init();
408 pxa_set_ac97_info(NULL); 531 palmtc_irda_init();
409 pxa_set_ficp_info(&palmtc_ficp_platform_data); 532 palmtc_mkp_init();
410 533 palmtc_udc_init();
411 platform_add_devices(devices, ARRAY_SIZE(devices)); 534 palmtc_ts_init();
535 palmtc_nor_init();
536 palmtc_lcd_init();
537 palmtc_leds_init();
412}; 538};
413 539
414MACHINE_START(PALMTC, "Palm Tungsten|C") 540MACHINE_START(PALMTC, "Palm Tungsten|C")
415 .boot_params = 0xa0000100, 541 .boot_params = 0xa0000100,
416 .map_io = pxa_map_io, 542 .map_io = pxa25x_map_io,
417 .init_irq = pxa25x_init_irq, 543 .init_irq = pxa25x_init_irq,
418 .timer = &pxa_timer, 544 .timer = &pxa_timer,
419 .init_machine = palmtc_init 545 .init_machine = palmtc_init
diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c
index a9dae7bc35d9..3f25014a136c 100644
--- a/arch/arm/mach-pxa/palmte2.c
+++ b/arch/arm/mach-pxa/palmte2.c
@@ -374,7 +374,7 @@ static void __init palmte2_init(void)
374 374
375MACHINE_START(PALMTE2, "Palm Tungsten|E2") 375MACHINE_START(PALMTE2, "Palm Tungsten|E2")
376 .boot_params = 0xa0000100, 376 .boot_params = 0xa0000100,
377 .map_io = pxa_map_io, 377 .map_io = pxa25x_map_io,
378 .init_irq = pxa25x_init_irq, 378 .init_irq = pxa25x_init_irq,
379 .timer = &pxa_timer, 379 .timer = &pxa_timer,
380 .init_machine = palmte2_init 380 .init_machine = palmte2_init
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c
index 00e2d7ba84ed..8aadad55fbe4 100644
--- a/arch/arm/mach-pxa/palmtreo.c
+++ b/arch/arm/mach-pxa/palmtreo.c
@@ -442,7 +442,7 @@ static void __init centro_init(void)
442 442
443MACHINE_START(TREO680, "Palm Treo 680") 443MACHINE_START(TREO680, "Palm Treo 680")
444 .boot_params = 0xa0000100, 444 .boot_params = 0xa0000100,
445 .map_io = pxa_map_io, 445 .map_io = pxa27x_map_io,
446 .reserve = treo_reserve, 446 .reserve = treo_reserve,
447 .init_irq = pxa27x_init_irq, 447 .init_irq = pxa27x_init_irq,
448 .timer = &pxa_timer, 448 .timer = &pxa_timer,
@@ -451,7 +451,7 @@ MACHINE_END
451 451
452MACHINE_START(CENTRO, "Palm Centro 685") 452MACHINE_START(CENTRO, "Palm Centro 685")
453 .boot_params = 0xa0000100, 453 .boot_params = 0xa0000100,
454 .map_io = pxa_map_io, 454 .map_io = pxa27x_map_io,
455 .reserve = treo_reserve, 455 .reserve = treo_reserve,
456 .init_irq = pxa27x_init_irq, 456 .init_irq = pxa27x_init_irq,
457 .timer = &pxa_timer, 457 .timer = &pxa_timer,
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c
index e5c9932b7588..595f002066cc 100644
--- a/arch/arm/mach-pxa/palmtx.c
+++ b/arch/arm/mach-pxa/palmtx.c
@@ -334,7 +334,7 @@ static struct map_desc palmtx_io_desc[] __initdata = {
334 334
335static void __init palmtx_map_io(void) 335static void __init palmtx_map_io(void)
336{ 336{
337 pxa_map_io(); 337 pxa27x_map_io();
338 iotable_init(palmtx_io_desc, ARRAY_SIZE(palmtx_io_desc)); 338 iotable_init(palmtx_io_desc, ARRAY_SIZE(palmtx_io_desc));
339} 339}
340 340
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c
index af6203fbca9c..7bf4017326e3 100644
--- a/arch/arm/mach-pxa/palmz72.c
+++ b/arch/arm/mach-pxa/palmz72.c
@@ -280,7 +280,7 @@ static void __init palmz72_init(void)
280 280
281MACHINE_START(PALMZ72, "Palm Zire72") 281MACHINE_START(PALMZ72, "Palm Zire72")
282 .boot_params = 0xa0000100, 282 .boot_params = 0xa0000100,
283 .map_io = pxa_map_io, 283 .map_io = pxa27x_map_io,
284 .init_irq = pxa27x_init_irq, 284 .init_irq = pxa27x_init_irq,
285 .timer = &pxa_timer, 285 .timer = &pxa_timer,
286 .init_machine = palmz72_init 286 .init_machine = palmz72_init
diff --git a/arch/arm/mach-pxa/pcm027.c b/arch/arm/mach-pxa/pcm027.c
index c77e8f30a439..8547c9abc40a 100644
--- a/arch/arm/mach-pxa/pcm027.c
+++ b/arch/arm/mach-pxa/pcm027.c
@@ -244,7 +244,7 @@ static void __init pcm027_init(void)
244 244
245static void __init pcm027_map_io(void) 245static void __init pcm027_map_io(void)
246{ 246{
247 pxa_map_io(); 247 pxa27x_map_io();
248 248
249 /* initialize sleep mode regs (wake-up sources, etc) */ 249 /* initialize sleep mode regs (wake-up sources, etc) */
250 PGSR0 = 0x01308000; 250 PGSR0 = 0x01308000;
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 93a191c889df..8451790cb48d 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -466,7 +466,7 @@ static void __init fixup_poodle(struct machine_desc *desc,
466 466
467MACHINE_START(POODLE, "SHARP Poodle") 467MACHINE_START(POODLE, "SHARP Poodle")
468 .fixup = fixup_poodle, 468 .fixup = fixup_poodle,
469 .map_io = pxa_map_io, 469 .map_io = pxa25x_map_io,
470 .nr_irqs = POODLE_NR_IRQS, /* 4 for LoCoMo */ 470 .nr_irqs = POODLE_NR_IRQS, /* 4 for LoCoMo */
471 .init_irq = pxa25x_init_irq, 471 .init_irq = pxa25x_init_irq,
472 .timer = &pxa_timer, 472 .timer = &pxa_timer,
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index de53f2e4aa39..3f5241c84894 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -23,6 +23,7 @@
23#include <linux/suspend.h> 23#include <linux/suspend.h>
24#include <linux/sysdev.h> 24#include <linux/sysdev.h>
25 25
26#include <asm/mach/map.h>
26#include <mach/hardware.h> 27#include <mach/hardware.h>
27#include <mach/irqs.h> 28#include <mach/irqs.h>
28#include <mach/gpio.h> 29#include <mach/gpio.h>
@@ -30,6 +31,7 @@
30#include <mach/reset.h> 31#include <mach/reset.h>
31#include <mach/pm.h> 32#include <mach/pm.h>
32#include <mach/dma.h> 33#include <mach/dma.h>
34#include <mach/smemc.h>
33 35
34#include "generic.h" 36#include "generic.h"
35#include "devices.h" 37#include "devices.h"
@@ -90,23 +92,21 @@ unsigned int pxa25x_get_clk_frequency_khz(int info)
90 return (turbo & 1) ? (N/1000) : (M/1000); 92 return (turbo & 1) ? (N/1000) : (M/1000);
91} 93}
92 94
93/* 95static unsigned long clk_pxa25x_mem_getrate(struct clk *clk)
94 * Return the current memory clock frequency in units of 10kHz
95 */
96unsigned int pxa25x_get_memclk_frequency_10khz(void)
97{ 96{
98 return L_clk_mult[(CCCR >> 0) & 0x1f] * BASE_CLK / 10000; 97 return L_clk_mult[(CCCR >> 0) & 0x1f] * BASE_CLK;
99} 98}
100 99
101static unsigned long clk_pxa25x_lcd_getrate(struct clk *clk) 100static const struct clkops clk_pxa25x_mem_ops = {
102{ 101 .enable = clk_dummy_enable,
103 return pxa25x_get_memclk_frequency_10khz() * 10000; 102 .disable = clk_dummy_disable,
104} 103 .getrate = clk_pxa25x_mem_getrate,
104};
105 105
106static const struct clkops clk_pxa25x_lcd_ops = { 106static const struct clkops clk_pxa25x_lcd_ops = {
107 .enable = clk_cken_enable, 107 .enable = clk_pxa2xx_cken_enable,
108 .disable = clk_cken_disable, 108 .disable = clk_pxa2xx_cken_disable,
109 .getrate = clk_pxa25x_lcd_getrate, 109 .getrate = clk_pxa25x_mem_getrate,
110}; 110};
111 111
112static unsigned long gpio12_config_32k[] = { 112static unsigned long gpio12_config_32k[] = {
@@ -160,31 +160,30 @@ static const struct clkops clk_pxa25x_gpio11_ops = {
160 * 95.842MHz -> MMC 19.169MHz, I2C 31.949MHz, FICP 47.923MHz, USB 47.923MHz 160 * 95.842MHz -> MMC 19.169MHz, I2C 31.949MHz, FICP 47.923MHz, USB 47.923MHz
161 * 147.456MHz -> UART 14.7456MHz, AC97 12.288MHz, I2S 5.672MHz (allegedly) 161 * 147.456MHz -> UART 14.7456MHz, AC97 12.288MHz, I2S 5.672MHz (allegedly)
162 */ 162 */
163static DEFINE_CKEN(pxa25x_hwuart, HWUART, 14745600, 1);
164
165static struct clk_lookup pxa25x_hwuart_clkreg =
166 INIT_CLKREG(&clk_pxa25x_hwuart, "pxa2xx-uart.3", NULL);
167 163
168/* 164/*
169 * PXA 2xx clock declarations. 165 * PXA 2xx clock declarations.
170 */ 166 */
167static DEFINE_PXA2_CKEN(pxa25x_hwuart, HWUART, 14745600, 1);
168static DEFINE_PXA2_CKEN(pxa25x_ffuart, FFUART, 14745600, 1);
169static DEFINE_PXA2_CKEN(pxa25x_btuart, BTUART, 14745600, 1);
170static DEFINE_PXA2_CKEN(pxa25x_stuart, STUART, 14745600, 1);
171static DEFINE_PXA2_CKEN(pxa25x_usb, USB, 47923000, 5);
172static DEFINE_PXA2_CKEN(pxa25x_mmc, MMC, 19169000, 0);
173static DEFINE_PXA2_CKEN(pxa25x_i2c, I2C, 31949000, 0);
174static DEFINE_PXA2_CKEN(pxa25x_ssp, SSP, 3686400, 0);
175static DEFINE_PXA2_CKEN(pxa25x_nssp, NSSP, 3686400, 0);
176static DEFINE_PXA2_CKEN(pxa25x_assp, ASSP, 3686400, 0);
177static DEFINE_PXA2_CKEN(pxa25x_pwm0, PWM0, 3686400, 0);
178static DEFINE_PXA2_CKEN(pxa25x_pwm1, PWM1, 3686400, 0);
179static DEFINE_PXA2_CKEN(pxa25x_ac97, AC97, 24576000, 0);
180static DEFINE_PXA2_CKEN(pxa25x_i2s, I2S, 14745600, 0);
181static DEFINE_PXA2_CKEN(pxa25x_ficp, FICP, 47923000, 0);
182
171static DEFINE_CK(pxa25x_lcd, LCD, &clk_pxa25x_lcd_ops); 183static DEFINE_CK(pxa25x_lcd, LCD, &clk_pxa25x_lcd_ops);
172static DEFINE_CKEN(pxa25x_ffuart, FFUART, 14745600, 1);
173static DEFINE_CKEN(pxa25x_btuart, BTUART, 14745600, 1);
174static DEFINE_CKEN(pxa25x_stuart, STUART, 14745600, 1);
175static DEFINE_CKEN(pxa25x_usb, USB, 47923000, 5);
176static DEFINE_CLK(pxa25x_gpio11, &clk_pxa25x_gpio11_ops, 3686400, 0); 184static DEFINE_CLK(pxa25x_gpio11, &clk_pxa25x_gpio11_ops, 3686400, 0);
177static DEFINE_CLK(pxa25x_gpio12, &clk_pxa25x_gpio12_ops, 32768, 0); 185static DEFINE_CLK(pxa25x_gpio12, &clk_pxa25x_gpio12_ops, 32768, 0);
178static DEFINE_CKEN(pxa25x_mmc, MMC, 19169000, 0); 186static DEFINE_CLK(pxa25x_mem, &clk_pxa25x_mem_ops, 0, 0);
179static DEFINE_CKEN(pxa25x_i2c, I2C, 31949000, 0);
180static DEFINE_CKEN(pxa25x_ssp, SSP, 3686400, 0);
181static DEFINE_CKEN(pxa25x_nssp, NSSP, 3686400, 0);
182static DEFINE_CKEN(pxa25x_assp, ASSP, 3686400, 0);
183static DEFINE_CKEN(pxa25x_pwm0, PWM0, 3686400, 0);
184static DEFINE_CKEN(pxa25x_pwm1, PWM1, 3686400, 0);
185static DEFINE_CKEN(pxa25x_ac97, AC97, 24576000, 0);
186static DEFINE_CKEN(pxa25x_i2s, I2S, 14745600, 0);
187static DEFINE_CKEN(pxa25x_ficp, FICP, 47923000, 0);
188 187
189static struct clk_lookup pxa25x_clkregs[] = { 188static struct clk_lookup pxa25x_clkregs[] = {
190 INIT_CLKREG(&clk_pxa25x_lcd, "pxa2xx-fb", NULL), 189 INIT_CLKREG(&clk_pxa25x_lcd, "pxa2xx-fb", NULL),
@@ -205,8 +204,12 @@ static struct clk_lookup pxa25x_clkregs[] = {
205 INIT_CLKREG(&clk_pxa25x_ac97, NULL, "AC97CLK"), 204 INIT_CLKREG(&clk_pxa25x_ac97, NULL, "AC97CLK"),
206 INIT_CLKREG(&clk_pxa25x_gpio11, NULL, "GPIO11_CLK"), 205 INIT_CLKREG(&clk_pxa25x_gpio11, NULL, "GPIO11_CLK"),
207 INIT_CLKREG(&clk_pxa25x_gpio12, NULL, "GPIO12_CLK"), 206 INIT_CLKREG(&clk_pxa25x_gpio12, NULL, "GPIO12_CLK"),
207 INIT_CLKREG(&clk_pxa25x_mem, "pxa2xx-pcmcia", NULL),
208}; 208};
209 209
210static struct clk_lookup pxa25x_hwuart_clkreg =
211 INIT_CLKREG(&clk_pxa25x_hwuart, "pxa2xx-uart.3", NULL);
212
210#ifdef CONFIG_PM 213#ifdef CONFIG_PM
211 214
212#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x 215#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x
@@ -219,20 +222,17 @@ static struct clk_lookup pxa25x_clkregs[] = {
219 */ 222 */
220enum { 223enum {
221 SLEEP_SAVE_PSTR, 224 SLEEP_SAVE_PSTR,
222 SLEEP_SAVE_CKEN,
223 SLEEP_SAVE_COUNT 225 SLEEP_SAVE_COUNT
224}; 226};
225 227
226 228
227static void pxa25x_cpu_pm_save(unsigned long *sleep_save) 229static void pxa25x_cpu_pm_save(unsigned long *sleep_save)
228{ 230{
229 SAVE(CKEN);
230 SAVE(PSTR); 231 SAVE(PSTR);
231} 232}
232 233
233static void pxa25x_cpu_pm_restore(unsigned long *sleep_save) 234static void pxa25x_cpu_pm_restore(unsigned long *sleep_save)
234{ 235{
235 RESTORE(CKEN);
236 RESTORE(PSTR); 236 RESTORE(PSTR);
237} 237}
238 238
@@ -320,6 +320,22 @@ void __init pxa26x_init_irq(void)
320} 320}
321#endif 321#endif
322 322
323static struct map_desc pxa25x_io_desc[] __initdata = {
324 { /* Mem Ctl */
325 .virtual = SMEMC_VIRT,
326 .pfn = __phys_to_pfn(PXA2XX_SMEMC_BASE),
327 .length = 0x00200000,
328 .type = MT_DEVICE
329 },
330};
331
332void __init pxa25x_map_io(void)
333{
334 pxa_map_io();
335 iotable_init(ARRAY_AND_SIZE(pxa25x_io_desc));
336 pxa25x_get_clk_frequency_khz(1);
337}
338
323static struct platform_device *pxa25x_devices[] __initdata = { 339static struct platform_device *pxa25x_devices[] __initdata = {
324 &pxa25x_device_udc, 340 &pxa25x_device_udc,
325 &pxa_device_pmu, 341 &pxa_device_pmu,
@@ -339,7 +355,9 @@ static struct sys_device pxa25x_sysdev[] = {
339 .cls = &pxa2xx_mfp_sysclass, 355 .cls = &pxa2xx_mfp_sysclass,
340 }, { 356 }, {
341 .cls = &pxa_gpio_sysclass, 357 .cls = &pxa_gpio_sysclass,
342 }, 358 }, {
359 .cls = &pxa2xx_clock_sysclass,
360 }
343}; 361};
344 362
345static int __init pxa25x_init(void) 363static int __init pxa25x_init(void)
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index d1fbf29d561c..b2130b7a7b52 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -17,7 +17,9 @@
17#include <linux/suspend.h> 17#include <linux/suspend.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/sysdev.h> 19#include <linux/sysdev.h>
20#include <linux/io.h>
20 21
22#include <asm/mach/map.h>
21#include <mach/hardware.h> 23#include <mach/hardware.h>
22#include <asm/irq.h> 24#include <asm/irq.h>
23#include <mach/irqs.h> 25#include <mach/irqs.h>
@@ -27,6 +29,8 @@
27#include <mach/ohci.h> 29#include <mach/ohci.h>
28#include <mach/pm.h> 30#include <mach/pm.h>
29#include <mach/dma.h> 31#include <mach/dma.h>
32#include <mach/smemc.h>
33
30#include <plat/i2c.h> 34#include <plat/i2c.h>
31 35
32#include "generic.h" 36#include "generic.h"
@@ -107,10 +111,9 @@ unsigned int pxa27x_get_clk_frequency_khz(int info)
107} 111}
108 112
109/* 113/*
110 * Return the current mem clock frequency in units of 10kHz as 114 * Return the current mem clock frequency as reflected by CCCR[A], B, and L
111 * reflected by CCCR[A], B, and L
112 */ 115 */
113unsigned int pxa27x_get_memclk_frequency_10khz(void) 116static unsigned long clk_pxa27x_mem_getrate(struct clk *clk)
114{ 117{
115 unsigned long ccsr, clkcfg; 118 unsigned long ccsr, clkcfg;
116 unsigned int l, L, m, M; 119 unsigned int l, L, m, M;
@@ -129,9 +132,15 @@ unsigned int pxa27x_get_memclk_frequency_10khz(void)
129 L = l * BASE_CLK; 132 L = l * BASE_CLK;
130 M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2)); 133 M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2));
131 134
132 return (M / 10000); 135 return M;
133} 136}
134 137
138static const struct clkops clk_pxa27x_mem_ops = {
139 .enable = clk_dummy_enable,
140 .disable = clk_dummy_disable,
141 .getrate = clk_pxa27x_mem_getrate,
142};
143
135/* 144/*
136 * Return the current LCD clock frequency in units of 10kHz as 145 * Return the current LCD clock frequency in units of 10kHz as
137 */ 146 */
@@ -157,36 +166,38 @@ static unsigned long clk_pxa27x_lcd_getrate(struct clk *clk)
157} 166}
158 167
159static const struct clkops clk_pxa27x_lcd_ops = { 168static const struct clkops clk_pxa27x_lcd_ops = {
160 .enable = clk_cken_enable, 169 .enable = clk_pxa2xx_cken_enable,
161 .disable = clk_cken_disable, 170 .disable = clk_pxa2xx_cken_disable,
162 .getrate = clk_pxa27x_lcd_getrate, 171 .getrate = clk_pxa27x_lcd_getrate,
163}; 172};
164 173
174static DEFINE_PXA2_CKEN(pxa27x_ffuart, FFUART, 14857000, 1);
175static DEFINE_PXA2_CKEN(pxa27x_btuart, BTUART, 14857000, 1);
176static DEFINE_PXA2_CKEN(pxa27x_stuart, STUART, 14857000, 1);
177static DEFINE_PXA2_CKEN(pxa27x_i2s, I2S, 14682000, 0);
178static DEFINE_PXA2_CKEN(pxa27x_i2c, I2C, 32842000, 0);
179static DEFINE_PXA2_CKEN(pxa27x_usb, USB, 48000000, 5);
180static DEFINE_PXA2_CKEN(pxa27x_mmc, MMC, 19500000, 0);
181static DEFINE_PXA2_CKEN(pxa27x_ficp, FICP, 48000000, 0);
182static DEFINE_PXA2_CKEN(pxa27x_usbhost, USBHOST, 48000000, 0);
183static DEFINE_PXA2_CKEN(pxa27x_pwri2c, PWRI2C, 13000000, 0);
184static DEFINE_PXA2_CKEN(pxa27x_keypad, KEYPAD, 32768, 0);
185static DEFINE_PXA2_CKEN(pxa27x_ssp1, SSP1, 13000000, 0);
186static DEFINE_PXA2_CKEN(pxa27x_ssp2, SSP2, 13000000, 0);
187static DEFINE_PXA2_CKEN(pxa27x_ssp3, SSP3, 13000000, 0);
188static DEFINE_PXA2_CKEN(pxa27x_pwm0, PWM0, 13000000, 0);
189static DEFINE_PXA2_CKEN(pxa27x_pwm1, PWM1, 13000000, 0);
190static DEFINE_PXA2_CKEN(pxa27x_ac97, AC97, 24576000, 0);
191static DEFINE_PXA2_CKEN(pxa27x_ac97conf, AC97CONF, 24576000, 0);
192static DEFINE_PXA2_CKEN(pxa27x_msl, MSL, 48000000, 0);
193static DEFINE_PXA2_CKEN(pxa27x_usim, USIM, 48000000, 0);
194static DEFINE_PXA2_CKEN(pxa27x_memstk, MEMSTK, 19500000, 0);
195static DEFINE_PXA2_CKEN(pxa27x_im, IM, 0, 0);
196static DEFINE_PXA2_CKEN(pxa27x_memc, MEMC, 0, 0);
197
165static DEFINE_CK(pxa27x_lcd, LCD, &clk_pxa27x_lcd_ops); 198static DEFINE_CK(pxa27x_lcd, LCD, &clk_pxa27x_lcd_ops);
166static DEFINE_CK(pxa27x_camera, CAMERA, &clk_pxa27x_lcd_ops); 199static DEFINE_CK(pxa27x_camera, CAMERA, &clk_pxa27x_lcd_ops);
167static DEFINE_CKEN(pxa27x_ffuart, FFUART, 14857000, 1); 200static DEFINE_CLK(pxa27x_mem, &clk_pxa27x_mem_ops, 0, 0);
168static DEFINE_CKEN(pxa27x_btuart, BTUART, 14857000, 1);
169static DEFINE_CKEN(pxa27x_stuart, STUART, 14857000, 1);
170static DEFINE_CKEN(pxa27x_i2s, I2S, 14682000, 0);
171static DEFINE_CKEN(pxa27x_i2c, I2C, 32842000, 0);
172static DEFINE_CKEN(pxa27x_usb, USB, 48000000, 5);
173static DEFINE_CKEN(pxa27x_mmc, MMC, 19500000, 0);
174static DEFINE_CKEN(pxa27x_ficp, FICP, 48000000, 0);
175static DEFINE_CKEN(pxa27x_usbhost, USBHOST, 48000000, 0);
176static DEFINE_CKEN(pxa27x_pwri2c, PWRI2C, 13000000, 0);
177static DEFINE_CKEN(pxa27x_keypad, KEYPAD, 32768, 0);
178static DEFINE_CKEN(pxa27x_ssp1, SSP1, 13000000, 0);
179static DEFINE_CKEN(pxa27x_ssp2, SSP2, 13000000, 0);
180static DEFINE_CKEN(pxa27x_ssp3, SSP3, 13000000, 0);
181static DEFINE_CKEN(pxa27x_pwm0, PWM0, 13000000, 0);
182static DEFINE_CKEN(pxa27x_pwm1, PWM1, 13000000, 0);
183static DEFINE_CKEN(pxa27x_ac97, AC97, 24576000, 0);
184static DEFINE_CKEN(pxa27x_ac97conf, AC97CONF, 24576000, 0);
185static DEFINE_CKEN(pxa27x_msl, MSL, 48000000, 0);
186static DEFINE_CKEN(pxa27x_usim, USIM, 48000000, 0);
187static DEFINE_CKEN(pxa27x_memstk, MEMSTK, 19500000, 0);
188static DEFINE_CKEN(pxa27x_im, IM, 0, 0);
189static DEFINE_CKEN(pxa27x_memc, MEMC, 0, 0);
190 201
191static struct clk_lookup pxa27x_clkregs[] = { 202static struct clk_lookup pxa27x_clkregs[] = {
192 INIT_CLKREG(&clk_pxa27x_lcd, "pxa2xx-fb", NULL), 203 INIT_CLKREG(&clk_pxa27x_lcd, "pxa2xx-fb", NULL),
@@ -215,6 +226,7 @@ static struct clk_lookup pxa27x_clkregs[] = {
215 INIT_CLKREG(&clk_pxa27x_memstk, NULL, "MSTKCLK"), 226 INIT_CLKREG(&clk_pxa27x_memstk, NULL, "MSTKCLK"),
216 INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"), 227 INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"),
217 INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"), 228 INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"),
229 INIT_CLKREG(&clk_pxa27x_mem, "pxa2xx-pcmcia", NULL),
218}; 230};
219 231
220#ifdef CONFIG_PM 232#ifdef CONFIG_PM
@@ -246,7 +258,6 @@ int __init pxa27x_set_pwrmode(unsigned int mode)
246 */ 258 */
247enum { 259enum {
248 SLEEP_SAVE_PSTR, 260 SLEEP_SAVE_PSTR,
249 SLEEP_SAVE_CKEN,
250 SLEEP_SAVE_MDREFR, 261 SLEEP_SAVE_MDREFR,
251 SLEEP_SAVE_PCFR, 262 SLEEP_SAVE_PCFR,
252 SLEEP_SAVE_COUNT 263 SLEEP_SAVE_COUNT
@@ -254,21 +265,19 @@ enum {
254 265
255void pxa27x_cpu_pm_save(unsigned long *sleep_save) 266void pxa27x_cpu_pm_save(unsigned long *sleep_save)
256{ 267{
257 SAVE(MDREFR); 268 sleep_save[SLEEP_SAVE_MDREFR] = __raw_readl(MDREFR);
258 SAVE(PCFR); 269 SAVE(PCFR);
259 270
260 SAVE(CKEN);
261 SAVE(PSTR); 271 SAVE(PSTR);
262} 272}
263 273
264void pxa27x_cpu_pm_restore(unsigned long *sleep_save) 274void pxa27x_cpu_pm_restore(unsigned long *sleep_save)
265{ 275{
266 RESTORE(MDREFR); 276 __raw_writel(sleep_save[SLEEP_SAVE_MDREFR], MDREFR);
267 RESTORE(PCFR); 277 RESTORE(PCFR);
268 278
269 PSSR = PSSR_RDH | PSSR_PH; 279 PSSR = PSSR_RDH | PSSR_PH;
270 280
271 RESTORE(CKEN);
272 RESTORE(PSTR); 281 RESTORE(PSTR);
273} 282}
274 283
@@ -370,6 +379,27 @@ void __init pxa27x_init_irq(void)
370 pxa_init_gpio(IRQ_GPIO_2_x, 2, 120, pxa27x_set_wake); 379 pxa_init_gpio(IRQ_GPIO_2_x, 2, 120, pxa27x_set_wake);
371} 380}
372 381
382static struct map_desc pxa27x_io_desc[] __initdata = {
383 { /* Mem Ctl */
384 .virtual = SMEMC_VIRT,
385 .pfn = __phys_to_pfn(PXA2XX_SMEMC_BASE),
386 .length = 0x00200000,
387 .type = MT_DEVICE
388 }, { /* IMem ctl */
389 .virtual = 0xfe000000,
390 .pfn = __phys_to_pfn(0x58000000),
391 .length = 0x00100000,
392 .type = MT_DEVICE
393 },
394};
395
396void __init pxa27x_map_io(void)
397{
398 pxa_map_io();
399 iotable_init(ARRAY_AND_SIZE(pxa27x_io_desc));
400 pxa27x_get_clk_frequency_khz(1);
401}
402
373/* 403/*
374 * device registration specific to PXA27x. 404 * device registration specific to PXA27x.
375 */ 405 */
@@ -405,7 +435,9 @@ static struct sys_device pxa27x_sysdev[] = {
405 .cls = &pxa2xx_mfp_sysclass, 435 .cls = &pxa2xx_mfp_sysclass,
406 }, { 436 }, {
407 .cls = &pxa_gpio_sysclass, 437 .cls = &pxa_gpio_sysclass,
408 }, 438 }, {
439 .cls = &pxa2xx_clock_sysclass,
440 }
409}; 441};
410 442
411static int __init pxa27x_init(void) 443static int __init pxa27x_init(void)
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index d1c747cdacf8..e14818f5d950 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -22,6 +22,7 @@
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/sysdev.h> 23#include <linux/sysdev.h>
24 24
25#include <asm/mach/map.h>
25#include <mach/hardware.h> 26#include <mach/hardware.h>
26#include <mach/gpio.h> 27#include <mach/gpio.h>
27#include <mach/pxa3xx-regs.h> 28#include <mach/pxa3xx-regs.h>
@@ -30,193 +31,16 @@
30#include <mach/pm.h> 31#include <mach/pm.h>
31#include <mach/dma.h> 32#include <mach/dma.h>
32#include <mach/regs-intc.h> 33#include <mach/regs-intc.h>
34#include <mach/smemc.h>
33#include <plat/i2c.h> 35#include <plat/i2c.h>
34 36
35#include "generic.h" 37#include "generic.h"
36#include "devices.h" 38#include "devices.h"
37#include "clock.h" 39#include "clock.h"
38 40
39/* Crystal clock: 13MHz */
40#define BASE_CLK 13000000
41
42/* Ring Oscillator Clock: 60MHz */
43#define RO_CLK 60000000
44
45#define ACCR_D0CS (1 << 26)
46#define ACCR_PCCE (1 << 11)
47
48#define PECR_IE(n) ((1 << ((n) * 2)) << 28) 41#define PECR_IE(n) ((1 << ((n) * 2)) << 28)
49#define PECR_IS(n) ((1 << ((n) * 2)) << 29) 42#define PECR_IS(n) ((1 << ((n) * 2)) << 29)
50 43
51/* crystal frequency to static memory controller multiplier (SMCFS) */
52static unsigned char smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, };
53
54/* crystal frequency to HSIO bus frequency multiplier (HSS) */
55static unsigned char hss_mult[4] = { 8, 12, 16, 24 };
56
57/*
58 * Get the clock frequency as reflected by CCSR and the turbo flag.
59 * We assume these values have been applied via a fcs.
60 * If info is not 0 we also display the current settings.
61 */
62unsigned int pxa3xx_get_clk_frequency_khz(int info)
63{
64 unsigned long acsr, xclkcfg;
65 unsigned int t, xl, xn, hss, ro, XL, XN, CLK, HSS;
66
67 /* Read XCLKCFG register turbo bit */
68 __asm__ __volatile__("mrc\tp14, 0, %0, c6, c0, 0" : "=r"(xclkcfg));
69 t = xclkcfg & 0x1;
70
71 acsr = ACSR;
72
73 xl = acsr & 0x1f;
74 xn = (acsr >> 8) & 0x7;
75 hss = (acsr >> 14) & 0x3;
76
77 XL = xl * BASE_CLK;
78 XN = xn * XL;
79
80 ro = acsr & ACCR_D0CS;
81
82 CLK = (ro) ? RO_CLK : ((t) ? XN : XL);
83 HSS = (ro) ? RO_CLK : hss_mult[hss] * BASE_CLK;
84
85 if (info) {
86 pr_info("RO Mode clock: %d.%02dMHz (%sactive)\n",
87 RO_CLK / 1000000, (RO_CLK % 1000000) / 10000,
88 (ro) ? "" : "in");
89 pr_info("Run Mode clock: %d.%02dMHz (*%d)\n",
90 XL / 1000000, (XL % 1000000) / 10000, xl);
91 pr_info("Turbo Mode clock: %d.%02dMHz (*%d, %sactive)\n",
92 XN / 1000000, (XN % 1000000) / 10000, xn,
93 (t) ? "" : "in");
94 pr_info("HSIO bus clock: %d.%02dMHz\n",
95 HSS / 1000000, (HSS % 1000000) / 10000);
96 }
97
98 return CLK / 1000;
99}
100
101void pxa3xx_clear_reset_status(unsigned int mask)
102{
103 /* RESET_STATUS_* has a 1:1 mapping with ARSR */
104 ARSR = mask;
105}
106
107/*
108 * Return the current AC97 clock frequency.
109 */
110static unsigned long clk_pxa3xx_ac97_getrate(struct clk *clk)
111{
112 unsigned long rate = 312000000;
113 unsigned long ac97_div;
114
115 ac97_div = AC97_DIV;
116
117 /* This may loose precision for some rates but won't for the
118 * standard 24.576MHz.
119 */
120 rate /= (ac97_div >> 12) & 0x7fff;
121 rate *= (ac97_div & 0xfff);
122
123 return rate;
124}
125
126/*
127 * Return the current HSIO bus clock frequency
128 */
129static unsigned long clk_pxa3xx_hsio_getrate(struct clk *clk)
130{
131 unsigned long acsr;
132 unsigned int hss, hsio_clk;
133
134 acsr = ACSR;
135
136 hss = (acsr >> 14) & 0x3;
137 hsio_clk = (acsr & ACCR_D0CS) ? RO_CLK : hss_mult[hss] * BASE_CLK;
138
139 return hsio_clk;
140}
141
142void clk_pxa3xx_cken_enable(struct clk *clk)
143{
144 unsigned long mask = 1ul << (clk->cken & 0x1f);
145
146 if (clk->cken < 32)
147 CKENA |= mask;
148 else
149 CKENB |= mask;
150}
151
152void clk_pxa3xx_cken_disable(struct clk *clk)
153{
154 unsigned long mask = 1ul << (clk->cken & 0x1f);
155
156 if (clk->cken < 32)
157 CKENA &= ~mask;
158 else
159 CKENB &= ~mask;
160}
161
162const struct clkops clk_pxa3xx_cken_ops = {
163 .enable = clk_pxa3xx_cken_enable,
164 .disable = clk_pxa3xx_cken_disable,
165};
166
167static const struct clkops clk_pxa3xx_hsio_ops = {
168 .enable = clk_pxa3xx_cken_enable,
169 .disable = clk_pxa3xx_cken_disable,
170 .getrate = clk_pxa3xx_hsio_getrate,
171};
172
173static const struct clkops clk_pxa3xx_ac97_ops = {
174 .enable = clk_pxa3xx_cken_enable,
175 .disable = clk_pxa3xx_cken_disable,
176 .getrate = clk_pxa3xx_ac97_getrate,
177};
178
179static void clk_pout_enable(struct clk *clk)
180{
181 OSCC |= OSCC_PEN;
182}
183
184static void clk_pout_disable(struct clk *clk)
185{
186 OSCC &= ~OSCC_PEN;
187}
188
189static const struct clkops clk_pout_ops = {
190 .enable = clk_pout_enable,
191 .disable = clk_pout_disable,
192};
193
194static void clk_dummy_enable(struct clk *clk)
195{
196}
197
198static void clk_dummy_disable(struct clk *clk)
199{
200}
201
202static const struct clkops clk_dummy_ops = {
203 .enable = clk_dummy_enable,
204 .disable = clk_dummy_disable,
205};
206
207static struct clk clk_pxa3xx_pout = {
208 .ops = &clk_pout_ops,
209 .rate = 13000000,
210 .delay = 70,
211};
212
213static struct clk clk_dummy = {
214 .ops = &clk_dummy_ops,
215};
216
217static DEFINE_PXA3_CK(pxa3xx_lcd, LCD, &clk_pxa3xx_hsio_ops);
218static DEFINE_PXA3_CK(pxa3xx_camera, CAMERA, &clk_pxa3xx_hsio_ops);
219static DEFINE_PXA3_CK(pxa3xx_ac97, AC97, &clk_pxa3xx_ac97_ops);
220static DEFINE_PXA3_CKEN(pxa3xx_ffuart, FFUART, 14857000, 1); 44static DEFINE_PXA3_CKEN(pxa3xx_ffuart, FFUART, 14857000, 1);
221static DEFINE_PXA3_CKEN(pxa3xx_btuart, BTUART, 14857000, 1); 45static DEFINE_PXA3_CKEN(pxa3xx_btuart, BTUART, 14857000, 1);
222static DEFINE_PXA3_CKEN(pxa3xx_stuart, STUART, 14857000, 1); 46static DEFINE_PXA3_CKEN(pxa3xx_stuart, STUART, 14857000, 1);
@@ -234,6 +58,12 @@ static DEFINE_PXA3_CKEN(pxa3xx_pwm1, PWM1, 13000000, 0);
234static DEFINE_PXA3_CKEN(pxa3xx_mmc1, MMC1, 19500000, 0); 58static DEFINE_PXA3_CKEN(pxa3xx_mmc1, MMC1, 19500000, 0);
235static DEFINE_PXA3_CKEN(pxa3xx_mmc2, MMC2, 19500000, 0); 59static DEFINE_PXA3_CKEN(pxa3xx_mmc2, MMC2, 19500000, 0);
236 60
61static DEFINE_CK(pxa3xx_lcd, LCD, &clk_pxa3xx_hsio_ops);
62static DEFINE_CK(pxa3xx_smemc, SMC, &clk_pxa3xx_smemc_ops);
63static DEFINE_CK(pxa3xx_camera, CAMERA, &clk_pxa3xx_hsio_ops);
64static DEFINE_CK(pxa3xx_ac97, AC97, &clk_pxa3xx_ac97_ops);
65static DEFINE_CLK(pxa3xx_pout, &clk_pxa3xx_pout_ops, 13000000, 70);
66
237static struct clk_lookup pxa3xx_clkregs[] = { 67static struct clk_lookup pxa3xx_clkregs[] = {
238 INIT_CLKREG(&clk_pxa3xx_pout, NULL, "CLK_POUT"), 68 INIT_CLKREG(&clk_pxa3xx_pout, NULL, "CLK_POUT"),
239 /* Power I2C clock is always on */ 69 /* Power I2C clock is always on */
@@ -258,6 +88,7 @@ static struct clk_lookup pxa3xx_clkregs[] = {
258 INIT_CLKREG(&clk_pxa3xx_pwm1, "pxa27x-pwm.1", NULL), 88 INIT_CLKREG(&clk_pxa3xx_pwm1, "pxa27x-pwm.1", NULL),
259 INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL), 89 INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL),
260 INIT_CLKREG(&clk_pxa3xx_mmc2, "pxa2xx-mci.1", NULL), 90 INIT_CLKREG(&clk_pxa3xx_mmc2, "pxa2xx-mci.1", NULL),
91 INIT_CLKREG(&clk_pxa3xx_smemc, "pxa2xx-pcmcia", NULL),
261}; 92};
262 93
263#ifdef CONFIG_PM 94#ifdef CONFIG_PM
@@ -268,30 +99,6 @@ static struct clk_lookup pxa3xx_clkregs[] = {
268static void __iomem *sram; 99static void __iomem *sram;
269static unsigned long wakeup_src; 100static unsigned long wakeup_src;
270 101
271#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x
272#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x]
273
274enum { SLEEP_SAVE_CKENA,
275 SLEEP_SAVE_CKENB,
276 SLEEP_SAVE_ACCR,
277
278 SLEEP_SAVE_COUNT,
279};
280
281static void pxa3xx_cpu_pm_save(unsigned long *sleep_save)
282{
283 SAVE(CKENA);
284 SAVE(CKENB);
285 SAVE(ACCR);
286}
287
288static void pxa3xx_cpu_pm_restore(unsigned long *sleep_save)
289{
290 RESTORE(ACCR);
291 RESTORE(CKENA);
292 RESTORE(CKENB);
293}
294
295/* 102/*
296 * Enter a standby mode (S0D1C2 or S0D2C2). Upon wakeup, the dynamic 103 * Enter a standby mode (S0D1C2 or S0D2C2). Upon wakeup, the dynamic
297 * memory controller has to be reinitialised, so we place some code 104 * memory controller has to be reinitialised, so we place some code
@@ -390,9 +197,6 @@ static int pxa3xx_cpu_pm_valid(suspend_state_t state)
390} 197}
391 198
392static struct pxa_cpu_pm_fns pxa3xx_cpu_pm_fns = { 199static struct pxa_cpu_pm_fns pxa3xx_cpu_pm_fns = {
393 .save_count = SLEEP_SAVE_COUNT,
394 .save = pxa3xx_cpu_pm_save,
395 .restore = pxa3xx_cpu_pm_restore,
396 .valid = pxa3xx_cpu_pm_valid, 200 .valid = pxa3xx_cpu_pm_valid,
397 .enter = pxa3xx_cpu_pm_enter, 201 .enter = pxa3xx_cpu_pm_enter,
398}; 202};
@@ -580,6 +384,22 @@ void __init pxa3xx_init_irq(void)
580 pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL); 384 pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL);
581} 385}
582 386
387static struct map_desc pxa3xx_io_desc[] __initdata = {
388 { /* Mem Ctl */
389 .virtual = SMEMC_VIRT,
390 .pfn = __phys_to_pfn(PXA3XX_SMEMC_BASE),
391 .length = 0x00200000,
392 .type = MT_DEVICE
393 }
394};
395
396void __init pxa3xx_map_io(void)
397{
398 pxa_map_io();
399 iotable_init(ARRAY_AND_SIZE(pxa3xx_io_desc));
400 pxa3xx_get_clk_frequency_khz(1);
401}
402
583/* 403/*
584 * device registration specific to PXA3xx. 404 * device registration specific to PXA3xx.
585 */ 405 */
@@ -615,7 +435,9 @@ static struct sys_device pxa3xx_sysdev[] = {
615 .cls = &pxa3xx_mfp_sysclass, 435 .cls = &pxa3xx_mfp_sysclass,
616 }, { 436 }, {
617 .cls = &pxa_gpio_sysclass, 437 .cls = &pxa_gpio_sysclass,
618 }, 438 }, {
439 .cls = &pxa3xx_clock_sysclass,
440 }
619}; 441};
620 442
621static int __init pxa3xx_init(void) 443static int __init pxa3xx_init(void)
diff --git a/arch/arm/mach-pxa/pxa930.c b/arch/arm/mach-pxa/pxa930.c
index 7d29dd3af79d..8aeacf908784 100644
--- a/arch/arm/mach-pxa/pxa930.c
+++ b/arch/arm/mach-pxa/pxa930.c
@@ -192,7 +192,7 @@ static struct mfp_addr_map pxa935_mfp_addr_map[] __initdata = {
192 192
193static int __init pxa930_init(void) 193static int __init pxa930_init(void)
194{ 194{
195 if (cpu_is_pxa930() || cpu_is_pxa935() || cpu_is_pxa950()) { 195 if (cpu_is_pxa93x()) {
196 mfp_init_base(io_p2v(MFPR_BASE)); 196 mfp_init_base(io_p2v(MFPR_BASE));
197 mfp_init_addr(pxa930_mfp_addr_map); 197 mfp_init_addr(pxa930_mfp_addr_map);
198 } 198 }
diff --git a/arch/arm/mach-pxa/pxa95x.c b/arch/arm/mach-pxa/pxa95x.c
new file mode 100644
index 000000000000..437980f72710
--- /dev/null
+++ b/arch/arm/mach-pxa/pxa95x.c
@@ -0,0 +1,308 @@
1/*
2 * linux/arch/arm/mach-pxa/pxa95x.c
3 *
4 * code specific to PXA95x aka MGx
5 *
6 * Copyright (C) 2009-2010 Marvell International Ltd.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/pm.h>
17#include <linux/platform_device.h>
18#include <linux/irq.h>
19#include <linux/io.h>
20#include <linux/sysdev.h>
21
22#include <mach/hardware.h>
23#include <mach/gpio.h>
24#include <mach/pxa3xx-regs.h>
25#include <mach/pxa930.h>
26#include <mach/reset.h>
27#include <mach/pm.h>
28#include <mach/dma.h>
29#include <mach/regs-intc.h>
30#include <plat/i2c.h>
31
32#include "generic.h"
33#include "devices.h"
34#include "clock.h"
35
36static struct mfp_addr_map pxa95x_mfp_addr_map[] __initdata = {
37
38 MFP_ADDR(GPIO0, 0x02e0),
39 MFP_ADDR(GPIO1, 0x02dc),
40 MFP_ADDR(GPIO2, 0x02e8),
41 MFP_ADDR(GPIO3, 0x02d8),
42 MFP_ADDR(GPIO4, 0x02e4),
43 MFP_ADDR(GPIO5, 0x02ec),
44 MFP_ADDR(GPIO6, 0x02f8),
45 MFP_ADDR(GPIO7, 0x02fc),
46 MFP_ADDR(GPIO8, 0x0300),
47 MFP_ADDR(GPIO9, 0x02d4),
48 MFP_ADDR(GPIO10, 0x02f4),
49 MFP_ADDR(GPIO11, 0x02f0),
50 MFP_ADDR(GPIO12, 0x0304),
51 MFP_ADDR(GPIO13, 0x0310),
52 MFP_ADDR(GPIO14, 0x0308),
53 MFP_ADDR(GPIO15, 0x030c),
54 MFP_ADDR(GPIO16, 0x04e8),
55 MFP_ADDR(GPIO17, 0x04f4),
56 MFP_ADDR(GPIO18, 0x04f8),
57 MFP_ADDR(GPIO19, 0x04fc),
58 MFP_ADDR(GPIO20, 0x0518),
59 MFP_ADDR(GPIO21, 0x051c),
60 MFP_ADDR(GPIO22, 0x04ec),
61 MFP_ADDR(GPIO23, 0x0500),
62 MFP_ADDR(GPIO24, 0x04f0),
63 MFP_ADDR(GPIO25, 0x0504),
64 MFP_ADDR(GPIO26, 0x0510),
65 MFP_ADDR(GPIO27, 0x0514),
66 MFP_ADDR(GPIO28, 0x0520),
67 MFP_ADDR(GPIO29, 0x0600),
68 MFP_ADDR(GPIO30, 0x0618),
69 MFP_ADDR(GPIO31, 0x0610),
70 MFP_ADDR(GPIO32, 0x060c),
71 MFP_ADDR(GPIO33, 0x061c),
72 MFP_ADDR(GPIO34, 0x0620),
73 MFP_ADDR(GPIO35, 0x0628),
74 MFP_ADDR(GPIO36, 0x062c),
75 MFP_ADDR(GPIO37, 0x0630),
76 MFP_ADDR(GPIO38, 0x0634),
77 MFP_ADDR(GPIO39, 0x0638),
78 MFP_ADDR(GPIO40, 0x063c),
79 MFP_ADDR(GPIO41, 0x0614),
80 MFP_ADDR(GPIO42, 0x0624),
81 MFP_ADDR(GPIO43, 0x0608),
82 MFP_ADDR(GPIO44, 0x0604),
83 MFP_ADDR(GPIO45, 0x050c),
84 MFP_ADDR(GPIO46, 0x0508),
85 MFP_ADDR(GPIO47, 0x02bc),
86 MFP_ADDR(GPIO48, 0x02b4),
87 MFP_ADDR(GPIO49, 0x02b8),
88 MFP_ADDR(GPIO50, 0x02c8),
89 MFP_ADDR(GPIO51, 0x02c0),
90 MFP_ADDR(GPIO52, 0x02c4),
91 MFP_ADDR(GPIO53, 0x02d0),
92 MFP_ADDR(GPIO54, 0x02cc),
93 MFP_ADDR(GPIO55, 0x029c),
94 MFP_ADDR(GPIO56, 0x02a0),
95 MFP_ADDR(GPIO57, 0x0294),
96 MFP_ADDR(GPIO58, 0x0298),
97 MFP_ADDR(GPIO59, 0x02a4),
98 MFP_ADDR(GPIO60, 0x02a8),
99 MFP_ADDR(GPIO61, 0x02b0),
100 MFP_ADDR(GPIO62, 0x02ac),
101 MFP_ADDR(GPIO63, 0x0640),
102 MFP_ADDR(GPIO64, 0x065c),
103 MFP_ADDR(GPIO65, 0x0648),
104 MFP_ADDR(GPIO66, 0x0644),
105 MFP_ADDR(GPIO67, 0x0674),
106 MFP_ADDR(GPIO68, 0x0658),
107 MFP_ADDR(GPIO69, 0x0654),
108 MFP_ADDR(GPIO70, 0x0660),
109 MFP_ADDR(GPIO71, 0x0668),
110 MFP_ADDR(GPIO72, 0x0664),
111 MFP_ADDR(GPIO73, 0x0650),
112 MFP_ADDR(GPIO74, 0x066c),
113 MFP_ADDR(GPIO75, 0x064c),
114 MFP_ADDR(GPIO76, 0x0670),
115 MFP_ADDR(GPIO77, 0x0678),
116 MFP_ADDR(GPIO78, 0x067c),
117 MFP_ADDR(GPIO79, 0x0694),
118 MFP_ADDR(GPIO80, 0x069c),
119 MFP_ADDR(GPIO81, 0x06a0),
120 MFP_ADDR(GPIO82, 0x06a4),
121 MFP_ADDR(GPIO83, 0x0698),
122 MFP_ADDR(GPIO84, 0x06bc),
123 MFP_ADDR(GPIO85, 0x06b4),
124 MFP_ADDR(GPIO86, 0x06b0),
125 MFP_ADDR(GPIO87, 0x06c0),
126 MFP_ADDR(GPIO88, 0x06c4),
127 MFP_ADDR(GPIO89, 0x06ac),
128 MFP_ADDR(GPIO90, 0x0680),
129 MFP_ADDR(GPIO91, 0x0684),
130 MFP_ADDR(GPIO92, 0x0688),
131 MFP_ADDR(GPIO93, 0x0690),
132 MFP_ADDR(GPIO94, 0x068c),
133 MFP_ADDR(GPIO95, 0x06a8),
134 MFP_ADDR(GPIO96, 0x06b8),
135 MFP_ADDR(GPIO97, 0x0410),
136 MFP_ADDR(GPIO98, 0x0418),
137 MFP_ADDR(GPIO99, 0x041c),
138 MFP_ADDR(GPIO100, 0x0414),
139 MFP_ADDR(GPIO101, 0x0408),
140 MFP_ADDR(GPIO102, 0x0324),
141 MFP_ADDR(GPIO103, 0x040c),
142 MFP_ADDR(GPIO104, 0x0400),
143 MFP_ADDR(GPIO105, 0x0328),
144 MFP_ADDR(GPIO106, 0x0404),
145
146 MFP_ADDR(GPIO159, 0x0524),
147 MFP_ADDR(GPIO163, 0x0534),
148 MFP_ADDR(GPIO167, 0x0544),
149 MFP_ADDR(GPIO168, 0x0548),
150 MFP_ADDR(GPIO169, 0x054c),
151 MFP_ADDR(GPIO170, 0x0550),
152 MFP_ADDR(GPIO171, 0x0554),
153 MFP_ADDR(GPIO172, 0x0558),
154 MFP_ADDR(GPIO173, 0x055c),
155
156 MFP_ADDR(nXCVREN, 0x0204),
157 MFP_ADDR(DF_CLE_nOE, 0x020c),
158 MFP_ADDR(DF_nADV1_ALE, 0x0218),
159 MFP_ADDR(DF_SCLK_E, 0x0214),
160 MFP_ADDR(DF_SCLK_S, 0x0210),
161 MFP_ADDR(nBE0, 0x021c),
162 MFP_ADDR(nBE1, 0x0220),
163 MFP_ADDR(DF_nADV2_ALE, 0x0224),
164 MFP_ADDR(DF_INT_RnB, 0x0228),
165 MFP_ADDR(DF_nCS0, 0x022c),
166 MFP_ADDR(DF_nCS1, 0x0230),
167 MFP_ADDR(nLUA, 0x0254),
168 MFP_ADDR(nLLA, 0x0258),
169 MFP_ADDR(DF_nWE, 0x0234),
170 MFP_ADDR(DF_nRE_nOE, 0x0238),
171 MFP_ADDR(DF_ADDR0, 0x024c),
172 MFP_ADDR(DF_ADDR1, 0x0250),
173 MFP_ADDR(DF_ADDR2, 0x025c),
174 MFP_ADDR(DF_ADDR3, 0x0260),
175 MFP_ADDR(DF_IO0, 0x023c),
176 MFP_ADDR(DF_IO1, 0x0240),
177 MFP_ADDR(DF_IO2, 0x0244),
178 MFP_ADDR(DF_IO3, 0x0248),
179 MFP_ADDR(DF_IO4, 0x0264),
180 MFP_ADDR(DF_IO5, 0x0268),
181 MFP_ADDR(DF_IO6, 0x026c),
182 MFP_ADDR(DF_IO7, 0x0270),
183 MFP_ADDR(DF_IO8, 0x0274),
184 MFP_ADDR(DF_IO9, 0x0278),
185 MFP_ADDR(DF_IO10, 0x027c),
186 MFP_ADDR(DF_IO11, 0x0280),
187 MFP_ADDR(DF_IO12, 0x0284),
188 MFP_ADDR(DF_IO13, 0x0288),
189 MFP_ADDR(DF_IO14, 0x028c),
190 MFP_ADDR(DF_IO15, 0x0290),
191
192 MFP_ADDR(GSIM_UIO, 0x0314),
193 MFP_ADDR(GSIM_UCLK, 0x0318),
194 MFP_ADDR(GSIM_UDET, 0x031c),
195 MFP_ADDR(GSIM_nURST, 0x0320),
196
197 MFP_ADDR(PMIC_INT, 0x06c8),
198
199 MFP_ADDR(RDY, 0x0200),
200
201 MFP_ADDR_END,
202};
203
204static DEFINE_CK(pxa95x_lcd, LCD, &clk_pxa3xx_hsio_ops);
205static DEFINE_CLK(pxa95x_pout, &clk_pxa3xx_pout_ops, 13000000, 70);
206static DEFINE_PXA3_CKEN(pxa95x_ffuart, FFUART, 14857000, 1);
207static DEFINE_PXA3_CKEN(pxa95x_btuart, BTUART, 14857000, 1);
208static DEFINE_PXA3_CKEN(pxa95x_stuart, STUART, 14857000, 1);
209static DEFINE_PXA3_CKEN(pxa95x_i2c, I2C, 32842000, 0);
210static DEFINE_PXA3_CKEN(pxa95x_keypad, KEYPAD, 32768, 0);
211static DEFINE_PXA3_CKEN(pxa95x_ssp1, SSP1, 13000000, 0);
212static DEFINE_PXA3_CKEN(pxa95x_ssp2, SSP2, 13000000, 0);
213static DEFINE_PXA3_CKEN(pxa95x_ssp3, SSP3, 13000000, 0);
214static DEFINE_PXA3_CKEN(pxa95x_ssp4, SSP4, 13000000, 0);
215static DEFINE_PXA3_CKEN(pxa95x_pwm0, PWM0, 13000000, 0);
216static DEFINE_PXA3_CKEN(pxa95x_pwm1, PWM1, 13000000, 0);
217
218static struct clk_lookup pxa95x_clkregs[] = {
219 INIT_CLKREG(&clk_pxa95x_pout, NULL, "CLK_POUT"),
220 /* Power I2C clock is always on */
221 INIT_CLKREG(&clk_dummy, "pxa3xx-pwri2c.1", NULL),
222 INIT_CLKREG(&clk_pxa95x_lcd, "pxa2xx-fb", NULL),
223 INIT_CLKREG(&clk_pxa95x_ffuart, "pxa2xx-uart.0", NULL),
224 INIT_CLKREG(&clk_pxa95x_btuart, "pxa2xx-uart.1", NULL),
225 INIT_CLKREG(&clk_pxa95x_stuart, "pxa2xx-uart.2", NULL),
226 INIT_CLKREG(&clk_pxa95x_stuart, "pxa2xx-ir", "UARTCLK"),
227 INIT_CLKREG(&clk_pxa95x_i2c, "pxa2xx-i2c.0", NULL),
228 INIT_CLKREG(&clk_pxa95x_keypad, "pxa27x-keypad", NULL),
229 INIT_CLKREG(&clk_pxa95x_ssp1, "pxa27x-ssp.0", NULL),
230 INIT_CLKREG(&clk_pxa95x_ssp2, "pxa27x-ssp.1", NULL),
231 INIT_CLKREG(&clk_pxa95x_ssp3, "pxa27x-ssp.2", NULL),
232 INIT_CLKREG(&clk_pxa95x_ssp4, "pxa27x-ssp.3", NULL),
233 INIT_CLKREG(&clk_pxa95x_pwm0, "pxa27x-pwm.0", NULL),
234 INIT_CLKREG(&clk_pxa95x_pwm1, "pxa27x-pwm.1", NULL),
235};
236
237void __init pxa95x_init_irq(void)
238{
239 pxa_init_irq(96, NULL);
240 pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL);
241}
242
243/*
244 * device registration specific to PXA93x.
245 */
246
247void __init pxa95x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
248{
249 pxa_register_device(&pxa3xx_device_i2c_power, info);
250}
251
252static struct platform_device *devices[] __initdata = {
253 &sa1100_device_rtc,
254 &pxa_device_rtc,
255 &pxa27x_device_ssp1,
256 &pxa27x_device_ssp2,
257 &pxa27x_device_ssp3,
258 &pxa3xx_device_ssp4,
259 &pxa27x_device_pwm0,
260 &pxa27x_device_pwm1,
261};
262
263static struct sys_device pxa95x_sysdev[] = {
264 {
265 .cls = &pxa_irq_sysclass,
266 }, {
267 .cls = &pxa_gpio_sysclass,
268 }, {
269 .cls = &pxa3xx_clock_sysclass,
270 }
271};
272
273static int __init pxa95x_init(void)
274{
275 int ret = 0, i;
276
277 if (cpu_is_pxa95x()) {
278 mfp_init_base(io_p2v(MFPR_BASE));
279 mfp_init_addr(pxa95x_mfp_addr_map);
280
281 reset_status = ARSR;
282
283 /*
284 * clear RDH bit every time after reset
285 *
286 * Note: the last 3 bits DxS are write-1-to-clear so carefully
287 * preserve them here in case they will be referenced later
288 */
289 ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S);
290
291 clkdev_add_table(pxa95x_clkregs, ARRAY_SIZE(pxa95x_clkregs));
292
293 if ((ret = pxa_init_dma(IRQ_DMA, 32)))
294 return ret;
295
296 for (i = 0; i < ARRAY_SIZE(pxa95x_sysdev); i++) {
297 ret = sysdev_register(&pxa95x_sysdev[i]);
298 if (ret)
299 pr_err("failed to register sysdev[%d]\n", i);
300 }
301
302 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
303 }
304
305 return ret;
306}
307
308postcore_initcall(pxa95x_init);
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
index 4121d03ea2c3..8361151be054 100644
--- a/arch/arm/mach-pxa/raumfeld.c
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -588,6 +588,9 @@ static struct pxafb_mach_info raumfeld_sharp_lcd_info = {
588 .num_modes = 1, 588 .num_modes = 1,
589 .video_mem_size = 0x400000, 589 .video_mem_size = 0x400000,
590 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, 590 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
591#ifdef CONFIG_PXA3XX_GCU
592 .acceleration_enabled = 1,
593#endif
591}; 594};
592 595
593static void __init raumfeld_lcd_init(void) 596static void __init raumfeld_lcd_init(void)
@@ -616,6 +619,8 @@ static void __init raumfeld_lcd_init(void)
616 pr_warning("Unable to request GPIO_DISPLAY_ENABLE\n"); 619 pr_warning("Unable to request GPIO_DISPLAY_ENABLE\n");
617 else 620 else
618 gpio_direction_output(GPIO_DISPLAY_ENABLE, 1); 621 gpio_direction_output(GPIO_DISPLAY_ENABLE, 1);
622
623 platform_device_register(&pxa3xx_device_gcu);
619} 624}
620 625
621/** 626/**
@@ -1085,7 +1090,7 @@ static void __init raumfeld_speaker_init(void)
1085MACHINE_START(RAUMFELD_RC, "Raumfeld Controller") 1090MACHINE_START(RAUMFELD_RC, "Raumfeld Controller")
1086 .boot_params = RAUMFELD_SDRAM_BASE + 0x100, 1091 .boot_params = RAUMFELD_SDRAM_BASE + 0x100,
1087 .init_machine = raumfeld_controller_init, 1092 .init_machine = raumfeld_controller_init,
1088 .map_io = pxa_map_io, 1093 .map_io = pxa3xx_map_io,
1089 .init_irq = pxa3xx_init_irq, 1094 .init_irq = pxa3xx_init_irq,
1090 .timer = &pxa_timer, 1095 .timer = &pxa_timer,
1091MACHINE_END 1096MACHINE_END
@@ -1095,7 +1100,7 @@ MACHINE_END
1095MACHINE_START(RAUMFELD_CONNECTOR, "Raumfeld Connector") 1100MACHINE_START(RAUMFELD_CONNECTOR, "Raumfeld Connector")
1096 .boot_params = RAUMFELD_SDRAM_BASE + 0x100, 1101 .boot_params = RAUMFELD_SDRAM_BASE + 0x100,
1097 .init_machine = raumfeld_connector_init, 1102 .init_machine = raumfeld_connector_init,
1098 .map_io = pxa_map_io, 1103 .map_io = pxa3xx_map_io,
1099 .init_irq = pxa3xx_init_irq, 1104 .init_irq = pxa3xx_init_irq,
1100 .timer = &pxa_timer, 1105 .timer = &pxa_timer,
1101MACHINE_END 1106MACHINE_END
@@ -1105,7 +1110,7 @@ MACHINE_END
1105MACHINE_START(RAUMFELD_SPEAKER, "Raumfeld Speaker") 1110MACHINE_START(RAUMFELD_SPEAKER, "Raumfeld Speaker")
1106 .boot_params = RAUMFELD_SDRAM_BASE + 0x100, 1111 .boot_params = RAUMFELD_SDRAM_BASE + 0x100,
1107 .init_machine = raumfeld_speaker_init, 1112 .init_machine = raumfeld_speaker_init,
1108 .map_io = pxa_map_io, 1113 .map_io = pxa3xx_map_io,
1109 .init_irq = pxa3xx_init_irq, 1114 .init_irq = pxa3xx_init_irq,
1110 .timer = &pxa_timer, 1115 .timer = &pxa_timer,
1111MACHINE_END 1116MACHINE_END
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c
index ffa50e633ee6..c1ca8cb467fc 100644
--- a/arch/arm/mach-pxa/saar.c
+++ b/arch/arm/mach-pxa/saar.c
@@ -597,7 +597,7 @@ static void __init saar_init(void)
597MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)") 597MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)")
598 /* Maintainer: Eric Miao <eric.miao@marvell.com> */ 598 /* Maintainer: Eric Miao <eric.miao@marvell.com> */
599 .boot_params = 0xa0000100, 599 .boot_params = 0xa0000100,
600 .map_io = pxa_map_io, 600 .map_io = pxa3xx_map_io,
601 .init_irq = pxa3xx_init_irq, 601 .init_irq = pxa3xx_init_irq,
602 .timer = &pxa_timer, 602 .timer = &pxa_timer,
603 .init_machine = saar_init, 603 .init_machine = saar_init,
diff --git a/arch/arm/mach-pxa/saarb.c b/arch/arm/mach-pxa/saarb.c
new file mode 100644
index 000000000000..e497922f761a
--- /dev/null
+++ b/arch/arm/mach-pxa/saarb.c
@@ -0,0 +1,114 @@
1/*
2 * linux/arch/arm/mach-pxa/saarb.c
3 *
4 * Support for the Marvell Handheld Platform (aka SAARB)
5 *
6 * Copyright (C) 2007-2010 Marvell International Ltd.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * publishhed by the Free Software Foundation.
11 */
12
13#include <linux/init.h>
14#include <linux/kernel.h>
15#include <linux/i2c.h>
16#include <linux/mfd/88pm860x.h>
17
18#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20
21#include <mach/irqs.h>
22#include <mach/hardware.h>
23#include <mach/mfp.h>
24#include <mach/mfp-pxa930.h>
25#include <mach/gpio.h>
26
27#include <plat/i2c.h>
28
29#include "generic.h"
30
31#define SAARB_NR_IRQS (IRQ_BOARD_START + 40)
32
33static struct pm860x_touch_pdata saarb_touch = {
34 .gpadc_prebias = 1,
35 .slot_cycle = 1,
36 .tsi_prebias = 6,
37 .pen_prebias = 16,
38 .pen_prechg = 2,
39 .res_x = 300,
40};
41
42static struct pm860x_backlight_pdata saarb_backlight[] = {
43 {
44 .id = PM8606_ID_BACKLIGHT,
45 .iset = PM8606_WLED_CURRENT(24),
46 .flags = PM8606_BACKLIGHT1,
47 },
48 {},
49};
50
51static struct pm860x_led_pdata saarb_led[] = {
52 {
53 .id = PM8606_ID_LED,
54 .iset = PM8606_LED_CURRENT(12),
55 .flags = PM8606_LED1_RED,
56 }, {
57 .id = PM8606_ID_LED,
58 .iset = PM8606_LED_CURRENT(12),
59 .flags = PM8606_LED1_GREEN,
60 }, {
61 .id = PM8606_ID_LED,
62 .iset = PM8606_LED_CURRENT(12),
63 .flags = PM8606_LED1_BLUE,
64 }, {
65 .id = PM8606_ID_LED,
66 .iset = PM8606_LED_CURRENT(12),
67 .flags = PM8606_LED2_RED,
68 }, {
69 .id = PM8606_ID_LED,
70 .iset = PM8606_LED_CURRENT(12),
71 .flags = PM8606_LED2_GREEN,
72 }, {
73 .id = PM8606_ID_LED,
74 .iset = PM8606_LED_CURRENT(12),
75 .flags = PM8606_LED2_BLUE,
76 },
77};
78
79static struct pm860x_platform_data saarb_pm8607_info = {
80 .touch = &saarb_touch,
81 .backlight = &saarb_backlight[0],
82 .led = &saarb_led[0],
83 .companion_addr = 0x10,
84 .irq_mode = 0,
85 .irq_base = IRQ_BOARD_START,
86
87 .i2c_port = GI2C_PORT,
88};
89
90static struct i2c_board_info saarb_i2c_info[] = {
91 {
92 .type = "88PM860x",
93 .addr = 0x34,
94 .platform_data = &saarb_pm8607_info,
95 .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)),
96 },
97};
98
99static void __init saarb_init(void)
100{
101 pxa_set_ffuart_info(NULL);
102 pxa_set_i2c_info(NULL);
103 i2c_register_board_info(0, ARRAY_AND_SIZE(saarb_i2c_info));
104}
105
106MACHINE_START(SAARB, "PXA955 Handheld Platform (aka SAARB)")
107 .boot_params = 0xa0000100,
108 .map_io = pxa_map_io,
109 .nr_irqs = SAARB_NR_IRQS,
110 .init_irq = pxa95x_init_irq,
111 .timer = &pxa_timer,
112 .init_machine = saarb_init,
113MACHINE_END
114
diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S
index ae008110db4e..c551da86baf6 100644
--- a/arch/arm/mach-pxa/sleep.S
+++ b/arch/arm/mach-pxa/sleep.S
@@ -14,7 +14,7 @@
14#include <linux/linkage.h> 14#include <linux/linkage.h>
15#include <asm/assembler.h> 15#include <asm/assembler.h>
16#include <mach/hardware.h> 16#include <mach/hardware.h>
17 17#include <mach/smemc.h>
18#include <mach/pxa2xx-regs.h> 18#include <mach/pxa2xx-regs.h>
19 19
20#define MDREFR_KDIV 0x200a4000 // all banks 20#define MDREFR_KDIV 0x200a4000 // all banks
diff --git a/arch/arm/mach-pxa/smemc.c b/arch/arm/mach-pxa/smemc.c
index d6f6904132a6..232b7316ec08 100644
--- a/arch/arm/mach-pxa/smemc.c
+++ b/arch/arm/mach-pxa/smemc.c
@@ -9,50 +9,37 @@
9#include <linux/sysdev.h> 9#include <linux/sysdev.h>
10 10
11#include <mach/hardware.h> 11#include <mach/hardware.h>
12 12#include <mach/smemc.h>
13#define SMEMC_PHYS_BASE (0x4A000000)
14#define SMEMC_PHYS_SIZE (0x90)
15
16#define MSC0 (0x08) /* Static Memory Controller Register 0 */
17#define MSC1 (0x0C) /* Static Memory Controller Register 1 */
18#define SXCNFG (0x1C) /* Synchronous Static Memory Control Register */
19#define MEMCLKCFG (0x68) /* Clock Configuration */
20#define CSADRCFG0 (0x80) /* Address Configuration Register for CS0 */
21#define CSADRCFG1 (0x84) /* Address Configuration Register for CS1 */
22#define CSADRCFG2 (0x88) /* Address Configuration Register for CS2 */
23#define CSADRCFG3 (0x8C) /* Address Configuration Register for CS3 */
24 13
25#ifdef CONFIG_PM 14#ifdef CONFIG_PM
26static void __iomem *smemc_mmio_base;
27
28static unsigned long msc[2]; 15static unsigned long msc[2];
29static unsigned long sxcnfg, memclkcfg; 16static unsigned long sxcnfg, memclkcfg;
30static unsigned long csadrcfg[4]; 17static unsigned long csadrcfg[4];
31 18
32static int pxa3xx_smemc_suspend(struct sys_device *dev, pm_message_t state) 19static int pxa3xx_smemc_suspend(struct sys_device *dev, pm_message_t state)
33{ 20{
34 msc[0] = __raw_readl(smemc_mmio_base + MSC0); 21 msc[0] = __raw_readl(MSC0);
35 msc[1] = __raw_readl(smemc_mmio_base + MSC1); 22 msc[1] = __raw_readl(MSC1);
36 sxcnfg = __raw_readl(smemc_mmio_base + SXCNFG); 23 sxcnfg = __raw_readl(SXCNFG);
37 memclkcfg = __raw_readl(smemc_mmio_base + MEMCLKCFG); 24 memclkcfg = __raw_readl(MEMCLKCFG);
38 csadrcfg[0] = __raw_readl(smemc_mmio_base + CSADRCFG0); 25 csadrcfg[0] = __raw_readl(CSADRCFG0);
39 csadrcfg[1] = __raw_readl(smemc_mmio_base + CSADRCFG1); 26 csadrcfg[1] = __raw_readl(CSADRCFG1);
40 csadrcfg[2] = __raw_readl(smemc_mmio_base + CSADRCFG2); 27 csadrcfg[2] = __raw_readl(CSADRCFG2);
41 csadrcfg[3] = __raw_readl(smemc_mmio_base + CSADRCFG3); 28 csadrcfg[3] = __raw_readl(CSADRCFG3);
42 29
43 return 0; 30 return 0;
44} 31}
45 32
46static int pxa3xx_smemc_resume(struct sys_device *dev) 33static int pxa3xx_smemc_resume(struct sys_device *dev)
47{ 34{
48 __raw_writel(msc[0], smemc_mmio_base + MSC0); 35 __raw_writel(msc[0], MSC0);
49 __raw_writel(msc[1], smemc_mmio_base + MSC1); 36 __raw_writel(msc[1], MSC1);
50 __raw_writel(sxcnfg, smemc_mmio_base + SXCNFG); 37 __raw_writel(sxcnfg, SXCNFG);
51 __raw_writel(memclkcfg, smemc_mmio_base + MEMCLKCFG); 38 __raw_writel(memclkcfg, MEMCLKCFG);
52 __raw_writel(csadrcfg[0], smemc_mmio_base + CSADRCFG0); 39 __raw_writel(csadrcfg[0], CSADRCFG0);
53 __raw_writel(csadrcfg[1], smemc_mmio_base + CSADRCFG1); 40 __raw_writel(csadrcfg[1], CSADRCFG1);
54 __raw_writel(csadrcfg[2], smemc_mmio_base + CSADRCFG2); 41 __raw_writel(csadrcfg[2], CSADRCFG2);
55 __raw_writel(csadrcfg[3], smemc_mmio_base + CSADRCFG3); 42 __raw_writel(csadrcfg[3], CSADRCFG3);
56 43
57 return 0; 44 return 0;
58} 45}
@@ -73,10 +60,6 @@ static int __init smemc_init(void)
73 int ret = 0; 60 int ret = 0;
74 61
75 if (cpu_is_pxa3xx()) { 62 if (cpu_is_pxa3xx()) {
76 smemc_mmio_base = ioremap(SMEMC_PHYS_BASE, SMEMC_PHYS_SIZE);
77 if (smemc_mmio_base == NULL)
78 return -ENODEV;
79
80 ret = sysdev_class_register(&smemc_sysclass); 63 ret = sysdev_class_register(&smemc_sysclass);
81 if (ret) 64 if (ret)
82 return ret; 65 return ret;
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index f736119f1ebf..0499a69e7673 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -27,6 +27,7 @@
27#include <linux/mtd/sharpsl.h> 27#include <linux/mtd/sharpsl.h>
28#include <linux/input/matrix_keypad.h> 28#include <linux/input/matrix_keypad.h>
29#include <linux/regulator/machine.h> 29#include <linux/regulator/machine.h>
30#include <linux/io.h>
30 31
31#include <asm/setup.h> 32#include <asm/setup.h>
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
@@ -44,6 +45,7 @@
44#include <mach/pxa2xx_spi.h> 45#include <mach/pxa2xx_spi.h>
45#include <mach/spitz.h> 46#include <mach/spitz.h>
46#include <mach/sharpsl_pm.h> 47#include <mach/sharpsl_pm.h>
48#include <mach/smemc.h>
47 49
48#include <plat/i2c.h> 50#include <plat/i2c.h>
49 51
@@ -929,9 +931,10 @@ static void spitz_poweroff(void)
929 931
930static void spitz_restart(char mode, const char *cmd) 932static void spitz_restart(char mode, const char *cmd)
931{ 933{
934 uint32_t msc0 = __raw_readl(MSC0);
932 /* Bootloader magic for a reboot */ 935 /* Bootloader magic for a reboot */
933 if ((MSC0 & 0xffff0000) == 0x7ff00000) 936 if ((msc0 & 0xffff0000) == 0x7ff00000)
934 MSC0 = (MSC0 & 0xffff) | 0x7ee00000; 937 __raw_writel((msc0 & 0xffff) | 0x7ee00000, MSC0);
935 938
936 spitz_poweroff(); 939 spitz_poweroff();
937} 940}
@@ -980,7 +983,7 @@ static void __init spitz_fixup(struct machine_desc *desc,
980#ifdef CONFIG_MACH_SPITZ 983#ifdef CONFIG_MACH_SPITZ
981MACHINE_START(SPITZ, "SHARP Spitz") 984MACHINE_START(SPITZ, "SHARP Spitz")
982 .fixup = spitz_fixup, 985 .fixup = spitz_fixup,
983 .map_io = pxa_map_io, 986 .map_io = pxa27x_map_io,
984 .init_irq = pxa27x_init_irq, 987 .init_irq = pxa27x_init_irq,
985 .init_machine = spitz_init, 988 .init_machine = spitz_init,
986 .timer = &pxa_timer, 989 .timer = &pxa_timer,
@@ -990,7 +993,7 @@ MACHINE_END
990#ifdef CONFIG_MACH_BORZOI 993#ifdef CONFIG_MACH_BORZOI
991MACHINE_START(BORZOI, "SHARP Borzoi") 994MACHINE_START(BORZOI, "SHARP Borzoi")
992 .fixup = spitz_fixup, 995 .fixup = spitz_fixup,
993 .map_io = pxa_map_io, 996 .map_io = pxa27x_map_io,
994 .init_irq = pxa27x_init_irq, 997 .init_irq = pxa27x_init_irq,
995 .init_machine = spitz_init, 998 .init_machine = spitz_init,
996 .timer = &pxa_timer, 999 .timer = &pxa_timer,
@@ -1000,7 +1003,7 @@ MACHINE_END
1000#ifdef CONFIG_MACH_AKITA 1003#ifdef CONFIG_MACH_AKITA
1001MACHINE_START(AKITA, "SHARP Akita") 1004MACHINE_START(AKITA, "SHARP Akita")
1002 .fixup = spitz_fixup, 1005 .fixup = spitz_fixup,
1003 .map_io = pxa_map_io, 1006 .map_io = pxa27x_map_io,
1004 .init_irq = pxa27x_init_irq, 1007 .init_irq = pxa27x_init_irq,
1005 .init_machine = spitz_init, 1008 .init_machine = spitz_init,
1006 .timer = &pxa_timer, 1009 .timer = &pxa_timer,
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
index 738adc1773fd..3498a1423943 100644
--- a/arch/arm/mach-pxa/stargate2.c
+++ b/arch/arm/mach-pxa/stargate2.c
@@ -48,6 +48,7 @@
48#include <mach/udc.h> 48#include <mach/udc.h>
49#include <mach/pxa2xx_spi.h> 49#include <mach/pxa2xx_spi.h>
50#include <mach/pxa27x-udc.h> 50#include <mach/pxa27x-udc.h>
51#include <mach/smemc.h>
51 52
52#include <linux/spi/spi.h> 53#include <linux/spi/spi.h>
53#include <linux/mfd/da903x.h> 54#include <linux/mfd/da903x.h>
@@ -976,7 +977,7 @@ static void __init stargate2_init(void)
976{ 977{
977 /* This is probably a board specific hack as this must be set 978 /* This is probably a board specific hack as this must be set
978 prior to connecting the MFP stuff up. */ 979 prior to connecting the MFP stuff up. */
979 MECR &= ~MECR_NOS; 980 __raw_writel(__raw_readl(MECR) & ~MECR_NOS, MECR);
980 981
981 pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config)); 982 pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config));
982 983
@@ -998,7 +999,7 @@ static void __init stargate2_init(void)
998 999
999#ifdef CONFIG_MACH_INTELMOTE2 1000#ifdef CONFIG_MACH_INTELMOTE2
1000MACHINE_START(INTELMOTE2, "IMOTE 2") 1001MACHINE_START(INTELMOTE2, "IMOTE 2")
1001 .map_io = pxa_map_io, 1002 .map_io = pxa27x_map_io,
1002 .init_irq = pxa27x_init_irq, 1003 .init_irq = pxa27x_init_irq,
1003 .timer = &pxa_timer, 1004 .timer = &pxa_timer,
1004 .init_machine = imote2_init, 1005 .init_machine = imote2_init,
@@ -1008,7 +1009,7 @@ MACHINE_END
1008 1009
1009#ifdef CONFIG_MACH_STARGATE2 1010#ifdef CONFIG_MACH_STARGATE2
1010MACHINE_START(STARGATE2, "Stargate 2") 1011MACHINE_START(STARGATE2, "Stargate 2")
1011 .map_io = pxa_map_io, 1012 .map_io = pxa27x_map_io,
1012 .nr_irqs = STARGATE_NR_IRQS, 1013 .nr_irqs = STARGATE_NR_IRQS,
1013 .init_irq = pxa27x_init_irq, 1014 .init_irq = pxa27x_init_irq,
1014 .timer = &pxa_timer, 1015 .timer = &pxa_timer,
diff --git a/arch/arm/mach-pxa/tavorevb.c b/arch/arm/mach-pxa/tavorevb.c
index 2ea7545273ad..9cecf8366db8 100644
--- a/arch/arm/mach-pxa/tavorevb.c
+++ b/arch/arm/mach-pxa/tavorevb.c
@@ -490,7 +490,7 @@ static void __init tavorevb_init(void)
490MACHINE_START(TAVOREVB, "PXA930 Evaluation Board (aka TavorEVB)") 490MACHINE_START(TAVOREVB, "PXA930 Evaluation Board (aka TavorEVB)")
491 /* Maintainer: Eric Miao <eric.miao@marvell.com> */ 491 /* Maintainer: Eric Miao <eric.miao@marvell.com> */
492 .boot_params = 0xa0000100, 492 .boot_params = 0xa0000100,
493 .map_io = pxa_map_io, 493 .map_io = pxa3xx_map_io,
494 .init_irq = pxa3xx_init_irq, 494 .init_irq = pxa3xx_init_irq,
495 .timer = &pxa_timer, 495 .timer = &pxa_timer,
496 .init_machine = tavorevb_init, 496 .init_machine = tavorevb_init,
diff --git a/arch/arm/mach-pxa/tavorevb3.c b/arch/arm/mach-pxa/tavorevb3.c
index dc3011697bbf..70191a9450eb 100644
--- a/arch/arm/mach-pxa/tavorevb3.c
+++ b/arch/arm/mach-pxa/tavorevb3.c
@@ -127,7 +127,7 @@ static void __init evb3_init(void)
127 127
128MACHINE_START(TAVOREVB3, "PXA950 Evaluation Board (aka TavorEVB3)") 128MACHINE_START(TAVOREVB3, "PXA950 Evaluation Board (aka TavorEVB3)")
129 .boot_params = 0xa0000100, 129 .boot_params = 0xa0000100,
130 .map_io = pxa_map_io, 130 .map_io = pxa3xx_map_io,
131 .nr_irqs = TAVOREVB3_NR_IRQS, 131 .nr_irqs = TAVOREVB3_NR_IRQS,
132 .init_irq = pxa3xx_init_irq, 132 .init_irq = pxa3xx_init_irq,
133 .timer = &pxa_timer, 133 .timer = &pxa_timer,
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 0ee1df49606d..57d61ee9b226 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -46,6 +46,7 @@
46#include <mach/tosa_bt.h> 46#include <mach/tosa_bt.h>
47#include <mach/pxa2xx_spi.h> 47#include <mach/pxa2xx_spi.h>
48#include <mach/audio.h> 48#include <mach/audio.h>
49#include <mach/smemc.h>
49 50
50#include <asm/mach/arch.h> 51#include <asm/mach/arch.h>
51#include <mach/tosa.h> 52#include <mach/tosa.h>
@@ -893,9 +894,11 @@ static void tosa_poweroff(void)
893 894
894static void tosa_restart(char mode, const char *cmd) 895static void tosa_restart(char mode, const char *cmd)
895{ 896{
897 uint32_t msc0 = __raw_readl(MSC0);
898
896 /* Bootloader magic for a reboot */ 899 /* Bootloader magic for a reboot */
897 if((MSC0 & 0xffff0000) == 0x7ff00000) 900 if((msc0 & 0xffff0000) == 0x7ff00000)
898 MSC0 = (MSC0 & 0xffff) | 0x7ee00000; 901 __raw_writel((msc0 & 0xffff) | 0x7ee00000, MSC0);
899 902
900 tosa_poweroff(); 903 tosa_poweroff();
901} 904}
@@ -953,7 +956,7 @@ static void __init fixup_tosa(struct machine_desc *desc,
953 956
954MACHINE_START(TOSA, "SHARP Tosa") 957MACHINE_START(TOSA, "SHARP Tosa")
955 .fixup = fixup_tosa, 958 .fixup = fixup_tosa,
956 .map_io = pxa_map_io, 959 .map_io = pxa25x_map_io,
957 .nr_irqs = TOSA_NR_IRQS, 960 .nr_irqs = TOSA_NR_IRQS,
958 .init_irq = pxa25x_init_irq, 961 .init_irq = pxa25x_init_irq,
959 .init_machine = tosa_init, 962 .init_machine = tosa_init,
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index 565d062f51d5..43fc9ca14594 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -47,6 +47,7 @@
47#include <mach/mmc.h> 47#include <mach/mmc.h>
48#include <mach/irda.h> 48#include <mach/irda.h>
49#include <mach/ohci.h> 49#include <mach/ohci.h>
50#include <mach/smemc.h>
50#include <plat/i2c.h> 51#include <plat/i2c.h>
51 52
52#include "generic.h" 53#include "generic.h"
@@ -539,10 +540,10 @@ static void __init trizeps4_init(void)
539 540
540static void __init trizeps4_map_io(void) 541static void __init trizeps4_map_io(void)
541{ 542{
542 pxa_map_io(); 543 pxa27x_map_io();
543 iotable_init(trizeps4_io_desc, ARRAY_SIZE(trizeps4_io_desc)); 544 iotable_init(trizeps4_io_desc, ARRAY_SIZE(trizeps4_io_desc));
544 545
545 if ((MSC0 & 0x8) && (BOOT_DEF & 0x1)) { 546 if ((__raw_readl(MSC0) & 0x8) && (__raw_readl(BOOT_DEF) & 0x1)) {
546 /* if flash is 16 bit wide its a Trizeps4 WL */ 547 /* if flash is 16 bit wide its a Trizeps4 WL */
547 __machine_arch_type = MACH_TYPE_TRIZEPS4WL; 548 __machine_arch_type = MACH_TYPE_TRIZEPS4WL;
548 trizeps4_flash_data[0].width = 2; 549 trizeps4_flash_data[0].width = 2;
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index 438fc9a5ed59..de69b203afa7 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -983,7 +983,7 @@ static struct map_desc viper_io_desc[] __initdata = {
983 983
984static void __init viper_map_io(void) 984static void __init viper_map_io(void)
985{ 985{
986 pxa_map_io(); 986 pxa25x_map_io();
987 987
988 iotable_init(viper_io_desc, ARRAY_SIZE(viper_io_desc)); 988 iotable_init(viper_io_desc, ARRAY_SIZE(viper_io_desc));
989 989
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
index f45ac0961778..b9b579715ff6 100644
--- a/arch/arm/mach-pxa/vpac270.c
+++ b/arch/arm/mach-pxa/vpac270.c
@@ -719,7 +719,7 @@ static void __init vpac270_init(void)
719 719
720MACHINE_START(VPAC270, "Voipac PXA270") 720MACHINE_START(VPAC270, "Voipac PXA270")
721 .boot_params = 0xa0000100, 721 .boot_params = 0xa0000100,
722 .map_io = pxa_map_io, 722 .map_io = pxa27x_map_io,
723 .init_irq = pxa27x_init_irq, 723 .init_irq = pxa27x_init_irq,
724 .timer = &pxa_timer, 724 .timer = &pxa_timer,
725 .init_machine = vpac270_init 725 .init_machine = vpac270_init
diff --git a/arch/arm/mach-pxa/xcep.c b/arch/arm/mach-pxa/xcep.c
index 3260ce73d327..51c0281c6e0a 100644
--- a/arch/arm/mach-pxa/xcep.c
+++ b/arch/arm/mach-pxa/xcep.c
@@ -31,6 +31,7 @@
31#include <mach/hardware.h> 31#include <mach/hardware.h>
32#include <mach/pxa2xx-regs.h> 32#include <mach/pxa2xx-regs.h>
33#include <mach/mfp-pxa25x.h> 33#include <mach/mfp-pxa25x.h>
34#include <mach/smemc.h>
34 35
35#include "generic.h" 36#include "generic.h"
36 37
@@ -172,9 +173,9 @@ static void __init xcep_init(void)
172 173
173 /* See Intel XScale Developer's Guide for details */ 174 /* See Intel XScale Developer's Guide for details */
174 /* Set RDF and RDN to appropriate values (chip select 3 (smc91x)) */ 175 /* Set RDF and RDN to appropriate values (chip select 3 (smc91x)) */
175 MSC1 = (MSC1 & 0xffff) | 0xD5540000; 176 __raw_writel((__raw_readl(MSC1) & 0xffff) | 0xD5540000, MSC1);
176 /* Set RDF and RDN to appropriate values (chip select 5 (fpga)) */ 177 /* Set RDF and RDN to appropriate values (chip select 5 (fpga)) */
177 MSC2 = (MSC2 & 0xffff) | 0x72A00000; 178 __raw_writel((__raw_readl(MSC2) & 0xffff) | 0x72A00000, MSC2);
178 179
179 platform_add_devices(ARRAY_AND_SIZE(devices)); 180 platform_add_devices(ARRAY_AND_SIZE(devices));
180 pxa_set_i2c_info(&xcep_i2c_platform_data); 181 pxa_set_i2c_info(&xcep_i2c_platform_data);
@@ -183,7 +184,7 @@ static void __init xcep_init(void)
183MACHINE_START(XCEP, "Iskratel XCEP") 184MACHINE_START(XCEP, "Iskratel XCEP")
184 .boot_params = 0xa0000100, 185 .boot_params = 0xa0000100,
185 .init_machine = xcep_init, 186 .init_machine = xcep_init,
186 .map_io = pxa_map_io, 187 .map_io = pxa25x_map_io,
187 .init_irq = pxa25x_init_irq, 188 .init_irq = pxa25x_init_irq,
188 .timer = &pxa_timer, 189 .timer = &pxa_timer,
189MACHINE_END 190MACHINE_END
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
index fefde9848d82..527c2a1ed310 100644
--- a/arch/arm/mach-pxa/z2.c
+++ b/arch/arm/mach-pxa/z2.c
@@ -704,7 +704,7 @@ static void __init z2_init(void)
704 704
705MACHINE_START(ZIPIT2, "Zipit Z2") 705MACHINE_START(ZIPIT2, "Zipit Z2")
706 .boot_params = 0xa0000100, 706 .boot_params = 0xa0000100,
707 .map_io = pxa_map_io, 707 .map_io = pxa27x_map_io,
708 .init_irq = pxa27x_init_irq, 708 .init_irq = pxa27x_init_irq,
709 .timer = &pxa_timer, 709 .timer = &pxa_timer,
710 .init_machine = z2_init, 710 .init_machine = z2_init,
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index dea46a2d089b..c87f2b35ee05 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -47,6 +47,7 @@
47#include <mach/audio.h> 47#include <mach/audio.h>
48#include <mach/arcom-pcmcia.h> 48#include <mach/arcom-pcmcia.h>
49#include <mach/zeus.h> 49#include <mach/zeus.h>
50#include <mach/smemc.h>
50 51
51#include "generic.h" 52#include "generic.h"
52 53
@@ -823,13 +824,16 @@ static mfp_cfg_t zeus_pin_config[] __initdata = {
823static void __init zeus_init(void) 824static void __init zeus_init(void)
824{ 825{
825 u16 dm9000_msc = DM9K_MSC_VALUE; 826 u16 dm9000_msc = DM9K_MSC_VALUE;
827 u32 msc0, msc1;
826 828
827 system_rev = __raw_readw(ZEUS_CPLD_VERSION); 829 system_rev = __raw_readw(ZEUS_CPLD_VERSION);
828 pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4, (system_rev & 0x0f)); 830 pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4, (system_rev & 0x0f));
829 831
830 /* Fix timings for dm9000s (CS1/CS2)*/ 832 /* Fix timings for dm9000s (CS1/CS2)*/
831 MSC0 = (MSC0 & 0xffff) | (dm9000_msc << 16); 833 msc0 = __raw_readl(MSC0) & 0x0000ffff | (dm9000_msc << 16);
832 MSC1 = (MSC1 & 0xffff0000) | dm9000_msc; 834 msc1 = __raw_readl(MSC1) & 0xffff0000 | dm9000_msc;
835 __raw_writel(msc0, MSC0);
836 __raw_writel(msc1, MSC1);
833 837
834 pm_power_off = zeus_power_off; 838 pm_power_off = zeus_power_off;
835 zeus_setup_apm(); 839 zeus_setup_apm();
@@ -883,7 +887,7 @@ static struct map_desc zeus_io_desc[] __initdata = {
883 887
884static void __init zeus_map_io(void) 888static void __init zeus_map_io(void)
885{ 889{
886 pxa_map_io(); 890 pxa27x_map_io();
887 891
888 iotable_init(zeus_io_desc, ARRAY_SIZE(zeus_io_desc)); 892 iotable_init(zeus_io_desc, ARRAY_SIZE(zeus_io_desc));
889 893
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c
index 702f7a68e87d..a4c784aab764 100644
--- a/arch/arm/mach-pxa/zylonite.c
+++ b/arch/arm/mach-pxa/zylonite.c
@@ -423,7 +423,7 @@ static void __init zylonite_init(void)
423 423
424MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)") 424MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)")
425 .boot_params = 0xa0000100, 425 .boot_params = 0xa0000100,
426 .map_io = pxa_map_io, 426 .map_io = pxa3xx_map_io,
427 .nr_irqs = ZYLONITE_NR_IRQS, 427 .nr_irqs = ZYLONITE_NR_IRQS,
428 .init_irq = pxa3xx_init_irq, 428 .init_irq = pxa3xx_init_irq,
429 .timer = &pxa_timer, 429 .timer = &pxa_timer,