diff mbox

ARM: Kirkwood: Iomega IX2-200 Device Tree Support Patch v2 Signed-off-by: Alan M Butler <alanbutty12@gmail.com>

Message ID 05c3c186d3675cde472bcc3a01198b6726c48a3c.1345196553.git.alanbutty12@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

alan butler Aug. 17, 2012, 9:56 a.m. UTC
---
 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(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
 create mode 100644 arch/arm/mach-kirkwood/board-iomega_ix2_200.c

Signed-off-by: Alan M Butler <alanbutty12@gmail.com>

Comments

Jason Cooper Aug. 19, 2012, 2:06 a.m. UTC | #1
You're so close!

Your subject line should be "[PATCH] ARM: Kirkwood: Iomega ix2-200 DT
support"

Also, please add a short description of the device and a link to iomega
page describing it to the commit message (should start on the third line
of the commit message, above the Signed-off-by:).

On Fri, Aug 17, 2012 at 10:56:14AM +0100, Alan M Butler wrote:

VVVVVVV--- This is where the signed-off-by goes, not at the end.

> Signed-off-by: Alan M Butler <alanbutty12@gmail.com>
> 
> ---
>  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(+), 0 deletions(-)
>  create mode 100644 arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
>  create mode 100644 arch/arm/mach-kirkwood/board-iomega_ix2_200.c
> 
> diff --git a/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
> new file mode 100644
> index 0000000..821a76b
> --- /dev/null
> +++ b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
> @@ -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 coherent_pool=1M";

Please remove 'coherent_pool=1M' that's a diagnosis tool, we still need
to get to the bottom of what that fixed.

> +	};
> +
> +	ocp@f1000000 {
> +		i2c@11000 {
> +			status = "okay";
> +
> +			lm63: lm63@4c {
> +				compatible = "national,lm63";
> +				reg = <0x4c>;
> +			};
> +		};
> +
> +		serial@12000 {
> +			clock-frequency = <200000000>;
> +			status = "ok";
> +		};
> +
> +		nand@3000000 {
> +			status = "okay";
> +
> +			partition@0 {
> +				label = "u-boot";
> +				reg = <0x0000000 0x100000>;
> +				read-only;
> +			};
> +
> +			partition@a0000 {
> +				label = "env";
> +				reg = <0xa0000 0x20000>;
> +				read-only;
> +			};
> +
> +			partition@100000 {
> +				label = "uImage";
> +				reg = <0x100000 0x300000>;
> +			};
> +
> +			partition@400000 {
> +				label = "uInitrd";
> +				reg = <0x540000 0x1000000>;
> +			};
> +		};
> +		sata@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>;
> +		};
> +	};

Did Fabio's patch fix gpio-keys?  If so, please list that as a
dependency below the '---', ie 3 lines below the Signed-off-by:.
Include the link he supplied with that comment.

