aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGwenhael Goavec-Merou <gwenhael.goavec-merou@armadeus.com>2011-04-29 01:21:39 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2011-05-19 07:11:37 -0400
commit7fc92c6092d7208e53d35cda32a9181aae396adf (patch)
tree310fe4858c389442a735ed0349c9f9e4ec1c24ab
parent6ec02091f766fed4c4cbcafe7b33a935f582ba8d (diff)
MX1: Add ARMadeus Systems APF9328 board support
APF9328 is an i.MXL based SOM (System On Module) that can be plugged on several docking/development boards. Here only basic module support is added (Ethernet, Serial, NOR Flash). Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@armadeus.com> Signed-off-by: Eric Jarrige <eric.jarrige@armadeus.org> Signed-off-by: Nicolas Colombain <nicolas.colombain@armadeus.com> Signed-off-by: Julien Boibessot <julien.boibessot@armadeus.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/configs/mx1_defconfig1
-rw-r--r--arch/arm/mach-imx/Kconfig7
-rw-r--r--arch/arm/mach-imx/Makefile1
-rw-r--r--arch/arm/mach-imx/mach-apf9328.c144
4 files changed, 153 insertions, 0 deletions
diff --git a/arch/arm/configs/mx1_defconfig b/arch/arm/configs/mx1_defconfig
index b39b5ced8a10..c9436d0bf593 100644
--- a/arch/arm/configs/mx1_defconfig
+++ b/arch/arm/configs/mx1_defconfig
@@ -15,6 +15,7 @@ CONFIG_ARCH_MXC=y
15CONFIG_ARCH_MX1=y 15CONFIG_ARCH_MX1=y
16CONFIG_ARCH_MX1ADS=y 16CONFIG_ARCH_MX1ADS=y
17CONFIG_MACH_SCB9328=y 17CONFIG_MACH_SCB9328=y
18CONFIG_MACH_APF9328=y
18CONFIG_MXC_IRQ_PRIOR=y 19CONFIG_MXC_IRQ_PRIOR=y
19CONFIG_NO_HZ=y 20CONFIG_NO_HZ=y
20CONFIG_HIGH_RES_TIMERS=y 21CONFIG_HIGH_RES_TIMERS=y
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 299580676dc8..11235ef10436 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -52,6 +52,13 @@ config MACH_SCB9328
52 help 52 help
53 Say Y here if you are using a Synertronixx scb9328 board 53 Say Y here if you are using a Synertronixx scb9328 board
54 54
55config MACH_APF9328
56 bool "APF9328"
57 select SOC_IMX1
58 select IMX_HAVE_PLATFORM_IMX_UART
59 help
60 Say Yes here if you are using the Armadeus APF9328 development board
61
55endif 62endif
56 63
57if ARCH_MX2 64if ARCH_MX2
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index b85794d27991..270f5f9db92e 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o
19 19
20obj-$(CONFIG_ARCH_MX1ADS) += mach-mx1ads.o 20obj-$(CONFIG_ARCH_MX1ADS) += mach-mx1ads.o
21obj-$(CONFIG_MACH_SCB9328) += mach-scb9328.o 21obj-$(CONFIG_MACH_SCB9328) += mach-scb9328.o
22obj-$(CONFIG_MACH_APF9328) += mach-apf9328.o
22 23
23obj-$(CONFIG_MACH_MX21ADS) += mach-mx21ads.o 24obj-$(CONFIG_MACH_MX21ADS) += mach-mx21ads.o
24 25
diff --git a/arch/arm/mach-imx/mach-apf9328.c b/arch/arm/mach-imx/mach-apf9328.c
new file mode 100644
index 000000000000..15e45c84e371
--- /dev/null
+++ b/arch/arm/mach-imx/mach-apf9328.c
@@ -0,0 +1,144 @@
1/*
2 * linux/arch/arm/mach-imx/mach-apf9328.c
3 *
4 * Copyright (c) 2005-2011 ARMadeus systems <support@armadeus.com>
5 *
6 * This work is based on mach-scb9328.c which is:
7 * Copyright (c) 2004 Sascha Hauer <saschahauer@web.de>
8 * Copyright (c) 2006-2008 Juergen Beisert <jbeisert@netscape.net>
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 version 2 as
12 * published by the Free Software Foundation.
13 *
14 */
15
16#include <linux/init.h>
17#include <linux/kernel.h>
18#include <linux/platform_device.h>
19#include <linux/mtd/physmap.h>
20#include <linux/dm9000.h>
21
22#include <asm/mach-types.h>
23#include <asm/mach/arch.h>
24#include <asm/mach/time.h>
25
26#include <mach/common.h>
27#include <mach/hardware.h>
28#include <mach/irqs.h>
29#include <mach/iomux-mx1.h>
30
31#include "devices-imx1.h"
32
33static const int apf9328_pins[] __initconst = {
34 /* UART1 */
35 PC9_PF_UART1_CTS,
36 PC10_PF_UART1_RTS,
37 PC11_PF_UART1_TXD,
38 PC12_PF_UART1_RXD,
39 /* UART2 */
40 PB28_PF_UART2_CTS,
41 PB29_PF_UART2_RTS,
42 PB30_PF_UART2_TXD,
43 PB31_PF_UART2_RXD,
44};
45
46/*
47 * The APF9328 can have up to 32MB NOR Flash
48 */
49static struct resource flash_resource = {
50 .start = MX1_CS0_PHYS,
51 .end = MX1_CS0_PHYS + SZ_32M - 1,
52 .flags = IORESOURCE_MEM,
53};
54
55static struct physmap_flash_data apf9328_flash_data = {
56 .width = 2,
57};
58
59static struct platform_device apf9328_flash_device = {
60 .name = "physmap-flash",
61 .id = 0,
62 .dev = {
63 .platform_data = &apf9328_flash_data,
64 },
65 .resource = &flash_resource,
66 .num_resources = 1,
67};
68
69/*
70 * APF9328 has a DM9000 Ethernet controller
71 */
72static struct dm9000_plat_data dm9000_setup = {
73 .flags = DM9000_PLATF_16BITONLY
74};
75
76static struct resource dm9000_resources[] = {
77 {
78 .start = MX1_CS4_PHYS + 0x00C00000,
79 .end = MX1_CS4_PHYS + 0x00C00001,
80 .flags = IORESOURCE_MEM,
81 }, {
82 .start = MX1_CS4_PHYS + 0x00C00002,
83 .end = MX1_CS4_PHYS + 0x00C00003,
84 .flags = IORESOURCE_MEM,
85 }, {
86 .start = IRQ_GPIOB(14),
87 .end = IRQ_GPIOB(14),
88 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
89 },
90};
91
92static struct platform_device dm9000x_device = {
93 .name = "dm9000",
94 .id = 0,
95 .num_resources = ARRAY_SIZE(dm9000_resources),
96 .resource = dm9000_resources,
97 .dev = {
98 .platform_data = &dm9000_setup,
99 }
100};
101
102/* --- SERIAL RESSOURCE --- */
103static const struct imxuart_platform_data uart0_pdata __initconst = {
104 .flags = 0,
105};
106
107static const struct imxuart_platform_data uart1_pdata __initconst = {
108 .flags = IMXUART_HAVE_RTSCTS,
109};
110
111static struct platform_device *devices[] __initdata = {
112 &apf9328_flash_device,
113 &dm9000x_device,
114};
115
116static void __init apf9328_init(void)
117{
118 mxc_gpio_setup_multiple_pins(apf9328_pins,
119 ARRAY_SIZE(apf9328_pins),
120 "APF9328");
121
122 imx1_add_imx_uart0(&uart0_pdata);
123 imx1_add_imx_uart1(&uart1_pdata);
124
125 platform_add_devices(devices, ARRAY_SIZE(devices));
126}
127
128static void __init apf9328_timer_init(void)
129{
130 mx1_clocks_init(32768);
131}
132
133static struct sys_timer apf9328_timer = {
134 .init = apf9328_timer_init,
135};
136
137MACHINE_START(APF9328, "Armadeus APF9328")
138 /* Maintainer: Gwenhael Goavec-Merou, ARMadeus Systems */
139 .map_io = mx1_map_io,
140 .init_early = imx1_init_early,
141 .init_irq = mx1_init_irq,
142 .timer = &apf9328_timer,
143 .init_machine = apf9328_init,
144MACHINE_END