aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorAlexey Kopytko <alexey@kopytko.ru>2008-09-25 09:47:30 -0400
committerNicolas Pitre <nico@cam.org>2008-09-25 17:00:01 -0400
commit7b0a26f2ca0001a13473b874d52b3d557e3d7289 (patch)
tree361e45560c71c32aabb2c578a3436084c771ee4a /arch/arm
parent4360bb41920ffacd4a935fa692768129ee5bef4e (diff)
[ARM] Orion: Add Buffalo Linkstation Mini support
This patch adds support for Buffalo Linkstation Mini board. Signed-off-by: Alexey Kopytko <alexey@kopytko.ru> Signed-off-by: Nicolas Pitre <nico@marvell.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/configs/orion5x_defconfig1
-rw-r--r--arch/arm/mach-orion5x/Kconfig7
-rw-r--r--arch/arm/mach-orion5x/Makefile1
-rw-r--r--arch/arm/mach-orion5x/lsmini-setup.c259
4 files changed, 268 insertions, 0 deletions
diff --git a/arch/arm/configs/orion5x_defconfig b/arch/arm/configs/orion5x_defconfig
index 1415cf56022b..06760f26eace 100644
--- a/arch/arm/configs/orion5x_defconfig
+++ b/arch/arm/configs/orion5x_defconfig
@@ -166,6 +166,7 @@ CONFIG_MACH_KUROBOX_PRO=y
166CONFIG_MACH_DNS323=y 166CONFIG_MACH_DNS323=y
167CONFIG_MACH_TS209=y 167CONFIG_MACH_TS209=y
168CONFIG_MACH_LINKSTATION_PRO=y 168CONFIG_MACH_LINKSTATION_PRO=y
169CONFIG_MACH_LINKSTATION_MINI=y
169CONFIG_MACH_TS409=y 170CONFIG_MACH_TS409=y
170CONFIG_MACH_WRT350N_V2=y 171CONFIG_MACH_WRT350N_V2=y
171CONFIG_MACH_TS78XX=y 172CONFIG_MACH_TS78XX=y
diff --git a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig
index c0ecf22ae819..f59a8d0e0824 100644
--- a/arch/arm/mach-orion5x/Kconfig
+++ b/arch/arm/mach-orion5x/Kconfig
@@ -50,6 +50,13 @@ config MACH_LINKSTATION_PRO
50 Buffalo Linkstation Pro/Live platform. Both v1 and 50 Buffalo Linkstation Pro/Live platform. Both v1 and
51 v2 devices are supported. 51 v2 devices are supported.
52 52
53config MACH_LINKSTATION_MINI
54 bool "Buffalo Linkstation Mini"
55 select I2C_BOARDINFO
56 help
57 Say 'Y' here if you want your kernel to support the
58 Buffalo Linkstation Mini platform.
59
53config MACH_TS409 60config MACH_TS409
54 bool "QNAP TS-409" 61 bool "QNAP TS-409"
55 help 62 help
diff --git a/arch/arm/mach-orion5x/Makefile b/arch/arm/mach-orion5x/Makefile
index 30681ed4c751..3d4a1bc12355 100644
--- a/arch/arm/mach-orion5x/Makefile
+++ b/arch/arm/mach-orion5x/Makefile
@@ -4,6 +4,7 @@ obj-$(CONFIG_MACH_RD88F5182) += rd88f5182-setup.o
4obj-$(CONFIG_MACH_KUROBOX_PRO) += kurobox_pro-setup.o 4obj-$(CONFIG_MACH_KUROBOX_PRO) += kurobox_pro-setup.o
5obj-$(CONFIG_MACH_TERASTATION_PRO2) += terastation_pro2-setup.o 5obj-$(CONFIG_MACH_TERASTATION_PRO2) += terastation_pro2-setup.o
6obj-$(CONFIG_MACH_LINKSTATION_PRO) += kurobox_pro-setup.o 6obj-$(CONFIG_MACH_LINKSTATION_PRO) += kurobox_pro-setup.o
7obj-$(CONFIG_MACH_LINKSTATION_MINI) += lsmini-setup.o
7obj-$(CONFIG_MACH_DNS323) += dns323-setup.o 8obj-$(CONFIG_MACH_DNS323) += dns323-setup.o
8obj-$(CONFIG_MACH_TS209) += ts209-setup.o tsx09-common.o 9obj-$(CONFIG_MACH_TS209) += ts209-setup.o tsx09-common.o
9obj-$(CONFIG_MACH_TS409) += ts409-setup.o tsx09-common.o 10obj-$(CONFIG_MACH_TS409) += ts409-setup.o tsx09-common.o
diff --git a/arch/arm/mach-orion5x/lsmini-setup.c b/arch/arm/mach-orion5x/lsmini-setup.c
new file mode 100644
index 000000000000..4311dafd7e26
--- /dev/null
+++ b/arch/arm/mach-orion5x/lsmini-setup.c
@@ -0,0 +1,259 @@
1/*
2 * arch/arm/mach-orion5x/lsmini-setup.c
3 *
4 * Maintainer: Alexey Kopytko <alexey@kopytko.ru>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/pci.h>
15#include <linux/mtd/physmap.h>
16#include <linux/mv643xx_eth.h>
17#include <linux/leds.h>
18#include <linux/gpio_keys.h>
19#include <linux/input.h>
20#include <linux/i2c.h>
21#include <linux/ata_platform.h>
22#include <asm/mach-types.h>
23#include <linux/gpio.h>
24#include <asm/mach/arch.h>
25#include "common.h"
26#include "mpp.h"
27#include "include/mach/system.h"
28
29/*****************************************************************************
30 * Linkstation Mini Info
31 ****************************************************************************/
32
33/*
34 * 256K NOR flash Device bus boot chip select
35 */
36
37#define LSMINI_NOR_BOOT_BASE 0xf4000000
38#define LSMINI_NOR_BOOT_SIZE SZ_256K
39
40/*****************************************************************************
41 * 256KB NOR Flash on BOOT Device
42 ****************************************************************************/
43
44static struct physmap_flash_data lsmini_nor_flash_data = {
45 .width = 1,
46};
47
48static struct resource lsmini_nor_flash_resource = {
49 .flags = IORESOURCE_MEM,
50 .start = LSMINI_NOR_BOOT_BASE,
51 .end = LSMINI_NOR_BOOT_BASE + LSMINI_NOR_BOOT_SIZE - 1,
52};
53
54static struct platform_device lsmini_nor_flash = {
55 .name = "physmap-flash",
56 .id = 0,
57 .dev = {
58 .platform_data = &lsmini_nor_flash_data,
59 },
60 .num_resources = 1,
61 .resource = &lsmini_nor_flash_resource,
62};
63
64/*****************************************************************************
65 * Ethernet
66 ****************************************************************************/
67
68static struct mv643xx_eth_platform_data lsmini_eth_data = {
69 .phy_addr = 8,
70};
71
72/*****************************************************************************
73 * RTC 5C372a on I2C bus
74 ****************************************************************************/
75
76static struct i2c_board_info __initdata lsmini_i2c_rtc = {
77 I2C_BOARD_INFO("rs5c372a", 0x32),
78};
79
80/*****************************************************************************
81 * LEDs attached to GPIO
82 ****************************************************************************/
83
84#define LSMINI_GPIO_LED_ALARM 2
85#define LSMINI_GPIO_LED_INFO 3
86#define LSMINI_GPIO_LED_FUNC 9
87#define LSMINI_GPIO_LED_PWR 14
88
89static struct gpio_led lsmini_led_pins[] = {
90 {
91 .name = "alarm:red",
92 .gpio = LSMINI_GPIO_LED_ALARM,
93 .active_low = 1,
94 }, {
95 .name = "info:amber",
96 .gpio = LSMINI_GPIO_LED_INFO,
97 .active_low = 1,
98 }, {
99 .name = "func:blue:top",
100 .gpio = LSMINI_GPIO_LED_FUNC,
101 .active_low = 1,
102 }, {
103 .name = "power:blue:bottom",
104 .gpio = LSMINI_GPIO_LED_PWR,
105 },
106};
107
108static struct gpio_led_platform_data lsmini_led_data = {
109 .leds = lsmini_led_pins,
110 .num_leds = ARRAY_SIZE(lsmini_led_pins),
111};
112
113static struct platform_device lsmini_leds = {
114 .name = "leds-gpio",
115 .id = -1,
116 .dev = {
117 .platform_data = &lsmini_led_data,
118 },
119};
120
121/****************************************************************************
122 * GPIO Attached Keys
123 ****************************************************************************/
124
125#define LSMINI_GPIO_KEY_FUNC 15
126#define LSMINI_GPIO_KEY_POWER 18
127#define LSMINI_GPIO_KEY_AUTOPOWER 17
128
129#define LSMINI_SW_POWER 0x00
130#define LSMINI_SW_AUTOPOWER 0x01
131
132static struct gpio_keys_button lsmini_buttons[] = {
133 {
134 .code = KEY_OPTION,
135 .gpio = LSMINI_GPIO_KEY_FUNC,
136 .desc = "Function Button",
137 .active_low = 1,
138 }, {
139 .type = EV_SW,
140 .code = LSMINI_SW_POWER,
141 .gpio = LSMINI_GPIO_KEY_POWER,
142 .desc = "Power-on Switch",
143 .active_low = 1,
144 }, {
145 .type = EV_SW,
146 .code = LSMINI_SW_AUTOPOWER,
147 .gpio = LSMINI_GPIO_KEY_AUTOPOWER,
148 .desc = "Power-auto Switch",
149 .active_low = 1,
150 },
151};
152
153static struct gpio_keys_platform_data lsmini_button_data = {
154 .buttons = lsmini_buttons,
155 .nbuttons = ARRAY_SIZE(lsmini_buttons),
156};
157
158static struct platform_device lsmini_button_device = {
159 .name = "gpio-keys",
160 .id = -1,
161 .num_resources = 0,
162 .dev = {
163 .platform_data = &lsmini_button_data,
164 },
165};
166
167
168/*****************************************************************************
169 * SATA
170 ****************************************************************************/
171static struct mv_sata_platform_data lsmini_sata_data = {
172 .n_ports = 2,
173};
174
175
176/*****************************************************************************
177 * General Setup
178 ****************************************************************************/
179
180#define LSMINI_GPIO_USB_POWER 16
181#define LSMINI_GPIO_AUTO_POWER 17
182#define LSMINI_GPIO_POWER 18
183
184#define LSMINI_GPIO_HDD_POWER0 1
185#define LSMINI_GPIO_HDD_POWER1 19
186
187static struct orion5x_mpp_mode lsmini_mpp_modes[] __initdata = {
188 { 0, MPP_UNUSED }, /* LED_RESERVE1 (unused) */
189 { 1, MPP_GPIO }, /* HDD_PWR */
190 { 2, MPP_GPIO }, /* LED_ALARM */
191 { 3, MPP_GPIO }, /* LED_INFO */
192 { 4, MPP_UNUSED },
193 { 5, MPP_UNUSED },
194 { 6, MPP_UNUSED },
195 { 7, MPP_UNUSED },
196 { 8, MPP_UNUSED },
197 { 9, MPP_GPIO }, /* LED_FUNC */
198 { 10, MPP_UNUSED },
199 { 11, MPP_UNUSED }, /* LED_ETH (dummy) */
200 { 12, MPP_UNUSED },
201 { 13, MPP_UNUSED },
202 { 14, MPP_GPIO }, /* LED_PWR */
203 { 15, MPP_GPIO }, /* FUNC */
204 { 16, MPP_GPIO }, /* USB_PWR */
205 { 17, MPP_GPIO }, /* AUTO_POWER */
206 { 18, MPP_GPIO }, /* POWER */
207 { 19, MPP_GPIO }, /* HDD_PWR1 */
208 { -1 },
209};
210
211static void __init lsmini_init(void)
212{
213 /*
214 * Setup basic Orion functions. Need to be called early.
215 */
216 orion5x_init();
217
218 orion5x_mpp_conf(lsmini_mpp_modes);
219
220 /*
221 * Configure peripherals.
222 */
223 orion5x_ehci0_init();
224 orion5x_ehci1_init();
225 orion5x_eth_init(&lsmini_eth_data);
226 orion5x_i2c_init();
227 orion5x_sata_init(&lsmini_sata_data);
228 orion5x_uart0_init();
229 orion5x_xor_init();
230
231 orion5x_setup_dev_boot_win(LSMINI_NOR_BOOT_BASE,
232 LSMINI_NOR_BOOT_SIZE);
233 platform_device_register(&lsmini_nor_flash);
234
235 platform_device_register(&lsmini_button_device);
236
237 platform_device_register(&lsmini_leds);
238
239 i2c_register_board_info(0, &lsmini_i2c_rtc, 1);
240
241 /* enable USB power */
242 gpio_set_value(LSMINI_GPIO_USB_POWER, 1);
243
244 pr_info("%s: finished\n", __func__);
245}
246
247#ifdef CONFIG_MACH_LINKSTATION_MINI
248MACHINE_START(LINKSTATION_MINI, "Buffalo Linkstation Mini")
249 /* Maintainer: Alexey Kopytko <alexey@kopytko.ru> */
250 .phys_io = ORION5X_REGS_PHYS_BASE,
251 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
252 .boot_params = 0x00000100,
253 .init_machine = lsmini_init,
254 .map_io = orion5x_map_io,
255 .init_irq = orion5x_init_irq,
256 .timer = &orion5x_timer,
257 .fixup = tag_fixup_mem32,
258MACHINE_END
259#endif