> +};
> diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> index ca5c15a..bee8451 100644
> --- a/arch/arm/mach-kirkwood/Kconfig
> +++ b/arch/arm/mach-kirkwood/Kconfig
> @@ -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
> diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
> index 055c85a..f5484dc 100644
> --- a/arch/arm/mach-kirkwood/Makefile
> +++ b/arch/arm/mach-kirkwood/Makefile
> @@ -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
> diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
> index 2a576ab..f8ef771 100644
> --- a/arch/arm/mach-kirkwood/Makefile.boot
> +++ b/arch/arm/mach-kirkwood/Makefile.boot
> @@ -11,3 +11,4 @@ dtb-$(CONFIG_MACH_TS219_DT)	+= kirkwood-qnap-ts219.dtb
>  dtb-$(CONFIG_MACH_GOFLEXNET_DT) += kirkwood-goflexnet.dtb
>  dbt-$(CONFIG_MACH_LSXL_DT) += kirkwood-lschlv2.dtb
>  dbt-$(CONFIG_MACH_LSXL_DT) += kirkwood-lsxhl.dtb
> +dtb-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += kirkwood-iomega_ix2_200.dtb
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index e4eb450..9b3ec17 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -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
>  };
>  
> diff --git a/arch/arm/mach-kirkwood/board-iomega_ix2_200.c b/arch/arm/mach-kirkwood/board-iomega_ix2_200.c
> new file mode 100644
> index 0000000..0c78752
> --- /dev/null
> +++ b/arch/arm/mach-kirkwood/board-iomega_ix2_200.c
> @@ -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>
> +#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"
> +
> +static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = {
> +	.phy_addr       = MV643XX_ETH_PHY_NONE,
> +	.speed          = SPEED_1000,
> +	.duplex         = DUPLEX_FULL,
> +};
> +
> +static struct mv643xx_eth_platform_data iomega_ix2_200_ge01_data = {
> +	.phy_addr	= MV643XX_ETH_PHY_ADDR(11),
> +};
> +
> +static unsigned int iomega_ix2_200_mpp_config[] __initdata = {
> +	MPP12_GPIO,			/* Reset Button */
> +	MPP14_GPIO,			/* Power Button */
> +	MPP15_GPIO,			/* Backup LED (blue) */
> +	MPP16_GPIO,			/* Power LED (white) */
> +	MPP35_GPIO,			/* OTB Button */
> +	MPP36_GPIO,			/* Rebuild LED (white) */
> +	MPP37_GPIO,			/* Health LED (red) */
> +	MPP38_GPIO,			/* SATA LED brightness control 1 */
> +	MPP39_GPIO,			/* SATA LED brightness control 2 */
> +	MPP40_GPIO,			/* Backup LED brightness control 1 */
> +	MPP41_GPIO,			/* Backup LED brightness control 2 */
> +	MPP42_GPIO,			/* Power LED brightness control 1 */
> +	MPP43_GPIO,			/* Power LED brightness control 2 */
> +	MPP44_GPIO,			/* Health LED brightness control 1 */
> +	MPP45_GPIO,			/* Health LED brightness control 2 */
> +	MPP46_GPIO,			/* Rebuild LED brightness control 1 */
> +	MPP47_GPIO,			/* Rebuild LED brightness control 2 */
> +	0
> +};
> +
> +void __init iomega_ix2_200_init(void)
> +{
> +	/*
> +	 * Basic setup. Needs to be called early.
> +	 */
> +	kirkwood_mpp_conf(iomega_ix2_200_mpp_config);
> +
> +	kirkwood_ehci_init();
> +
> +	kirkwood_ge00_init(&iomega_ix2_200_ge00_data);
> +	kirkwood_ge01_init(&iomega_ix2_200_ge01_data);
> +}
> +static int __init iomega_ix2_200_pci_init(void)
> +{
> +	if (of_machine_is_compatible("iom,ix2-200"))
> +		kirkwood_pcie_init(KW_PCIE0);
> +	return 0;
> +}
> +subsys_initcall(iomega_ix2_200_pci_init);
> +
> diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
> index 304dd1a..d5d4064 100644
> --- a/arch/arm/mach-kirkwood/common.h
> +++ b/arch/arm/mach-kirkwood/common.h
> @@ -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);
> Signed-off-by: Alan M Butler <alanbutty12@gmail.com>

This is the wrong place for the Signed-off-by:, please see my comments,
above.  If anyone tries to apply this patch it will fail because git or
patch will think the sob is a line of context.  There won't be a match,
so it will fail.

hth,

