aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-06-08 14:26:28 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-06-08 14:26:28 -0400
commit2d8d24935d372175786ebefa8a2de8680831b67f (patch)
tree9969683b85f94b59e58bdc1a42e543be62029cb1 /arch/arm
parentc0683039207226afcffbe0fbf6a1caaee77a37b0 (diff)
parenta0895162fbc1a4168c8cf29e1eb1bbc8c260a80a (diff)
Merge branch 'mxc-master' of git://git.pengutronix.de/git/imx/linux-2.6 into devel
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-mx2/Kconfig8
-rw-r--r--arch/arm/mach-mx2/Makefile2
-rw-r--r--arch/arm/mach-mx2/clock_imx21.c77
-rw-r--r--arch/arm/mach-mx2/mx27lite.c95
-rw-r--r--arch/arm/mach-mx2/mx27pdk.c2
-rw-r--r--arch/arm/mach-mx3/Kconfig21
-rw-r--r--arch/arm/mach-mx3/Makefile3
-rw-r--r--arch/arm/mach-mx3/armadillo5x0.c295
-rw-r--r--arch/arm/mach-mx3/clock.c9
-rw-r--r--arch/arm/mach-mx3/devices.h2
-rw-r--r--arch/arm/mach-mx3/mx31lilly-db.c216
-rw-r--r--arch/arm/mach-mx3/mx31lilly.c155
-rw-r--r--arch/arm/mach-mx3/mx31pdk.c38
-rw-r--r--arch/arm/mach-mx3/mx35pdk.c104
-rw-r--r--arch/arm/plat-mxc/include/mach/board-armadillo5x0.h22
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx27lite.h19
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31lilly.h46
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx35pdk.h27
-rw-r--r--arch/arm/plat-mxc/include/mach/debug-macro.S9
19 files changed, 1121 insertions, 29 deletions
diff --git a/arch/arm/mach-mx2/Kconfig b/arch/arm/mach-mx2/Kconfig
index 61550443a233..c77da586b71d 100644
--- a/arch/arm/mach-mx2/Kconfig
+++ b/arch/arm/mach-mx2/Kconfig
@@ -59,4 +59,12 @@ config MACH_MX27_3DS
59 help 59 help
60 Include support for MX27PDK platform. This includes specific 60 Include support for MX27PDK platform. This includes specific
61 configurations for the board and its peripherals. 61 configurations for the board and its peripherals.
62
63config MACH_MX27LITE
64 bool "LogicPD MX27 LITEKIT platform"
65 depends on MACH_MX27
66 help
67 Include support for MX27 LITEKIT platform. This includes specific
68 configurations for the board and its peripherals.
69
62endif 70endif
diff --git a/arch/arm/mach-mx2/Makefile b/arch/arm/mach-mx2/Makefile
index d140e2dcf942..b9b1cca4e9bc 100644
--- a/arch/arm/mach-mx2/Makefile
+++ b/arch/arm/mach-mx2/Makefile
@@ -16,3 +16,5 @@ obj-$(CONFIG_MACH_MX27ADS) += mx27ads.o
16obj-$(CONFIG_MACH_PCM038) += pcm038.o 16obj-$(CONFIG_MACH_PCM038) += pcm038.o
17obj-$(CONFIG_MACH_PCM970_BASEBOARD) += pcm970-baseboard.o 17obj-$(CONFIG_MACH_PCM970_BASEBOARD) += pcm970-baseboard.o
18obj-$(CONFIG_MACH_MX27_3DS) += mx27pdk.o 18obj-$(CONFIG_MACH_MX27_3DS) += mx27pdk.o
19obj-$(CONFIG_MACH_MX27LITE) += mx27lite.o
20
diff --git a/arch/arm/mach-mx2/clock_imx21.c b/arch/arm/mach-mx2/clock_imx21.c
index 999d013e06e3..fa2b292d7b3c 100644
--- a/arch/arm/mach-mx2/clock_imx21.c
+++ b/arch/arm/mach-mx2/clock_imx21.c
@@ -48,6 +48,25 @@ static void _clk_disable(struct clk *clk)
48 __raw_writel(reg, clk->enable_reg); 48 __raw_writel(reg, clk->enable_reg);
49} 49}
50 50
51static unsigned long _clk_generic_round_rate(struct clk *clk,
52 unsigned long rate,
53 u32 max_divisor)
54{
55 u32 div;
56 unsigned long parent_rate;
57
58 parent_rate = clk_get_rate(clk->parent);
59
60 div = parent_rate / rate;
61 if (parent_rate % rate)
62 div++;
63
64 if (div > max_divisor)
65 div = max_divisor;
66
67 return parent_rate / div;
68}
69
51static int _clk_spll_enable(struct clk *clk) 70static int _clk_spll_enable(struct clk *clk)
52{ 71{
53 u32 reg; 72 u32 reg;
@@ -78,19 +97,7 @@ static void _clk_spll_disable(struct clk *clk)
78static unsigned long _clk_perclkx_round_rate(struct clk *clk, 97static unsigned long _clk_perclkx_round_rate(struct clk *clk,
79 unsigned long rate) 98 unsigned long rate)
80{ 99{
81 u32 div; 100 return _clk_generic_round_rate(clk, rate, 64);
82 unsigned long parent_rate;
83
84 parent_rate = clk_get_rate(clk->parent);
85
86 div = parent_rate / rate;
87 if (parent_rate % rate)
88 div++;
89
90 if (div > 64)
91 div = 64;
92
93 return parent_rate / div;
94} 101}
95 102
96static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate) 103static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate)
@@ -130,6 +137,32 @@ static unsigned long _clk_usb_recalc(struct clk *clk)
130 return parent_rate / (usb_pdf + 1U); 137 return parent_rate / (usb_pdf + 1U);
131} 138}
132 139
140static unsigned long _clk_usb_round_rate(struct clk *clk,
141 unsigned long rate)
142{
143 return _clk_generic_round_rate(clk, rate, 8);
144}
145
146static int _clk_usb_set_rate(struct clk *clk, unsigned long rate)
147{
148 u32 reg;
149 u32 div;
150 unsigned long parent_rate;
151
152 parent_rate = clk_get_rate(clk->parent);
153
154 div = parent_rate / rate;
155 if (div > 8 || div < 1 || ((parent_rate / div) != rate))
156 return -EINVAL;
157 div--;
158
159 reg = CSCR() & ~CCM_CSCR_USB_MASK;
160 reg |= div << CCM_CSCR_USB_OFFSET;
161 __raw_writel(reg, CCM_CSCR);
162
163 return 0;
164}
165
133static unsigned long _clk_ssix_recalc(struct clk *clk, unsigned long pdf) 166static unsigned long _clk_ssix_recalc(struct clk *clk, unsigned long pdf)
134{ 167{
135 unsigned long parent_rate; 168 unsigned long parent_rate;
@@ -595,11 +628,14 @@ static struct clk csi_clk[] = {
595static struct clk usb_clk[] = { 628static struct clk usb_clk[] = {
596 { 629 {
597 .parent = &spll_clk, 630 .parent = &spll_clk,
631 .secondary = &usb_clk[1],
598 .get_rate = _clk_usb_recalc, 632 .get_rate = _clk_usb_recalc,
599 .enable = _clk_enable, 633 .enable = _clk_enable,
600 .enable_reg = CCM_PCCR_USBOTG_REG, 634 .enable_reg = CCM_PCCR_USBOTG_REG,
601 .enable_shift = CCM_PCCR_USBOTG_OFFSET, 635 .enable_shift = CCM_PCCR_USBOTG_OFFSET,
602 .disable = _clk_disable, 636 .disable = _clk_disable,
637 .round_rate = _clk_usb_round_rate,
638 .set_rate = _clk_usb_set_rate,
603 }, { 639 }, {
604 .parent = &hclk_clk, 640 .parent = &hclk_clk,
605 .enable = _clk_enable, 641 .enable = _clk_enable,
@@ -768,18 +804,7 @@ static struct clk rtc_clk = {
768 804
769static unsigned long _clk_clko_round_rate(struct clk *clk, unsigned long rate) 805static unsigned long _clk_clko_round_rate(struct clk *clk, unsigned long rate)
770{ 806{
771 u32 div; 807 return _clk_generic_round_rate(clk, rate, 8);
772 unsigned long parent_rate;
773
774 parent_rate = clk_get_rate(clk->parent);
775 div = parent_rate / rate;
776 if (parent_rate % rate)
777 div++;
778
779 if (div > 8)
780 div = 8;
781
782 return parent_rate / div;
783} 808}
784 809
785static int _clk_clko_set_rate(struct clk *clk, unsigned long rate) 810static int _clk_clko_set_rate(struct clk *clk, unsigned long rate)
@@ -921,7 +946,7 @@ static struct clk_lookup lookups[] __initdata = {
921 _REGISTER_CLOCK(NULL, "cspi3", cspi_clk[2]) 946 _REGISTER_CLOCK(NULL, "cspi3", cspi_clk[2])
922 _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk[0]) 947 _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk[0])
923 _REGISTER_CLOCK(NULL, "csi", csi_clk[0]) 948 _REGISTER_CLOCK(NULL, "csi", csi_clk[0])
924 _REGISTER_CLOCK(NULL, "usb", usb_clk[0]) 949 _REGISTER_CLOCK("imx21-hcd.0", NULL, usb_clk[0])
925 _REGISTER_CLOCK(NULL, "ssi1", ssi_clk[0]) 950 _REGISTER_CLOCK(NULL, "ssi1", ssi_clk[0])
926 _REGISTER_CLOCK(NULL, "ssi2", ssi_clk[1]) 951 _REGISTER_CLOCK(NULL, "ssi2", ssi_clk[1])
927 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) 952 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
diff --git a/arch/arm/mach-mx2/mx27lite.c b/arch/arm/mach-mx2/mx27lite.c
new file mode 100644
index 000000000000..3ae11cb8c04b
--- /dev/null
+++ b/arch/arm/mach-mx2/mx27lite.c
@@ -0,0 +1,95 @@
1/*
2 * Copyright 2007 Robert Schwebel <r.schwebel@pengutronix.de>, Pengutronix
3 * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
4 * Copyright 2009 Daniel Schaeffer (daniel.schaeffer@timesys.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 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
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/platform_device.h>
22#include <linux/gpio.h>
23#include <asm/mach-types.h>
24#include <asm/mach/arch.h>
25#include <asm/mach/time.h>
26#include <asm/mach/map.h>
27#include <mach/hardware.h>
28#include <mach/common.h>
29#include <mach/imx-uart.h>
30#include <mach/iomux.h>
31#include <mach/board-mx27lite.h>
32
33#include "devices.h"
34
35static unsigned int mx27lite_pins[] = {
36 /* UART1 */
37 PE12_PF_UART1_TXD,
38 PE13_PF_UART1_RXD,
39 PE14_PF_UART1_CTS,
40 PE15_PF_UART1_RTS,
41 /* FEC */
42 PD0_AIN_FEC_TXD0,
43 PD1_AIN_FEC_TXD1,
44 PD2_AIN_FEC_TXD2,
45 PD3_AIN_FEC_TXD3,
46 PD4_AOUT_FEC_RX_ER,
47 PD5_AOUT_FEC_RXD1,
48 PD6_AOUT_FEC_RXD2,
49 PD7_AOUT_FEC_RXD3,
50 PD8_AF_FEC_MDIO,
51 PD9_AIN_FEC_MDC,
52 PD10_AOUT_FEC_CRS,
53 PD11_AOUT_FEC_TX_CLK,
54 PD12_AOUT_FEC_RXD0,
55 PD13_AOUT_FEC_RX_DV,
56 PD14_AOUT_FEC_RX_CLK,
57 PD15_AOUT_FEC_COL,
58 PD16_AIN_FEC_TX_ER,
59 PF23_AIN_FEC_TX_EN,
60};
61
62static struct imxuart_platform_data uart_pdata = {
63 .flags = IMXUART_HAVE_RTSCTS,
64};
65
66static struct platform_device *platform_devices[] __initdata = {
67 &mxc_fec_device,
68};
69
70static void __init mx27lite_init(void)
71{
72 mxc_gpio_setup_multiple_pins(mx27lite_pins, ARRAY_SIZE(mx27lite_pins),
73 "imx27lite");
74 mxc_register_device(&mxc_uart_device0, &uart_pdata);
75 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
76}
77
78static void __init mx27lite_timer_init(void)
79{
80 mx27_clocks_init(26000000);
81}
82
83static struct sys_timer mx27lite_timer = {
84 .init = mx27lite_timer_init,
85};
86
87MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE")
88 .phys_io = AIPI_BASE_ADDR,
89 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
90 .boot_params = PHYS_OFFSET + 0x100,
91 .map_io = mx27_map_io,
92 .init_irq = mxc_init_irq,
93 .init_machine = mx27lite_init,
94 .timer = &mx27lite_timer,
95MACHINE_END
diff --git a/arch/arm/mach-mx2/mx27pdk.c b/arch/arm/mach-mx2/mx27pdk.c
index 90b1fa5d1849..1d9238c7a6c3 100644
--- a/arch/arm/mach-mx2/mx27pdk.c
+++ b/arch/arm/mach-mx2/mx27pdk.c
@@ -88,7 +88,7 @@ MACHINE_START(MX27_3DS, "Freescale MX27PDK")
88 .phys_io = AIPI_BASE_ADDR, 88 .phys_io = AIPI_BASE_ADDR,
89 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 89 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
90 .boot_params = PHYS_OFFSET + 0x100, 90 .boot_params = PHYS_OFFSET + 0x100,
91 .map_io = mxc_map_io, 91 .map_io = mx27_map_io,
92 .init_irq = mxc_init_irq, 92 .init_irq = mxc_init_irq,
93 .init_machine = mx27pdk_init, 93 .init_machine = mx27pdk_init,
94 .timer = &mx27pdk_timer, 94 .timer = &mx27pdk_timer,
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index 229fb3e71fa1..17a21a291e2f 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -57,6 +57,13 @@ config MACH_MX31MOBOARD
57 Include support for mx31moboard platform. This includes specific 57 Include support for mx31moboard platform. This includes specific
58 configurations for the board and its peripherals. 58 configurations for the board and its peripherals.
59 59
60config MACH_MX31LILLY
61 bool "Support MX31 LILLY-1131 platforms (INCO startec)"
62 select ARCH_MX31
63 help
64 Include support for mx31 based LILLY1131 modules. This includes
65 specific configurations for the board and its peripherals.
66
60config MACH_QONG 67config MACH_QONG
61 bool "Support Dave/DENX QongEVB-LITE platform" 68 bool "Support Dave/DENX QongEVB-LITE platform"
62 select ARCH_MX31 69 select ARCH_MX31
@@ -71,4 +78,18 @@ config MACH_PCM043
71 Include support for Phytec pcm043 platform. This includes 78 Include support for Phytec pcm043 platform. This includes
72 specific configurations for the board and its peripherals. 79 specific configurations for the board and its peripherals.
73 80
81config MACH_ARMADILLO5X0
82 bool "Support Atmark Armadillo-500 Development Base Board"
83 select ARCH_MX31
84 help
85 Include support for Atmark Armadillo-500 platform. This includes
86 specific configurations for the board and its peripherals.
87
88config MACH_MX35_3DS
89 bool "Support MX35PDK platform"
90 select ARCH_MX35
91 default n
92 help
93 Include support for MX35PDK platform. This includes specific
94 configurations for the board and its peripherals.
74endif 95endif
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile
index cd6547b61b1e..0322696bd11a 100644
--- a/arch/arm/mach-mx3/Makefile
+++ b/arch/arm/mach-mx3/Makefile
@@ -8,6 +8,7 @@ obj-y := mm.o devices.o
8obj-$(CONFIG_ARCH_MX31) += clock.o iomux.o 8obj-$(CONFIG_ARCH_MX31) += clock.o iomux.o
9obj-$(CONFIG_ARCH_MX35) += clock-imx35.o 9obj-$(CONFIG_ARCH_MX35) += clock-imx35.o
10obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o 10obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o
11obj-$(CONFIG_MACH_MX31LILLY) += mx31lilly.o mx31lilly-db.o
11obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o 12obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o
12obj-$(CONFIG_MACH_PCM037) += pcm037.o 13obj-$(CONFIG_MACH_PCM037) += pcm037.o
13obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o 14obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o
@@ -15,3 +16,5 @@ obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o mx31moboard-devboard.o \
15 mx31moboard-marxbot.o 16 mx31moboard-marxbot.o
16obj-$(CONFIG_MACH_QONG) += qong.o 17obj-$(CONFIG_MACH_QONG) += qong.o
17obj-$(CONFIG_MACH_PCM043) += pcm043.o 18obj-$(CONFIG_MACH_PCM043) += pcm043.o
19obj-$(CONFIG_MACH_ARMADILLO5X0) += armadillo5x0.o
20obj-$(CONFIG_MACH_MX35_3DS) += mx35pdk.o
diff --git a/arch/arm/mach-mx3/armadillo5x0.c b/arch/arm/mach-mx3/armadillo5x0.c
new file mode 100644
index 000000000000..541181090b37
--- /dev/null
+++ b/arch/arm/mach-mx3/armadillo5x0.c
@@ -0,0 +1,295 @@
1/*
2 * armadillo5x0.c
3 *
4 * Copyright 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
5 * updates in http://alberdroid.blogspot.com/
6 *
7 * Based on Atmark Techno, Inc. armadillo 500 BSP 2008
8 * Based on mx31ads.c and pcm037.c Great Work!
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23 * MA 02110-1301, USA.
24 */
25
26#include <linux/types.h>
27#include <linux/init.h>
28#include <linux/clk.h>
29#include <linux/platform_device.h>
30#include <linux/gpio.h>
31#include <linux/smsc911x.h>
32#include <linux/interrupt.h>
33#include <linux/irq.h>
34
35#include <mach/hardware.h>
36#include <asm/mach-types.h>
37#include <asm/mach/arch.h>
38#include <asm/mach/time.h>
39#include <asm/memory.h>
40#include <asm/mach/map.h>
41
42#include <mach/common.h>
43#include <mach/imx-uart.h>
44#include <mach/iomux-mx3.h>
45#include <mach/board-armadillo5x0.h>
46#include <mach/mmc.h>
47#include <mach/ipu.h>
48#include <mach/mx3fb.h>
49
50#include "devices.h"
51
52static int armadillo5x0_pins[] = {
53 /* UART1 */
54 MX31_PIN_CTS1__CTS1,
55 MX31_PIN_RTS1__RTS1,
56 MX31_PIN_TXD1__TXD1,
57 MX31_PIN_RXD1__RXD1,
58 /* UART2 */
59 MX31_PIN_CTS2__CTS2,
60 MX31_PIN_RTS2__RTS2,
61 MX31_PIN_TXD2__TXD2,
62 MX31_PIN_RXD2__RXD2,
63 /* LAN9118_IRQ */
64 IOMUX_MODE(MX31_PIN_GPIO1_0, IOMUX_CONFIG_GPIO),
65 /* SDHC1 */
66 MX31_PIN_SD1_DATA3__SD1_DATA3,
67 MX31_PIN_SD1_DATA2__SD1_DATA2,
68 MX31_PIN_SD1_DATA1__SD1_DATA1,
69 MX31_PIN_SD1_DATA0__SD1_DATA0,
70 MX31_PIN_SD1_CLK__SD1_CLK,
71 MX31_PIN_SD1_CMD__SD1_CMD,
72 /* Framebuffer */
73 MX31_PIN_LD0__LD0,
74 MX31_PIN_LD1__LD1,
75 MX31_PIN_LD2__LD2,
76 MX31_PIN_LD3__LD3,
77 MX31_PIN_LD4__LD4,
78 MX31_PIN_LD5__LD5,
79 MX31_PIN_LD6__LD6,
80 MX31_PIN_LD7__LD7,
81 MX31_PIN_LD8__LD8,
82 MX31_PIN_LD9__LD9,
83 MX31_PIN_LD10__LD10,
84 MX31_PIN_LD11__LD11,
85 MX31_PIN_LD12__LD12,
86 MX31_PIN_LD13__LD13,
87 MX31_PIN_LD14__LD14,
88 MX31_PIN_LD15__LD15,
89 MX31_PIN_LD16__LD16,
90 MX31_PIN_LD17__LD17,
91 MX31_PIN_VSYNC3__VSYNC3,
92 MX31_PIN_HSYNC__HSYNC,
93 MX31_PIN_FPSHIFT__FPSHIFT,
94 MX31_PIN_DRDY0__DRDY0,
95 IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/
96
97};
98
99/*
100 * FB support
101 */
102static const struct fb_videomode fb_modedb[] = {
103 { /* 640x480 @ 60 Hz */
104 .name = "CRT-VGA",
105 .refresh = 60,
106 .xres = 640,
107 .yres = 480,
108 .pixclock = 39721,
109 .left_margin = 35,
110 .right_margin = 115,
111 .upper_margin = 43,
112 .lower_margin = 1,
113 .hsync_len = 10,
114 .vsync_len = 1,
115 .sync = FB_SYNC_OE_ACT_HIGH,
116 .vmode = FB_VMODE_NONINTERLACED,
117 .flag = 0,
118 }, {/* 800x600 @ 56 Hz */
119 .name = "CRT-SVGA",
120 .refresh = 56,
121 .xres = 800,
122 .yres = 600,
123 .pixclock = 30000,
124 .left_margin = 30,
125 .right_margin = 108,
126 .upper_margin = 13,
127 .lower_margin = 10,
128 .hsync_len = 10,
129 .vsync_len = 1,
130 .sync = FB_SYNC_OE_ACT_HIGH | FB_SYNC_HOR_HIGH_ACT |
131 FB_SYNC_VERT_HIGH_ACT,
132 .vmode = FB_VMODE_NONINTERLACED,
133 .flag = 0,
134 },
135};
136
137static struct ipu_platform_data mx3_ipu_data = {
138 .irq_base = MXC_IPU_IRQ_START,
139};
140
141static struct mx3fb_platform_data mx3fb_pdata = {
142 .dma_dev = &mx3_ipu.dev,
143 .name = "CRT-VGA",
144 .mode = fb_modedb,
145 .num_modes = ARRAY_SIZE(fb_modedb),
146};
147
148/*
149 * SDHC 1
150 * MMC support
151 */
152static int armadillo5x0_sdhc1_get_ro(struct device *dev)
153{
154 return gpio_get_value(IOMUX_TO_GPIO(MX31_PIN_ATA_RESET_B));
155}
156
157static int armadillo5x0_sdhc1_init(struct device *dev,
158 irq_handler_t detect_irq, void *data)
159{
160 int ret;
161 int gpio_det, gpio_wp;
162
163 gpio_det = IOMUX_TO_GPIO(MX31_PIN_ATA_DMACK);
164 gpio_wp = IOMUX_TO_GPIO(MX31_PIN_ATA_RESET_B);
165
166 ret = gpio_request(gpio_det, "sdhc-card-detect");
167 if (ret)
168 return ret;
169
170 gpio_direction_input(gpio_det);
171
172 ret = gpio_request(gpio_wp, "sdhc-write-protect");
173 if (ret)
174 goto err_gpio_free;
175
176 gpio_direction_input(gpio_wp);
177
178 /* When supported the trigger type have to be BOTH */
179 ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_ATA_DMACK), detect_irq,
180 IRQF_DISABLED | IRQF_TRIGGER_FALLING,
181 "sdhc-detect", data);
182
183 if (ret)
184 goto err_gpio_free_2;
185
186 return 0;
187
188err_gpio_free_2:
189 gpio_free(gpio_wp);
190
191err_gpio_free:
192 gpio_free(gpio_det);
193
194 return ret;
195
196}
197
198static void armadillo5x0_sdhc1_exit(struct device *dev, void *data)
199{
200 free_irq(IOMUX_TO_IRQ(MX31_PIN_ATA_DMACK), data);
201 gpio_free(IOMUX_TO_GPIO(MX31_PIN_ATA_DMACK));
202 gpio_free(IOMUX_TO_GPIO(MX31_PIN_ATA_RESET_B));
203}
204
205static struct imxmmc_platform_data sdhc_pdata = {
206 .get_ro = armadillo5x0_sdhc1_get_ro,
207 .init = armadillo5x0_sdhc1_init,
208 .exit = armadillo5x0_sdhc1_exit,
209};
210
211/*
212 * SMSC 9118
213 * Network support
214 */
215static struct resource armadillo5x0_smc911x_resources[] = {
216 {
217 .start = CS3_BASE_ADDR,
218 .end = CS3_BASE_ADDR + SZ_32M - 1,
219 .flags = IORESOURCE_MEM,
220 }, {
221 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0),
222 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0),
223 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
224 },
225};
226
227static struct smsc911x_platform_config smsc911x_info = {
228 .flags = SMSC911X_USE_32BIT,
229 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
230 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
231};
232
233static struct platform_device armadillo5x0_smc911x_device = {
234 .name = "smsc911x",
235 .id = -1,
236 .num_resources = ARRAY_SIZE(armadillo5x0_smc911x_resources),
237 .resource = armadillo5x0_smc911x_resources,
238 .dev = {
239 .platform_data = &smsc911x_info,
240 },
241};
242
243/* UART device data */
244static struct imxuart_platform_data uart_pdata = {
245 .flags = IMXUART_HAVE_RTSCTS,
246};
247
248static struct platform_device *devices[] __initdata = {
249 &armadillo5x0_smc911x_device,
250};
251
252/*
253 * Perform board specific initializations
254 */
255static void __init armadillo5x0_init(void)
256{
257 mxc_iomux_setup_multiple_pins(armadillo5x0_pins,
258 ARRAY_SIZE(armadillo5x0_pins), "armadillo5x0");
259
260 platform_add_devices(devices, ARRAY_SIZE(devices));
261
262 /* Register UART */
263 mxc_register_device(&mxc_uart_device0, &uart_pdata);
264 mxc_register_device(&mxc_uart_device1, &uart_pdata);
265
266 /* SMSC9118 IRQ pin */
267 gpio_direction_input(MX31_PIN_GPIO1_0);
268
269 /* Register SDHC */
270 mxc_register_device(&mxcsdhc_device0, &sdhc_pdata);
271
272 /* Register FB */
273 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
274 mxc_register_device(&mx3_fb, &mx3fb_pdata);
275}
276
277static void __init armadillo5x0_timer_init(void)
278{
279 mx31_clocks_init(26000000);
280}
281
282static struct sys_timer armadillo5x0_timer = {
283 .init = armadillo5x0_timer_init,
284};
285
286MACHINE_START(ARMADILLO5X0, "Armadillo-500")
287 /* Maintainer: Alberto Panizzo */
288 .phys_io = AIPS1_BASE_ADDR,
289 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
290 .boot_params = PHYS_OFFSET + 0x00000100,
291 .map_io = mx31_map_io,
292 .init_irq = mxc_init_irq,
293 .timer = &armadillo5x0_timer,
294 .init_machine = armadillo5x0_init,
295MACHINE_END
diff --git a/arch/arm/mach-mx3/clock.c b/arch/arm/mach-mx3/clock.c
index 28bd11dc89b8..217d114b177a 100644
--- a/arch/arm/mach-mx3/clock.c
+++ b/arch/arm/mach-mx3/clock.c
@@ -483,7 +483,7 @@ DEFINE_CLOCK(i2c3_clk, 2, MXC_CCM_CGR0, 30, NULL, NULL, &perclk_clk);
483DEFINE_CLOCK(mpeg4_clk, 0, MXC_CCM_CGR1, 0, NULL, NULL, &ahb_clk); 483DEFINE_CLOCK(mpeg4_clk, 0, MXC_CCM_CGR1, 0, NULL, NULL, &ahb_clk);
484DEFINE_CLOCK(mstick1_clk, 0, MXC_CCM_CGR1, 2, mstick1_get_rate, NULL, &usb_pll_clk); 484DEFINE_CLOCK(mstick1_clk, 0, MXC_CCM_CGR1, 2, mstick1_get_rate, NULL, &usb_pll_clk);
485DEFINE_CLOCK(mstick2_clk, 1, MXC_CCM_CGR1, 4, mstick2_get_rate, NULL, &usb_pll_clk); 485DEFINE_CLOCK(mstick2_clk, 1, MXC_CCM_CGR1, 4, mstick2_get_rate, NULL, &usb_pll_clk);
486DEFINE_CLOCK1(csi_clk, 0, MXC_CCM_CGR1, 6, csi, NULL, &ahb_clk); 486DEFINE_CLOCK1(csi_clk, 0, MXC_CCM_CGR1, 6, csi, NULL, &serial_pll_clk);
487DEFINE_CLOCK(rtc_clk, 0, MXC_CCM_CGR1, 8, NULL, NULL, &ipg_clk); 487DEFINE_CLOCK(rtc_clk, 0, MXC_CCM_CGR1, 8, NULL, NULL, &ipg_clk);
488DEFINE_CLOCK(wdog_clk, 0, MXC_CCM_CGR1, 10, NULL, NULL, &ipg_clk); 488DEFINE_CLOCK(wdog_clk, 0, MXC_CCM_CGR1, 10, NULL, NULL, &ipg_clk);
489DEFINE_CLOCK(pwm_clk, 0, MXC_CCM_CGR1, 12, NULL, NULL, &perclk_clk); 489DEFINE_CLOCK(pwm_clk, 0, MXC_CCM_CGR1, 12, NULL, NULL, &perclk_clk);
@@ -571,6 +571,13 @@ int __init mx31_clocks_init(unsigned long fref)
571 for (i = 0; i < ARRAY_SIZE(lookups); i++) 571 for (i = 0; i < ARRAY_SIZE(lookups); i++)
572 clkdev_add(&lookups[i]); 572 clkdev_add(&lookups[i]);
573 573
574 /* change the csi_clk parent if necessary */
575 reg = __raw_readl(MXC_CCM_CCMR);
576 if (!(reg & MXC_CCM_CCMR_CSCS))
577 if (clk_set_parent(&csi_clk, &usb_pll_clk))
578 pr_err("%s: error changing csi_clk parent\n", __func__);
579
580
574 /* Turn off all possible clocks */ 581 /* Turn off all possible clocks */
575 __raw_writel((3 << 4), MXC_CCM_CGR0); 582 __raw_writel((3 << 4), MXC_CCM_CGR0);
576 __raw_writel(0, MXC_CCM_CGR1); 583 __raw_writel(0, MXC_CCM_CGR1);
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h
index 475410ada60a..ffd494ddd4ac 100644
--- a/arch/arm/mach-mx3/devices.h
+++ b/arch/arm/mach-mx3/devices.h
@@ -16,3 +16,5 @@ extern struct platform_device mxc_fec_device;
16extern struct platform_device mxcsdhc_device0; 16extern struct platform_device mxcsdhc_device0;
17extern struct platform_device mxcsdhc_device1; 17extern struct platform_device mxcsdhc_device1;
18extern struct platform_device mxc_otg_udc_device; 18extern struct platform_device mxc_otg_udc_device;
19extern struct platform_device mxc_rnga_device;
20
diff --git a/arch/arm/mach-mx3/mx31lilly-db.c b/arch/arm/mach-mx3/mx31lilly-db.c
new file mode 100644
index 000000000000..3b3a78f49c23
--- /dev/null
+++ b/arch/arm/mach-mx3/mx31lilly-db.c
@@ -0,0 +1,216 @@
1/*
2 * LILLY-1131 development board support
3 *
4 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
5 *
6 * based on code for other MX31 boards,
7 *
8 * Copyright 2005-2007 Freescale Semiconductor
9 * Copyright (c) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
10 * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */
26
27#include <linux/kernel.h>
28#include <linux/types.h>
29#include <linux/init.h>
30#include <linux/gpio.h>
31#include <linux/platform_device.h>
32
33#include <asm/mach-types.h>
34#include <asm/mach/arch.h>
35#include <asm/mach/map.h>
36
37#include <mach/hardware.h>
38#include <mach/common.h>
39#include <mach/imx-uart.h>
40#include <mach/iomux-mx3.h>
41#include <mach/board-mx31lilly.h>
42#include <mach/mmc.h>
43#include <mach/mx3fb.h>
44#include <mach/ipu.h>
45
46#include "devices.h"
47
48/*
49 * This file contains board-specific initialization routines for the
50 * LILLY-1131 development board. If you design an own baseboard for the
51 * module, use this file as base for support code.
52 */
53
54static unsigned int lilly_db_board_pins[] __initdata = {
55 MX31_PIN_CTS1__CTS1,
56 MX31_PIN_RTS1__RTS1,
57 MX31_PIN_TXD1__TXD1,
58 MX31_PIN_RXD1__RXD1,
59 MX31_PIN_CTS2__CTS2,
60 MX31_PIN_RTS2__RTS2,
61 MX31_PIN_TXD2__TXD2,
62 MX31_PIN_RXD2__RXD2,
63 MX31_PIN_CSPI3_MOSI__RXD3,
64 MX31_PIN_CSPI3_MISO__TXD3,
65 MX31_PIN_CSPI3_SCLK__RTS3,
66 MX31_PIN_CSPI3_SPI_RDY__CTS3,
67 MX31_PIN_SD1_DATA3__SD1_DATA3,
68 MX31_PIN_SD1_DATA2__SD1_DATA2,
69 MX31_PIN_SD1_DATA1__SD1_DATA1,
70 MX31_PIN_SD1_DATA0__SD1_DATA0,
71 MX31_PIN_SD1_CLK__SD1_CLK,
72 MX31_PIN_SD1_CMD__SD1_CMD,
73 MX31_PIN_LD0__LD0,
74 MX31_PIN_LD1__LD1,
75 MX31_PIN_LD2__LD2,
76 MX31_PIN_LD3__LD3,
77 MX31_PIN_LD4__LD4,
78 MX31_PIN_LD5__LD5,
79 MX31_PIN_LD6__LD6,
80 MX31_PIN_LD7__LD7,
81 MX31_PIN_LD8__LD8,
82 MX31_PIN_LD9__LD9,
83 MX31_PIN_LD10__LD10,
84 MX31_PIN_LD11__LD11,
85 MX31_PIN_LD12__LD12,
86 MX31_PIN_LD13__LD13,
87 MX31_PIN_LD14__LD14,
88 MX31_PIN_LD15__LD15,
89 MX31_PIN_LD16__LD16,
90 MX31_PIN_LD17__LD17,
91 MX31_PIN_VSYNC3__VSYNC3,
92 MX31_PIN_HSYNC__HSYNC,
93 MX31_PIN_FPSHIFT__FPSHIFT,
94 MX31_PIN_DRDY0__DRDY0,
95 MX31_PIN_CONTRAST__CONTRAST,
96};
97
98/* UART */
99static struct imxuart_platform_data uart_pdata __initdata = {
100 .flags = IMXUART_HAVE_RTSCTS,
101};
102
103/* MMC support */
104
105static int mxc_mmc1_get_ro(struct device *dev)
106{
107 return gpio_get_value(IOMUX_TO_GPIO(MX31_PIN_LCS0));
108}
109
110static int gpio_det, gpio_wp;
111
112static int mxc_mmc1_init(struct device *dev,
113 irq_handler_t detect_irq, void *data)
114{
115 int ret;
116
117 gpio_det = IOMUX_TO_GPIO(MX31_PIN_GPIO1_1);
118 gpio_wp = IOMUX_TO_GPIO(MX31_PIN_LCS0);
119
120 ret = gpio_request(gpio_det, "MMC detect");
121 if (ret)
122 return ret;
123
124 ret = gpio_request(gpio_wp, "MMC w/p");
125 if (ret)
126 goto exit_free_det;
127
128 gpio_direction_input(gpio_det);
129 gpio_direction_input(gpio_wp);
130
131 ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), detect_irq,
132 IRQF_DISABLED | IRQF_TRIGGER_FALLING,
133 "MMC detect", data);
134 if (ret)
135 goto exit_free_wp;
136
137 return 0;
138
139exit_free_wp:
140 gpio_free(gpio_wp);
141
142exit_free_det:
143 gpio_free(gpio_det);
144
145 return ret;
146}
147
148static void mxc_mmc1_exit(struct device *dev, void *data)
149{
150 gpio_free(gpio_det);
151 gpio_free(gpio_wp);
152 free_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), data);
153}
154
155static struct imxmmc_platform_data mmc_pdata = {
156 .get_ro = mxc_mmc1_get_ro,
157 .init = mxc_mmc1_init,
158 .exit = mxc_mmc1_exit,
159};
160
161/* Framebuffer support */
162static struct ipu_platform_data ipu_data __initdata = {
163 .irq_base = MXC_IPU_IRQ_START,
164};
165
166static const struct fb_videomode fb_modedb = {
167 /* 640x480 TFT panel (IPS-056T) */
168 .name = "CRT-VGA",
169 .refresh = 64,
170 .xres = 640,
171 .yres = 480,
172 .pixclock = 30000,
173 .left_margin = 200,
174 .right_margin = 2,
175 .upper_margin = 2,
176 .lower_margin = 2,
177 .hsync_len = 3,
178 .vsync_len = 1,
179 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_OE_ACT_HIGH,
180 .vmode = FB_VMODE_NONINTERLACED,
181 .flag = 0,
182};
183
184static struct mx3fb_platform_data fb_pdata __initdata = {
185 .dma_dev = &mx3_ipu.dev,
186 .name = "CRT-VGA",
187 .mode = &fb_modedb,
188 .num_modes = 1,
189};
190
191#define LCD_VCC_EN_GPIO (7)
192
193static void __init mx31lilly_init_fb(void)
194{
195 if (gpio_request(LCD_VCC_EN_GPIO, "LCD enable") != 0) {
196 printk(KERN_WARNING "unable to request LCD_VCC_EN pin.\n");
197 return;
198 }
199
200 mxc_register_device(&mx3_ipu, &ipu_data);
201 mxc_register_device(&mx3_fb, &fb_pdata);
202 gpio_direction_output(LCD_VCC_EN_GPIO, 1);
203}
204
205void __init mx31lilly_db_init(void)
206{
207 mxc_iomux_setup_multiple_pins(lilly_db_board_pins,
208 ARRAY_SIZE(lilly_db_board_pins),
209 "development board pins");
210 mxc_register_device(&mxc_uart_device0, &uart_pdata);
211 mxc_register_device(&mxc_uart_device1, &uart_pdata);
212 mxc_register_device(&mxc_uart_device2, &uart_pdata);
213 mxc_register_device(&mxcsdhc_device0, &mmc_pdata);
214 mx31lilly_init_fb();
215}
216
diff --git a/arch/arm/mach-mx3/mx31lilly.c b/arch/arm/mach-mx3/mx31lilly.c
new file mode 100644
index 000000000000..6ab2f163cb95
--- /dev/null
+++ b/arch/arm/mach-mx3/mx31lilly.c
@@ -0,0 +1,155 @@
1/*
2 * LILLY-1131 module support
3 *
4 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
5 *
6 * based on code for other MX31 boards,
7 *
8 * Copyright 2005-2007 Freescale Semiconductor
9 * Copyright (c) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
10 * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */
26
27#include <linux/types.h>
28#include <linux/init.h>
29#include <linux/clk.h>
30#include <linux/platform_device.h>
31#include <linux/interrupt.h>
32#include <linux/smsc911x.h>
33#include <linux/mtd/physmap.h>
34
35#include <asm/mach-types.h>
36#include <asm/mach/arch.h>
37#include <asm/mach/time.h>
38#include <asm/mach/map.h>
39
40#include <mach/hardware.h>
41#include <mach/common.h>
42#include <mach/iomux-mx3.h>
43#include <mach/board-mx31lilly.h>
44
45#include "devices.h"
46
47/*
48 * This file contains module-specific initialization routines for LILLY-1131.
49 * Initialization of peripherals found on the baseboard is implemented in the
50 * appropriate baseboard support code.
51 */
52
53/* SMSC ethernet support */
54
55static struct resource smsc91x_resources[] = {
56 {
57 .start = CS4_BASE_ADDR,
58 .end = CS4_BASE_ADDR + 0xffff,
59 .flags = IORESOURCE_MEM,
60 },
61 {
62 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0),
63 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0),
64 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
65 }
66};
67
68static struct smsc911x_platform_config smsc911x_config = {
69 .phy_interface = PHY_INTERFACE_MODE_MII,
70 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
71 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
72 .flags = SMSC911X_USE_32BIT |
73 SMSC911X_SAVE_MAC_ADDRESS |
74 SMSC911X_FORCE_INTERNAL_PHY,
75};
76
77static struct platform_device smsc91x_device = {
78 .name = "smsc911x",
79 .id = -1,
80 .num_resources = ARRAY_SIZE(smsc91x_resources),
81 .resource = smsc91x_resources,
82 .dev = {
83 .platform_data = &smsc911x_config,
84 }
85};
86
87/* NOR flash */
88static struct physmap_flash_data nor_flash_data = {
89 .width = 2,
90};
91
92static struct resource nor_flash_resource = {
93 .start = 0xa0000000,
94 .end = 0xa1ffffff,
95 .flags = IORESOURCE_MEM,
96};
97
98static struct platform_device physmap_flash_device = {
99 .name = "physmap-flash",
100 .id = 0,
101 .dev = {
102 .platform_data = &nor_flash_data,
103 },
104 .resource = &nor_flash_resource,
105 .num_resources = 1,
106};
107
108static struct platform_device *devices[] __initdata = {
109 &smsc91x_device,
110 &physmap_flash_device,
111 &mxc_i2c_device1,
112};
113
114static int mx31lilly_baseboard;
115core_param(mx31lilly_baseboard, mx31lilly_baseboard, int, 0444);
116
117static void __init mx31lilly_board_init(void)
118{
119 switch (mx31lilly_baseboard) {
120 case MX31LILLY_NOBOARD:
121 break;
122 case MX31LILLY_DB:
123 mx31lilly_db_init();
124 break;
125 default:
126 printk(KERN_ERR "Illegal mx31lilly_baseboard type %d\n",
127 mx31lilly_baseboard);
128 }
129
130 mxc_iomux_alloc_pin(MX31_PIN_CS4__CS4, "Ethernet CS");
131 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MOSI__SCL, "I2C SCL");
132 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MISO__SDA, "I2C SDA");
133
134 platform_add_devices(devices, ARRAY_SIZE(devices));
135}
136
137static void __init mx31lilly_timer_init(void)
138{
139 mx31_clocks_init(26000000);
140}
141
142static struct sys_timer mx31lilly_timer = {
143 .init = mx31lilly_timer_init,
144};
145
146MACHINE_START(LILLY1131, "INCO startec LILLY-1131")
147 .phys_io = AIPS1_BASE_ADDR,
148 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
149 .boot_params = PHYS_OFFSET + 0x100,
150 .map_io = mx31_map_io,
151 .init_irq = mxc_init_irq,
152 .init_machine = mx31lilly_board_init,
153 .timer = &mx31lilly_timer,
154MACHINE_END
155
diff --git a/arch/arm/mach-mx3/mx31pdk.c b/arch/arm/mach-mx3/mx31pdk.c
index 32599e507534..c19838d2e369 100644
--- a/arch/arm/mach-mx3/mx31pdk.c
+++ b/arch/arm/mach-mx3/mx31pdk.c
@@ -21,6 +21,8 @@
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/irq.h> 22#include <linux/irq.h>
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/smsc911x.h>
25#include <linux/platform_device.h>
24 26
25#include <mach/hardware.h> 27#include <mach/hardware.h>
26#include <asm/mach-types.h> 28#include <asm/mach-types.h>
@@ -56,6 +58,39 @@ static struct imxuart_platform_data uart_pdata = {
56}; 58};
57 59
58/* 60/*
61 * Support for the SMSC9217 on the Debug board.
62 */
63
64static struct smsc911x_platform_config smsc911x_config = {
65 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
66 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
67 .flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY,
68 .phy_interface = PHY_INTERFACE_MODE_MII,
69};
70
71static struct resource smsc911x_resources[] = {
72 {
73 .start = LAN9217_BASE_ADDR,
74 .end = LAN9217_BASE_ADDR + 0xff,
75 .flags = IORESOURCE_MEM,
76 }, {
77 .start = EXPIO_INT_ENET,
78 .end = EXPIO_INT_ENET,
79 .flags = IORESOURCE_IRQ,
80 },
81};
82
83static struct platform_device smsc911x_device = {
84 .name = "smsc911x",
85 .id = -1,
86 .num_resources = ARRAY_SIZE(smsc911x_resources),
87 .resource = smsc911x_resources,
88 .dev = {
89 .platform_data = &smsc911x_config,
90 },
91};
92
93/*
59 * Routines for the CPLD on the debug board. It contains a CPLD handling 94 * Routines for the CPLD on the debug board. It contains a CPLD handling
60 * LEDs, switches, interrupts for Ethernet. 95 * LEDs, switches, interrupts for Ethernet.
61 */ 96 */
@@ -207,7 +242,8 @@ static void __init mxc_board_init(void)
207 242
208 mxc_register_device(&mxc_uart_device0, &uart_pdata); 243 mxc_register_device(&mxc_uart_device0, &uart_pdata);
209 244
210 mx31pdk_init_expio(); 245 if (!mx31pdk_init_expio())
246 platform_device_register(&smsc911x_device);
211} 247}
212 248
213static void __init mx31pdk_timer_init(void) 249static void __init mx31pdk_timer_init(void)
diff --git a/arch/arm/mach-mx3/mx35pdk.c b/arch/arm/mach-mx3/mx35pdk.c
new file mode 100644
index 000000000000..6d15374414b9
--- /dev/null
+++ b/arch/arm/mach-mx3/mx35pdk.c
@@ -0,0 +1,104 @@
1/*
2 * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * Author: Fabio Estevam <fabio.estevam@freescale.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 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
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/types.h>
22#include <linux/init.h>
23#include <linux/platform_device.h>
24#include <linux/memory.h>
25#include <linux/gpio.h>
26
27#include <asm/mach-types.h>
28#include <asm/mach/arch.h>
29#include <asm/mach/time.h>
30#include <asm/mach/map.h>
31
32#include <mach/hardware.h>
33#include <mach/common.h>
34#include <mach/imx-uart.h>
35#include <mach/iomux-mx35.h>
36
37#include "devices.h"
38
39static struct imxuart_platform_data uart_pdata = {
40 .flags = IMXUART_HAVE_RTSCTS,
41};
42
43static struct platform_device *devices[] __initdata = {
44 &mxc_fec_device,
45};
46
47static struct pad_desc mx35pdk_pads[] = {
48 /* UART1 */
49 MX35_PAD_CTS1__UART1_CTS,
50 MX35_PAD_RTS1__UART1_RTS,
51 MX35_PAD_TXD1__UART1_TXD_MUX,
52 MX35_PAD_RXD1__UART1_RXD_MUX,
53 /* FEC */
54 MX35_PAD_FEC_TX_CLK__FEC_TX_CLK,
55 MX35_PAD_FEC_RX_CLK__FEC_RX_CLK,
56 MX35_PAD_FEC_RX_DV__FEC_RX_DV,
57 MX35_PAD_FEC_COL__FEC_COL,
58 MX35_PAD_FEC_RDATA0__FEC_RDATA_0,
59 MX35_PAD_FEC_TDATA0__FEC_TDATA_0,
60 MX35_PAD_FEC_TX_EN__FEC_TX_EN,
61 MX35_PAD_FEC_MDC__FEC_MDC,
62 MX35_PAD_FEC_MDIO__FEC_MDIO,
63 MX35_PAD_FEC_TX_ERR__FEC_TX_ERR,
64 MX35_PAD_FEC_RX_ERR__FEC_RX_ERR,
65 MX35_PAD_FEC_CRS__FEC_CRS,
66 MX35_PAD_FEC_RDATA1__FEC_RDATA_1,
67 MX35_PAD_FEC_TDATA1__FEC_TDATA_1,
68 MX35_PAD_FEC_RDATA2__FEC_RDATA_2,
69 MX35_PAD_FEC_TDATA2__FEC_TDATA_2,
70 MX35_PAD_FEC_RDATA3__FEC_RDATA_3,
71 MX35_PAD_FEC_TDATA3__FEC_TDATA_3,
72};
73
74/*
75 * Board specific initialization.
76 */
77static void __init mxc_board_init(void)
78{
79 mxc_iomux_v3_setup_multiple_pads(mx35pdk_pads, ARRAY_SIZE(mx35pdk_pads));
80
81 platform_add_devices(devices, ARRAY_SIZE(devices));
82
83 mxc_register_device(&mxc_uart_device0, &uart_pdata);
84}
85
86static void __init mx35pdk_timer_init(void)
87{
88 mx35_clocks_init();
89}
90
91struct sys_timer mx35pdk_timer = {
92 .init = mx35pdk_timer_init,
93};
94
95MACHINE_START(MX35_3DS, "Freescale MX35PDK")
96 /* Maintainer: Freescale Semiconductor, Inc */
97 .phys_io = AIPS1_BASE_ADDR,
98 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
99 .boot_params = PHYS_OFFSET + 0x100,
100 .map_io = mx35_map_io,
101 .init_irq = mxc_init_irq,
102 .init_machine = mxc_board_init,
103 .timer = &mx35pdk_timer,
104MACHINE_END
diff --git a/arch/arm/plat-mxc/include/mach/board-armadillo5x0.h b/arch/arm/plat-mxc/include/mach/board-armadillo5x0.h
new file mode 100644
index 000000000000..8769e910e559
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/board-armadillo5x0.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>.
3 * All Rights Reserved.
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 version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __ASM_ARCH_MXC_BOARD_ARMADILLO5X0_H__
13#define __ASM_ARCH_MXC_BOARD_ARMADILLO5X0_H__
14
15#include <mach/hardware.h>
16
17/* mandatory for CONFIG_DEBUG_LL */
18
19#define MXC_LL_UART_PADDR UART1_BASE_ADDR
20#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
21
22#endif
diff --git a/arch/arm/plat-mxc/include/mach/board-mx27lite.h b/arch/arm/plat-mxc/include/mach/board-mx27lite.h
new file mode 100644
index 000000000000..a870f8ea2443
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/board-mx27lite.h
@@ -0,0 +1,19 @@
1/*
2 * Copyright 2009 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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_BOARD_MX27LITE_H__
12#define __ASM_ARCH_MXC_BOARD_MX27LITE_H__
13
14/* mandatory for CONFIG_DEBUG_LL */
15
16#define MXC_LL_UART_PADDR UART1_BASE_ADDR
17#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
18
19#endif /* __ASM_ARCH_MXC_BOARD_MX27LITE_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31lilly.h b/arch/arm/plat-mxc/include/mach/board-mx31lilly.h
new file mode 100644
index 000000000000..78cf31e22e4d
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/board-mx31lilly.h
@@ -0,0 +1,46 @@
1/*
2 * Copyright (C) 2009 Daniel Mack <daniel@caiaq.de>
3 *
4 * Based on code for mobots boards,
5 * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
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
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 */
21
22#ifndef __ASM_ARCH_MXC_BOARD_MX31LILLY_H__
23#define __ASM_ARCH_MXC_BOARD_MX31LILLY_H__
24
25/* mandatory for CONFIG_LL_DEBUG */
26
27#define MXC_LL_UART_PADDR UART1_BASE_ADDR
28#define MXC_LL_UART_VADDR (AIPI_BASE_ADDR_VIRT + 0x0A000)
29
30#ifndef __ASSEMBLY__
31
32enum mx31lilly_boards {
33 MX31LILLY_NOBOARD = 0,
34 MX31LILLY_DB = 1,
35};
36
37/*
38 * This CPU module needs a baseboard to work. After basic initializing
39 * its own devices, it calls baseboard's init function.
40 */
41
42extern void mx31lilly_db_init(void);
43
44#endif
45
46#endif /* __ASM_ARCH_MXC_BOARD_MX31LILLY_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-mx35pdk.h b/arch/arm/plat-mxc/include/mach/board-mx35pdk.h
new file mode 100644
index 000000000000..1111037d6d9d
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/board-mx35pdk.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright 2009 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
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef __ASM_ARCH_MXC_BOARD_MX35PDK_H__
20#define __ASM_ARCH_MXC_BOARD_MX35PDK_H__
21
22/* mandatory for CONFIG_DEBUG_LL */
23
24#define MXC_LL_UART_PADDR UART1_BASE_ADDR
25#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
26
27#endif /* __ASM_ARCH_MXC_BOARD_MX35PDK_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/debug-macro.S b/arch/arm/plat-mxc/include/mach/debug-macro.S
index e6b841b15e36..bbc5f6753cfb 100644
--- a/arch/arm/plat-mxc/include/mach/debug-macro.S
+++ b/arch/arm/plat-mxc/include/mach/debug-macro.S
@@ -43,6 +43,15 @@
43#ifdef CONFIG_MACH_MX27_3DS 43#ifdef CONFIG_MACH_MX27_3DS
44#include <mach/board-mx27pdk.h> 44#include <mach/board-mx27pdk.h>
45#endif 45#endif
46#ifdef CONFIG_MACH_ARMADILLO5X0
47#include <mach/board-armadillo5x0.h>
48#endif
49#ifdef CONFIG_MACH_MX35_3DS
50#include <mach/board-mx35pdk.h>
51#endif
52#ifdef CONFIG_MACH_MX27LITE
53#include <mach/board-mx27lite.h>
54#endif
46 .macro addruart,rx 55 .macro addruart,rx
47 mrc p15, 0, \rx, c1, c0 56 mrc p15, 0, \rx, c1, c0
48 tst \rx, #1 @ MMU enabled? 57 tst \rx, #1 @ MMU enabled?