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 at91sam9263_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);
78 static void __init
tqma9263_init_irq(void)
80 at91sam9263_init_interrupts(NULL
);
87 static struct at91_usbh_data __initdata tqma9263_usbh_data
= {
89 .vbus_pin
= { AT91_PIN_PA24
, AT91_PIN_PA21
},
90 .vbus_active_high
= 1,
97 static struct at91_udc_data __initdata tqma9263_udc_data
= {
98 .vbus_pin
= AT91_PIN_PA25
,
99 .pullup_pin
= 0, /* pull-up driven by UDC */
106 static struct at91_mmc_data __initdata tqma9263_mmc_data
= {
108 .det_pin
= AT91_PIN_PE18
,
109 .wp_pin
= AT91_PIN_PB28
,
114 * MACB Ethernet device
116 static struct at91_eth_data __initdata tqma9263_macb_data
= {
117 .phy_irq_pin
= AT91_PIN_PE31
,
125 static struct i2c_board_info __initdata tqma9263_i2c_devices
[] = {
127 I2C_BOARD_INFO("pcf8563", 0x51),
130 I2C_BOARD_INFO("24c04", 0x52),
138 static struct mtd_partition __initdata tqma9263_nand_partition
[] = {
146 .offset
= MTDPART_OFS_NXTBLK
,
151 .offset
= MTDPART_OFS_NXTBLK
,
156 .offset
= MTDPART_OFS_NXTBLK
,
157 .size
= MTDPART_SIZ_FULL
,
161 static struct mtd_partition
* __init
nand_partitions(int size
, int *num_partitions
)
163 *num_partitions
= ARRAY_SIZE(tqma9263_nand_partition
);
164 return tqma9263_nand_partition
;
167 static struct atmel_nand_data __initdata tqma9263_nand_data
= {
170 .rdy_pin
= AT91_PIN_PD14
,
171 .enable_pin
= AT91_PIN_PD15
,
172 .partition_info
= nand_partitions
,
175 static struct sam9_smc_config __initdata tqma9263_nand_smc_config
= {
178 .ncs_write_setup
= 0,
183 .ncs_write_pulse
= 3,
189 .mode
= AT91_SMC_READMODE
| AT91_SMC_WRITEMODE
| AT91_SMC_EXNWMODE_DISABLE
| AT91_SMC_DBW_8
,
193 static void __init
tqma9263_add_device_nand(void)
195 /* configure chip-select 3 (NAND) */
196 sam9_smc_configure(3, &tqma9263_nand_smc_config
);
198 at91_add_device_nand(&tqma9263_nand_data
);
202 static void __init
tqma9263_board_init(void)
205 at91_add_device_serial();
207 at91_add_device_usbh(&tqma9263_usbh_data
);
209 at91_add_device_udc(&tqma9263_udc_data
);
211 at91_add_device_mmc(1, &tqma9263_mmc_data
);
213 at91_add_device_i2c(tqma9263_i2c_devices
, ARRAY_SIZE(tqma9263_i2c_devices
));
215 at91_add_device_eth(&tqma9263_macb_data
);
217 tqma9263_add_device_nand();
220 MACHINE_START(TQMA9263
, "TQ Components TQMa9263")
221 /* Maintainer: Michael Heimpold */
222 .phys_io
= AT91_BASE_SYS
,
223 .io_pg_offst
= (AT91_VA_BASE_SYS
>> 18) & 0xfffc,
224 .boot_params
= AT91_SDRAM_BASE
+ 0x100,
225 .timer
= &at91sam926x_timer
,
226 .map_io
= tqma9263_map_io
,
227 .init_irq
= tqma9263_init_irq
,
228 .init_machine
= tqma9263_board_init
,