Jason.
alan butler Aug. 19, 2012, 8:45 a.m. UTC | #2
On 19 August 2012 03:06, Jason Cooper <jason@lakedaemon.net> wrote:
> You're so close!
>
> Your subject line should be "[PATCH] ARM: Kirkwood: Iomega ix2-200 DT
> support"
>
> Also, please add a short description of the device and a link to iomega
> page describing it to the commit message (should start on the third line
> of the commit message, above the Signed-off-by:).
>
> On Fri, Aug 17, 2012 at 10:56:14AM +0100, Alan M Butler wrote:
>
> VVVVVVV--- This is where the signed-off-by goes, not at the end.
>
>> Signed-off-by: Alan M Butler <alanbutty12@gmail.com>
>>
>> ---
>>  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(+), 0 deletions(-)
>>  create mode 100644 arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
>>  create mode 100644 arch/arm/mach-kirkwood/board-iomega_ix2_200.c
>>
>> diff --git a/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
>> new file mode 100644
>> index 0000000..821a76b
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
>> @@ -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 coherent_pool=1M";
>
> Please remove 'coherent_pool=1M' that's a diagnosis tool, we still need
> to get to the bottom of what that fixed.
>
>> +     };
>> +
>> +     ocp@f1000000 {
>> +             i2c@11000 {
>> +                     status = "okay";
>> +
>> +                     lm63: lm63@4c {
>> +                             compatible = "national,lm63";
>> +                             reg = <0x4c>;
>> +                     };
>> +             };
>> +
>> +             serial@12000 {
>> +                     clock-frequency = <200000000>;
>> +                     status = "ok";
>> +             };
>> +
>> +             nand@3000000 {
>> +                     status = "okay";
>> +
>> +                     partition@0 {
>> +                             label = "u-boot";
>> +                             reg = <0x0000000 0x100000>;
>> +                             read-only;
>> +                     };
>> +
>> +                     partition@a0000 {
>> +                             label = "env";
>> +                             reg = <0xa0000 0x20000>;
>> +                             read-only;
>> +                     };
>> +
>> +                     partition@100000 {
>> +                             label = "uImage";
>> +                             reg = <0x100000 0x300000>;
>> +                     };
>> +
>> +                     partition@400000 {
>> +                             label = "uInitrd";
>> +                             reg = <0x540000 0x1000000>;
>> +                     };
>> +             };
>> +             sata@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>;
>> +             };
>> +     };
>
> Did Fabio's patch fix gpio-keys?  If so, please list that as a
> dependency below the '---', ie 3 lines below the Signed-off-by:.
> Include the link he supplied with that comment.
>
>> +};
>> diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
>> index ca5c15a..bee8451 100644
>> --- a/arch/arm/mach-kirkwood/Kconfig
>> +++ b/arch/arm/mach-kirkwood/Kconfig
>> @@ -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
>> diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
>> index 055c85a..f5484dc 100644
>> --- a/arch/arm/mach-kirkwood/Makefile
>> +++ b/arch/arm/mach-kirkwood/Makefile
>> @@ -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
>> diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
>> index 2a576ab..f8ef771 100644
>> --- a/arch/arm/mach-kirkwood/Makefile.boot
>> +++ b/arch/arm/mach-kirkwood/Makefile.boot
>> @@ -11,3 +11,4 @@ dtb-$(CONFIG_MACH_TS219_DT) += kirkwood-qnap-ts219.dtb
>>  dtb-$(CONFIG_MACH_GOFLEXNET_DT) += kirkwood-goflexnet.dtb
>>  dbt-$(CONFIG_MACH_LSXL_DT) += kirkwood-lschlv2.dtb
>>  dbt-$(CONFIG_MACH_LSXL_DT) += kirkwood-lsxhl.dtb
>> +dtb-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += kirkwood-iomega_ix2_200.dtb
>> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
>> index e4eb450..9b3ec17 100644
>> --- a/arch/arm/mach-kirkwood/board-dt.c
>> +++ b/arch/arm/mach-kirkwood/board-dt.c
>> @@ -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
>>  };
>>
>> diff --git a/arch/arm/mach-kirkwood/board-iomega_ix2_200.c b/arch/arm/mach-kirkwood/board-iomega_ix2_200.c
>> new file mode 100644
>> index 0000000..0c78752
>> --- /dev/null
>> +++ b/arch/arm/mach-kirkwood/board-iomega_ix2_200.c
>> @@ -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>
>> +#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"
>> +
>> +static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = {
>> +     .phy_addr       = MV643XX_ETH_PHY_NONE,
>> +     .speed          = SPEED_1000,
>> +     .duplex         = DUPLEX_FULL,
>> +};
>> +
>> +static struct mv643xx_eth_platform_data iomega_ix2_200_ge01_data = {
>> +     .phy_addr       = MV643XX_ETH_PHY_ADDR(11),
>> +};
>> +
>> +static unsigned int iomega_ix2_200_mpp_config[] __initdata = {
>> +     MPP12_GPIO,                     /* Reset Button */
>> +     MPP14_GPIO,                     /* Power Button */
>> +     MPP15_GPIO,                     /* Backup LED (blue) */
>> +     MPP16_GPIO,                     /* Power LED (white) */
>> +     MPP35_GPIO,                     /* OTB Button */
>> +     MPP36_GPIO,                     /* Rebuild LED (white) */
>> +     MPP37_GPIO,                     /* Health LED (red) */
>> +     MPP38_GPIO,                     /* SATA LED brightness control 1 */
>> +     MPP39_GPIO,                     /* SATA LED brightness control 2 */
>> +     MPP40_GPIO,                     /* Backup LED brightness control 1 */
>> +     MPP41_GPIO,                     /* Backup LED brightness control 2 */
>> +     MPP42_GPIO,                     /* Power LED brightness control 1 */
>> +     MPP43_GPIO,                     /* Power LED brightness control 2 */
>> +     MPP44_GPIO,                     /* Health LED brightness control 1 */
>> +     MPP45_GPIO,                     /* Health LED brightness control 2 */
>> +     MPP46_GPIO,                     /* Rebuild LED brightness control 1 */
>> +     MPP47_GPIO,                     /* Rebuild LED brightness control 2 */
>> +     0
>> +};
>> +
>> +void __init iomega_ix2_200_init(void)
>> +{
>> +     /*
>> +      * Basic setup. Needs to be called early.
>> +      */
>> +     kirkwood_mpp_conf(iomega_ix2_200_mpp_config);
>> +
>> +     kirkwood_ehci_init();
>> +
>> +     kirkwood_ge00_init(&iomega_ix2_200_ge00_data);
>> +     kirkwood_ge01_init(&iomega_ix2_200_ge01_data);
>> +}
>> +static int __init iomega_ix2_200_pci_init(void)
>> +{
>> +     if (of_machine_is_compatible("iom,ix2-200"))
>> +             kirkwood_pcie_init(KW_PCIE0);
>> +     return 0;
>> +}
>> +subsys_initcall(iomega_ix2_200_pci_init);
>> +
>> diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
>> index 304dd1a..d5d4064 100644
>> --- a/arch/arm/mach-kirkwood/common.h
>> +++ b/arch/arm/mach-kirkwood/common.h
>> @@ -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);
>> Signed-off-by: Alan M Butler <alanbutty12@gmail.com>
>
> This is the wrong place for the Signed-off-by:, please see my comments,
> above.  If anyone tries to apply this patch it will fail because git or
> patch will think the sob is a line of context.  There won't be a match,
> so it will fail.
>
> hth,
>
> Jason.

