Added gpio and led drivers for 2.6.25.10 kernel
[openwrt.git] / target / linux / at91 / patches-2.6.22 / 001-vlink-machine.patch
1 Index: linux-2.6.22.19/arch/arm/boot/compressed/head-at91rm9200.S
2 ===================================================================
3 --- linux-2.6.22.19.orig/arch/arm/boot/compressed/head-at91rm9200.S
4 +++ linux-2.6.22.19/arch/arm/boot/compressed/head-at91rm9200.S
5 @@ -67,6 +67,12 @@
6 cmp r7, r3
7 beq 99f
8
9 + @ FDL Versalink : 1053
10 + mov r3, #(MACH_TYPE_VLINK & 0xff)
11 + orr r3, r3, #(MACH_TYPE_VLINK & 0xff00)
12 + cmp r7, r3
13 + beq 99f
14 +
15 @ Ajeco 1ARM : 1075
16 mov r3, #(MACH_TYPE_ONEARM & 0xff)
17 orr r3, r3, #(MACH_TYPE_ONEARM & 0xff00)
18 Index: linux-2.6.22.19/arch/arm/mach-at91/board-vlink.c
19 ===================================================================
20 --- /dev/null
21 +++ linux-2.6.22.19/arch/arm/mach-at91/board-vlink.c
22 @@ -0,0 +1,191 @@
23 +/*
24 + * linux/arch/arm/mach-at91/board-vlink.c
25 + *
26 + * Copyright (C) 2005 SAN People
27 + * Copyright (C) 2006,2007 Guthrie Consulting
28 + *
29 + *
30 + * This program is free software; you can redistribute it and/or modify
31 + * it under the terms of the GNU General Public License as published by
32 + * the Free Software Foundation; either version 2 of the License, or
33 + * (at your option) any later version.
34 + *
35 + * This program is distributed in the hope that it will be useful,
36 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
37 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38 + * GNU General Public License for more details.
39 + *
40 + * You should have received a copy of the GNU General Public License
41 + * along with this program; if not, write to the Free Software
42 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
43 + */
44 +
45 +#include <linux/types.h>
46 +#include <linux/init.h>
47 +#include <linux/mm.h>
48 +#include <linux/module.h>
49 +#include <linux/platform_device.h>
50 +#include <linux/spi/spi.h>
51 +#include <linux/mtd/physmap.h>
52 +
53 +#include <asm/hardware.h>
54 +#include <asm/setup.h>
55 +#include <asm/mach-types.h>
56 +#include <asm/irq.h>
57 +
58 +#include <asm/mach/arch.h>
59 +#include <asm/mach/map.h>
60 +#include <asm/mach/irq.h>
61 +
62 +#include <asm/arch/board.h>
63 +#include <asm/arch/gpio.h>
64 +#include <asm/arch/at91rm9200_mc.h>
65 +
66 +#include "generic.h"
67 +
68 +
69 +/*
70 + * Serial port configuration.
71 + * 0 .. 3 = USART0 .. USART3
72 + * 4 = DBGU
73 + */
74 +static struct at91_uart_config __initdata vlink_uart_config = {
75 + .console_tty = 0, /* ttyS0 */
76 + .nr_tty = 5,
77 + .tty_map = { 4, 1, 0, 3, 2 } /* ttyS0, ..., ttyS4 */
78 +};
79 +
80 +static void __init vlink_map_io(void)
81 +{
82 + /* Initialize processor: 18.432 MHz crystal */
83 + at91rm9200_initialize(18432000, AT91RM9200_PQFP);
84 +
85 + /* Setup the LEDs */
86 + at91_init_leds(AT91_PIN_PC14, AT91_PIN_PC15);
87 +
88 + /* Setup the serial ports and console */
89 + at91_init_serial(&vlink_uart_config);
90 +}
91 +
92 +static void __init vlink_init_irq(void)
93 +{
94 + at91rm9200_init_interrupts(NULL);
95 +}
96 +
97 +static struct at91_eth_data __initdata vlink_eth_data = {
98 + .phy_irq_pin = AT91_PIN_PC4,
99 + .is_rmii = 1,
100 +};
101 +
102 +static struct at91_usbh_data __initdata vlink_usbh_data = {
103 + .ports = 1,
104 +};
105 +
106 +/*
107 +static struct at91_udc_data __initdata vlink_udc_data = {
108 + .vbus_pin = AT91_PIN_PD4,
109 + .pullup_pin = AT91_PIN_PD5,
110 +};
111 +*/
112 +
113 +static struct at91_mmc_data __initdata vlink_mmc_data = {
114 +// .det_pin = AT91_PIN_PB27,
115 + .slot_b = 0,
116 + .wire4 = 1,
117 +// .wp_pin = AT91_PIN_PA17,
118 +};
119 +
120 +static struct spi_board_info vlink_spi_devices[] = {
121 + { /* DataFlash chip */
122 + .modalias = "mtd_dataflash",
123 + .chip_select = 0,
124 + .max_speed_hz = 15 * 1000 * 1000,
125 + },
126 +#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
127 + { /* DataFlash card */
128 + .modalias = "mtd_dataflash",
129 + .chip_select = 3,
130 + .max_speed_hz = 15 * 1000 * 1000,
131 + },
132 +#endif
133 +};
134 +
135 +/*static struct at91_gpio_led vlink_leds[] = {
136 + {
137 + .name = "led0",
138 + .gpio = AT91_PIN_PC14,
139 + .trigger = "heartbeat",
140 + },
141 + {
142 + .name = "led1",
143 + .gpio = AT91_PIN_PC15,
144 + .trigger = "timer",
145 + }
146 +};
147 +*/
148 +
149 +static void __init vlink_board_init(void)
150 +{
151 + /* Serial */
152 + at91_add_device_serial();
153 + /* Ethernet */
154 + at91_add_device_eth(&vlink_eth_data);
155 + /* USB Host */
156 + at91_add_device_usbh(&vlink_usbh_data);
157 + /* USB Device */
158 +// at91_add_device_udc(&vlink_udc_data);
159 +// at91_set_multi_drive(vlink_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */
160 + /* I2C */
161 + at91_add_device_i2c();
162 + /* SPI */
163 + at91_add_device_spi(vlink_spi_devices, ARRAY_SIZE(vlink_spi_devices));
164 +#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
165 + /* DataFlash card */
166 +// at91_set_gpio_output(AT91_PIN_PB22, 0);
167 +#else
168 + /* MMC */
169 +// at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
170 + at91_add_device_mmc(0, &vlink_mmc_data);
171 +#endif
172 + /* LEDs */
173 +// at91_gpio_leds(vlink_leds, ARRAY_SIZE(vlink_leds));
174 +
175 +/* Other LED's */
176 + at91_set_gpio_output(AT91_PIN_PC7, 1); // LED FRONT AP1
177 + at91_set_gpio_output(AT91_PIN_PC8, 1); // LED FRONT BP1
178 + at91_set_gpio_output(AT91_PIN_PB14, 1); // LED BACK AP1
179 + at91_set_gpio_output(AT91_PIN_PB15, 1); // LED BACK BP1
180 + at91_set_gpio_output(AT91_PIN_PB16, 1); // LED BACK AP2
181 + at91_set_gpio_output(AT91_PIN_PB17, 1); // LED BACK BP2
182 +
183 +/* SIM Cards */
184 + at91_set_gpio_output(AT91_PIN_PB9, 1); // ENBSC3
185 + at91_set_gpio_output(AT91_PIN_PB10, 1); // ENBSC2
186 + at91_set_gpio_output(AT91_PIN_PB11, 1); // ENBSC1
187 +
188 +/* GSM Module Control */
189 + at91_set_gpio_output(AT91_PIN_PB12, 1); // GSMONOFF
190 +
191 +/* Test jig presence detection */
192 + at91_set_gpio_input(AT91_PIN_PB8, 1); // JIGPRESENT
193 +
194 +/* Power indicator */
195 + at91_set_gpio_input(AT91_PIN_PB22, 1); // PWR_IND
196 +
197 +/* USB Device control */
198 + at91_set_gpio_input(AT91_PIN_PB27, 1); // UDB_CNX
199 + at91_set_gpio_output(AT91_PIN_PB28, 1); // UDB_PUP
200 + at91_set_multi_drive(AT91_PIN_PB28, 1); // Set to multi-drive
201 +
202 +}
203 +
204 +MACHINE_START(VLINK, "FDL VersaLink")
205 + /* Maintainer: Guthrie Consulting */
206 + .phys_io = AT91_BASE_SYS,
207 + .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
208 + .boot_params = AT91_SDRAM_BASE + 0x100,
209 + .timer = &at91rm9200_timer,
210 + .map_io = vlink_map_io,
211 + .init_irq = vlink_init_irq,
212 + .init_machine = vlink_board_init,
213 +MACHINE_END
214 Index: linux-2.6.22.19/arch/arm/mach-at91/Kconfig
215 ===================================================================
216 --- linux-2.6.22.19.orig/arch/arm/mach-at91/Kconfig
217 +++ linux-2.6.22.19/arch/arm/mach-at91/Kconfig
218 @@ -103,6 +103,12 @@ config MACH_CHUB
219 help
220 Select this if you are using Promwad's Chub board.
221
222 +config MACH_VLINK
223 + bool "Figment Design Labs VersaLink"
224 + depends on ARCH_AT91RM9200
225 + help
226 + Select this if you are using FDL's VersaLink board
227 +
228 endif
229
230 # ----------------------------------------------------------
231 Index: linux-2.6.22.19/arch/arm/mach-at91/Makefile
232 ===================================================================
233 --- linux-2.6.22.19.orig/arch/arm/mach-at91/Makefile
234 +++ linux-2.6.22.19/arch/arm/mach-at91/Makefile
235 @@ -29,6 +29,7 @@ obj-$(CONFIG_MACH_KB9200) += board-kb920
236 obj-$(CONFIG_MACH_ATEB9200) += board-eb9200.o
237 obj-$(CONFIG_MACH_KAFA) += board-kafa.o
238 obj-$(CONFIG_MACH_CHUB) += board-chub.o
239 +obj-$(CONFIG_MACH_VLINK) += board-vlink.o
240 obj-$(CONFIG_MACH_PICOTUX2XX) += board-picotux200.o
241
242 # AT91SAM9260 board-specific support
243 @@ -52,6 +53,7 @@ led-$(CONFIG_MACH_CSB337) += leds.o
244 led-$(CONFIG_MACH_CSB637) += leds.o
245 led-$(CONFIG_MACH_KB9200) += leds.o
246 led-$(CONFIG_MACH_KAFA) += leds.o
247 +led-$(CONFIG_MACH_VLINK) += leds.o
248 obj-$(CONFIG_LEDS) += $(led-y)
249
250 # VGA support
This page took 0.054197 seconds and 5 git commands to generate.