aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx5
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-01-06 17:33:32 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-01-06 17:33:32 -0500
commit404a02cbd2ae8bf256a2fa1169bdfe86bb5ebb34 (patch)
tree99119edc53fdca73ed7586829b8ee736e09440b3 /arch/arm/mach-mx5
parent28cdac6690cb113856293bf79b40de33dbd8f974 (diff)
parent1051b9f0f9eab8091fe3bf98320741adf36b4cfa (diff)
Merge branch 'devel-stable' into devel
Conflicts: arch/arm/mach-pxa/clock.c arch/arm/mach-pxa/clock.h
Diffstat (limited to 'arch/arm/mach-mx5')
-rw-r--r--arch/arm/mach-mx5/Kconfig63
-rw-r--r--arch/arm/mach-mx5/Makefile5
-rw-r--r--arch/arm/mach-mx5/Makefile.boot12
-rw-r--r--arch/arm/mach-mx5/board-cpuimx51.c32
-rw-r--r--arch/arm/mach-mx5/board-cpuimx51sd.c68
-rw-r--r--arch/arm/mach-mx5/board-mx50_rdp.c197
-rw-r--r--arch/arm/mach-mx5/board-mx51_3ds.c9
-rw-r--r--arch/arm/mach-mx5/board-mx51_babbage.c101
-rw-r--r--arch/arm/mach-mx5/board-mx51_efikamx.c247
-rw-r--r--arch/arm/mach-mx5/board-mx53_evk.c84
-rw-r--r--arch/arm/mach-mx5/clock-mx51-mx53.c (renamed from arch/arm/mach-mx5/clock-mx51.c)296
-rw-r--r--arch/arm/mach-mx5/cpu.c118
-rw-r--r--arch/arm/mach-mx5/crm_regs.h10
-rw-r--r--arch/arm/mach-mx5/devices-imx51.h11
-rw-r--r--arch/arm/mach-mx5/devices-imx53.h13
-rw-r--r--arch/arm/mach-mx5/devices-mx50.h26
-rw-r--r--arch/arm/mach-mx5/devices.c51
-rw-r--r--arch/arm/mach-mx5/devices.h2
-rw-r--r--arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c26
-rw-r--r--arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c17
-rw-r--r--arch/arm/mach-mx5/mm-mx50.c59
-rw-r--r--arch/arm/mach-mx5/mm.c75
22 files changed, 1310 insertions, 212 deletions
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
index 3ec910a7a182..55254b6e9460 100644
--- a/arch/arm/mach-mx5/Kconfig
+++ b/arch/arm/mach-mx5/Kconfig
@@ -1,20 +1,47 @@
1if ARCH_MX5 1if ARCH_MX5
2# ARCH_MX51 and ARCH_MX50 are left for compatibility
3
4config ARCH_MX50
5 bool
2 6
3config ARCH_MX51 7config ARCH_MX51
4 bool 8 bool
5 default y 9
10config ARCH_MX53
11 bool
12
13config SOC_IMX50
14 bool
15 select MXC_TZIC
16 select ARCH_MXC_IOMUX_V3
17 select ARCH_MXC_AUDMUX_V2
18 select ARCH_HAS_CPUFREQ
19 select ARCH_MX50
20
21config SOC_IMX51
22 bool
6 select MXC_TZIC 23 select MXC_TZIC
7 select ARCH_MXC_IOMUX_V3 24 select ARCH_MXC_IOMUX_V3
8 select ARCH_MXC_AUDMUX_V2 25 select ARCH_MXC_AUDMUX_V2
9 select ARCH_HAS_CPUFREQ 26 select ARCH_HAS_CPUFREQ
27 select ARCH_MX51
28
29config SOC_IMX53
30 bool
31 select MXC_TZIC
32 select ARCH_MXC_IOMUX_V3
33 select ARCH_MX53
10 34
11comment "MX5 platforms:" 35comment "MX5 platforms:"
12 36
13config MACH_MX51_BABBAGE 37config MACH_MX51_BABBAGE
14 bool "Support MX51 BABBAGE platforms" 38 bool "Support MX51 BABBAGE platforms"
39 select SOC_IMX51
40 select IMX_HAVE_PLATFORM_IMX2_WDT
15 select IMX_HAVE_PLATFORM_IMX_I2C 41 select IMX_HAVE_PLATFORM_IMX_I2C
16 select IMX_HAVE_PLATFORM_IMX_UART 42 select IMX_HAVE_PLATFORM_IMX_UART
17 select IMX_HAVE_PLATFORM_ESDHC 43 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
44 select IMX_HAVE_PLATFORM_SPI_IMX
18 help 45 help
19 Include support for MX51 Babbage platform, also known as MX51EVK in 46 Include support for MX51 Babbage platform, also known as MX51EVK in
20 u-boot. This includes specific configurations for the board and its 47 u-boot. This includes specific configurations for the board and its
@@ -22,7 +49,9 @@ config MACH_MX51_BABBAGE
22 49
23config MACH_MX51_3DS 50config MACH_MX51_3DS
24 bool "Support MX51PDK (3DS)" 51 bool "Support MX51PDK (3DS)"
52 select SOC_IMX51
25 select IMX_HAVE_PLATFORM_IMX_UART 53 select IMX_HAVE_PLATFORM_IMX_UART
54 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
26 select IMX_HAVE_PLATFORM_SPI_IMX 55 select IMX_HAVE_PLATFORM_SPI_IMX
27 select MXC_DEBUG_BOARD 56 select MXC_DEBUG_BOARD
28 help 57 help
@@ -31,6 +60,7 @@ config MACH_MX51_3DS
31 60
32config MACH_EUKREA_CPUIMX51 61config MACH_EUKREA_CPUIMX51
33 bool "Support Eukrea CPUIMX51 module" 62 bool "Support Eukrea CPUIMX51 module"
63 select SOC_IMX51
34 select IMX_HAVE_PLATFORM_IMX_I2C 64 select IMX_HAVE_PLATFORM_IMX_I2C
35 select IMX_HAVE_PLATFORM_IMX_UART 65 select IMX_HAVE_PLATFORM_IMX_UART
36 select IMX_HAVE_PLATFORM_MXC_NAND 66 select IMX_HAVE_PLATFORM_MXC_NAND
@@ -47,7 +77,7 @@ choice
47config MACH_EUKREA_MBIMX51_BASEBOARD 77config MACH_EUKREA_MBIMX51_BASEBOARD
48 prompt "Eukrea MBIMX51 development board" 78 prompt "Eukrea MBIMX51 development board"
49 bool 79 bool
50 select IMX_HAVE_PLATFORM_ESDHC 80 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
51 help 81 help
52 This adds board specific devices that can be found on Eukrea's 82 This adds board specific devices that can be found on Eukrea's
53 MBIMX51 evaluation board. 83 MBIMX51 evaluation board.
@@ -56,6 +86,7 @@ endchoice
56 86
57config MACH_EUKREA_CPUIMX51SD 87config MACH_EUKREA_CPUIMX51SD
58 bool "Support Eukrea CPUIMX51SD module" 88 bool "Support Eukrea CPUIMX51SD module"
89 select SOC_IMX51
59 select IMX_HAVE_PLATFORM_IMX_I2C 90 select IMX_HAVE_PLATFORM_IMX_I2C
60 select IMX_HAVE_PLATFORM_SPI_IMX 91 select IMX_HAVE_PLATFORM_SPI_IMX
61 select IMX_HAVE_PLATFORM_IMX_UART 92 select IMX_HAVE_PLATFORM_IMX_UART
@@ -72,7 +103,7 @@ choice
72config MACH_EUKREA_MBIMXSD51_BASEBOARD 103config MACH_EUKREA_MBIMXSD51_BASEBOARD
73 prompt "Eukrea MBIMXSD development board" 104 prompt "Eukrea MBIMXSD development board"
74 bool 105 bool
75 select IMX_HAVE_PLATFORM_ESDHC 106 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
76 help 107 help
77 This adds board specific devices that can be found on Eukrea's 108 This adds board specific devices that can be found on Eukrea's
78 MBIMXSD evaluation board. 109 MBIMXSD evaluation board.
@@ -81,9 +112,33 @@ endchoice
81 112
82config MACH_MX51_EFIKAMX 113config MACH_MX51_EFIKAMX
83 bool "Support MX51 Genesi Efika MX nettop" 114 bool "Support MX51 Genesi Efika MX nettop"
115 select SOC_IMX51
84 select IMX_HAVE_PLATFORM_IMX_UART 116 select IMX_HAVE_PLATFORM_IMX_UART
117 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
118 select IMX_HAVE_PLATFORM_SPI_IMX
85 help 119 help
86 Include support for Genesi Efika MX nettop. This includes specific 120 Include support for Genesi Efika MX nettop. This includes specific
87 configurations for the board and its peripherals. 121 configurations for the board and its peripherals.
88 122
123config MACH_MX53_EVK
124 bool "Support MX53 EVK platforms"
125 select SOC_IMX53
126 select IMX_HAVE_PLATFORM_IMX_UART
127 help
128 Include support for MX53 EVK platform. This includes specific
129 configurations for the board and its peripherals.
130
131
132config MACH_MX50_RDP
133 bool "Support MX50 reference design platform"
134 depends on BROKEN
135 select SOC_IMX50
136 select IMX_HAVE_PLATFORM_IMX_I2C
137 select IMX_HAVE_PLATFORM_IMX_UART
138 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
139 select IMX_HAVE_PLATFORM_SPI_IMX
140 help
141 Include support for MX50 reference design platform (RDP) board. This
142 includes specific configurations for the board and its peripherals.
143
89endif 144endif
diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile
index 462f177eddfe..0c398baf11fe 100644
--- a/arch/arm/mach-mx5/Makefile
+++ b/arch/arm/mach-mx5/Makefile
@@ -3,13 +3,16 @@
3# 3#
4 4
5# Object file lists. 5# Object file lists.
6obj-y := cpu.o mm.o clock-mx51.o devices.o 6obj-y := cpu.o mm.o clock-mx51-mx53.o devices.o
7obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
7 8
8obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o 9obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o
9obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o 10obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o
10obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o 11obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o
12obj-$(CONFIG_MACH_MX53_EVK) += board-mx53_evk.o
11obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o 13obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o
12obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o 14obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o
13obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += board-cpuimx51sd.o 15obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += board-cpuimx51sd.o
14obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd-baseboard.o 16obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd-baseboard.o
15obj-$(CONFIG_MACH_MX51_EFIKAMX) += board-mx51_efikamx.o 17obj-$(CONFIG_MACH_MX51_EFIKAMX) += board-mx51_efikamx.o
18obj-$(CONFIG_MACH_MX50_RDP) += board-mx50_rdp.o
diff --git a/arch/arm/mach-mx5/Makefile.boot b/arch/arm/mach-mx5/Makefile.boot
index 9939a19d99a1..e928be1b6757 100644
--- a/arch/arm/mach-mx5/Makefile.boot
+++ b/arch/arm/mach-mx5/Makefile.boot
@@ -1,3 +1,9 @@
1 zreladdr-y := 0x90008000 1 zreladdr-$(CONFIG_ARCH_MX50) := 0x70008000
2params_phys-y := 0x90000100 2params_phys-$(CONFIG_ARCH_MX50) := 0x70000100
3initrd_phys-y := 0x90800000 3initrd_phys-$(CONFIG_ARCH_MX50) := 0x70800000
4 zreladdr-$(CONFIG_ARCH_MX51) := 0x90008000
5params_phys-$(CONFIG_ARCH_MX51) := 0x90000100
6initrd_phys-$(CONFIG_ARCH_MX51) := 0x90800000
7 zreladdr-$(CONFIG_ARCH_MX53) := 0x70008000
8params_phys-$(CONFIG_ARCH_MX53) := 0x70000100
9initrd_phys-$(CONFIG_ARCH_MX53) := 0x70800000
diff --git a/arch/arm/mach-mx5/board-cpuimx51.c b/arch/arm/mach-mx5/board-cpuimx51.c
index 6a9792fd0a76..f8652ef25f85 100644
--- a/arch/arm/mach-mx5/board-cpuimx51.c
+++ b/arch/arm/mach-mx5/board-cpuimx51.c
@@ -40,11 +40,11 @@
40#include "devices-imx51.h" 40#include "devices-imx51.h"
41#include "devices.h" 41#include "devices.h"
42 42
43#define CPUIMX51_USBH1_STP (0*32 + 27) 43#define CPUIMX51_USBH1_STP IMX_GPIO_NR(1, 27)
44#define CPUIMX51_QUARTA_GPIO (2*32 + 28) 44#define CPUIMX51_QUARTA_GPIO IMX_GPIO_NR(3, 28)
45#define CPUIMX51_QUARTB_GPIO (2*32 + 25) 45#define CPUIMX51_QUARTB_GPIO IMX_GPIO_NR(3, 25)
46#define CPUIMX51_QUARTC_GPIO (2*32 + 26) 46#define CPUIMX51_QUARTC_GPIO IMX_GPIO_NR(3, 26)
47#define CPUIMX51_QUARTD_GPIO (2*32 + 27) 47#define CPUIMX51_QUARTD_GPIO IMX_GPIO_NR(3, 27)
48#define CPUIMX51_QUARTA_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTA_GPIO) 48#define CPUIMX51_QUARTA_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTA_GPIO)
49#define CPUIMX51_QUARTB_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTB_GPIO) 49#define CPUIMX51_QUARTB_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTB_GPIO)
50#define CPUIMX51_QUARTC_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTC_GPIO) 50#define CPUIMX51_QUARTC_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTC_GPIO)
@@ -113,7 +113,7 @@ static struct platform_device *devices[] __initdata = {
113#endif 113#endif
114}; 114};
115 115
116static struct pad_desc eukrea_cpuimx51_pads[] = { 116static iomux_v3_cfg_t eukrea_cpuimx51_pads[] = {
117 /* UART1 */ 117 /* UART1 */
118 MX51_PAD_UART1_RXD__UART1_RXD, 118 MX51_PAD_UART1_RXD__UART1_RXD,
119 MX51_PAD_UART1_TXD__UART1_TXD, 119 MX51_PAD_UART1_TXD__UART1_TXD,
@@ -121,15 +121,15 @@ static struct pad_desc eukrea_cpuimx51_pads[] = {
121 MX51_PAD_UART1_CTS__UART1_CTS, 121 MX51_PAD_UART1_CTS__UART1_CTS,
122 122
123 /* I2C2 */ 123 /* I2C2 */
124 MX51_PAD_GPIO_1_2__I2C2_SCL, 124 MX51_PAD_GPIO1_2__I2C2_SCL,
125 MX51_PAD_GPIO_1_3__I2C2_SDA, 125 MX51_PAD_GPIO1_3__I2C2_SDA,
126 MX51_PAD_NANDF_D10__GPIO_3_30, 126 MX51_PAD_NANDF_D10__GPIO3_30,
127 127
128 /* QUART IRQ */ 128 /* QUART IRQ */
129 MX51_PAD_NANDF_D15__GPIO_3_25, 129 MX51_PAD_NANDF_D15__GPIO3_25,
130 MX51_PAD_NANDF_D14__GPIO_3_26, 130 MX51_PAD_NANDF_D14__GPIO3_26,
131 MX51_PAD_NANDF_D13__GPIO_3_27, 131 MX51_PAD_NANDF_D13__GPIO3_27,
132 MX51_PAD_NANDF_D12__GPIO_3_28, 132 MX51_PAD_NANDF_D12__GPIO3_28,
133 133
134 /* USB HOST1 */ 134 /* USB HOST1 */
135 MX51_PAD_USBH1_CLK__USBH1_CLK, 135 MX51_PAD_USBH1_CLK__USBH1_CLK,
@@ -178,6 +178,8 @@ static int initialize_otg_port(struct platform_device *pdev)
178 void __iomem *usbother_base; 178 void __iomem *usbother_base;
179 179
180 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); 180 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
181 if (!usb_base)
182 return -ENOMEM;
181 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; 183 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
182 184
183 /* Set the PHY clock to 19.2MHz */ 185 /* Set the PHY clock to 19.2MHz */
@@ -196,6 +198,8 @@ static int initialize_usbh1_port(struct platform_device *pdev)
196 void __iomem *usbother_base; 198 void __iomem *usbother_base;
197 199
198 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); 200 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
201 if (!usb_base)
202 return -ENOMEM;
199 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; 203 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
200 204
201 /* The clock for the USBH1 ULPI port will come externally from the PHY. */ 205 /* The clock for the USBH1 ULPI port will come externally from the PHY. */
@@ -292,7 +296,7 @@ static struct sys_timer mxc_timer = {
292 296
293MACHINE_START(EUKREA_CPUIMX51, "Eukrea CPUIMX51 Module") 297MACHINE_START(EUKREA_CPUIMX51, "Eukrea CPUIMX51 Module")
294 /* Maintainer: Eric Bénard <eric@eukrea.com> */ 298 /* Maintainer: Eric Bénard <eric@eukrea.com> */
295 .boot_params = PHYS_OFFSET + 0x100, 299 .boot_params = MX51_PHYS_OFFSET + 0x100,
296 .map_io = mx51_map_io, 300 .map_io = mx51_map_io,
297 .init_irq = mx51_init_irq, 301 .init_irq = mx51_init_irq,
298 .init_machine = eukrea_cpuimx51_init, 302 .init_machine = eukrea_cpuimx51_init,
diff --git a/arch/arm/mach-mx5/board-cpuimx51sd.c b/arch/arm/mach-mx5/board-cpuimx51sd.c
index 4b3a6119c5fb..ad931895d8b6 100644
--- a/arch/arm/mach-mx5/board-cpuimx51sd.c
+++ b/arch/arm/mach-mx5/board-cpuimx51sd.c
@@ -43,19 +43,19 @@
43#include "devices-imx51.h" 43#include "devices-imx51.h"
44#include "devices.h" 44#include "devices.h"
45 45
46#define USBH1_RST (1*32 + 28) 46#define USBH1_RST IMX_GPIO_NR(2, 28)
47#define ETH_RST (1*32 + 31) 47#define ETH_RST IMX_GPIO_NR(2, 31)
48#define TSC2007_IRQGPIO (2*32 + 12) 48#define TSC2007_IRQGPIO IMX_GPIO_NR(3, 12)
49#define CAN_IRQGPIO (0*32 + 1) 49#define CAN_IRQGPIO IMX_GPIO_NR(1, 1)
50#define CAN_RST (3*32 + 15) 50#define CAN_RST IMX_GPIO_NR(4, 15)
51#define CAN_NCS (3*32 + 24) 51#define CAN_NCS IMX_GPIO_NR(4, 24)
52#define CAN_RXOBF (0*32 + 4) 52#define CAN_RXOBF IMX_GPIO_NR(1, 4)
53#define CAN_RX1BF (0*32 + 6) 53#define CAN_RX1BF IMX_GPIO_NR(1, 6)
54#define CAN_TXORTS (0*32 + 7) 54#define CAN_TXORTS IMX_GPIO_NR(1, 7)
55#define CAN_TX1RTS (0*32 + 8) 55#define CAN_TX1RTS IMX_GPIO_NR(1, 8)
56#define CAN_TX2RTS (0*32 + 9) 56#define CAN_TX2RTS IMX_GPIO_NR(1, 9)
57#define I2C_SCL (3*32 + 16) 57#define I2C_SCL IMX_GPIO_NR(4, 16)
58#define I2C_SDA (3*32 + 17) 58#define I2C_SDA IMX_GPIO_NR(4, 17)
59 59
60/* USB_CTRL_1 */ 60/* USB_CTRL_1 */
61#define MX51_USB_CTRL_1_OFFSET 0x10 61#define MX51_USB_CTRL_1_OFFSET 0x10
@@ -65,10 +65,7 @@
65#define MX51_USB_PLL_DIV_19_2_MHZ 0x01 65#define MX51_USB_PLL_DIV_19_2_MHZ 0x01
66#define MX51_USB_PLL_DIV_24_MHZ 0x02 66#define MX51_USB_PLL_DIV_24_MHZ 0x02
67 67
68#define CPUIMX51SD_GPIO_3_12 IOMUX_PAD(0x57C, 0x194, 3, 0x0, 0, \ 68static iomux_v3_cfg_t eukrea_cpuimx51sd_pads[] = {
69 MX51_PAD_CTRL_1 | PAD_CTL_PUS_22K_UP)
70
71static struct pad_desc eukrea_cpuimx51sd_pads[] = {
72 /* UART1 */ 69 /* UART1 */
73 MX51_PAD_UART1_RXD__UART1_RXD, 70 MX51_PAD_UART1_RXD__UART1_RXD,
74 MX51_PAD_UART1_TXD__UART1_TXD, 71 MX51_PAD_UART1_TXD__UART1_TXD,
@@ -88,30 +85,33 @@ static struct pad_desc eukrea_cpuimx51sd_pads[] = {
88 MX51_PAD_USBH1_DATA6__USBH1_DATA6, 85 MX51_PAD_USBH1_DATA6__USBH1_DATA6,
89 MX51_PAD_USBH1_DATA7__USBH1_DATA7, 86 MX51_PAD_USBH1_DATA7__USBH1_DATA7,
90 MX51_PAD_USBH1_STP__USBH1_STP, 87 MX51_PAD_USBH1_STP__USBH1_STP,
91 MX51_PAD_EIM_CS3__GPIO_2_28, /* PHY nRESET */ 88 MX51_PAD_EIM_CS3__GPIO2_28, /* PHY nRESET */
92 89
93 /* FEC */ 90 /* FEC */
94 MX51_PAD_EIM_DTACK__GPIO_2_31, /* PHY nRESET */ 91 MX51_PAD_EIM_DTACK__GPIO2_31, /* PHY nRESET */
95 92
96 /* HSI2C */ 93 /* HSI2C */
97 MX51_PAD_I2C1_CLK__GPIO_4_16, 94 MX51_PAD_I2C1_CLK__GPIO4_16,
98 MX51_PAD_I2C1_DAT__GPIO_4_17, 95 MX51_PAD_I2C1_DAT__GPIO4_17,
99 96
100 /* CAN */ 97 /* CAN */
101 MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI, 98 MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI,
102 MX51_PAD_CSPI1_MISO__ECSPI1_MISO, 99 MX51_PAD_CSPI1_MISO__ECSPI1_MISO,
103 MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK, 100 MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK,
104 MX51_PAD_CSPI1_SS0__GPIO_4_24, /* nCS */ 101 MX51_PAD_CSPI1_SS0__GPIO4_24, /* nCS */
105 MX51_PAD_CSI2_PIXCLK__GPIO_4_15, /* nReset */ 102 MX51_PAD_CSI2_PIXCLK__GPIO4_15, /* nReset */
106 MX51_PAD_GPIO_1_1__GPIO_1_1, /* IRQ */ 103 MX51_PAD_GPIO1_1__GPIO1_1, /* IRQ */
107 MX51_PAD_GPIO_1_4__GPIO_1_4, /* Control signals */ 104 MX51_PAD_GPIO1_4__GPIO1_4, /* Control signals */
108 MX51_PAD_GPIO_1_6__GPIO_1_6, 105 MX51_PAD_GPIO1_6__GPIO1_6,
109 MX51_PAD_GPIO_1_7__GPIO_1_7, 106 MX51_PAD_GPIO1_7__GPIO1_7,
110 MX51_PAD_GPIO_1_8__GPIO_1_8, 107 MX51_PAD_GPIO1_8__GPIO1_8,
111 MX51_PAD_GPIO_1_9__GPIO_1_9, 108 MX51_PAD_GPIO1_9__GPIO1_9,
112 109
113 /* Touchscreen */ 110 /* Touchscreen */
114 CPUIMX51SD_GPIO_3_12, /* IRQ */ 111 /* IRQ */
112 _MX51_PAD_CSI1_D8__GPIO3_12 | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP |
113 PAD_CTL_PKE | PAD_CTL_SRE_FAST |
114 PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
115}; 115};
116 116
117static const struct imxuart_platform_data uart_pdata __initconst = { 117static const struct imxuart_platform_data uart_pdata __initconst = {
@@ -157,6 +157,8 @@ static int initialize_otg_port(struct platform_device *pdev)
157 void __iomem *usbother_base; 157 void __iomem *usbother_base;
158 158
159 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); 159 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
160 if (!usb_base)
161 return -ENOMEM;
160 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; 162 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
161 163
162 /* Set the PHY clock to 19.2MHz */ 164 /* Set the PHY clock to 19.2MHz */
@@ -175,6 +177,8 @@ static int initialize_usbh1_port(struct platform_device *pdev)
175 void __iomem *usbother_base; 177 void __iomem *usbother_base;
176 178
177 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); 179 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
180 if (!usb_base)
181 return -ENOMEM;
178 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; 182 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
179 183
180 /* The clock for the USBH1 ULPI port will come from the PHY. */ 184 /* The clock for the USBH1 ULPI port will come from the PHY. */
@@ -243,7 +247,7 @@ static struct spi_board_info cpuimx51sd_spi_device[] = {
243 .mode = SPI_MODE_0, 247 .mode = SPI_MODE_0,
244 .chip_select = 0, 248 .chip_select = 0,
245 .platform_data = &mcp251x_info, 249 .platform_data = &mcp251x_info,
246 .irq = gpio_to_irq(0 * 32 + 1) 250 .irq = gpio_to_irq(CAN_IRQGPIO)
247 }, 251 },
248}; 252};
249 253
@@ -323,7 +327,7 @@ static struct sys_timer mxc_timer = {
323 327
324MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD") 328MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD")
325 /* Maintainer: Eric Bénard <eric@eukrea.com> */ 329 /* Maintainer: Eric Bénard <eric@eukrea.com> */
326 .boot_params = PHYS_OFFSET + 0x100, 330 .boot_params = MX51_PHYS_OFFSET + 0x100,
327 .map_io = mx51_map_io, 331 .map_io = mx51_map_io,
328 .init_irq = mx51_init_irq, 332 .init_irq = mx51_init_irq,
329 .init_machine = eukrea_cpuimx51sd_init, 333 .init_machine = eukrea_cpuimx51sd_init,
diff --git a/arch/arm/mach-mx5/board-mx50_rdp.c b/arch/arm/mach-mx5/board-mx50_rdp.c
new file mode 100644
index 000000000000..fd32e4c450e8
--- /dev/null
+++ b/arch/arm/mach-mx5/board-mx50_rdp.c
@@ -0,0 +1,197 @@
1/*
2 * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#include <linux/init.h>
22#include <linux/platform_device.h>
23#include <linux/gpio.h>
24#include <linux/delay.h>
25#include <linux/io.h>
26#include <linux/fsl_devices.h>
27
28#include <mach/common.h>
29#include <mach/hardware.h>
30#include <mach/iomux-mx50.h>
31
32#include <asm/irq.h>
33#include <asm/setup.h>
34#include <asm/mach-types.h>
35#include <asm/mach/arch.h>
36#include <asm/mach/time.h>
37
38#include "devices-mx50.h"
39
40static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = {
41 /* SD1 */
42 MX50_PAD_ECSPI2_SS0__GPIO_4_19,
43 MX50_PAD_EIM_CRE__GPIO_1_27,
44 MX50_PAD_SD1_CMD__SD1_CMD,
45
46 MX50_PAD_SD1_CLK__SD1_CLK,
47 MX50_PAD_SD1_D0__SD1_D0,
48 MX50_PAD_SD1_D1__SD1_D1,
49 MX50_PAD_SD1_D2__SD1_D2,
50 MX50_PAD_SD1_D3__SD1_D3,
51
52 /* SD2 */
53 MX50_PAD_SD2_CD__GPIO_5_17,
54 MX50_PAD_SD2_WP__GPIO_5_16,
55 MX50_PAD_SD2_CMD__SD2_CMD,
56 MX50_PAD_SD2_CLK__SD2_CLK,
57 MX50_PAD_SD2_D0__SD2_D0,
58 MX50_PAD_SD2_D1__SD2_D1,
59 MX50_PAD_SD2_D2__SD2_D2,
60 MX50_PAD_SD2_D3__SD2_D3,
61 MX50_PAD_SD2_D4__SD2_D4,
62 MX50_PAD_SD2_D5__SD2_D5,
63 MX50_PAD_SD2_D6__SD2_D6,
64 MX50_PAD_SD2_D7__SD2_D7,
65
66 /* SD3 */
67 MX50_PAD_SD3_CMD__SD3_CMD,
68 MX50_PAD_SD3_CLK__SD3_CLK,
69 MX50_PAD_SD3_D0__SD3_D0,
70 MX50_PAD_SD3_D1__SD3_D1,
71 MX50_PAD_SD3_D2__SD3_D2,
72 MX50_PAD_SD3_D3__SD3_D3,
73 MX50_PAD_SD3_D4__SD3_D4,
74 MX50_PAD_SD3_D5__SD3_D5,
75 MX50_PAD_SD3_D6__SD3_D6,
76 MX50_PAD_SD3_D7__SD3_D7,
77
78 /* PWR_INT */
79 MX50_PAD_ECSPI2_MISO__GPIO_4_18,
80
81 /* UART pad setting */
82 MX50_PAD_UART1_TXD__UART1_TXD,
83 MX50_PAD_UART1_RXD__UART1_RXD,
84 MX50_PAD_UART1_RTS__UART1_RTS,
85 MX50_PAD_UART2_TXD__UART2_TXD,
86 MX50_PAD_UART2_RXD__UART2_RXD,
87 MX50_PAD_UART2_CTS__UART2_CTS,
88 MX50_PAD_UART2_RTS__UART2_RTS,
89
90 MX50_PAD_I2C1_SCL__I2C1_SCL,
91 MX50_PAD_I2C1_SDA__I2C1_SDA,
92 MX50_PAD_I2C2_SCL__I2C2_SCL,
93 MX50_PAD_I2C2_SDA__I2C2_SDA,
94
95 MX50_PAD_EPITO__USBH1_PWR,
96 /* Need to comment below line if
97 * one needs to debug owire.
98 */
99 MX50_PAD_OWIRE__USBH1_OC,
100 /* using gpio to control otg pwr */
101 MX50_PAD_PWM2__GPIO_6_25,
102 MX50_PAD_I2C3_SCL__USBOTG_OC,
103
104 MX50_PAD_SSI_RXC__FEC_MDIO,
105 MX50_PAD_SSI_RXC__FEC_MDIO,
106 MX50_PAD_DISP_D0__FEC_TXCLK,
107 MX50_PAD_DISP_D1__FEC_RX_ER,
108 MX50_PAD_DISP_D2__FEC_RX_DV,
109 MX50_PAD_DISP_D3__FEC_RXD1,
110 MX50_PAD_DISP_D4__FEC_RXD0,
111 MX50_PAD_DISP_D5__FEC_TX_EN,
112 MX50_PAD_DISP_D6__FEC_TXD1,
113 MX50_PAD_DISP_D7__FEC_TXD0,
114 MX50_PAD_SSI_RXFS__FEC_MDC,
115 MX50_PAD_I2C3_SDA__GPIO_6_23,
116 MX50_PAD_ECSPI1_SCLK__GPIO_4_12,
117
118 MX50_PAD_CSPI_SS0__CSPI_SS0,
119 MX50_PAD_ECSPI1_MOSI__CSPI_SS1,
120 MX50_PAD_CSPI_MOSI__CSPI_MOSI,
121 MX50_PAD_CSPI_MISO__CSPI_MISO,
122
123 /* SGTL500_OSC_EN */
124 MX50_PAD_UART1_CTS__GPIO_6_8,
125
126 /* SGTL_AMP_SHDN */
127 MX50_PAD_UART3_RXD__GPIO_6_15,
128
129 /* Keypad */
130 MX50_PAD_KEY_COL0__KEY_COL0,
131 MX50_PAD_KEY_ROW0__KEY_ROW0,
132 MX50_PAD_KEY_COL1__KEY_COL1,
133 MX50_PAD_KEY_ROW1__KEY_ROW1,
134 MX50_PAD_KEY_COL2__KEY_COL2,
135 MX50_PAD_KEY_ROW2__KEY_ROW2,
136 MX50_PAD_KEY_COL3__KEY_COL3,
137 MX50_PAD_KEY_ROW3__KEY_ROW3,
138 MX50_PAD_EIM_DA0__KEY_COL4,
139 MX50_PAD_EIM_DA1__KEY_ROW4,
140 MX50_PAD_EIM_DA2__KEY_COL5,
141 MX50_PAD_EIM_DA3__KEY_ROW5,
142 MX50_PAD_EIM_DA4__KEY_COL6,
143 MX50_PAD_EIM_DA5__KEY_ROW6,
144 MX50_PAD_EIM_DA6__KEY_COL7,
145 MX50_PAD_EIM_DA7__KEY_ROW7,
146 /*EIM pads */
147 MX50_PAD_EIM_DA8__GPIO_1_8,
148 MX50_PAD_EIM_DA9__GPIO_1_9,
149 MX50_PAD_EIM_DA10__GPIO_1_10,
150 MX50_PAD_EIM_DA11__GPIO_1_11,
151 MX50_PAD_EIM_DA12__GPIO_1_12,
152 MX50_PAD_EIM_DA13__GPIO_1_13,
153 MX50_PAD_EIM_DA14__GPIO_1_14,
154 MX50_PAD_EIM_DA15__GPIO_1_15,
155 MX50_PAD_EIM_CS2__GPIO_1_16,
156 MX50_PAD_EIM_CS1__GPIO_1_17,
157 MX50_PAD_EIM_CS0__GPIO_1_18,
158 MX50_PAD_EIM_EB0__GPIO_1_19,
159 MX50_PAD_EIM_EB1__GPIO_1_20,
160 MX50_PAD_EIM_WAIT__GPIO_1_21,
161 MX50_PAD_EIM_BCLK__GPIO_1_22,
162 MX50_PAD_EIM_RDY__GPIO_1_23,
163 MX50_PAD_EIM_OE__GPIO_1_24,
164};
165
166/* Serial ports */
167static const struct imxuart_platform_data uart_pdata __initconst = {
168 .flags = IMXUART_HAVE_RTSCTS,
169};
170
171/*
172 * Board specific initialization.
173 */
174static void __init mx50_rdp_board_init(void)
175{
176 mxc_iomux_v3_setup_multiple_pads(mx50_rdp_pads,
177 ARRAY_SIZE(mx50_rdp_pads));
178
179 imx50_add_imx_uart(0, &uart_pdata);
180 imx50_add_imx_uart(1, &uart_pdata);
181}
182
183static void __init mx50_rdp_timer_init(void)
184{
185 mx50_clocks_init(32768, 24000000, 22579200);
186}
187
188static struct sys_timer mx50_rdp_timer = {
189 .init = mx50_rdp_timer_init,
190};
191
192MACHINE_START(MX50_RDP, "Freescale MX50 Reference Design Platform")
193 .map_io = mx50_map_io,
194 .init_irq = mx50_init_irq,
195 .init_machine = mx50_rdp_board_init,
196 .timer = &mx50_rdp_timer,
197MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx51_3ds.c b/arch/arm/mach-mx5/board-mx51_3ds.c
index 79ce8dcf3cda..e42bd2eb034e 100644
--- a/arch/arm/mach-mx5/board-mx51_3ds.c
+++ b/arch/arm/mach-mx5/board-mx51_3ds.c
@@ -30,7 +30,7 @@
30#define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTA + 6) 30#define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTA + 6)
31#define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28) 31#define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28)
32 32
33static struct pad_desc mx51_3ds_pads[] = { 33static iomux_v3_cfg_t mx51_3ds_pads[] = {
34 /* UART1 */ 34 /* UART1 */
35 MX51_PAD_UART1_RXD__UART1_RXD, 35 MX51_PAD_UART1_RXD__UART1_RXD,
36 MX51_PAD_UART1_TXD__UART1_TXD, 36 MX51_PAD_UART1_TXD__UART1_TXD,
@@ -50,7 +50,7 @@ static struct pad_desc mx51_3ds_pads[] = {
50 MX51_PAD_EIM_D27__UART3_RTS, 50 MX51_PAD_EIM_D27__UART3_RTS,
51 51
52 /* CPLD PARENT IRQ PIN */ 52 /* CPLD PARENT IRQ PIN */
53 MX51_PAD_GPIO_1_6__GPIO_1_6, 53 MX51_PAD_GPIO1_6__GPIO1_6,
54 54
55 /* KPP */ 55 /* KPP */
56 MX51_PAD_KEY_ROW0__KEY_ROW0, 56 MX51_PAD_KEY_ROW0__KEY_ROW0,
@@ -68,7 +68,7 @@ static struct pad_desc mx51_3ds_pads[] = {
68 MX51_PAD_NANDF_RB2__ECSPI2_SCLK, 68 MX51_PAD_NANDF_RB2__ECSPI2_SCLK,
69 MX51_PAD_NANDF_RB3__ECSPI2_MISO, 69 MX51_PAD_NANDF_RB3__ECSPI2_MISO,
70 MX51_PAD_NANDF_D15__ECSPI2_MOSI, 70 MX51_PAD_NANDF_D15__ECSPI2_MOSI,
71 MX51_PAD_NANDF_D12__GPIO_3_28, 71 MX51_PAD_NANDF_D12__GPIO3_28,
72}; 72};
73 73
74/* Serial ports */ 74/* Serial ports */
@@ -172,6 +172,7 @@ static void __init mxc_board_init(void)
172 printk(KERN_WARNING "Init of the debugboard failed, all " 172 printk(KERN_WARNING "Init of the debugboard failed, all "
173 "devices on the board are unusable.\n"); 173 "devices on the board are unusable.\n");
174 174
175 imx51_add_sdhci_esdhc_imx(0, NULL);
175 mxc_init_keypad(); 176 mxc_init_keypad();
176} 177}
177 178
@@ -186,7 +187,7 @@ static struct sys_timer mxc_timer = {
186 187
187MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board") 188MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board")
188 /* Maintainer: Freescale Semiconductor, Inc. */ 189 /* Maintainer: Freescale Semiconductor, Inc. */
189 .boot_params = PHYS_OFFSET + 0x100, 190 .boot_params = MX51_PHYS_OFFSET + 0x100,
190 .map_io = mx51_map_io, 191 .map_io = mx51_map_io,
191 .init_irq = mx51_init_irq, 192 .init_irq = mx51_init_irq,
192 .init_machine = mxc_board_init, 193 .init_machine = mxc_board_init,
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c
index acbe30df2e69..1d231e84107c 100644
--- a/arch/arm/mach-mx5/board-mx51_babbage.c
+++ b/arch/arm/mach-mx5/board-mx51_babbage.c
@@ -20,6 +20,8 @@
20#include <linux/fec.h> 20#include <linux/fec.h>
21#include <linux/gpio_keys.h> 21#include <linux/gpio_keys.h>
22#include <linux/input.h> 22#include <linux/input.h>
23#include <linux/spi/flash.h>
24#include <linux/spi/spi.h>
23 25
24#include <mach/common.h> 26#include <mach/common.h>
25#include <mach/hardware.h> 27#include <mach/hardware.h>
@@ -36,11 +38,13 @@
36#include "devices.h" 38#include "devices.h"
37#include "cpu_op-mx51.h" 39#include "cpu_op-mx51.h"
38 40
39#define BABBAGE_USB_HUB_RESET (0*32 + 7) /* GPIO_1_7 */ 41#define BABBAGE_USB_HUB_RESET IMX_GPIO_NR(1, 7)
40#define BABBAGE_USBH1_STP (0*32 + 27) /* GPIO_1_27 */ 42#define BABBAGE_USBH1_STP IMX_GPIO_NR(1, 27)
41#define BABBAGE_PHY_RESET (1*32 + 5) /* GPIO_2_5 */ 43#define BABBAGE_PHY_RESET IMX_GPIO_NR(2, 5)
42#define BABBAGE_FEC_PHY_RESET (1*32 + 14) /* GPIO_2_14 */ 44#define BABBAGE_FEC_PHY_RESET IMX_GPIO_NR(2, 14)
43#define BABBAGE_POWER_KEY (1*32 + 21) /* GPIO_2_21 */ 45#define BABBAGE_POWER_KEY IMX_GPIO_NR(2, 21)
46#define BABBAGE_ECSPI1_CS0 IMX_GPIO_NR(4, 24)
47#define BABBAGE_ECSPI1_CS1 IMX_GPIO_NR(4, 25)
44 48
45/* USB_CTRL_1 */ 49/* USB_CTRL_1 */
46#define MX51_USB_CTRL_1_OFFSET 0x10 50#define MX51_USB_CTRL_1_OFFSET 0x10
@@ -65,7 +69,7 @@ static const struct gpio_keys_platform_data imx_button_data __initconst = {
65 .nbuttons = ARRAY_SIZE(babbage_buttons), 69 .nbuttons = ARRAY_SIZE(babbage_buttons),
66}; 70};
67 71
68static struct pad_desc mx51babbage_pads[] = { 72static iomux_v3_cfg_t mx51babbage_pads[] = {
69 /* UART1 */ 73 /* UART1 */
70 MX51_PAD_UART1_RXD__UART1_RXD, 74 MX51_PAD_UART1_RXD__UART1_RXD,
71 MX51_PAD_UART1_TXD__UART1_TXD, 75 MX51_PAD_UART1_TXD__UART1_TXD,
@@ -91,8 +95,8 @@ static struct pad_desc mx51babbage_pads[] = {
91 MX51_PAD_KEY_COL5__I2C2_SDA, 95 MX51_PAD_KEY_COL5__I2C2_SDA,
92 96
93 /* HSI2C */ 97 /* HSI2C */
94 MX51_PAD_I2C1_CLK__HSI2C_CLK, 98 MX51_PAD_I2C1_CLK__I2C1_CLK,
95 MX51_PAD_I2C1_DAT__HSI2C_DAT, 99 MX51_PAD_I2C1_DAT__I2C1_DAT,
96 100
97 /* USB HOST1 */ 101 /* USB HOST1 */
98 MX51_PAD_USBH1_CLK__USBH1_CLK, 102 MX51_PAD_USBH1_CLK__USBH1_CLK,
@@ -108,29 +112,29 @@ static struct pad_desc mx51babbage_pads[] = {
108 MX51_PAD_USBH1_DATA7__USBH1_DATA7, 112 MX51_PAD_USBH1_DATA7__USBH1_DATA7,
109 113
110 /* USB HUB reset line*/ 114 /* USB HUB reset line*/
111 MX51_PAD_GPIO_1_7__GPIO_1_7, 115 MX51_PAD_GPIO1_7__GPIO1_7,
112 116
113 /* FEC */ 117 /* FEC */
114 MX51_PAD_EIM_EB2__FEC_MDIO, 118 MX51_PAD_EIM_EB2__FEC_MDIO,
115 MX51_PAD_EIM_EB3__FEC_RDAT1, 119 MX51_PAD_EIM_EB3__FEC_RDATA1,
116 MX51_PAD_EIM_CS2__FEC_RDAT2, 120 MX51_PAD_EIM_CS2__FEC_RDATA2,
117 MX51_PAD_EIM_CS3__FEC_RDAT3, 121 MX51_PAD_EIM_CS3__FEC_RDATA3,
118 MX51_PAD_EIM_CS4__FEC_RX_ER, 122 MX51_PAD_EIM_CS4__FEC_RX_ER,
119 MX51_PAD_EIM_CS5__FEC_CRS, 123 MX51_PAD_EIM_CS5__FEC_CRS,
120 MX51_PAD_NANDF_RB2__FEC_COL, 124 MX51_PAD_NANDF_RB2__FEC_COL,
121 MX51_PAD_NANDF_RB3__FEC_RXCLK, 125 MX51_PAD_NANDF_RB3__FEC_RX_CLK,
122 MX51_PAD_NANDF_RB6__FEC_RDAT0, 126 MX51_PAD_NANDF_D9__FEC_RDATA0,
123 MX51_PAD_NANDF_RB7__FEC_TDAT0, 127 MX51_PAD_NANDF_D8__FEC_TDATA0,
124 MX51_PAD_NANDF_CS2__FEC_TX_ER, 128 MX51_PAD_NANDF_CS2__FEC_TX_ER,
125 MX51_PAD_NANDF_CS3__FEC_MDC, 129 MX51_PAD_NANDF_CS3__FEC_MDC,
126 MX51_PAD_NANDF_CS4__FEC_TDAT1, 130 MX51_PAD_NANDF_CS4__FEC_TDATA1,
127 MX51_PAD_NANDF_CS5__FEC_TDAT2, 131 MX51_PAD_NANDF_CS5__FEC_TDATA2,
128 MX51_PAD_NANDF_CS6__FEC_TDAT3, 132 MX51_PAD_NANDF_CS6__FEC_TDATA3,
129 MX51_PAD_NANDF_CS7__FEC_TX_EN, 133 MX51_PAD_NANDF_CS7__FEC_TX_EN,
130 MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK, 134 MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK,
131 135
132 /* FEC PHY reset line */ 136 /* FEC PHY reset line */
133 MX51_PAD_EIM_A20__GPIO_2_14, 137 MX51_PAD_EIM_A20__GPIO2_14,
134 138
135 /* SD 1 */ 139 /* SD 1 */
136 MX51_PAD_SD1_CMD__SD1_CMD, 140 MX51_PAD_SD1_CMD__SD1_CMD,
@@ -147,6 +151,13 @@ static struct pad_desc mx51babbage_pads[] = {
147 MX51_PAD_SD2_DATA1__SD2_DATA1, 151 MX51_PAD_SD2_DATA1__SD2_DATA1,
148 MX51_PAD_SD2_DATA2__SD2_DATA2, 152 MX51_PAD_SD2_DATA2__SD2_DATA2,
149 MX51_PAD_SD2_DATA3__SD2_DATA3, 153 MX51_PAD_SD2_DATA3__SD2_DATA3,
154
155 /* eCSPI1 */
156 MX51_PAD_CSPI1_MISO__ECSPI1_MISO,
157 MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI,
158 MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK,
159 MX51_PAD_CSPI1_SS0__GPIO4_24,
160 MX51_PAD_CSPI1_SS1__GPIO4_25,
150}; 161};
151 162
152/* Serial ports */ 163/* Serial ports */
@@ -177,12 +188,12 @@ static struct imxi2c_platform_data babbage_hsi2c_data = {
177 188
178static int gpio_usbh1_active(void) 189static int gpio_usbh1_active(void)
179{ 190{
180 struct pad_desc usbh1stp_gpio = MX51_PAD_USBH1_STP__GPIO_1_27; 191 iomux_v3_cfg_t usbh1stp_gpio = MX51_PAD_USBH1_STP__GPIO1_27;
181 struct pad_desc phyreset_gpio = MX51_PAD_EIM_D21__GPIO_2_5; 192 iomux_v3_cfg_t phyreset_gpio = MX51_PAD_EIM_D21__GPIO2_5;
182 int ret; 193 int ret;
183 194
184 /* Set USBH1_STP to GPIO and toggle it */ 195 /* Set USBH1_STP to GPIO and toggle it */
185 mxc_iomux_v3_setup_pad(&usbh1stp_gpio); 196 mxc_iomux_v3_setup_pad(usbh1stp_gpio);
186 ret = gpio_request(BABBAGE_USBH1_STP, "usbh1_stp"); 197 ret = gpio_request(BABBAGE_USBH1_STP, "usbh1_stp");
187 198
188 if (ret) { 199 if (ret) {
@@ -195,7 +206,7 @@ static int gpio_usbh1_active(void)
195 gpio_free(BABBAGE_USBH1_STP); 206 gpio_free(BABBAGE_USBH1_STP);
196 207
197 /* De-assert USB PHY RESETB */ 208 /* De-assert USB PHY RESETB */
198 mxc_iomux_v3_setup_pad(&phyreset_gpio); 209 mxc_iomux_v3_setup_pad(phyreset_gpio);
199 ret = gpio_request(BABBAGE_PHY_RESET, "phy_reset"); 210 ret = gpio_request(BABBAGE_PHY_RESET, "phy_reset");
200 211
201 if (ret) { 212 if (ret) {
@@ -251,6 +262,8 @@ static int initialize_otg_port(struct platform_device *pdev)
251 void __iomem *usbother_base; 262 void __iomem *usbother_base;
252 263
253 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); 264 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
265 if (!usb_base)
266 return -ENOMEM;
254 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; 267 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
255 268
256 /* Set the PHY clock to 19.2MHz */ 269 /* Set the PHY clock to 19.2MHz */
@@ -269,6 +282,8 @@ static int initialize_usbh1_port(struct platform_device *pdev)
269 void __iomem *usbother_base; 282 void __iomem *usbother_base;
270 283
271 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); 284 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
285 if (!usb_base)
286 return -ENOMEM;
272 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; 287 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
273 288
274 /* The clock for the USBH1 ULPI port will come externally from the PHY. */ 289 /* The clock for the USBH1 ULPI port will come externally from the PHY. */
@@ -310,13 +325,35 @@ static int __init babbage_otg_mode(char *options)
310} 325}
311__setup("otg_mode=", babbage_otg_mode); 326__setup("otg_mode=", babbage_otg_mode);
312 327
328static struct spi_board_info mx51_babbage_spi_board_info[] __initdata = {
329 {
330 .modalias = "mtd_dataflash",
331 .max_speed_hz = 25000000,
332 .bus_num = 0,
333 .chip_select = 1,
334 .mode = SPI_MODE_0,
335 .platform_data = NULL,
336 },
337};
338
339static int mx51_babbage_spi_cs[] = {
340 BABBAGE_ECSPI1_CS0,
341 BABBAGE_ECSPI1_CS1,
342};
343
344static const struct spi_imx_master mx51_babbage_spi_pdata __initconst = {
345 .chipselect = mx51_babbage_spi_cs,
346 .num_chipselect = ARRAY_SIZE(mx51_babbage_spi_cs),
347};
348
313/* 349/*
314 * Board specific initialization. 350 * Board specific initialization.
315 */ 351 */
316static void __init mxc_board_init(void) 352static void __init mxc_board_init(void)
317{ 353{
318 struct pad_desc usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP; 354 iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP;
319 struct pad_desc power_key = MX51_PAD_EIM_A27__GPIO_2_21; 355 iomux_v3_cfg_t power_key = _MX51_PAD_EIM_A27__GPIO2_21 |
356 MUX_PAD_CTRL(PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP);
320 357
321#if defined(CONFIG_CPU_FREQ_IMX) 358#if defined(CONFIG_CPU_FREQ_IMX)
322 get_cpu_op = mx51_get_cpu_op; 359 get_cpu_op = mx51_get_cpu_op;
@@ -328,8 +365,7 @@ static void __init mxc_board_init(void)
328 imx51_add_fec(NULL); 365 imx51_add_fec(NULL);
329 366
330 /* Set the PAD settings for the pwr key. */ 367 /* Set the PAD settings for the pwr key. */
331 power_key.pad_ctrl = MX51_GPIO_PAD_CTRL_2; 368 mxc_iomux_v3_setup_pad(power_key);
332 mxc_iomux_v3_setup_pad(&power_key);
333 imx51_add_gpio_keys(&imx_button_data); 369 imx51_add_gpio_keys(&imx_button_data);
334 370
335 imx51_add_imx_i2c(0, &babbage_i2c_data); 371 imx51_add_imx_i2c(0, &babbage_i2c_data);
@@ -346,11 +382,16 @@ static void __init mxc_board_init(void)
346 gpio_usbh1_active(); 382 gpio_usbh1_active();
347 mxc_register_device(&mxc_usbh1_device, &usbh1_config); 383 mxc_register_device(&mxc_usbh1_device, &usbh1_config);
348 /* setback USBH1_STP to be function */ 384 /* setback USBH1_STP to be function */
349 mxc_iomux_v3_setup_pad(&usbh1stp); 385 mxc_iomux_v3_setup_pad(usbh1stp);
350 babbage_usbhub_reset(); 386 babbage_usbhub_reset();
351 387
352 imx51_add_esdhc(0, NULL); 388 imx51_add_sdhci_esdhc_imx(0, NULL);
353 imx51_add_esdhc(1, NULL); 389 imx51_add_sdhci_esdhc_imx(1, NULL);
390
391 spi_register_board_info(mx51_babbage_spi_board_info,
392 ARRAY_SIZE(mx51_babbage_spi_board_info));
393 imx51_add_ecspi(0, &mx51_babbage_spi_pdata);
394 imx51_add_imx2_wdt(0, NULL);
354} 395}
355 396
356static void __init mx51_babbage_timer_init(void) 397static void __init mx51_babbage_timer_init(void)
diff --git a/arch/arm/mach-mx5/board-mx51_efikamx.c b/arch/arm/mach-mx5/board-mx51_efikamx.c
index 6e623bda3ee7..b7946f8e8d40 100644
--- a/arch/arm/mach-mx5/board-mx51_efikamx.c
+++ b/arch/arm/mach-mx5/board-mx51_efikamx.c
@@ -18,9 +18,13 @@
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/i2c.h> 19#include <linux/i2c.h>
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21#include <linux/leds.h>
22#include <linux/input.h>
21#include <linux/delay.h> 23#include <linux/delay.h>
22#include <linux/io.h> 24#include <linux/io.h>
23#include <linux/fsl_devices.h> 25#include <linux/fsl_devices.h>
26#include <linux/spi/flash.h>
27#include <linux/spi/spi.h>
24 28
25#include <mach/common.h> 29#include <mach/common.h>
26#include <mach/hardware.h> 30#include <mach/hardware.h>
@@ -39,12 +43,81 @@
39 43
40#define MX51_USB_PLL_DIV_24_MHZ 0x01 44#define MX51_USB_PLL_DIV_24_MHZ 0x01
41 45
42static struct pad_desc mx51efikamx_pads[] = { 46#define EFIKAMX_PCBID0 IMX_GPIO_NR(3, 16)
47#define EFIKAMX_PCBID1 IMX_GPIO_NR(3, 17)
48#define EFIKAMX_PCBID2 IMX_GPIO_NR(3, 11)
49
50#define EFIKAMX_BLUE_LED IMX_GPIO_NR(3, 13)
51#define EFIKAMX_GREEN_LED IMX_GPIO_NR(3, 14)
52#define EFIKAMX_RED_LED IMX_GPIO_NR(3, 15)
53
54#define EFIKAMX_POWER_KEY IMX_GPIO_NR(2, 31)
55
56#define EFIKAMX_SPI_CS0 IMX_GPIO_NR(4, 24)
57#define EFIKAMX_SPI_CS1 IMX_GPIO_NR(4, 25)
58
59/* board 1.1 doesn't have same reset gpio */
60#define EFIKAMX_RESET1_1 IMX_GPIO_NR(3, 2)
61#define EFIKAMX_RESET IMX_GPIO_NR(1, 4)
62
63/* the pci ids pin have pull up. they're driven low according to board id */
64#define MX51_PAD_PCBID0 IOMUX_PAD(0x518, 0x130, 3, 0x0, 0, PAD_CTL_PUS_100K_UP)
65#define MX51_PAD_PCBID1 IOMUX_PAD(0x51C, 0x134, 3, 0x0, 0, PAD_CTL_PUS_100K_UP)
66#define MX51_PAD_PCBID2 IOMUX_PAD(0x504, 0x128, 3, 0x0, 0, PAD_CTL_PUS_100K_UP)
67#define MX51_PAD_PWRKEY IOMUX_PAD(0x48c, 0x0f8, 1, 0x0, 0, PAD_CTL_PUS_100K_UP | PAD_CTL_PKE)
68
69static iomux_v3_cfg_t mx51efikamx_pads[] = {
43 /* UART1 */ 70 /* UART1 */
44 MX51_PAD_UART1_RXD__UART1_RXD, 71 MX51_PAD_UART1_RXD__UART1_RXD,
45 MX51_PAD_UART1_TXD__UART1_TXD, 72 MX51_PAD_UART1_TXD__UART1_TXD,
46 MX51_PAD_UART1_RTS__UART1_RTS, 73 MX51_PAD_UART1_RTS__UART1_RTS,
47 MX51_PAD_UART1_CTS__UART1_CTS, 74 MX51_PAD_UART1_CTS__UART1_CTS,
75 /* board id */
76 MX51_PAD_PCBID0,
77 MX51_PAD_PCBID1,
78 MX51_PAD_PCBID2,
79
80 /* SD 1 */
81 MX51_PAD_SD1_CMD__SD1_CMD,
82 MX51_PAD_SD1_CLK__SD1_CLK,
83 MX51_PAD_SD1_DATA0__SD1_DATA0,
84 MX51_PAD_SD1_DATA1__SD1_DATA1,
85 MX51_PAD_SD1_DATA2__SD1_DATA2,
86 MX51_PAD_SD1_DATA3__SD1_DATA3,
87
88 /* SD 2 */
89 MX51_PAD_SD2_CMD__SD2_CMD,
90 MX51_PAD_SD2_CLK__SD2_CLK,
91 MX51_PAD_SD2_DATA0__SD2_DATA0,
92 MX51_PAD_SD2_DATA1__SD2_DATA1,
93 MX51_PAD_SD2_DATA2__SD2_DATA2,
94 MX51_PAD_SD2_DATA3__SD2_DATA3,
95
96 /* SD/MMC WP/CD */
97 MX51_PAD_GPIO1_0__SD1_CD,
98 MX51_PAD_GPIO1_1__SD1_WP,
99 MX51_PAD_GPIO1_7__SD2_WP,
100 MX51_PAD_GPIO1_8__SD2_CD,
101
102 /* leds */
103 MX51_PAD_CSI1_D9__GPIO3_13,
104 MX51_PAD_CSI1_VSYNC__GPIO3_14,
105 MX51_PAD_CSI1_HSYNC__GPIO3_15,
106
107 /* power key */
108 MX51_PAD_PWRKEY,
109
110 /* spi */
111 MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI,
112 MX51_PAD_CSPI1_MISO__ECSPI1_MISO,
113 MX51_PAD_CSPI1_SS0__GPIO4_24,
114 MX51_PAD_CSPI1_SS1__GPIO4_25,
115 MX51_PAD_CSPI1_RDY__ECSPI1_RDY,
116 MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK,
117
118 /* reset */
119 MX51_PAD_DI1_PIN13__GPIO3_2,
120 MX51_PAD_GPIO1_4__GPIO1_4,
48}; 121};
49 122
50/* Serial ports */ 123/* Serial ports */
@@ -75,6 +148,8 @@ static int initialize_otg_port(struct platform_device *pdev)
75 void __iomem *usb_base; 148 void __iomem *usb_base;
76 void __iomem *usbother_base; 149 void __iomem *usbother_base;
77 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); 150 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
151 if (!usb_base)
152 return -ENOMEM;
78 usbother_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET); 153 usbother_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET);
79 154
80 /* Set the PHY clock to 19.2MHz */ 155 /* Set the PHY clock to 19.2MHz */
@@ -92,12 +167,182 @@ static struct mxc_usbh_platform_data dr_utmi_config = {
92 .flags = MXC_EHCI_INTERNAL_PHY, 167 .flags = MXC_EHCI_INTERNAL_PHY,
93}; 168};
94 169
170/* PCBID2 PCBID1 PCBID0 STATE
171 1 1 1 ER1:rev1.1
172 1 1 0 ER2:rev1.2
173 1 0 1 ER3:rev1.3
174 1 0 0 ER4:rev1.4
175*/
176static void __init mx51_efikamx_board_id(void)
177{
178 int id;
179
180 /* things are taking time to settle */
181 msleep(150);
182
183 gpio_request(EFIKAMX_PCBID0, "pcbid0");
184 gpio_direction_input(EFIKAMX_PCBID0);
185 gpio_request(EFIKAMX_PCBID1, "pcbid1");
186 gpio_direction_input(EFIKAMX_PCBID1);
187 gpio_request(EFIKAMX_PCBID2, "pcbid2");
188 gpio_direction_input(EFIKAMX_PCBID2);
189
190 id = gpio_get_value(EFIKAMX_PCBID0);
191 id |= gpio_get_value(EFIKAMX_PCBID1) << 1;
192 id |= gpio_get_value(EFIKAMX_PCBID2) << 2;
193
194 switch (id) {
195 case 7:
196 system_rev = 0x11;
197 break;
198 case 6:
199 system_rev = 0x12;
200 break;
201 case 5:
202 system_rev = 0x13;
203 break;
204 case 4:
205 system_rev = 0x14;
206 break;
207 default:
208 system_rev = 0x10;
209 break;
210 }
211
212 if ((system_rev == 0x10)
213 || (system_rev == 0x12)
214 || (system_rev == 0x14)) {
215 printk(KERN_WARNING
216 "EfikaMX: Unsupported board revision 1.%u!\n",
217 system_rev & 0xf);
218 }
219}
220
221static struct gpio_led mx51_efikamx_leds[] = {
222 {
223 .name = "efikamx:green",
224 .default_trigger = "default-on",
225 .gpio = EFIKAMX_GREEN_LED,
226 },
227 {
228 .name = "efikamx:red",
229 .default_trigger = "ide-disk",
230 .gpio = EFIKAMX_RED_LED,
231 },
232 {
233 .name = "efikamx:blue",
234 .default_trigger = "mmc0",
235 .gpio = EFIKAMX_BLUE_LED,
236 },
237};
238
239static struct gpio_led_platform_data mx51_efikamx_leds_data = {
240 .leds = mx51_efikamx_leds,
241 .num_leds = ARRAY_SIZE(mx51_efikamx_leds),
242};
243
244static struct platform_device mx51_efikamx_leds_device = {
245 .name = "leds-gpio",
246 .id = -1,
247 .dev = {
248 .platform_data = &mx51_efikamx_leds_data,
249 },
250};
251
252static struct gpio_keys_button mx51_efikamx_powerkey[] = {
253 {
254 .code = KEY_POWER,
255 .gpio = EFIKAMX_POWER_KEY,
256 .type = EV_PWR,
257 .desc = "Power Button (CM)",
258 .wakeup = 1,
259 .debounce_interval = 10, /* ms */
260 },
261};
262
263static const struct gpio_keys_platform_data mx51_efikamx_powerkey_data __initconst = {
264 .buttons = mx51_efikamx_powerkey,
265 .nbuttons = ARRAY_SIZE(mx51_efikamx_powerkey),
266};
267
268static struct mtd_partition mx51_efikamx_spi_nor_partitions[] = {
269 {
270 .name = "u-boot",
271 .offset = 0,
272 .size = SZ_256K,
273 },
274 {
275 .name = "config",
276 .offset = MTDPART_OFS_APPEND,
277 .size = SZ_64K,
278 },
279};
280
281static struct flash_platform_data mx51_efikamx_spi_flash_data = {
282 .name = "spi_flash",
283 .parts = mx51_efikamx_spi_nor_partitions,
284 .nr_parts = ARRAY_SIZE(mx51_efikamx_spi_nor_partitions),
285 .type = "sst25vf032b",
286};
287
288static struct spi_board_info mx51_efikamx_spi_board_info[] __initdata = {
289 {
290 .modalias = "m25p80",
291 .max_speed_hz = 25000000,
292 .bus_num = 0,
293 .chip_select = 1,
294 .platform_data = &mx51_efikamx_spi_flash_data,
295 .irq = -1,
296 },
297};
298
299static int mx51_efikamx_spi_cs[] = {
300 EFIKAMX_SPI_CS0,
301 EFIKAMX_SPI_CS1,
302};
303
304static const struct spi_imx_master mx51_efikamx_spi_pdata __initconst = {
305 .chipselect = mx51_efikamx_spi_cs,
306 .num_chipselect = ARRAY_SIZE(mx51_efikamx_spi_cs),
307};
308
309void mx51_efikamx_reset(void)
310{
311 if (system_rev == 0x11)
312 gpio_direction_output(EFIKAMX_RESET1_1, 0);
313 else
314 gpio_direction_output(EFIKAMX_RESET, 0);
315}
316
95static void __init mxc_board_init(void) 317static void __init mxc_board_init(void)
96{ 318{
97 mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads, 319 mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads,
98 ARRAY_SIZE(mx51efikamx_pads)); 320 ARRAY_SIZE(mx51efikamx_pads));
321 mx51_efikamx_board_id();
99 mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config); 322 mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config);
100 mxc_init_imx_uart(); 323 mxc_init_imx_uart();
324 imx51_add_sdhci_esdhc_imx(0, NULL);
325
326 /* on < 1.2 boards both SD controllers are used */
327 if (system_rev < 0x12) {
328 imx51_add_sdhci_esdhc_imx(1, NULL);
329 mx51_efikamx_leds[2].default_trigger = "mmc1";
330 }
331
332 platform_device_register(&mx51_efikamx_leds_device);
333 imx51_add_gpio_keys(&mx51_efikamx_powerkey_data);
334
335 spi_register_board_info(mx51_efikamx_spi_board_info,
336 ARRAY_SIZE(mx51_efikamx_spi_board_info));
337 imx51_add_ecspi(0, &mx51_efikamx_spi_pdata);
338
339 if (system_rev == 0x11) {
340 gpio_request(EFIKAMX_RESET1_1, "reset");
341 gpio_direction_output(EFIKAMX_RESET1_1, 1);
342 } else {
343 gpio_request(EFIKAMX_RESET, "reset");
344 gpio_direction_output(EFIKAMX_RESET, 1);
345 }
101} 346}
102 347
103static void __init mx51_efikamx_timer_init(void) 348static void __init mx51_efikamx_timer_init(void)
diff --git a/arch/arm/mach-mx5/board-mx53_evk.c b/arch/arm/mach-mx5/board-mx53_evk.c
new file mode 100644
index 000000000000..fa97d0d5dd05
--- /dev/null
+++ b/arch/arm/mach-mx5/board-mx53_evk.c
@@ -0,0 +1,84 @@
1/*
2 * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright (C) 2010 Yong Shen. <Yong.Shen@linaro.org>
4 */
5
6/*
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21
22#include <linux/init.h>
23#include <linux/clk.h>
24#include <mach/common.h>
25#include <mach/hardware.h>
26#include <asm/mach-types.h>
27#include <asm/mach/arch.h>
28#include <asm/mach/time.h>
29#include <mach/imx-uart.h>
30#include <mach/iomux-mx53.h>
31
32#include "crm_regs.h"
33#include "devices-imx53.h"
34
35static iomux_v3_cfg_t mx53_evk_pads[] = {
36 MX53_PAD_CSI0_D10__UART1_TXD,
37 MX53_PAD_CSI0_D11__UART1_RXD,
38 MX53_PAD_ATA_DIOW__UART1_TXD,
39 MX53_PAD_ATA_DMACK__UART1_RXD,
40
41 MX53_PAD_ATA_BUFFER_EN__UART2_RXD,
42 MX53_PAD_ATA_DMARQ__UART2_TXD,
43 MX53_PAD_ATA_DIOR__UART2_RTS,
44 MX53_PAD_ATA_INTRQ__UART2_CTS,
45
46 MX53_PAD_ATA_CS_0__UART3_TXD,
47 MX53_PAD_ATA_CS_1__UART3_RXD,
48 MX53_PAD_ATA_DA_1__UART3_CTS,
49 MX53_PAD_ATA_DA_2__UART3_RTS,
50};
51
52static const struct imxuart_platform_data mx53_evk_uart_pdata __initconst = {
53 .flags = IMXUART_HAVE_RTSCTS,
54};
55
56static inline void mx53_evk_init_uart(void)
57{
58 imx53_add_imx_uart(0, &mx53_evk_uart_pdata);
59 imx53_add_imx_uart(1, &mx53_evk_uart_pdata);
60 imx53_add_imx_uart(2, &mx53_evk_uart_pdata);
61}
62
63static void __init mx53_evk_board_init(void)
64{
65 mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads,
66 ARRAY_SIZE(mx53_evk_pads));
67 mx53_evk_init_uart();
68}
69
70static void __init mx53_evk_timer_init(void)
71{
72 mx53_clocks_init(32768, 24000000, 22579200, 0);
73}
74
75static struct sys_timer mx53_evk_timer = {
76 .init = mx53_evk_timer_init,
77};
78
79MACHINE_START(MX53_EVK, "Freescale MX53 EVK Board")
80 .map_io = mx53_map_io,
81 .init_irq = mx53_init_irq,
82 .init_machine = mx53_evk_board_init,
83 .timer = &mx53_evk_timer,
84MACHINE_END
diff --git a/arch/arm/mach-mx5/clock-mx51.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
index 5975edb47de8..785e1a336183 100644
--- a/arch/arm/mach-mx5/clock-mx51.c
+++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
@@ -33,11 +33,15 @@ static struct clk pll1_main_clk;
33static struct clk pll1_sw_clk; 33static struct clk pll1_sw_clk;
34static struct clk pll2_sw_clk; 34static struct clk pll2_sw_clk;
35static struct clk pll3_sw_clk; 35static struct clk pll3_sw_clk;
36static struct clk mx53_pll4_sw_clk;
36static struct clk lp_apm_clk; 37static struct clk lp_apm_clk;
37static struct clk periph_apm_clk; 38static struct clk periph_apm_clk;
38static struct clk ahb_clk; 39static struct clk ahb_clk;
39static struct clk ipg_clk; 40static struct clk ipg_clk;
40static struct clk usboh3_clk; 41static struct clk usboh3_clk;
42static struct clk emi_fast_clk;
43static struct clk ipu_clk;
44static struct clk mipi_hsc1_clk;
41 45
42#define MAX_DPLL_WAIT_TRIES 1000 /* 1000 * udelay(1) = 1ms */ 46#define MAX_DPLL_WAIT_TRIES 1000 /* 1000 * udelay(1) = 1ms */
43 47
@@ -123,7 +127,7 @@ static inline u32 _get_mux(struct clk *parent, struct clk *m0,
123 return -EINVAL; 127 return -EINVAL;
124} 128}
125 129
126static inline void __iomem *_get_pll_base(struct clk *pll) 130static inline void __iomem *_mx51_get_pll_base(struct clk *pll)
127{ 131{
128 if (pll == &pll1_main_clk) 132 if (pll == &pll1_main_clk)
129 return MX51_DPLL1_BASE; 133 return MX51_DPLL1_BASE;
@@ -137,6 +141,30 @@ static inline void __iomem *_get_pll_base(struct clk *pll)
137 return NULL; 141 return NULL;
138} 142}
139 143
144static inline void __iomem *_mx53_get_pll_base(struct clk *pll)
145{
146 if (pll == &pll1_main_clk)
147 return MX53_DPLL1_BASE;
148 else if (pll == &pll2_sw_clk)
149 return MX53_DPLL2_BASE;
150 else if (pll == &pll3_sw_clk)
151 return MX53_DPLL3_BASE;
152 else if (pll == &mx53_pll4_sw_clk)
153 return MX53_DPLL4_BASE;
154 else
155 BUG();
156
157 return NULL;
158}
159
160static inline void __iomem *_get_pll_base(struct clk *pll)
161{
162 if (cpu_is_mx51())
163 return _mx51_get_pll_base(pll);
164 else
165 return _mx53_get_pll_base(pll);
166}
167
140static unsigned long clk_pll_get_rate(struct clk *clk) 168static unsigned long clk_pll_get_rate(struct clk *clk)
141{ 169{
142 long mfi, mfn, mfd, pdf, ref_clk, mfn_abs; 170 long mfi, mfn, mfd, pdf, ref_clk, mfn_abs;
@@ -514,7 +542,10 @@ static int _clk_max_enable(struct clk *clk)
514 542
515 /* Handshake with MAX when LPM is entered. */ 543 /* Handshake with MAX when LPM is entered. */
516 reg = __raw_readl(MXC_CCM_CLPCR); 544 reg = __raw_readl(MXC_CCM_CLPCR);
517 reg &= ~MXC_CCM_CLPCR_BYPASS_MAX_LPM_HS; 545 if (cpu_is_mx51())
546 reg &= ~MX51_CCM_CLPCR_BYPASS_MAX_LPM_HS;
547 else if (cpu_is_mx53())
548 reg &= ~MX53_CCM_CLPCR_BYPASS_MAX_LPM_HS;
518 __raw_writel(reg, MXC_CCM_CLPCR); 549 __raw_writel(reg, MXC_CCM_CLPCR);
519 550
520 return 0; 551 return 0;
@@ -528,7 +559,10 @@ static void _clk_max_disable(struct clk *clk)
528 559
529 /* No Handshake with MAX when LPM is entered as its disabled. */ 560 /* No Handshake with MAX when LPM is entered as its disabled. */
530 reg = __raw_readl(MXC_CCM_CLPCR); 561 reg = __raw_readl(MXC_CCM_CLPCR);
531 reg |= MXC_CCM_CLPCR_BYPASS_MAX_LPM_HS; 562 if (cpu_is_mx51())
563 reg |= MX51_CCM_CLPCR_BYPASS_MAX_LPM_HS;
564 else if (cpu_is_mx53())
565 reg &= ~MX53_CCM_CLPCR_BYPASS_MAX_LPM_HS;
532 __raw_writel(reg, MXC_CCM_CLPCR); 566 __raw_writel(reg, MXC_CCM_CLPCR);
533} 567}
534 568
@@ -679,6 +713,19 @@ static unsigned long clk_emi_slow_get_rate(struct clk *clk)
679 return clk_get_rate(clk->parent) / div; 713 return clk_get_rate(clk->parent) / div;
680} 714}
681 715
716static unsigned long _clk_ddr_hf_get_rate(struct clk *clk)
717{
718 unsigned long rate;
719 u32 reg, div;
720
721 reg = __raw_readl(MXC_CCM_CBCDR);
722 div = ((reg & MXC_CCM_CBCDR_DDR_PODF_MASK) >>
723 MXC_CCM_CBCDR_DDR_PODF_OFFSET) + 1;
724 rate = clk_get_rate(clk->parent) / div;
725
726 return rate;
727}
728
682/* External high frequency clock */ 729/* External high frequency clock */
683static struct clk ckih_clk = { 730static struct clk ckih_clk = {
684 .get_rate = get_high_reference_clock_rate, 731 .get_rate = get_high_reference_clock_rate,
@@ -739,6 +786,14 @@ static struct clk pll3_sw_clk = {
739 .disable = _clk_pll_disable, 786 .disable = _clk_pll_disable,
740}; 787};
741 788
789/* PLL4 SW supplies to LVDS Display Bridge(LDB) */
790static struct clk mx53_pll4_sw_clk = {
791 .parent = &osc_clk,
792 .set_rate = _clk_pll_set_rate,
793 .enable = _clk_pll_enable,
794 .disable = _clk_pll_disable,
795};
796
742/* Low-power Audio Playback Mode clock */ 797/* Low-power Audio Playback Mode clock */
743static struct clk lp_apm_clk = { 798static struct clk lp_apm_clk = {
744 .parent = &osc_clk, 799 .parent = &osc_clk,
@@ -763,6 +818,12 @@ static struct clk ahb_clk = {
763 .round_rate = _clk_ahb_round_rate, 818 .round_rate = _clk_ahb_round_rate,
764}; 819};
765 820
821static struct clk iim_clk = {
822 .parent = &ipg_clk,
823 .enable_reg = MXC_CCM_CCGR0,
824 .enable_shift = MXC_CCM_CCGRx_CG15_OFFSET,
825};
826
766/* Main IP interface clock for access to registers */ 827/* Main IP interface clock for access to registers */
767static struct clk ipg_clk = { 828static struct clk ipg_clk = {
768 .parent = &ahb_clk, 829 .parent = &ahb_clk,
@@ -810,6 +871,10 @@ static struct clk kpp_clk = {
810 .id = 0, 871 .id = 0,
811}; 872};
812 873
874static struct clk dummy_clk = {
875 .id = 0,
876};
877
813static struct clk emi_slow_clk = { 878static struct clk emi_slow_clk = {
814 .parent = &pll2_sw_clk, 879 .parent = &pll2_sw_clk,
815 .enable_reg = MXC_CCM_CCGR5, 880 .enable_reg = MXC_CCM_CCGR5,
@@ -819,6 +884,109 @@ static struct clk emi_slow_clk = {
819 .get_rate = clk_emi_slow_get_rate, 884 .get_rate = clk_emi_slow_get_rate,
820}; 885};
821 886
887static int clk_ipu_enable(struct clk *clk)
888{
889 u32 reg;
890
891 _clk_ccgr_enable(clk);
892
893 /* Enable handshake with IPU when certain clock rates are changed */
894 reg = __raw_readl(MXC_CCM_CCDR);
895 reg &= ~MXC_CCM_CCDR_IPU_HS_MASK;
896 __raw_writel(reg, MXC_CCM_CCDR);
897
898 /* Enable handshake with IPU when LPM is entered */
899 reg = __raw_readl(MXC_CCM_CLPCR);
900 reg &= ~MXC_CCM_CLPCR_BYPASS_IPU_LPM_HS;
901 __raw_writel(reg, MXC_CCM_CLPCR);
902
903 return 0;
904}
905
906static void clk_ipu_disable(struct clk *clk)
907{
908 u32 reg;
909
910 _clk_ccgr_disable(clk);
911
912 /* Disable handshake with IPU whe dividers are changed */
913 reg = __raw_readl(MXC_CCM_CCDR);
914 reg |= MXC_CCM_CCDR_IPU_HS_MASK;
915 __raw_writel(reg, MXC_CCM_CCDR);
916
917 /* Disable handshake with IPU when LPM is entered */
918 reg = __raw_readl(MXC_CCM_CLPCR);
919 reg |= MXC_CCM_CLPCR_BYPASS_IPU_LPM_HS;
920 __raw_writel(reg, MXC_CCM_CLPCR);
921}
922
923static struct clk ahbmux1_clk = {
924 .parent = &ahb_clk,
925 .secondary = &ahb_max_clk,
926 .enable_reg = MXC_CCM_CCGR0,
927 .enable_shift = MXC_CCM_CCGRx_CG8_OFFSET,
928 .enable = _clk_ccgr_enable,
929 .disable = _clk_ccgr_disable_inwait,
930};
931
932static struct clk ipu_sec_clk = {
933 .parent = &emi_fast_clk,
934 .secondary = &ahbmux1_clk,
935};
936
937static struct clk ddr_hf_clk = {
938 .parent = &pll1_sw_clk,
939 .get_rate = _clk_ddr_hf_get_rate,
940};
941
942static struct clk ddr_clk = {
943 .parent = &ddr_hf_clk,
944};
945
946/* clock definitions for MIPI HSC unit which has been removed
947 * from documentation, but not from hardware
948 */
949static int _clk_hsc_enable(struct clk *clk)
950{
951 u32 reg;
952
953 _clk_ccgr_enable(clk);
954 /* Handshake with IPU when certain clock rates are changed. */
955 reg = __raw_readl(MXC_CCM_CCDR);
956 reg &= ~MXC_CCM_CCDR_HSC_HS_MASK;
957 __raw_writel(reg, MXC_CCM_CCDR);
958
959 reg = __raw_readl(MXC_CCM_CLPCR);
960 reg &= ~MXC_CCM_CLPCR_BYPASS_HSC_LPM_HS;
961 __raw_writel(reg, MXC_CCM_CLPCR);
962
963 return 0;
964}
965
966static void _clk_hsc_disable(struct clk *clk)
967{
968 u32 reg;
969
970 _clk_ccgr_disable(clk);
971 /* No handshake with HSC as its not enabled. */
972 reg = __raw_readl(MXC_CCM_CCDR);
973 reg |= MXC_CCM_CCDR_HSC_HS_MASK;
974 __raw_writel(reg, MXC_CCM_CCDR);
975
976 reg = __raw_readl(MXC_CCM_CLPCR);
977 reg |= MXC_CCM_CLPCR_BYPASS_HSC_LPM_HS;
978 __raw_writel(reg, MXC_CCM_CLPCR);
979}
980
981static struct clk mipi_hsp_clk = {
982 .parent = &ipu_clk,
983 .enable_reg = MXC_CCM_CCGR4,
984 .enable_shift = MXC_CCM_CCGRx_CG6_OFFSET,
985 .enable = _clk_hsc_enable,
986 .disable = _clk_hsc_disable,
987 .secondary = &mipi_hsc1_clk,
988};
989
822#define DEFINE_CLOCK_CCGR(name, i, er, es, pfx, p, s) \ 990#define DEFINE_CLOCK_CCGR(name, i, er, es, pfx, p, s) \
823 static struct clk name = { \ 991 static struct clk name = { \
824 .id = i, \ 992 .id = i, \
@@ -927,6 +1095,41 @@ static struct clk usboh3_clk = {
927 .parent = &pll2_sw_clk, 1095 .parent = &pll2_sw_clk,
928 .get_rate = clk_usboh3_get_rate, 1096 .get_rate = clk_usboh3_get_rate,
929 .set_parent = clk_usboh3_set_parent, 1097 .set_parent = clk_usboh3_set_parent,
1098 .enable = _clk_ccgr_enable,
1099 .disable = _clk_ccgr_disable,
1100 .enable_reg = MXC_CCM_CCGR2,
1101 .enable_shift = MXC_CCM_CCGRx_CG14_OFFSET,
1102};
1103
1104static struct clk usb_ahb_clk = {
1105 .parent = &ipg_clk,
1106 .enable = _clk_ccgr_enable,
1107 .disable = _clk_ccgr_disable,
1108 .enable_reg = MXC_CCM_CCGR2,
1109 .enable_shift = MXC_CCM_CCGRx_CG13_OFFSET,
1110};
1111
1112static int clk_usb_phy1_set_parent(struct clk *clk, struct clk *parent)
1113{
1114 u32 reg;
1115
1116 reg = __raw_readl(MXC_CCM_CSCMR1) & ~MXC_CCM_CSCMR1_USB_PHY_CLK_SEL;
1117
1118 if (parent == &pll3_sw_clk)
1119 reg |= 1 << MXC_CCM_CSCMR1_USB_PHY_CLK_SEL_OFFSET;
1120
1121 __raw_writel(reg, MXC_CCM_CSCMR1);
1122
1123 return 0;
1124}
1125
1126static struct clk usb_phy1_clk = {
1127 .parent = &pll3_sw_clk,
1128 .set_parent = clk_usb_phy1_set_parent,
1129 .enable = _clk_ccgr_enable,
1130 .enable_reg = MXC_CCM_CCGR2,
1131 .enable_shift = MXC_CCM_CCGRx_CG0_OFFSET,
1132 .disable = _clk_ccgr_disable,
930}; 1133};
931 1134
932/* eCSPI */ 1135/* eCSPI */
@@ -1013,6 +1216,10 @@ DEFINE_CLOCK(ssi2_ipg_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG10_OFFSET,
1013 NULL, NULL, &ipg_clk, NULL); 1216 NULL, NULL, &ipg_clk, NULL);
1014DEFINE_CLOCK(ssi2_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG11_OFFSET, 1217DEFINE_CLOCK(ssi2_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG11_OFFSET,
1015 NULL, NULL, &pll3_sw_clk, &ssi2_ipg_clk); 1218 NULL, NULL, &pll3_sw_clk, &ssi2_ipg_clk);
1219DEFINE_CLOCK(ssi3_ipg_clk, 2, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG12_OFFSET,
1220 NULL, NULL, &ipg_clk, NULL);
1221DEFINE_CLOCK(ssi3_clk, 2, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG13_OFFSET,
1222 NULL, NULL, &pll3_sw_clk, &ssi3_ipg_clk);
1016 1223
1017/* eCSPI */ 1224/* eCSPI */
1018DEFINE_CLOCK_FULL(ecspi1_ipg_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG9_OFFSET, 1225DEFINE_CLOCK_FULL(ecspi1_ipg_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG9_OFFSET,
@@ -1046,6 +1253,23 @@ DEFINE_CLOCK_FULL(esdhc2_ipg_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG2_OFFSET,
1046DEFINE_CLOCK_MAX(esdhc2_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG3_OFFSET, 1253DEFINE_CLOCK_MAX(esdhc2_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG3_OFFSET,
1047 clk_esdhc2, &pll2_sw_clk, &esdhc2_ipg_clk); 1254 clk_esdhc2, &pll2_sw_clk, &esdhc2_ipg_clk);
1048 1255
1256DEFINE_CLOCK(mipi_esc_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG5_OFFSET, NULL, NULL, NULL, &pll2_sw_clk);
1257DEFINE_CLOCK(mipi_hsc2_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG4_OFFSET, NULL, NULL, &mipi_esc_clk, &pll2_sw_clk);
1258DEFINE_CLOCK(mipi_hsc1_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG3_OFFSET, NULL, NULL, &mipi_hsc2_clk, &pll2_sw_clk);
1259
1260/* IPU */
1261DEFINE_CLOCK_FULL(ipu_clk, 0, MXC_CCM_CCGR5, MXC_CCM_CCGRx_CG5_OFFSET,
1262 NULL, NULL, clk_ipu_enable, clk_ipu_disable, &ahb_clk, &ipu_sec_clk);
1263
1264DEFINE_CLOCK_FULL(emi_fast_clk, 0, MXC_CCM_CCGR5, MXC_CCM_CCGRx_CG7_OFFSET,
1265 NULL, NULL, _clk_ccgr_enable, _clk_ccgr_disable_inwait,
1266 &ddr_clk, NULL);
1267
1268DEFINE_CLOCK(ipu_di0_clk, 0, MXC_CCM_CCGR6, MXC_CCM_CCGRx_CG5_OFFSET,
1269 NULL, NULL, &pll3_sw_clk, NULL);
1270DEFINE_CLOCK(ipu_di1_clk, 0, MXC_CCM_CCGR6, MXC_CCM_CCGRx_CG6_OFFSET,
1271 NULL, NULL, &pll3_sw_clk, NULL);
1272
1049#define _REGISTER_CLOCK(d, n, c) \ 1273#define _REGISTER_CLOCK(d, n, c) \
1050 { \ 1274 { \
1051 .dev_id = d, \ 1275 .dev_id = d, \
@@ -1053,7 +1277,7 @@ DEFINE_CLOCK_MAX(esdhc2_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG3_OFFSET,
1053 .clk = &c, \ 1277 .clk = &c, \
1054 }, 1278 },
1055 1279
1056static struct clk_lookup lookups[] = { 1280static struct clk_lookup mx51_lookups[] = {
1057 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk) 1281 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk)
1058 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk) 1282 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
1059 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) 1283 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
@@ -1063,15 +1287,19 @@ static struct clk_lookup lookups[] = {
1063 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) 1287 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk)
1064 _REGISTER_CLOCK("imx-i2c.2", NULL, hsi2c_clk) 1288 _REGISTER_CLOCK("imx-i2c.2", NULL, hsi2c_clk)
1065 _REGISTER_CLOCK("mxc-ehci.0", "usb", usboh3_clk) 1289 _REGISTER_CLOCK("mxc-ehci.0", "usb", usboh3_clk)
1066 _REGISTER_CLOCK("mxc-ehci.0", "usb_ahb", ahb_clk) 1290 _REGISTER_CLOCK("mxc-ehci.0", "usb_ahb", usb_ahb_clk)
1291 _REGISTER_CLOCK("mxc-ehci.0", "usb_phy1", usb_phy1_clk)
1067 _REGISTER_CLOCK("mxc-ehci.1", "usb", usboh3_clk) 1292 _REGISTER_CLOCK("mxc-ehci.1", "usb", usboh3_clk)
1068 _REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", ahb_clk) 1293 _REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", usb_ahb_clk)
1294 _REGISTER_CLOCK("mxc-ehci.2", "usb", usboh3_clk)
1295 _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_ahb_clk)
1069 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usboh3_clk) 1296 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usboh3_clk)
1070 _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", ahb_clk) 1297 _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", ahb_clk)
1071 _REGISTER_CLOCK("imx-keypad.0", NULL, kpp_clk) 1298 _REGISTER_CLOCK("imx-keypad.0", NULL, kpp_clk)
1072 _REGISTER_CLOCK("mxc_nand", NULL, nfc_clk) 1299 _REGISTER_CLOCK("mxc_nand", NULL, nfc_clk)
1073 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) 1300 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
1074 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) 1301 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
1302 _REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk)
1075 _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk) 1303 _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk)
1076 _REGISTER_CLOCK(NULL, "ckih", ckih_clk) 1304 _REGISTER_CLOCK(NULL, "ckih", ckih_clk)
1077 _REGISTER_CLOCK(NULL, "ckih2", ckih2_clk) 1305 _REGISTER_CLOCK(NULL, "ckih2", ckih2_clk)
@@ -1082,6 +1310,22 @@ static struct clk_lookup lookups[] = {
1082 _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk) 1310 _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk)
1083 _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk) 1311 _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk)
1084 _REGISTER_CLOCK(NULL, "cpu_clk", cpu_clk) 1312 _REGISTER_CLOCK(NULL, "cpu_clk", cpu_clk)
1313 _REGISTER_CLOCK(NULL, "iim_clk", iim_clk)
1314 _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk)
1315 _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk)
1316 _REGISTER_CLOCK(NULL, "mipi_hsp", mipi_hsp_clk)
1317 _REGISTER_CLOCK("imx-ipuv3", NULL, ipu_clk)
1318 _REGISTER_CLOCK("imx-ipuv3", "di0", ipu_di0_clk)
1319 _REGISTER_CLOCK("imx-ipuv3", "di1", ipu_di1_clk)
1320};
1321
1322static struct clk_lookup mx53_lookups[] = {
1323 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk)
1324 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
1325 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
1326 _REGISTER_CLOCK(NULL, "gpt", gpt_clk)
1327 _REGISTER_CLOCK("fec.0", NULL, fec_clk)
1328 _REGISTER_CLOCK(NULL, "iim_clk", iim_clk)
1085}; 1329};
1086 1330
1087static void clk_tree_init(void) 1331static void clk_tree_init(void)
@@ -1114,14 +1358,22 @@ int __init mx51_clocks_init(unsigned long ckil, unsigned long osc,
1114 ckih2_reference = ckih2; 1358 ckih2_reference = ckih2;
1115 oscillator_reference = osc; 1359 oscillator_reference = osc;
1116 1360
1117 for (i = 0; i < ARRAY_SIZE(lookups); i++) 1361 for (i = 0; i < ARRAY_SIZE(mx51_lookups); i++)
1118 clkdev_add(&lookups[i]); 1362 clkdev_add(&mx51_lookups[i]);
1119 1363
1120 clk_tree_init(); 1364 clk_tree_init();
1121 1365
1366 clk_set_parent(&uart_root_clk, &pll3_sw_clk);
1122 clk_enable(&cpu_clk); 1367 clk_enable(&cpu_clk);
1123 clk_enable(&main_bus_clk); 1368 clk_enable(&main_bus_clk);
1124 1369
1370 clk_enable(&iim_clk);
1371 mx51_revision();
1372 clk_disable(&iim_clk);
1373
1374 /* move usb_phy_clk to 24MHz */
1375 clk_set_parent(&usb_phy1_clk, &osc_clk);
1376
1125 /* set the usboh3_clk parent to pll2_sw_clk */ 1377 /* set the usboh3_clk parent to pll2_sw_clk */
1126 clk_set_parent(&usboh3_clk, &pll2_sw_clk); 1378 clk_set_parent(&usboh3_clk, &pll2_sw_clk);
1127 1379
@@ -1138,3 +1390,31 @@ int __init mx51_clocks_init(unsigned long ckil, unsigned long osc,
1138 MX51_MXC_INT_GPT); 1390 MX51_MXC_INT_GPT);
1139 return 0; 1391 return 0;
1140} 1392}
1393
1394int __init mx53_clocks_init(unsigned long ckil, unsigned long osc,
1395 unsigned long ckih1, unsigned long ckih2)
1396{
1397 int i;
1398
1399 external_low_reference = ckil;
1400 external_high_reference = ckih1;
1401 ckih2_reference = ckih2;
1402 oscillator_reference = osc;
1403
1404 for (i = 0; i < ARRAY_SIZE(mx53_lookups); i++)
1405 clkdev_add(&mx53_lookups[i]);
1406
1407 clk_tree_init();
1408
1409 clk_enable(&cpu_clk);
1410 clk_enable(&main_bus_clk);
1411
1412 clk_enable(&iim_clk);
1413 mx53_revision();
1414 clk_disable(&iim_clk);
1415
1416 /* System timer */
1417 mxc_timer_init(&gpt_clk, MX53_IO_ADDRESS(MX53_GPT1_BASE_ADDR),
1418 MX53_INT_GPT);
1419 return 0;
1420}
diff --git a/arch/arm/mach-mx5/cpu.c b/arch/arm/mach-mx5/cpu.c
index eaacb6e9b5d0..d40671da4372 100644
--- a/arch/arm/mach-mx5/cpu.c
+++ b/arch/arm/mach-mx5/cpu.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved. 2 * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 * 3 *
4 * The code contained herein is licensed under the GNU General Public 4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License 5 * License. You may obtain a copy of the GNU General Public License
@@ -20,37 +20,18 @@
20 20
21static int cpu_silicon_rev = -1; 21static int cpu_silicon_rev = -1;
22 22
23#define SI_REV 0x48 23#define IIM_SREV 0x24
24 24
25static void query_silicon_parameter(void) 25static int get_mx51_srev(void)
26{ 26{
27 void __iomem *rom = ioremap(MX51_IROM_BASE_ADDR, MX51_IROM_SIZE); 27 void __iomem *iim_base = MX51_IO_ADDRESS(MX51_IIM_BASE_ADDR);
28 u32 rev; 28 u32 rev = readl(iim_base + IIM_SREV) & 0xff;
29 29
30 if (!rom) { 30 if (rev == 0x0)
31 cpu_silicon_rev = -EINVAL; 31 return IMX_CHIP_REVISION_2_0;
32 return; 32 else if (rev == 0x10)
33 } 33 return IMX_CHIP_REVISION_3_0;
34 34 return 0;
35 rev = readl(rom + SI_REV);
36 switch (rev) {
37 case 0x1:
38 cpu_silicon_rev = MX51_CHIP_REV_1_0;
39 break;
40 case 0x2:
41 cpu_silicon_rev = MX51_CHIP_REV_1_1;
42 break;
43 case 0x10:
44 cpu_silicon_rev = MX51_CHIP_REV_2_0;
45 break;
46 case 0x20:
47 cpu_silicon_rev = MX51_CHIP_REV_3_0;
48 break;
49 default:
50 cpu_silicon_rev = 0;
51 }
52
53 iounmap(rom);
54} 35}
55 36
56/* 37/*
@@ -64,7 +45,7 @@ int mx51_revision(void)
64 return -EINVAL; 45 return -EINVAL;
65 46
66 if (cpu_silicon_rev == -1) 47 if (cpu_silicon_rev == -1)
67 query_silicon_parameter(); 48 cpu_silicon_rev = get_mx51_srev();
68 49
69 return cpu_silicon_rev; 50 return cpu_silicon_rev;
70} 51}
@@ -79,7 +60,10 @@ EXPORT_SYMBOL(mx51_revision);
79 */ 60 */
80static int __init mx51_neon_fixup(void) 61static int __init mx51_neon_fixup(void)
81{ 62{
82 if (mx51_revision() < MX51_CHIP_REV_3_0 && (elf_hwcap & HWCAP_NEON)) { 63 if (!cpu_is_mx51())
64 return 0;
65
66 if (mx51_revision() < IMX_CHIP_REVISION_3_0 && (elf_hwcap & HWCAP_NEON)) {
83 elf_hwcap &= ~HWCAP_NEON; 67 elf_hwcap &= ~HWCAP_NEON;
84 pr_info("Turning off NEON support, detected broken NEON implementation\n"); 68 pr_info("Turning off NEON support, detected broken NEON implementation\n");
85 } 69 }
@@ -89,29 +73,65 @@ static int __init mx51_neon_fixup(void)
89late_initcall(mx51_neon_fixup); 73late_initcall(mx51_neon_fixup);
90#endif 74#endif
91 75
76static int get_mx53_srev(void)
77{
78 void __iomem *iim_base = MX51_IO_ADDRESS(MX53_IIM_BASE_ADDR);
79 u32 rev = readl(iim_base + IIM_SREV) & 0xff;
80
81 if (rev == 0x0)
82 return IMX_CHIP_REVISION_1_0;
83 else if (rev == 0x10)
84 return IMX_CHIP_REVISION_2_0;
85 return 0;
86}
87
88/*
89 * Returns:
90 * the silicon revision of the cpu
91 * -EINVAL - not a mx53
92 */
93int mx53_revision(void)
94{
95 if (!cpu_is_mx53())
96 return -EINVAL;
97
98 if (cpu_silicon_rev == -1)
99 cpu_silicon_rev = get_mx53_srev();
100
101 return cpu_silicon_rev;
102}
103EXPORT_SYMBOL(mx53_revision);
104
92static int __init post_cpu_init(void) 105static int __init post_cpu_init(void)
93{ 106{
94 unsigned int reg; 107 unsigned int reg;
95 void __iomem *base; 108 void __iomem *base;
96 109
97 if (!cpu_is_mx51()) 110 if (cpu_is_mx51() || cpu_is_mx53()) {
98 return 0; 111 if (cpu_is_mx51())
99 112 base = MX51_IO_ADDRESS(MX51_AIPS1_BASE_ADDR);
100 base = MX51_IO_ADDRESS(MX51_AIPS1_BASE_ADDR); 113 else
101 __raw_writel(0x0, base + 0x40); 114 base = MX53_IO_ADDRESS(MX53_AIPS1_BASE_ADDR);
102 __raw_writel(0x0, base + 0x44); 115
103 __raw_writel(0x0, base + 0x48); 116 __raw_writel(0x0, base + 0x40);
104 __raw_writel(0x0, base + 0x4C); 117 __raw_writel(0x0, base + 0x44);
105 reg = __raw_readl(base + 0x50) & 0x00FFFFFF; 118 __raw_writel(0x0, base + 0x48);
106 __raw_writel(reg, base + 0x50); 119 __raw_writel(0x0, base + 0x4C);
107 120 reg = __raw_readl(base + 0x50) & 0x00FFFFFF;
108 base = MX51_IO_ADDRESS(MX51_AIPS2_BASE_ADDR); 121 __raw_writel(reg, base + 0x50);
109 __raw_writel(0x0, base + 0x40); 122
110 __raw_writel(0x0, base + 0x44); 123 if (cpu_is_mx51())
111 __raw_writel(0x0, base + 0x48); 124 base = MX51_IO_ADDRESS(MX51_AIPS2_BASE_ADDR);
112 __raw_writel(0x0, base + 0x4C); 125 else
113 reg = __raw_readl(base + 0x50) & 0x00FFFFFF; 126 base = MX53_IO_ADDRESS(MX53_AIPS2_BASE_ADDR);
114 __raw_writel(reg, base + 0x50); 127
128 __raw_writel(0x0, base + 0x40);
129 __raw_writel(0x0, base + 0x44);
130 __raw_writel(0x0, base + 0x48);
131 __raw_writel(0x0, base + 0x4C);
132 reg = __raw_readl(base + 0x50) & 0x00FFFFFF;
133 __raw_writel(reg, base + 0x50);
134 }
115 135
116 return 0; 136 return 0;
117} 137}
diff --git a/arch/arm/mach-mx5/crm_regs.h b/arch/arm/mach-mx5/crm_regs.h
index c776b9af0624..b462c22f53d8 100644
--- a/arch/arm/mach-mx5/crm_regs.h
+++ b/arch/arm/mach-mx5/crm_regs.h
@@ -18,6 +18,13 @@
18#define MX51_CORTEXA8_BASE MX51_IO_ADDRESS(MX51_ARM_BASE_ADDR) 18#define MX51_CORTEXA8_BASE MX51_IO_ADDRESS(MX51_ARM_BASE_ADDR)
19#define MX51_GPC_BASE MX51_IO_ADDRESS(MX51_GPC_BASE_ADDR) 19#define MX51_GPC_BASE MX51_IO_ADDRESS(MX51_GPC_BASE_ADDR)
20 20
21/*MX53*/
22#define MX53_CCM_BASE MX53_IO_ADDRESS(MX53_CCM_BASE_ADDR)
23#define MX53_DPLL1_BASE MX53_IO_ADDRESS(MX53_PLL1_BASE_ADDR)
24#define MX53_DPLL2_BASE MX53_IO_ADDRESS(MX53_PLL2_BASE_ADDR)
25#define MX53_DPLL3_BASE MX53_IO_ADDRESS(MX53_PLL3_BASE_ADDR)
26#define MX53_DPLL4_BASE MX53_IO_ADDRESS(MX53_PLL3_BASE_ADDR)
27
21/* PLL Register Offsets */ 28/* PLL Register Offsets */
22#define MXC_PLL_DP_CTL 0x00 29#define MXC_PLL_DP_CTL 0x00
23#define MXC_PLL_DP_CONFIG 0x04 30#define MXC_PLL_DP_CONFIG 0x04
@@ -380,7 +387,8 @@
380/* Define the bits in register CLPCR */ 387/* Define the bits in register CLPCR */
381#define MXC_CCM_CLPCR_BYPASS_HSC_LPM_HS (0x1 << 23) 388#define MXC_CCM_CLPCR_BYPASS_HSC_LPM_HS (0x1 << 23)
382#define MXC_CCM_CLPCR_BYPASS_SCC_LPM_HS (0x1 << 22) 389#define MXC_CCM_CLPCR_BYPASS_SCC_LPM_HS (0x1 << 22)
383#define MXC_CCM_CLPCR_BYPASS_MAX_LPM_HS (0x1 << 21) 390#define MX51_CCM_CLPCR_BYPASS_MAX_LPM_HS (0x1 << 21)
391#define MX53_CCM_CLPCR_BYPASS_MAX_LPM_HS (0x1 << 25)
384#define MXC_CCM_CLPCR_BYPASS_SDMA_LPM_HS (0x1 << 20) 392#define MXC_CCM_CLPCR_BYPASS_SDMA_LPM_HS (0x1 << 20)
385#define MXC_CCM_CLPCR_BYPASS_EMI_LPM_HS (0x1 << 19) 393#define MXC_CCM_CLPCR_BYPASS_EMI_LPM_HS (0x1 << 19)
386#define MXC_CCM_CLPCR_BYPASS_IPU_LPM_HS (0x1 << 18) 394#define MXC_CCM_CLPCR_BYPASS_IPU_LPM_HS (0x1 << 18)
diff --git a/arch/arm/mach-mx5/devices-imx51.h b/arch/arm/mach-mx5/devices-imx51.h
index 8c50cb5d05f5..6302e4670000 100644
--- a/arch/arm/mach-mx5/devices-imx51.h
+++ b/arch/arm/mach-mx5/devices-imx51.h
@@ -31,6 +31,11 @@ extern const struct imx_mxc_nand_data imx51_mxc_nand_data __initconst;
31#define imx51_add_mxc_nand(pdata) \ 31#define imx51_add_mxc_nand(pdata) \
32 imx_add_mxc_nand(&imx51_mxc_nand_data, pdata) 32 imx_add_mxc_nand(&imx51_mxc_nand_data, pdata)
33 33
34extern const struct imx_sdhci_esdhc_imx_data
35imx51_sdhci_esdhc_imx_data[] __initconst;
36#define imx51_add_sdhci_esdhc_imx(id, pdata) \
37 imx_add_sdhci_esdhc_imx(&imx51_sdhci_esdhc_imx_data[id], pdata)
38
34extern const struct imx_spi_imx_data imx51_cspi_data __initconst; 39extern const struct imx_spi_imx_data imx51_cspi_data __initconst;
35#define imx51_add_cspi(pdata) \ 40#define imx51_add_cspi(pdata) \
36 imx_add_spi_imx(&imx51_cspi_data, pdata) 41 imx_add_spi_imx(&imx51_cspi_data, pdata)
@@ -39,6 +44,6 @@ extern const struct imx_spi_imx_data imx51_ecspi_data[] __initconst;
39#define imx51_add_ecspi(id, pdata) \ 44#define imx51_add_ecspi(id, pdata) \
40 imx_add_spi_imx(&imx51_ecspi_data[id], pdata) 45 imx_add_spi_imx(&imx51_ecspi_data[id], pdata)
41 46
42extern const struct imx_esdhc_imx_data imx51_esdhc_data[] __initconst; 47extern const struct imx_imx2_wdt_data imx51_imx2_wdt_data[] __initconst;
43#define imx51_add_esdhc(id, pdata) \ 48#define imx51_add_imx2_wdt(id, pdata) \
44 imx_add_esdhc(&imx51_esdhc_data[id], pdata) 49 imx_add_imx2_wdt(&imx51_imx2_wdt_data[id])
diff --git a/arch/arm/mach-mx5/devices-imx53.h b/arch/arm/mach-mx5/devices-imx53.h
new file mode 100644
index 000000000000..9d0ec2507fa6
--- /dev/null
+++ b/arch/arm/mach-mx5/devices-imx53.h
@@ -0,0 +1,13 @@
1/*
2 * Copyright (C) 2010 Yong Shen. <Yong.Shen@linaro.org>
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8#include <mach/mx53.h>
9#include <mach/devices-common.h>
10
11extern const struct imx_imx_uart_1irq_data imx53_imx_uart_data[] __initconst;
12#define imx53_add_imx_uart(id, pdata) \
13 imx_add_imx_uart_1irq(&imx53_imx_uart_data[id], pdata)
diff --git a/arch/arm/mach-mx5/devices-mx50.h b/arch/arm/mach-mx5/devices-mx50.h
new file mode 100644
index 000000000000..98ab07468a0e
--- /dev/null
+++ b/arch/arm/mach-mx5/devices-mx50.h
@@ -0,0 +1,26 @@
1/*
2 * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#include <mach/mx50.h>
22#include <mach/devices-common.h>
23
24extern const struct imx_imx_uart_1irq_data imx50_imx_uart_data[] __initconst;
25#define imx50_add_imx_uart(id, pdata) \
26 imx_add_imx_uart_1irq(&imx50_imx_uart_data[id], pdata)
diff --git a/arch/arm/mach-mx5/devices.c b/arch/arm/mach-mx5/devices.c
index 4c7be87a7c9d..1bda5cb339dc 100644
--- a/arch/arm/mach-mx5/devices.c
+++ b/arch/arm/mach-mx5/devices.c
@@ -97,19 +97,27 @@ struct platform_device mxc_usbh1_device = {
97 }, 97 },
98}; 98};
99 99
100static struct resource mxc_wdt_resources[] = { 100static struct resource usbh2_resources[] = {
101 { 101 {
102 .start = MX51_WDOG_BASE_ADDR, 102 .start = MX51_OTG_BASE_ADDR + 0x400,
103 .end = MX51_WDOG_BASE_ADDR + SZ_16K - 1, 103 .end = MX51_OTG_BASE_ADDR + 0x400 + 0x1ff,
104 .flags = IORESOURCE_MEM, 104 .flags = IORESOURCE_MEM,
105 }, 105 },
106 {
107 .start = MX51_MXC_INT_USB_H2,
108 .flags = IORESOURCE_IRQ,
109 },
106}; 110};
107 111
108struct platform_device mxc_wdt = { 112struct platform_device mxc_usbh2_device = {
109 .name = "imx2-wdt", 113 .name = "mxc-ehci",
110 .id = 0, 114 .id = 2,
111 .num_resources = ARRAY_SIZE(mxc_wdt_resources), 115 .num_resources = ARRAY_SIZE(usbh2_resources),
112 .resource = mxc_wdt_resources, 116 .resource = usbh2_resources,
117 .dev = {
118 .dma_mask = &usb_dma_mask,
119 .coherent_dma_mask = DMA_BIT_MASK(32),
120 },
113}; 121};
114 122
115static struct resource mxc_kpp_resources[] = { 123static struct resource mxc_kpp_resources[] = {
@@ -160,9 +168,36 @@ static struct mxc_gpio_port mxc_gpio_ports[] = {
160 .irq_high = MX51_MXC_INT_GPIO4_HIGH, 168 .irq_high = MX51_MXC_INT_GPIO4_HIGH,
161 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 3 169 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 3
162 }, 170 },
171 {
172 .chip.label = "gpio-4",
173 .base = MX53_IO_ADDRESS(MX53_GPIO5_BASE_ADDR),
174 .irq = MX53_INT_GPIO5_LOW,
175 .irq_high = MX53_INT_GPIO5_HIGH,
176 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 4
177 },
178 {
179 .chip.label = "gpio-5",
180 .base = MX53_IO_ADDRESS(MX53_GPIO6_BASE_ADDR),
181 .irq = MX53_INT_GPIO6_LOW,
182 .irq_high = MX53_INT_GPIO6_HIGH,
183 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 5
184 },
185 {
186 .chip.label = "gpio-6",
187 .base = MX53_IO_ADDRESS(MX53_GPIO7_BASE_ADDR),
188 .irq = MX53_INT_GPIO7_LOW,
189 .irq_high = MX53_INT_GPIO7_HIGH,
190 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 6
191 },
163}; 192};
164 193
165int __init imx51_register_gpios(void) 194int __init imx51_register_gpios(void)
166{ 195{
196 return mxc_gpio_init(mxc_gpio_ports, 4);
197}
198
199int __init imx53_register_gpios(void)
200{
167 return mxc_gpio_init(mxc_gpio_ports, ARRAY_SIZE(mxc_gpio_ports)); 201 return mxc_gpio_init(mxc_gpio_ports, ARRAY_SIZE(mxc_gpio_ports));
168} 202}
203
diff --git a/arch/arm/mach-mx5/devices.h b/arch/arm/mach-mx5/devices.h
index af1d07c0bbc1..16891aa3573c 100644
--- a/arch/arm/mach-mx5/devices.h
+++ b/arch/arm/mach-mx5/devices.h
@@ -1,6 +1,6 @@
1extern struct platform_device mxc_usbdr_host_device; 1extern struct platform_device mxc_usbdr_host_device;
2extern struct platform_device mxc_usbh1_device; 2extern struct platform_device mxc_usbh1_device;
3extern struct platform_device mxc_usbh2_device;
3extern struct platform_device mxc_usbdr_udc_device; 4extern struct platform_device mxc_usbdr_udc_device;
4extern struct platform_device mxc_wdt;
5extern struct platform_device mxc_hsi2c_device; 5extern struct platform_device mxc_hsi2c_device;
6extern struct platform_device mxc_keypad_device; 6extern struct platform_device mxc_keypad_device;
diff --git a/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
index a2e6e8c39d25..c96d018ff8a2 100644
--- a/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
+++ b/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
@@ -33,12 +33,12 @@
33#include "devices-imx51.h" 33#include "devices-imx51.h"
34#include "devices.h" 34#include "devices.h"
35 35
36#define MBIMX51_TSC2007_GPIO (2*32 + 30) 36#define MBIMX51_TSC2007_GPIO IMX_GPIO_NR(3, 30)
37#define MBIMX51_TSC2007_IRQ (MXC_INTERNAL_IRQS + MBIMX51_TSC2007_GPIO) 37#define MBIMX51_TSC2007_IRQ (MXC_INTERNAL_IRQS + MBIMX51_TSC2007_GPIO)
38#define MBIMX51_LED0 (2*32 + 5) 38#define MBIMX51_LED0 IMX_GPIO_NR(3, 5)
39#define MBIMX51_LED1 (2*32 + 6) 39#define MBIMX51_LED1 IMX_GPIO_NR(3, 6)
40#define MBIMX51_LED2 (2*32 + 7) 40#define MBIMX51_LED2 IMX_GPIO_NR(3, 7)
41#define MBIMX51_LED3 (2*32 + 8) 41#define MBIMX51_LED3 IMX_GPIO_NR(3, 8)
42 42
43static struct gpio_led mbimx51_leds[] = { 43static struct gpio_led mbimx51_leds[] = {
44 { 44 {
@@ -84,7 +84,7 @@ static struct platform_device *devices[] __initdata = {
84 &mbimx51_leds_gpio, 84 &mbimx51_leds_gpio,
85}; 85};
86 86
87static struct pad_desc mbimx51_pads[] = { 87static iomux_v3_cfg_t mbimx51_pads[] = {
88 /* UART2 */ 88 /* UART2 */
89 MX51_PAD_UART2_RXD__UART2_RXD, 89 MX51_PAD_UART2_RXD__UART2_RXD,
90 MX51_PAD_UART2_TXD__UART2_TXD, 90 MX51_PAD_UART2_TXD__UART2_TXD,
@@ -96,13 +96,13 @@ static struct pad_desc mbimx51_pads[] = {
96 MX51_PAD_KEY_COL5__UART3_CTS, 96 MX51_PAD_KEY_COL5__UART3_CTS,
97 97
98 /* TSC2007 IRQ */ 98 /* TSC2007 IRQ */
99 MX51_PAD_NANDF_D10__GPIO_3_30, 99 MX51_PAD_NANDF_D10__GPIO3_30,
100 100
101 /* LEDS */ 101 /* LEDS */
102 MX51_PAD_DISPB2_SER_DIN__GPIO_3_5, 102 MX51_PAD_DISPB2_SER_DIN__GPIO3_5,
103 MX51_PAD_DISPB2_SER_DIO__GPIO_3_6, 103 MX51_PAD_DISPB2_SER_DIO__GPIO3_6,
104 MX51_PAD_DISPB2_SER_CLK__GPIO_3_7, 104 MX51_PAD_DISPB2_SER_CLK__GPIO3_7,
105 MX51_PAD_DISPB2_SER_RS__GPIO_3_8, 105 MX51_PAD_DISPB2_SER_RS__GPIO3_8,
106 106
107 /* KPP */ 107 /* KPP */
108 MX51_PAD_KEY_ROW0__KEY_ROW0, 108 MX51_PAD_KEY_ROW0__KEY_ROW0,
@@ -217,6 +217,6 @@ void __init eukrea_mbimx51_baseboard_init(void)
217 i2c_register_board_info(1, mbimx51_i2c_devices, 217 i2c_register_board_info(1, mbimx51_i2c_devices,
218 ARRAY_SIZE(mbimx51_i2c_devices)); 218 ARRAY_SIZE(mbimx51_i2c_devices));
219 219
220 imx51_add_esdhc(0, NULL); 220 imx51_add_sdhci_esdhc_imx(0, NULL);
221 imx51_add_esdhc(1, NULL); 221 imx51_add_sdhci_esdhc_imx(1, NULL);
222} 222}
diff --git a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c
index 2b48f5190830..c372a4373691 100644
--- a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c
+++ b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c
@@ -45,14 +45,13 @@
45#include "devices-imx51.h" 45#include "devices-imx51.h"
46#include "devices.h" 46#include "devices.h"
47 47
48#define MBIMXSD_GPIO_3_31 IOMUX_PAD(0x554, 0x16C, 3, 0x0, 0, \ 48static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
49 MX51_PAD_CTRL_1 | PAD_CTL_PUS_22K_UP)
50
51static struct pad_desc eukrea_mbimxsd_pads[] = {
52 /* LED */ 49 /* LED */
53 MX51_PAD_NANDF_D10__GPIO_3_30, 50 MX51_PAD_NANDF_D10__GPIO3_30,
54 /* SWITCH */ 51 /* SWITCH */
55 MBIMXSD_GPIO_3_31, 52 _MX51_PAD_NANDF_D9__GPIO3_31 | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP |
53 PAD_CTL_PKE | PAD_CTL_SRE_FAST |
54 PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
56 /* UART2 */ 55 /* UART2 */
57 MX51_PAD_UART2_RXD__UART2_RXD, 56 MX51_PAD_UART2_RXD__UART2_RXD,
58 MX51_PAD_UART2_TXD__UART2_TXD, 57 MX51_PAD_UART2_TXD__UART2_TXD,
@@ -70,8 +69,8 @@ static struct pad_desc eukrea_mbimxsd_pads[] = {
70 MX51_PAD_SD1_DATA3__SD1_DATA3, 69 MX51_PAD_SD1_DATA3__SD1_DATA3,
71}; 70};
72 71
73#define GPIO_LED1 (2 * 32 + 30) 72#define GPIO_LED1 IMX_GPIO_NR(3, 30)
74#define GPIO_SWITCH1 (2 * 32 + 31) 73#define GPIO_SWITCH1 IMX_GPIO_NR(3, 31)
75 74
76static struct gpio_led eukrea_mbimxsd_leds[] = { 75static struct gpio_led eukrea_mbimxsd_leds[] = {
77 { 76 {
@@ -149,7 +148,7 @@ void __init eukrea_mbimxsd51_baseboard_init(void)
149 imx51_add_imx_uart(1, NULL); 148 imx51_add_imx_uart(1, NULL);
150 imx51_add_imx_uart(2, &uart_pdata); 149 imx51_add_imx_uart(2, &uart_pdata);
151 150
152 imx51_add_esdhc(0, NULL); 151 imx51_add_sdhci_esdhc_imx(0, NULL);
153 152
154 gpio_request(GPIO_LED1, "LED1"); 153 gpio_request(GPIO_LED1, "LED1");
155 gpio_direction_output(GPIO_LED1, 1); 154 gpio_direction_output(GPIO_LED1, 1);
diff --git a/arch/arm/mach-mx5/mm-mx50.c b/arch/arm/mach-mx5/mm-mx50.c
new file mode 100644
index 000000000000..8c6540e58390
--- /dev/null
+++ b/arch/arm/mach-mx5/mm-mx50.c
@@ -0,0 +1,59 @@
1/*
2 * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
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 as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Create static mapping between physical to virtual memory.
19 */
20
21#include <linux/mm.h>
22#include <linux/init.h>
23
24#include <asm/mach/map.h>
25
26#include <mach/hardware.h>
27#include <mach/common.h>
28#include <mach/iomux-v3.h>
29
30/*
31 * Define the MX50 memory map.
32 */
33static struct map_desc mx50_io_desc[] __initdata = {
34 imx_map_entry(MX50, TZIC, MT_DEVICE),
35 imx_map_entry(MX50, SPBA0, MT_DEVICE),
36 imx_map_entry(MX50, AIPS1, MT_DEVICE),
37 imx_map_entry(MX50, AIPS2, MT_DEVICE),
38};
39
40/*
41 * This function initializes the memory map. It is called during the
42 * system startup to create static physical to virtual memory mappings
43 * for the IO modules.
44 */
45void __init mx50_map_io(void)
46{
47 mxc_set_cpu_type(MXC_CPU_MX50);
48 mxc_iomux_v3_init(MX50_IO_ADDRESS(MX50_IOMUXC_BASE_ADDR));
49 mxc_arch_reset_init(MX50_IO_ADDRESS(MX50_WDOG_BASE_ADDR));
50 iotable_init(mx50_io_desc, ARRAY_SIZE(mx50_io_desc));
51}
52
53int imx50_register_gpios(void);
54
55void __init mx50_init_irq(void)
56{
57 tzic_init_irq(MX50_IO_ADDRESS(MX50_TZIC_BASE_ADDR));
58 imx50_register_gpios();
59}
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
index bc3f30db8d9a..457f9f95204b 100644
--- a/arch/arm/mach-mx5/mm.c
+++ b/arch/arm/mach-mx5/mm.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved. 2 * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 * 3 *
4 * The code contained herein is licensed under the GNU General Public 4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License 5 * License. You may obtain a copy of the GNU General Public License
@@ -23,33 +23,21 @@
23/* 23/*
24 * Define the MX51 memory map. 24 * Define the MX51 memory map.
25 */ 25 */
26static struct map_desc mxc_io_desc[] __initdata = { 26static struct map_desc mx51_io_desc[] __initdata = {
27 { 27 imx_map_entry(MX51, IRAM, MT_DEVICE),
28 .virtual = MX51_IRAM_BASE_ADDR_VIRT, 28 imx_map_entry(MX51, DEBUG, MT_DEVICE),
29 .pfn = __phys_to_pfn(MX51_IRAM_BASE_ADDR), 29 imx_map_entry(MX51, AIPS1, MT_DEVICE),
30 .length = MX51_IRAM_SIZE, 30 imx_map_entry(MX51, SPBA0, MT_DEVICE),
31 .type = MT_DEVICE 31 imx_map_entry(MX51, AIPS2, MT_DEVICE),
32 }, { 32};
33 .virtual = MX51_DEBUG_BASE_ADDR_VIRT, 33
34 .pfn = __phys_to_pfn(MX51_DEBUG_BASE_ADDR), 34/*
35 .length = MX51_DEBUG_SIZE, 35 * Define the MX53 memory map.
36 .type = MT_DEVICE 36 */
37 }, { 37static struct map_desc mx53_io_desc[] __initdata = {
38 .virtual = MX51_AIPS1_BASE_ADDR_VIRT, 38 imx_map_entry(MX53, AIPS1, MT_DEVICE),
39 .pfn = __phys_to_pfn(MX51_AIPS1_BASE_ADDR), 39 imx_map_entry(MX53, SPBA0, MT_DEVICE),
40 .length = MX51_AIPS1_SIZE, 40 imx_map_entry(MX53, AIPS2, MT_DEVICE),
41 .type = MT_DEVICE
42 }, {
43 .virtual = MX51_SPBA0_BASE_ADDR_VIRT,
44 .pfn = __phys_to_pfn(MX51_SPBA0_BASE_ADDR),
45 .length = MX51_SPBA0_SIZE,
46 .type = MT_DEVICE
47 }, {
48 .virtual = MX51_AIPS2_BASE_ADDR_VIRT,
49 .pfn = __phys_to_pfn(MX51_AIPS2_BASE_ADDR),
50 .length = MX51_AIPS2_SIZE,
51 .type = MT_DEVICE
52 },
53}; 41};
54 42
55/* 43/*
@@ -61,8 +49,16 @@ void __init mx51_map_io(void)
61{ 49{
62 mxc_set_cpu_type(MXC_CPU_MX51); 50 mxc_set_cpu_type(MXC_CPU_MX51);
63 mxc_iomux_v3_init(MX51_IO_ADDRESS(MX51_IOMUXC_BASE_ADDR)); 51 mxc_iomux_v3_init(MX51_IO_ADDRESS(MX51_IOMUXC_BASE_ADDR));
64 mxc_arch_reset_init(MX51_IO_ADDRESS(MX51_WDOG_BASE_ADDR)); 52 mxc_arch_reset_init(MX51_IO_ADDRESS(MX51_WDOG1_BASE_ADDR));
65 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); 53 iotable_init(mx51_io_desc, ARRAY_SIZE(mx51_io_desc));
54}
55
56void __init mx53_map_io(void)
57{
58 mxc_set_cpu_type(MXC_CPU_MX53);
59 mxc_iomux_v3_init(MX53_IO_ADDRESS(MX53_IOMUXC_BASE_ADDR));
60 mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG_BASE_ADDR));
61 iotable_init(mx53_io_desc, ARRAY_SIZE(mx53_io_desc));
66} 62}
67 63
68int imx51_register_gpios(void); 64int imx51_register_gpios(void);
@@ -72,7 +68,7 @@ void __init mx51_init_irq(void)
72 unsigned long tzic_addr; 68 unsigned long tzic_addr;
73 void __iomem *tzic_virt; 69 void __iomem *tzic_virt;
74 70
75 if (mx51_revision() < MX51_CHIP_REV_2_0) 71 if (mx51_revision() < IMX_CHIP_REVISION_2_0)
76 tzic_addr = MX51_TZIC_BASE_ADDR_TO1; 72 tzic_addr = MX51_TZIC_BASE_ADDR_TO1;
77 else 73 else
78 tzic_addr = MX51_TZIC_BASE_ADDR; 74 tzic_addr = MX51_TZIC_BASE_ADDR;
@@ -84,3 +80,20 @@ void __init mx51_init_irq(void)
84 tzic_init_irq(tzic_virt); 80 tzic_init_irq(tzic_virt);
85 imx51_register_gpios(); 81 imx51_register_gpios();
86} 82}
83
84int imx53_register_gpios(void);
85
86void __init mx53_init_irq(void)
87{
88 unsigned long tzic_addr;
89 void __iomem *tzic_virt;
90
91 tzic_addr = MX53_TZIC_BASE_ADDR;
92
93 tzic_virt = ioremap(tzic_addr, SZ_16K);
94 if (!tzic_virt)
95 panic("unable to map TZIC interrupt controller\n");
96
97 tzic_init_irq(tzic_virt);
98 imx53_register_gpios();
99}