yeah 2 seconds after i sent the patch i noticed i forgot to remove the
coherent_pool line and i think i sent a v3 with it removed but i will
need to do a v4 and fix what you told me here. and i think i told
fabio that it did not fix the keys however it did allow the kernel to
boot with no panics but the keys still did not work so there is still
something small thats missing or broken in his gpio file i think.

But the patch as is works on 3.6-rc1 with the buttons and leds. If i
get a chance i will try with his patch again later today. Should i
remake the patch on 3.6-rc2 so to be sure it applies cleanly?

Thanks.

p.s Do i send the updated patch directly to you and andrew or to the
list and just cc you both? Still getting used to this mailing list and
submitting a patch thing.
alan butler Aug. 19, 2012, 6:03 p.m. UTC | #3
On 19 August 2012 09:45, Alan M Butler <alanbutty12@gmail.com> wrote:
> On 19 August 2012 03:06, Jason Cooper <jason@lakedaemon.net> wrote:
>> You're so close!
>>
>> Your subject line should be "[PATCH] ARM: Kirkwood: Iomega ix2-200 DT
>> support"
>>
>> Also, please add a short description of the device and a link to iomega
>> page describing it to the commit message (should start on the third line
>> of the commit message, above the Signed-off-by:).
>>
>> On Fri, Aug 17, 2012 at 10:56:14AM +0100, Alan M Butler wrote:
>>
>> VVVVVVV--- This is where the signed-off-by goes, not at the end.
>>
>>> Signed-off-by: Alan M Butler <alanbutty12@gmail.com>
>>>
>>> ---
>>>  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(+), 0 deletions(-)
>>>  create mode 100644 arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
>>>  create mode 100644 arch/arm/mach-kirkwood/board-iomega_ix2_200.c
>>>
>>> diff --git a/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
>>> new file mode 100644
>>> index 0000000..821a76b
>>> --- /dev/null
>>> +++ b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
>>> @@ -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 coherent_pool=1M";
>>
>> Please remove 'coherent_pool=1M' that's a diagnosis tool, we still need
>> to get to the bottom of what that fixed.
>>
>>> +     };
>>> +
>>> +     ocp@f1000000 {
>>> +             i2c@11000 {
>>> +                     status = "okay";
>>> +
>>> +                     lm63: lm63@4c {
>>> +                             compatible = "national,lm63";
>>> +                             reg = <0x4c>;
>>> +                     };
>>> +             };
>>> +
>>> +             serial@12000 {
>>> +                     clock-frequency = <200000000>;
>>> +                     status = "ok";
>>> +             };
>>> +
>>> +             nand@3000000 {
>>> +                     status = "okay";
>>> +
>>> +                     partition@0 {
>>> +                             label = "u-boot";
>>> +                             reg = <0x0000000 0x100000>;
>>> +                             read-only;
>>> +                     };
>>> +
>>> +                     partition@a0000 {
>>> +                             label = "env";
>>> +                             reg = <0xa0000 0x20000>;
>>> +                             read-only;
>>> +                     };
>>> +
>>> +                     partition@100000 {
>>> +                             label = "uImage";
>>> +                             reg = <0x100000 0x300000>;
>>> +                     };
>>> +
>>> +                     partition@400000 {
>>> +                             label = "uInitrd";
>>> +                             reg = <0x540000 0x1000000>;
>>> +                     };
>>> +             };
>>> +             sata@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>;
>>> +             };
>>> +     };
>>
>> Did Fabio's patch fix gpio-keys?  If so, please list that as a
>> dependency below the '---', ie 3 lines below the Signed-off-by:.
>> Include the link he supplied with that comment.
>>
>>> +};
>>> diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
>>> index ca5c15a..bee8451 100644
>>> --- a/arch/arm/mach-kirkwood/Kconfig
>>> +++ b/arch/arm/mach-kirkwood/Kconfig
>>> @@ -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
>>> diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
>>> index 055c85a..f5484dc 100644
>>> --- a/arch/arm/mach-kirkwood/Makefile
>>> +++ b/arch/arm/mach-kirkwood/Makefile
>>> @@ -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
>>> diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
>>> index 2a576ab..f8ef771 100644
>>> --- a/arch/arm/mach-kirkwood/Makefile.boot
>>> +++ b/arch/arm/mach-kirkwood/Makefile.boot
>>> @@ -11,3 +11,4 @@ dtb-$(CONFIG_MACH_TS219_DT) += kirkwood-qnap-ts219.dtb
>>>  dtb-$(CONFIG_MACH_GOFLEXNET_DT) += kirkwood-goflexnet.dtb
>>>  dbt-$(CONFIG_MACH_LSXL_DT) += kirkwood-lschlv2.dtb
>>>  dbt-$(CONFIG_MACH_LSXL_DT) += kirkwood-lsxhl.dtb
>>> +dtb-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += kirkwood-iomega_ix2_200.dtb
>>> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
>>> index e4eb450..9b3ec17 100644
>>> --- a/arch/arm/mach-kirkwood/board-dt.c
>>> +++ b/arch/arm/mach-kirkwood/board-dt.c
>>> @@ -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
>>>  };
>>>
>>> diff --git a/arch/arm/mach-kirkwood/board-iomega_ix2_200.c b/arch/arm/mach-kirkwood/board-iomega_ix2_200.c
>>> new file mode 100644
>>> index 0000000..0c78752
>>> --- /dev/null
>>> +++ b/arch/arm/mach-kirkwood/board-iomega_ix2_200.c
>>> @@ -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>
>>> +#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"
>>> +
>>> +static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = {
>>> +     .phy_addr       = MV643XX_ETH_PHY_NONE,
>>> +     .speed          = SPEED_1000,
>>> +     .duplex         = DUPLEX_FULL,
>>> +};
>>> +
>>> +static struct mv643xx_eth_platform_data iomega_ix2_200_ge01_data = {
>>> +     .phy_addr       = MV643XX_ETH_PHY_ADDR(11),
>>> +};
>>> +
>>> +static unsigned int iomega_ix2_200_mpp_config[] __initdata = {
>>> +     MPP12_GPIO,                     /* Reset Button */
>>> +     MPP14_GPIO,                     /* Power Button */
>>> +     MPP15_GPIO,                     /* Backup LED (blue) */
>>> +     MPP16_GPIO,                     /* Power LED (white) */
>>> +     MPP35_GPIO,                     /* OTB Button */
>>> +     MPP36_GPIO,                     /* Rebuild LED (white) */
>>> +     MPP37_GPIO,                     /* Health LED (red) */
>>> +     MPP38_GPIO,                     /* SATA LED brightness control 1 */
>>> +     MPP39_GPIO,                     /* SATA LED brightness control 2 */
>>> +     MPP40_GPIO,                     /* Backup LED brightness control 1 */
>>> +     MPP41_GPIO,                     /* Backup LED brightness control 2 */
>>> +     MPP42_GPIO,                     /* Power LED brightness control 1 */
>>> +     MPP43_GPIO,                     /* Power LED brightness control 2 */
>>> +     MPP44_GPIO,                     /* Health LED brightness control 1 */
>>> +     MPP45_GPIO,                     /* Health LED brightness control 2 */
>>> +     MPP46_GPIO,                     /* Rebuild LED brightness control 1 */
>>> +     MPP47_GPIO,                     /* Rebuild LED brightness control 2 */
>>> +     0
>>> +};
>>> +
>>> +void __init iomega_ix2_200_init(void)
>>> +{
>>> +     /*
>>> +      * Basic setup. Needs to be called early.
>>> +      */
>>> +     kirkwood_mpp_conf(iomega_ix2_200_mpp_config);
>>> +
>>> +     kirkwood_ehci_init();
>>> +
>>> +     kirkwood_ge00_init(&iomega_ix2_200_ge00_data);
>>> +     kirkwood_ge01_init(&iomega_ix2_200_ge01_data);
>>> +}
>>> +static int __init iomega_ix2_200_pci_init(void)
>>> +{
>>> +     if (of_machine_is_compatible("iom,ix2-200"))
>>> +             kirkwood_pcie_init(KW_PCIE0);
>>> +     return 0;
>>> +}
>>> +subsys_initcall(iomega_ix2_200_pci_init);
>>> +
>>> diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
>>> index 304dd1a..d5d4064 100644
>>> --- a/arch/arm/mach-kirkwood/common.h
>>> +++ b/arch/arm/mach-kirkwood/common.h
>>> @@ -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);
>>> Signed-off-by: Alan M Butler <alanbutty12@gmail.com>
>>
>> This is the wrong place for the Signed-off-by:, please see my comments,
>> above.  If anyone tries to apply this patch it will fail because git or
>> patch will think the sob is a line of context.  There won't be a match,
>> so it will fail.
>>
>> hth,
>>
>> Jason.
>
> yeah 2 seconds after i sent the patch i noticed i forgot to remove the
> coherent_pool line and i think i sent a v3 with it removed but i will
> need to do a v4 and fix what you told me here. and i think i told
> fabio that it did not fix the keys however it did allow the kernel to
> boot with no panics but the keys still did not work so there is still
> something small thats missing or broken in his gpio file i think.
>
> But the patch as is works on 3.6-rc1 with the buttons and leds. If i
> get a chance i will try with his patch again later today. Should i
> remake the patch on 3.6-rc2 so to be sure it applies cleanly?
>
> Thanks.
>
> p.s Do i send the updated patch directly to you and andrew or to the
> list and just cc you both? Still getting used to this mailing list and
> submitting a patch thing.

