aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx1/mx1ads.c
diff options
context:
space:
mode:
authorPaulius Zaleckas <paulius.zaleckas@teltonika.lt>2008-11-14 05:01:38 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2008-12-16 08:58:40 -0500
commitcfca8b539f53114fb6a6de091987a984c8013d96 (patch)
tree7ba5516e465164bb330f1e8965f1be91337f966a /arch/arm/mach-mx1/mx1ads.c
parentd133d6a89340b7438038ed0407221c5277cb8a0e (diff)
patch-mxc-add-ARCH_MX1
Adds MX1 architecture to platform MXC. It will supersede mach-imx and let it die. Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt> Signed-off-by: Darius Augulis <augulis.darius@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx1/mx1ads.c')
-rw-r--r--arch/arm/mach-mx1/mx1ads.c148
1 files changed, 148 insertions, 0 deletions
diff --git a/arch/arm/mach-mx1/mx1ads.c b/arch/arm/mach-mx1/mx1ads.c
new file mode 100644
index 000000000000..2e4b185fe4a9
--- /dev/null
+++ b/arch/arm/mach-mx1/mx1ads.c
@@ -0,0 +1,148 @@
1/*
2 * arch/arm/mach-imx/mx1ads.c
3 *
4 * Initially based on:
5 * linux-2.6.7-imx/arch/arm/mach-imx/scb9328.c
6 * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
7 *
8 * 2004 (c) MontaVista Software, Inc.
9 *
10 * This file is licensed under the terms of the GNU General Public
11 * License version 2. This program is licensed "as is" without any
12 * warranty of any kind, whether express or implied.
13 */
14
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/platform_device.h>
18#include <linux/mtd/physmap.h>
19
20#include <asm/mach-types.h>
21#include <asm/mach/arch.h>
22#include <asm/mach/time.h>
23
24#include <mach/hardware.h>
25#include <mach/common.h>
26#include <mach/imx-uart.h>
27#include <mach/iomux-mx1-mx2.h>
28#include "devices.h"
29
30/*
31 * UARTs platform data
32 */
33static int mxc_uart1_pins[] = {
34 PC9_PF_UART1_CTS,
35 PC10_PF_UART1_RTS,
36 PC11_PF_UART1_TXD,
37 PC12_PF_UART1_RXD,
38};
39
40static int uart1_mxc_init(struct platform_device *pdev)
41{
42 return mxc_gpio_setup_multiple_pins(mxc_uart1_pins,
43 ARRAY_SIZE(mxc_uart1_pins), "UART1");
44}
45
46static int uart1_mxc_exit(struct platform_device *pdev)
47{
48 mxc_gpio_release_multiple_pins(mxc_uart1_pins,
49 ARRAY_SIZE(mxc_uart1_pins));
50 return 0;
51}
52
53static int mxc_uart2_pins[] = {
54 PB28_PF_UART2_CTS,
55 PB29_PF_UART2_RTS,
56 PB30_PF_UART2_TXD,
57 PB31_PF_UART2_RXD,
58};
59
60static int uart2_mxc_init(struct platform_device *pdev)
61{
62 return mxc_gpio_setup_multiple_pins(mxc_uart2_pins,
63 ARRAY_SIZE(mxc_uart2_pins), "UART2");
64}
65
66static int uart2_mxc_exit(struct platform_device *pdev)
67{
68 mxc_gpio_release_multiple_pins(mxc_uart2_pins,
69 ARRAY_SIZE(mxc_uart2_pins));
70 return 0;
71}
72
73static struct imxuart_platform_data uart_pdata[] = {
74 {
75 .init = uart1_mxc_init,
76 .exit = uart1_mxc_exit,
77 .flags = IMXUART_HAVE_RTSCTS,
78 }, {
79 .init = uart2_mxc_init,
80 .exit = uart2_mxc_exit,
81 .flags = IMXUART_HAVE_RTSCTS,
82 },
83};
84
85/*
86 * Physmap flash
87 */
88
89static struct physmap_flash_data mx1ads_flash_data = {
90 .width = 4, /* bankwidth in bytes */
91};
92
93static struct resource flash_resource = {
94 .start = IMX_CS0_PHYS,
95 .end = IMX_CS0_PHYS + SZ_32M - 1,
96 .flags = IORESOURCE_MEM,
97};
98
99static struct platform_device flash_device = {
100 .name = "physmap-flash",
101 .id = 0,
102 .resource = &flash_resource,
103 .num_resources = 1,
104};
105
106/*
107 * Board init
108 */
109static void __init mx1ads_init(void)
110{
111 /* UART */
112 mxc_register_device(&imx_uart1_device, &uart_pdata[0]);
113 mxc_register_device(&imx_uart2_device, &uart_pdata[1]);
114
115 /* Physmap flash */
116 mxc_register_device(&flash_device, &mx1ads_flash_data);
117}
118
119static void __init mx1ads_timer_init(void)
120{
121 mxc_clocks_init(32000);
122 mxc_timer_init("gpt_clk");
123}
124
125struct sys_timer mx1ads_timer = {
126 .init = mx1ads_timer_init,
127};
128
129MACHINE_START(MX1ADS, "Freescale MX1ADS")
130 /* Maintainer: Sascha Hauer, Pengutronix */
131 .phys_io = IMX_IO_PHYS,
132 .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc,
133 .boot_params = PHYS_OFFSET + 0x100,
134 .map_io = mxc_map_io,
135 .init_irq = mxc_init_irq,
136 .timer = &mx1ads_timer,
137 .init_machine = mx1ads_init,
138MACHINE_END
139
140MACHINE_START(MXLADS, "Freescale MXLADS")
141 .phys_io = IMX_IO_PHYS,
142 .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc,
143 .boot_params = PHYS_OFFSET + 0x100,
144 .map_io = mxc_map_io,
145 .init_irq = mxc_init_irq,
146 .timer = &mx1ads_timer,
147 .init_machine = mx1ads_init,
148MACHINE_END