RE: [PATCH 3/3] ARM: dts: am335x: add support for Moxa UC-2102 open platform

2018-09-17 Thread 林上智
Hi,


 
> The 2102 is a superset of the 2101? If so, the 2102 should come first.
> If not, this should probably be 2 separate entries.
> 

Nope, they use different SoC models and PMICs. I'll resend them separately in 
next version.

Thanks for guidance.

> > + {
> > +   vcc1-supply = <>;
> > +   vcc2-supply = <>;
> > +   vcc3-supply = <>;
> > +   vcc4-supply = <>;
> > +   vcc5-supply = <>;
> > +   vcc6-supply = <>;
> > +   vcc7-supply = <>;
> > +   vccio-supply = <>;
> > +
> > +   regulators {
> > +   vrtc_reg: regulator@0 {
> 
> Without a reg property, you shouldn't have unit addresses.

I would like to ask why shouldn't we keep unit address with 
"regulator-always-on;" reg property?

SZ

> 
> 
> > +   regulator-always-on;
> > +   };
> > +
> > +   vio_reg: regulator@1 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vdd1_reg: regulator@2 {
> > +   /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% 
> > tolerance */
> > +   regulator-name = "vdd_mpu";
> > +   regulator-min-microvolt = <912500>;
> > +   regulator-max-microvolt = <1378000>;
> > +   regulator-boot-on;
> > +   regulator-always-on;
> > +   };
> > +
> > +   vdd2_reg: regulator@3 {
> > +   /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% 
> > tolerance */
> > +   regulator-name = "vdd_core";
> > +   regulator-min-microvolt = <912500>;
> > +   regulator-max-microvolt = <115>;
> > +   regulator-boot-on;
> > +   regulator-always-on;
> > +   };
> > +
> > +   vdd3_reg: regulator@4 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vdig1_reg: regulator@5 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vdig2_reg: regulator@6 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vpll_reg: regulator@7 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vdac_reg: regulator@8 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vaux1_reg: regulator@9 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vaux2_reg: regulator@10 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vaux33_reg: regulator@11 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vmmc_reg: regulator@12 {
> > +   compatible = "regulator-fixed";
> > +   regulator-name = "vmmc_reg";
> > +   regulator-min-microvolt = <330>;
> > +   regulator-max-microvolt = <330>;
> > +   regulator-always-on;
> > +   };
> > +   };
> > +};
> > +
> > + {
> > +   pinctrl-names = "default";
> > +   pinctrl-0 = <_default>;
> > +   dual_emac = <1>;
> > +   status = "okay";
> > +};
> > +
> > +_emac0 {
> > +   status = "okay";
> > +   phy_id = <_mdio>, <0x4>;
> > +   phy-mode = "rmii";
> > +   dual_emac_res_vlan = <1>;
> > +};
> > +
> > +_emac1 {
> > +   status = "okay";
> > +   phy_id = <_mdio>, <0x5>;
> > +   phy-mode = "rmii";
> > +   dual_emac_res_vlan = <2>;
> > +};
> > +
> > + {
> > +   pinctrl-names = "default";
> > +   vmmc-supply = <_fixed>;
> > +   bus-width = <4>;
> > +   pinctrl-0 = <_pins_default>;
> > +   cd-gpios = < 14 GPIO_ACTIVE_HIGH>;
> > +   wp-gpios = < 18 GPIO_ACTIVE_HIGH>;
> > +   status = "okay";
> > +};
> > --
> > 2.19.0.rc1
> >



RE: [PATCH 3/3] ARM: dts: am335x: add support for Moxa UC-2102 open platform

2018-09-17 Thread 林上智
Hi,


 
> The 2102 is a superset of the 2101? If so, the 2102 should come first.
> If not, this should probably be 2 separate entries.
> 

Nope, they use different SoC models and PMICs. I'll resend them separately in 
next version.

Thanks for guidance.

