All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: orion5x: gpio pin fixes for linkstation lswtgl
@ 2016-01-20 10:44 Roger Shimizu
  2016-01-20 12:46 ` Roger Shimizu
  2016-01-21 15:00 ` [PATCH v2] " Roger Shimizu
  0 siblings, 2 replies; 8+ messages in thread
From: Roger Shimizu @ 2016-01-20 10:44 UTC (permalink / raw)
  To: linux-arm-kernel

Here're a few gpio pin related fixes:
  - remove pinctrl-0 definition from pinctrl, since those pins are used
    in other places such as gpio-fan and regulators.
  - turn on power led from initial state, by change pin to active_high
    from active_low.
  - fix for alarm pin of gpio-fan.

Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>
---
 arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts b/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts
index 3daec91..d40b593 100644
--- a/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts
+++ b/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts
@@ -1,7 +1,8 @@
 /*
  * Device Tree file for Buffalo Linkstation LS-WTGL
  *
- * Copyright (C) 2015, Roger Shimizu <rogershimizu@gmail.com>
+ * Copyright (C) 2015, 2016
+ * Roger Shimizu <rogershimizu@gmail.com>
  *
  * This file is dual-licensed: you can use it either under the terms
  * of the GPL or the X11 license, at your option. Note that this dual
@@ -69,8 +70,6 @@
 
 		internal-regs {
 			pinctrl: pinctrl at 10000 {
-				pinctrl-0 = <&pmx_usb_power &pmx_power_hdd
-					&pmx_fan_low &pmx_fan_high &pmx_fan_lock>;
 				pinctrl-names = "default";
 
 				pmx_led_power: pmx-leds {
@@ -161,7 +160,7 @@
 
 		led at 1 {
 			label = "lswtgl:blue:power";
-			gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
+			gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
 		};
 
 		led at 2 {
@@ -188,7 +187,7 @@
 				3250 1
 				5000 0>;
 
-		alarm-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+		alarm-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
 	};
 
 	restart_poweroff {
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] ARM: dts: orion5x: gpio pin fixes for linkstation lswtgl
  2016-01-20 10:44 [PATCH] ARM: dts: orion5x: gpio pin fixes for linkstation lswtgl Roger Shimizu
@ 2016-01-20 12:46 ` Roger Shimizu
  2016-01-21 15:00 ` [PATCH v2] " Roger Shimizu
  1 sibling, 0 replies; 8+ messages in thread
From: Roger Shimizu @ 2016-01-20 12:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 20, 2016 at 7:44 PM, Roger Shimizu <rogershimizu@gmail.com> wrote:
>

Sorry, I forgot to append the "Fixes" tag, as below.

Fixes: dc57844a736f ("ARM: dts: orion5x: add buffalo linkstation ls-wtgl")

Cheers,
Roger

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] ARM: dts: orion5x: gpio pin fixes for linkstation lswtgl
  2016-01-20 10:44 [PATCH] ARM: dts: orion5x: gpio pin fixes for linkstation lswtgl Roger Shimizu
  2016-01-20 12:46 ` Roger Shimizu
@ 2016-01-21 15:00 ` Roger Shimizu
  2016-01-24 23:32   ` Roger Shimizu
                     ` (2 more replies)
  1 sibling, 3 replies; 8+ messages in thread
From: Roger Shimizu @ 2016-01-21 15:00 UTC (permalink / raw)
  To: linux-arm-kernel

Here're a few gpio pin related fixes:
  - remove pinctrl-0 definition from pinctrl, since those pins are used
    in other places such as gpio-fan and regulators.
  - keep initial state of power led
  - fix for alarm pin of gpio-fan.

Fixes: dc57844a736f ("ARM: dts: orion5x: add buffalo linkstation ls-wtgl")
Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>
---
 arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts b/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts
index 3daec912b4bf..420788229e6f 100644
--- a/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts
+++ b/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts
@@ -1,7 +1,8 @@
 /*
  * Device Tree file for Buffalo Linkstation LS-WTGL
  *
- * Copyright (C) 2015, Roger Shimizu <rogershimizu@gmail.com>
+ * Copyright (C) 2015, 2016
+ * Roger Shimizu <rogershimizu@gmail.com>
  *
  * This file is dual-licensed: you can use it either under the terms
  * of the GPL or the X11 license, at your option. Note that this dual
@@ -69,8 +70,6 @@
 
 		internal-regs {
 			pinctrl: pinctrl at 10000 {
-				pinctrl-0 = <&pmx_usb_power &pmx_power_hdd
-					&pmx_fan_low &pmx_fan_high &pmx_fan_lock>;
 				pinctrl-names = "default";
 
 				pmx_led_power: pmx-leds {
@@ -162,6 +161,7 @@
 		led at 1 {
 			label = "lswtgl:blue:power";
 			gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
+			default-state = "keep";
 		};
 
 		led at 2 {
@@ -188,7 +188,7 @@
 				3250 1
 				5000 0>;
 
-		alarm-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+		alarm-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
 	};
 
 	restart_poweroff {
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2] ARM: dts: orion5x: gpio pin fixes for linkstation lswtgl
  2016-01-21 15:00 ` [PATCH v2] " Roger Shimizu
@ 2016-01-24 23:32   ` Roger Shimizu
  2016-01-25 13:01   ` Andrew Lunn
  2016-01-25 15:25   ` Gregory CLEMENT
  2 siblings, 0 replies; 8+ messages in thread
From: Roger Shimizu @ 2016-01-24 23:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 22, 2016 at 12:00 AM, Roger Shimizu <rogershimizu@gmail.com> wrote:
> Here're a few gpio pin related fixes:
>   - remove pinctrl-0 definition from pinctrl, since those pins are used
>     in other places such as gpio-fan and regulators.
>   - keep initial state of power led
>   - fix for alarm pin of gpio-fan.
>
> Fixes: dc57844a736f ("ARM: dts: orion5x: add buffalo linkstation ls-wtgl")
> Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>
> ---
>  arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Dear Andrew,

Could you kindly review this patch, please?
It's fixing the similar things as for kirkwood-lswxl.dts [0], which is
already reviewed OK.
Thank you all the time!

[0]: http://lists.infradead.org/pipermail/linux-arm-kernel/2016-January/400933.html

Cheers

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] ARM: dts: orion5x: gpio pin fixes for linkstation lswtgl
  2016-01-21 15:00 ` [PATCH v2] " Roger Shimizu
  2016-01-24 23:32   ` Roger Shimizu
@ 2016-01-25 13:01   ` Andrew Lunn
  2016-01-25 15:25   ` Gregory CLEMENT
  2 siblings, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2016-01-25 13:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 22, 2016 at 12:00:36AM +0900, Roger Shimizu wrote:
> Here're a few gpio pin related fixes:
>   - remove pinctrl-0 definition from pinctrl, since those pins are used
>     in other places such as gpio-fan and regulators.
>   - keep initial state of power led
>   - fix for alarm pin of gpio-fan.
> 
> Fixes: dc57844a736f ("ARM: dts: orion5x: add buffalo linkstation ls-wtgl")
> Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

	     Andrew

> ---
>  arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts b/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts
> index 3daec912b4bf..420788229e6f 100644
> --- a/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts
> +++ b/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts
> @@ -1,7 +1,8 @@
>  /*
>   * Device Tree file for Buffalo Linkstation LS-WTGL
>   *
> - * Copyright (C) 2015, Roger Shimizu <rogershimizu@gmail.com>
> + * Copyright (C) 2015, 2016
> + * Roger Shimizu <rogershimizu@gmail.com>
>   *
>   * This file is dual-licensed: you can use it either under the terms
>   * of the GPL or the X11 license, at your option. Note that this dual
> @@ -69,8 +70,6 @@
>  
>  		internal-regs {
>  			pinctrl: pinctrl at 10000 {
> -				pinctrl-0 = <&pmx_usb_power &pmx_power_hdd
> -					&pmx_fan_low &pmx_fan_high &pmx_fan_lock>;
>  				pinctrl-names = "default";
>  
>  				pmx_led_power: pmx-leds {
> @@ -162,6 +161,7 @@
>  		led at 1 {
>  			label = "lswtgl:blue:power";
>  			gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
> +			default-state = "keep";
>  		};
>  
>  		led at 2 {
> @@ -188,7 +188,7 @@
>  				3250 1
>  				5000 0>;
>  
> -		alarm-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
> +		alarm-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
>  	};
>  
>  	restart_poweroff {
> -- 
> 2.1.4
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] ARM: dts: orion5x: gpio pin fixes for linkstation lswtgl
  2016-01-21 15:00 ` [PATCH v2] " Roger Shimizu
  2016-01-24 23:32   ` Roger Shimizu
  2016-01-25 13:01   ` Andrew Lunn
@ 2016-01-25 15:25   ` Gregory CLEMENT
  2016-01-25 17:20     ` Roger Shimizu
  2 siblings, 1 reply; 8+ messages in thread
From: Gregory CLEMENT @ 2016-01-25 15:25 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Roger,
 
 On jeu., janv. 21 2016, Roger Shimizu <rogershimizu@gmail.com> wrote:

> Here're a few gpio pin related fixes:
>   - remove pinctrl-0 definition from pinctrl, since those pins are used
>     in other places such as gpio-fan and regulators.
>   - keep initial state of power led
>   - fix for alarm pin of gpio-fan.
>
> Fixes: dc57844a736f ("ARM: dts: orion5x: add buffalo linkstation ls-wtgl")
> Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>

Applied on mvebu/fixes with Andrew Reviewed-by tag

Thanks,

Gregory

> ---
>  arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts b/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts
> index 3daec912b4bf..420788229e6f 100644
> --- a/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts
> +++ b/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts
> @@ -1,7 +1,8 @@
>  /*
>   * Device Tree file for Buffalo Linkstation LS-WTGL
>   *
> - * Copyright (C) 2015, Roger Shimizu <rogershimizu@gmail.com>
> + * Copyright (C) 2015, 2016
> + * Roger Shimizu <rogershimizu@gmail.com>
>   *
>   * This file is dual-licensed: you can use it either under the terms
>   * of the GPL or the X11 license, at your option. Note that this dual
> @@ -69,8 +70,6 @@
>  
>  		internal-regs {
>  			pinctrl: pinctrl at 10000 {
> -				pinctrl-0 = <&pmx_usb_power &pmx_power_hdd
> -					&pmx_fan_low &pmx_fan_high &pmx_fan_lock>;
>  				pinctrl-names = "default";
>  
>  				pmx_led_power: pmx-leds {
> @@ -162,6 +161,7 @@
>  		led at 1 {
>  			label = "lswtgl:blue:power";
>  			gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
> +			default-state = "keep";
>  		};
>  
>  		led at 2 {
> @@ -188,7 +188,7 @@
>  				3250 1
>  				5000 0>;
>  
> -		alarm-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
> +		alarm-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
>  	};
>  
>  	restart_poweroff {
> -- 
> 2.1.4
>

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] ARM: dts: orion5x: gpio pin fixes for linkstation lswtgl
  2016-01-25 15:25   ` Gregory CLEMENT
@ 2016-01-25 17:20     ` Roger Shimizu
  2016-01-27 10:03       ` Roger Shimizu
  0 siblings, 1 reply; 8+ messages in thread
From: Roger Shimizu @ 2016-01-25 17:20 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Andrew, Gregory,

On Tue, Jan 26, 2016 at 12:25 AM, Gregory CLEMENT
<gregory.clement@free-electrons.com> wrote:
> Hi Roger,
>
>  On jeu., janv. 21 2016, Roger Shimizu <rogershimizu@gmail.com> wrote:
>
>> Here're a few gpio pin related fixes:
>>   - remove pinctrl-0 definition from pinctrl, since those pins are used
>>     in other places such as gpio-fan and regulators.
>>   - keep initial state of power led
>>   - fix for alarm pin of gpio-fan.
>>
>> Fixes: dc57844a736f ("ARM: dts: orion5x: add buffalo linkstation ls-wtgl")
>> Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>
>
> Applied on mvebu/fixes with Andrew Reviewed-by tag

Thanks for the review and apply of my patch!
After this patch, now there's not any error/warning in dmesg. I feel great!

However, there's still one thing missing, the MTD, which stores the
u-boot environment.
Maybe you're not the right person to ask this question, but I believe
you know how to reach the right one.
Please help, or forward to the right person for me. Thank you!

For the kirkwood based Linkstation, such as LS-WXL or LS-WVL, the MTD
is a spi/m25p40 device.
But for LS-WTGL orion5x based Linkstation, I tried a few ways, still
cannot get the MTD device out.

I also referred the orion5x-rd88f5182-nas.dts, to add
devbus_bootcs/devbus_cs1, but didn't work.

The MTD working kernel is a patch for kernel 2.6, which is not DTB,
but in lagacy way.
The patch can be get from:
- https://github.com/rogers0/linux-2.6_squeeze-security/blob/master/debian/patches/features/arm/ls-produo/01_ls-produo_driver.patch

MTD related part seems like:

+#define LSPRODUO_NOR_BOOT_BASE 0xf4000000
+#define LSPRODUO_NOR_BOOT_SIZE SZ_256K

+static struct resource lsproduo_nor_flash_resource = {
+ .flags = IORESOURCE_MEM,
+ .start = LSPRODUO_NOR_BOOT_BASE,
+ .end = LSPRODUO_NOR_BOOT_BASE + LSPRODUO_NOR_BOOT_SIZE - 1,
+};

+static struct platform_device lsproduo_nor_flash = {
+ .name = "physmap-flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &lsproduo_nor_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &lsproduo_nor_flash_resource,
+};

+ orion5x_setup_dev_boot_win(LSPRODUO_NOR_BOOT_BASE,
+ LSPRODUO_NOR_BOOT_SIZE);
+ platform_device_register(&lsproduo_nor_flash);

I'd appreciate your help!

Cheers,
Roger

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] ARM: dts: orion5x: gpio pin fixes for linkstation lswtgl
  2016-01-25 17:20     ` Roger Shimizu
@ 2016-01-27 10:03       ` Roger Shimizu
  0 siblings, 0 replies; 8+ messages in thread
From: Roger Shimizu @ 2016-01-27 10:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 26, 2016 at 2:20 AM, Roger Shimizu <rogershimizu@gmail.com> wrote:
>
> However, there's still one thing missing, the MTD, which stores the
> u-boot environment.
> Maybe you're not the right person to ask this question, but I believe
> you know how to reach the right one.
> Please help, or forward to the right person for me. Thank you!
>
> For the kirkwood based Linkstation, such as LS-WXL or LS-WVL, the MTD
> is a spi/m25p40 device.
> But for LS-WTGL orion5x based Linkstation, I tried a few ways, still
> cannot get the MTD device out.
>
> I also referred the orion5x-rd88f5182-nas.dts, to add
> devbus_bootcs/devbus_cs1, but didn't work.
>
> The MTD working kernel is a patch for kernel 2.6, which is not DTB,
> but in lagacy way.
> The patch can be get from:
> - https://github.com/rogers0/linux-2.6_squeeze-security/blob/master/debian/patches/features/arm/ls-produo/01_ls-produo_driver.patch
>
> MTD related part seems like:
>
> +#define LSPRODUO_NOR_BOOT_BASE 0xf4000000
> +#define LSPRODUO_NOR_BOOT_SIZE SZ_256K
>
> +static struct resource lsproduo_nor_flash_resource = {
> + .flags = IORESOURCE_MEM,
> + .start = LSPRODUO_NOR_BOOT_BASE,
> + .end = LSPRODUO_NOR_BOOT_BASE + LSPRODUO_NOR_BOOT_SIZE - 1,
> +};
>
> +static struct platform_device lsproduo_nor_flash = {
> + .name = "physmap-flash",
> + .id = 0,
> + .dev = {
> + .platform_data = &lsproduo_nor_flash_data,
> + },
> + .num_resources = 1,
> + .resource = &lsproduo_nor_flash_resource,
> +};
>
> + orion5x_setup_dev_boot_win(LSPRODUO_NOR_BOOT_BASE,
> + LSPRODUO_NOR_BOOT_SIZE);
> + platform_device_register(&lsproduo_nor_flash);

I solved mtd problem by myself.

I read drivers/mtd/maps/physmap_of.c, then find the supported list of flash type
in struct of_device_id of_flash_match: cfi-flash, jedec-flash,
mtd-ram, mtd-rom, direct-mapped.

I previous refered the type in orion5x-rd88f5182-nas.dts is
"cfi-flash", as which I mentioned it never worked.
After I tired to use "jedec-flash", the mtd is working, dmesg as following:

[   12.863750] Found: SST 39LF020
[   12.866834] f4000000.flash: Found 1 x8 devices at 0x0 in 8-bit bank
[   12.873194] number of JEDEC chips: 1
[   12.895609] 3 ofpart partitions found on MTD device f4000000.flash
[   12.901868] Creating 3 MTD partitions on "f4000000.flash":
[   12.907454] 0x000000000000-0x000000030000 : "header"
[   12.915764] 0x000000030000-0x00000003f000 : "uboot"
[   12.924022] 0x00000003f000-0x000000040000 : "uboot_env"

So I'll send patch to update orion5x-linkstation-lswtgl.dts soon.

Cheers,
-- 
Roger Shimizu, GMT +9 Tokyo
PGP/GPG: 17B3ACB1

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-01-27 10:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-20 10:44 [PATCH] ARM: dts: orion5x: gpio pin fixes for linkstation lswtgl Roger Shimizu
2016-01-20 12:46 ` Roger Shimizu
2016-01-21 15:00 ` [PATCH v2] " Roger Shimizu
2016-01-24 23:32   ` Roger Shimizu
2016-01-25 13:01   ` Andrew Lunn
2016-01-25 15:25   ` Gregory CLEMENT
2016-01-25 17:20     ` Roger Shimizu
2016-01-27 10:03       ` Roger Shimizu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.