Skip to contentSkip to conversation

ARM: Kirkwood: Iomega_IX2_200 DT support Signed-off-by: Alan M Butler <[email protected]>

PATCH New Alan M Butler 2 participants 4 messages Aug 20, 2012 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 ARM: Kirkwood: Iomega_IX2_200 DT support Signed-off-by: Alan M Butler <[email protected]>

Patch version 4.
Add support for the Iomega ix2-200.
Led's and buttons working as of kernel 3.6-rc2
Product page:
http://go.iomega.com/en/products/network-storage-desktop/storcenter-network-storage-solution/network-hard-drive-ix2-200-cloud/?partner=4735#tech_specsItem_tab

---
 arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts |  105 +++++++++++++++++++++++++
 arch/arm/mach-kirkwood/Kconfig                |    7 ++
 arch/arm/mach-kirkwood/Makefile               |    1 +
 arch/arm/mach-kirkwood/Makefile.boot          |    1 +
 arch/arm/mach-kirkwood/board-dt.c             |    4 +
 arch/arm/mach-kirkwood/board-iomega_ix2_200.c |   79 +++++++++++++++++++
 arch/arm/mach-kirkwood/common.h               |    6 ++
 7 files changed, 203 insertions(+)
 create mode 100644 arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
 create mode 100644 arch/arm/mach-kirkwood/board-iomega_ix2_200.c
arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts new file +105 -0
new file mode 100644
index 0000000..865aeec
@@ -0,0 +1,105 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+
+/ {
+	model = "Iomega StorCenter ix2-200";
+	compatible = "iom,ix2-200", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x10000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+	ocp at f1000000 {
+		i2c at 11000 {
+			status = "okay";
+
+			lm63: lm63 at 4c {
+				compatible = "national,lm63";
+				reg = <0x4c>;
+			};
+		};
+
+		serial at 12000 {
+			clock-frequency = <200000000>;
+			status = "ok";
+		};
+
+		nand at 3000000 {
+			status = "okay";
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0000000 0x100000>;
+				read-only;
+			};
+
+			partition at a0000 {
+				label = "env";
+				reg = <0xa0000 0x20000>;
+				read-only;
+			};
+
+			partition at 100000 {
+				label = "uImage";
+				reg = <0x100000 0x300000>;
+			};
+
+			partition at 400000 {
+				label = "uInitrd";
+				reg = <0x540000 0x1000000>;
+			};
+		};
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <2>;
+		};
+
+	};
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		power_led {
+			label = "status:white:power_led";
+			gpios = <&gpio0 16 0>;
+			linux,default-trigger = "default-on";
+		};
+		health_led1 {
+			label = "status:red:health_led";
+			gpios = <&gpio1 5 0>;
+		};
+		health_led2 {
+			label = "status:white:health_led";
+			gpios = <&gpio1 4 0>;
+		};
+		backup_led {
+			label = "status:blue:backup_led";
+			gpios = <&gpio0 15 0>;
+		};
+	};
+	gpio-keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		Power {
+			label = "Power Button";
+			linux,code = <116>;
+			gpios = <&gpio0 14 1>;
+		};
+		Reset {
+			label = "Reset Button";
+			linux,code = <0x198>;
+			gpios = <&gpio0 12 1>;
+		};
+		OTB {
+			label = "OTB Button";
+			linux,code = <133>;
+			gpios = <&gpio1 3 1>;
+		};
+	};
+};
arch/arm/mach-kirkwood/Kconfig +7 -0
index ca5c15a..bee8451 100644
@@ -195,6 +195,13 @@ config MACH_T5325
 	  Say 'Y' here if you want your kernel to support the
 	  HP t5325 Thin Client.
 
+config MACH_IOMEGA_IX2_200_DT
+	bool "Iomega StorCenter ix2-200 (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Iomega StorCenter ix2-200 (Flattened Device Tree).
+
 endmenu
 
 endif
