[ar71xx] create firmware image for the Ubiquiti LS-SR71 board
[10.03/openwrt.git] / target / linux / at91 / patches-2.6.21 / 001-vlink-machine.patch
1 Index: linux-2.6.21.7/arch/arm/boot/compressed/head-at91rm9200.S
2 ===================================================================
3 --- linux-2.6.21.7.orig/arch/arm/boot/compressed/head-at91rm9200.S
4 +++ linux-2.6.21.7/arch/arm/boot/compressed/head-at91rm9200.S
5 @@ -61,6 +61,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.21.7/arch/arm/mach-at91/board-vlink.c
19 ===================================================================
20 --- /dev/null
21 +++ linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
22 @@ -0,0 +1,160 @@
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_PB1, AT91_PIN_PB2);
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 +static struct at91_udc_data __initdata vlink_udc_data = {
107 +       .vbus_pin       = AT91_PIN_PD4,
108 +       .pullup_pin     = AT91_PIN_PD5,
109 +};
110 +
111 +static struct at91_mmc_data __initdata vlink_mmc_data = {
112 +//     .det_pin        = AT91_PIN_PB27,
113 +       .slot_b         = 0,
114 +       .wire4          = 1,
115 +//     .wp_pin         = AT91_PIN_PA17,
116 +};
117 +
118 +static struct spi_board_info vlink_spi_devices[] = {
119 +       {       /* DataFlash chip */
120 +               .modalias       = "mtd_dataflash",
121 +               .chip_select    = 0,
122 +               .max_speed_hz   = 15 * 1000 * 1000,
123 +       },
124 +#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
125 +       {       /* DataFlash card */
126 +               .modalias       = "mtd_dataflash",
127 +               .chip_select    = 3,
128 +               .max_speed_hz   = 15 * 1000 * 1000,
129 +       },
130 +#endif
131 +};
132 +
133 +static struct at91_gpio_led vlink_leds[] = {
134 +       {
135 +               .name           = "led0",
136 +               .gpio           = AT91_PIN_PB1,
137 +               .trigger        = "heartbeat",
138 +       },
139 +       {
140 +               .name           = "led1",
141 +               .gpio           = AT91_PIN_PB2,
142 +               .trigger        = "timer",
143 +       }
144 +};
145 +
146 +static void __init vlink_board_init(void)
147 +{
148 +       /* Serial */
149 +       at91_add_device_serial();
150 +       /* Ethernet */
151 +       at91_add_device_eth(&vlink_eth_data);
152 +       /* USB Host */
153 +       at91_add_device_usbh(&vlink_usbh_data);
154 +       /* USB Device */
155 +       at91_add_device_udc(&vlink_udc_data);
156 +       at91_set_multi_drive(vlink_udc_data.pullup_pin, 1);     /* pullup_pin is connected to reset */
157 +       /* I2C */
158 +       at91_add_device_i2c();
159 +       /* SPI */
160 +       at91_add_device_spi(vlink_spi_devices, ARRAY_SIZE(vlink_spi_devices));
161 +#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
162 +       /* DataFlash card */
163 +//     at91_set_gpio_output(AT91_PIN_PB22, 0);
164 +#else
165 +       /* MMC */
166 +//     at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
167 +       at91_add_device_mmc(0, &vlink_mmc_data);
168 +#endif
169 +       /* LEDs */
170 +       at91_gpio_leds(vlink_leds, ARRAY_SIZE(vlink_leds));
171 +}
172 +
173 +MACHINE_START(VLINK, "FDL VersaLink")
174 +       /* Maintainer: Guthrie Consulting */
175 +       .phys_io        = AT91_BASE_SYS,
176 +       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
177 +       .boot_params    = AT91_SDRAM_BASE + 0x100,
178 +       .timer          = &at91rm9200_timer,
179 +       .map_io         = vlink_map_io,
180 +       .init_irq       = vlink_init_irq,
181 +       .init_machine   = vlink_board_init,
182 +MACHINE_END
183 Index: linux-2.6.21.7/arch/arm/mach-at91/Kconfig
184 ===================================================================
185 --- linux-2.6.21.7.orig/arch/arm/mach-at91/Kconfig
186 +++ linux-2.6.21.7/arch/arm/mach-at91/Kconfig
187 @@ -96,6 +96,12 @@ config MACH_CHUB
188         help
189           Select this if you are using Promwad's Chub board.
190  
191 +config MACH_VLINK
192 +       bool "Figment Design Labs VersaLink"
193 +       depends on ARCH_AT91RM9200
194 +       help
195 +               Select this if you are using FDL's VersaLink board
196 +
197  endif
198  
199  # ----------------------------------------------------------
200 Index: linux-2.6.21.7/arch/arm/mach-at91/Makefile
201 ===================================================================
202 --- linux-2.6.21.7.orig/arch/arm/mach-at91/Makefile
203 +++ linux-2.6.21.7/arch/arm/mach-at91/Makefile
204 @@ -29,6 +29,7 @@ obj-$(CONFIG_MACH_KB9200)     += board-kb920
205  obj-$(CONFIG_MACH_ATEB9200)    += board-eb9200.o
206  obj-$(CONFIG_MACH_KAFA)                += board-kafa.o
207  obj-$(CONFIG_MACH_CHUB)                += board-chub.o
208 +obj-$(CONFIG_MACH_VLINK)       += board-vlink.o
209  
210  # AT91SAM9260 board-specific support
211  obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o
212 @@ -51,6 +52,7 @@ led-$(CONFIG_MACH_CSB337)     += leds.o
213  led-$(CONFIG_MACH_CSB637)      += leds.o
214  led-$(CONFIG_MACH_KB9200)      += leds.o
215  led-$(CONFIG_MACH_KAFA)                += leds.o
216 +led-$(CONFIG_MACH_VLINK)       += leds.o
217  obj-$(CONFIG_LEDS) += $(led-y)
218  
219  # VGA support