diff options
author | Sergey Lapin <slapin@ossfans.org> | 2008-08-02 21:29:48 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-09-18 18:11:55 -0400 |
commit | 9c784f958d01097e3fae24ad75ab3a80ed1e556b (patch) | |
tree | 3ba0c0a4975086bffcbe33e50442bdbc4bbe6daf /arch/arm/mach-at91 | |
parent | adee14b2e1557d0a8559f29681732d05a89dfc35 (diff) |
[ARM] 5210/2: AFEB9260: board support
This patch adds support for AT91SAM9260-based board AFEB9260
which is a product from both Open Source design which runs
Open Source software. Some commertial projects
are made with this design. A board is basically AT91SAM9260-EK
with some modifications and different peripherals and different
parts used. Main purpose of this project is to gain experience in
hardware design.
More info: http://groups.google.com/group/arm9fpga-evolution-board
(In Russian only, sorry).
Subversion repository: svn://194.85.238.22/home/users/george/svn/arm9eb
By this patch only basic functionality is provided.
Signed-off-by: Sergey Lapin <slapin@ossfans.org>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r-- | arch/arm/mach-at91/Kconfig | 9 | ||||
-rw-r--r-- | arch/arm/mach-at91/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-afeb-9260v1.c | 194 |
3 files changed, 204 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index a048b92cb407..68537e37387f 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig | |||
@@ -175,6 +175,15 @@ config MACH_SAM9_L9260 | |||
175 | Select this if you are using Olimex's SAM9-L9260 board based on the Atmel AT91SAM9260. | 175 | Select this if you are using Olimex's SAM9-L9260 board based on the Atmel AT91SAM9260. |
176 | <http://www.olimex.com/dev/sam9-L9260.html> | 176 | <http://www.olimex.com/dev/sam9-L9260.html> |
177 | 177 | ||
178 | config MACH_AFEB9260 | ||
179 | bool "Custom afeb9260 board v1" | ||
180 | depends on ARCH_AT91SAM9260 | ||
181 | help | ||
182 | Select this if you are using custom afeb9260 board based on | ||
183 | open hardware design. Select this for revision 1 of the board. | ||
184 | <svn://194.85.238.22/home/users/george/svn/arm9eb> | ||
185 | <http://groups.google.com/group/arm9fpga-evolution-board> | ||
186 | |||
178 | config MACH_USB_A9260 | 187 | config MACH_USB_A9260 |
179 | bool "CALAO USB-A9260" | 188 | bool "CALAO USB-A9260" |
180 | depends on ARCH_AT91SAM9260 | 189 | depends on ARCH_AT91SAM9260 |
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index 7d641f97516b..a95c49bdf927 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile | |||
@@ -39,6 +39,7 @@ obj-$(CONFIG_MACH_CAM60) += board-cam60.o | |||
39 | obj-$(CONFIG_MACH_SAM9_L9260) += board-sam9-l9260.o | 39 | obj-$(CONFIG_MACH_SAM9_L9260) += board-sam9-l9260.o |
40 | obj-$(CONFIG_MACH_USB_A9260) += board-usb-a9260.o | 40 | obj-$(CONFIG_MACH_USB_A9260) += board-usb-a9260.o |
41 | obj-$(CONFIG_MACH_QIL_A9260) += board-qil-a9260.o | 41 | obj-$(CONFIG_MACH_QIL_A9260) += board-qil-a9260.o |
42 | obj-$(CONFIG_MACH_AFEB9260) += board-afeb-9260v1.o | ||
42 | 43 | ||
43 | # AT91SAM9261 board-specific support | 44 | # AT91SAM9261 board-specific support |
44 | obj-$(CONFIG_MACH_AT91SAM9261EK) += board-sam9261ek.o | 45 | obj-$(CONFIG_MACH_AT91SAM9261EK) += board-sam9261ek.o |
diff --git a/arch/arm/mach-at91/board-afeb-9260v1.c b/arch/arm/mach-at91/board-afeb-9260v1.c new file mode 100644 index 000000000000..8778b8e08549 --- /dev/null +++ b/arch/arm/mach-at91/board-afeb-9260v1.c | |||
@@ -0,0 +1,194 @@ | |||
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/init.h> | ||
29 | #include <linux/mm.h> | ||
30 | #include <linux/module.h> | ||
31 | #include <linux/platform_device.h> | ||
32 | #include <linux/spi/spi.h> | ||
33 | #include <linux/clk.h> | ||
34 | #include <linux/dma-mapping.h> | ||
35 | |||
36 | #include <mach/hardware.h> | ||
37 | #include <asm/setup.h> | ||
38 | #include <asm/mach-types.h> | ||
39 | #include <asm/irq.h> | ||
40 | |||
41 | #include <asm/mach/arch.h> | ||
42 | #include <asm/mach/map.h> | ||
43 | #include <asm/mach/irq.h> | ||
44 | |||
45 | #include <mach/board.h> | ||
46 | #include <mach/gpio.h> | ||
47 | |||
48 | #include "generic.h" | ||
49 | |||
50 | |||
51 | static void __init afeb9260_map_io(void) | ||
52 | { | ||
53 | /* Initialize processor: 18.432 MHz crystal */ | ||
54 | at91sam9260_initialize(18432000); | ||
55 | |||
56 | /* DGBU on ttyS0. (Rx & Tx only) */ | ||
57 | at91_register_uart(0, 0, 0); | ||
58 | |||
59 | /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
60 | at91_register_uart(AT91SAM9260_ID_US0, 1, | ||
61 | ATMEL_UART_CTS | ATMEL_UART_RTS | ||
62 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ||
63 | | ATMEL_UART_DCD | ATMEL_UART_RI); | ||
64 | |||
65 | /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */ | ||
66 | at91_register_uart(AT91SAM9260_ID_US1, 2, | ||
67 | ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
68 | |||
69 | /* set serial console to ttyS0 (ie, DBGU) */ | ||
70 | at91_set_serial_console(0); | ||
71 | } | ||
72 | |||
73 | static void __init afeb9260_init_irq(void) | ||
74 | { | ||
75 | at91sam9260_init_interrupts(NULL); | ||
76 | } | ||
77 | |||
78 | |||
79 | /* | ||
80 | * USB Host port | ||
81 | */ | ||
82 | static struct at91_usbh_data __initdata afeb9260_usbh_data = { | ||
83 | .ports = 1, | ||
84 | }; | ||
85 | |||
86 | /* | ||
87 | * USB Device port | ||
88 | */ | ||
89 | static struct at91_udc_data __initdata afeb9260_udc_data = { | ||
90 | .vbus_pin = AT91_PIN_PC5, | ||
91 | .pullup_pin = 0, /* pull-up driven by UDC */ | ||
92 | }; | ||
93 | |||
94 | |||
95 | |||
96 | /* | ||
97 | * SPI devices. | ||
98 | */ | ||
99 | static struct spi_board_info afeb9260_spi_devices[] = { | ||
100 | { /* DataFlash chip */ | ||
101 | .modalias = "mtd_dataflash", | ||
102 | .chip_select = 1, | ||
103 | .max_speed_hz = 15 * 1000 * 1000, | ||
104 | .bus_num = 0, | ||
105 | }, | ||
106 | }; | ||
107 | |||
108 | |||
109 | |||
110 | /* | ||
111 | * NAND flash | ||
112 | */ | ||
113 | static struct mtd_partition __initdata afeb9260_nand_partition[] = { | ||
114 | { | ||
115 | .name = "bootloader", | ||
116 | .offset = 0, | ||
117 | .size = (640 * SZ_1K), | ||
118 | }, | ||
119 | { | ||
120 | .name = "kernel", | ||
121 | .offset = MTDPART_OFS_NXTBLK, | ||
122 | .size = SZ_2M, | ||
123 | }, | ||
124 | { | ||
125 | .name = "rootfs", | ||
126 | .offset = MTDPART_OFS_NXTBLK, | ||
127 | .size = MTDPART_SIZ_FULL, | ||
128 | }, | ||
129 | }; | ||
130 | |||
131 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
132 | { | ||
133 | *num_partitions = ARRAY_SIZE(afeb9260_nand_partition); | ||
134 | return afeb9260_nand_partition; | ||
135 | } | ||
136 | |||
137 | static struct atmel_nand_data __initdata afeb9260_nand_data = { | ||
138 | .ale = 21, | ||
139 | .cle = 22, | ||
140 | .rdy_pin = AT91_PIN_PC13, | ||
141 | .enable_pin = AT91_PIN_PC14, | ||
142 | .partition_info = nand_partitions, | ||
143 | .bus_width_16 = 0, | ||
144 | }; | ||
145 | |||
146 | |||
147 | /* | ||
148 | * MCI (SD/MMC) | ||
149 | */ | ||
150 | static struct at91_mmc_data __initdata afeb9260_mmc_data = { | ||
151 | .slot_b = 1, | ||
152 | .wire4 = 1, | ||
153 | }; | ||
154 | |||
155 | |||
156 | |||
157 | static struct i2c_board_info __initdata afeb9260_i2c_devices[] = { | ||
158 | { | ||
159 | I2C_BOARD_INFO("fm3130", 0x68), | ||
160 | I2C_BOARD_INFO("24c64", 0x50), | ||
161 | }, | ||
162 | }; | ||
163 | |||
164 | static void __init afeb9260_board_init(void) | ||
165 | { | ||
166 | /* Serial */ | ||
167 | at91_add_device_serial(); | ||
168 | /* USB Host */ | ||
169 | at91_add_device_usbh(&afeb9260_usbh_data); | ||
170 | /* USB Device */ | ||
171 | at91_add_device_udc(&afeb9260_udc_data); | ||
172 | /* SPI */ | ||
173 | at91_add_device_spi(afeb9260_spi_devices, | ||
174 | ARRAY_SIZE(afeb9260_spi_devices)); | ||
175 | /* NAND */ | ||
176 | at91_add_device_nand(&afeb9260_nand_data); | ||
177 | /* MMC */ | ||
178 | at91_add_device_mmc(0, &afeb9260_mmc_data); | ||
179 | /* I2C */ | ||
180 | at91_add_device_i2c(afeb9260_i2c_devices, | ||
181 | ARRAY_SIZE(afeb9260_i2c_devices)); | ||
182 | } | ||
183 | |||
184 | MACHINE_START(AFEB9260, "Custom afeb9260 board") | ||
185 | /* Maintainer: Sergey Lapin <slapin@ossfans.org> */ | ||
186 | .phys_io = AT91_BASE_SYS, | ||
187 | .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, | ||
188 | .boot_params = AT91_SDRAM_BASE + 0x100, | ||
189 | .timer = &at91sam926x_timer, | ||
190 | .map_io = afeb9260_map_io, | ||
191 | .init_irq = afeb9260_init_irq, | ||
192 | .init_machine = afeb9260_board_init, | ||
193 | MACHINE_END | ||
194 | |||