i just thaught i should let fabio and jason know that i just tried
kernel 3.6-rc2 and the buttons work i tried to apply the patch that
fabio sent me before but it didnt apply so i tried the kernel anyway
and the buttons do work.
Fabio Estevam Aug. 20, 2012, 2:31 a.m. UTC | #4
On Sun, Aug 19, 2012 at 3:03 PM, Alan M Butler <alanbutty12@gmail.com> wrote:
> i just thaught i should let fabio and jason know that i just tried
> kernel 3.6-rc2 and the buttons work i tried to apply the patch that
> fabio sent me before but it didnt apply so i tried the kernel anyway
> and the buttons do work.

The patch I sent applies against linux-next.

If you try linux-next you will probably get the kernel crash.
alan butler Aug. 20, 2012, 8:41 a.m. UTC | #5
On 20 August 2012 03:31, Fabio Estevam <festevam@gmail.com> wrote:
> On Sun, Aug 19, 2012 at 3:03 PM, Alan M Butler <alanbutty12@gmail.com> wrote:
>> i just thaught i should let fabio and jason know that i just tried
>> kernel 3.6-rc2 and the buttons work i tried to apply the patch that
>> fabio sent me before but it didnt apply so i tried the kernel anyway
>> and the buttons do work.
>
> The patch I sent applies against linux-next.
>
> If you try linux-next you will probably get the kernel crash.

