2 * Copyright (C) 2008 I2SE GmbH
3 * Copyright (C) 2010 IEQualize GmbH
4 * Copyright (C) 2010-2011 Michael Heimpold
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include <linux/types.h>
22 #include <linux/init.h>
24 #include <linux/module.h>
25 #include <linux/platform_device.h>
28 #include <mach/hardware.h>
29 #include <asm/setup.h>
30 #include <asm/mach-types.h>
33 #include <asm/mach/arch.h>
34 #include <asm/mach/map.h>
35 #include <asm/mach/irq.h>
37 #include <mach/board.h>
38 #include <mach/gpio.h>
39 #include <mach/at91sam9_smc.h>
41 #include <video/atmel_lcdc.h>
46 #include <linux/atmel_serial.h>
49 static void __init tqma9263_map_io(void)
53 /* Initialize processor: 18.432 MHz crystal */
54 at91_initialize(18432000);
56 /* DGBU on ttyS0. (Rx & Tx only) */
57 at91_register_uart(0, 0, 0);
60 pins = ATMEL_UART_CTS | ATMEL_UART_RTS |
61 ATMEL_UART_DSR | ATMEL_UART_DTR |
62 ATMEL_UART_DCD | ATMEL_UART_RI;
63 at91_register_uart(AT91SAM9263_ID_US0, 1, pins);
66 pins = ATMEL_UART_RTS;
67 at91_register_uart(AT91SAM9263_ID_US1, 2, pins);
70 pins = ATMEL_UART_RTS;
71 at91_register_uart(AT91SAM9263_ID_US2, 3, pins);
73 /* set serial console to ttyS0 (ie, DBGU) */
74 at91_set_serial_console(0);
81 static struct at91_usbh_data __initdata tqma9263_usbh_data = {
83 .vbus_pin = { AT91_PIN_PA24, AT91_PIN_PA21 },
84 .vbus_pin_active_low = 0,
91 static struct at91_udc_data __initdata tqma9263_udc_data = {
92 .vbus_pin = AT91_PIN_PA25,
93 .pullup_pin = 0, /* pull-up driven by UDC */
100 static struct at91_mmc_data __initdata tqma9263_mmc_data = {
102 .det_pin = AT91_PIN_PE18,
103 .wp_pin = AT91_PIN_PB28,
108 * MACB Ethernet device
110 static struct macb_platform_data __initdata tqma9263_macb_data = {
111 .phy_irq_pin = AT91_PIN_PE31,
119 static struct i2c_board_info __initdata tqma9263_i2c_devices[] = {
121 I2C_BOARD_INFO("pcf8563", 0x51),
124 I2C_BOARD_INFO("24c04", 0x52),
132 static struct mtd_partition __initdata tqma9263_nand_partition[] = {
140 .offset = MTDPART_OFS_NXTBLK,
145 .offset = MTDPART_OFS_NXTBLK,
150 .offset = MTDPART_OFS_NXTBLK,
151 .size = MTDPART_SIZ_FULL,
155 static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
157 *num_partitions = ARRAY_SIZE(tqma9263_nand_partition);
158 return tqma9263_nand_partition;
161 static struct atmel_nand_data __initdata tqma9263_nand_data = {
164 .rdy_pin = AT91_PIN_PD14,
165 .enable_pin = AT91_PIN_PD15,
168 static struct sam9_smc_config __initdata tqma9263_nand_smc_config = {
171 .ncs_write_setup = 0,
176 .ncs_write_pulse = 3,
182 .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8,
186 static void __init tqma9263_add_device_nand(void)
188 /* configure chip-select 3 (NAND) */
189 sam9_smc_configure(0, 3, &tqma9263_nand_smc_config);
191 at91_add_device_nand(&tqma9263_nand_data);
195 static void __init tqma9263_board_init(void)
198 at91_add_device_serial();
200 at91_add_device_usbh(&tqma9263_usbh_data);
202 at91_add_device_udc(&tqma9263_udc_data);
204 at91_add_device_mmc(1, &tqma9263_mmc_data);
206 at91_add_device_i2c(tqma9263_i2c_devices, ARRAY_SIZE(tqma9263_i2c_devices));
208 at91_add_device_eth(&tqma9263_macb_data);
210 tqma9263_add_device_nand();
213 MACHINE_START(TQMA9263, "TQ Components TQMa9263")
214 /* Maintainer: Michael Heimpold */
215 .timer = &at91sam926x_timer,
216 .map_io = tqma9263_map_io,
217 .init_irq = at91_init_irq_default,
218 .init_machine = tqma9263_board_init,