arch/arm/mach-kirkwood/Makefile +1 -0
index 055c85a..f5484dc 100644
@@ -28,3 +28,4 @@ obj-$(CONFIG_MACH_IB62X0_DT)		+= board-ib62x0.o
 obj-$(CONFIG_MACH_TS219_DT)		+= board-ts219.o tsx1x-common.o
 obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
 obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
+obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)	+= board-iomega_ix2_200.o
arch/arm/mach-kirkwood/Makefile.boot +1 -0
index a571755..59b719d 100644
@@ -11,3 +11,4 @@ dtb-$(CONFIG_MACH_TS219_DT)	+= kirkwood-qnap-ts219.dtb
 dtb-$(CONFIG_MACH_GOFLEXNET_DT) += kirkwood-goflexnet.dtb
 dtb-$(CONFIG_MACH_LSXL_DT) += kirkwood-lschlv2.dtb
 dtb-$(CONFIG_MACH_LSXL_DT) += kirkwood-lsxhl.dtb
+dtb-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += kirkwood-iomega_ix2_200.dtb
arch/arm/mach-kirkwood/board-dt.c +4 -0
index e4eb450..9b3ec17 100644
@@ -87,6 +87,9 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("buffalo,lsxl"))
 		lsxl_init();
 
+	if (of_machine_is_compatible("iom,ix2-200"))
+		iomega_ix2_200_init();
+
 	of_platform_populate(NULL, kirkwood_dt_match_table,
 			     kirkwood_auxdata_lookup, NULL);
 }
@@ -100,6 +103,7 @@ static const char *kirkwood_dt_board_compat[] = {
 	"qnap,ts219",
 	"seagate,goflexnet",
 	"buffalo,lsxl",
+	"iom,ix2-200",
 	NULL
 };
 
arch/arm/mach-kirkwood/board-iomega_ix2_200.c new file +79 -0

79 lines not on this page · raw message

arch/arm/mach-kirkwood/common.h +6 -0
index 304dd1a..d5d4064 100644
@@ -94,6 +94,12 @@ void lsxl_init(void);
 static inline void lsxl_init(void) {};
 #endif
 
