Re: [PATCH v3 2/3] arm: dts: add Nuvoton NPCM750 device tree

2017-09-06 Thread Brendan Higgins
On Tue, Sep 5, 2017 at 10:23 PM, Joel Stanley  wrote:
> On Wed, Sep 6, 2017 at 10:00 AM, Brendan Higgins
>  wrote:
>> +++ b/Documentation/devicetree/bindings/arm/npcm/npcm.txt
>> @@ -0,0 +1,6 @@
>> +NPCM Platforms Device Tree Bindings
>> +---
>> +NPCM750 SoC
>> +Required root node properties:
>> +   - compatible = "nuvoton,npcm750";
>> +
>
> This is minimal. I assume there will be more content added as more
> support is added?

Yep, that's the plan. They have a number of similar BMCs, both those
based on different ARM cores and some with different peripheral sets,
so we will probably want to have different compat strings for those.

>
> Does it need it's own directory?

Not sure, I saw that some of the other architectures did it, some did
not. I don't feel strongly about it.

>
>
>> diff --git a/arch/arm/boot/dts/nuvoton-npcm750-evb.dts 
>> b/arch/arm/boot/dts/nuvoton-npcm750-evb.dts
>> new file mode 100644
>> index ..54df32cff21b
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/nuvoton-npcm750-evb.dts
>
>> +
>> +/dts-v1/;
>> +#include "nuvoton-npcm750.dtsi"
>> +
>> +/ {
>> +   model = "Nuvoton npcm750 Development Board (Device Tree)";
>> +   compatible = "nuvoton,npcm750";
>> +
>> +   chosen {
>> +   stdout-path = 
>> +   bootargs = "earlyprintk=serial,serial3,115200";
>> +   };
>> +
>> +   memory {
>> +   reg = <0 0x4000>;
>> +   };
>> +
>> +   cpus {
>> +   enable-method = "nuvoton,npcm7xx-smp";
>> +   };
>> +
>> +   clk: clock-controller@f0801000 {
>> +   status = "okay";
>> +   };
>> +
>> +   apb {
>> +   watchdog1: watchdog@f0009000 {
>> +   status = "okay";
>> +   };
>
> You've already got the label for the node, is there are reason you
> don't use a phandle to set the status?

Addressed in v4.

>
>  {
>status = "okay";
> };
>
> Same with the serial nodes below.
>
>> +
>> +   serial0: serial0@f0001000 {
>> +   status = "okay";
>> +   };
>> +
>> +   serial1: serial1@f0002000 {
>> +   status = "okay";
>> +   };
>> +
>> +   serial2: serial2@f0003000 {
>> +   status = "okay";
>> +   };
>> +
>> +   serial3: serial3@f0004000 {
>> +   status = "okay";
>> +   };
>> +   };


Re: [PATCH v3 2/3] arm: dts: add Nuvoton NPCM750 device tree

2017-09-06 Thread Brendan Higgins
On Tue, Sep 5, 2017 at 10:23 PM, Joel Stanley  wrote:
> On Wed, Sep 6, 2017 at 10:00 AM, Brendan Higgins
>  wrote:
>> +++ b/Documentation/devicetree/bindings/arm/npcm/npcm.txt
>> @@ -0,0 +1,6 @@
>> +NPCM Platforms Device Tree Bindings
>> +---
>> +NPCM750 SoC
>> +Required root node properties:
>> +   - compatible = "nuvoton,npcm750";
>> +
>
> This is minimal. I assume there will be more content added as more
> support is added?

Yep, that's the plan. They have a number of similar BMCs, both those
based on different ARM cores and some with different peripheral sets,
so we will probably want to have different compat strings for those.

>
> Does it need it's own directory?

Not sure, I saw that some of the other architectures did it, some did
not. I don't feel strongly about it.

>
>
>> diff --git a/arch/arm/boot/dts/nuvoton-npcm750-evb.dts 
>> b/arch/arm/boot/dts/nuvoton-npcm750-evb.dts
>> new file mode 100644
>> index ..54df32cff21b
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/nuvoton-npcm750-evb.dts
>
>> +
>> +/dts-v1/;
>> +#include "nuvoton-npcm750.dtsi"
>> +
>> +/ {
>> +   model = "Nuvoton npcm750 Development Board (Device Tree)";
>> +   compatible = "nuvoton,npcm750";
>> +
>> +   chosen {
>> +   stdout-path = 
>> +   bootargs = "earlyprintk=serial,serial3,115200";
>> +   };
>> +
>> +   memory {
>> +   reg = <0 0x4000>;
>> +   };
>> +
>> +   cpus {
>> +   enable-method = "nuvoton,npcm7xx-smp";
>> +   };
>> +
>> +   clk: clock-controller@f0801000 {
>> +   status = "okay";
>> +   };
>> +
>> +   apb {
>> +   watchdog1: watchdog@f0009000 {
>> +   status = "okay";
>> +   };
>
> You've already got the label for the node, is there are reason you
> don't use a phandle to set the status?

Addressed in v4.

>
>  {
>status = "okay";
> };
>
> Same with the serial nodes below.
>
>> +
>> +   serial0: serial0@f0001000 {
>> +   status = "okay";
>> +   };
>> +
>> +   serial1: serial1@f0002000 {
>> +   status = "okay";
>> +   };
>> +
>> +   serial2: serial2@f0003000 {
>> +   status = "okay";
>> +   };
>> +
>> +   serial3: serial3@f0004000 {
>> +   status = "okay";
>> +   };
>> +   };


Re: [PATCH v3 2/3] arm: dts: add Nuvoton NPCM750 device tree

2017-09-05 Thread Joel Stanley
On Wed, Sep 6, 2017 at 10:00 AM, Brendan Higgins
 wrote:
> +++ b/Documentation/devicetree/bindings/arm/npcm/npcm.txt
> @@ -0,0 +1,6 @@
> +NPCM Platforms Device Tree Bindings
> +---
> +NPCM750 SoC
> +Required root node properties:
> +   - compatible = "nuvoton,npcm750";
> +

This is minimal. I assume there will be more content added as more
support is added?

Does it need it's own directory?


> diff --git a/arch/arm/boot/dts/nuvoton-npcm750-evb.dts 
> b/arch/arm/boot/dts/nuvoton-npcm750-evb.dts
> new file mode 100644
> index ..54df32cff21b
> --- /dev/null
> +++ b/arch/arm/boot/dts/nuvoton-npcm750-evb.dts

> +
> +/dts-v1/;
> +#include "nuvoton-npcm750.dtsi"
> +
> +/ {
> +   model = "Nuvoton npcm750 Development Board (Device Tree)";
> +   compatible = "nuvoton,npcm750";
> +
> +   chosen {
> +   stdout-path = 
> +   bootargs = "earlyprintk=serial,serial3,115200";
> +   };
> +
> +   memory {
> +   reg = <0 0x4000>;
> +   };
> +
> +   cpus {
> +   enable-method = "nuvoton,npcm7xx-smp";
> +   };
> +
> +   clk: clock-controller@f0801000 {
> +   status = "okay";
> +   };
> +
> +   apb {
> +   watchdog1: watchdog@f0009000 {
> +   status = "okay";
> +   };

You've already got the label for the node, is there are reason you
don't use a phandle to set the status?

 {
   status = "okay";
};

Same with the serial nodes below.

> +
> +   serial0: serial0@f0001000 {
> +   status = "okay";
> +   };
> +
> +   serial1: serial1@f0002000 {
> +   status = "okay";
> +   };
> +
> +   serial2: serial2@f0003000 {
> +   status = "okay";
> +   };
> +
> +   serial3: serial3@f0004000 {
> +   status = "okay";
> +   };
> +   };


Re: [PATCH v3 2/3] arm: dts: add Nuvoton NPCM750 device tree

2017-09-05 Thread Joel Stanley
On Wed, Sep 6, 2017 at 10:00 AM, Brendan Higgins
 wrote:
> +++ b/Documentation/devicetree/bindings/arm/npcm/npcm.txt
> @@ -0,0 +1,6 @@
> +NPCM Platforms Device Tree Bindings
> +---
> +NPCM750 SoC
> +Required root node properties:
> +   - compatible = "nuvoton,npcm750";
> +

This is minimal. I assume there will be more content added as more
support is added?

Does it need it's own directory?


> diff --git a/arch/arm/boot/dts/nuvoton-npcm750-evb.dts 
> b/arch/arm/boot/dts/nuvoton-npcm750-evb.dts
> new file mode 100644
> index ..54df32cff21b
> --- /dev/null
> +++ b/arch/arm/boot/dts/nuvoton-npcm750-evb.dts

> +
> +/dts-v1/;
> +#include "nuvoton-npcm750.dtsi"
> +
> +/ {
> +   model = "Nuvoton npcm750 Development Board (Device Tree)";
> +   compatible = "nuvoton,npcm750";
> +
> +   chosen {
> +   stdout-path = 
> +   bootargs = "earlyprintk=serial,serial3,115200";
> +   };
> +
> +   memory {
> +   reg = <0 0x4000>;
> +   };
> +
> +   cpus {
> +   enable-method = "nuvoton,npcm7xx-smp";
> +   };
> +
> +   clk: clock-controller@f0801000 {
> +   status = "okay";
> +   };
> +
> +   apb {
> +   watchdog1: watchdog@f0009000 {
> +   status = "okay";
> +   };

You've already got the label for the node, is there are reason you
don't use a phandle to set the status?

 {
   status = "okay";
};

Same with the serial nodes below.

> +
> +   serial0: serial0@f0001000 {
> +   status = "okay";
> +   };
> +
> +   serial1: serial1@f0002000 {
> +   status = "okay";
> +   };
> +
> +   serial2: serial2@f0003000 {
> +   status = "okay";
> +   };
> +
> +   serial3: serial3@f0004000 {
> +   status = "okay";
> +   };
> +   };


[PATCH v3 2/3] arm: dts: add Nuvoton NPCM750 device tree

2017-09-05 Thread Brendan Higgins
Add a common device tree for all Nuvoton NPCM750 BMCs and a board
specific device tree for the NPCM750 (Poleg) evaluation board.

Signed-off-by: Brendan Higgins 
Reviewed-by: Tomer Maimon 
Reviewed-by: Avi Fishman 
Tested-by: Tomer Maimon 
Tested-by: Avi Fishman 
---
 .../arm/cpu-enable-method/nuvoton,npcm7xx-smp  |  42 +
 .../devicetree/bindings/arm/npcm/npcm.txt  |   6 +
 arch/arm/boot/dts/nuvoton-npcm750-evb.dts  |  59 +++
 arch/arm/boot/dts/nuvoton-npcm750.dtsi | 177 +
 include/dt-bindings/clock/nuvoton,npcm7xx-clks.h   |  39 +
 5 files changed, 323 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/arm/cpu-enable-method/nuvoton,npcm7xx-smp
 create mode 100644 Documentation/devicetree/bindings/arm/npcm/npcm.txt
 create mode 100644 arch/arm/boot/dts/nuvoton-npcm750-evb.dts
 create mode 100644 arch/arm/boot/dts/nuvoton-npcm750.dtsi
 create mode 100644 include/dt-bindings/clock/nuvoton,npcm7xx-clks.h

diff --git 
a/Documentation/devicetree/bindings/arm/cpu-enable-method/nuvoton,npcm7xx-smp 
b/Documentation/devicetree/bindings/arm/cpu-enable-method/nuvoton,npcm7xx-smp
new file mode 100644
index ..e81f85b400cf
--- /dev/null
+++ 
b/Documentation/devicetree/bindings/arm/cpu-enable-method/nuvoton,npcm7xx-smp
@@ -0,0 +1,42 @@
+=
+Secondary CPU enable-method "nuvoton,npcm7xx-smp" binding
+=
+
+To apply to all CPUs, a single "nuvoton,npcm7xx-smp" enable method should be
+defined in the "cpus" node.
+
+Enable method name:"nuvoton,npcm7xx-smp"
+Compatible machines:   "nuvoton,npcm750"
+Compatible CPUs:   "arm,cortex-a9"
+Related properties:(none)
+
+Note:
+This enable method needs valid nodes compatible with "arm,cortex-a9-scu" and
+"nuvoton,npcm750-gcr".
+
+Example:
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   enable-method = "nuvoton,npcm7xx-smp";
+
+   cpu@0 {
+   device_type = "cpu";
+   compatible = "arm,cortex-a9";
+   clocks = < NPCM7XX_CLK_CPU>;
+   clock-names = "clk_cpu";
+   reg = <0>;
+   next-level-cache = <>;
+   };
+
+   cpu@1 {
+   device_type = "cpu";
+   compatible = "arm,cortex-a9";
+   clocks = < NPCM7XX_CLK_CPU>;
+   clock-names = "clk_cpu";
+   reg = <1>;
+   next-level-cache = <>;
+   };
+   };
+
diff --git a/Documentation/devicetree/bindings/arm/npcm/npcm.txt 
b/Documentation/devicetree/bindings/arm/npcm/npcm.txt
new file mode 100644
index ..2d87d9ecea85
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/npcm/npcm.txt
@@ -0,0 +1,6 @@
+NPCM Platforms Device Tree Bindings
+---
+NPCM750 SoC
+Required root node properties:
+   - compatible = "nuvoton,npcm750";
+
diff --git a/arch/arm/boot/dts/nuvoton-npcm750-evb.dts 
b/arch/arm/boot/dts/nuvoton-npcm750-evb.dts
new file mode 100644
index ..54df32cff21b
--- /dev/null
+++ b/arch/arm/boot/dts/nuvoton-npcm750-evb.dts
@@ -0,0 +1,59 @@
+/*
+ * DTS file for all NPCM750 SoCs
+ *
+ * Copyright 2012 Tomer Maimon 
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+#include "nuvoton-npcm750.dtsi"
+
+/ {
+   model = "Nuvoton npcm750 Development Board (Device Tree)";
+   compatible = "nuvoton,npcm750";
+
+   chosen {
+   stdout-path = 
+   bootargs = "earlyprintk=serial,serial3,115200";
+   };
+
+   memory {
+   reg = <0 0x4000>;
+   };
+
+   cpus {
+   enable-method = "nuvoton,npcm7xx-smp";
+   };
+
+   clk: clock-controller@f0801000 {
+   status = "okay";
+   };
+
+   apb {
+   watchdog1: watchdog@f0009000 {
+   status = "okay";
+   };
+
+   serial0: serial0@f0001000 {
+   status = "okay";
+   };
+
+   serial1: serial1@f0002000 {
+   status = "okay";
+   };
+
+   serial2: serial2@f0003000 {
+   status = "okay";
+   };
+
+   serial3: serial3@f0004000 {
+   status = "okay";
+   };
+   };
+};
diff --git 

[PATCH v3 2/3] arm: dts: add Nuvoton NPCM750 device tree

2017-09-05 Thread Brendan Higgins
Add a common device tree for all Nuvoton NPCM750 BMCs and a board
specific device tree for the NPCM750 (Poleg) evaluation board.

Signed-off-by: Brendan Higgins 
Reviewed-by: Tomer Maimon 
Reviewed-by: Avi Fishman 
Tested-by: Tomer Maimon 
Tested-by: Avi Fishman 
---
 .../arm/cpu-enable-method/nuvoton,npcm7xx-smp  |  42 +
 .../devicetree/bindings/arm/npcm/npcm.txt  |   6 +
 arch/arm/boot/dts/nuvoton-npcm750-evb.dts  |  59 +++
 arch/arm/boot/dts/nuvoton-npcm750.dtsi | 177 +
 include/dt-bindings/clock/nuvoton,npcm7xx-clks.h   |  39 +
 5 files changed, 323 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/arm/cpu-enable-method/nuvoton,npcm7xx-smp
 create mode 100644 Documentation/devicetree/bindings/arm/npcm/npcm.txt
 create mode 100644 arch/arm/boot/dts/nuvoton-npcm750-evb.dts
 create mode 100644 arch/arm/boot/dts/nuvoton-npcm750.dtsi
 create mode 100644 include/dt-bindings/clock/nuvoton,npcm7xx-clks.h

diff --git 
a/Documentation/devicetree/bindings/arm/cpu-enable-method/nuvoton,npcm7xx-smp 
b/Documentation/devicetree/bindings/arm/cpu-enable-method/nuvoton,npcm7xx-smp
new file mode 100644
index ..e81f85b400cf
--- /dev/null
+++ 
b/Documentation/devicetree/bindings/arm/cpu-enable-method/nuvoton,npcm7xx-smp
@@ -0,0 +1,42 @@
+=
+Secondary CPU enable-method "nuvoton,npcm7xx-smp" binding
+=
+
+To apply to all CPUs, a single "nuvoton,npcm7xx-smp" enable method should be
+defined in the "cpus" node.
+
+Enable method name:"nuvoton,npcm7xx-smp"
+Compatible machines:   "nuvoton,npcm750"
+Compatible CPUs:   "arm,cortex-a9"
+Related properties:(none)
+
+Note:
+This enable method needs valid nodes compatible with "arm,cortex-a9-scu" and
+"nuvoton,npcm750-gcr".
+
+Example:
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   enable-method = "nuvoton,npcm7xx-smp";
+
+   cpu@0 {
+   device_type = "cpu";
+   compatible = "arm,cortex-a9";
+   clocks = < NPCM7XX_CLK_CPU>;
+   clock-names = "clk_cpu";
+   reg = <0>;
+   next-level-cache = <>;
+   };
+
+   cpu@1 {
+   device_type = "cpu";
+   compatible = "arm,cortex-a9";
+   clocks = < NPCM7XX_CLK_CPU>;
+   clock-names = "clk_cpu";
+   reg = <1>;
+   next-level-cache = <>;
+   };
+   };
+
diff --git a/Documentation/devicetree/bindings/arm/npcm/npcm.txt 
b/Documentation/devicetree/bindings/arm/npcm/npcm.txt
new file mode 100644
index ..2d87d9ecea85
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/npcm/npcm.txt
@@ -0,0 +1,6 @@
+NPCM Platforms Device Tree Bindings
+---
+NPCM750 SoC
+Required root node properties:
+   - compatible = "nuvoton,npcm750";
+
diff --git a/arch/arm/boot/dts/nuvoton-npcm750-evb.dts 
b/arch/arm/boot/dts/nuvoton-npcm750-evb.dts
new file mode 100644
index ..54df32cff21b
--- /dev/null
+++ b/arch/arm/boot/dts/nuvoton-npcm750-evb.dts
@@ -0,0 +1,59 @@
+/*
+ * DTS file for all NPCM750 SoCs
+ *
+ * Copyright 2012 Tomer Maimon 
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+#include "nuvoton-npcm750.dtsi"
+
+/ {
+   model = "Nuvoton npcm750 Development Board (Device Tree)";
+   compatible = "nuvoton,npcm750";
+
+   chosen {
+   stdout-path = 
+   bootargs = "earlyprintk=serial,serial3,115200";
+   };
+
+   memory {
+   reg = <0 0x4000>;
+   };
+
+   cpus {
+   enable-method = "nuvoton,npcm7xx-smp";
+   };
+
+   clk: clock-controller@f0801000 {
+   status = "okay";
+   };
+
+   apb {
+   watchdog1: watchdog@f0009000 {
+   status = "okay";
+   };
+
+   serial0: serial0@f0001000 {
+   status = "okay";
+   };
+
+   serial1: serial1@f0002000 {
+   status = "okay";
+   };
+
+   serial2: serial2@f0003000 {
+   status = "okay";
+   };
+
+   serial3: serial3@f0004000 {
+   status = "okay";
+   };
+   };
+};
diff --git a/arch/arm/boot/dts/nuvoton-npcm750.dtsi 
b/arch/arm/boot/dts/nuvoton-npcm750.dtsi
new file mode 100644
index ..bca96b3ae9d3
---