diff mbox

[v2] ARM: dts: orion5x: gpio pin fixes for linkstation lswtgl

Message ID 1453388436-8390-1-git-send-email-rogershimizu@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Roger Shimizu Jan. 21, 2016, 3 p.m. UTC
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(-)

Comments

Roger Shimizu Jan. 24, 2016, 11:32 p.m. UTC | #1
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
Andrew Lunn Jan. 25, 2016, 1:01 p.m. UTC | #2
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@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@1 {
>  			label = "lswtgl:blue:power";
>  			gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
> +			default-state = "keep";
>  		};
>  
>  		led@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 Jan. 25, 2016, 3:25 p.m. UTC | #3
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@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@1 {
>  			label = "lswtgl:blue:power";
>  			gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
> +			default-state = "keep";
>  		};
>  
>  		led@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
>
Roger Shimizu Jan. 25, 2016, 5:20 p.m. UTC | #4
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
Roger Shimizu Jan. 27, 2016, 10:03 a.m. UTC | #5
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,
diff mbox

Patch

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@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@1 {
 			label = "lswtgl:blue:power";
 			gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
+			default-state = "keep";
 		};
 
 		led@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 {