1 This patch adds support for the Seagate FreeAgent DockStar, a Marvell
2 Sheevaplug derivative. I have already registered the DOCKSTAR machine
5 Signed-off-by: Eric Cooper <ecc@xxxxxxx>
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
14 diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
15 index 29b2163..74d832f 100644
16 --- a/arch/arm/mach-kirkwood/Kconfig
17 +++ b/arch/arm/mach-kirkwood/Kconfig
18 @@ -32,6 +32,12 @@ config MACH_TS219
19 Say 'Y' here if you want your kernel to support the
20 QNAP TS-119 and TS-219 Turbo NAS devices.
23 + bool "Seagate FreeAgent DockStar"
25 + Say 'Y' here if you want your kernel to support the
26 + Seagate FreeAgent DockStar.
31 diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
32 index c0cd5d3..025b256 100644
33 --- a/arch/arm/mach-kirkwood/Makefile
34 +++ b/arch/arm/mach-kirkwood/Makefile
35 @@ -6,4 +6,5 @@ obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG) += sheevaplug-setup.o
36 obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o
37 obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o
38 +obj-$(CONFIG_MACH_DOCKSTAR) += dockstar-setup.o
40 obj-$(CONFIG_CPU_IDLE) += cpuidle.o
41 diff --git a/arch/arm/mach-kirkwood/dockstar-setup.c b/arch/arm/mach-kirkwood/dockstar-setup.c
43 index 0000000..a90475d
45 +++ b/arch/arm/mach-kirkwood/dockstar-setup.c
48 + * arch/arm/mach-kirkwood/dockstar-setup.c
50 + * Seagate FreeAgent DockStar Setup
52 + * This file is licensed under the terms of the GNU General Public
53 + * License version 2. This program is licensed "as is" without any
54 + * warranty of any kind, whether express or implied.
57 +#include <linux/kernel.h>
58 +#include <linux/init.h>
59 +#include <linux/platform_device.h>
60 +#include <linux/ata_platform.h>
61 +#include <linux/mtd/partitions.h>
62 +#include <linux/mv643xx_eth.h>
63 +#include <linux/gpio.h>
64 +#include <linux/leds.h>
65 +#include <asm/mach-types.h>
66 +#include <asm/mach/arch.h>
67 +#include <mach/kirkwood.h>
68 +#include <plat/mvsdio.h>
69 +#include <plat/orion_nand.h>
73 +static struct mtd_partition dockstar_nand_parts[] = {
79 + .name = "second_stage_u-boot",
80 + .offset = MTDPART_OFS_NXTBLK,
84 + .offset = MTDPART_OFS_NXTBLK,
85 + .size = SZ_1M + SZ_2M,
88 + .offset = MTDPART_OFS_NXTBLK,
92 + .offset = MTDPART_OFS_NXTBLK,
93 + .size = MTDPART_SIZ_FULL
97 +static struct resource dockstar_nand_resource = {
98 + .flags = IORESOURCE_MEM,
99 + .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
100 + .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
101 + KIRKWOOD_NAND_MEM_SIZE - 1,
104 +static struct orion_nand_data dockstar_nand_data = {
105 + .parts = dockstar_nand_parts,
106 + .nr_parts = ARRAY_SIZE(dockstar_nand_parts),
113 +static struct platform_device dockstar_nand_flash = {
114 + .name = "orion_nand",
117 + .platform_data = &dockstar_nand_data,
119 + .resource = &dockstar_nand_resource,
120 + .num_resources = 1,
124 +static struct mv643xx_eth_platform_data dockstar_ge00_data = {
125 + .phy_addr = MV643XX_ETH_PHY_ADDR(0),
128 +static struct gpio_led dockstar_led_pins[] = {
130 + .name = "dockstar:green:health",
131 + .default_trigger = "default-on",
136 + .name = "dockstar:orange:misc",
137 + .default_trigger = "none",
143 +static struct gpio_led_platform_data dockstar_led_data = {
144 + .leds = dockstar_led_pins,
145 + .num_leds = ARRAY_SIZE(dockstar_led_pins),
148 +static struct platform_device dockstar_leds = {
149 + .name = "leds-gpio",
152 + .platform_data = &dockstar_led_data,
156 +static unsigned int dockstar_mpp_config[] __initdata = {
157 + MPP29_GPIO, /* USB Power Enable */
158 + MPP46_GPIO, /* LED green */
159 + MPP47_GPIO, /* LED orange */
163 +static void __init dockstar_init(void)
166 + * Basic setup. Needs to be called early.
170 + /* setup gpio pin select */
171 + kirkwood_mpp_conf(dockstar_mpp_config);
173 + kirkwood_uart0_init();
175 + if (gpio_request(29, "USB Power Enable") != 0 ||
176 + gpio_direction_output(29, 1) != 0)
177 + printk(KERN_ERR "can't set up GPIO 29 (USB Power Enable)\n");
178 + kirkwood_ehci_init();
180 + kirkwood_ge00_init(&dockstar_ge00_data);
182 + platform_device_register(&dockstar_nand_flash);
183 + platform_device_register(&dockstar_leds);
186 +MACHINE_START(DOCKSTAR, "Seagate FreeAgent DockStar")
187 + .phys_io = KIRKWOOD_REGS_PHYS_BASE,
188 + .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
189 + .boot_params = 0x00000100,
190 + .init_machine = dockstar_init,
191 + .map_io = kirkwood_map_io,
192 + .init_irq = kirkwood_init_irq,
193 + .timer = &kirkwood_timer,
195 diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
196 index 48cbdcb..8d56837 100644
197 --- a/arch/arm/tools/mach-types
198 +++ b/arch/arm/tools/mach-types
199 @@ -2245,3 +2245,4 @@ davinci_dm365_dvr MACH_DAVINCI_DM365_DVR DAVINCI_DM365_DVR 2963
200 omap3_wl_ff MACH_OMAP3_WL_FF OMAP3_WL_FF 2258
201 simcom MACH_SIMCOM SIMCOM 2259
202 mcwebio MACH_MCWEBIO MCWEBIO 2260
203 +dockstar MACH_DOCKSTAR DOCKSTAR 2998