aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorArnaud Patard <arnaud.patard@rtp-net.org>2007-07-15 15:12:23 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-07-20 04:35:35 -0400
commita8135fcfd0431eda3653c7069e7aefc8674fdfbe (patch)
treecd32567c33525faf5de4424c7ffa1b13f84110b1 /arch/arm
parent9a79b2274186fade17134929d4f85b70d59a3840 (diff)
[ARM] 4476/1: EM7210/SS4000E support
This patch adds the basic support for the em7210 board. It is similar to the iq31244 board and can be found on Intel "Baxter Creek" ss4000e nas. Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-iop32x/Kconfig7
-rw-r--r--arch/arm/mach-iop32x/Makefile1
-rw-r--r--arch/arm/mach-iop32x/em7210.c202
-rw-r--r--arch/arm/mach-iop32x/irq.c3
4 files changed, 212 insertions, 1 deletions
diff --git a/arch/arm/mach-iop32x/Kconfig b/arch/arm/mach-iop32x/Kconfig
index 9bb02b6d7ae..dbe07c9472e 100644
--- a/arch/arm/mach-iop32x/Kconfig
+++ b/arch/arm/mach-iop32x/Kconfig
@@ -42,6 +42,13 @@ config IOP3XX_ATU
42 Say N if the IOP is an add in card, the host system owns the PCI 42 Say N if the IOP is an add in card, the host system owns the PCI
43 bus in this case. 43 bus in this case.
44 44
45config MACH_EM7210
46 bool "Enable support for the Lanner EM7210"
47 help
48 Say Y here if you want to run your kernel on the Lanner EM7210
49 board. Say also Y here if you have a SS4000e Baxter Creek NAS
50 appliance."
51
45endmenu 52endmenu
46 53
47endif 54endif
diff --git a/arch/arm/mach-iop32x/Makefile b/arch/arm/mach-iop32x/Makefile
index 7b05b37e1f9..cfdf8a137c2 100644
--- a/arch/arm/mach-iop32x/Makefile
+++ b/arch/arm/mach-iop32x/Makefile
@@ -11,3 +11,4 @@ obj-$(CONFIG_MACH_GLANTANK) += glantank.o
11obj-$(CONFIG_ARCH_IQ80321) += iq80321.o 11obj-$(CONFIG_ARCH_IQ80321) += iq80321.o
12obj-$(CONFIG_ARCH_IQ31244) += iq31244.o 12obj-$(CONFIG_ARCH_IQ31244) += iq31244.o
13obj-$(CONFIG_MACH_N2100) += n2100.o 13obj-$(CONFIG_MACH_N2100) += n2100.o
14obj-$(CONFIG_MACH_EM7210) += em7210.o
diff --git a/arch/arm/mach-iop32x/em7210.c b/arch/arm/mach-iop32x/em7210.c
new file mode 100644
index 00000000000..f0362053fdc
--- /dev/null
+++ b/arch/arm/mach-iop32x/em7210.c
@@ -0,0 +1,202 @@
1/*
2 * arch/arm/mach-iop32x/em7210.c
3 *
4 * Board support code for the Lanner EM7210 platforms.
5 *
6 * Based on arch/arm/mach-iop32x/iq31244.c file.
7 *
8 * Copyright (C) 2007 Arnaud Patard <arnaud.patard@rtp-net.org>
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/mm.h>
17#include <linux/init.h>
18#include <linux/kernel.h>
19#include <linux/pci.h>
20#include <linux/pm.h>
21#include <linux/serial_core.h>
22#include <linux/serial_8250.h>
23#include <linux/mtd/physmap.h>
24#include <linux/platform_device.h>
25#include <asm/hardware.h>
26#include <linux/io.h>
27#include <linux/irq.h>
28#include <asm/mach/arch.h>
29#include <asm/mach/map.h>
30#include <asm/mach/pci.h>
31#include <asm/mach/time.h>
32#include <asm/mach-types.h>
33#include <asm/arch/time.h>
34
35static void __init em7210_timer_init(void)
36{
37 /* http://www.kwaak.net/fotos/fotos-nas/slide_24.html */
38 /* 33.333 MHz crystal. */
39 iop_init_time(200000000);
40}
41
42static struct sys_timer em7210_timer = {
43 .init = em7210_timer_init,
44 .offset = iop_gettimeoffset,
45};
46
47
48/*
49 * EM7210 I/O
50 */
51static struct map_desc em7210_io_desc[] __initdata = {
52 { /* on-board devices */
53 .virtual = IQ31244_UART,
54 .pfn = __phys_to_pfn(IQ31244_UART),
55 .length = 0x00100000,
56 .type = MT_DEVICE,
57 },
58};
59
60void __init em7210_map_io(void)
61{
62 iop3xx_map_io();
63 iotable_init(em7210_io_desc, ARRAY_SIZE(em7210_io_desc));
64}
65
66
67/*
68 * EM7210 PCI
69 */
70#define INTA IRQ_IOP32X_XINT0
71#define INTB IRQ_IOP32X_XINT1
72#define INTC IRQ_IOP32X_XINT2
73#define INTD IRQ_IOP32X_XINT3
74
75static int __init
76em7210_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
77{
78 static int pci_irq_table[][4] = {
79 /*
80 * PCI IDSEL/INTPIN->INTLINE
81 * A B C D
82 */
83 {INTB, INTB, INTB, INTB}, /* console / uart */
84 {INTA, INTA, INTA, INTA}, /* 1st 82541 */
85 {INTD, INTD, INTD, INTD}, /* 2nd 82541 */
86 {INTC, INTC, INTC, INTC}, /* GD31244 */
87 {INTD, INTA, INTA, INTA}, /* mini-PCI */
88 {INTD, INTC, INTA, INTA}, /* NEC USB */
89 };
90
91 if (pin < 1 || pin > 4)
92 return -1;
93
94 return pci_irq_table[slot % 6][pin - 1];
95}
96
97static struct hw_pci em7210_pci __initdata = {
98 .swizzle = pci_std_swizzle,
99 .nr_controllers = 1,
100 .setup = iop3xx_pci_setup,
101 .preinit = iop3xx_pci_preinit,
102 .scan = iop3xx_pci_scan_bus,
103 .map_irq = em7210_pci_map_irq,
104};
105
106static int __init em7210_pci_init(void)
107{
108 if (machine_is_em7210())
109 pci_common_init(&em7210_pci);
110
111 return 0;
112}
113
114subsys_initcall(em7210_pci_init);
115
116
117/*
118 * EM7210 Flash
119 */
120static struct physmap_flash_data em7210_flash_data = {
121 .width = 2,
122};
123
124static struct resource em7210_flash_resource = {
125 .start = 0xf0000000,
126 .end = 0xf1ffffff,
127 .flags = IORESOURCE_MEM,
128};
129
130static struct platform_device em7210_flash_device = {
131 .name = "physmap-flash",
132 .id = 0,
133 .dev = {
134 .platform_data = &em7210_flash_data,
135 },
136 .num_resources = 1,
137 .resource = &em7210_flash_resource,
138};
139
140
141/*
142 * EM7210 UART
143 * The physical address of the serial port is 0xfe800000,
144 * so it can be used for physical and virtual address.
145 */
146static struct plat_serial8250_port em7210_serial_port[] = {
147 {
148 .mapbase = IQ31244_UART,
149 .membase = (char *)IQ31244_UART,
150 .irq = IRQ_IOP32X_XINT1,
151 .flags = UPF_SKIP_TEST,
152 .iotype = UPIO_MEM,
153 .regshift = 0,
154 .uartclk = 1843200,
155 },
156 { },
157};
158
159static struct resource em7210_uart_resource = {
160 .start = IQ31244_UART,
161 .end = IQ31244_UART + 7,
162 .flags = IORESOURCE_MEM,
163};
164
165static struct platform_device em7210_serial_device = {
166 .name = "serial8250",
167 .id = PLAT8250_DEV_PLATFORM,
168 .dev = {
169 .platform_data = em7210_serial_port,
170 },
171 .num_resources = 1,
172 .resource = &em7210_uart_resource,
173};
174
175void em7210_power_off(void)
176{
177 *IOP3XX_GPOE &= 0xfe;
178 *IOP3XX_GPOD |= 0x01;
179}
180
181static void __init em7210_init_machine(void)
182{
183 platform_device_register(&em7210_serial_device);
184 platform_device_register(&iop3xx_i2c0_device);
185 platform_device_register(&iop3xx_i2c1_device);
186 platform_device_register(&em7210_flash_device);
187 platform_device_register(&iop3xx_dma_0_channel);
188 platform_device_register(&iop3xx_dma_1_channel);
189
190
191 pm_power_off = em7210_power_off;
192}
193
194MACHINE_START(EM7210, "Lanner EM7210")
195 .phys_io = IQ31244_UART,
196 .io_pg_offst = ((IQ31244_UART) >> 18) & 0xfffc,
197 .boot_params = 0xa0000100,
198 .map_io = em7210_map_io,
199 .init_irq = iop32x_init_irq,
200 .timer = &em7210_timer,
201 .init_machine = em7210_init_machine,
202MACHINE_END
diff --git a/arch/arm/mach-iop32x/irq.c b/arch/arm/mach-iop32x/irq.c
index c971171c290..55cf0162e8c 100644
--- a/arch/arm/mach-iop32x/irq.c
+++ b/arch/arm/mach-iop32x/irq.c
@@ -63,7 +63,8 @@ void __init iop32x_init_irq(void)
63 if (machine_is_glantank() || 63 if (machine_is_glantank() ||
64 machine_is_iq80321() || 64 machine_is_iq80321() ||
65 machine_is_iq31244() || 65 machine_is_iq31244() ||
66 machine_is_n2100()) 66 machine_is_n2100() ||
67 machine_is_em7210())
67 *IOP3XX_PCIIRSR = 0x0f; 68 *IOP3XX_PCIIRSR = 0x0f;
68 69
69 for (i = 0; i < NR_IRQS; i++) { 70 for (i = 0; i < NR_IRQS; i++) {