aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/boot/dts/Makefile1
-rw-r--r--arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts55
-rw-r--r--arch/arm/mach-orion5x/Kconfig7
-rw-r--r--arch/arm/mach-orion5x/Makefile2
-rw-r--r--arch/arm/mach-orion5x/board-dt.c3
-rw-r--r--arch/arm/mach-orion5x/common.h7
-rw-r--r--arch/arm/mach-orion5x/edmini_v2-setup.c88
7 files changed, 72 insertions, 91 deletions
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index eef6545f65ee..f1ba69c2496a 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -81,6 +81,7 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
81 omap5-evm.dtb \ 81 omap5-evm.dtb \
82 am335x-evm.dtb \ 82 am335x-evm.dtb \
83 am335x-bone.dtb 83 am335x-bone.dtb
84dtb-$(CONFIG_ARCH_ORION5X) += orion5x-lacie-ethernet-disk-mini-v2.dtb
84dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb 85dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb
85dtb-$(CONFIG_ARCH_U8500) += snowball.dtb 86dtb-$(CONFIG_ARCH_U8500) += snowball.dtb
86dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \ 87dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
diff --git a/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts b/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts
new file mode 100644
index 000000000000..5a3a58b7e18f
--- /dev/null
+++ b/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts
@@ -0,0 +1,55 @@
1/*
2 * Copyright (C) 2012 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9/dts-v1/;
10/include/ "orion5x.dtsi"
11
12/ {
13 model = "LaCie Ethernet Disk mini V2";
14 compatible = "lacie,ethernet-disk-mini-v2", "marvell-orion5x-88f5182", "marvell,orion5x";
15
16 memory {
17 reg = <0x00000000 0x4000000>; /* 64 MB */
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200n8 earlyprintk";
22 };
23
24 ocp@f1000000 {
25 serial@12000 {
26 clock-frequency = <166666667>;
27 status = "okay";
28 };
29
30 sata@80000 {
31 status = "okay";
32 nr-ports = <2>;
33 };
34 };
35
36 gpio_keys {
37 compatible = "gpio-keys";
38 #address-cells = <1>;
39 #size-cells = <0>;
40 button@1 {
41 label = "Power-on Switch";
42 linux,code = <116>; /* KEY_POWER */
43 gpios = <&gpio0 18 0>;
44 };
45 };
46
47 gpio_leds {
48 compatible = "gpio-leds";
49
50 led@1 {
51 label = "power:blue";
52 gpios = <&gpio0 16 1>;
53 };
54 };
55};
diff --git a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig
index 0910c3bd0c99..2cb2f06c20f5 100644
--- a/arch/arm/mach-orion5x/Kconfig
+++ b/arch/arm/mach-orion5x/Kconfig
@@ -103,12 +103,13 @@ config MACH_MV2120
103 Say 'Y' here if you want your kernel to support the 103 Say 'Y' here if you want your kernel to support the
104 HP Media Vault mv2120 or mv5100. 104 HP Media Vault mv2120 or mv5100.
105 105
106config MACH_EDMINI_V2 106config MACH_EDMINI_V2_DT
107 bool "LaCie Ethernet Disk mini V2" 107 bool "LaCie Ethernet Disk mini V2 (Flattened Device Tree)"
108 select I2C_BOARDINFO 108 select I2C_BOARDINFO
109 select ARCH_ORION5X_DT
109 help 110 help
110 Say 'Y' here if you want your kernel to support the 111 Say 'Y' here if you want your kernel to support the
111 LaCie Ethernet Disk mini V2. 112 LaCie Ethernet Disk mini V2 (Flattened Device Tree).
112 113
113config MACH_D2NET 114config MACH_D2NET
114 bool "LaCie d2 Network" 115 bool "LaCie d2 Network"
diff --git a/arch/arm/mach-orion5x/Makefile b/arch/arm/mach-orion5x/Makefile
index 843e6deb66d0..9e809a7c05c0 100644
--- a/arch/arm/mach-orion5x/Makefile
+++ b/arch/arm/mach-orion5x/Makefile
@@ -12,7 +12,6 @@ obj-$(CONFIG_MACH_TS409) += ts409-setup.o tsx09-common.o
12obj-$(CONFIG_MACH_WRT350N_V2) += wrt350n-v2-setup.o 12obj-$(CONFIG_MACH_WRT350N_V2) += wrt350n-v2-setup.o
13obj-$(CONFIG_MACH_TS78XX) += ts78xx-setup.o 13obj-$(CONFIG_MACH_TS78XX) += ts78xx-setup.o
14obj-$(CONFIG_MACH_MV2120) += mv2120-setup.o 14obj-$(CONFIG_MACH_MV2120) += mv2120-setup.o
15obj-$(CONFIG_MACH_EDMINI_V2) += edmini_v2-setup.o
16obj-$(CONFIG_MACH_D2NET) += d2net-setup.o 15obj-$(CONFIG_MACH_D2NET) += d2net-setup.o
17obj-$(CONFIG_MACH_BIGDISK) += d2net-setup.o 16obj-$(CONFIG_MACH_BIGDISK) += d2net-setup.o
18obj-$(CONFIG_MACH_NET2BIG) += net2big-setup.o 17obj-$(CONFIG_MACH_NET2BIG) += net2big-setup.o
@@ -24,3 +23,4 @@ obj-$(CONFIG_MACH_RD88F6183AP_GE) += rd88f6183ap-ge-setup.o
24obj-$(CONFIG_MACH_LINKSTATION_LSCHL) += ls-chl-setup.o 23obj-$(CONFIG_MACH_LINKSTATION_LSCHL) += ls-chl-setup.o
25 24
26obj-$(CONFIG_ARCH_ORION5X_DT) += board-dt.o 25obj-$(CONFIG_ARCH_ORION5X_DT) += board-dt.o
26obj-$(CONFIG_MACH_EDMINI_V2_DT) += edmini_v2-setup.o
diff --git a/arch/arm/mach-orion5x/board-dt.c b/arch/arm/mach-orion5x/board-dt.c
index a26397f58f1f..32e5c211a89b 100644
--- a/arch/arm/mach-orion5x/board-dt.c
+++ b/arch/arm/mach-orion5x/board-dt.c
@@ -55,6 +55,9 @@ static void __init orion5x_dt_init(void)
55 disable_hlt(); 55 disable_hlt();
56 } 56 }
57 57
58 if (of_machine_is_compatible("lacie,ethernet-disk-mini-v2"))
59 edmini_v2_init();
60
58 of_platform_populate(NULL, of_default_bus_match_table, 61 of_platform_populate(NULL, of_default_bus_match_table,
59 orion5x_auxdata_lookup, NULL); 62 orion5x_auxdata_lookup, NULL);
60} 63}
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
index 2033b79089a7..7db5cdd9c4b7 100644
--- a/arch/arm/mach-orion5x/common.h
+++ b/arch/arm/mach-orion5x/common.h
@@ -56,6 +56,13 @@ int orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys);
56struct pci_bus *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys); 56struct pci_bus *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys);
57int orion5x_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); 57int orion5x_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
58 58
59/* board init functions for boards not fully converted to fdt */
60#ifdef CONFIG_MACH_EDMINI_V2_DT
61void edmini_v2_init(void);
62#else
63static inline void edmini_v2_init(void) {};
64#endif
65
59struct meminfo; 66struct meminfo;
60struct tag; 67struct tag;
61extern void __init tag_fixup_mem32(struct tag *, char **, struct meminfo *); 68extern void __init tag_fixup_mem32(struct tag *, char **, struct meminfo *);
diff --git a/arch/arm/mach-orion5x/edmini_v2-setup.c b/arch/arm/mach-orion5x/edmini_v2-setup.c
index 355e962137c7..d675e727803d 100644
--- a/arch/arm/mach-orion5x/edmini_v2-setup.c
+++ b/arch/arm/mach-orion5x/edmini_v2-setup.c
@@ -115,69 +115,6 @@ static struct i2c_board_info __initdata edmini_v2_i2c_rtc = {
115}; 115};
116 116
117/***************************************************************************** 117/*****************************************************************************
118 * Sata
119 ****************************************************************************/
120
121static struct mv_sata_platform_data edmini_v2_sata_data = {
122 .n_ports = 2,
123};
124
125/*****************************************************************************
126 * GPIO LED (simple - doesn't use hardware blinking support)
127 ****************************************************************************/
128
129#define EDMINI_V2_GPIO_LED_POWER 16
130
131static struct gpio_led edmini_v2_leds[] = {
132 {
133 .name = "power:blue",
134 .gpio = EDMINI_V2_GPIO_LED_POWER,
135 .active_low = 1,
136 },
137};
138
139static struct gpio_led_platform_data edmini_v2_led_data = {
140 .num_leds = ARRAY_SIZE(edmini_v2_leds),
141 .leds = edmini_v2_leds,
142};
143
144static struct platform_device edmini_v2_gpio_leds = {
145 .name = "leds-gpio",
146 .id = -1,
147 .dev = {
148 .platform_data = &edmini_v2_led_data,
149 },
150};
151
152/****************************************************************************
153 * GPIO key
154 ****************************************************************************/
155
156#define EDMINI_V2_GPIO_KEY_POWER 18
157
158static struct gpio_keys_button edmini_v2_buttons[] = {
159 {
160 .code = KEY_POWER,
161 .gpio = EDMINI_V2_GPIO_KEY_POWER,
162 .desc = "Power Button",
163 .active_low = 0,
164 },
165};
166
167static struct gpio_keys_platform_data edmini_v2_button_data = {
168 .buttons = edmini_v2_buttons,
169 .nbuttons = ARRAY_SIZE(edmini_v2_buttons),
170};
171
172static struct platform_device edmini_v2_gpio_buttons = {
173 .name = "gpio-keys",
174 .id = -1,
175 .dev = {
176 .platform_data = &edmini_v2_button_data,
177 },
178};
179
180/*****************************************************************************
181 * General Setup 118 * General Setup
182 ****************************************************************************/ 119 ****************************************************************************/
183static unsigned int edminiv2_mpp_modes[] __initdata = { 120static unsigned int edminiv2_mpp_modes[] __initdata = {
@@ -207,13 +144,8 @@ static unsigned int edminiv2_mpp_modes[] __initdata = {
207 0, 144 0,
208}; 145};
209 146
210static void __init edmini_v2_init(void) 147void __init edmini_v2_init(void)
211{ 148{
212 /*
213 * Setup basic Orion functions. Need to be called early.
214 */
215 orion5x_init();
216
217 orion5x_mpp_conf(edminiv2_mpp_modes); 149 orion5x_mpp_conf(edminiv2_mpp_modes);
218 150
219 /* 151 /*
@@ -221,15 +153,10 @@ static void __init edmini_v2_init(void)
221 */ 153 */
222 orion5x_ehci0_init(); 154 orion5x_ehci0_init();
223 orion5x_eth_init(&edmini_v2_eth_data); 155 orion5x_eth_init(&edmini_v2_eth_data);
224 orion5x_i2c_init();
225 orion5x_sata_init(&edmini_v2_sata_data);
226 orion5x_uart0_init();
227 156
228 orion5x_setup_dev_boot_win(EDMINI_V2_NOR_BOOT_BASE, 157 orion5x_setup_dev_boot_win(EDMINI_V2_NOR_BOOT_BASE,
229 EDMINI_V2_NOR_BOOT_SIZE); 158 EDMINI_V2_NOR_BOOT_SIZE);
230 platform_device_register(&edmini_v2_nor_flash); 159 platform_device_register(&edmini_v2_nor_flash);
231 platform_device_register(&edmini_v2_gpio_leds);
232 platform_device_register(&edmini_v2_gpio_buttons);
233 160
234 pr_notice("edmini_v2: USB device port, flash write and power-off " 161 pr_notice("edmini_v2: USB device port, flash write and power-off "
235 "are not yet supported.\n"); 162 "are not yet supported.\n");
@@ -247,16 +174,3 @@ static void __init edmini_v2_init(void)
247 174
248 i2c_register_board_info(0, &edmini_v2_i2c_rtc, 1); 175 i2c_register_board_info(0, &edmini_v2_i2c_rtc, 1);
249} 176}
250
251/* Warning: LaCie use a wrong mach-type (0x20e=526) in their bootloader. */
252MACHINE_START(EDMINI_V2, "LaCie Ethernet Disk mini V2")
253 /* Maintainer: Christopher Moore <moore@free.fr> */
254 .atag_offset = 0x100,
255 .init_machine = edmini_v2_init,
256 .map_io = orion5x_map_io,
257 .init_early = orion5x_init_early,
258 .init_irq = orion5x_init_irq,
259 .timer = &orion5x_timer,
260 .fixup = tag_fixup_mem32,
261 .restart = orion5x_restart,
262MACHINE_END