Oh yeah i did send you the eroor before i did try the patch on linux
next dated the 17th and the kernel did not crash but i got an error so
i will re-send you the error i got again incase you have lost it or
anything.

> orion_gpio_is_valid: invalid GPIO 0
> orion_gpio_is_valid: invalid GPIO 0
> gpio-keys gpio-keys.2: \x013INFO: %s in %pS age=%lu cpu=%u pid=%d
> Failed to request GPIO 0, error -22
> gpio-keys: probe of gpio-keys.2 failed with error -22

Thats what i got on that linux-next. but the 3.6-rc2 works fine. the
gpio settings are the exact same in the rc2 that i tried in the linux
next so it might be something in the way the dts file is read in the
new code?

should the gpio-keys be named button@1 and so on as i see that in the
other kirkwood dts files where i have mine named power, otb, reset?
Fabio Estevam Aug. 20, 2012, 12:17 p.m. UTC | #6
On 8/20/12, Alan M Butler <alanbutty12@gmail.com> wrote:

>> orion_gpio_is_valid: invalid GPIO 0
>> orion_gpio_is_valid: invalid GPIO 0
>> gpio-keys gpio-keys.2: \x013INFO: %s in %pS age=%lu cpu=%u pid=%d
>> Failed to request GPIO 0, error -22
>> gpio-keys: probe of gpio-keys.2 failed with error -22

This looks like a different issue.

Regards,

