diff options
author | Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org> | 2012-04-18 17:16:41 -0400 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2012-05-14 23:12:27 -0400 |
commit | c06cd9bfcad4960023bac1f052da748824e24961 (patch) | |
tree | b2c01a3e2452f983324edb09e7fcf1bb65bb97b7 /arch/arm | |
parent | ff3e660b5a881b401b2b6735aa5334f433237dcb (diff) |
kirkwood: Add iconnect support
Add support for Iomega Iconnect system.
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Tested-By: Adam Baker <linux@baker-net.org.uk>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/boot/dts/kirkwood-iconnect.dts | 26 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/Kconfig | 6 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/Makefile.boot | 1 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/board-dt.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/board-iconnect.c | 165 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/common.h | 6 |
7 files changed, 209 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts new file mode 100644 index 00000000000..1ba75d4adec --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-iconnect.dts | |||
@@ -0,0 +1,26 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | /include/ "kirkwood.dtsi" | ||
4 | |||
5 | / { | ||
6 | model = "Iomega Iconnect"; | ||
7 | compatible = "iom,iconnect-1.1", "iom,iconnect", "mrvl,kirkwood-88f6281", "mrvl,kirkwood"; | ||
8 | |||
9 | memory { | ||
10 | device_type = "memory"; | ||
11 | reg = <0x00000000 0x10000000>; | ||
12 | }; | ||
13 | |||
14 | chosen { | ||
15 | bootargs = "console=ttyS0,115200n8 earlyprintk mtdparts=orion_nand:0xc0000@0x0(uboot),0x20000@0xa0000(env),0x300000@0x100000(zImage),0x300000@0x540000(initrd),0x1f400000@0x980000(boot)"; | ||
16 | linux,initrd-start = <0x4500040>; | ||
17 | linux,initrd-end = <0x4800000>; | ||
18 | }; | ||
19 | |||
20 | ocp@f1000000 { | ||
21 | serial@12000 { | ||
22 | clock-frequency = <200000000>; | ||
23 | status = "ok"; | ||
24 | }; | ||
25 | }; | ||
26 | }; | ||
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 636778e7c52..bbea3f6f6d3 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig | |||
@@ -58,6 +58,12 @@ config MACH_DREAMPLUG_DT | |||
58 | Say 'Y' here if you want your kernel to support the | 58 | Say 'Y' here if you want your kernel to support the |
59 | Marvell DreamPlug (Flattened Device Tree). | 59 | Marvell DreamPlug (Flattened Device Tree). |
60 | 60 | ||
61 | config MACH_ICONNECT_DT | ||
62 | bool "Iomega Iconnect (Flattened Device Tree)" | ||
63 | select ARCH_KIRKWOOD_DT | ||
64 | help | ||
65 | Say 'Y' here to enable Iomega Iconnect support. | ||
66 | |||
61 | config MACH_DLINK_KIRKWOOD_DT | 67 | config MACH_DLINK_KIRKWOOD_DT |
62 | bool "D-Link Kirkwood-based NAS (Flattened Device Tree)" | 68 | bool "D-Link Kirkwood-based NAS (Flattened Device Tree)" |
63 | select ARCH_KIRKWOOD_DT | 69 | select ARCH_KIRKWOOD_DT |
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index 36781b318eb..82a3d13e5dc 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile | |||
@@ -22,4 +22,5 @@ obj-$(CONFIG_MACH_T5325) += t5325-setup.o | |||
22 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o | 22 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o |
23 | obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o | 23 | obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o |
24 | obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o | 24 | obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o |
25 | obj-$(CONFIG_MACH_ICONNECT_DT) += board-iconnect.o | ||
25 | obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += board-dnskw.o | 26 | obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += board-dnskw.o |
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot index 8bbffbe1d9c..a827ca16406 100644 --- a/arch/arm/mach-kirkwood/Makefile.boot +++ b/arch/arm/mach-kirkwood/Makefile.boot | |||
@@ -5,3 +5,4 @@ initrd_phys-y := 0x00800000 | |||
5 | dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb | 5 | dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb |
6 | dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns320.dtb | 6 | dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns320.dtb |
7 | dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns325.dtb | 7 | dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns325.dtb |
8 | dtb-$(CONFIG_MACH_ICONNECT_DT) += kirkwood-iconnect.dtb | ||
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index 3ade0ec20c9..7e82a8e9379 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c | |||
@@ -59,6 +59,9 @@ static void __init kirkwood_dt_init(void) | |||
59 | if (of_machine_is_compatible("dlink,dns-kirkwood")) | 59 | if (of_machine_is_compatible("dlink,dns-kirkwood")) |
60 | dnskw_init(); | 60 | dnskw_init(); |
61 | 61 | ||
62 | if (of_machine_is_compatible("iom,iconnect")) | ||
63 | iconnect_init(); | ||
64 | |||
62 | of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL); | 65 | of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL); |
63 | } | 66 | } |
64 | 67 | ||
@@ -66,6 +69,7 @@ static const char *kirkwood_dt_board_compat[] = { | |||
66 | "globalscale,dreamplug", | 69 | "globalscale,dreamplug", |
67 | "dlink,dns-320", | 70 | "dlink,dns-320", |
68 | "dlink,dns-325", | 71 | "dlink,dns-325", |
72 | "iom,iconnect", | ||
69 | NULL | 73 | NULL |
70 | }; | 74 | }; |
71 | 75 | ||
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c new file mode 100644 index 00000000000..2222c573951 --- /dev/null +++ b/arch/arm/mach-kirkwood/board-iconnect.c | |||
@@ -0,0 +1,165 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/board-iconnect.c | ||
3 | * | ||
4 | * Iomega i-connect Board Setup | ||
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/of.h> | ||
15 | #include <linux/of_address.h> | ||
16 | #include <linux/of_fdt.h> | ||
17 | #include <linux/of_irq.h> | ||
18 | #include <linux/of_platform.h> | ||
19 | #include <linux/mtd/partitions.h> | ||
20 | #include <linux/mv643xx_eth.h> | ||
21 | #include <linux/gpio.h> | ||
22 | #include <linux/leds.h> | ||
23 | #include <linux/spi/flash.h> | ||
24 | #include <linux/spi/spi.h> | ||
25 | #include <linux/spi/orion_spi.h> | ||
26 | #include <linux/i2c.h> | ||
27 | #include <linux/input.h> | ||
28 | #include <linux/gpio_keys.h> | ||
29 | #include <asm/mach/arch.h> | ||
30 | #include <mach/kirkwood.h> | ||
31 | #include "common.h" | ||
32 | #include "mpp.h" | ||
33 | |||
34 | static struct mv643xx_eth_platform_data iconnect_ge00_data = { | ||
35 | .phy_addr = MV643XX_ETH_PHY_ADDR(11), | ||
36 | }; | ||
37 | |||
38 | static struct gpio_led iconnect_led_pins[] = { | ||
39 | { | ||
40 | .name = "led_level", | ||
41 | .gpio = 41, | ||
42 | .default_trigger = "default-on", | ||
43 | }, { | ||
44 | .name = "power:blue", | ||
45 | .gpio = 42, | ||
46 | .default_trigger = "timer", | ||
47 | }, { | ||
48 | .name = "power:red", | ||
49 | .gpio = 43, | ||
50 | }, { | ||
51 | .name = "usb1:blue", | ||
52 | .gpio = 44, | ||
53 | }, { | ||
54 | .name = "usb2:blue", | ||
55 | .gpio = 45, | ||
56 | }, { | ||
57 | .name = "usb3:blue", | ||
58 | .gpio = 46, | ||
59 | }, { | ||
60 | .name = "usb4:blue", | ||
61 | .gpio = 47, | ||
62 | }, { | ||
63 | .name = "otb:blue", | ||
64 | .gpio = 48, | ||
65 | }, | ||
66 | }; | ||
67 | |||
68 | static struct gpio_led_platform_data iconnect_led_data = { | ||
69 | .leds = iconnect_led_pins, | ||
70 | .num_leds = ARRAY_SIZE(iconnect_led_pins), | ||
71 | .gpio_blink_set = orion_gpio_led_blink_set, | ||
72 | }; | ||
73 | |||
74 | static struct platform_device iconnect_leds = { | ||
75 | .name = "leds-gpio", | ||
76 | .id = -1, | ||
77 | .dev = { | ||
78 | .platform_data = &iconnect_led_data, | ||
79 | } | ||
80 | }; | ||
81 | |||
82 | static unsigned int iconnect_mpp_config[] __initdata = { | ||
83 | MPP12_GPIO, | ||
84 | MPP35_GPIO, | ||
85 | MPP41_GPIO, | ||
86 | MPP42_GPIO, | ||
87 | MPP43_GPIO, | ||
88 | MPP44_GPIO, | ||
89 | MPP45_GPIO, | ||
90 | MPP46_GPIO, | ||
91 | MPP47_GPIO, | ||
92 | MPP48_GPIO, | ||
93 | 0 | ||
94 | }; | ||
95 | |||
96 | static struct i2c_board_info __initdata iconnect_board_info[] = { | ||
97 | { | ||
98 | I2C_BOARD_INFO("lm63", 0x4c), | ||
99 | }, | ||
100 | }; | ||
101 | |||
102 | static struct mtd_partition iconnect_nand_parts[] = { | ||
103 | { | ||
104 | .name = "flash", | ||
105 | .offset = 0, | ||
106 | .size = MTDPART_SIZ_FULL, | ||
107 | }, | ||
108 | }; | ||
109 | |||
110 | /* yikes... theses are the original input buttons */ | ||
111 | /* but I'm not convinced by the sw event choices */ | ||
112 | static struct gpio_keys_button iconnect_buttons[] = { | ||
113 | { | ||
114 | .type = EV_SW, | ||
115 | .code = SW_LID, | ||
116 | .gpio = 12, | ||
117 | .desc = "Reset Button", | ||
118 | .active_low = 1, | ||
119 | .debounce_interval = 100, | ||
120 | }, { | ||
121 | .type = EV_SW, | ||
122 | .code = SW_TABLET_MODE, | ||
123 | .gpio = 35, | ||
124 | .desc = "OTB Button", | ||
125 | .active_low = 1, | ||
126 | .debounce_interval = 100, | ||
127 | }, | ||
128 | }; | ||
129 | |||
130 | static struct gpio_keys_platform_data iconnect_button_data = { | ||
131 | .buttons = iconnect_buttons, | ||
132 | .nbuttons = ARRAY_SIZE(iconnect_buttons), | ||
133 | }; | ||
134 | |||
135 | static struct platform_device iconnect_button_device = { | ||
136 | .name = "gpio-keys", | ||
137 | .id = -1, | ||
138 | .num_resources = 0, | ||
139 | .dev = { | ||
140 | .platform_data = &iconnect_button_data, | ||
141 | }, | ||
142 | }; | ||
143 | |||
144 | void __init iconnect_init(void) | ||
145 | { | ||
146 | kirkwood_mpp_conf(iconnect_mpp_config); | ||
147 | kirkwood_nand_init(ARRAY_AND_SIZE(iconnect_nand_parts), 25); | ||
148 | kirkwood_i2c_init(); | ||
149 | i2c_register_board_info(0, iconnect_board_info, | ||
150 | ARRAY_SIZE(iconnect_board_info)); | ||
151 | |||
152 | kirkwood_ehci_init(); | ||
153 | kirkwood_ge00_init(&iconnect_ge00_data); | ||
154 | |||
155 | platform_device_register(&iconnect_button_device); | ||
156 | platform_device_register(&iconnect_leds); | ||
157 | } | ||
158 | |||
159 | static int __init iconnect_pci_init(void) | ||
160 | { | ||
161 | if (of_machine_is_compatible("iom,iconnect")) | ||
162 | kirkwood_pcie_init(KW_PCIE0); | ||
163 | return 0; | ||
164 | } | ||
165 | subsys_initcall(iconnect_pci_init); | ||
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 6195a377080..5f0365c74b0 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h | |||
@@ -64,6 +64,12 @@ void dnskw_init(void); | |||
64 | static inline void dnskw_init(void) {}; | 64 | static inline void dnskw_init(void) {}; |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | #ifdef CONFIG_MACH_ICONNECT_DT | ||
68 | void iconnect_init(void); | ||
69 | #else | ||
70 | static inline void iconnect_init(void) {}; | ||
71 | #endif | ||
72 | |||
67 | /* early init functions not converted to fdt yet */ | 73 | /* early init functions not converted to fdt yet */ |
68 | char *kirkwood_id(void); | 74 | char *kirkwood_id(void); |
69 | void kirkwood_l2_init(void); | 75 | void kirkwood_l2_init(void); |