Re: [PATCH] arm, ls1021a: add support for Moxa UC-8410A open platform

2017-11-28 Thread Shawn Guo
On Thu, Nov 16, 2017 at 10:58:57PM +0800, SZ Lin wrote:
> Add support for Moxa UC-8410A open platform
> 
> The UC-8410A computing platform is designed
> for embedded communication-centric industrial applications
> 
> The features of UC-8410A are:
> * QSPI flash
> * SD slot
> * 3x LAN
> * 8x RS-232/422/485 ports, software-selectable
> * Mini PCIe form factor with PCIe/USB signal
> * 2x USB host
> * TPM
> * Watchdog
> * RTC
> * User LEDs
> * Beeper
> 
> Signed-off-by: Jimmy Chen 
> Signed-off-by: Harry YJ Jhou 
> Signed-off-by: SZ Lin 

We usually prefix arm dts patch with 'ARM: dts: ...'.

> ---
>  arch/arm/boot/dts/Makefile  |   1 +
>  arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts | 230 
> 
>  2 files changed, 231 insertions(+)
>  create mode 100644 arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts
> 
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index eff87a344566..0165fbcb1d10 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -495,6 +495,7 @@ dtb-$(CONFIG_SOC_IMX7D) += \
>   imx7s-colibri-eval-v3.dtb \
>   imx7s-warp.dtb
>  dtb-$(CONFIG_SOC_LS1021A) += \
> + ls1021a-moxa-uc-8410a.dtb \
>   ls1021a-qds.dtb \
>   ls1021a-twr.dtb
>  dtb-$(CONFIG_SOC_VF610) += \
> diff --git a/arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts 
> b/arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts
> new file mode 100644
> index ..4896b551505b
> --- /dev/null
> +++ b/arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts
> @@ -0,0 +1,230 @@
> +/*
> + * Copyright (C) 2017 Moxa Inc. - https://www.moxa.com/
> + *
> + * Author: Harry YJ Jhou (周亞諄) 
> + * Jimmy Chen (陳永達)
> + * SZ Lin (林上智)
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +/dts-v1/;
> +
> +#include "ls1021a.dtsi"
> +
> +/ {
> + model = "Moxa UC-8410A";
> +
> + aliases {
> + enet0_rgmii_phy = _phy0;
> + enet1_rgmii_phy = _phy1;
> + enet2_rgmii_phy = _phy2;
> + };
> +
> + sys_mclk: clock-mclk {
> + compatible = "fixed-clock";
> + #clock-cells = <0>;
> + clock-frequency = <24576000>;
> + };
> +
> + regulators {
> + compatible = "simple-bus";
> + #address-cells = <1>;
> + #size-cells = <0>;

Drop this container node and put fixed regulator directly under root.

> +
> + reg_3p3v: regulator@0 {

Name the fixed regulator like below.

reg_xxx: regulator-xxx {
...
};

> + compatible = "regulator-fixed";
> + reg = <0>;
> + regulator-name = "3P3V";
> + regulator-min-microvolt = <330>;
> + regulator-max-microvolt = <330>;
> + regulator-always-on;
> + };
> + };
> +
> + leds {
> + compatible = "gpio-leds";

Have a newline between property list and child node.

> + cel_pwr {

We usually use hyphen instead of underscore in node name.

> + label = "UC8410A:CEL_PWR";
> + gpios = < 23 1>;

Can you use the polarity defines in include/dt-bindings/gpio/gpio.h to
make it more readable?

> + default-state = "off";
> + };
> +
> + cel_reset {
> + label = "UC8410A:CEL_RESET";
> + gpios = < 24 1>;
> + default-state = "off";
> + };
> +
> + str_led {
> + label = "UC8410A:RED:PROG";
> + gpios = < 16 0>;
> + linux,default-trigger = "mmc0";
> + };
> +
> + sw_ready {
> + label = "UC8410A:GREEN:SWRDY";
> + gpios = < 18 0>;
> + default-state = "on";
> + };
> +
> + beeper {
> + label = "UC8410A:BEEP";
> + gpios = < 20 0>;
> + default-state = "off";
> + };
> +
> + prog_led0 {
> + label = "UC8410A:GREEN:PROG2";
> + gpios = < 14 0>;
> + default-state = "off";
> + };
> +
> + prog_led1 {
> + label = "UC8410A:GREEN:PROG1";
> + gpios = < 15 0>;
> + default-state = "off";
> + };
> +
> + prog_led2 {
> + label = "UC8410A:GREEN:PROG0";
> + gpios = < 16 0>;
> + default-state = "off";
> + };
> +
> + 

Re: [PATCH] arm, ls1021a: add support for Moxa UC-8410A open platform

2017-11-28 Thread Shawn Guo
On Thu, Nov 16, 2017 at 10:58:57PM +0800, SZ Lin wrote:
> Add support for Moxa UC-8410A open platform
> 
> The UC-8410A computing platform is designed
> for embedded communication-centric industrial applications
> 
> The features of UC-8410A are:
> * QSPI flash
> * SD slot
> * 3x LAN
> * 8x RS-232/422/485 ports, software-selectable
> * Mini PCIe form factor with PCIe/USB signal
> * 2x USB host
> * TPM
> * Watchdog
> * RTC
> * User LEDs
> * Beeper
> 
> Signed-off-by: Jimmy Chen 
> Signed-off-by: Harry YJ Jhou 
> Signed-off-by: SZ Lin 

We usually prefix arm dts patch with 'ARM: dts: ...'.

> ---
>  arch/arm/boot/dts/Makefile  |   1 +
>  arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts | 230 
> 
>  2 files changed, 231 insertions(+)
>  create mode 100644 arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts
> 
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index eff87a344566..0165fbcb1d10 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -495,6 +495,7 @@ dtb-$(CONFIG_SOC_IMX7D) += \
>   imx7s-colibri-eval-v3.dtb \
>   imx7s-warp.dtb
>  dtb-$(CONFIG_SOC_LS1021A) += \
> + ls1021a-moxa-uc-8410a.dtb \
>   ls1021a-qds.dtb \
>   ls1021a-twr.dtb
>  dtb-$(CONFIG_SOC_VF610) += \
> diff --git a/arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts 
> b/arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts
> new file mode 100644
> index ..4896b551505b
> --- /dev/null
> +++ b/arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts
> @@ -0,0 +1,230 @@
> +/*
> + * Copyright (C) 2017 Moxa Inc. - https://www.moxa.com/
> + *
> + * Author: Harry YJ Jhou (周亞諄) 
> + * Jimmy Chen (陳永達)
> + * SZ Lin (林上智)
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +/dts-v1/;
> +
> +#include "ls1021a.dtsi"
> +
> +/ {
> + model = "Moxa UC-8410A";
> +
> + aliases {
> + enet0_rgmii_phy = _phy0;
> + enet1_rgmii_phy = _phy1;
> + enet2_rgmii_phy = _phy2;
> + };
> +
> + sys_mclk: clock-mclk {
> + compatible = "fixed-clock";
> + #clock-cells = <0>;
> + clock-frequency = <24576000>;
> + };
> +
> + regulators {
> + compatible = "simple-bus";
> + #address-cells = <1>;
> + #size-cells = <0>;

Drop this container node and put fixed regulator directly under root.

> +
> + reg_3p3v: regulator@0 {

Name the fixed regulator like below.

reg_xxx: regulator-xxx {
...
};

> + compatible = "regulator-fixed";
> + reg = <0>;
> + regulator-name = "3P3V";
> + regulator-min-microvolt = <330>;
> + regulator-max-microvolt = <330>;
> + regulator-always-on;
> + };
> + };
> +
> + leds {
> + compatible = "gpio-leds";

Have a newline between property list and child node.

> + cel_pwr {

We usually use hyphen instead of underscore in node name.

> + label = "UC8410A:CEL_PWR";
> + gpios = < 23 1>;

Can you use the polarity defines in include/dt-bindings/gpio/gpio.h to
make it more readable?

> + default-state = "off";
> + };
> +
> + cel_reset {
> + label = "UC8410A:CEL_RESET";
> + gpios = < 24 1>;
> + default-state = "off";
> + };
> +
> + str_led {
> + label = "UC8410A:RED:PROG";
> + gpios = < 16 0>;
> + linux,default-trigger = "mmc0";
> + };
> +
> + sw_ready {
> + label = "UC8410A:GREEN:SWRDY";
> + gpios = < 18 0>;
> + default-state = "on";
> + };
> +
> + beeper {
> + label = "UC8410A:BEEP";
> + gpios = < 20 0>;
> + default-state = "off";
> + };
> +
> + prog_led0 {
> + label = "UC8410A:GREEN:PROG2";
> + gpios = < 14 0>;
> + default-state = "off";
> + };
> +
> + prog_led1 {
> + label = "UC8410A:GREEN:PROG1";
> + gpios = < 15 0>;
> + default-state = "off";
> + };
> +
> + prog_led2 {
> + label = "UC8410A:GREEN:PROG0";
> + gpios = < 16 0>;
> + default-state = "off";
> + };
> +
> + wifi_signal0 {
> + label = "UC8410A:GREEN:CEL2";
> + gpios = < 17 0>;
> +   

[PATCH] arm, ls1021a: add support for Moxa UC-8410A open platform

2017-11-16 Thread SZ Lin
Add support for Moxa UC-8410A open platform

The UC-8410A computing platform is designed
for embedded communication-centric industrial applications

The features of UC-8410A are:
* QSPI flash
* SD slot
* 3x LAN
* 8x RS-232/422/485 ports, software-selectable
* Mini PCIe form factor with PCIe/USB signal
* 2x USB host
* TPM
* Watchdog
* RTC
* User LEDs
* Beeper

Signed-off-by: Jimmy Chen 
Signed-off-by: Harry YJ Jhou 
Signed-off-by: SZ Lin 
---
 arch/arm/boot/dts/Makefile  |   1 +
 arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts | 230 
 2 files changed, 231 insertions(+)
 create mode 100644 arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index eff87a344566..0165fbcb1d10 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -495,6 +495,7 @@ dtb-$(CONFIG_SOC_IMX7D) += \
imx7s-colibri-eval-v3.dtb \
imx7s-warp.dtb
 dtb-$(CONFIG_SOC_LS1021A) += \
+   ls1021a-moxa-uc-8410a.dtb \
ls1021a-qds.dtb \
ls1021a-twr.dtb
 dtb-$(CONFIG_SOC_VF610) += \
diff --git a/arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts 
b/arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts
new file mode 100644
index ..4896b551505b
--- /dev/null
+++ b/arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts
@@ -0,0 +1,230 @@
+/*
+ * Copyright (C) 2017 Moxa Inc. - https://www.moxa.com/
+ *
+ * Author: Harry YJ Jhou (周亞諄) 
+ * Jimmy Chen (陳永達)
+ * SZ Lin (林上智)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/dts-v1/;
+
+#include "ls1021a.dtsi"
+
+/ {
+   model = "Moxa UC-8410A";
+
+   aliases {
+   enet0_rgmii_phy = _phy0;
+   enet1_rgmii_phy = _phy1;
+   enet2_rgmii_phy = _phy2;
+   };
+
+   sys_mclk: clock-mclk {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <24576000>;
+   };
+
+   regulators {
+   compatible = "simple-bus";
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   reg_3p3v: regulator@0 {
+   compatible = "regulator-fixed";
+   reg = <0>;
+   regulator-name = "3P3V";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-always-on;
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+   cel_pwr {
+   label = "UC8410A:CEL_PWR";
+   gpios = < 23 1>;
+   default-state = "off";
+   };
+
+   cel_reset {
+   label = "UC8410A:CEL_RESET";
+   gpios = < 24 1>;
+   default-state = "off";
+   };
+
+   str_led {
+   label = "UC8410A:RED:PROG";
+   gpios = < 16 0>;
+   linux,default-trigger = "mmc0";
+   };
+
+   sw_ready {
+   label = "UC8410A:GREEN:SWRDY";
+   gpios = < 18 0>;
+   default-state = "on";
+   };
+
+   beeper {
+   label = "UC8410A:BEEP";
+   gpios = < 20 0>;
+   default-state = "off";
+   };
+
+   prog_led0 {
+   label = "UC8410A:GREEN:PROG2";
+   gpios = < 14 0>;
+   default-state = "off";
+   };
+
+   prog_led1 {
+   label = "UC8410A:GREEN:PROG1";
+   gpios = < 15 0>;
+   default-state = "off";
+   };
+
+   prog_led2 {
+   label = "UC8410A:GREEN:PROG0";
+   gpios = < 16 0>;
+   default-state = "off";
+   };
+
+   wifi_signal0 {
+   label = "UC8410A:GREEN:CEL2";
+   gpios = < 17 0>;
+   default-state = "off";
+   };
+
+   wifi_signal1 {
+   label = "UC8410A:GREEN:CEL1";
+   gpios = < 18 0>;
+   default-state = "off";
+   };
+
+   wifi_signal2 {
+   label = "UC8410A:GREEN:CEL0";
+   gpios = < 19 0>;
+   default-state = "off";
+   };
+
+   cpu_diag_red {
+   label = 

[PATCH] arm, ls1021a: add support for Moxa UC-8410A open platform

2017-11-16 Thread SZ Lin
Add support for Moxa UC-8410A open platform

The UC-8410A computing platform is designed
for embedded communication-centric industrial applications

The features of UC-8410A are:
* QSPI flash
* SD slot
* 3x LAN
* 8x RS-232/422/485 ports, software-selectable
* Mini PCIe form factor with PCIe/USB signal
* 2x USB host
* TPM
* Watchdog
* RTC
* User LEDs
* Beeper

Signed-off-by: Jimmy Chen 
Signed-off-by: Harry YJ Jhou 
Signed-off-by: SZ Lin 
---
 arch/arm/boot/dts/Makefile  |   1 +
 arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts | 230 
 2 files changed, 231 insertions(+)
 create mode 100644 arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index eff87a344566..0165fbcb1d10 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -495,6 +495,7 @@ dtb-$(CONFIG_SOC_IMX7D) += \
imx7s-colibri-eval-v3.dtb \
imx7s-warp.dtb
 dtb-$(CONFIG_SOC_LS1021A) += \
+   ls1021a-moxa-uc-8410a.dtb \
ls1021a-qds.dtb \
ls1021a-twr.dtb
 dtb-$(CONFIG_SOC_VF610) += \
diff --git a/arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts 
b/arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts
new file mode 100644
index ..4896b551505b
--- /dev/null
+++ b/arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts
@@ -0,0 +1,230 @@
+/*
+ * Copyright (C) 2017 Moxa Inc. - https://www.moxa.com/
+ *
+ * Author: Harry YJ Jhou (周亞諄) 
+ * Jimmy Chen (陳永達)
+ * SZ Lin (林上智)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/dts-v1/;
+
+#include "ls1021a.dtsi"
+
+/ {
+   model = "Moxa UC-8410A";
+
+   aliases {
+   enet0_rgmii_phy = _phy0;
+   enet1_rgmii_phy = _phy1;
+   enet2_rgmii_phy = _phy2;
+   };
+
+   sys_mclk: clock-mclk {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <24576000>;
+   };
+
+   regulators {
+   compatible = "simple-bus";
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   reg_3p3v: regulator@0 {
+   compatible = "regulator-fixed";
+   reg = <0>;
+   regulator-name = "3P3V";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-always-on;
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+   cel_pwr {
+   label = "UC8410A:CEL_PWR";
+   gpios = < 23 1>;
+   default-state = "off";
+   };
+
+   cel_reset {
+   label = "UC8410A:CEL_RESET";
+   gpios = < 24 1>;
+   default-state = "off";
+   };
+
+   str_led {
+   label = "UC8410A:RED:PROG";
+   gpios = < 16 0>;
+   linux,default-trigger = "mmc0";
+   };
+
+   sw_ready {
+   label = "UC8410A:GREEN:SWRDY";
+   gpios = < 18 0>;
+   default-state = "on";
+   };
+
+   beeper {
+   label = "UC8410A:BEEP";
+   gpios = < 20 0>;
+   default-state = "off";
+   };
+
+   prog_led0 {
+   label = "UC8410A:GREEN:PROG2";
+   gpios = < 14 0>;
+   default-state = "off";
+   };
+
+   prog_led1 {
+   label = "UC8410A:GREEN:PROG1";
+   gpios = < 15 0>;
+   default-state = "off";
+   };
+
+   prog_led2 {
+   label = "UC8410A:GREEN:PROG0";
+   gpios = < 16 0>;
+   default-state = "off";
+   };
+
+   wifi_signal0 {
+   label = "UC8410A:GREEN:CEL2";
+   gpios = < 17 0>;
+   default-state = "off";
+   };
+
+   wifi_signal1 {
+   label = "UC8410A:GREEN:CEL1";
+   gpios = < 18 0>;
+   default-state = "off";
+   };
+
+   wifi_signal2 {
+   label = "UC8410A:GREEN:CEL0";
+   gpios = < 19 0>;
+   default-state = "off";
+   };
+
+   cpu_diag_red {
+   label = "UC8410A:RED:DIA";
+   gpios = < 20 0>;
+   default-state = "off";
+   };
+
+