2 +++ b/arch/arm/mach-kirkwood/nas6210-setup.c
5 + * arch/arm/mach-kirkwood/nas6210-setup.c
7 + * Raidsonic ICYBOX NAS6210 Board Setup
9 + * This file is licensed under the terms of the GNU General Public
10 + * License version 2. This program is licensed "as is" without any
11 + * warranty of any kind, whether express or implied.
14 +#include <linux/kernel.h>
15 +#include <linux/init.h>
16 +#include <linux/platform_device.h>
17 +#include <linux/ata_platform.h>
18 +#include <linux/mtd/partitions.h>
19 +#include <linux/mv643xx_eth.h>
20 +#include <linux/gpio.h>
21 +#include <linux/gpio_keys.h>
22 +#include <linux/input.h>
23 +#include <linux/leds.h>
24 +#include <asm/mach-types.h>
25 +#include <asm/mach/arch.h>
26 +#include <mach/kirkwood.h>
30 +#define NAS6210_GPIO_POWER_OFF 24
32 +static struct mtd_partition nas6210_nand_parts[] = {
38 + .name = "uboot_env",
39 + .offset = MTDPART_OFS_NXTBLK,
43 + .offset = MTDPART_OFS_NXTBLK,
47 + .offset = MTDPART_OFS_NXTBLK,
48 + .size = MTDPART_SIZ_FULL
52 +static struct mv643xx_eth_platform_data nas6210_ge00_data = {
53 + .phy_addr = MV643XX_ETH_PHY_ADDR(8),
56 +static struct mv_sata_platform_data nas6210_sata_data = {
60 +static struct gpio_led nas6210_led_pins[] = {
62 + .name = "status:green:power",
63 + .default_trigger = "default-on",
68 + .name = "status:red:power",
69 + .default_trigger = "none",
74 + .name = "status:red:usb_copy",
75 + .default_trigger = "none",
81 +static struct gpio_led_platform_data nas6210_led_data = {
82 + .leds = nas6210_led_pins,
83 + .num_leds = ARRAY_SIZE(nas6210_led_pins),
86 +static struct platform_device nas6210_leds = {
87 + .name = "leds-gpio",
90 + .platform_data = &nas6210_led_data,
94 +static struct gpio_keys_button nas6210_buttons[] = {
102 + .code = KEY_RESTART,
109 +static struct gpio_keys_platform_data nas6210_button_data = {
110 + .buttons = nas6210_buttons,
111 + .nbuttons = ARRAY_SIZE(nas6210_buttons),
114 +static struct platform_device nas6210_button_device = {
115 + .name = "gpio-keys",
117 + .num_resources = 0,
119 + .platform_data = &nas6210_button_data,
123 +static unsigned int nas6210_mpp_config[] __initdata = {
132 + MPP22_GPIO, /* Power LED red */
133 + MPP24_GPIO, /* Power off device */
134 + MPP25_GPIO, /* Power LED green */
135 + MPP27_GPIO, /* USB transfer LED */
136 + MPP28_GPIO, /* Reset button */
137 + MPP29_GPIO, /* USB Copy button */
141 +static void nas6210_power_off(void)
143 + gpio_set_value(NAS6210_GPIO_POWER_OFF, 1);
146 +static void __init nas6210_init(void)
149 + * Basic setup. Needs to be called early.
152 + kirkwood_mpp_conf(nas6210_mpp_config);
154 + kirkwood_nand_init(ARRAY_AND_SIZE(nas6210_nand_parts), 25);
155 + kirkwood_ehci_init();
156 + kirkwood_ge00_init(&nas6210_ge00_data);
157 + kirkwood_sata_init(&nas6210_sata_data);
158 + kirkwood_uart0_init();
159 + platform_device_register(&nas6210_leds);
160 + platform_device_register(&nas6210_button_device);
161 + if (gpio_request(NAS6210_GPIO_POWER_OFF, "power-off") == 0 &&
162 + gpio_direction_output(NAS6210_GPIO_POWER_OFF, 0) == 0)
163 + pm_power_off = nas6210_power_off;
165 + pr_err("nas6210: failed to configure power-off GPIO\n");
168 +static int __init nas6210_pci_init(void)
170 + if (machine_is_nas6210()) {
173 + kirkwood_pcie_id(&dev, &rev);
174 + if (dev == MV88F6282_DEV_ID)
175 + kirkwood_pcie_init(KW_PCIE1 | KW_PCIE0);
177 + kirkwood_pcie_init(KW_PCIE0);
182 +subsys_initcall(nas6210_pci_init);
184 +MACHINE_START(NAS6210, "RaidSonic ICY BOX IB-NAS6210")
185 + /* Maintainer: <gmbnomis at gmail dot com> */
186 + .atag_offset = 0x100,
187 + .init_machine = nas6210_init,
188 + .map_io = kirkwood_map_io,
189 + .init_early = kirkwood_init_early,
190 + .init_irq = kirkwood_init_irq,
191 + .timer = &kirkwood_timer,
193 --- a/arch/arm/mach-kirkwood/Kconfig
194 +++ b/arch/arm/mach-kirkwood/Kconfig
195 @@ -136,6 +136,12 @@ config MACH_ICONNECT
196 Say 'Y' here if you want your kernel to support the
197 Iomega iConnect Wireless.
200 + bool "RaidSonic ICY BOX IB-NAS6210"
202 + Say 'Y' here if you want your kernel to support the
203 + RaidSonic ICY BOX IB-NAS6210 device.
208 --- a/arch/arm/mach-kirkwood/Makefile
209 +++ b/arch/arm/mach-kirkwood/Makefile
210 @@ -19,5 +19,6 @@ obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2
211 obj-$(CONFIG_MACH_NET2BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
212 obj-$(CONFIG_MACH_NET5BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
213 obj-$(CONFIG_MACH_T5325) += t5325-setup.o
214 +obj-$(CONFIG_MACH_NAS6210) += nas6210-setup.o
216 obj-$(CONFIG_CPU_IDLE) += cpuidle.o