Fabio Estevam
alan butler Aug. 20, 2012, 12:44 p.m. UTC | #7
On 20 August 2012 13:36, Fabio Estevam <festevam@gmail.com> wrote:
> On Mon, Aug 20, 2012 at 9:30 AM, Alan M Butler <alanbutty12@gmail.com> wrote:
>
>> im not sure but i only get that after applying the patch you sent me
>> on the linux next from the 17th.
>> i will try building a new linux-next later today and will send you what happens.
>
> Please do not drop the list from Cc.
>
>> would it be because i named the buttons power, reset and otb? instead
>> of button@1 and so on like the other kirkwood devices?
>
> I am not familiar with kirkwood device, sorry.

sorry i forgot to cc the list.

But as far as i can tell with the buttons the only difference between
my device and the other's like the iconnect is that they named the
buttons button@1 and i named mine Power, Reset and OTB. Is it possible
the capital letters are causing the problem?
alan butler Aug. 20, 2012, 5:37 p.m. UTC | #8
On 20 August 2012 13:44, Alan M Butler <alanbutty12@gmail.com> wrote:
> On 20 August 2012 13:36, Fabio Estevam <festevam@gmail.com> wrote:
>> On Mon, Aug 20, 2012 at 9:30 AM, Alan M Butler <alanbutty12@gmail.com> wrote:
>>
>>> im not sure but i only get that after applying the patch you sent me
>>> on the linux next from the 17th.
>>> i will try building a new linux-next later today and will send you what happens.
>>
>> Please do not drop the list from Cc.
>>
>>> would it be because i named the buttons power, reset and otb? instead
>>> of button@1 and so on like the other kirkwood devices?
>>
>> I am not familiar with kirkwood device, sorry.
>
> sorry i forgot to cc the list.
>
> But as far as i can tell with the buttons the only difference between
> my device and the other's like the iconnect is that they named the
> buttons button@1 and i named mine Power, Reset and OTB. Is it possible
> the capital letters are causing the problem?

i just tried your patch again with the latest linux-next dated 20th of
august with that patch you gave me and i am still getting the errors
on the gpio-keys this is the error:

[    4.838988] orion_gpio_is_valid: invalid GPIO 0
[    4.838999] orion_gpio_is_valid: invalid GPIO 0
[    4.839015] gpio-keys gpio-keys.2: Failed to request GPIO 0, error -22
[    4.845617] gpio-keys: probe of gpio-keys.2 failed with error -22

and this is how the keys are assigned in the dts file:

               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>;
               };

I hope this helps you figure out the problem.
Fabio Estevam Aug. 20, 2012, 6:53 p.m. UTC | #9
Hi Alan,

On Mon, Aug 20, 2012 at 2:37 PM, Alan M Butler <alanbutty12@gmail.com> wrote:

> i just tried your patch again with the latest linux-next dated 20th of
> august with that patch you gave me and i am still getting the errors
> on the gpio-keys this is the error:
>
> [    4.838988] orion_gpio_is_valid: invalid GPIO 0
> [    4.838999] orion_gpio_is_valid: invalid GPIO 0
> [    4.839015] gpio-keys gpio-keys.2: Failed to request GPIO 0, error -22
> [    4.845617] gpio-keys: probe of gpio-keys.2 failed with error -22

Ok, I am able to reproduce your issue on a mx53qsb as well.

I haven't seen the issue previously because I was registering only one
key on my mx51-babbage. The failure happens on the subsequent key
registrations.

I fixed it with the attached patch, which just sent it to the linux-input list.

Can you please test it?

Regards,

Fabio Estevam
alan butler Aug. 20, 2012, 8:24 p.m. UTC | #10
On 20 August 2012 19:53, Fabio Estevam <festevam@gmail.com> wrote:
> Hi Alan,
>
> On Mon, Aug 20, 2012 at 2:37 PM, Alan M Butler <alanbutty12@gmail.com> wrote:
>
>> i just tried your patch again with the latest linux-next dated 20th of
>> august with that patch you gave me and i am still getting the errors
>> on the gpio-keys this is the error:
>>
>> [    4.838988] orion_gpio_is_valid: invalid GPIO 0
>> [    4.838999] orion_gpio_is_valid: invalid GPIO 0
>> [    4.839015] gpio-keys gpio-keys.2: Failed to request GPIO 0, error -22
>> [    4.845617] gpio-keys: probe of gpio-keys.2 failed with error -22
>
> Ok, I am able to reproduce your issue on a mx53qsb as well.
>
> I haven't seen the issue previously because I was registering only one
> key on my mx51-babbage. The failure happens on the subsequent key
> registrations.
>
> I fixed it with the attached patch, which just sent it to the linux-input list.
>
> Can you please test it?
>
> Regards,
>
> Fabio Estevam