> > + {
> > +   vcc1-supply = <>;
> > +   vcc2-supply = <>;
> > +   vcc3-supply = <>;
> > +   vcc4-supply = <>;
> > +   vcc5-supply = <>;
> > +   vcc6-supply = <>;
> > +   vcc7-supply = <>;
> > +   vccio-supply = <>;
> > +
> > +   regulators {
> > +   vrtc_reg: regulator@0 {
> 
> Without a reg property, you shouldn't have unit addresses.

I would like to ask why shouldn't we keep unit address with 
"regulator-always-on;" reg property?

SZ

> 
> 
> > +   regulator-always-on;
> > +   };
> > +
> > +   vio_reg: regulator@1 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vdd1_reg: regulator@2 {
> > +   /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% 
> > tolerance */
> > +   regulator-name = "vdd_mpu";
> > +   regulator-min-microvolt = <912500>;
> > +   regulator-max-microvolt = <1378000>;
> > +   regulator-boot-on;
> > +   regulator-always-on;
> > +   };
> > +
> > +   vdd2_reg: regulator@3 {
> > +   /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% 
> > tolerance */
> > +   regulator-name = "vdd_core";
> > +   regulator-min-microvolt = <912500>;
> > +   regulator-max-microvolt = <115>;
> > +   regulator-boot-on;
> > +   regulator-always-on;
> > +   };
> > +
> > +   vdd3_reg: regulator@4 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vdig1_reg: regulator@5 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vdig2_reg: regulator@6 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vpll_reg: regulator@7 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vdac_reg: regulator@8 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vaux1_reg: regulator@9 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vaux2_reg: regulator@10 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vaux33_reg: regulator@11 {
> > +   regulator-always-on;
> > +   };
> > +
> > +   vmmc_reg: regulator@12 {
> > +   compatible = "regulator-fixed";
> > +   regulator-name = "vmmc_reg";
> > +   regulator-min-microvolt = <330>;
> > +   regulator-max-microvolt = <330>;
> > +   regulator-always-on;
> > +   };
> > +   };
> > +};
> > +
> > + {
> > +   pinctrl-names = "default";
> > +   pinctrl-0 = <_default>;
> > +   dual_emac = <1>;
> > +   status = "okay";
> > +};
> > +
> > +_emac0 {
> > +   status = "okay";
> > +   phy_id = <_mdio>, <0x4>;
> > +   phy-mode = "rmii";
> > +   dual_emac_res_vlan = <1>;
> > +};
> > +
> > +_emac1 {
> > +   status = "okay";
> > +   phy_id = <_mdio>, <0x5>;
> > +   phy-mode = "rmii";
> > +   dual_emac_res_vlan = <2>;
> > +};
> > +
> > + {
> > +   pinctrl-names = "default";
> > +   vmmc-supply = <_fixed>;
> > +   bus-width = <4>;
> > +   pinctrl-0 = <_pins_default>;
> > +   cd-gpios = < 14 GPIO_ACTIVE_HIGH>;
> > +   wp-gpios = < 18 GPIO_ACTIVE_HIGH>;
> > +   status = "okay";
> > +};
> > --
> > 2.19.0.rc1
> >



[PATCH 3/3] ARM: dts: am335x: add support for Moxa UC-2102 open platform

2018-08-29 Thread 林上智
Add support for Moxa UC-2102 open platform

The UC-2102 computing platform is designed for industrial embedded
data acquisition and processing applications.

The features of UC-2102 are:
* eMMC
* SPI flash
* 2x LAN
* EEPROM
* TPM 2.0
* Watchdog
* RTC
* User gpio-keys
* User LEDs
* User button

Signed-off-by: Wes Huang (黃淵河) 
Signed-off-by: Fero JD Zhou (周俊達) 
Signed-off-by: SZ Lin (林上智) 
---
 .../devicetree/bindings/arm/omap/omap.txt |   2 +-
 arch/arm/boot/dts/Makefile|   1 +
 arch/arm/boot/dts/am335x-moxa-uc-2102.dts | 200 ++
 3 files changed, 202 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/am335x-moxa-uc-2102.dts

diff --git a/Documentation/devicetree/bindings/arm/omap/omap.txt 
b/Documentation/devicetree/bindings/arm/omap/omap.txt
index c5ca3d6a8099..6876eb8263ed 100644
--- a/Documentation/devicetree/bindings/arm/omap/omap.txt
+++ b/Documentation/devicetree/bindings/arm/omap/omap.txt
@@ -158,7 +158,7 @@ Boards:
   compatible = "phytec,am335x-pcm-953", "phytec,am335x-phycore-som", 
"ti,am33xx"
 
 - AM335X UC-2100: Wireless-enabled palm-sized industrial computing platform
