ramips: update mips multi-machine stuff
[openwrt/staging/yousong.git] / target / linux / ramips / files / arch / mips / ralink / rt288x / mach-wzr-agl300nh.c
1 /*
2 * Buffalo WZR-AGL300NH board support
3 *
4 * Copyright (C) 2010 Joonas Lahtinen <joonas.lahtinen@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
9 */
10
11 #include <linux/init.h>
12 #include <linux/platform_device.h>
13 #include <linux/mtd/mtd.h>
14 #include <linux/mtd/partitions.h>
15 #include <linux/mtd/physmap.h>
16 #include <linux/leds.h>
17
18 #include <asm/mach-ralink/machine.h>
19 #include <asm/mach-ralink/dev_gpio_leds.h>
20 #include <asm/mach-ralink/rt288x.h>
21 #include <asm/mach-ralink/rt288x_regs.h>
22
23 #include "devices.h"
24
25 #if 0
26 #define WZR_AGL300NH_GPIO_LED_POWER XX
27 #define WZR_AGL300NH_GPIO_BUTTON_AOSS XX
28 #define WZR_AGL300NH_GPIO_BUTTON_RESET XX
29 #endif // 0
30
31 #ifdef CONFIG_MTD_PARTITIONS
32
33 /*
34 From stock firmware:
35 mtd0: 00030000 00010000 "uboot"
36 mtd1: 00010000 00010000 "uboot_environ"
37 mtd2: 00010000 00010000 "factory_default"
38 mtd3: 000b0000 00010000 "linux"
39 mtd4: 002f0000 00010000 "rootfs"
40 mtd5: 00010000 00010000 "user_property"
41 */
42
43 static struct mtd_partition wzr_agl300nh_partitions[] = {
44 {
45 .name = "uboot",
46 .offset = 0,
47 .size = 0x030000,
48 .mask_flags = MTD_WRITEABLE,
49 }, {
50 .name = "uboot_environ",
51 .offset = 0x030000,
52 .size = 0x010000,
53 .mask_flags = MTD_WRITEABLE,
54 }, {
55 .name = "factory_default",
56 .offset = 0x040000,
57 .size = 0x010000,
58 .mask_flags = MTD_WRITEABLE,
59 }, {
60 .name = "linux",
61 .offset = 0x050000,
62 .size = 0x0b0000,
63 }, {
64 .name = "rootfs",
65 .offset = 0x100000,
66 .size = 0x2f0000,
67 }, {
68 .name = "user_property",
69 .offset = 0x3f0000,
70 .size = 0x010000,
71 }
72 };
73 #endif /* CONFIG_MTD_PARTITIONS */
74
75 static struct physmap_flash_data wzr_agl300nh_flash_data = {
76 #ifdef CONFIG_MTD_PARTITIONS
77 .nr_parts = ARRAY_SIZE(wzr_agl300nh_partitions),
78 .parts = wzr_agl300nh_partitions,
79 #endif
80 };
81
82 #if 0
83 static struct gpio_led wzr_agl300nh_leds_gpio[] __initdata = {
84 {
85 .name = "wzr-agl300nh:green:power",
86 .gpio = WZR_AGL300NH_GPIO_LED_POWER,
87 .active_low = ??,
88 }
89 };
90 #endif
91
92 static void __init wzr_agl300nh_init(void)
93 {
94 rt288x_gpio_init(RT2880_GPIO_MODE_UART0);
95
96 rt288x_register_flash(0, &wzr_agl300nh_flash_data);
97
98 /*
99 ramips_register_gpio_leds(-1, ARRAY_SIZE(wzr_agl300nh_leds_gpio),
100 wzr_agl300nh_leds_gpio);
101 */
102 }
103
104 MIPS_MACHINE(RAMIPS_MACH_WZR_AGL300NH, "WZR-AGL300NH",
105 "Buffalo WZR-AGL300NH", wzr_agl300nh_init);