I can confirm fabio that the patch you sent did fix the problem with
the buttons
on the linux-next dated 20th of august.
diff mbox

Patch

diff --git a/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
new file mode 100644
index 0000000..821a76b
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
@@ -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 coherent_pool=1M";
+	};
+
+	ocp@f1000000 {
+		i2c@11000 {
+			status = "okay";
+
+			lm63: lm63@4c {
+				compatible = "national,lm63";
+				reg = <0x4c>;
+			};
+		};
+
+		serial@12000 {
+			clock-frequency = <200000000>;
+			status = "ok";
+		};
+
+		nand@3000000 {
+			status = "okay";
+
+			partition@0 {
+				label = "u-boot";
+				reg = <0x0000000 0x100000>;
+				read-only;
+			};
+
+			partition@a0000 {
+				label = "env";
+				reg = <0xa0000 0x20000>;
+				read-only;
+			};
+
+			partition@100000 {
+				label = "uImage";
+				reg = <0x100000 0x300000>;
+			};
+
+			partition@400000 {
+				label = "uInitrd";
+				reg = <0x540000 0x1000000>;
+			};
+		};
+		sata@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>;
+		};
+	};
+};
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index ca5c15a..bee8451 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -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
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 055c85a..f5484dc 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -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
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 2a576ab..f8ef771 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -11,3 +11,4 @@  dtb-$(CONFIG_MACH_TS219_DT)	+= kirkwood-qnap-ts219.dtb
 dtb-$(CONFIG_MACH_GOFLEXNET_DT) += kirkwood-goflexnet.dtb
 dbt-$(CONFIG_MACH_LSXL_DT) += kirkwood-lschlv2.dtb
 dbt-$(CONFIG_MACH_LSXL_DT) += kirkwood-lsxhl.dtb
+dtb-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += kirkwood-iomega_ix2_200.dtb
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index e4eb450..9b3ec17 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -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
 };
 
diff --git a/arch/arm/mach-kirkwood/board-iomega_ix2_200.c b/arch/arm/mach-kirkwood/board-iomega_ix2_200.c
new file mode 100644
index 0000000..0c78752
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-iomega_ix2_200.c
@@ -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>
+#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"
+
+static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = {
+	.phy_addr       = MV643XX_ETH_PHY_NONE,
+	.speed          = SPEED_1000,
+	.duplex         = DUPLEX_FULL,
+};
+
+static struct mv643xx_eth_platform_data iomega_ix2_200_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(11),
+};
+
+static unsigned int iomega_ix2_200_mpp_config[] __initdata = {
+	MPP12_GPIO,			/* Reset Button */
+	MPP14_GPIO,			/* Power Button */
+	MPP15_GPIO,			/* Backup LED (blue) */
+	MPP16_GPIO,			/* Power LED (white) */
+	MPP35_GPIO,			/* OTB Button */
+	MPP36_GPIO,			/* Rebuild LED (white) */
+	MPP37_GPIO,			/* Health LED (red) */
+	MPP38_GPIO,			/* SATA LED brightness control 1 */
+	MPP39_GPIO,			/* SATA LED brightness control 2 */
+	MPP40_GPIO,			/* Backup LED brightness control 1 */
+	MPP41_GPIO,			/* Backup LED brightness control 2 */
+	MPP42_GPIO,			/* Power LED brightness control 1 */
+	MPP43_GPIO,			/* Power LED brightness control 2 */
+	MPP44_GPIO,			/* Health LED brightness control 1 */
+	MPP45_GPIO,			/* Health LED brightness control 2 */
+	MPP46_GPIO,			/* Rebuild LED brightness control 1 */
+	MPP47_GPIO,			/* Rebuild LED brightness control 2 */
+	0
+};
+
+void __init iomega_ix2_200_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_mpp_conf(iomega_ix2_200_mpp_config);
+
+	kirkwood_ehci_init();
+
+	kirkwood_ge00_init(&iomega_ix2_200_ge00_data);
+	kirkwood_ge01_init(&iomega_ix2_200_ge01_data);
+}
+static int __init iomega_ix2_200_pci_init(void)
+{
+	if (of_machine_is_compatible("iom,ix2-200"))
+		kirkwood_pcie_init(KW_PCIE0);
+	return 0;
+}
+subsys_initcall(iomega_ix2_200_pci_init);
+
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 304dd1a..d5d4064 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -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);