[ifxmips] add ar9 target
[openwrt/svn-archive/archive.git] / target / linux / ifxmips / files-2.6.33 / arch / mips / ifxmips / ar9 / mach-easy50812.c
1 #include <linux/init.h>
2 #include <linux/platform_device.h>
3 #include <linux/leds.h>
4 #include <linux/gpio.h>
5 #include <linux/gpio_buttons.h>
6 #include <linux/mtd/mtd.h>
7 #include <linux/mtd/partitions.h>
8 #include <linux/mtd/physmap.h>
9 #include <linux/input.h>
10
11 #include <machine.h>
12 #include <ifxmips_prom.h>
13
14 #include "devices.h"
15
16 extern unsigned char ifxmips_ethaddr[6];
17
18 #ifdef CONFIG_MTD_PARTITIONS
19 static struct mtd_partition easy50812_partitions[] =
20 {
21 {
22 .name = "uboot",
23 .offset = 0x0,
24 .size = 0x40000,
25 },
26 {
27 .name = "uboot_env",
28 .offset = 0x40000,
29 .size = 0x10000,
30 },
31 {
32 .name = "kernel",
33 .offset = 0x0,
34 .size = 0x0,
35 },
36 {
37 .name = "rootfs",
38 .offset = 0x0,
39 .size = 0x0,
40 }
41 };
42 #endif
43
44 static struct physmap_flash_data easy50812_flash_data = {
45 #ifdef CONFIG_MTD_PARTITIONS
46 .nr_parts = ARRAY_SIZE(easy50812_partitions),
47 .parts = easy50812_partitions,
48 #endif
49 };
50
51 static struct gpio_led easy50812_leds[] = {
52 { .name = "ifx:green:test0", .gpio = 0,},
53 { .name = "ifx:green:test1", .gpio = 1,},
54 { .name = "ifx:green:test2", .gpio = 2,},
55 { .name = "ifx:green:test3", .gpio = 3,},
56 };
57
58 static void __init
59 easy50812_init(void)
60 {
61 ifxmips_register_gpio();
62
63 //printk("ifxmips_register_gpio_dev\n");
64 //ifxmips_register_gpio_dev();
65
66 ifxmips_register_mtd(&easy50812_flash_data);
67
68 ifxmips_register_leds(easy50812_leds, ARRAY_SIZE(easy50812_leds));
69
70 ifxmips_register_wdt();
71
72 ar9_register_ethernet(ifxmips_ethaddr);
73
74 ar9_register_usb();
75 }
76
77 MIPS_MACHINE(IFXMIPS_MACH_EASY50812,
78 "EASY50812",
79 "Lantiq AR9 Eval Board",
80 easy50812_init);