diff options
-rw-r--r-- | arch/arm/mach-at91/Makefile | 19 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-afeb-9260v1.c | 223 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-cam60.c | 199 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-cpu9krea.c | 386 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-flexibity.c | 171 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-gsia18s.c | 585 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-pcontrol-g20.c | 228 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9-l9260.c | 230 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9260ek.c | 354 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9g20ek.c | 429 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-snapper9260.c | 191 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-stamp9g20.c | 294 | ||||
-rw-r--r-- | arch/arm/mach-at91/stamp9g20.h | 7 |
13 files changed, 0 insertions, 3316 deletions
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index e0361357e018..88d49248fc5c 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile | |||
@@ -39,29 +39,10 @@ obj-$(CONFIG_MACH_YL9200) += board-yl-9200.o | |||
39 | obj-$(CONFIG_MACH_CPUAT91) += board-cpuat91.o | 39 | obj-$(CONFIG_MACH_CPUAT91) += board-cpuat91.o |
40 | obj-$(CONFIG_MACH_ECO920) += board-eco920.o | 40 | obj-$(CONFIG_MACH_ECO920) += board-eco920.o |
41 | 41 | ||
42 | # AT91SAM9260 board-specific support | ||
43 | obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o | ||
44 | obj-$(CONFIG_MACH_CAM60) += board-cam60.o | ||
45 | obj-$(CONFIG_MACH_SAM9_L9260) += board-sam9-l9260.o | ||
46 | obj-$(CONFIG_MACH_AFEB9260) += board-afeb-9260v1.o | ||
47 | obj-$(CONFIG_MACH_CPU9260) += board-cpu9krea.o | ||
48 | obj-$(CONFIG_MACH_FLEXIBITY) += board-flexibity.o | ||
49 | |||
50 | # AT91SAM9261 board-specific support | 42 | # AT91SAM9261 board-specific support |
51 | obj-$(CONFIG_MACH_AT91SAM9261EK) += board-sam9261ek.o | 43 | obj-$(CONFIG_MACH_AT91SAM9261EK) += board-sam9261ek.o |
52 | obj-$(CONFIG_MACH_AT91SAM9G10EK) += board-sam9261ek.o | 44 | obj-$(CONFIG_MACH_AT91SAM9G10EK) += board-sam9261ek.o |
53 | 45 | ||
54 | # AT91SAM9G20 board-specific support | ||
55 | obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o | ||
56 | obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o | ||
57 | obj-$(CONFIG_MACH_STAMP9G20) += board-stamp9g20.o | ||
58 | obj-$(CONFIG_MACH_PORTUXG20) += board-stamp9g20.o | ||
59 | obj-$(CONFIG_MACH_PCONTROL_G20) += board-pcontrol-g20.o board-stamp9g20.o | ||
60 | obj-$(CONFIG_MACH_GSIA18S) += board-gsia18s.o board-stamp9g20.o | ||
61 | |||
62 | # AT91SAM9260/AT91SAM9G20 board-specific support | ||
63 | obj-$(CONFIG_MACH_SNAPPER_9260) += board-snapper9260.o | ||
64 | |||
65 | # AT91SAM board with device-tree | 46 | # AT91SAM board with device-tree |
66 | obj-$(CONFIG_MACH_AT91RM9200_DT) += board-dt-rm9200.o | 47 | obj-$(CONFIG_MACH_AT91RM9200_DT) += board-dt-rm9200.o |
67 | obj-$(CONFIG_MACH_AT91SAM9_DT) += board-dt-sam9.o | 48 | obj-$(CONFIG_MACH_AT91SAM9_DT) += board-dt-sam9.o |
diff --git a/arch/arm/mach-at91/board-afeb-9260v1.c b/arch/arm/mach-at91/board-afeb-9260v1.c deleted file mode 100644 index e76e35ce81e7..000000000000 --- a/arch/arm/mach-at91/board-afeb-9260v1.c +++ /dev/null | |||
@@ -1,223 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-at91/board-afeb-9260v1.c | ||
3 | * | ||
4 | * Copyright (C) 2005 SAN People | ||
5 | * Copyright (C) 2006 Atmel | ||
6 | * Copyright (C) 2008 Sergey Lapin | ||
7 | * | ||
8 | * A custom board designed as open hardware; PCBs and various information | ||
9 | * is available at http://groups.google.com/group/arm9fpga-evolution-board/ | ||
10 | * Subversion repository: svn://194.85.238.22/home/users/george/svn/arm9eb | ||
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/gpio.h> | ||
29 | #include <linux/init.h> | ||
30 | #include <linux/mm.h> | ||
31 | #include <linux/module.h> | ||
32 | #include <linux/platform_device.h> | ||
33 | #include <linux/spi/spi.h> | ||
34 | #include <linux/clk.h> | ||
35 | #include <linux/dma-mapping.h> | ||
36 | |||
37 | #include <mach/hardware.h> | ||
38 | #include <asm/setup.h> | ||
39 | #include <asm/mach-types.h> | ||
40 | #include <asm/irq.h> | ||
41 | |||
42 | #include <asm/mach/arch.h> | ||
43 | #include <asm/mach/map.h> | ||
44 | #include <asm/mach/irq.h> | ||
45 | |||
46 | #include "at91_aic.h" | ||
47 | #include "board.h" | ||
48 | #include "generic.h" | ||
49 | #include "gpio.h" | ||
50 | |||
51 | |||
52 | static void __init afeb9260_init_early(void) | ||
53 | { | ||
54 | /* Initialize processor: 18.432 MHz crystal */ | ||
55 | at91_initialize(18432000); | ||
56 | } | ||
57 | |||
58 | /* | ||
59 | * USB Host port | ||
60 | */ | ||
61 | static struct at91_usbh_data __initdata afeb9260_usbh_data = { | ||
62 | .ports = 1, | ||
63 | .vbus_pin = {-EINVAL, -EINVAL}, | ||
64 | .overcurrent_pin= {-EINVAL, -EINVAL}, | ||
65 | }; | ||
66 | |||
67 | /* | ||
68 | * USB Device port | ||
69 | */ | ||
70 | static struct at91_udc_data __initdata afeb9260_udc_data = { | ||
71 | .vbus_pin = AT91_PIN_PC5, | ||
72 | .pullup_pin = -EINVAL, /* pull-up driven by UDC */ | ||
73 | }; | ||
74 | |||
75 | |||
76 | |||
77 | /* | ||
78 | * SPI devices. | ||
79 | */ | ||
80 | static struct spi_board_info afeb9260_spi_devices[] = { | ||
81 | { /* DataFlash chip */ | ||
82 | .modalias = "mtd_dataflash", | ||
83 | .chip_select = 1, | ||
84 | .max_speed_hz = 15 * 1000 * 1000, | ||
85 | .bus_num = 0, | ||
86 | }, | ||
87 | }; | ||
88 | |||
89 | |||
90 | /* | ||
91 | * MACB Ethernet device | ||
92 | */ | ||
93 | static struct macb_platform_data __initdata afeb9260_macb_data = { | ||
94 | .phy_irq_pin = AT91_PIN_PA9, | ||
95 | .is_rmii = 0, | ||
96 | }; | ||
97 | |||
98 | |||
99 | /* | ||
100 | * NAND flash | ||
101 | */ | ||
102 | static struct mtd_partition __initdata afeb9260_nand_partition[] = { | ||
103 | { | ||
104 | .name = "bootloader", | ||
105 | .offset = 0, | ||
106 | .size = (640 * SZ_1K), | ||
107 | }, | ||
108 | { | ||
109 | .name = "kernel", | ||
110 | .offset = MTDPART_OFS_NXTBLK, | ||
111 | .size = SZ_2M, | ||
112 | }, | ||
113 | { | ||
114 | .name = "rootfs", | ||
115 | .offset = MTDPART_OFS_NXTBLK, | ||
116 | .size = MTDPART_SIZ_FULL, | ||
117 | }, | ||
118 | }; | ||
119 | |||
120 | static struct atmel_nand_data __initdata afeb9260_nand_data = { | ||
121 | .ale = 21, | ||
122 | .cle = 22, | ||
123 | .rdy_pin = AT91_PIN_PC13, | ||
124 | .enable_pin = AT91_PIN_PC14, | ||
125 | .bus_width_16 = 0, | ||
126 | .ecc_mode = NAND_ECC_SOFT, | ||
127 | .parts = afeb9260_nand_partition, | ||
128 | .num_parts = ARRAY_SIZE(afeb9260_nand_partition), | ||
129 | .det_pin = -EINVAL, | ||
130 | }; | ||
131 | |||
132 | |||
133 | /* | ||
134 | * MCI (SD/MMC) | ||
135 | */ | ||
136 | static struct mci_platform_data __initdata afeb9260_mci0_data = { | ||
137 | .slot[1] = { | ||
138 | .bus_width = 4, | ||
139 | .detect_pin = AT91_PIN_PC9, | ||
140 | .wp_pin = AT91_PIN_PC4, | ||
141 | }, | ||
142 | }; | ||
143 | |||
144 | |||
145 | |||
146 | static struct i2c_board_info __initdata afeb9260_i2c_devices[] = { | ||
147 | { | ||
148 | I2C_BOARD_INFO("tlv320aic23", 0x1a), | ||
149 | }, { | ||
150 | I2C_BOARD_INFO("fm3130", 0x68), | ||
151 | }, { | ||
152 | I2C_BOARD_INFO("24c64", 0x50), | ||
153 | }, | ||
154 | }; | ||
155 | |||
156 | /* | ||
157 | * IDE (CF True IDE mode) | ||
158 | */ | ||
159 | static struct at91_cf_data afeb9260_cf_data = { | ||
160 | .chipselect = 4, | ||
161 | .irq_pin = AT91_PIN_PA6, | ||
162 | .det_pin = -EINVAL, | ||
163 | .vcc_pin = -EINVAL, | ||
164 | .rst_pin = AT91_PIN_PA7, | ||
165 | .flags = AT91_CF_TRUE_IDE, | ||
166 | }; | ||
167 | |||
168 | static void __init afeb9260_board_init(void) | ||
169 | { | ||
170 | at91_register_devices(); | ||
171 | |||
172 | /* Serial */ | ||
173 | /* DBGU on ttyS0. (Rx & Tx only) */ | ||
174 | at91_register_uart(0, 0, 0); | ||
175 | |||
176 | /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
177 | at91_register_uart(AT91SAM9260_ID_US0, 1, | ||
178 | ATMEL_UART_CTS | ATMEL_UART_RTS | ||
179 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ||
180 | | ATMEL_UART_DCD | ATMEL_UART_RI); | ||
181 | |||
182 | /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */ | ||
183 | at91_register_uart(AT91SAM9260_ID_US1, 2, | ||
184 | ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
185 | at91_add_device_serial(); | ||
186 | /* USB Host */ | ||
187 | at91_add_device_usbh(&afeb9260_usbh_data); | ||
188 | /* USB Device */ | ||
189 | at91_add_device_udc(&afeb9260_udc_data); | ||
190 | /* SPI */ | ||
191 | at91_add_device_spi(afeb9260_spi_devices, | ||
192 | ARRAY_SIZE(afeb9260_spi_devices)); | ||
193 | /* NAND */ | ||
194 | at91_add_device_nand(&afeb9260_nand_data); | ||
195 | /* Ethernet */ | ||
196 | at91_add_device_eth(&afeb9260_macb_data); | ||
197 | |||
198 | /* Standard function's pin assignments are not | ||
199 | * appropriate for us and generic code provide | ||
200 | * no API to configure these pins any other way */ | ||
201 | at91_set_B_periph(AT91_PIN_PA10, 0); /* ETX2 */ | ||
202 | at91_set_B_periph(AT91_PIN_PA11, 0); /* ETX3 */ | ||
203 | /* MMC */ | ||
204 | at91_add_device_mci(0, &afeb9260_mci0_data); | ||
205 | /* I2C */ | ||
206 | at91_add_device_i2c(afeb9260_i2c_devices, | ||
207 | ARRAY_SIZE(afeb9260_i2c_devices)); | ||
208 | /* Audio */ | ||
209 | at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX); | ||
210 | /* IDE */ | ||
211 | at91_add_device_cf(&afeb9260_cf_data); | ||
212 | } | ||
213 | |||
214 | MACHINE_START(AFEB9260, "Custom afeb9260 board") | ||
215 | /* Maintainer: Sergey Lapin <slapin@ossfans.org> */ | ||
216 | .init_time = at91_init_time, | ||
217 | .map_io = at91_map_io, | ||
218 | .handle_irq = at91_aic_handle_irq, | ||
219 | .init_early = afeb9260_init_early, | ||
220 | .init_irq = at91_init_irq_default, | ||
221 | .init_machine = afeb9260_board_init, | ||
222 | MACHINE_END | ||
223 | |||
diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c deleted file mode 100644 index ae827dd2d0d2..000000000000 --- a/arch/arm/mach-at91/board-cam60.c +++ /dev/null | |||
@@ -1,199 +0,0 @@ | |||
1 | /* | ||
2 | * KwikByte CAM60 (KB9260) | ||
3 | * | ||
4 | * based on board-sam9260ek.c | ||
5 | * Copyright (C) 2005 SAN People | ||
6 | * Copyright (C) 2006 Atmel | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | #include <linux/gpio.h> | ||
25 | #include <linux/init.h> | ||
26 | #include <linux/mm.h> | ||
27 | #include <linux/module.h> | ||
28 | #include <linux/platform_device.h> | ||
29 | #include <linux/spi/spi.h> | ||
30 | #include <linux/spi/flash.h> | ||
31 | |||
32 | #include <mach/hardware.h> | ||
33 | #include <asm/setup.h> | ||
34 | #include <asm/mach-types.h> | ||
35 | #include <asm/irq.h> | ||
36 | |||
37 | #include <asm/mach/arch.h> | ||
38 | #include <asm/mach/map.h> | ||
39 | #include <asm/mach/irq.h> | ||
40 | |||
41 | #include <mach/at91sam9_smc.h> | ||
42 | |||
43 | #include "at91_aic.h" | ||
44 | #include "board.h" | ||
45 | #include "sam9_smc.h" | ||
46 | #include "generic.h" | ||
47 | #include "gpio.h" | ||
48 | |||
49 | |||
50 | static void __init cam60_init_early(void) | ||
51 | { | ||
52 | /* Initialize processor: 10 MHz crystal */ | ||
53 | at91_initialize(10000000); | ||
54 | } | ||
55 | |||
56 | /* | ||
57 | * USB Host | ||
58 | */ | ||
59 | static struct at91_usbh_data __initdata cam60_usbh_data = { | ||
60 | .ports = 1, | ||
61 | .vbus_pin = {-EINVAL, -EINVAL}, | ||
62 | .overcurrent_pin= {-EINVAL, -EINVAL}, | ||
63 | }; | ||
64 | |||
65 | |||
66 | /* | ||
67 | * SPI devices. | ||
68 | */ | ||
69 | #if defined(CONFIG_MTD_DATAFLASH) | ||
70 | static struct mtd_partition cam60_spi_partitions[] = { | ||
71 | { | ||
72 | .name = "BOOT1", | ||
73 | .offset = 0, | ||
74 | .size = 4 * 1056, | ||
75 | }, | ||
76 | { | ||
77 | .name = "BOOT2", | ||
78 | .offset = MTDPART_OFS_NXTBLK, | ||
79 | .size = 256 * 1056, | ||
80 | }, | ||
81 | { | ||
82 | .name = "kernel", | ||
83 | .offset = MTDPART_OFS_NXTBLK, | ||
84 | .size = 2222 * 1056, | ||
85 | }, | ||
86 | { | ||
87 | .name = "file system", | ||
88 | .offset = MTDPART_OFS_NXTBLK, | ||
89 | .size = MTDPART_SIZ_FULL, | ||
90 | }, | ||
91 | }; | ||
92 | |||
93 | static struct flash_platform_data cam60_spi_flash_platform_data = { | ||
94 | .name = "spi_flash", | ||
95 | .parts = cam60_spi_partitions, | ||
96 | .nr_parts = ARRAY_SIZE(cam60_spi_partitions) | ||
97 | }; | ||
98 | #endif | ||
99 | |||
100 | static struct spi_board_info cam60_spi_devices[] __initdata = { | ||
101 | #if defined(CONFIG_MTD_DATAFLASH) | ||
102 | { /* DataFlash chip */ | ||
103 | .modalias = "mtd_dataflash", | ||
104 | .chip_select = 0, | ||
105 | .max_speed_hz = 15 * 1000 * 1000, | ||
106 | .bus_num = 0, | ||
107 | .platform_data = &cam60_spi_flash_platform_data | ||
108 | }, | ||
109 | #endif | ||
110 | }; | ||
111 | |||
112 | |||
113 | /* | ||
114 | * MACB Ethernet device | ||
115 | */ | ||
116 | static struct macb_platform_data cam60_macb_data __initdata = { | ||
117 | .phy_irq_pin = AT91_PIN_PB5, | ||
118 | .is_rmii = 0, | ||
119 | }; | ||
120 | |||
121 | |||
122 | /* | ||
123 | * NAND Flash | ||
124 | */ | ||
125 | static struct mtd_partition __initdata cam60_nand_partition[] = { | ||
126 | { | ||
127 | .name = "nand_fs", | ||
128 | .offset = 0, | ||
129 | .size = MTDPART_SIZ_FULL, | ||
130 | }, | ||
131 | }; | ||
132 | |||
133 | static struct atmel_nand_data __initdata cam60_nand_data = { | ||
134 | .ale = 21, | ||
135 | .cle = 22, | ||
136 | .det_pin = -EINVAL, | ||
137 | .rdy_pin = AT91_PIN_PA9, | ||
138 | .enable_pin = AT91_PIN_PA7, | ||
139 | .ecc_mode = NAND_ECC_SOFT, | ||
140 | .parts = cam60_nand_partition, | ||
141 | .num_parts = ARRAY_SIZE(cam60_nand_partition), | ||
142 | }; | ||
143 | |||
144 | static struct sam9_smc_config __initdata cam60_nand_smc_config = { | ||
145 | .ncs_read_setup = 0, | ||
146 | .nrd_setup = 1, | ||
147 | .ncs_write_setup = 0, | ||
148 | .nwe_setup = 1, | ||
149 | |||
150 | .ncs_read_pulse = 3, | ||
151 | .nrd_pulse = 3, | ||
152 | .ncs_write_pulse = 3, | ||
153 | .nwe_pulse = 3, | ||
154 | |||
155 | .read_cycle = 5, | ||
156 | .write_cycle = 5, | ||
157 | |||
158 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8, | ||
159 | .tdf_cycles = 2, | ||
160 | }; | ||
161 | |||
162 | static void __init cam60_add_device_nand(void) | ||
163 | { | ||
164 | /* configure chip-select 3 (NAND) */ | ||
165 | sam9_smc_configure(0, 3, &cam60_nand_smc_config); | ||
166 | |||
167 | at91_add_device_nand(&cam60_nand_data); | ||
168 | } | ||
169 | |||
170 | |||
171 | static void __init cam60_board_init(void) | ||
172 | { | ||
173 | at91_register_devices(); | ||
174 | |||
175 | /* Serial */ | ||
176 | /* DBGU on ttyS0. (Rx & Tx only) */ | ||
177 | at91_register_uart(0, 0, 0); | ||
178 | at91_add_device_serial(); | ||
179 | /* SPI */ | ||
180 | at91_add_device_spi(cam60_spi_devices, ARRAY_SIZE(cam60_spi_devices)); | ||
181 | /* Ethernet */ | ||
182 | at91_add_device_eth(&cam60_macb_data); | ||
183 | /* USB Host */ | ||
184 | /* enable USB power supply circuit */ | ||
185 | at91_set_gpio_output(AT91_PIN_PB18, 1); | ||
186 | at91_add_device_usbh(&cam60_usbh_data); | ||
187 | /* NAND */ | ||
188 | cam60_add_device_nand(); | ||
189 | } | ||
190 | |||
191 | MACHINE_START(CAM60, "KwikByte CAM60") | ||
192 | /* Maintainer: KwikByte */ | ||
193 | .init_time = at91_init_time, | ||
194 | .map_io = at91_map_io, | ||
195 | .handle_irq = at91_aic_handle_irq, | ||
196 | .init_early = cam60_init_early, | ||
197 | .init_irq = at91_init_irq_default, | ||
198 | .init_machine = cam60_board_init, | ||
199 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/board-cpu9krea.c b/arch/arm/mach-at91/board-cpu9krea.c deleted file mode 100644 index 731c8318f4f5..000000000000 --- a/arch/arm/mach-at91/board-cpu9krea.c +++ /dev/null | |||
@@ -1,386 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-at91/board-cpu9krea.c | ||
3 | * | ||
4 | * Copyright (C) 2005 SAN People | ||
5 | * Copyright (C) 2006 Atmel | ||
6 | * Copyright (C) 2009 Eric Benard - eric@eukrea.com | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | #include <linux/gpio.h> | ||
25 | #include <linux/init.h> | ||
26 | #include <linux/mm.h> | ||
27 | #include <linux/module.h> | ||
28 | #include <linux/platform_device.h> | ||
29 | #include <linux/clk.h> | ||
30 | #include <linux/gpio_keys.h> | ||
31 | #include <linux/input.h> | ||
32 | #include <linux/mtd/physmap.h> | ||
33 | |||
34 | #include <asm/setup.h> | ||
35 | #include <asm/mach-types.h> | ||
36 | #include <asm/irq.h> | ||
37 | |||
38 | #include <asm/mach/arch.h> | ||
39 | #include <asm/mach/map.h> | ||
40 | #include <asm/mach/irq.h> | ||
41 | |||
42 | #include <mach/hardware.h> | ||
43 | #include <mach/at91sam9_smc.h> | ||
44 | #include <mach/at91sam9260_matrix.h> | ||
45 | #include <mach/at91_matrix.h> | ||
46 | |||
47 | #include "at91_aic.h" | ||
48 | #include "board.h" | ||
49 | #include "sam9_smc.h" | ||
50 | #include "generic.h" | ||
51 | #include "gpio.h" | ||
52 | |||
53 | static void __init cpu9krea_init_early(void) | ||
54 | { | ||
55 | /* Initialize processor: 18.432 MHz crystal */ | ||
56 | at91_initialize(18432000); | ||
57 | } | ||
58 | |||
59 | /* | ||
60 | * USB Host port | ||
61 | */ | ||
62 | static struct at91_usbh_data __initdata cpu9krea_usbh_data = { | ||
63 | .ports = 2, | ||
64 | .vbus_pin = {-EINVAL, -EINVAL}, | ||
65 | .overcurrent_pin= {-EINVAL, -EINVAL}, | ||
66 | }; | ||
67 | |||
68 | /* | ||
69 | * USB Device port | ||
70 | */ | ||
71 | static struct at91_udc_data __initdata cpu9krea_udc_data = { | ||
72 | .vbus_pin = AT91_PIN_PC8, | ||
73 | .pullup_pin = -EINVAL, /* pull-up driven by UDC */ | ||
74 | }; | ||
75 | |||
76 | /* | ||
77 | * MACB Ethernet device | ||
78 | */ | ||
79 | static struct macb_platform_data __initdata cpu9krea_macb_data = { | ||
80 | .phy_irq_pin = -EINVAL, | ||
81 | .is_rmii = 1, | ||
82 | }; | ||
83 | |||
84 | /* | ||
85 | * NAND flash | ||
86 | */ | ||
87 | static struct atmel_nand_data __initdata cpu9krea_nand_data = { | ||
88 | .ale = 21, | ||
89 | .cle = 22, | ||
90 | .rdy_pin = AT91_PIN_PC13, | ||
91 | .enable_pin = AT91_PIN_PC14, | ||
92 | .bus_width_16 = 0, | ||
93 | .det_pin = -EINVAL, | ||
94 | .ecc_mode = NAND_ECC_SOFT, | ||
95 | }; | ||
96 | |||
97 | #ifdef CONFIG_MACH_CPU9260 | ||
98 | static struct sam9_smc_config __initdata cpu9krea_nand_smc_config = { | ||
99 | .ncs_read_setup = 0, | ||
100 | .nrd_setup = 1, | ||
101 | .ncs_write_setup = 0, | ||
102 | .nwe_setup = 1, | ||
103 | |||
104 | .ncs_read_pulse = 3, | ||
105 | .nrd_pulse = 3, | ||
106 | .ncs_write_pulse = 3, | ||
107 | .nwe_pulse = 3, | ||
108 | |||
109 | .read_cycle = 5, | ||
110 | .write_cycle = 5, | ||
111 | |||
112 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | ||
113 | | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8, | ||
114 | .tdf_cycles = 2, | ||
115 | }; | ||
116 | #else | ||
117 | static struct sam9_smc_config __initdata cpu9krea_nand_smc_config = { | ||
118 | .ncs_read_setup = 0, | ||
119 | .nrd_setup = 2, | ||
120 | .ncs_write_setup = 0, | ||
121 | .nwe_setup = 2, | ||
122 | |||
123 | .ncs_read_pulse = 4, | ||
124 | .nrd_pulse = 4, | ||
125 | .ncs_write_pulse = 4, | ||
126 | .nwe_pulse = 4, | ||
127 | |||
128 | .read_cycle = 7, | ||
129 | .write_cycle = 7, | ||
130 | |||
131 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | ||
132 | | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8, | ||
133 | .tdf_cycles = 3, | ||
134 | }; | ||
135 | #endif | ||
136 | |||
137 | static void __init cpu9krea_add_device_nand(void) | ||
138 | { | ||
139 | sam9_smc_configure(0, 3, &cpu9krea_nand_smc_config); | ||
140 | at91_add_device_nand(&cpu9krea_nand_data); | ||
141 | } | ||
142 | |||
143 | /* | ||
144 | * NOR flash | ||
145 | */ | ||
146 | static struct physmap_flash_data cpuat9260_nor_data = { | ||
147 | .width = 2, | ||
148 | }; | ||
149 | |||
150 | #define NOR_BASE AT91_CHIPSELECT_0 | ||
151 | #define NOR_SIZE SZ_64M | ||
152 | |||
153 | static struct resource nor_flash_resources[] = { | ||
154 | { | ||
155 | .start = NOR_BASE, | ||
156 | .end = NOR_BASE + NOR_SIZE - 1, | ||
157 | .flags = IORESOURCE_MEM, | ||
158 | } | ||
159 | }; | ||
160 | |||
161 | static struct platform_device cpu9krea_nor_flash = { | ||
162 | .name = "physmap-flash", | ||
163 | .id = 0, | ||
164 | .dev = { | ||
165 | .platform_data = &cpuat9260_nor_data, | ||
166 | }, | ||
167 | .resource = nor_flash_resources, | ||
168 | .num_resources = ARRAY_SIZE(nor_flash_resources), | ||
169 | }; | ||
170 | |||
171 | #ifdef CONFIG_MACH_CPU9260 | ||
172 | static struct sam9_smc_config __initdata cpu9krea_nor_smc_config = { | ||
173 | .ncs_read_setup = 0, | ||
174 | .nrd_setup = 1, | ||
175 | .ncs_write_setup = 0, | ||
176 | .nwe_setup = 1, | ||
177 | |||
178 | .ncs_read_pulse = 10, | ||
179 | .nrd_pulse = 10, | ||
180 | .ncs_write_pulse = 6, | ||
181 | .nwe_pulse = 6, | ||
182 | |||
183 | .read_cycle = 12, | ||
184 | .write_cycle = 8, | ||
185 | |||
186 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | ||
187 | | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_BAT_WRITE | ||
188 | | AT91_SMC_DBW_16, | ||
189 | .tdf_cycles = 2, | ||
190 | }; | ||
191 | #else | ||
192 | static struct sam9_smc_config __initdata cpu9krea_nor_smc_config = { | ||
193 | .ncs_read_setup = 0, | ||
194 | .nrd_setup = 1, | ||
195 | .ncs_write_setup = 0, | ||
196 | .nwe_setup = 1, | ||
197 | |||
198 | .ncs_read_pulse = 13, | ||
199 | .nrd_pulse = 13, | ||
200 | .ncs_write_pulse = 8, | ||
201 | .nwe_pulse = 8, | ||
202 | |||
203 | .read_cycle = 15, | ||
204 | .write_cycle = 10, | ||
205 | |||
206 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | ||
207 | | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_BAT_WRITE | ||
208 | | AT91_SMC_DBW_16, | ||
209 | .tdf_cycles = 2, | ||
210 | }; | ||
211 | #endif | ||
212 | |||
213 | static __init void cpu9krea_add_device_nor(void) | ||
214 | { | ||
215 | unsigned long csa; | ||
216 | |||
217 | csa = at91_matrix_read(AT91_MATRIX_EBICSA); | ||
218 | at91_matrix_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_VDDIOMSEL_3_3V); | ||
219 | |||
220 | /* configure chip-select 0 (NOR) */ | ||
221 | sam9_smc_configure(0, 0, &cpu9krea_nor_smc_config); | ||
222 | |||
223 | platform_device_register(&cpu9krea_nor_flash); | ||
224 | } | ||
225 | |||
226 | /* | ||
227 | * LEDs | ||
228 | */ | ||
229 | static struct gpio_led cpu9krea_leds[] = { | ||
230 | { /* LED1 */ | ||
231 | .name = "LED1", | ||
232 | .gpio = AT91_PIN_PC11, | ||
233 | .active_low = 1, | ||
234 | .default_trigger = "timer", | ||
235 | }, | ||
236 | { /* LED2 */ | ||
237 | .name = "LED2", | ||
238 | .gpio = AT91_PIN_PC12, | ||
239 | .active_low = 1, | ||
240 | .default_trigger = "heartbeat", | ||
241 | }, | ||
242 | { /* LED3 */ | ||
243 | .name = "LED3", | ||
244 | .gpio = AT91_PIN_PC7, | ||
245 | .active_low = 1, | ||
246 | .default_trigger = "none", | ||
247 | }, | ||
248 | { /* LED4 */ | ||
249 | .name = "LED4", | ||
250 | .gpio = AT91_PIN_PC9, | ||
251 | .active_low = 1, | ||
252 | .default_trigger = "none", | ||
253 | } | ||
254 | }; | ||
255 | |||
256 | static struct i2c_board_info __initdata cpu9krea_i2c_devices[] = { | ||
257 | { | ||
258 | I2C_BOARD_INFO("ds1339", 0x68), | ||
259 | }, | ||
260 | }; | ||
261 | |||
262 | /* | ||
263 | * GPIO Buttons | ||
264 | */ | ||
265 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
266 | static struct gpio_keys_button cpu9krea_buttons[] = { | ||
267 | { | ||
268 | .gpio = AT91_PIN_PC3, | ||
269 | .code = BTN_0, | ||
270 | .desc = "BP1", | ||
271 | .active_low = 1, | ||
272 | .wakeup = 1, | ||
273 | }, | ||
274 | { | ||
275 | .gpio = AT91_PIN_PB20, | ||
276 | .code = BTN_1, | ||
277 | .desc = "BP2", | ||
278 | .active_low = 1, | ||
279 | .wakeup = 1, | ||
280 | } | ||
281 | }; | ||
282 | |||
283 | static struct gpio_keys_platform_data cpu9krea_button_data = { | ||
284 | .buttons = cpu9krea_buttons, | ||
285 | .nbuttons = ARRAY_SIZE(cpu9krea_buttons), | ||
286 | }; | ||
287 | |||
288 | static struct platform_device cpu9krea_button_device = { | ||
289 | .name = "gpio-keys", | ||
290 | .id = -1, | ||
291 | .num_resources = 0, | ||
292 | .dev = { | ||
293 | .platform_data = &cpu9krea_button_data, | ||
294 | } | ||
295 | }; | ||
296 | |||
297 | static void __init cpu9krea_add_device_buttons(void) | ||
298 | { | ||
299 | at91_set_gpio_input(AT91_PIN_PC3, 1); /* BP1 */ | ||
300 | at91_set_deglitch(AT91_PIN_PC3, 1); | ||
301 | at91_set_gpio_input(AT91_PIN_PB20, 1); /* BP2 */ | ||
302 | at91_set_deglitch(AT91_PIN_PB20, 1); | ||
303 | |||
304 | platform_device_register(&cpu9krea_button_device); | ||
305 | } | ||
306 | #else | ||
307 | static void __init cpu9krea_add_device_buttons(void) | ||
308 | { | ||
309 | } | ||
310 | #endif | ||
311 | |||
312 | /* | ||
313 | * MCI (SD/MMC) | ||
314 | */ | ||
315 | static struct mci_platform_data __initdata cpu9krea_mci0_data = { | ||
316 | .slot[0] = { | ||
317 | .bus_width = 4, | ||
318 | .detect_pin = AT91_PIN_PA29, | ||
319 | .wp_pin = -EINVAL, | ||
320 | }, | ||
321 | }; | ||
322 | |||
323 | static void __init cpu9krea_board_init(void) | ||
324 | { | ||
325 | at91_register_devices(); | ||
326 | |||
327 | /* NOR */ | ||
328 | cpu9krea_add_device_nor(); | ||
329 | /* Serial */ | ||
330 | /* DGBU on ttyS0. (Rx & Tx only) */ | ||
331 | at91_register_uart(0, 0, 0); | ||
332 | |||
333 | /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
334 | at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | | ||
335 | ATMEL_UART_RTS | ATMEL_UART_DTR | ATMEL_UART_DSR | | ||
336 | ATMEL_UART_DCD | ATMEL_UART_RI); | ||
337 | |||
338 | /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */ | ||
339 | at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | | ||
340 | ATMEL_UART_RTS); | ||
341 | |||
342 | /* USART2 on ttyS3. (Rx, Tx, RTS, CTS) */ | ||
343 | at91_register_uart(AT91SAM9260_ID_US2, 3, ATMEL_UART_CTS | | ||
344 | ATMEL_UART_RTS); | ||
345 | |||
346 | /* USART3 on ttyS4. (Rx, Tx) */ | ||
347 | at91_register_uart(AT91SAM9260_ID_US3, 4, 0); | ||
348 | |||
349 | /* USART4 on ttyS5. (Rx, Tx) */ | ||
350 | at91_register_uart(AT91SAM9260_ID_US4, 5, 0); | ||
351 | |||
352 | /* USART5 on ttyS6. (Rx, Tx) */ | ||
353 | at91_register_uart(AT91SAM9260_ID_US5, 6, 0); | ||
354 | at91_add_device_serial(); | ||
355 | /* USB Host */ | ||
356 | at91_add_device_usbh(&cpu9krea_usbh_data); | ||
357 | /* USB Device */ | ||
358 | at91_add_device_udc(&cpu9krea_udc_data); | ||
359 | /* NAND */ | ||
360 | cpu9krea_add_device_nand(); | ||
361 | /* Ethernet */ | ||
362 | at91_add_device_eth(&cpu9krea_macb_data); | ||
363 | /* MMC */ | ||
364 | at91_add_device_mci(0, &cpu9krea_mci0_data); | ||
365 | /* I2C */ | ||
366 | at91_add_device_i2c(cpu9krea_i2c_devices, | ||
367 | ARRAY_SIZE(cpu9krea_i2c_devices)); | ||
368 | /* LEDs */ | ||
369 | at91_gpio_leds(cpu9krea_leds, ARRAY_SIZE(cpu9krea_leds)); | ||
370 | /* Push Buttons */ | ||
371 | cpu9krea_add_device_buttons(); | ||
372 | } | ||
373 | |||
374 | #ifdef CONFIG_MACH_CPU9260 | ||
375 | MACHINE_START(CPUAT9260, "Eukrea CPU9260") | ||
376 | #else | ||
377 | MACHINE_START(CPUAT9G20, "Eukrea CPU9G20") | ||
378 | #endif | ||
379 | /* Maintainer: Eric Benard - EUKREA Electromatique */ | ||
380 | .init_time = at91_init_time, | ||
381 | .map_io = at91_map_io, | ||
382 | .handle_irq = at91_aic_handle_irq, | ||
383 | .init_early = cpu9krea_init_early, | ||
384 | .init_irq = at91_init_irq_default, | ||
385 | .init_machine = cpu9krea_board_init, | ||
386 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/board-flexibity.c b/arch/arm/mach-at91/board-flexibity.c deleted file mode 100644 index a6aa4a2432f2..000000000000 --- a/arch/arm/mach-at91/board-flexibity.c +++ /dev/null | |||
@@ -1,171 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-at91/board-flexibity.c | ||
3 | * | ||
4 | * Copyright (C) 2010-2011 Flexibity | ||
5 | * Copyright (C) 2005 SAN People | ||
6 | * Copyright (C) 2006 Atmel | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #include <linux/init.h> | ||
24 | #include <linux/platform_device.h> | ||
25 | #include <linux/spi/spi.h> | ||
26 | #include <linux/input.h> | ||
27 | #include <linux/gpio.h> | ||
28 | |||
29 | #include <asm/mach-types.h> | ||
30 | |||
31 | #include <asm/mach/arch.h> | ||
32 | #include <asm/mach/map.h> | ||
33 | #include <asm/mach/irq.h> | ||
34 | |||
35 | #include <mach/hardware.h> | ||
36 | |||
37 | #include "at91_aic.h" | ||
38 | #include "board.h" | ||
39 | #include "generic.h" | ||
40 | #include "gpio.h" | ||
41 | |||
42 | static void __init flexibity_init_early(void) | ||
43 | { | ||
44 | /* Initialize processor: 18.432 MHz crystal */ | ||
45 | at91_initialize(18432000); | ||
46 | } | ||
47 | |||
48 | /* USB Host port */ | ||
49 | static struct at91_usbh_data __initdata flexibity_usbh_data = { | ||
50 | .ports = 2, | ||
51 | .vbus_pin = {-EINVAL, -EINVAL}, | ||
52 | .overcurrent_pin= {-EINVAL, -EINVAL}, | ||
53 | }; | ||
54 | |||
55 | /* USB Device port */ | ||
56 | static struct at91_udc_data __initdata flexibity_udc_data = { | ||
57 | .vbus_pin = AT91_PIN_PC5, | ||
58 | .pullup_pin = -EINVAL, /* pull-up driven by UDC */ | ||
59 | }; | ||
60 | |||
61 | /* I2C devices */ | ||
62 | static struct i2c_board_info __initdata flexibity_i2c_devices[] = { | ||
63 | { | ||
64 | I2C_BOARD_INFO("ds1307", 0x68), | ||
65 | }, | ||
66 | }; | ||
67 | |||
68 | /* SPI devices */ | ||
69 | static struct spi_board_info flexibity_spi_devices[] = { | ||
70 | { /* DataFlash chip */ | ||
71 | .modalias = "mtd_dataflash", | ||
72 | .chip_select = 1, | ||
73 | .max_speed_hz = 15 * 1000 * 1000, | ||
74 | .bus_num = 0, | ||
75 | }, | ||
76 | }; | ||
77 | |||
78 | /* MCI (SD/MMC) */ | ||
79 | static struct mci_platform_data __initdata flexibity_mci0_data = { | ||
80 | .slot[0] = { | ||
81 | .bus_width = 4, | ||
82 | .detect_pin = AT91_PIN_PC9, | ||
83 | .wp_pin = AT91_PIN_PC4, | ||
84 | }, | ||
85 | }; | ||
86 | |||
87 | /* LEDs */ | ||
88 | static struct gpio_led flexibity_leds[] = { | ||
89 | { | ||
90 | .name = "usb1:green", | ||
91 | .gpio = AT91_PIN_PA12, | ||
92 | .active_low = 1, | ||
93 | .default_trigger = "default-on", | ||
94 | }, | ||
95 | { | ||
96 | .name = "usb1:red", | ||
97 | .gpio = AT91_PIN_PA13, | ||
98 | .active_low = 1, | ||
99 | .default_trigger = "default-on", | ||
100 | }, | ||
101 | { | ||
102 | .name = "usb2:green", | ||
103 | .gpio = AT91_PIN_PB26, | ||
104 | .active_low = 1, | ||
105 | .default_trigger = "default-on", | ||
106 | }, | ||
107 | { | ||
108 | .name = "usb2:red", | ||
109 | .gpio = AT91_PIN_PB27, | ||
110 | .active_low = 1, | ||
111 | .default_trigger = "default-on", | ||
112 | }, | ||
113 | { | ||
114 | .name = "usb3:green", | ||
115 | .gpio = AT91_PIN_PC8, | ||
116 | .active_low = 1, | ||
117 | .default_trigger = "default-on", | ||
118 | }, | ||
119 | { | ||
120 | .name = "usb3:red", | ||
121 | .gpio = AT91_PIN_PC6, | ||
122 | .active_low = 1, | ||
123 | .default_trigger = "default-on", | ||
124 | }, | ||
125 | { | ||
126 | .name = "usb4:green", | ||
127 | .gpio = AT91_PIN_PB4, | ||
128 | .active_low = 1, | ||
129 | .default_trigger = "default-on", | ||
130 | }, | ||
131 | { | ||
132 | .name = "usb4:red", | ||
133 | .gpio = AT91_PIN_PB5, | ||
134 | .active_low = 1, | ||
135 | .default_trigger = "default-on", | ||
136 | } | ||
137 | }; | ||
138 | |||
139 | static void __init flexibity_board_init(void) | ||
140 | { | ||
141 | at91_register_devices(); | ||
142 | |||
143 | /* Serial */ | ||
144 | /* DBGU on ttyS0. (Rx & Tx only) */ | ||
145 | at91_register_uart(0, 0, 0); | ||
146 | at91_add_device_serial(); | ||
147 | /* USB Host */ | ||
148 | at91_add_device_usbh(&flexibity_usbh_data); | ||
149 | /* USB Device */ | ||
150 | at91_add_device_udc(&flexibity_udc_data); | ||
151 | /* I2C */ | ||
152 | at91_add_device_i2c(flexibity_i2c_devices, | ||
153 | ARRAY_SIZE(flexibity_i2c_devices)); | ||
154 | /* SPI */ | ||
155 | at91_add_device_spi(flexibity_spi_devices, | ||
156 | ARRAY_SIZE(flexibity_spi_devices)); | ||
157 | /* MMC */ | ||
158 | at91_add_device_mci(0, &flexibity_mci0_data); | ||
159 | /* LEDs */ | ||
160 | at91_gpio_leds(flexibity_leds, ARRAY_SIZE(flexibity_leds)); | ||
161 | } | ||
162 | |||
163 | MACHINE_START(FLEXIBITY, "Flexibity Connect") | ||
164 | /* Maintainer: Maxim Osipov */ | ||
165 | .init_time = at91_init_time, | ||
166 | .map_io = at91_map_io, | ||
167 | .handle_irq = at91_aic_handle_irq, | ||
168 | .init_early = flexibity_init_early, | ||
169 | .init_irq = at91_init_irq_default, | ||
170 | .init_machine = flexibity_board_init, | ||
171 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/board-gsia18s.c b/arch/arm/mach-at91/board-gsia18s.c deleted file mode 100644 index bf5cc55c7db6..000000000000 --- a/arch/arm/mach-at91/board-gsia18s.c +++ /dev/null | |||
@@ -1,585 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Christian Glindkamp <christian.glindkamp@taskit.de> | ||
3 | * taskit GmbH | ||
4 | * 2010 Igor Plyatov <plyatov@gmail.com> | ||
5 | * GeoSIG Ltd | ||
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 as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | #include <linux/platform_device.h> | ||
23 | #include <linux/gpio.h> | ||
24 | #include <linux/w1-gpio.h> | ||
25 | #include <linux/i2c.h> | ||
26 | #include <linux/i2c/pcf857x.h> | ||
27 | #include <linux/gpio_keys.h> | ||
28 | #include <linux/input.h> | ||
29 | |||
30 | #include <asm/mach-types.h> | ||
31 | #include <asm/mach/arch.h> | ||
32 | |||
33 | #include <mach/at91sam9_smc.h> | ||
34 | #include <mach/hardware.h> | ||
35 | |||
36 | #include "at91_aic.h" | ||
37 | #include "board.h" | ||
38 | #include "sam9_smc.h" | ||
39 | #include "generic.h" | ||
40 | #include "gsia18s.h" | ||
41 | #include "stamp9g20.h" | ||
42 | #include "gpio.h" | ||
43 | |||
44 | static void __init gsia18s_init_early(void) | ||
45 | { | ||
46 | stamp9g20_init_early(); | ||
47 | } | ||
48 | |||
49 | /* | ||
50 | * Two USB Host ports | ||
51 | */ | ||
52 | static struct at91_usbh_data __initdata usbh_data = { | ||
53 | .ports = 2, | ||
54 | .vbus_pin = {-EINVAL, -EINVAL}, | ||
55 | .overcurrent_pin= {-EINVAL, -EINVAL}, | ||
56 | }; | ||
57 | |||
58 | /* | ||
59 | * USB Device port | ||
60 | */ | ||
61 | static struct at91_udc_data __initdata udc_data = { | ||
62 | .vbus_pin = AT91_PIN_PA22, | ||
63 | .pullup_pin = -EINVAL, /* pull-up driven by UDC */ | ||
64 | }; | ||
65 | |||
66 | /* | ||
67 | * MACB Ethernet device | ||
68 | */ | ||
69 | static struct macb_platform_data __initdata macb_data = { | ||
70 | .phy_irq_pin = AT91_PIN_PA28, | ||
71 | .is_rmii = 1, | ||
72 | }; | ||
73 | |||
74 | /* | ||
75 | * LEDs and GPOs | ||
76 | */ | ||
77 | static struct gpio_led gpio_leds[] = { | ||
78 | { | ||
79 | .name = "gpo:spi1reset", | ||
80 | .gpio = AT91_PIN_PC1, | ||
81 | .active_low = 0, | ||
82 | .default_trigger = "none", | ||
83 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
84 | }, | ||
85 | { | ||
86 | .name = "gpo:trig_net_out", | ||
87 | .gpio = AT91_PIN_PB20, | ||
88 | .active_low = 0, | ||
89 | .default_trigger = "none", | ||
90 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
91 | }, | ||
92 | { | ||
93 | .name = "gpo:trig_net_dir", | ||
94 | .gpio = AT91_PIN_PB19, | ||
95 | .active_low = 0, | ||
96 | .default_trigger = "none", | ||
97 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
98 | }, | ||
99 | { | ||
100 | .name = "gpo:charge_dis", | ||
101 | .gpio = AT91_PIN_PC2, | ||
102 | .active_low = 0, | ||
103 | .default_trigger = "none", | ||
104 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
105 | }, | ||
106 | { | ||
107 | .name = "led:event", | ||
108 | .gpio = AT91_PIN_PB17, | ||
109 | .active_low = 1, | ||
110 | .default_trigger = "none", | ||
111 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
112 | }, | ||
113 | { | ||
114 | .name = "led:lan", | ||
115 | .gpio = AT91_PIN_PB18, | ||
116 | .active_low = 1, | ||
117 | .default_trigger = "none", | ||
118 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
119 | }, | ||
120 | { | ||
121 | .name = "led:error", | ||
122 | .gpio = AT91_PIN_PB16, | ||
123 | .active_low = 1, | ||
124 | .default_trigger = "none", | ||
125 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
126 | } | ||
127 | }; | ||
128 | |||
129 | static struct gpio_led_platform_data gpio_led_info = { | ||
130 | .leds = gpio_leds, | ||
131 | .num_leds = ARRAY_SIZE(gpio_leds), | ||
132 | }; | ||
133 | |||
134 | static struct platform_device leds = { | ||
135 | .name = "leds-gpio", | ||
136 | .id = 0, | ||
137 | .dev = { | ||
138 | .platform_data = &gpio_led_info, | ||
139 | } | ||
140 | }; | ||
141 | |||
142 | static void __init gsia18s_leds_init(void) | ||
143 | { | ||
144 | platform_device_register(&leds); | ||
145 | } | ||
146 | |||
147 | /* PCF8574 0x20 GPIO - U1 on the GS_IA18-CB_V3 board */ | ||
148 | static struct gpio_led pcf_gpio_leds1[] = { | ||
149 | { /* bit 0 */ | ||
150 | .name = "gpo:hdc_power", | ||
151 | .gpio = PCF_GPIO_HDC_POWER, | ||
152 | .active_low = 0, | ||
153 | .default_trigger = "none", | ||
154 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
155 | }, | ||
156 | { /* bit 1 */ | ||
157 | .name = "gpo:wifi_setup", | ||
158 | .gpio = PCF_GPIO_WIFI_SETUP, | ||
159 | .active_low = 1, | ||
160 | .default_trigger = "none", | ||
161 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
162 | }, | ||
163 | { /* bit 2 */ | ||
164 | .name = "gpo:wifi_enable", | ||
165 | .gpio = PCF_GPIO_WIFI_ENABLE, | ||
166 | .active_low = 1, | ||
167 | .default_trigger = "none", | ||
168 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
169 | }, | ||
170 | { /* bit 3 */ | ||
171 | .name = "gpo:wifi_reset", | ||
172 | .gpio = PCF_GPIO_WIFI_RESET, | ||
173 | .active_low = 1, | ||
174 | .default_trigger = "none", | ||
175 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
176 | }, | ||
177 | /* bit 4 used as GPI */ | ||
178 | { /* bit 5 */ | ||
179 | .name = "gpo:gps_setup", | ||
180 | .gpio = PCF_GPIO_GPS_SETUP, | ||
181 | .active_low = 1, | ||
182 | .default_trigger = "none", | ||
183 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
184 | }, | ||
185 | { /* bit 6 */ | ||
186 | .name = "gpo:gps_standby", | ||
187 | .gpio = PCF_GPIO_GPS_STANDBY, | ||
188 | .active_low = 0, | ||
189 | .default_trigger = "none", | ||
190 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
191 | }, | ||
192 | { /* bit 7 */ | ||
193 | .name = "gpo:gps_power", | ||
194 | .gpio = PCF_GPIO_GPS_POWER, | ||
195 | .active_low = 0, | ||
196 | .default_trigger = "none", | ||
197 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
198 | } | ||
199 | }; | ||
200 | |||
201 | static struct gpio_led_platform_data pcf_gpio_led_info1 = { | ||
202 | .leds = pcf_gpio_leds1, | ||
203 | .num_leds = ARRAY_SIZE(pcf_gpio_leds1), | ||
204 | }; | ||
205 | |||
206 | static struct platform_device pcf_leds1 = { | ||
207 | .name = "leds-gpio", /* GS_IA18-CB_board */ | ||
208 | .id = 1, | ||
209 | .dev = { | ||
210 | .platform_data = &pcf_gpio_led_info1, | ||
211 | } | ||
212 | }; | ||
213 | |||
214 | /* PCF8574 0x22 GPIO - U1 on the GS_2G_OPT1-A_V0 board (Alarm) */ | ||
215 | static struct gpio_led pcf_gpio_leds2[] = { | ||
216 | { /* bit 0 */ | ||
217 | .name = "gpo:alarm_1", | ||
218 | .gpio = PCF_GPIO_ALARM1, | ||
219 | .active_low = 1, | ||
220 | .default_trigger = "none", | ||
221 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
222 | }, | ||
223 | { /* bit 1 */ | ||
224 | .name = "gpo:alarm_2", | ||
225 | .gpio = PCF_GPIO_ALARM2, | ||
226 | .active_low = 1, | ||
227 | .default_trigger = "none", | ||
228 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
229 | }, | ||
230 | { /* bit 2 */ | ||
231 | .name = "gpo:alarm_3", | ||
232 | .gpio = PCF_GPIO_ALARM3, | ||
233 | .active_low = 1, | ||
234 | .default_trigger = "none", | ||
235 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
236 | }, | ||
237 | { /* bit 3 */ | ||
238 | .name = "gpo:alarm_4", | ||
239 | .gpio = PCF_GPIO_ALARM4, | ||
240 | .active_low = 1, | ||
241 | .default_trigger = "none", | ||
242 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
243 | }, | ||
244 | /* bits 4, 5, 6 not used */ | ||
245 | { /* bit 7 */ | ||
246 | .name = "gpo:alarm_v_relay_on", | ||
247 | .gpio = PCF_GPIO_ALARM_V_RELAY_ON, | ||
248 | .active_low = 0, | ||
249 | .default_trigger = "none", | ||
250 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
251 | }, | ||
252 | }; | ||
253 | |||
254 | static struct gpio_led_platform_data pcf_gpio_led_info2 = { | ||
255 | .leds = pcf_gpio_leds2, | ||
256 | .num_leds = ARRAY_SIZE(pcf_gpio_leds2), | ||
257 | }; | ||
258 | |||
259 | static struct platform_device pcf_leds2 = { | ||
260 | .name = "leds-gpio", | ||
261 | .id = 2, | ||
262 | .dev = { | ||
263 | .platform_data = &pcf_gpio_led_info2, | ||
264 | } | ||
265 | }; | ||
266 | |||
267 | /* PCF8574 0x24 GPIO U1 on the GS_2G-OPT23-A_V0 board (Modem) */ | ||
268 | static struct gpio_led pcf_gpio_leds3[] = { | ||
269 | { /* bit 0 */ | ||
270 | .name = "gpo:modem_power", | ||
271 | .gpio = PCF_GPIO_MODEM_POWER, | ||
272 | .active_low = 1, | ||
273 | .default_trigger = "none", | ||
274 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
275 | }, | ||
276 | /* bits 1 and 2 not used */ | ||
277 | { /* bit 3 */ | ||
278 | .name = "gpo:modem_reset", | ||
279 | .gpio = PCF_GPIO_MODEM_RESET, | ||
280 | .active_low = 1, | ||
281 | .default_trigger = "none", | ||
282 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
283 | }, | ||
284 | /* bits 4, 5 and 6 not used */ | ||
285 | { /* bit 7 */ | ||
286 | .name = "gpo:trx_reset", | ||
287 | .gpio = PCF_GPIO_TRX_RESET, | ||
288 | .active_low = 1, | ||
289 | .default_trigger = "none", | ||
290 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
291 | } | ||
292 | }; | ||
293 | |||
294 | static struct gpio_led_platform_data pcf_gpio_led_info3 = { | ||
295 | .leds = pcf_gpio_leds3, | ||
296 | .num_leds = ARRAY_SIZE(pcf_gpio_leds3), | ||
297 | }; | ||
298 | |||
299 | static struct platform_device pcf_leds3 = { | ||
300 | .name = "leds-gpio", | ||
301 | .id = 3, | ||
302 | .dev = { | ||
303 | .platform_data = &pcf_gpio_led_info3, | ||
304 | } | ||
305 | }; | ||
306 | |||
307 | static void __init gsia18s_pcf_leds_init(void) | ||
308 | { | ||
309 | platform_device_register(&pcf_leds1); | ||
310 | platform_device_register(&pcf_leds2); | ||
311 | platform_device_register(&pcf_leds3); | ||
312 | } | ||
313 | |||
314 | /* | ||
315 | * SPI busses. | ||
316 | */ | ||
317 | static struct spi_board_info gsia18s_spi_devices[] = { | ||
318 | { /* User accessible spi0, cs0 used for communication with MSP RTC */ | ||
319 | .modalias = "spidev", | ||
320 | .bus_num = 0, | ||
321 | .chip_select = 0, | ||
322 | .max_speed_hz = 580000, | ||
323 | .mode = SPI_MODE_1, | ||
324 | }, | ||
325 | { /* User accessible spi1, cs0 used for communication with int. DSP */ | ||
326 | .modalias = "spidev", | ||
327 | .bus_num = 1, | ||
328 | .chip_select = 0, | ||
329 | .max_speed_hz = 5600000, | ||
330 | .mode = SPI_MODE_0, | ||
331 | }, | ||
332 | { /* User accessible spi1, cs1 used for communication with ext. DSP */ | ||
333 | .modalias = "spidev", | ||
334 | .bus_num = 1, | ||
335 | .chip_select = 1, | ||
336 | .max_speed_hz = 5600000, | ||
337 | .mode = SPI_MODE_0, | ||
338 | }, | ||
339 | { /* User accessible spi1, cs2 used for communication with ext. DSP */ | ||
340 | .modalias = "spidev", | ||
341 | .bus_num = 1, | ||
342 | .chip_select = 2, | ||
343 | .max_speed_hz = 5600000, | ||
344 | .mode = SPI_MODE_0, | ||
345 | }, | ||
346 | { /* User accessible spi1, cs3 used for communication with ext. DSP */ | ||
347 | .modalias = "spidev", | ||
348 | .bus_num = 1, | ||
349 | .chip_select = 3, | ||
350 | .max_speed_hz = 5600000, | ||
351 | .mode = SPI_MODE_0, | ||
352 | } | ||
353 | }; | ||
354 | |||
355 | /* | ||
356 | * GPI Buttons | ||
357 | */ | ||
358 | static struct gpio_keys_button buttons[] = { | ||
359 | { | ||
360 | .gpio = GPIO_TRIG_NET_IN, | ||
361 | .code = BTN_1, | ||
362 | .desc = "TRIG_NET_IN", | ||
363 | .type = EV_KEY, | ||
364 | .active_low = 0, | ||
365 | .wakeup = 1, | ||
366 | }, | ||
367 | { /* SW80 on the GS_IA18_S-MN board*/ | ||
368 | .gpio = GPIO_CARD_UNMOUNT_0, | ||
369 | .code = BTN_2, | ||
370 | .desc = "Card umount 0", | ||
371 | .type = EV_KEY, | ||
372 | .active_low = 1, | ||
373 | .wakeup = 1, | ||
374 | }, | ||
375 | { /* SW79 on the GS_IA18_S-MN board*/ | ||
376 | .gpio = GPIO_CARD_UNMOUNT_1, | ||
377 | .code = BTN_3, | ||
378 | .desc = "Card umount 1", | ||
379 | .type = EV_KEY, | ||
380 | .active_low = 1, | ||
381 | .wakeup = 1, | ||
382 | }, | ||
383 | { /* SW280 on the GS_IA18-CB board*/ | ||
384 | .gpio = GPIO_KEY_POWER, | ||
385 | .code = KEY_POWER, | ||
386 | .desc = "Power Off Button", | ||
387 | .type = EV_KEY, | ||
388 | .active_low = 0, | ||
389 | .wakeup = 1, | ||
390 | } | ||
391 | }; | ||
392 | |||
393 | static struct gpio_keys_platform_data button_data = { | ||
394 | .buttons = buttons, | ||
395 | .nbuttons = ARRAY_SIZE(buttons), | ||
396 | }; | ||
397 | |||
398 | static struct platform_device button_device = { | ||
399 | .name = "gpio-keys", | ||
400 | .id = -1, | ||
401 | .num_resources = 0, | ||
402 | .dev = { | ||
403 | .platform_data = &button_data, | ||
404 | } | ||
405 | }; | ||
406 | |||
407 | static void __init gsia18s_add_device_buttons(void) | ||
408 | { | ||
409 | at91_set_gpio_input(GPIO_TRIG_NET_IN, 1); | ||
410 | at91_set_deglitch(GPIO_TRIG_NET_IN, 1); | ||
411 | at91_set_gpio_input(GPIO_CARD_UNMOUNT_0, 1); | ||
412 | at91_set_deglitch(GPIO_CARD_UNMOUNT_0, 1); | ||
413 | at91_set_gpio_input(GPIO_CARD_UNMOUNT_1, 1); | ||
414 | at91_set_deglitch(GPIO_CARD_UNMOUNT_1, 1); | ||
415 | at91_set_gpio_input(GPIO_KEY_POWER, 0); | ||
416 | at91_set_deglitch(GPIO_KEY_POWER, 1); | ||
417 | |||
418 | platform_device_register(&button_device); | ||
419 | } | ||
420 | |||
421 | /* | ||
422 | * I2C | ||
423 | */ | ||
424 | static int pcf8574x_0x20_setup(struct i2c_client *client, int gpio, | ||
425 | unsigned int ngpio, void *context) | ||
426 | { | ||
427 | int status; | ||
428 | |||
429 | status = gpio_request(gpio + PCF_GPIO_ETH_DETECT, "eth_det"); | ||
430 | if (status < 0) { | ||
431 | pr_err("error: can't request GPIO%d\n", | ||
432 | gpio + PCF_GPIO_ETH_DETECT); | ||
433 | return status; | ||
434 | } | ||
435 | status = gpio_direction_input(gpio + PCF_GPIO_ETH_DETECT); | ||
436 | if (status < 0) { | ||
437 | pr_err("error: can't setup GPIO%d as input\n", | ||
438 | gpio + PCF_GPIO_ETH_DETECT); | ||
439 | return status; | ||
440 | } | ||
441 | status = gpio_export(gpio + PCF_GPIO_ETH_DETECT, false); | ||
442 | if (status < 0) { | ||
443 | pr_err("error: can't export GPIO%d\n", | ||
444 | gpio + PCF_GPIO_ETH_DETECT); | ||
445 | return status; | ||
446 | } | ||
447 | status = gpio_sysfs_set_active_low(gpio + PCF_GPIO_ETH_DETECT, 1); | ||
448 | if (status < 0) { | ||
449 | pr_err("error: gpio_sysfs_set active_low(GPIO%d, 1)\n", | ||
450 | gpio + PCF_GPIO_ETH_DETECT); | ||
451 | return status; | ||
452 | } | ||
453 | |||
454 | return 0; | ||
455 | } | ||
456 | |||
457 | static int pcf8574x_0x20_teardown(struct i2c_client *client, int gpio, | ||
458 | unsigned ngpio, void *context) | ||
459 | { | ||
460 | gpio_free(gpio + PCF_GPIO_ETH_DETECT); | ||
461 | return 0; | ||
462 | } | ||
463 | |||
464 | static struct pcf857x_platform_data pcf20_pdata = { | ||
465 | .gpio_base = GS_IA18_S_PCF_GPIO_BASE0, | ||
466 | .n_latch = (1 << 4), | ||
467 | .setup = pcf8574x_0x20_setup, | ||
468 | .teardown = pcf8574x_0x20_teardown, | ||
469 | }; | ||
470 | |||
471 | static struct pcf857x_platform_data pcf22_pdata = { | ||
472 | .gpio_base = GS_IA18_S_PCF_GPIO_BASE1, | ||
473 | }; | ||
474 | |||
475 | static struct pcf857x_platform_data pcf24_pdata = { | ||
476 | .gpio_base = GS_IA18_S_PCF_GPIO_BASE2, | ||
477 | }; | ||
478 | |||
479 | static struct i2c_board_info __initdata gsia18s_i2c_devices[] = { | ||
480 | { /* U1 on the GS_IA18-CB_V3 board */ | ||
481 | I2C_BOARD_INFO("pcf8574", 0x20), | ||
482 | .platform_data = &pcf20_pdata, | ||
483 | }, | ||
484 | { /* U1 on the GS_2G_OPT1-A_V0 board (Alarm) */ | ||
485 | I2C_BOARD_INFO("pcf8574", 0x22), | ||
486 | .platform_data = &pcf22_pdata, | ||
487 | }, | ||
488 | { /* U1 on the GS_2G-OPT23-A_V0 board (Modem) */ | ||
489 | I2C_BOARD_INFO("pcf8574", 0x24), | ||
490 | .platform_data = &pcf24_pdata, | ||
491 | }, | ||
492 | { /* U161 on the GS_IA18_S-MN board */ | ||
493 | I2C_BOARD_INFO("24c1024", 0x50), | ||
494 | }, | ||
495 | { /* U162 on the GS_IA18_S-MN board */ | ||
496 | I2C_BOARD_INFO("24c01", 0x53), | ||
497 | }, | ||
498 | }; | ||
499 | |||
500 | /* | ||
501 | * Compact Flash | ||
502 | */ | ||
503 | static struct at91_cf_data __initdata gsia18s_cf1_data = { | ||
504 | .irq_pin = AT91_PIN_PA27, | ||
505 | .det_pin = AT91_PIN_PB30, | ||
506 | .vcc_pin = -EINVAL, | ||
507 | .rst_pin = AT91_PIN_PB31, | ||
508 | .chipselect = 5, | ||
509 | .flags = AT91_CF_TRUE_IDE, | ||
510 | }; | ||
511 | |||
512 | /* Power Off by RTC */ | ||
513 | static void gsia18s_power_off(void) | ||
514 | { | ||
515 | pr_notice("Power supply will be switched off automatically now or after 60 seconds without ArmDAS.\n"); | ||
516 | at91_set_gpio_output(AT91_PIN_PA25, 1); | ||
517 | /* Spin to death... */ | ||
518 | while (1) | ||
519 | ; | ||
520 | } | ||
521 | |||
522 | static int __init gsia18s_power_off_init(void) | ||
523 | { | ||
524 | pm_power_off = gsia18s_power_off; | ||
525 | return 0; | ||
526 | } | ||
527 | |||
528 | /* ---------------------------------------------------------------------------*/ | ||
529 | |||
530 | static void __init gsia18s_board_init(void) | ||
531 | { | ||
532 | /* | ||
533 | * USART0 on ttyS1 (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI). | ||
534 | * Used for Internal Analog Modem. | ||
535 | */ | ||
536 | at91_register_uart(AT91SAM9260_ID_US0, 1, | ||
537 | ATMEL_UART_CTS | ATMEL_UART_RTS | | ||
538 | ATMEL_UART_DTR | ATMEL_UART_DSR | | ||
539 | ATMEL_UART_DCD | ATMEL_UART_RI); | ||
540 | /* | ||
541 | * USART1 on ttyS2 (Rx, Tx, CTS, RTS). | ||
542 | * Used for GPS or WiFi or Data stream. | ||
543 | */ | ||
544 | at91_register_uart(AT91SAM9260_ID_US1, 2, | ||
545 | ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
546 | /* | ||
547 | * USART2 on ttyS3 (Rx, Tx, CTS, RTS). | ||
548 | * Used for External Modem. | ||
549 | */ | ||
550 | at91_register_uart(AT91SAM9260_ID_US2, 3, | ||
551 | ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
552 | /* | ||
553 | * USART3 on ttyS4 (Rx, Tx, RTS). | ||
554 | * Used for RS-485. | ||
555 | */ | ||
556 | at91_register_uart(AT91SAM9260_ID_US3, 4, ATMEL_UART_RTS); | ||
557 | |||
558 | /* | ||
559 | * USART4 on ttyS5 (Rx, Tx). | ||
560 | * Used for TRX433 Radio Module. | ||
561 | */ | ||
562 | at91_register_uart(AT91SAM9260_ID_US4, 5, 0); | ||
563 | stamp9g20_board_init(); | ||
564 | at91_add_device_usbh(&usbh_data); | ||
565 | at91_add_device_udc(&udc_data); | ||
566 | at91_add_device_eth(&macb_data); | ||
567 | gsia18s_leds_init(); | ||
568 | gsia18s_pcf_leds_init(); | ||
569 | gsia18s_add_device_buttons(); | ||
570 | at91_add_device_i2c(gsia18s_i2c_devices, | ||
571 | ARRAY_SIZE(gsia18s_i2c_devices)); | ||
572 | at91_add_device_cf(&gsia18s_cf1_data); | ||
573 | at91_add_device_spi(gsia18s_spi_devices, | ||
574 | ARRAY_SIZE(gsia18s_spi_devices)); | ||
575 | gsia18s_power_off_init(); | ||
576 | } | ||
577 | |||
578 | MACHINE_START(GSIA18S, "GS_IA18_S") | ||
579 | .init_time = at91_init_time, | ||
580 | .map_io = at91_map_io, | ||
581 | .handle_irq = at91_aic_handle_irq, | ||
582 | .init_early = gsia18s_init_early, | ||
583 | .init_irq = at91_init_irq_default, | ||
584 | .init_machine = gsia18s_board_init, | ||
585 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/board-pcontrol-g20.c b/arch/arm/mach-at91/board-pcontrol-g20.c deleted file mode 100644 index 9c26b94ce448..000000000000 --- a/arch/arm/mach-at91/board-pcontrol-g20.c +++ /dev/null | |||
@@ -1,228 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Christian Glindkamp <christian.glindkamp@taskit.de> | ||
3 | * taskit GmbH | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | /* | ||
20 | * copied and adjusted from board-stamp9g20.c | ||
21 | * by Peter Gsellmann <pgsellmann@portner-elektronik.at> | ||
22 | */ | ||
23 | |||
24 | #include <linux/mm.h> | ||
25 | #include <linux/platform_device.h> | ||
26 | #include <linux/gpio.h> | ||
27 | #include <linux/w1-gpio.h> | ||
28 | |||
29 | #include <asm/mach-types.h> | ||
30 | #include <asm/mach/arch.h> | ||
31 | |||
32 | #include <mach/at91sam9_smc.h> | ||
33 | #include <mach/hardware.h> | ||
34 | |||
35 | #include "at91_aic.h" | ||
36 | #include "board.h" | ||
37 | #include "sam9_smc.h" | ||
38 | #include "generic.h" | ||
39 | #include "stamp9g20.h" | ||
40 | #include "gpio.h" | ||
41 | |||
42 | |||
43 | static void __init pcontrol_g20_init_early(void) | ||
44 | { | ||
45 | stamp9g20_init_early(); | ||
46 | } | ||
47 | |||
48 | static struct sam9_smc_config __initdata pcontrol_smc_config[2] = { { | ||
49 | .ncs_read_setup = 16, | ||
50 | .nrd_setup = 18, | ||
51 | .ncs_write_setup = 16, | ||
52 | .nwe_setup = 18, | ||
53 | |||
54 | .ncs_read_pulse = 63, | ||
55 | .nrd_pulse = 55, | ||
56 | .ncs_write_pulse = 63, | ||
57 | .nwe_pulse = 55, | ||
58 | |||
59 | .read_cycle = 127, | ||
60 | .write_cycle = 127, | ||
61 | |||
62 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | ||
63 | | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_BAT_SELECT | ||
64 | | AT91_SMC_DBW_8 | AT91_SMC_PS_4 | ||
65 | | AT91_SMC_TDFMODE, | ||
66 | .tdf_cycles = 3, | ||
67 | }, { | ||
68 | .ncs_read_setup = 0, | ||
69 | .nrd_setup = 0, | ||
70 | .ncs_write_setup = 0, | ||
71 | .nwe_setup = 1, | ||
72 | |||
73 | .ncs_read_pulse = 8, | ||
74 | .nrd_pulse = 8, | ||
75 | .ncs_write_pulse = 5, | ||
76 | .nwe_pulse = 4, | ||
77 | |||
78 | .read_cycle = 8, | ||
79 | .write_cycle = 7, | ||
80 | |||
81 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | ||
82 | | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_BAT_SELECT | ||
83 | | AT91_SMC_DBW_16 | AT91_SMC_PS_8 | ||
84 | | AT91_SMC_TDFMODE, | ||
85 | .tdf_cycles = 1, | ||
86 | } }; | ||
87 | |||
88 | static void __init add_device_pcontrol(void) | ||
89 | { | ||
90 | /* configure chip-select 4 (IO compatible to 8051 X4 ) */ | ||
91 | sam9_smc_configure(0, 4, &pcontrol_smc_config[0]); | ||
92 | /* configure chip-select 7 (FerroRAM 256KiBx16bit MR2A16A D4 ) */ | ||
93 | sam9_smc_configure(0, 7, &pcontrol_smc_config[1]); | ||
94 | } | ||
95 | |||
96 | |||
97 | /* | ||
98 | * USB Host port | ||
99 | */ | ||
100 | static struct at91_usbh_data __initdata usbh_data = { | ||
101 | .ports = 2, | ||
102 | .vbus_pin = {-EINVAL, -EINVAL}, | ||
103 | .overcurrent_pin= {-EINVAL, -EINVAL}, | ||
104 | }; | ||
105 | |||
106 | |||
107 | /* | ||
108 | * USB Device port | ||
109 | */ | ||
110 | static struct at91_udc_data __initdata pcontrol_g20_udc_data = { | ||
111 | .vbus_pin = AT91_PIN_PA22, /* Detect +5V bus voltage */ | ||
112 | .pullup_pin = AT91_PIN_PA4, /* K-state, active low */ | ||
113 | }; | ||
114 | |||
115 | |||
116 | /* | ||
117 | * MACB Ethernet device | ||
118 | */ | ||
119 | static struct macb_platform_data __initdata macb_data = { | ||
120 | .phy_irq_pin = AT91_PIN_PA28, | ||
121 | .is_rmii = 1, | ||
122 | }; | ||
123 | |||
124 | |||
125 | /* | ||
126 | * I2C devices: eeprom and phy/switch | ||
127 | */ | ||
128 | static struct i2c_board_info __initdata pcontrol_g20_i2c_devices[] = { | ||
129 | { /* D7 address width=2, 8KiB */ | ||
130 | I2C_BOARD_INFO("24c64", 0x50) | ||
131 | }, { /* D8 address width=1, 1 byte has 32 bits! */ | ||
132 | I2C_BOARD_INFO("lan9303", 0x0a) | ||
133 | }, }; | ||
134 | |||
135 | |||
136 | /* | ||
137 | * LEDs | ||
138 | */ | ||
139 | static struct gpio_led pcontrol_g20_leds[] = { | ||
140 | { | ||
141 | .name = "LED1", /* red H5 */ | ||
142 | .gpio = AT91_PIN_PB18, | ||
143 | .active_low = 1, | ||
144 | .default_trigger = "none", /* supervisor */ | ||
145 | }, { | ||
146 | .name = "LED2", /* yellow H7 */ | ||
147 | .gpio = AT91_PIN_PB19, | ||
148 | .active_low = 1, | ||
149 | .default_trigger = "mmc0", /* SD-card activity */ | ||
150 | }, { | ||
151 | .name = "LED3", /* green H2 */ | ||
152 | .gpio = AT91_PIN_PB20, | ||
153 | .active_low = 1, | ||
154 | .default_trigger = "heartbeat", /* blinky */ | ||
155 | }, { | ||
156 | .name = "LED4", /* red H3 */ | ||
157 | .gpio = AT91_PIN_PC6, | ||
158 | .active_low = 1, | ||
159 | .default_trigger = "none", /* connection lost */ | ||
160 | }, { | ||
161 | .name = "LED5", /* yellow H6 */ | ||
162 | .gpio = AT91_PIN_PC7, | ||
163 | .active_low = 1, | ||
164 | .default_trigger = "none", /* unsent data */ | ||
165 | }, { | ||
166 | .name = "LED6", /* green H1 */ | ||
167 | .gpio = AT91_PIN_PC9, | ||
168 | .active_low = 1, | ||
169 | .default_trigger = "none", /* snafu */ | ||
170 | } | ||
171 | }; | ||
172 | |||
173 | |||
174 | /* | ||
175 | * SPI devices | ||
176 | */ | ||
177 | static struct spi_board_info pcontrol_g20_spi_devices[] = { | ||
178 | { | ||
179 | .modalias = "spidev", /* HMI port X4 */ | ||
180 | .chip_select = 1, | ||
181 | .max_speed_hz = 50 * 1000 * 1000, | ||
182 | .bus_num = 0, | ||
183 | }, { | ||
184 | .modalias = "spidev", /* piggyback A2 */ | ||
185 | .chip_select = 0, | ||
186 | .max_speed_hz = 50 * 1000 * 1000, | ||
187 | .bus_num = 1, | ||
188 | }, | ||
189 | }; | ||
190 | |||
191 | |||
192 | static void __init pcontrol_g20_board_init(void) | ||
193 | { | ||
194 | /* USART0 on ttyS1. (Rx, Tx, CTS, RTS) piggyback A2 */ | ||
195 | at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ||
196 | | ATMEL_UART_RTS); | ||
197 | |||
198 | /* USART1 on ttyS2. (Rx, Tx, CTS, RTS) isolated RS485 X5 */ | ||
199 | at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | ||
200 | | ATMEL_UART_RTS); | ||
201 | |||
202 | /* USART2 on ttyS3. (Rx, Tx) 9bit-Bus Multidrop-mode X4 */ | ||
203 | at91_register_uart(AT91SAM9260_ID_US4, 3, 0); | ||
204 | stamp9g20_board_init(); | ||
205 | at91_add_device_usbh(&usbh_data); | ||
206 | at91_add_device_eth(&macb_data); | ||
207 | at91_add_device_i2c(pcontrol_g20_i2c_devices, | ||
208 | ARRAY_SIZE(pcontrol_g20_i2c_devices)); | ||
209 | add_device_pcontrol(); | ||
210 | at91_add_device_spi(pcontrol_g20_spi_devices, | ||
211 | ARRAY_SIZE(pcontrol_g20_spi_devices)); | ||
212 | at91_add_device_udc(&pcontrol_g20_udc_data); | ||
213 | at91_gpio_leds(pcontrol_g20_leds, | ||
214 | ARRAY_SIZE(pcontrol_g20_leds)); | ||
215 | /* piggyback A2 */ | ||
216 | at91_set_gpio_output(AT91_PIN_PB31, 1); | ||
217 | } | ||
218 | |||
219 | |||
220 | MACHINE_START(PCONTROL_G20, "PControl G20") | ||
221 | /* Maintainer: pgsellmann@portner-elektronik.at */ | ||
222 | .init_time = at91_init_time, | ||
223 | .map_io = at91_map_io, | ||
224 | .handle_irq = at91_aic_handle_irq, | ||
225 | .init_early = pcontrol_g20_init_early, | ||
226 | .init_irq = at91_init_irq_default, | ||
227 | .init_machine = pcontrol_g20_board_init, | ||
228 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/board-sam9-l9260.c b/arch/arm/mach-at91/board-sam9-l9260.c deleted file mode 100644 index c2166e3a236c..000000000000 --- a/arch/arm/mach-at91/board-sam9-l9260.c +++ /dev/null | |||
@@ -1,230 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-at91/board-sam9-l9260.c | ||
3 | * | ||
4 | * Copyright (C) 2005 SAN People | ||
5 | * Copyright (C) 2006 Atmel | ||
6 | * Copyright (C) 2007 Olimex Ltd | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | #include <linux/gpio.h> | ||
25 | #include <linux/init.h> | ||
26 | #include <linux/mm.h> | ||
27 | #include <linux/module.h> | ||
28 | #include <linux/platform_device.h> | ||
29 | #include <linux/spi/spi.h> | ||
30 | |||
31 | #include <mach/hardware.h> | ||
32 | #include <asm/setup.h> | ||
33 | #include <asm/mach-types.h> | ||
34 | #include <asm/irq.h> | ||
35 | |||
36 | #include <asm/mach/arch.h> | ||
37 | #include <asm/mach/map.h> | ||
38 | #include <asm/mach/irq.h> | ||
39 | |||
40 | #include <mach/at91sam9_smc.h> | ||
41 | |||
42 | #include "at91_aic.h" | ||
43 | #include "board.h" | ||
44 | #include "sam9_smc.h" | ||
45 | #include "generic.h" | ||
46 | #include "gpio.h" | ||
47 | |||
48 | |||
49 | static void __init ek_init_early(void) | ||
50 | { | ||
51 | /* Initialize processor: 18.432 MHz crystal */ | ||
52 | at91_initialize(18432000); | ||
53 | } | ||
54 | |||
55 | /* | ||
56 | * USB Host port | ||
57 | */ | ||
58 | static struct at91_usbh_data __initdata ek_usbh_data = { | ||
59 | .ports = 2, | ||
60 | .vbus_pin = {-EINVAL, -EINVAL}, | ||
61 | .overcurrent_pin= {-EINVAL, -EINVAL}, | ||
62 | }; | ||
63 | |||
64 | /* | ||
65 | * USB Device port | ||
66 | */ | ||
67 | static struct at91_udc_data __initdata ek_udc_data = { | ||
68 | .vbus_pin = AT91_PIN_PC5, | ||
69 | .pullup_pin = -EINVAL, /* pull-up driven by UDC */ | ||
70 | }; | ||
71 | |||
72 | |||
73 | /* | ||
74 | * SPI devices. | ||
75 | */ | ||
76 | static struct spi_board_info ek_spi_devices[] = { | ||
77 | #if !IS_ENABLED(CONFIG_MMC_ATMELMCI) | ||
78 | { /* DataFlash chip */ | ||
79 | .modalias = "mtd_dataflash", | ||
80 | .chip_select = 1, | ||
81 | .max_speed_hz = 15 * 1000 * 1000, | ||
82 | .bus_num = 0, | ||
83 | }, | ||
84 | #if defined(CONFIG_MTD_AT91_DATAFLASH_CARD) | ||
85 | { /* DataFlash card */ | ||
86 | .modalias = "mtd_dataflash", | ||
87 | .chip_select = 0, | ||
88 | .max_speed_hz = 15 * 1000 * 1000, | ||
89 | .bus_num = 0, | ||
90 | }, | ||
91 | #endif | ||
92 | #endif | ||
93 | }; | ||
94 | |||
95 | |||
96 | /* | ||
97 | * MACB Ethernet device | ||
98 | */ | ||
99 | static struct macb_platform_data __initdata ek_macb_data = { | ||
100 | .phy_irq_pin = AT91_PIN_PA7, | ||
101 | .is_rmii = 0, | ||
102 | }; | ||
103 | |||
104 | |||
105 | /* | ||
106 | * NAND flash | ||
107 | */ | ||
108 | static struct mtd_partition __initdata ek_nand_partition[] = { | ||
109 | { | ||
110 | .name = "Bootloader Area", | ||
111 | .offset = 0, | ||
112 | .size = 10 * SZ_1M, | ||
113 | }, | ||
114 | { | ||
115 | .name = "User Area", | ||
116 | .offset = MTDPART_OFS_NXTBLK, | ||
117 | .size = MTDPART_SIZ_FULL, | ||
118 | }, | ||
119 | }; | ||
120 | |||
121 | static struct atmel_nand_data __initdata ek_nand_data = { | ||
122 | .ale = 21, | ||
123 | .cle = 22, | ||
124 | .det_pin = -EINVAL, | ||
125 | .rdy_pin = AT91_PIN_PC13, | ||
126 | .enable_pin = AT91_PIN_PC14, | ||
127 | .ecc_mode = NAND_ECC_SOFT, | ||
128 | .parts = ek_nand_partition, | ||
129 | .num_parts = ARRAY_SIZE(ek_nand_partition), | ||
130 | }; | ||
131 | |||
132 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | ||
133 | .ncs_read_setup = 0, | ||
134 | .nrd_setup = 1, | ||
135 | .ncs_write_setup = 0, | ||
136 | .nwe_setup = 1, | ||
137 | |||
138 | .ncs_read_pulse = 3, | ||
139 | .nrd_pulse = 3, | ||
140 | .ncs_write_pulse = 3, | ||
141 | .nwe_pulse = 3, | ||
142 | |||
143 | .read_cycle = 5, | ||
144 | .write_cycle = 5, | ||
145 | |||
146 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8, | ||
147 | .tdf_cycles = 2, | ||
148 | }; | ||
149 | |||
150 | static void __init ek_add_device_nand(void) | ||
151 | { | ||
152 | /* configure chip-select 3 (NAND) */ | ||
153 | sam9_smc_configure(0, 3, &ek_nand_smc_config); | ||
154 | |||
155 | at91_add_device_nand(&ek_nand_data); | ||
156 | } | ||
157 | |||
158 | |||
159 | /* | ||
160 | * MCI (SD/MMC) | ||
161 | */ | ||
162 | static struct mci_platform_data __initdata ek_mci0_data = { | ||
163 | .slot[1] = { | ||
164 | .bus_width = 4, | ||
165 | .detect_pin = AT91_PIN_PC8, | ||
166 | .wp_pin = AT91_PIN_PC4, | ||
167 | }, | ||
168 | }; | ||
169 | |||
170 | /* | ||
171 | * LEDs | ||
172 | */ | ||
173 | static struct gpio_led ek_leds[] = { | ||
174 | { /* D1 */ | ||
175 | .name = "led1", | ||
176 | .gpio = AT91_PIN_PA9, | ||
177 | .active_low = 1, | ||
178 | .default_trigger = "heartbeat", | ||
179 | }, | ||
180 | { /* D2 */ | ||
181 | .name = "led2", | ||
182 | .gpio = AT91_PIN_PA6, | ||
183 | .active_low = 1, | ||
184 | .default_trigger = "timer", | ||
185 | } | ||
186 | }; | ||
187 | |||
188 | static void __init ek_board_init(void) | ||
189 | { | ||
190 | at91_register_devices(); | ||
191 | |||
192 | /* Serial */ | ||
193 | /* DBGU on ttyS0. (Rx & Tx only) */ | ||
194 | at91_register_uart(0, 0, 0); | ||
195 | |||
196 | /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
197 | at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS | ||
198 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD | ||
199 | | ATMEL_UART_RI); | ||
200 | |||
201 | /* USART1 on ttyS2. (Rx, Tx, CTS, RTS) */ | ||
202 | at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
203 | at91_add_device_serial(); | ||
204 | /* USB Host */ | ||
205 | at91_add_device_usbh(&ek_usbh_data); | ||
206 | /* USB Device */ | ||
207 | at91_add_device_udc(&ek_udc_data); | ||
208 | /* SPI */ | ||
209 | at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); | ||
210 | /* NAND */ | ||
211 | ek_add_device_nand(); | ||
212 | /* Ethernet */ | ||
213 | at91_add_device_eth(&ek_macb_data); | ||
214 | /* MMC */ | ||
215 | at91_add_device_mci(0, &ek_mci0_data); | ||
216 | /* I2C */ | ||
217 | at91_add_device_i2c(NULL, 0); | ||
218 | /* LEDs */ | ||
219 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); | ||
220 | } | ||
221 | |||
222 | MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260") | ||
223 | /* Maintainer: Olimex */ | ||
224 | .init_time = at91_init_time, | ||
225 | .map_io = at91_map_io, | ||
226 | .handle_irq = at91_aic_handle_irq, | ||
227 | .init_early = ek_init_early, | ||
228 | .init_irq = at91_init_irq_default, | ||
229 | .init_machine = ek_board_init, | ||
230 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c deleted file mode 100644 index bf8a946b4cd0..000000000000 --- a/arch/arm/mach-at91/board-sam9260ek.c +++ /dev/null | |||
@@ -1,354 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-at91/board-sam9260ek.c | ||
3 | * | ||
4 | * Copyright (C) 2005 SAN People | ||
5 | * Copyright (C) 2006 Atmel | ||
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 as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | #include <linux/types.h> | ||
23 | #include <linux/gpio.h> | ||
24 | #include <linux/init.h> | ||
25 | #include <linux/mm.h> | ||
26 | #include <linux/module.h> | ||
27 | #include <linux/platform_device.h> | ||
28 | #include <linux/spi/spi.h> | ||
29 | #include <linux/spi/at73c213.h> | ||
30 | #include <linux/clk.h> | ||
31 | #include <linux/platform_data/at24.h> | ||
32 | #include <linux/gpio_keys.h> | ||
33 | #include <linux/input.h> | ||
34 | |||
35 | #include <asm/setup.h> | ||
36 | #include <asm/mach-types.h> | ||
37 | #include <asm/irq.h> | ||
38 | |||
39 | #include <asm/mach/arch.h> | ||
40 | #include <asm/mach/map.h> | ||
41 | #include <asm/mach/irq.h> | ||
42 | |||
43 | #include <mach/hardware.h> | ||
44 | #include <mach/at91sam9_smc.h> | ||
45 | #include <mach/system_rev.h> | ||
46 | |||
47 | #include "at91_aic.h" | ||
48 | #include "board.h" | ||
49 | #include "sam9_smc.h" | ||
50 | #include "generic.h" | ||
51 | #include "gpio.h" | ||
52 | |||
53 | |||
54 | static void __init ek_init_early(void) | ||
55 | { | ||
56 | /* Initialize processor: 18.432 MHz crystal */ | ||
57 | at91_initialize(18432000); | ||
58 | } | ||
59 | |||
60 | /* | ||
61 | * USB Host port | ||
62 | */ | ||
63 | static struct at91_usbh_data __initdata ek_usbh_data = { | ||
64 | .ports = 2, | ||
65 | .vbus_pin = {-EINVAL, -EINVAL}, | ||
66 | .overcurrent_pin= {-EINVAL, -EINVAL}, | ||
67 | }; | ||
68 | |||
69 | /* | ||
70 | * USB Device port | ||
71 | */ | ||
72 | static struct at91_udc_data __initdata ek_udc_data = { | ||
73 | .vbus_pin = AT91_PIN_PC5, | ||
74 | .pullup_pin = -EINVAL, /* pull-up driven by UDC */ | ||
75 | }; | ||
76 | |||
77 | |||
78 | /* | ||
79 | * Audio | ||
80 | */ | ||
81 | static struct at73c213_board_info at73c213_data = { | ||
82 | .ssc_id = 0, | ||
83 | .shortname = "AT91SAM9260-EK external DAC", | ||
84 | }; | ||
85 | |||
86 | #if defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE) | ||
87 | static void __init at73c213_set_clk(struct at73c213_board_info *info) | ||
88 | { | ||
89 | struct clk *pck0; | ||
90 | struct clk *plla; | ||
91 | |||
92 | pck0 = clk_get(NULL, "pck0"); | ||
93 | plla = clk_get(NULL, "plla"); | ||
94 | |||
95 | /* AT73C213 MCK Clock */ | ||
96 | at91_set_B_periph(AT91_PIN_PC1, 0); /* PCK0 */ | ||
97 | |||
98 | clk_set_parent(pck0, plla); | ||
99 | clk_put(plla); | ||
100 | |||
101 | info->dac_clk = pck0; | ||
102 | } | ||
103 | #else | ||
104 | static void __init at73c213_set_clk(struct at73c213_board_info *info) {} | ||
105 | #endif | ||
106 | |||
107 | /* | ||
108 | * SPI devices. | ||
109 | */ | ||
110 | static struct spi_board_info ek_spi_devices[] = { | ||
111 | #if !IS_ENABLED(CONFIG_MMC_ATMELMCI) | ||
112 | { /* DataFlash chip */ | ||
113 | .modalias = "mtd_dataflash", | ||
114 | .chip_select = 1, | ||
115 | .max_speed_hz = 15 * 1000 * 1000, | ||
116 | .bus_num = 0, | ||
117 | }, | ||
118 | #if defined(CONFIG_MTD_AT91_DATAFLASH_CARD) | ||
119 | { /* DataFlash card */ | ||
120 | .modalias = "mtd_dataflash", | ||
121 | .chip_select = 0, | ||
122 | .max_speed_hz = 15 * 1000 * 1000, | ||
123 | .bus_num = 0, | ||
124 | }, | ||
125 | #endif | ||
126 | #endif | ||
127 | #if defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE) | ||
128 | { /* AT73C213 DAC */ | ||
129 | .modalias = "at73c213", | ||
130 | .chip_select = 0, | ||
131 | .max_speed_hz = 10 * 1000 * 1000, | ||
132 | .bus_num = 1, | ||
133 | .mode = SPI_MODE_1, | ||
134 | .platform_data = &at73c213_data, | ||
135 | }, | ||
136 | #endif | ||
137 | }; | ||
138 | |||
139 | |||
140 | /* | ||
141 | * MACB Ethernet device | ||
142 | */ | ||
143 | static struct macb_platform_data __initdata ek_macb_data = { | ||
144 | .phy_irq_pin = AT91_PIN_PA7, | ||
145 | .is_rmii = 1, | ||
146 | }; | ||
147 | |||
148 | |||
149 | /* | ||
150 | * NAND flash | ||
151 | */ | ||
152 | static struct mtd_partition __initdata ek_nand_partition[] = { | ||
153 | { | ||
154 | .name = "Partition 1", | ||
155 | .offset = 0, | ||
156 | .size = SZ_256K, | ||
157 | }, | ||
158 | { | ||
159 | .name = "Partition 2", | ||
160 | .offset = MTDPART_OFS_NXTBLK, | ||
161 | .size = MTDPART_SIZ_FULL, | ||
162 | }, | ||
163 | }; | ||
164 | |||
165 | static struct atmel_nand_data __initdata ek_nand_data = { | ||
166 | .ale = 21, | ||
167 | .cle = 22, | ||
168 | .det_pin = -EINVAL, | ||
169 | .rdy_pin = AT91_PIN_PC13, | ||
170 | .enable_pin = AT91_PIN_PC14, | ||
171 | .ecc_mode = NAND_ECC_SOFT, | ||
172 | .on_flash_bbt = 1, | ||
173 | .parts = ek_nand_partition, | ||
174 | .num_parts = ARRAY_SIZE(ek_nand_partition), | ||
175 | }; | ||
176 | |||
177 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | ||
178 | .ncs_read_setup = 0, | ||
179 | .nrd_setup = 1, | ||
180 | .ncs_write_setup = 0, | ||
181 | .nwe_setup = 1, | ||
182 | |||
183 | .ncs_read_pulse = 3, | ||
184 | .nrd_pulse = 3, | ||
185 | .ncs_write_pulse = 3, | ||
186 | .nwe_pulse = 3, | ||
187 | |||
188 | .read_cycle = 5, | ||
189 | .write_cycle = 5, | ||
190 | |||
191 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE, | ||
192 | .tdf_cycles = 2, | ||
193 | }; | ||
194 | |||
195 | static void __init ek_add_device_nand(void) | ||
196 | { | ||
197 | ek_nand_data.bus_width_16 = board_have_nand_16bit(); | ||
198 | /* setup bus-width (8 or 16) */ | ||
199 | if (ek_nand_data.bus_width_16) | ||
200 | ek_nand_smc_config.mode |= AT91_SMC_DBW_16; | ||
201 | else | ||
202 | ek_nand_smc_config.mode |= AT91_SMC_DBW_8; | ||
203 | |||
204 | /* configure chip-select 3 (NAND) */ | ||
205 | sam9_smc_configure(0, 3, &ek_nand_smc_config); | ||
206 | |||
207 | at91_add_device_nand(&ek_nand_data); | ||
208 | } | ||
209 | |||
210 | |||
211 | /* | ||
212 | * MCI (SD/MMC) | ||
213 | */ | ||
214 | static struct mci_platform_data __initdata ek_mci0_data = { | ||
215 | .slot[1] = { | ||
216 | .bus_width = 4, | ||
217 | .detect_pin = -EINVAL, | ||
218 | .wp_pin = -EINVAL, | ||
219 | }, | ||
220 | }; | ||
221 | |||
222 | |||
223 | /* | ||
224 | * LEDs | ||
225 | */ | ||
226 | static struct gpio_led ek_leds[] = { | ||
227 | { /* "bottom" led, green, userled1 to be defined */ | ||
228 | .name = "ds5", | ||
229 | .gpio = AT91_PIN_PA6, | ||
230 | .active_low = 1, | ||
231 | .default_trigger = "none", | ||
232 | }, | ||
233 | { /* "power" led, yellow */ | ||
234 | .name = "ds1", | ||
235 | .gpio = AT91_PIN_PA9, | ||
236 | .default_trigger = "heartbeat", | ||
237 | } | ||
238 | }; | ||
239 | |||
240 | /* | ||
241 | * I2C devices | ||
242 | */ | ||
243 | static struct at24_platform_data at24c512 = { | ||
244 | .byte_len = SZ_512K / 8, | ||
245 | .page_size = 128, | ||
246 | .flags = AT24_FLAG_ADDR16, | ||
247 | }; | ||
248 | |||
249 | static struct i2c_board_info __initdata ek_i2c_devices[] = { | ||
250 | { | ||
251 | I2C_BOARD_INFO("24c512", 0x50), | ||
252 | .platform_data = &at24c512, | ||
253 | }, | ||
254 | /* more devices can be added using expansion connectors */ | ||
255 | }; | ||
256 | |||
257 | |||
258 | /* | ||
259 | * GPIO Buttons | ||
260 | */ | ||
261 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
262 | static struct gpio_keys_button ek_buttons[] = { | ||
263 | { | ||
264 | .gpio = AT91_PIN_PA30, | ||
265 | .code = BTN_3, | ||
266 | .desc = "Button 3", | ||
267 | .active_low = 1, | ||
268 | .wakeup = 1, | ||
269 | }, | ||
270 | { | ||
271 | .gpio = AT91_PIN_PA31, | ||
272 | .code = BTN_4, | ||
273 | .desc = "Button 4", | ||
274 | .active_low = 1, | ||
275 | .wakeup = 1, | ||
276 | } | ||
277 | }; | ||
278 | |||
279 | static struct gpio_keys_platform_data ek_button_data = { | ||
280 | .buttons = ek_buttons, | ||
281 | .nbuttons = ARRAY_SIZE(ek_buttons), | ||
282 | }; | ||
283 | |||
284 | static struct platform_device ek_button_device = { | ||
285 | .name = "gpio-keys", | ||
286 | .id = -1, | ||
287 | .num_resources = 0, | ||
288 | .dev = { | ||
289 | .platform_data = &ek_button_data, | ||
290 | } | ||
291 | }; | ||
292 | |||
293 | static void __init ek_add_device_buttons(void) | ||
294 | { | ||
295 | at91_set_gpio_input(AT91_PIN_PA30, 1); /* btn3 */ | ||
296 | at91_set_deglitch(AT91_PIN_PA30, 1); | ||
297 | at91_set_gpio_input(AT91_PIN_PA31, 1); /* btn4 */ | ||
298 | at91_set_deglitch(AT91_PIN_PA31, 1); | ||
299 | |||
300 | platform_device_register(&ek_button_device); | ||
301 | } | ||
302 | #else | ||
303 | static void __init ek_add_device_buttons(void) {} | ||
304 | #endif | ||
305 | |||
306 | |||
307 | static void __init ek_board_init(void) | ||
308 | { | ||
309 | at91_register_devices(); | ||
310 | |||
311 | /* Serial */ | ||
312 | /* DBGU on ttyS0. (Rx & Tx only) */ | ||
313 | at91_register_uart(0, 0, 0); | ||
314 | |||
315 | /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
316 | at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS | ||
317 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD | ||
318 | | ATMEL_UART_RI); | ||
319 | |||
320 | /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */ | ||
321 | at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
322 | at91_add_device_serial(); | ||
323 | /* USB Host */ | ||
324 | at91_add_device_usbh(&ek_usbh_data); | ||
325 | /* USB Device */ | ||
326 | at91_add_device_udc(&ek_udc_data); | ||
327 | /* SPI */ | ||
328 | at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); | ||
329 | /* NAND */ | ||
330 | ek_add_device_nand(); | ||
331 | /* Ethernet */ | ||
332 | at91_add_device_eth(&ek_macb_data); | ||
333 | /* MMC */ | ||
334 | at91_add_device_mci(0, &ek_mci0_data); | ||
335 | /* I2C */ | ||
336 | at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); | ||
337 | /* SSC (to AT73C213) */ | ||
338 | at73c213_set_clk(&at73c213_data); | ||
339 | at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX); | ||
340 | /* LEDs */ | ||
341 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); | ||
342 | /* Push Buttons */ | ||
343 | ek_add_device_buttons(); | ||
344 | } | ||
345 | |||
346 | MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK") | ||
347 | /* Maintainer: Atmel */ | ||
348 | .init_time = at91_init_time, | ||
349 | .map_io = at91_map_io, | ||
350 | .handle_irq = at91_aic_handle_irq, | ||
351 | .init_early = ek_init_early, | ||
352 | .init_irq = at91_init_irq_default, | ||
353 | .init_machine = ek_board_init, | ||
354 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c deleted file mode 100644 index 49f075213451..000000000000 --- a/arch/arm/mach-at91/board-sam9g20ek.c +++ /dev/null | |||
@@ -1,429 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 SAN People | ||
3 | * Copyright (C) 2008 Atmel | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #include <linux/types.h> | ||
21 | #include <linux/gpio.h> | ||
22 | #include <linux/init.h> | ||
23 | #include <linux/mm.h> | ||
24 | #include <linux/module.h> | ||
25 | #include <linux/platform_device.h> | ||
26 | #include <linux/spi/spi.h> | ||
27 | #include <linux/spi/at73c213.h> | ||
28 | #include <linux/gpio_keys.h> | ||
29 | #include <linux/input.h> | ||
30 | #include <linux/clk.h> | ||
31 | #include <linux/regulator/machine.h> | ||
32 | #include <linux/regulator/fixed.h> | ||
33 | #include <linux/regulator/consumer.h> | ||
34 | |||
35 | #include <linux/platform_data/at91_adc.h> | ||
36 | |||
37 | #include <mach/hardware.h> | ||
38 | #include <asm/setup.h> | ||
39 | #include <asm/mach-types.h> | ||
40 | #include <asm/irq.h> | ||
41 | |||
42 | #include <asm/mach/arch.h> | ||
43 | #include <asm/mach/map.h> | ||
44 | #include <asm/mach/irq.h> | ||
45 | |||
46 | #include <mach/at91sam9_smc.h> | ||
47 | #include <mach/system_rev.h> | ||
48 | |||
49 | #include "at91_aic.h" | ||
50 | #include "board.h" | ||
51 | #include "sam9_smc.h" | ||
52 | #include "generic.h" | ||
53 | #include "gpio.h" | ||
54 | |||
55 | /* | ||
56 | * board revision encoding | ||
57 | * bit 0: | ||
58 | * 0 => 1 sd/mmc slot | ||
59 | * 1 => 2 sd/mmc slots connectors (board from revision C) | ||
60 | */ | ||
61 | #define HAVE_2MMC (1 << 0) | ||
62 | static int inline ek_have_2mmc(void) | ||
63 | { | ||
64 | return machine_is_at91sam9g20ek_2mmc() || (system_rev & HAVE_2MMC); | ||
65 | } | ||
66 | |||
67 | |||
68 | static void __init ek_init_early(void) | ||
69 | { | ||
70 | /* Initialize processor: 18.432 MHz crystal */ | ||
71 | at91_initialize(18432000); | ||
72 | } | ||
73 | |||
74 | /* | ||
75 | * USB Host port | ||
76 | */ | ||
77 | static struct at91_usbh_data __initdata ek_usbh_data = { | ||
78 | .ports = 2, | ||
79 | .vbus_pin = {-EINVAL, -EINVAL}, | ||
80 | .overcurrent_pin= {-EINVAL, -EINVAL}, | ||
81 | }; | ||
82 | |||
83 | /* | ||
84 | * USB Device port | ||
85 | */ | ||
86 | static struct at91_udc_data __initdata ek_udc_data = { | ||
87 | .vbus_pin = AT91_PIN_PC5, | ||
88 | .pullup_pin = -EINVAL, /* pull-up driven by UDC */ | ||
89 | }; | ||
90 | |||
91 | |||
92 | /* | ||
93 | * SPI devices. | ||
94 | */ | ||
95 | static struct spi_board_info ek_spi_devices[] = { | ||
96 | #if !IS_ENABLED(CONFIG_MMC_ATMELMCI) | ||
97 | { /* DataFlash chip */ | ||
98 | .modalias = "mtd_dataflash", | ||
99 | .chip_select = 1, | ||
100 | .max_speed_hz = 15 * 1000 * 1000, | ||
101 | .bus_num = 0, | ||
102 | }, | ||
103 | #if defined(CONFIG_MTD_AT91_DATAFLASH_CARD) | ||
104 | { /* DataFlash card */ | ||
105 | .modalias = "mtd_dataflash", | ||
106 | .chip_select = 0, | ||
107 | .max_speed_hz = 15 * 1000 * 1000, | ||
108 | .bus_num = 0, | ||
109 | }, | ||
110 | #endif | ||
111 | #endif | ||
112 | }; | ||
113 | |||
114 | |||
115 | /* | ||
116 | * MACB Ethernet device | ||
117 | */ | ||
118 | static struct macb_platform_data __initdata ek_macb_data = { | ||
119 | .phy_irq_pin = AT91_PIN_PA7, | ||
120 | .is_rmii = 1, | ||
121 | }; | ||
122 | |||
123 | static void __init ek_add_device_macb(void) | ||
124 | { | ||
125 | if (ek_have_2mmc()) | ||
126 | ek_macb_data.phy_irq_pin = AT91_PIN_PB0; | ||
127 | |||
128 | at91_add_device_eth(&ek_macb_data); | ||
129 | } | ||
130 | |||
131 | /* | ||
132 | * NAND flash | ||
133 | */ | ||
134 | static struct mtd_partition __initdata ek_nand_partition[] = { | ||
135 | { | ||
136 | .name = "Bootstrap", | ||
137 | .offset = 0, | ||
138 | .size = 4 * SZ_1M, | ||
139 | }, | ||
140 | { | ||
141 | .name = "Partition 1", | ||
142 | .offset = MTDPART_OFS_NXTBLK, | ||
143 | .size = 60 * SZ_1M, | ||
144 | }, | ||
145 | { | ||
146 | .name = "Partition 2", | ||
147 | .offset = MTDPART_OFS_NXTBLK, | ||
148 | .size = MTDPART_SIZ_FULL, | ||
149 | }, | ||
150 | }; | ||
151 | |||
152 | /* det_pin is not connected */ | ||
153 | static struct atmel_nand_data __initdata ek_nand_data = { | ||
154 | .ale = 21, | ||
155 | .cle = 22, | ||
156 | .rdy_pin = AT91_PIN_PC13, | ||
157 | .enable_pin = AT91_PIN_PC14, | ||
158 | .det_pin = -EINVAL, | ||
159 | .ecc_mode = NAND_ECC_SOFT, | ||
160 | .on_flash_bbt = 1, | ||
161 | .parts = ek_nand_partition, | ||
162 | .num_parts = ARRAY_SIZE(ek_nand_partition), | ||
163 | }; | ||
164 | |||
165 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | ||
166 | .ncs_read_setup = 0, | ||
167 | .nrd_setup = 2, | ||
168 | .ncs_write_setup = 0, | ||
169 | .nwe_setup = 2, | ||
170 | |||
171 | .ncs_read_pulse = 4, | ||
172 | .nrd_pulse = 4, | ||
173 | .ncs_write_pulse = 4, | ||
174 | .nwe_pulse = 4, | ||
175 | |||
176 | .read_cycle = 7, | ||
177 | .write_cycle = 7, | ||
178 | |||
179 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE, | ||
180 | .tdf_cycles = 3, | ||
181 | }; | ||
182 | |||
183 | static void __init ek_add_device_nand(void) | ||
184 | { | ||
185 | ek_nand_data.bus_width_16 = board_have_nand_16bit(); | ||
186 | /* setup bus-width (8 or 16) */ | ||
187 | if (ek_nand_data.bus_width_16) | ||
188 | ek_nand_smc_config.mode |= AT91_SMC_DBW_16; | ||
189 | else | ||
190 | ek_nand_smc_config.mode |= AT91_SMC_DBW_8; | ||
191 | |||
192 | /* configure chip-select 3 (NAND) */ | ||
193 | sam9_smc_configure(0, 3, &ek_nand_smc_config); | ||
194 | |||
195 | at91_add_device_nand(&ek_nand_data); | ||
196 | } | ||
197 | |||
198 | |||
199 | /* | ||
200 | * MCI (SD/MMC) | ||
201 | * wp_pin and vcc_pin are not connected | ||
202 | */ | ||
203 | static struct mci_platform_data __initdata ek_mmc_data = { | ||
204 | .slot[1] = { | ||
205 | .bus_width = 4, | ||
206 | .detect_pin = AT91_PIN_PC9, | ||
207 | .wp_pin = -EINVAL, | ||
208 | }, | ||
209 | |||
210 | }; | ||
211 | |||
212 | static void __init ek_add_device_mmc(void) | ||
213 | { | ||
214 | if (ek_have_2mmc()) { | ||
215 | ek_mmc_data.slot[0].bus_width = 4; | ||
216 | ek_mmc_data.slot[0].detect_pin = AT91_PIN_PC2; | ||
217 | ek_mmc_data.slot[0].wp_pin = -1; | ||
218 | } | ||
219 | at91_add_device_mci(0, &ek_mmc_data); | ||
220 | } | ||
221 | |||
222 | /* | ||
223 | * LEDs | ||
224 | */ | ||
225 | static struct gpio_led ek_leds[] = { | ||
226 | { /* "bottom" led, green, userled1 to be defined */ | ||
227 | .name = "ds5", | ||
228 | .gpio = AT91_PIN_PA6, | ||
229 | .active_low = 1, | ||
230 | .default_trigger = "none", | ||
231 | }, | ||
232 | { /* "power" led, yellow */ | ||
233 | .name = "ds1", | ||
234 | .gpio = AT91_PIN_PA9, | ||
235 | .default_trigger = "heartbeat", | ||
236 | } | ||
237 | }; | ||
238 | |||
239 | static void __init ek_add_device_gpio_leds(void) | ||
240 | { | ||
241 | if (ek_have_2mmc()) { | ||
242 | ek_leds[0].gpio = AT91_PIN_PB8; | ||
243 | ek_leds[1].gpio = AT91_PIN_PB9; | ||
244 | } | ||
245 | |||
246 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); | ||
247 | } | ||
248 | |||
249 | /* | ||
250 | * GPIO Buttons | ||
251 | */ | ||
252 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
253 | static struct gpio_keys_button ek_buttons[] = { | ||
254 | { | ||
255 | .gpio = AT91_PIN_PA30, | ||
256 | .code = BTN_3, | ||
257 | .desc = "Button 3", | ||
258 | .active_low = 1, | ||
259 | .wakeup = 1, | ||
260 | }, | ||
261 | { | ||
262 | .gpio = AT91_PIN_PA31, | ||
263 | .code = BTN_4, | ||
264 | .desc = "Button 4", | ||
265 | .active_low = 1, | ||
266 | .wakeup = 1, | ||
267 | } | ||
268 | }; | ||
269 | |||
270 | static struct gpio_keys_platform_data ek_button_data = { | ||
271 | .buttons = ek_buttons, | ||
272 | .nbuttons = ARRAY_SIZE(ek_buttons), | ||
273 | }; | ||
274 | |||
275 | static struct platform_device ek_button_device = { | ||
276 | .name = "gpio-keys", | ||
277 | .id = -1, | ||
278 | .num_resources = 0, | ||
279 | .dev = { | ||
280 | .platform_data = &ek_button_data, | ||
281 | } | ||
282 | }; | ||
283 | |||
284 | static void __init ek_add_device_buttons(void) | ||
285 | { | ||
286 | at91_set_gpio_input(AT91_PIN_PA30, 1); /* btn3 */ | ||
287 | at91_set_deglitch(AT91_PIN_PA30, 1); | ||
288 | at91_set_gpio_input(AT91_PIN_PA31, 1); /* btn4 */ | ||
289 | at91_set_deglitch(AT91_PIN_PA31, 1); | ||
290 | |||
291 | platform_device_register(&ek_button_device); | ||
292 | } | ||
293 | #else | ||
294 | static void __init ek_add_device_buttons(void) {} | ||
295 | #endif | ||
296 | |||
297 | /* | ||
298 | * ADCs | ||
299 | */ | ||
300 | |||
301 | static struct at91_adc_data ek_adc_data = { | ||
302 | .channels_used = BIT(0) | BIT(1) | BIT(2) | BIT(3), | ||
303 | .use_external_triggers = true, | ||
304 | .vref = 3300, | ||
305 | }; | ||
306 | |||
307 | #if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE) | ||
308 | static struct regulator_consumer_supply ek_audio_consumer_supplies[] = { | ||
309 | REGULATOR_SUPPLY("AVDD", "0-001b"), | ||
310 | REGULATOR_SUPPLY("HPVDD", "0-001b"), | ||
311 | REGULATOR_SUPPLY("DBVDD", "0-001b"), | ||
312 | REGULATOR_SUPPLY("DCVDD", "0-001b"), | ||
313 | }; | ||
314 | |||
315 | static struct regulator_init_data ek_avdd_reg_init_data = { | ||
316 | .constraints = { | ||
317 | .name = "3V3", | ||
318 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
319 | }, | ||
320 | .consumer_supplies = ek_audio_consumer_supplies, | ||
321 | .num_consumer_supplies = ARRAY_SIZE(ek_audio_consumer_supplies), | ||
322 | }; | ||
323 | |||
324 | static struct fixed_voltage_config ek_vdd_pdata = { | ||
325 | .supply_name = "board-3V3", | ||
326 | .microvolts = 3300000, | ||
327 | .gpio = -EINVAL, | ||
328 | .enabled_at_boot = 0, | ||
329 | .init_data = &ek_avdd_reg_init_data, | ||
330 | }; | ||
331 | static struct platform_device ek_voltage_regulator = { | ||
332 | .name = "reg-fixed-voltage", | ||
333 | .id = -1, | ||
334 | .num_resources = 0, | ||
335 | .dev = { | ||
336 | .platform_data = &ek_vdd_pdata, | ||
337 | }, | ||
338 | }; | ||
339 | static void __init ek_add_regulators(void) | ||
340 | { | ||
341 | platform_device_register(&ek_voltage_regulator); | ||
342 | } | ||
343 | #else | ||
344 | static void __init ek_add_regulators(void) {} | ||
345 | #endif | ||
346 | |||
347 | |||
348 | static struct i2c_board_info __initdata ek_i2c_devices[] = { | ||
349 | { | ||
350 | I2C_BOARD_INFO("24c512", 0x50) | ||
351 | }, | ||
352 | { | ||
353 | I2C_BOARD_INFO("wm8731", 0x1b) | ||
354 | }, | ||
355 | }; | ||
356 | |||
357 | static struct platform_device sam9g20ek_audio_device = { | ||
358 | .name = "at91sam9g20ek-audio", | ||
359 | .id = -1, | ||
360 | }; | ||
361 | |||
362 | static void __init ek_add_device_audio(void) | ||
363 | { | ||
364 | platform_device_register(&sam9g20ek_audio_device); | ||
365 | } | ||
366 | |||
367 | |||
368 | static void __init ek_board_init(void) | ||
369 | { | ||
370 | /* Serial */ | ||
371 | /* DBGU on ttyS0. (Rx & Tx only) */ | ||
372 | at91_register_uart(0, 0, 0); | ||
373 | |||
374 | /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
375 | at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS | ||
376 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD | ||
377 | | ATMEL_UART_RI); | ||
378 | |||
379 | /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */ | ||
380 | at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
381 | at91_add_device_serial(); | ||
382 | /* USB Host */ | ||
383 | at91_add_device_usbh(&ek_usbh_data); | ||
384 | /* USB Device */ | ||
385 | at91_add_device_udc(&ek_udc_data); | ||
386 | /* SPI */ | ||
387 | at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); | ||
388 | /* NAND */ | ||
389 | ek_add_device_nand(); | ||
390 | /* Ethernet */ | ||
391 | ek_add_device_macb(); | ||
392 | /* Regulators */ | ||
393 | ek_add_regulators(); | ||
394 | /* MMC */ | ||
395 | ek_add_device_mmc(); | ||
396 | /* I2C */ | ||
397 | at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); | ||
398 | /* LEDs */ | ||
399 | ek_add_device_gpio_leds(); | ||
400 | /* Push Buttons */ | ||
401 | ek_add_device_buttons(); | ||
402 | /* ADCs */ | ||
403 | at91_add_device_adc(&ek_adc_data); | ||
404 | /* PCK0 provides MCLK to the WM8731 */ | ||
405 | at91_set_B_periph(AT91_PIN_PC1, 0); | ||
406 | /* SSC (for WM8731) */ | ||
407 | at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX); | ||
408 | ek_add_device_audio(); | ||
409 | } | ||
410 | |||
411 | MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK") | ||
412 | /* Maintainer: Atmel */ | ||
413 | .init_time = at91_init_time, | ||
414 | .map_io = at91_map_io, | ||
415 | .handle_irq = at91_aic_handle_irq, | ||
416 | .init_early = ek_init_early, | ||
417 | .init_irq = at91_init_irq_default, | ||
418 | .init_machine = ek_board_init, | ||
419 | MACHINE_END | ||
420 | |||
421 | MACHINE_START(AT91SAM9G20EK_2MMC, "Atmel AT91SAM9G20-EK 2 MMC Slot Mod") | ||
422 | /* Maintainer: Atmel */ | ||
423 | .init_time = at91_init_time, | ||
424 | .map_io = at91_map_io, | ||
425 | .handle_irq = at91_aic_handle_irq, | ||
426 | .init_early = ek_init_early, | ||
427 | .init_irq = at91_init_irq_default, | ||
428 | .init_machine = ek_board_init, | ||
429 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/board-snapper9260.c b/arch/arm/mach-at91/board-snapper9260.c deleted file mode 100644 index b4aff840a1a0..000000000000 --- a/arch/arm/mach-at91/board-snapper9260.c +++ /dev/null | |||
@@ -1,191 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-at91/board-snapper9260.c | ||
3 | * | ||
4 | * Copyright (C) 2010 Bluewater System Ltd | ||
5 | * | ||
6 | * Author: Andre Renaud <andre@bluewatersys.com> | ||
7 | * Author: Ryan Mallon | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #include <linux/init.h> | ||
26 | #include <linux/gpio.h> | ||
27 | #include <linux/platform_device.h> | ||
28 | #include <linux/spi/spi.h> | ||
29 | #include <linux/platform_data/pca953x.h> | ||
30 | |||
31 | #include <asm/mach-types.h> | ||
32 | #include <asm/mach/arch.h> | ||
33 | |||
34 | #include <mach/hardware.h> | ||
35 | #include <mach/at91sam9_smc.h> | ||
36 | |||
37 | #include "at91_aic.h" | ||
38 | #include "board.h" | ||
39 | #include "sam9_smc.h" | ||
40 | #include "generic.h" | ||
41 | #include "gpio.h" | ||
42 | |||
43 | #define SNAPPER9260_IO_EXP_GPIO(x) (NR_BUILTIN_GPIO + (x)) | ||
44 | |||
45 | static void __init snapper9260_init_early(void) | ||
46 | { | ||
47 | at91_initialize(18432000); | ||
48 | } | ||
49 | |||
50 | static struct at91_usbh_data __initdata snapper9260_usbh_data = { | ||
51 | .ports = 2, | ||
52 | .vbus_pin = {-EINVAL, -EINVAL}, | ||
53 | .overcurrent_pin= {-EINVAL, -EINVAL}, | ||
54 | }; | ||
55 | |||
56 | static struct at91_udc_data __initdata snapper9260_udc_data = { | ||
57 | .vbus_pin = SNAPPER9260_IO_EXP_GPIO(5), | ||
58 | .vbus_active_low = 1, | ||
59 | .vbus_polled = 1, | ||
60 | .pullup_pin = -EINVAL, | ||
61 | }; | ||
62 | |||
63 | static struct macb_platform_data snapper9260_macb_data = { | ||
64 | .phy_irq_pin = -EINVAL, | ||
65 | .is_rmii = 1, | ||
66 | }; | ||
67 | |||
68 | static struct mtd_partition __initdata snapper9260_nand_partitions[] = { | ||
69 | { | ||
70 | .name = "Preboot", | ||
71 | .offset = 0, | ||
72 | .size = SZ_128K, | ||
73 | }, | ||
74 | { | ||
75 | .name = "Bootloader", | ||
76 | .offset = MTDPART_OFS_APPEND, | ||
77 | .size = SZ_256K, | ||
78 | }, | ||
79 | { | ||
80 | .name = "Environment", | ||
81 | .offset = MTDPART_OFS_APPEND, | ||
82 | .size = SZ_128K, | ||
83 | }, | ||
84 | { | ||
85 | .name = "Kernel", | ||
86 | .offset = MTDPART_OFS_APPEND, | ||
87 | .size = SZ_4M, | ||
88 | }, | ||
89 | { | ||
90 | .name = "Filesystem", | ||
91 | .offset = MTDPART_OFS_APPEND, | ||
92 | .size = MTDPART_SIZ_FULL, | ||
93 | }, | ||
94 | }; | ||
95 | |||
96 | static struct atmel_nand_data __initdata snapper9260_nand_data = { | ||
97 | .ale = 21, | ||
98 | .cle = 22, | ||
99 | .rdy_pin = AT91_PIN_PC13, | ||
100 | .parts = snapper9260_nand_partitions, | ||
101 | .num_parts = ARRAY_SIZE(snapper9260_nand_partitions), | ||
102 | .bus_width_16 = 0, | ||
103 | .enable_pin = -EINVAL, | ||
104 | .det_pin = -EINVAL, | ||
105 | .ecc_mode = NAND_ECC_SOFT, | ||
106 | }; | ||
107 | |||
108 | static struct sam9_smc_config __initdata snapper9260_nand_smc_config = { | ||
109 | .ncs_read_setup = 0, | ||
110 | .nrd_setup = 0, | ||
111 | .ncs_write_setup = 0, | ||
112 | .nwe_setup = 0, | ||
113 | |||
114 | .ncs_read_pulse = 5, | ||
115 | .nrd_pulse = 2, | ||
116 | .ncs_write_pulse = 5, | ||
117 | .nwe_pulse = 2, | ||
118 | |||
119 | .read_cycle = 7, | ||
120 | .write_cycle = 7, | ||
121 | |||
122 | .mode = (AT91_SMC_READMODE | AT91_SMC_WRITEMODE | | ||
123 | AT91_SMC_EXNWMODE_DISABLE), | ||
124 | .tdf_cycles = 1, | ||
125 | }; | ||
126 | |||
127 | static struct pca953x_platform_data snapper9260_io_expander_data = { | ||
128 | .gpio_base = SNAPPER9260_IO_EXP_GPIO(0), | ||
129 | }; | ||
130 | |||
131 | static struct i2c_board_info __initdata snapper9260_i2c_devices[] = { | ||
132 | { | ||
133 | /* IO expander */ | ||
134 | I2C_BOARD_INFO("max7312", 0x28), | ||
135 | .platform_data = &snapper9260_io_expander_data, | ||
136 | }, | ||
137 | { | ||
138 | /* Audio codec */ | ||
139 | I2C_BOARD_INFO("tlv320aic23", 0x1a), | ||
140 | }, | ||
141 | }; | ||
142 | |||
143 | static struct i2c_board_info __initdata snapper9260_i2c_isl1208 = { | ||
144 | /* RTC */ | ||
145 | I2C_BOARD_INFO("isl1208", 0x6f), | ||
146 | }; | ||
147 | |||
148 | static void __init snapper9260_add_device_nand(void) | ||
149 | { | ||
150 | at91_set_A_periph(AT91_PIN_PC14, 0); | ||
151 | sam9_smc_configure(0, 3, &snapper9260_nand_smc_config); | ||
152 | at91_add_device_nand(&snapper9260_nand_data); | ||
153 | } | ||
154 | |||
155 | static void __init snapper9260_board_init(void) | ||
156 | { | ||
157 | at91_register_devices(); | ||
158 | |||
159 | at91_add_device_i2c(snapper9260_i2c_devices, | ||
160 | ARRAY_SIZE(snapper9260_i2c_devices)); | ||
161 | |||
162 | snapper9260_i2c_isl1208.irq = gpio_to_irq(AT91_PIN_PA31); | ||
163 | i2c_register_board_info(0, &snapper9260_i2c_isl1208, 1); | ||
164 | |||
165 | /* Debug on ttyS0 */ | ||
166 | at91_register_uart(0, 0, 0); | ||
167 | |||
168 | at91_register_uart(AT91SAM9260_ID_US0, 1, | ||
169 | ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
170 | at91_register_uart(AT91SAM9260_ID_US1, 2, | ||
171 | ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
172 | at91_register_uart(AT91SAM9260_ID_US2, 3, 0); | ||
173 | at91_add_device_serial(); | ||
174 | at91_add_device_usbh(&snapper9260_usbh_data); | ||
175 | at91_add_device_udc(&snapper9260_udc_data); | ||
176 | at91_add_device_eth(&snapper9260_macb_data); | ||
177 | at91_add_device_ssc(AT91SAM9260_ID_SSC, (ATMEL_SSC_TF | ATMEL_SSC_TK | | ||
178 | ATMEL_SSC_TD | ATMEL_SSC_RD)); | ||
179 | snapper9260_add_device_nand(); | ||
180 | } | ||
181 | |||
182 | MACHINE_START(SNAPPER_9260, "Bluewater Systems Snapper 9260/9G20 module") | ||
183 | .init_time = at91_init_time, | ||
184 | .map_io = at91_map_io, | ||
185 | .handle_irq = at91_aic_handle_irq, | ||
186 | .init_early = snapper9260_init_early, | ||
187 | .init_irq = at91_init_irq_default, | ||
188 | .init_machine = snapper9260_board_init, | ||
189 | MACHINE_END | ||
190 | |||
191 | |||
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c deleted file mode 100644 index e825641a1dee..000000000000 --- a/arch/arm/mach-at91/board-stamp9g20.c +++ /dev/null | |||
@@ -1,294 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Christian Glindkamp <christian.glindkamp@taskit.de> | ||
3 | * taskit GmbH | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #include <linux/mm.h> | ||
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/gpio.h> | ||
23 | #include <linux/w1-gpio.h> | ||
24 | |||
25 | #include <asm/mach-types.h> | ||
26 | #include <asm/mach/arch.h> | ||
27 | |||
28 | #include <mach/at91sam9_smc.h> | ||
29 | #include <mach/hardware.h> | ||
30 | |||
31 | #include "at91_aic.h" | ||
32 | #include "board.h" | ||
33 | #include "sam9_smc.h" | ||
34 | #include "generic.h" | ||
35 | #include "gpio.h" | ||
36 | |||
37 | |||
38 | void __init stamp9g20_init_early(void) | ||
39 | { | ||
40 | /* Initialize processor: 18.432 MHz crystal */ | ||
41 | at91_initialize(18432000); | ||
42 | } | ||
43 | |||
44 | /* | ||
45 | * NAND flash | ||
46 | */ | ||
47 | static struct atmel_nand_data __initdata nand_data = { | ||
48 | .ale = 21, | ||
49 | .cle = 22, | ||
50 | .rdy_pin = AT91_PIN_PC13, | ||
51 | .enable_pin = AT91_PIN_PC14, | ||
52 | .bus_width_16 = 0, | ||
53 | .det_pin = -EINVAL, | ||
54 | .ecc_mode = NAND_ECC_SOFT, | ||
55 | }; | ||
56 | |||
57 | static struct sam9_smc_config __initdata nand_smc_config = { | ||
58 | .ncs_read_setup = 0, | ||
59 | .nrd_setup = 2, | ||
60 | .ncs_write_setup = 0, | ||
61 | .nwe_setup = 2, | ||
62 | |||
63 | .ncs_read_pulse = 4, | ||
64 | .nrd_pulse = 4, | ||
65 | .ncs_write_pulse = 4, | ||
66 | .nwe_pulse = 4, | ||
67 | |||
68 | .read_cycle = 7, | ||
69 | .write_cycle = 7, | ||
70 | |||
71 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8, | ||
72 | .tdf_cycles = 3, | ||
73 | }; | ||
74 | |||
75 | static void __init add_device_nand(void) | ||
76 | { | ||
77 | /* configure chip-select 3 (NAND) */ | ||
78 | sam9_smc_configure(0, 3, &nand_smc_config); | ||
79 | |||
80 | at91_add_device_nand(&nand_data); | ||
81 | } | ||
82 | |||
83 | |||
84 | /* | ||
85 | * MCI (SD/MMC) | ||
86 | * det_pin, wp_pin and vcc_pin are not connected | ||
87 | */ | ||
88 | static struct mci_platform_data __initdata mmc_data = { | ||
89 | .slot[0] = { | ||
90 | .bus_width = 4, | ||
91 | .detect_pin = -1, | ||
92 | .wp_pin = -1, | ||
93 | }, | ||
94 | }; | ||
95 | |||
96 | |||
97 | /* | ||
98 | * USB Host port | ||
99 | */ | ||
100 | static struct at91_usbh_data __initdata usbh_data = { | ||
101 | .ports = 2, | ||
102 | .vbus_pin = {-EINVAL, -EINVAL}, | ||
103 | .overcurrent_pin= {-EINVAL, -EINVAL}, | ||
104 | }; | ||
105 | |||
106 | |||
107 | /* | ||
108 | * USB Device port | ||
109 | */ | ||
110 | static struct at91_udc_data __initdata portuxg20_udc_data = { | ||
111 | .vbus_pin = AT91_PIN_PC7, | ||
112 | .pullup_pin = -EINVAL, /* pull-up driven by UDC */ | ||
113 | }; | ||
114 | |||
115 | static struct at91_udc_data __initdata stamp9g20evb_udc_data = { | ||
116 | .vbus_pin = AT91_PIN_PA22, | ||
117 | .pullup_pin = -EINVAL, /* pull-up driven by UDC */ | ||
118 | }; | ||
119 | |||
120 | |||
121 | /* | ||
122 | * MACB Ethernet device | ||
123 | */ | ||
124 | static struct macb_platform_data __initdata macb_data = { | ||
125 | .phy_irq_pin = AT91_PIN_PA28, | ||
126 | .is_rmii = 1, | ||
127 | }; | ||
128 | |||
129 | |||
130 | /* | ||
131 | * LEDs | ||
132 | */ | ||
133 | static struct gpio_led portuxg20_leds[] = { | ||
134 | { | ||
135 | .name = "LED2", | ||
136 | .gpio = AT91_PIN_PC5, | ||
137 | .default_trigger = "none", | ||
138 | }, { | ||
139 | .name = "LED3", | ||
140 | .gpio = AT91_PIN_PC4, | ||
141 | .default_trigger = "none", | ||
142 | }, { | ||
143 | .name = "LED4", | ||
144 | .gpio = AT91_PIN_PC10, | ||
145 | .default_trigger = "heartbeat", | ||
146 | } | ||
147 | }; | ||
148 | |||
149 | static struct gpio_led stamp9g20evb_leds[] = { | ||
150 | { | ||
151 | .name = "D8", | ||
152 | .gpio = AT91_PIN_PB18, | ||
153 | .active_low = 1, | ||
154 | .default_trigger = "none", | ||
155 | }, { | ||
156 | .name = "D9", | ||
157 | .gpio = AT91_PIN_PB19, | ||
158 | .active_low = 1, | ||
159 | .default_trigger = "none", | ||
160 | }, { | ||
161 | .name = "D10", | ||
162 | .gpio = AT91_PIN_PB20, | ||
163 | .active_low = 1, | ||
164 | .default_trigger = "heartbeat", | ||
165 | } | ||
166 | }; | ||
167 | |||
168 | |||
169 | /* | ||
170 | * SPI devices | ||
171 | */ | ||
172 | static struct spi_board_info portuxg20_spi_devices[] = { | ||
173 | { | ||
174 | .modalias = "spidev", | ||
175 | .chip_select = 0, | ||
176 | .max_speed_hz = 1 * 1000 * 1000, | ||
177 | .bus_num = 0, | ||
178 | }, { | ||
179 | .modalias = "spidev", | ||
180 | .chip_select = 0, | ||
181 | .max_speed_hz = 1 * 1000 * 1000, | ||
182 | .bus_num = 1, | ||
183 | }, | ||
184 | }; | ||
185 | |||
186 | |||
187 | /* | ||
188 | * Dallas 1-Wire | ||
189 | */ | ||
190 | static struct w1_gpio_platform_data w1_gpio_pdata = { | ||
191 | .pin = AT91_PIN_PA29, | ||
192 | .is_open_drain = 1, | ||
193 | .ext_pullup_enable_pin = -EINVAL, | ||
194 | }; | ||
195 | |||
196 | static struct platform_device w1_device = { | ||
197 | .name = "w1-gpio", | ||
198 | .id = -1, | ||
199 | .dev.platform_data = &w1_gpio_pdata, | ||
200 | }; | ||
201 | |||
202 | void add_w1(void) | ||
203 | { | ||
204 | at91_set_GPIO_periph(w1_gpio_pdata.pin, 1); | ||
205 | at91_set_multi_drive(w1_gpio_pdata.pin, 1); | ||
206 | platform_device_register(&w1_device); | ||
207 | } | ||
208 | |||
209 | |||
210 | void __init stamp9g20_board_init(void) | ||
211 | { | ||
212 | /* Serial */ | ||
213 | /* DGBU on ttyS0. (Rx & Tx only) */ | ||
214 | at91_register_uart(0, 0, 0); | ||
215 | at91_add_device_serial(); | ||
216 | /* NAND */ | ||
217 | add_device_nand(); | ||
218 | /* MMC */ | ||
219 | at91_add_device_mci(0, &mmc_data); | ||
220 | /* W1 */ | ||
221 | add_w1(); | ||
222 | } | ||
223 | |||
224 | static void __init portuxg20_board_init(void) | ||
225 | { | ||
226 | /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
227 | at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS | ||
228 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ||
229 | | ATMEL_UART_DCD | ATMEL_UART_RI); | ||
230 | |||
231 | /* USART1 on ttyS2. (Rx, Tx, CTS, RTS) */ | ||
232 | at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
233 | |||
234 | /* USART2 on ttyS3. (Rx, Tx, CTS, RTS) */ | ||
235 | at91_register_uart(AT91SAM9260_ID_US2, 3, ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
236 | |||
237 | /* USART4 on ttyS5. (Rx, Tx only) */ | ||
238 | at91_register_uart(AT91SAM9260_ID_US4, 5, 0); | ||
239 | |||
240 | /* USART5 on ttyS6. (Rx, Tx only) */ | ||
241 | at91_register_uart(AT91SAM9260_ID_US5, 6, 0); | ||
242 | stamp9g20_board_init(); | ||
243 | /* USB Host */ | ||
244 | at91_add_device_usbh(&usbh_data); | ||
245 | /* USB Device */ | ||
246 | at91_add_device_udc(&portuxg20_udc_data); | ||
247 | /* Ethernet */ | ||
248 | at91_add_device_eth(&macb_data); | ||
249 | /* I2C */ | ||
250 | at91_add_device_i2c(NULL, 0); | ||
251 | /* SPI */ | ||
252 | at91_add_device_spi(portuxg20_spi_devices, ARRAY_SIZE(portuxg20_spi_devices)); | ||
253 | /* LEDs */ | ||
254 | at91_gpio_leds(portuxg20_leds, ARRAY_SIZE(portuxg20_leds)); | ||
255 | } | ||
256 | |||
257 | static void __init stamp9g20evb_board_init(void) | ||
258 | { | ||
259 | /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
260 | at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS | ||
261 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ||
262 | | ATMEL_UART_DCD | ATMEL_UART_RI); | ||
263 | stamp9g20_board_init(); | ||
264 | /* USB Host */ | ||
265 | at91_add_device_usbh(&usbh_data); | ||
266 | /* USB Device */ | ||
267 | at91_add_device_udc(&stamp9g20evb_udc_data); | ||
268 | /* Ethernet */ | ||
269 | at91_add_device_eth(&macb_data); | ||
270 | /* I2C */ | ||
271 | at91_add_device_i2c(NULL, 0); | ||
272 | /* LEDs */ | ||
273 | at91_gpio_leds(stamp9g20evb_leds, ARRAY_SIZE(stamp9g20evb_leds)); | ||
274 | } | ||
275 | |||
276 | MACHINE_START(PORTUXG20, "taskit PortuxG20") | ||
277 | /* Maintainer: taskit GmbH */ | ||
278 | .init_time = at91_init_time, | ||
279 | .map_io = at91_map_io, | ||
280 | .handle_irq = at91_aic_handle_irq, | ||
281 | .init_early = stamp9g20_init_early, | ||
282 | .init_irq = at91_init_irq_default, | ||
283 | .init_machine = portuxg20_board_init, | ||
284 | MACHINE_END | ||
285 | |||
286 | MACHINE_START(STAMP9G20, "taskit Stamp9G20") | ||
287 | /* Maintainer: taskit GmbH */ | ||
288 | .init_time = at91_init_time, | ||
289 | .map_io = at91_map_io, | ||
290 | .handle_irq = at91_aic_handle_irq, | ||
291 | .init_early = stamp9g20_init_early, | ||
292 | .init_irq = at91_init_irq_default, | ||
293 | .init_machine = stamp9g20evb_board_init, | ||
294 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/stamp9g20.h b/arch/arm/mach-at91/stamp9g20.h deleted file mode 100644 index f62c0abca4b4..000000000000 --- a/arch/arm/mach-at91/stamp9g20.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef __MACH_STAMP9G20_H | ||
2 | #define __MACH_STAMP9G20_H | ||
3 | |||
4 | void stamp9g20_init_early(void); | ||
5 | void stamp9g20_board_init(void); | ||
6 | |||
7 | #endif | ||