2 * ATSTK1002 daughterboard-specific init code
4 * Copyright (C) 2005-2006 Atmel Corporation
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 #include <linux/init.h>
11 #include <linux/kernel.h>
12 #include <linux/string.h>
13 #include <linux/types.h>
15 #include <asm/setup.h>
16 #include <asm/arch/board.h>
17 #include <asm/arch/init.h>
19 static struct eth_platform_data __initdata eth_data[2];
20 extern struct lcdc_platform_data atstk1000_fb0_data;
22 static int __init parse_tag_ethernet(struct tag *tag)
26 i = tag->u.ethernet.mac_index;
27 if (i < ARRAY_SIZE(eth_data)) {
28 eth_data[i].mii_phy_addr = tag->u.ethernet.mii_phy_addr;
29 memcpy(ð_data[i].hw_addr, tag->u.ethernet.hw_address,
30 sizeof(eth_data[i].hw_addr));
31 eth_data[i].valid = 1;
35 __tagtable(ATAG_ETHERNET, parse_tag_ethernet);
37 void __init setup_board(void)
39 at32_map_usart(1, 0); /* /dev/ttyS0 */
40 at32_map_usart(2, 1); /* /dev/ttyS1 */
41 at32_map_usart(3, 2); /* /dev/ttyS2 */
43 at32_setup_serial_console(0);
46 static int __init atstk1002_init(void)
48 at32_add_system_devices();
50 at32_add_device_usart(0);
51 at32_add_device_usart(1);
52 at32_add_device_usart(2);
54 if (eth_data[0].valid)
55 at32_add_device_eth(0, ð_data[0]);
57 at32_add_device_spi(0);
58 at32_add_device_lcdc(0, &atstk1000_fb0_data);
62 postcore_initcall(atstk1002_init);