diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2009-11-03 14:39:02 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-11-10 18:46:35 -0500 |
commit | 01c62c9b32ec122bf5e3edeecec4d826cb8e81e5 (patch) | |
tree | 707d95579beead1faffece0e76b3c1dace297571 | |
parent | 1ea60cf7062271f0d53d09268726aa1544bf4836 (diff) |
ARM: 5782/1: at91: support for eco920
CONFIG_MACH_ECO920 is enabled in at91rm9200dk_defconfig. The name is
wrong, but this is better than adding another defconfig or don't get
compile coverage at all.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/configs/at91rm9200dk_defconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-at91/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-at91/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-eco920.c | 158 |
4 files changed, 165 insertions, 0 deletions
diff --git a/arch/arm/configs/at91rm9200dk_defconfig b/arch/arm/configs/at91rm9200dk_defconfig index 238b218394e3..c97e1022ada1 100644 --- a/arch/arm/configs/at91rm9200dk_defconfig +++ b/arch/arm/configs/at91rm9200dk_defconfig | |||
@@ -120,6 +120,7 @@ CONFIG_ARCH_AT91RM9200DK=y | |||
120 | # CONFIG_MACH_CARMEVA is not set | 120 | # CONFIG_MACH_CARMEVA is not set |
121 | # CONFIG_MACH_KB9200 is not set | 121 | # CONFIG_MACH_KB9200 is not set |
122 | # CONFIG_MACH_ATEB9200 is not set | 122 | # CONFIG_MACH_ATEB9200 is not set |
123 | CONFIG_MACH_ECO920=y | ||
123 | 124 | ||
124 | # | 125 | # |
125 | # AT91RM9200 Feature Selections | 126 | # AT91RM9200 Feature Selections |
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index e35d54d43e70..7878e3312861 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig | |||
@@ -163,6 +163,11 @@ config MACH_CPUAT91 | |||
163 | Select this if you are using the Eukrea Electromatique's | 163 | Select this if you are using the Eukrea Electromatique's |
164 | CPUAT91 board <http://www.eukrea.com/>. | 164 | CPUAT91 board <http://www.eukrea.com/>. |
165 | 165 | ||
166 | config MACH_ECO920 | ||
167 | bool "eco920" | ||
168 | help | ||
169 | Select this if you are using the eco920 board | ||
170 | |||
166 | endif | 171 | endif |
167 | 172 | ||
168 | # ---------------------------------------------------------- | 173 | # ---------------------------------------------------------- |
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index f9e12bb3fb4e..709fbad4a3ee 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile | |||
@@ -35,6 +35,7 @@ obj-$(CONFIG_MACH_PICOTUX2XX) += board-picotux200.o | |||
35 | obj-$(CONFIG_MACH_ECBAT91) += board-ecbat91.o | 35 | obj-$(CONFIG_MACH_ECBAT91) += board-ecbat91.o |
36 | obj-$(CONFIG_MACH_YL9200) += board-yl-9200.o | 36 | obj-$(CONFIG_MACH_YL9200) += board-yl-9200.o |
37 | obj-$(CONFIG_MACH_CPUAT91) += board-cpuat91.o | 37 | obj-$(CONFIG_MACH_CPUAT91) += board-cpuat91.o |
38 | obj-$(CONFIG_MACH_ECO920) += board-eco920.o | ||
38 | 39 | ||
39 | # AT91SAM9260 board-specific support | 40 | # AT91SAM9260 board-specific support |
40 | obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o | 41 | obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o |
diff --git a/arch/arm/mach-at91/board-eco920.c b/arch/arm/mach-at91/board-eco920.c new file mode 100644 index 000000000000..295a96609e71 --- /dev/null +++ b/arch/arm/mach-at91/board-eco920.c | |||
@@ -0,0 +1,158 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify | ||
3 | * it under the terms of the GNU General Public License as published by | ||
4 | * the Free Software Foundation; either version 2 of the License, or | ||
5 | * (at your option) any later version. | ||
6 | * | ||
7 | * This program is distributed in the hope that it will be useful, | ||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
10 | * GNU General Public License for more details. | ||
11 | * | ||
12 | * You should have received a copy of the GNU General Public License | ||
13 | * along with this program; if not, write to the Free Software | ||
14 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
15 | */ | ||
16 | |||
17 | #include <linux/init.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | #include <linux/mtd/physmap.h> | ||
20 | #include <linux/gpio.h> | ||
21 | |||
22 | #include <asm/mach-types.h> | ||
23 | |||
24 | #include <asm/mach/arch.h> | ||
25 | #include <asm/mach/map.h> | ||
26 | |||
27 | #include <mach/board.h> | ||
28 | #include <mach/at91rm9200_mc.h> | ||
29 | #include "generic.h" | ||
30 | |||
31 | static void __init eco920_map_io(void) | ||
32 | { | ||
33 | at91rm9200_initialize(18432000, AT91RM9200_PQFP); | ||
34 | |||
35 | /* Setup the LEDs */ | ||
36 | at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1); | ||
37 | |||
38 | /* DBGU on ttyS0. (Rx & Tx only */ | ||
39 | at91_register_uart(0, 0, 0); | ||
40 | |||
41 | /* set serial console to ttyS0 (ie, DBGU) */ | ||
42 | at91_set_serial_console(0); | ||
43 | } | ||
44 | |||
45 | static void __init eco920_init_irq(void) | ||
46 | { | ||
47 | at91rm9200_init_interrupts(NULL); | ||
48 | } | ||
49 | |||
50 | static struct at91_eth_data __initdata eco920_eth_data = { | ||
51 | .phy_irq_pin = AT91_PIN_PC2, | ||
52 | .is_rmii = 1, | ||
53 | }; | ||
54 | |||
55 | static struct at91_usbh_data __initdata eco920_usbh_data = { | ||
56 | .ports = 1, | ||
57 | }; | ||
58 | |||
59 | static struct at91_udc_data __initdata eco920_udc_data = { | ||
60 | .vbus_pin = AT91_PIN_PB12, | ||
61 | .pullup_pin = AT91_PIN_PB13, | ||
62 | }; | ||
63 | |||
64 | static struct at91_mmc_data __initdata eco920_mmc_data = { | ||
65 | .slot_b = 0, | ||
66 | .wire4 = 0, | ||
67 | }; | ||
68 | |||
69 | static struct physmap_flash_data eco920_flash_data = { | ||
70 | .width = 2, | ||
71 | }; | ||
72 | |||
73 | static struct resource eco920_flash_resource = { | ||
74 | .start = 0x11000000, | ||
75 | .end = 0x11ffffff, | ||
76 | .flags = IORESOURCE_MEM, | ||
77 | }; | ||
78 | |||
79 | static struct platform_device eco920_flash = { | ||
80 | .name = "physmap-flash", | ||
81 | .id = 0, | ||
82 | .dev = { | ||
83 | .platform_data = &eco920_flash_data, | ||
84 | }, | ||
85 | .resource = &eco920_flash_resource, | ||
86 | .num_resources = 1, | ||
87 | }; | ||
88 | |||
89 | static struct resource at91_beeper_resources[] = { | ||
90 | [0] = { | ||
91 | .start = AT91RM9200_BASE_TC3, | ||
92 | .end = AT91RM9200_BASE_TC3 + 0x39, | ||
93 | .flags = IORESOURCE_MEM, | ||
94 | }, | ||
95 | }; | ||
96 | |||
97 | static struct platform_device at91_beeper = { | ||
98 | .name = "at91_beeper", | ||
99 | .id = 0, | ||
100 | .resource = at91_beeper_resources, | ||
101 | .num_resources = ARRAY_SIZE(at91_beeper_resources), | ||
102 | }; | ||
103 | |||
104 | static struct spi_board_info eco920_spi_devices[] = { | ||
105 | { /* CAN controller */ | ||
106 | .modalias = "tlv5638", | ||
107 | .chip_select = 3, | ||
108 | .max_speed_hz = 20 * 1000 * 1000, | ||
109 | .mode = SPI_CPHA, | ||
110 | }, | ||
111 | }; | ||
112 | |||
113 | static void __init eco920_board_init(void) | ||
114 | { | ||
115 | at91_add_device_serial(); | ||
116 | at91_add_device_eth(&eco920_eth_data); | ||
117 | at91_add_device_usbh(&eco920_usbh_data); | ||
118 | at91_add_device_udc(&eco920_udc_data); | ||
119 | |||
120 | at91_add_device_mmc(0, &eco920_mmc_data); | ||
121 | platform_device_register(&eco920_flash); | ||
122 | |||
123 | at91_sys_write(AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1) | ||
124 | | AT91_SMC_RWSETUP_(1) | ||
125 | | AT91_SMC_DBW_8 | ||
126 | | AT91_SMC_WSEN | ||
127 | | AT91_SMC_NWS_(15)); | ||
128 | |||
129 | at91_set_A_periph(AT91_PIN_PC6, 1); | ||
130 | |||
131 | at91_set_gpio_input(AT91_PIN_PA23, 0); | ||
132 | at91_set_deglitch(AT91_PIN_PA23, 1); | ||
133 | |||
134 | /* Initialization of the Static Memory Controller for Chip Select 3 */ | ||
135 | at91_sys_write(AT91_SMC_CSR(3), | ||
136 | AT91_SMC_DBW_16 | /* 16 bit */ | ||
137 | AT91_SMC_WSEN | | ||
138 | AT91_SMC_NWS_(5) | /* wait states */ | ||
139 | AT91_SMC_TDF_(1) /* float time */ | ||
140 | ); | ||
141 | |||
142 | at91_clock_associate("tc3_clk", &at91_beeper.dev, "at91_beeper"); | ||
143 | at91_set_B_periph(AT91_PIN_PB6, 0); | ||
144 | platform_device_register(&at91_beeper); | ||
145 | |||
146 | at91_add_device_spi(eco920_spi_devices, ARRAY_SIZE(eco920_spi_devices)); | ||
147 | } | ||
148 | |||
149 | MACHINE_START(ECO920, "eco920") | ||
150 | /* Maintainer: Sascha Hauer */ | ||
151 | .phys_io = AT91_BASE_SYS, | ||
152 | .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, | ||
153 | .boot_params = AT91_SDRAM_BASE + 0x100, | ||
154 | .timer = &at91rm9200_timer, | ||
155 | .map_io = eco920_map_io, | ||
156 | .init_irq = eco920_init_irq, | ||
157 | .init_machine = eco920_board_init, | ||
158 | MACHINE_END | ||