+#ifdef CONFIG_MACH_IOMEGA_IX2_200_DT
+void iomega_ix2_200_init(void);
+#else
+static inline void iomega_ix2_200_init(void) {};
+#endif
+
 /* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 1/1 ARM: Kirkwood: Iomega_IX2_200 DT support Signed-off-by: Alan M Butler <[email protected]>

Hi Alan

Overall this is looking good.

Just a few minor comments below.

Quoted 23 lines
arch/arm/mach-kirkwood/board-iomega_ix2_200.c new file +17 -0
new file mode 100644
index 0000000..0c78752
@@ -0,0 +1,79 @@
+/*
+ * arch/arm/mach-kirkwood/board-iomega_ix2_200.c
+ *
+ * Iomega StorCenter ix2-200
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/irq.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>

arch/arm/mach-kirkwood/board-iomega_ix2_200.c line 27

Quoted 10 lines
arch/arm/mach-kirkwood/board-iomega_ix2_200.c new file +10 -0
+#include <linux/ethtool.h>
+#include <net/dsa.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/i2c.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include "common.h"
+#include "mpp.h"

It would be good to remove all the unneeded include files.

arch/arm/mach-kirkwood/board-iomega_ix2_200.c line 33

Quoted 6 lines
arch/arm/mach-kirkwood/board-iomega_ix2_200.c new file +6 -0
+
+static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = {
+	.phy_addr       = MV643XX_ETH_PHY_NONE,
+	.speed          = SPEED_1000,
+	.duplex         = DUPLEX_FULL,
+};

It is somewhat unusual to have this configuration, 1000 full. Is this a hardware limitation? Or is the port connected to an internal switch? Maybe add a comment why its hard coded.

Andrew

#3 lore raw

PATCH 1/1 ARM: Kirkwood: Iomega_IX2_200 DT support Signed-off-by: Alan M Butler <[email protected]>

Quoted 53 lines · Andrew Lunn

Hi Alan

Overall this is looking good.

Just a few minor comments below.

Quoted 23 lines
arch/arm/mach-kirkwood/board-iomega_ix2_200.c new file +17 -0
new file mode 100644
index 0000000..0c78752
@@ -0,0 +1,79 @@
+/*
+ * arch/arm/mach-kirkwood/board-iomega_ix2_200.c
+ *
+ * Iomega StorCenter ix2-200
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/irq.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>

arch/arm/mach-kirkwood/board-iomega_ix2_200.c line 27

Quoted 10 lines
arch/arm/mach-kirkwood/board-iomega_ix2_200.c new file +10 -0
+#include <linux/ethtool.h>
+#include <net/dsa.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/i2c.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include "common.h"
+#include "mpp.h"

It would be good to remove all the unneeded include files.

arch/arm/mach-kirkwood/board-iomega_ix2_200.c line 33

Quoted 6 lines
arch/arm/mach-kirkwood/board-iomega_ix2_200.c new file +6 -0
+
+static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = {
+     .phy_addr       = MV643XX_ETH_PHY_NONE,
+     .speed          = SPEED_1000,
+     .duplex         = DUPLEX_FULL,
+};

It is somewhat unusual to have this configuration, 1000 full. Is this a hardware limitation? Or is the port connected to an internal switch? Maybe add a comment why its hard coded.

Quoted 2 lines

Andrew

the only 2 includes i can think of that might be able to be removed are:

#include <linux/ethtool.h>
#include <net/dsa.h>

As they do not appear in the iconnect or the goflexnet which i have been using as my guide to makeing the dts file.
But i am not sure about the include files its probably best to leave them the way they are maybe?.

As for the network that was setup that way in the origional modified config file and in uboot on the device it states 2 network devices egiga0 and egiga1 i believe it refers to them by but the device only has only 1 phisical network interface (egiga1) so i think there must be some kind of switch inside.

#4 lore raw

PATCH 1/1 ARM: Kirkwood: Iomega_IX2_200 DT support Signed-off-by: Alan M Butler <[email protected]>

Quoted 31 lines
Quoted 31 lines
Quoted 7 lines
arch/arm/mach-kirkwood/board-iomega_ix2_200.c new file +7 -0
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/irq.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>

arch/arm/mach-kirkwood/board-iomega_ix2_200.c line 27

Quoted 10 lines
arch/arm/mach-kirkwood/board-iomega_ix2_200.c new file +10 -0
+#include <linux/ethtool.h>
+#include <net/dsa.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/i2c.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include "common.h"
+#include "mpp.h"

It would be good to remove all the unneeded include files.

arch/arm/mach-kirkwood/board-iomega_ix2_200.c line 33

Quoted 6 lines
arch/arm/mach-kirkwood/board-iomega_ix2_200.c new file +6 -0
+
+static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = {
+     .phy_addr       = MV643XX_ETH_PHY_NONE,
+     .speed          = SPEED_1000,
+     .duplex         = DUPLEX_FULL,
+};

It is somewhat unusual to have this configuration, 1000 full. Is this a hardware limitation? Or is the port connected to an internal switch? Maybe add a comment why its hard coded.

Quoted 7 lines
Quoted 2 lines

Andrew

the only 2 includes i can think of that might be able to be removed are:

#include <linux/ethtool.h>
#include <net/dsa.h>

I think you can remove a lot more. I _think_ you can remove all these:

#include <linux/irq.h>
#include <linux/mtd/partitions.h>
#include <linux/ata_platform.h>
#include <net/dsa.h>
#include <linux/gpio.h>
#include <linux/leds.h>
#include <linux/i2c.h>

and maybe:

#include <asm/mach-types.h>
#include <asm/mach/arch.h>

Try it and see.

Quoted 5 lines

As for the network that was setup that way in the origional modified config file and in uboot on the device it states 2 network devices egiga0 and egiga1 i believe it refers to them by but the device only has only 1 phisical network interface (egiga1) so i think there must be some kind of switch inside.

You should only instantiate the one that is usable, comes outside of the box. I would delete the other.

Andrew