-  compatible = "moxa,uc-2101", "ti,am33xx"
+  compatible = "moxa,uc-2101", "moxa,uc-2102", "ti,am33xx"
 
 - AM335X UC-8100-ME-T: Communication-centric industrial computing platform
   compatible = "moxa,uc-8100-me-t", "ti,am33xx";
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 6167c068601c..15d52cabb1a0 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -707,6 +707,7 @@ dtb-$(CONFIG_SOC_AM33XX) += \
am335x-icev2.dtb \
am335x-lxm.dtb \
am335x-moxa-uc-2101.dtb \
+   am335x-moxa-uc-2102.dtb \
am335x-moxa-uc-8100-me-t.dtb \
am335x-nano.dtb \
am335x-pdu001.dtb \
diff --git a/arch/arm/boot/dts/am335x-moxa-uc-2102.dts 
b/arch/arm/boot/dts/am335x-moxa-uc-2102.dts
new file mode 100644
index ..94a7ecc9eb9a
--- /dev/null
+++ b/arch/arm/boot/dts/am335x-moxa-uc-2102.dts
@@ -0,0 +1,200 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2018 MOXA Inc. - https://www.moxa.com/
+ *
+ * Authors: SZ Lin (林上智) 
+ *  Wes Huang (黃淵河) 
+ *  Fero JD Zhou (周俊達) 
+ */
+
+/dts-v1/;
+
+#include "am335x-moxa-uc-2100-common.dtsi"
+
+/ {
+   model = "Moxa UC-2102";
+   compatible = "moxa,uc-2102", "ti,am33xx";
+
+   leds {
+   compatible = "gpio-leds";
+   led1 {
+   label = "UC2100:GREEN:USER1";
+   gpios = < 16 GPIO_ACTIVE_HIGH>;
+   default-state = "off";
+   };
+
+   led2 {
+   label = "UC2100:GREEN:USER2";
+   gpios = < 17 GPIO_ACTIVE_HIGH>;
+   default-state = "off";
+   };
+   };
+};
+
+_pinmux {
+   pinctrl-names = "default";
+
+   cpsw_default: cpsw_default {
+   pinctrl-single,pins = <
+   /* Slave 1 */
+   AM33XX_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE1) 
/* mii1_crs.rmii1_crs_dv */
+   AM33XX_IOPAD(0x910, PIN_INPUT_PULLUP | MUX_MODE1)   
/* mii1_rxerr.rmii1_rxerr */
+   AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE1)
/* mii1_txen.rmii1_txen */
+   AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE1)
/* mii1_txd1.rmii1_txd1 */
+   AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE1)
/* mii1_txd0.rmii1_txd0 */
+   AM33XX_IOPAD(0x93c, PIN_INPUT_PULLUP | MUX_MODE1)   
/* mii1_rxd1.rmii1_rxd1 */
+   AM33XX_IOPAD(0x940, PIN_INPUT_PULLUP | MUX_MODE1)   
/* mii1_rxd0.rmii1_rxd0 */
+   AM33XX_IOPAD(0x944, PIN_INPUT_PULLDOWN | MUX_MODE0) 
/* mii1_refclk.rmii1_refclk */
+
+   /* Slave 2 */
+   AM33XX_IOPAD(0x870, PIN_INPUT_PULLDOWN | MUX_MODE3) 
/* gpmc_wait0.rmii2_crs_dv */
+   AM33XX_IOPAD(0x874, PIN_INPUT_PULLDOWN | MUX_MODE3) 
/* gpmc_wpn.rmii2_rxer */
+   AM33XX_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE3)
/* gpmc_a0.rmii2_txen */
+   AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE3)
/* gpmc_a5.rmii2_td0 */
+   AM33XX_IOPAD(0x850, PIN_OUTPUT_PULLDOWN | MUX_MODE3)
/* gpmc_a4.rmii2_td1 */
+   AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE3) 
/* gpmc_a11.rmii2_rd0 */
+   AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE3) 
/* gpmc_a10.rmii2_rd1 */
+   AM33XX_IOPAD(0x908, PIN_INPUT_PULLDOWN | MUX_MODE1) 
/* gmii1_col.rmii2_refclk */
+   >;
+   };
+
+   mmc0_pins_default: pinmux_mmc0_pins {
+   pinctrl-single,pins = <
+   AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | 

[PATCH 3/3] ARM: dts: am335x: add support for Moxa UC-2102 open platform

2018-08-29 Thread 林上智
Add support for Moxa UC-2102 open platform

The UC-2102 computing platform is designed for industrial embedded
data acquisition and processing applications.

The features of UC-2102 are:
* eMMC
* SPI flash
* 2x LAN
* EEPROM
* TPM 2.0
* Watchdog
* RTC
* User gpio-keys
* User LEDs
* User button

Signed-off-by: Wes Huang (黃淵河) 
Signed-off-by: Fero JD Zhou (周俊達) 
Signed-off-by: SZ Lin (林上智) 
---
 .../devicetree/bindings/arm/omap/omap.txt |   2 +-
 arch/arm/boot/dts/Makefile|   1 +
 arch/arm/boot/dts/am335x-moxa-uc-2102.dts | 200 ++
 3 files changed, 202 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/am335x-moxa-uc-2102.dts

diff --git a/Documentation/devicetree/bindings/arm/omap/omap.txt 
b/Documentation/devicetree/bindings/arm/omap/omap.txt
index c5ca3d6a8099..6876eb8263ed 100644
--- a/Documentation/devicetree/bindings/arm/omap/omap.txt
+++ b/Documentation/devicetree/bindings/arm/omap/omap.txt
@@ -158,7 +158,7 @@ Boards:
   compatible = "phytec,am335x-pcm-953", "phytec,am335x-phycore-som", 
"ti,am33xx"
 
 - AM335X UC-2100: Wireless-enabled palm-sized industrial computing platform
-  compatible = "moxa,uc-2101", "ti,am33xx"
+  compatible = "moxa,uc-2101", "moxa,uc-2102", "ti,am33xx"
 
 - AM335X UC-8100-ME-T: Communication-centric industrial computing platform
   compatible = "moxa,uc-8100-me-t", "ti,am33xx";
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 6167c068601c..15d52cabb1a0 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -707,6 +707,7 @@ dtb-$(CONFIG_SOC_AM33XX) += \
am335x-icev2.dtb \
am335x-lxm.dtb \
am335x-moxa-uc-2101.dtb \
+   am335x-moxa-uc-2102.dtb \
am335x-moxa-uc-8100-me-t.dtb \
am335x-nano.dtb \
am335x-pdu001.dtb \
diff --git a/arch/arm/boot/dts/am335x-moxa-uc-2102.dts 
b/arch/arm/boot/dts/am335x-moxa-uc-2102.dts
new file mode 100644
index ..94a7ecc9eb9a
--- /dev/null
+++ b/arch/arm/boot/dts/am335x-moxa-uc-2102.dts
@@ -0,0 +1,200 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2018 MOXA Inc. - https://www.moxa.com/
+ *
+ * Authors: SZ Lin (林上智) 
+ *  Wes Huang (黃淵河) 
+ *  Fero JD Zhou (周俊達) 
+ */
+
+/dts-v1/;
+
+#include "am335x-moxa-uc-2100-common.dtsi"
+
+/ {
+   model = "Moxa UC-2102";
+   compatible = "moxa,uc-2102", "ti,am33xx";
+
+   leds {
+   compatible = "gpio-leds";
+   led1 {
+   label = "UC2100:GREEN:USER1";
+   gpios = < 16 GPIO_ACTIVE_HIGH>;
+   default-state = "off";
+   };
+
+   led2 {
+   label = "UC2100:GREEN:USER2";
+   gpios = < 17 GPIO_ACTIVE_HIGH>;
+   default-state = "off";
+   };
+   };
+};
+
+_pinmux {
+   pinctrl-names = "default";
+
+   cpsw_default: cpsw_default {
+   pinctrl-single,pins = <
+   /* Slave 1 */
+   AM33XX_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE1) 
/* mii1_crs.rmii1_crs_dv */
+   AM33XX_IOPAD(0x910, PIN_INPUT_PULLUP | MUX_MODE1)   
/* mii1_rxerr.rmii1_rxerr */
+   AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE1)
/* mii1_txen.rmii1_txen */
+   AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE1)
/* mii1_txd1.rmii1_txd1 */
+   AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE1)
/* mii1_txd0.rmii1_txd0 */
+   AM33XX_IOPAD(0x93c, PIN_INPUT_PULLUP | MUX_MODE1)   
/* mii1_rxd1.rmii1_rxd1 */
+   AM33XX_IOPAD(0x940, PIN_INPUT_PULLUP | MUX_MODE1)   
/* mii1_rxd0.rmii1_rxd0 */
+   AM33XX_IOPAD(0x944, PIN_INPUT_PULLDOWN | MUX_MODE0) 
/* mii1_refclk.rmii1_refclk */
+
+   /* Slave 2 */
+   AM33XX_IOPAD(0x870, PIN_INPUT_PULLDOWN | MUX_MODE3) 
/* gpmc_wait0.rmii2_crs_dv */
+   AM33XX_IOPAD(0x874, PIN_INPUT_PULLDOWN | MUX_MODE3) 
/* gpmc_wpn.rmii2_rxer */
+   AM33XX_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE3)
/* gpmc_a0.rmii2_txen */
+   AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE3)
/* gpmc_a5.rmii2_td0 */
+   AM33XX_IOPAD(0x850, PIN_OUTPUT_PULLDOWN | MUX_MODE3)
/* gpmc_a4.rmii2_td1 */
+   AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE3) 
/* gpmc_a11.rmii2_rd0 */
+   AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE3) 
/* gpmc_a10.rmii2_rd1 */
+   AM33XX_IOPAD(0x908, PIN_INPUT_PULLDOWN | MUX_MODE1) 
/* gmii1_col.rmii2_refclk */
+   >;
+   };
+
+   mmc0_pins_default: pinmux_mmc0_pins {
+   pinctrl-single,pins = <
+   AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP |