[kirkwood] Align jffs2 to pagesize and fix mkfs2.jffs2 opts
[openwrt.git] / target / linux / kirkwood / patches / 100-dockstar.patch
1 This patch adds support for the Seagate FreeAgent DockStar, a Marvell
2 Sheevaplug derivative. I have already registered the DOCKSTAR machine
3 ID.
4
5 Signed-off-by: Eric Cooper <ecc@xxxxxxx>
6 ---
7 arch/arm/mach-kirkwood/Kconfig | 6 ++
8 arch/arm/mach-kirkwood/Makefile | 1 +
9 arch/arm/mach-kirkwood/dockstar-setup.c | 112 +++++++++++++++++++++++++++++++
10 arch/arm/tools/mach-types | 1 +
11 4 files changed, 120 insertions(+), 0 deletions(-)
12 create mode 100644 arch/arm/mach-kirkwood/dockstar-setup.c
13
14 --- a/arch/arm/mach-kirkwood/Kconfig
15 +++ b/arch/arm/mach-kirkwood/Kconfig
16 @@ -99,6 +99,12 @@ config MACH_NET5BIG_V2
17 Say 'Y' here if you want your kernel to support the
18 LaCie 5Big Network v2 NAS.
19
20 +config MACH_DOCKSTAR
21 + bool "Seagate FreeAgent DockStar"
22 + help
23 + Say 'Y' here if you want your kernel to support the
24 + Seagate FreeAgent DockStar.
25 +
26 endmenu
27
28 endif
29 --- a/arch/arm/mach-kirkwood/Makefile
30 +++ b/arch/arm/mach-kirkwood/Makefile
31 @@ -5,6 +5,7 @@ obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88
32 obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o
33 obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o
34 obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o
35 +obj-$(CONFIG_MACH_DOCKSTAR) += dockstar-setup.o
36 obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG) += sheevaplug-setup.o
37 obj-$(CONFIG_MACH_GURUPLUG) += guruplug-setup.o
38 obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o
39 --- /dev/null
40 +++ b/arch/arm/mach-kirkwood/dockstar-setup.c
41 @@ -0,0 +1,148 @@
42 +/*
43 + * arch/arm/mach-kirkwood/dockstar-setup.c
44 + *
45 + * Seagate FreeAgent DockStar Setup
46 + *
47 + * This file is licensed under the terms of the GNU General Public
48 + * License version 2. This program is licensed "as is" without any
49 + * warranty of any kind, whether express or implied.
50 + */
51 +
52 +#include <linux/kernel.h>
53 +#include <linux/init.h>
54 +#include <linux/platform_device.h>
55 +#include <linux/ata_platform.h>
56 +#include <linux/mtd/partitions.h>
57 +#include <linux/mv643xx_eth.h>
58 +#include <linux/gpio.h>
59 +#include <linux/leds.h>
60 +#include <asm/mach-types.h>
61 +#include <asm/mach/arch.h>
62 +#include <mach/kirkwood.h>
63 +#include <plat/mvsdio.h>
64 +#include <plat/orion_nand.h>
65 +#include "common.h"
66 +#include "mpp.h"
67 +
68 +static struct mtd_partition dockstar_nand_parts[] = {
69 + {
70 + .name = "u-boot",
71 + .offset = 0,
72 + .size = SZ_1M
73 + }, {
74 + .name = "second_stage_u-boot",
75 + .offset = MTDPART_OFS_NXTBLK,
76 + .size = SZ_1M
77 + }, {
78 + .name = "uImage",
79 + .offset = MTDPART_OFS_NXTBLK,
80 + .size = SZ_1M + SZ_2M,
81 + }, {
82 + .name = "rootfs",
83 + .offset = MTDPART_OFS_NXTBLK,
84 + .size = SZ_64M,
85 + }, {
86 + .name = "data",
87 + .offset = MTDPART_OFS_NXTBLK,
88 + .size = MTDPART_SIZ_FULL
89 + },
90 +};
91 +
92 +static struct resource dockstar_nand_resource = {
93 + .flags = IORESOURCE_MEM,
94 + .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
95 + .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
96 + KIRKWOOD_NAND_MEM_SIZE - 1,
97 +};
98 +
99 +static struct orion_nand_data dockstar_nand_data = {
100 + .parts = dockstar_nand_parts,
101 + .nr_parts = ARRAY_SIZE(dockstar_nand_parts),
102 + .cle = 0,
103 + .ale = 1,
104 + .width = 8,
105 + .chip_delay = 25,
106 +};
107 +
108 +static struct platform_device dockstar_nand_flash = {
109 + .name = "orion_nand",
110 + .id = -1,
111 + .dev = {
112 + .platform_data = &dockstar_nand_data,
113 + },
114 + .resource = &dockstar_nand_resource,
115 + .num_resources = 1,
116 +};
117 +
118 +
119 +static struct mv643xx_eth_platform_data dockstar_ge00_data = {
120 + .phy_addr = MV643XX_ETH_PHY_ADDR(0),
121 +};
122 +
123 +static struct gpio_led dockstar_led_pins[] = {
124 + {
125 + .name = "dockstar:green:health",
126 + .default_trigger = "default-on",
127 + .gpio = 46,
128 + .active_low = 1,
129 + },
130 + {
131 + .name = "dockstar:orange:misc",
132 + .default_trigger = "none",
133 + .gpio = 47,
134 + .active_low = 1,
135 + },
136 +};
137 +
138 +static struct gpio_led_platform_data dockstar_led_data = {
139 + .leds = dockstar_led_pins,
140 + .num_leds = ARRAY_SIZE(dockstar_led_pins),
141 +};
142 +
143 +static struct platform_device dockstar_leds = {
144 + .name = "leds-gpio",
145 + .id = -1,
146 + .dev = {
147 + .platform_data = &dockstar_led_data,
148 + }
149 +};
150 +
151 +static unsigned int dockstar_mpp_config[] __initdata = {
152 + MPP29_GPIO, /* USB Power Enable */
153 + MPP46_GPIO, /* LED green */
154 + MPP47_GPIO, /* LED orange */
155 + 0
156 +};
157 +
158 +static void __init dockstar_init(void)
159 +{
160 + /*
161 + * Basic setup. Needs to be called early.
162 + */
163 + kirkwood_init();
164 +
165 + /* setup gpio pin select */
166 + kirkwood_mpp_conf(dockstar_mpp_config);
167 +
168 + kirkwood_uart0_init();
169 +
170 + if (gpio_request(29, "USB Power Enable") != 0 ||
171 + gpio_direction_output(29, 1) != 0)
172 + printk(KERN_ERR "can't set up GPIO 29 (USB Power Enable)\n");
173 + kirkwood_ehci_init();
174 +
175 + kirkwood_ge00_init(&dockstar_ge00_data);
176 +
177 + platform_device_register(&dockstar_nand_flash);
178 + platform_device_register(&dockstar_leds);
179 +}
180 +
181 +MACHINE_START(DOCKSTAR, "Seagate FreeAgent DockStar")
182 + .phys_io = KIRKWOOD_REGS_PHYS_BASE,
183 + .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
184 + .boot_params = 0x00000100,
185 + .init_machine = dockstar_init,
186 + .map_io = kirkwood_map_io,
187 + .init_irq = kirkwood_init_irq,
188 + .timer = &kirkwood_timer,
189 +MACHINE_END
This page took 0.04631 seconds and 5 git commands to generate.