[ifxmips]
[openwrt/svn-archive/archive.git] / target / linux / ifxmips / files-2.6.33 / arch / mips / ifxmips / danube / mach-easy4010.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.h>
13 #include <ifxmips_prom.h>
14
15 #include "devices.h"
16
17 extern unsigned char ifxmips_ethaddr[6];
18
19 #ifdef CONFIG_MTD_PARTITIONS
20 static struct mtd_partition easy4010_partitions[] =
21 {
22 {
23 .name = "uboot",
24 .offset = 0x0,
25 .size = 0x40000,
26 },
27 {
28 .name = "uboot_env",
29 .offset = 0x40000,
30 .size = 0x10000,
31 },
32 {
33 .name = "kernel",
34 .offset = 0x0,
35 .size = 0x0,
36 },
37 {
38 .name = "rootfs",
39 .offset = 0x0,
40 .size = 0x0,
41 }
42 };
43 #endif
44
45 static struct physmap_flash_data easy4010_flash_data = {
46 #ifdef CONFIG_MTD_PARTITIONS
47 .nr_parts = ARRAY_SIZE(easy4010_partitions),
48 .parts = easy4010_partitions,
49 #endif
50 };
51
52 static struct gpio_led easy4010_leds[] = {
53 { .name = "ifx:green:test0", .gpio = 0,},
54 { .name = "ifx:green:test1", .gpio = 1,},
55 { .name = "ifx:green:test2", .gpio = 2,},
56 { .name = "ifx:green:test3", .gpio = 3,},
57 };
58
59 static void __init
60 easy4010_init(void)
61 {
62 ifxmips_register_gpio();
63
64 ifxmips_register_gpio_dev();
65
66 ifxmips_register_mtd(&easy4010_flash_data);
67
68 ifxmips_register_leds(easy4010_leds, ARRAY_SIZE(easy4010_leds));
69
70 ifxmips_register_wdt();
71
72 danube_register_ethernet(ifxmips_ethaddr, REV_MII_MODE);
73
74 danube_register_usb();
75 }
76
77 MIPS_MACHINE(IFXMIPS_MACH_EASY4010,
78 "EASY4010",
79 "Lantiq Twinpass Eval Board",
80 easy4010_init);