Added initial support for at91 plaform (HCG)
[openwrt.git] / target / linux / at91-2.6 / patches / 001-vlink-machine.patch
1 diff -Naur linux-2.6.19.1/arch/arm/boot/compressed/head-at91rm9200.S linux/arch/arm/boot/compressed/head-at91rm9200.S
2 --- linux-2.6.19.1/arch/arm/boot/compressed/head-at91rm9200.S   2006-12-11 20:32:53.000000000 +0100
3 +++ linux/arch/arm/boot/compressed/head-at91rm9200.S    2007-01-20 10:26:21.000000000 +0100
4 @@ -61,6 +61,12 @@
5                 cmp     r7, r3
6                 beq     99f
7  
8 +    @ FDL Versalink : 1053
9 +    mov   r3, #(MACH_TYPE_VLINK & 0xff)
10 +    orr r3, r3, #(MACH_TYPE_VLINK & 0xff00)
11 +    cmp r7, r3
12 +    beq 99f
13 +                                               
14                 @ Ajeco 1ARM : 1075
15                 mov     r3,     #(MACH_TYPE_ONEARM & 0xff)
16                 orr     r3, r3, #(MACH_TYPE_ONEARM & 0xff00)
17 diff -Naur linux-2.6.19.1/arch/arm/mach-at91rm9200/board-vlink.c linux/arch/arm/mach-at91rm9200/board-vlink.c
18 --- linux-2.6.19.1/arch/arm/mach-at91rm9200/board-vlink.c       1970-01-01 01:00:00.000000000 +0100
19 +++ linux/arch/arm/mach-at91rm9200/board-vlink.c        2007-01-19 21:18:00.000000000 +0100
20 @@ -0,0 +1,144 @@
21 +/*
22 + * linux/arch/arm/mach-at91rm9200/board-ek.c
23 + *
24 + *  Copyright (C) 2006,2007 Hamish Guthrie
25 + *                          Guthrie Consulting.
26 + *
27 + * This program is free software; you can redistribute it and/or modify
28 + * it under the terms of the GNU General Public License as published by
29 + * the Free Software Foundation; either version 2 of the License, or
30 + * (at your option) any later version.
31 + *
32 + * This program is distributed in the hope that it will be useful,
33 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
34 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
35 + * GNU General Public License for more details.
36 + *
37 + * You should have received a copy of the GNU General Public License
38 + * along with this program; if not, write to the Free Software
39 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
40 + */
41 +
42 +#include <linux/types.h>
43 +#include <linux/init.h>
44 +#include <linux/mm.h>
45 +#include <linux/module.h>
46 +#include <linux/platform_device.h>
47 +#include <linux/spi/spi.h>
48 +
49 +#include <asm/hardware.h>
50 +#include <asm/setup.h>
51 +#include <asm/mach-types.h>
52 +#include <asm/irq.h>
53 +
54 +#include <asm/mach/arch.h>
55 +#include <asm/mach/map.h>
56 +#include <asm/mach/irq.h>
57 +
58 +#include <asm/arch/board.h>
59 +#include <asm/arch/gpio.h>
60 +
61 +#include "generic.h"
62 +
63 +
64 +/*
65 + * Serial port configuration.
66 + *    0 .. 3 = USART0 .. USART3
67 + *    4      = DBGU
68 + */
69 +static struct at91_uart_config __initdata vlink_uart_config = {
70 +       .console_tty    = 0,                            /* ttyS0 */
71 +       .nr_tty         = 5,
72 +       .tty_map        = { 4, 1, 0, 3, 2 }             /* ttyS0, ..., ttyS4 */
73 +};
74 +
75 +static void __init vlink_map_io(void)
76 +{
77 +       /* Initialize processor: 18.432 MHz crystal */
78 +       at91rm9200_initialize(18432000, AT91RM9200_PQFP);
79 +
80 +       /* Setup the LEDs */
81 +//     at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2);
82 +
83 +       /* Setup the serial ports and console */
84 +       at91_init_serial(&vlink_uart_config);
85 +}
86 +
87 +static void __init vlink_init_irq(void)
88 +{
89 +       at91rm9200_init_interrupts(NULL);
90 +}
91 +
92 +static struct eth_platform_data __initdata vlink_eth_data = {
93 +       .phy_irq_pin    = AT91_PIN_PC4,
94 +       .is_rmii        = 1,
95 +};
96 +
97 +static struct at91_usbh_data __initdata vlink_usbh_data = {
98 +       .ports          = 1,
99 +};
100 +
101 +static struct at91_udc_data __initdata vlink_udc_data = {
102 +       .vbus_pin       = AT91_PIN_PD4,
103 +       .pullup_pin     = AT91_PIN_PD5,
104 +};
105 +
106 +/*static struct at91_mmc_data __initdata ek_mmc_data = {
107 +       .det_pin        = AT91_PIN_PB27,
108 +       .is_b           = 0,
109 +       .wire4          = 1,
110 +       .wp_pin         = AT91_PIN_PA17,
111 +};
112 +*/
113 +
114 +static struct spi_board_info vlink_spi_devices[] = {
115 +       {       /* DataFlash chip */
116 +               .modalias       = "mtd_dataflash",
117 +               .chip_select    = 0,
118 +               .max_speed_hz   = 15 * 1000 * 1000,
119 +       },
120 +#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
121 +       {       /* DataFlash card */
122 +               .modalias       = "mtd_dataflash",
123 +               .chip_select    = 3,
124 +               .max_speed_hz   = 15 * 1000 * 1000,
125 +       },
126 +#endif
127 +};
128 +
129 +static void __init vlink_board_init(void)
130 +{
131 +       /* Serial */
132 +       at91_add_device_serial();
133 +       /* Ethernet */
134 +       at91_add_device_eth(&vlink_eth_data);
135 +       /* USB Host */
136 +       at91_add_device_usbh(&vlink_usbh_data);
137 +       /* USB Device */
138 +       at91_add_device_udc(&vlink_udc_data);
139 +       at91_set_multi_drive(vlink_udc_data.pullup_pin, 1);     /* pullup_pin is connected to reset */
140 +       /* I2C */
141 +       at91_add_device_i2c();
142 +       /* SPI */
143 +       at91_add_device_spi(vlink_spi_devices, ARRAY_SIZE(vlink_spi_devices));
144 +#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
145 +       /* DataFlash card */
146 +//     at91_set_gpio_output(AT91_PIN_PB22, 0);
147 +#else
148 +       /* MMC */
149 +//     at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
150 +//     at91_add_device_mmc(&vlink_mmc_data);
151 +#endif
152 +       /* VGA */
153 +}
154 +
155 +MACHINE_START(VLINK, "FDL VersaLink")
156 +       /* Maintainer: Guthrie Consulting */
157 +       .phys_io        = AT91_BASE_SYS,
158 +       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
159 +       .boot_params    = AT91_SDRAM_BASE + 0x100,
160 +       .timer          = &at91rm9200_timer,
161 +       .map_io         = vlink_map_io,
162 +       .init_irq       = vlink_init_irq,
163 +       .init_machine   = vlink_board_init,
164 +MACHINE_END
165 diff -Naur linux-2.6.19.1/arch/arm/mach-at91rm9200/Kconfig linux/arch/arm/mach-at91rm9200/Kconfig
166 --- linux-2.6.19.1/arch/arm/mach-at91rm9200/Kconfig     2006-12-11 20:32:53.000000000 +0100
167 +++ linux/arch/arm/mach-at91rm9200/Kconfig      2007-01-19 21:17:49.000000000 +0100
168 @@ -82,6 +82,12 @@
169         help
170           Select this if you are using Sperry-Sun's KAFA board.
171  
172 +config MACH_VLINK
173 +       bool "Figment Design Labs VersaLink"
174 +       depends on ARCH_AT91RM9200
175 +       help
176 +               Select this if you are using FDL's VersaLink board
177 +
178  endif
179  
180  # ----------------------------------------------------------
181 diff -Naur linux-2.6.19.1/arch/arm/mach-at91rm9200/Makefile linux/arch/arm/mach-at91rm9200/Makefile
182 --- linux-2.6.19.1/arch/arm/mach-at91rm9200/Makefile    2006-12-11 20:32:53.000000000 +0100
183 +++ linux/arch/arm/mach-at91rm9200/Makefile     2007-01-19 21:17:42.000000000 +0100
184 @@ -24,6 +24,7 @@
185  obj-$(CONFIG_MACH_KB9200)      += board-kb9202.o
186  obj-$(CONFIG_MACH_ATEB9200)    += board-eb9200.o
187  obj-$(CONFIG_MACH_KAFA)                += board-kafa.o
188 +obj-$(CONFIG_MACH_VLINK)  += board-vlink.o
189  
190  # AT91SAM9260 board-specific support
191