2018-02-06 00:00:16

by Brendan Higgins

[permalink] [raw]
Subject: [PATCH v9 0/3] arm: npcm: add basic support for Nuvoton BMCs

Addressed comments from:
- Philippe: https://www.spinics.net/lists/arm-kernel/msg621710.html

Summary of changes since previous update:
- Now use SPDX ids instead of traditional license boilerplate. Top of file
comments are now C++ style comments.
- Changed reviewers listed in MAINTAINERS.


2018-02-05 23:59:24

by Brendan Higgins

[permalink] [raw]
Subject: [PATCH v9 2/3] arm: dts: add Nuvoton NPCM750 device tree

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 <[email protected]>
Reviewed-by: Tomer Maimon <[email protected]>
Reviewed-by: Avi Fishman <[email protected]>
Reviewed-by: Joel Stanley <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Tested-by: Tomer Maimon <[email protected]>
Tested-by: Avi Fishman <[email protected]>
---
.../arm/cpu-enable-method/nuvoton,npcm7xx-smp | 42 ++++++
.../devicetree/bindings/arm/npcm/npcm.txt | 6 +
arch/arm/boot/dts/nuvoton-npcm750-evb.dts | 35 +++++
arch/arm/boot/dts/nuvoton-npcm750.dtsi | 162 +++++++++++++++++++++
include/dt-bindings/clock/nuvoton,npcm7xx-clks.h | 35 +++++
5 files changed, 280 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 000000000000..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 = <&clk NPCM7XX_CLK_CPU>;
+ clock-names = "clk_cpu";
+ reg = <0>;
+ next-level-cache = <&L2>;
+ };
+
+ cpu@1 {
+ device_type = "cpu";
+ compatible = "arm,cortex-a9";
+ clocks = <&clk NPCM7XX_CLK_CPU>;
+ clock-names = "clk_cpu";
+ reg = <1>;
+ next-level-cache = <&L2>;
+ };
+ };
+
diff --git a/Documentation/devicetree/bindings/arm/npcm/npcm.txt b/Documentation/devicetree/bindings/arm/npcm/npcm.txt
new file mode 100644
index 000000000000..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 000000000000..cabde3d5be8a
--- /dev/null
+++ b/arch/arm/boot/dts/nuvoton-npcm750-evb.dts
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (c) 2018 Nuvoton Technology corporation.
+// Copyright 2018 Google, Inc.
+
+/dts-v1/;
+#include "nuvoton-npcm750.dtsi"
+
+/ {
+ model = "Nuvoton npcm750 Development Board (Device Tree)";
+ compatible = "nuvoton,npcm750";
+
+ chosen {
+ stdout-path = &serial3;
+ };
+
+ memory {
+ reg = <0 0x40000000>;
+ };
+};
+
+&serial0 {
+ status = "okay";
+};
+
+&serial1 {
+ status = "okay";
+};
+
+&serial2 {
+ status = "okay";
+};
+
+&serial3 {
+ 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 000000000000..08e906f88c49
--- /dev/null
+++ b/arch/arm/boot/dts/nuvoton-npcm750.dtsi
@@ -0,0 +1,162 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (c) 2018 Nuvoton Technology corporation.
+// Copyright 2018 Google, Inc.
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/clock/nuvoton,npcm7xx-clks.h>
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ interrupt-parent = <&gic>;
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ enable-method = "nuvoton,npcm7xx-smp";
+
+ cpu@0 {
+ device_type = "cpu";
+ compatible = "arm,cortex-a9";
+ clocks = <&clk NPCM7XX_CLK_CPU>;
+ clock-names = "clk_cpu";
+ reg = <0>;
+ next-level-cache = <&l2>;
+ };
+
+ cpu@1 {
+ device_type = "cpu";
+ compatible = "arm,cortex-a9";
+ clocks = <&clk NPCM7XX_CLK_CPU>;
+ clock-names = "clk_cpu";
+ reg = <1>;
+ next-level-cache = <&l2>;
+ };
+ };
+
+/* external clock signal rg1refck, supplied by the phy */
+clk-rg1refck {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <125000000>;
+};
+
+/* external clock signal rg2refck, supplied by the phy */
+clk-rg2refck {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <125000000>;
+};
+
+clk-xin {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <50000000>;
+};
+
+ soc {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "simple-bus";
+ interrupt-parent = <&gic>;
+ ranges = <0x0 0xf0000000 0x00900000>;
+
+ gcr: gcr@800000 {
+ compatible = "nuvoton,npcm750-gcr", "syscon",
+ "simple-mfd";
+ reg = <0x800000 0x1000>;
+ };
+
+ scu: scu@3fe000 {
+ compatible = "arm,cortex-a9-scu";
+ reg = <0x3fe000 0x1000>;
+ };
+
+ l2: cache-controller@3fc000 {
+ compatible = "arm,pl310-cache";
+ reg = <0x3fc000 0x1000>;
+ interrupts = <0 21 4>;
+ cache-unified;
+ cache-level = <2>;
+ clocks = <&clk NPCM7XX_CLK_AXI>;
+ arm,shared-override;
+ };
+
+ gic: interrupt-controller@3ff000 {
+ compatible = "arm,cortex-a9-gic";
+ interrupt-controller;
+ #interrupt-cells = <3>;
+ reg = <0x3ff000 0x1000>,
+ <0x3fe100 0x100>;
+ };
+
+ timer@3fe600 {
+ compatible = "arm,cortex-a9-twd-timer";
+ reg = <0x3fe600 0x20>;
+ interrupts = <1 13 0x304>;
+ clocks = <&clk NPCM7XX_CLK_TIMER>;
+ };
+ };
+
+ ahb {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "simple-bus";
+ interrupt-parent = <&gic>;
+ ranges;
+
+ clk: clock-controller@f0801000 {
+ compatible = "nuvoton,npcm750-clk";
+ #clock-cells = <1>;
+ reg = <0xf0801000 0x1000>;
+ status = "okay";
+ };
+
+ apb {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "simple-bus";
+ interrupt-parent = <&gic>;
+ ranges = <0x0 0xf0000000 0x00300000>;
+
+ timer0: timer@8000 {
+ compatible = "nuvoton,npcm750-timer";
+ interrupts = <0 32 4>;
+ reg = <0x8000 0x1000>;
+ clocks = <&clk NPCM7XX_CLK_TIMER>;
+ };
+
+ serial0: serial@1000 {
+ compatible = "nuvoton,npcm750-uart";
+ reg = <0x1000 0x1000>;
+ clocks = <&clk NPCM7XX_CLK_UART_CORE>;
+ interrupts = <0 2 4>;
+ status = "disabled";
+ };
+
+ serial1: serial@2000 {
+ compatible = "nuvoton,npcm750-uart";
+ reg = <0x2000 0x1000>;
+ clocks = <&clk NPCM7XX_CLK_UART_CORE>;
+ interrupts = <0 3 4>;
+ status = "disabled";
+ };
+
+ serial2: serial@3000 {
+ compatible = "nuvoton,npcm750-uart";
+ reg = <0x3000 0x1000>;
+ clocks = <&clk NPCM7XX_CLK_UART_CORE>;
+ interrupts = <0 4 4>;
+ status = "disabled";
+ };
+
+ serial3: serial@4000 {
+ compatible = "nuvoton,npcm750-uart";
+ reg = <0x4000 0x1000>;
+ clocks = <&clk NPCM7XX_CLK_UART_CORE>;
+ interrupts = <0 5 4>;
+ status = "disabled";
+ };
+ };
+ };
+};
diff --git a/include/dt-bindings/clock/nuvoton,npcm7xx-clks.h b/include/dt-bindings/clock/nuvoton,npcm7xx-clks.h
new file mode 100644
index 000000000000..93918714f16c
--- /dev/null
+++ b/include/dt-bindings/clock/nuvoton,npcm7xx-clks.h
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (c) 2018 Nuvoton Technology corporation.
+// Copyright 2018 Google, Inc.
+
+#ifndef _DT_BINDINGS_CLK_NPCM7XX_H
+#define _DT_BINDINGS_CLK_NPCM7XX_H
+
+#define NPCM7XX_CLK_PLL0 0
+#define NPCM7XX_CLK_PLL1 1
+#define NPCM7XX_CLK_PLL2 2
+#define NPCM7XX_CLK_GFX 3
+#define NPCM7XX_CLK_APB1 4
+#define NPCM7XX_CLK_APB2 5
+#define NPCM7XX_CLK_APB3 6
+#define NPCM7XX_CLK_APB4 7
+#define NPCM7XX_CLK_APB5 8
+#define NPCM7XX_CLK_MC 9
+#define NPCM7XX_CLK_CPU 10
+#define NPCM7XX_CLK_SPI0 11
+#define NPCM7XX_CLK_SPI3 12
+#define NPCM7XX_CLK_SPIX 13
+#define NPCM7XX_CLK_UART_CORE 14
+#define NPCM7XX_CLK_TIMER 15
+#define NPCM7XX_CLK_HOST_UART 16
+#define NPCM7XX_CLK_MMC 17
+#define NPCM7XX_CLK_SDHC 18
+#define NPCM7XX_CLK_ADC 19
+#define NPCM7XX_CLK_GFX_MEM 20
+#define NPCM7XX_CLK_USB_BRIDGE 21
+#define NPCM7XX_CLK_AXI 22
+#define NPCM7XX_CLK_AHB 23
+#define NPCM7XX_CLK_EMC 24
+#define NPCM7XX_CLK_GMAC 25
+
+#endif
--
2.16.0.rc1.238.g530d649a79-goog


2018-02-05 23:59:43

by Brendan Higgins

[permalink] [raw]
Subject: [PATCH v9 3/3] MAINTAINERS: Add entry for the Nuvoton NPCM architecture

Add maintainers and reviewers for the Nuvoton NPCM architecture.

Signed-off-by: Brendan Higgins <[email protected]>
Reviewed-by: Tomer Maimon <[email protected]>
Reviewed-by: Avi Fishman <[email protected]>
---
MAINTAINERS | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 44cb004c765d..2fa95aba0f7f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1598,6 +1598,20 @@ F: drivers/pinctrl/nomadik/
F: drivers/i2c/busses/i2c-nomadik.c
T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git

+ARM/NUVOTON NPCM ARCHITECTURE
+M: Avi Fishman <[email protected]>
+M: Tomer Maimon <[email protected]>
+R: Patrick Venture <[email protected]>
+R: Nancy Yuen <[email protected]>
+R: Brendan Higgins <[email protected]>
+L: [email protected] (moderated for non-subscribers)
+S: Supported
+F: arch/arm/mach-npcm/
+F: arch/arm/boot/dts/nuvoton-npcm*
+F: include/dt-bindings/clock/nuvoton,npcm7xx-clks.h
+F: drivers/*/*npcm*
+F: Documentation/*/*npcm*
+
ARM/NUVOTON W90X900 ARM ARCHITECTURE
M: Wan ZongShun <[email protected]>
L: [email protected] (moderated for non-subscribers)
--
2.16.0.rc1.238.g530d649a79-goog


2018-02-06 00:00:17

by Brendan Higgins

[permalink] [raw]
Subject: [PATCH v9 1/3] arm: npcm: add basic support for Nuvoton BMCs

Adds basic support for the Nuvoton NPCM750 BMC.

Signed-off-by: Brendan Higgins <[email protected]>
Reviewed-by: Tomer Maimon <[email protected]>
Reviewed-by: Avi Fishman <[email protected]>
Tested-by: Tomer Maimon <[email protected]>
Tested-by: Avi Fishman <[email protected]>
---
arch/arm/Kconfig | 2 ++
arch/arm/Makefile | 1 +
arch/arm/mach-npcm/Kconfig | 48 ++++++++++++++++++++++++++
arch/arm/mach-npcm/Makefile | 3 ++
arch/arm/mach-npcm/headsmp.S | 17 ++++++++++
arch/arm/mach-npcm/npcm7xx.c | 20 +++++++++++
arch/arm/mach-npcm/platsmp.c | 81 ++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 172 insertions(+)
create mode 100644 arch/arm/mach-npcm/Kconfig
create mode 100644 arch/arm/mach-npcm/Makefile
create mode 100644 arch/arm/mach-npcm/headsmp.S
create mode 100644 arch/arm/mach-npcm/npcm7xx.c
create mode 100644 arch/arm/mach-npcm/platsmp.c

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 61a0cb15067e..05543f1cfbde 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -782,6 +782,8 @@ source "arch/arm/mach-netx/Kconfig"

source "arch/arm/mach-nomadik/Kconfig"

+source "arch/arm/mach-npcm/Kconfig"
+
source "arch/arm/mach-nspire/Kconfig"

source "arch/arm/plat-omap/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 47d3a1ab08d2..60ca50c7d762 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -191,6 +191,7 @@ machine-$(CONFIG_ARCH_MEDIATEK) += mediatek
machine-$(CONFIG_ARCH_MXS) += mxs
machine-$(CONFIG_ARCH_NETX) += netx
machine-$(CONFIG_ARCH_NOMADIK) += nomadik
+machine-$(CONFIG_ARCH_NPCM) += npcm
machine-$(CONFIG_ARCH_NSPIRE) += nspire
machine-$(CONFIG_ARCH_OXNAS) += oxnas
machine-$(CONFIG_ARCH_OMAP1) += omap1
diff --git a/arch/arm/mach-npcm/Kconfig b/arch/arm/mach-npcm/Kconfig
new file mode 100644
index 000000000000..6ff9df2636be
--- /dev/null
+++ b/arch/arm/mach-npcm/Kconfig
@@ -0,0 +1,48 @@
+menuconfig ARCH_NPCM
+ bool "Nuvoton NPCM Architecture"
+ select ARCH_REQUIRE_GPIOLIB
+ select USE_OF
+ select PINCTRL
+ select PINCTRL_NPCM7XX
+
+if ARCH_NPCM
+
+comment "NPCM7XX CPU type"
+
+config ARCH_NPCM750
+ depends on ARCH_NPCM && ARCH_MULTI_V7
+ bool "Support for NPCM750 BMC CPU (Poleg)"
+ select CACHE_L2X0
+ select CPU_V7
+ select ARM_GIC
+ select HAVE_SMP
+ select SMP
+ select SMP_ON_UP
+ select HAVE_ARM_SCU
+ select HAVE_ARM_TWD if SMP
+ select ARM_ERRATA_720789
+ select ARM_ERRATA_754322
+ select ARM_ERRATA_764369
+ select ARM_ERRATA_794072
+ select PL310_ERRATA_588369
+ select PL310_ERRATA_727915
+ select USB_EHCI_ROOT_HUB_TT
+ select USB_ARCH_HAS_HCD
+ select USB_ARCH_HAS_EHCI
+ select USB_EHCI_HCD
+ select USB_ARCH_HAS_OHCI
+ select USB_OHCI_HCD
+ select USB
+ select FIQ
+ select CPU_USE_DOMAINS
+ select GENERIC_CLOCKEVENTS
+ select CLKDEV_LOOKUP
+ select COMMON_CLK if OF
+ select NPCM750_TIMER
+ select MFD_SYSCON
+ help
+ Support for NPCM750 BMC CPU (Poleg).
+
+ Nuvoton NPCM750 BMC based on the Cortex A9.
+
+endif
diff --git a/arch/arm/mach-npcm/Makefile b/arch/arm/mach-npcm/Makefile
new file mode 100644
index 000000000000..c7a1316d27c1
--- /dev/null
+++ b/arch/arm/mach-npcm/Makefile
@@ -0,0 +1,3 @@
+AFLAGS_headsmp.o += -march=armv7-a
+
+obj-$(CONFIG_ARCH_NPCM750) += npcm7xx.o platsmp.o headsmp.o
diff --git a/arch/arm/mach-npcm/headsmp.S b/arch/arm/mach-npcm/headsmp.S
new file mode 100644
index 000000000000..c083fe09a07b
--- /dev/null
+++ b/arch/arm/mach-npcm/headsmp.S
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (c) 2018 Nuvoton Technology corporation.
+// Copyright 2018 Google, Inc.
+
+#include <linux/linkage.h>
+#include <linux/init.h>
+#include <asm/assembler.h>
+
+/*
+ * The boot ROM does not start secondary CPUs in SVC mode, so we need to do that
+ * here.
+ */
+ENTRY(npcm7xx_secondary_startup)
+ safe_svcmode_maskall r0
+
+ b secondary_startup
+ENDPROC(npcm7xx_secondary_startup)
diff --git a/arch/arm/mach-npcm/npcm7xx.c b/arch/arm/mach-npcm/npcm7xx.c
new file mode 100644
index 000000000000..5f7cd88103ef
--- /dev/null
+++ b/arch/arm/mach-npcm/npcm7xx.c
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (c) 2018 Nuvoton Technology corporation.
+// Copyright 2018 Google, Inc.
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach-types.h>
+#include <asm/mach/map.h>
+#include <asm/hardware/cache-l2x0.h>
+
+static const char *const npcm7xx_dt_match[] = {
+ "nuvoton,npcm750",
+ NULL
+};
+
+DT_MACHINE_START(NPCM7XX_DT, "NPCM7XX Chip family")
+ .atag_offset = 0x100,
+ .dt_compat = npcm7xx_dt_match,
+MACHINE_END
diff --git a/arch/arm/mach-npcm/platsmp.c b/arch/arm/mach-npcm/platsmp.c
new file mode 100644
index 000000000000..49079cd5c63c
--- /dev/null
+++ b/arch/arm/mach-npcm/platsmp.c
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (c) 2018 Nuvoton Technology corporation.
+// Copyright 2018 Google, Inc.
+
+#define pr_fmt(fmt) "nuvoton,npcm7xx-smp: " fmt
+
+#include <linux/delay.h>
+#include <linux/device.h>
+#include <linux/smp.h>
+#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/of_platform.h>
+#include <linux/of_address.h>
+#include <asm/cacheflush.h>
+#include <asm/smp.h>
+#include <asm/smp_plat.h>
+#include <asm/smp_scu.h>
+
+#define NPCM7XX_SCRPAD_REG 0x13c
+
+extern void npcm7xx_secondary_startup(void);
+
+static int npcm7xx_smp_boot_secondary(unsigned int cpu,
+ struct task_struct *idle)
+{
+ struct device_node *gcr_np;
+ void __iomem *gcr_base;
+ int ret = 0;
+
+ gcr_np = of_find_compatible_node(NULL, NULL, "nuvoton,npcm750-gcr");
+ if (!gcr_np) {
+ pr_err("no gcr device node\n");
+ ret = -ENODEV;
+ goto out;
+ }
+ gcr_base = of_iomap(gcr_np, 0);
+ if (!gcr_base) {
+ pr_err("could not iomap gcr");
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ /* give boot ROM kernel start address. */
+ iowrite32(__pa_symbol(npcm7xx_secondary_startup), gcr_base +
+ NPCM7XX_SCRPAD_REG);
+ /* make sure the previous write is seen by all observers. */
+ dsb_sev();
+
+ iounmap(gcr_base);
+out:
+ return ret;
+}
+
+static void __init npcm7xx_smp_prepare_cpus(unsigned int max_cpus)
+{
+ struct device_node *scu_np;
+ void __iomem *scu_base;
+
+ scu_np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
+ if (!scu_np) {
+ pr_err("no scu device node\n");
+ return;
+ }
+ scu_base = of_iomap(scu_np, 0);
+ if (!scu_base) {
+ pr_err("could not iomap scu");
+ return;
+ }
+
+ scu_enable(scu_base);
+
+ iounmap(scu_base);
+}
+
+static struct smp_operations npcm7xx_smp_ops __initdata = {
+ .smp_prepare_cpus = npcm7xx_smp_prepare_cpus,
+ .smp_boot_secondary = npcm7xx_smp_boot_secondary,
+};
+
+CPU_METHOD_OF_DECLARE(npcm7xx_smp, "nuvoton,npcm7xx-smp", &npcm7xx_smp_ops);
--
2.16.0.rc1.238.g530d649a79-goog


2018-02-13 06:25:01

by Joel Stanley

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] arm: dts: add Nuvoton NPCM750 device tree

Hi Brendan,

On Tue, Feb 6, 2018 at 10:27 AM, Brendan Higgins
<[email protected]> wrote:
> 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 <[email protected]>
> Reviewed-by: Tomer Maimon <[email protected]>
> Reviewed-by: Avi Fishman <[email protected]>
> Reviewed-by: Joel Stanley <[email protected]>
> Reviewed-by: Rob Herring <[email protected]>
> Tested-by: Tomer Maimon <[email protected]>
> Tested-by: Avi Fishman <[email protected]>

This looks well acked, reviewed and tested. How do you plan to have
the ARM SoC maintainers merge your patches?

> ---
> .../arm/cpu-enable-method/nuvoton,npcm7xx-smp | 42 ++++++
> .../devicetree/bindings/arm/npcm/npcm.txt | 6 +
> arch/arm/boot/dts/nuvoton-npcm750-evb.dts | 35 +++++
> arch/arm/boot/dts/nuvoton-npcm750.dtsi | 162 +++++++++++++++++++++
> include/dt-bindings/clock/nuvoton,npcm7xx-clks.h | 35 +++++
> 5 files changed, 280 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

You need to add nuvoton-npcm750-evb.dts to arch/arm/boot/dts/Makefile

Once you've done that you can add

Tested-by: Joel Stanley <[email protected]>

as I tested this on an EVB.

> diff --git a/arch/arm/boot/dts/nuvoton-npcm750.dtsi b/arch/arm/boot/dts/nuvoton-npcm750.dtsi
> new file mode 100644
> index 000000000000..08e906f88c49
> --- /dev/null
> +++ b/arch/arm/boot/dts/nuvoton-npcm750.dtsi
> @@ -0,0 +1,162 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Copyright (c) 2018 Nuvoton Technology corporation.
> +// Copyright 2018 Google, Inc.
> +
> +#include <dt-bindings/interrupt-controller/arm-gic.h>
> +#include <dt-bindings/clock/nuvoton,npcm7xx-clks.h>
> +
> +/ {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + interrupt-parent = <&gic>;
> +
> + cpus {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + enable-method = "nuvoton,npcm7xx-smp";
> +
> + cpu@0 {
> + device_type = "cpu";
> + compatible = "arm,cortex-a9";
> + clocks = <&clk NPCM7XX_CLK_CPU>;
> + clock-names = "clk_cpu";
> + reg = <0>;
> + next-level-cache = <&l2>;
> + };
> +
> + cpu@1 {
> + device_type = "cpu";
> + compatible = "arm,cortex-a9";
> + clocks = <&clk NPCM7XX_CLK_CPU>;
> + clock-names = "clk_cpu";
> + reg = <1>;
> + next-level-cache = <&l2>;
> + };
> + };
> +
> +/* external clock signal rg1refck, supplied by the phy */
> +clk-rg1refck {
> + compatible = "fixed-clock";
> + #clock-cells = <0>;
> + clock-frequency = <125000000>;
> +};
> +
> +/* external clock signal rg2refck, supplied by the phy */
> +clk-rg2refck {
> + compatible = "fixed-clock";
> + #clock-cells = <0>;
> + clock-frequency = <125000000>;
> +};
> +
> +clk-xin {
> + compatible = "fixed-clock";
> + #clock-cells = <0>;
> + clock-frequency = <50000000>;
> +};

The whitespace here needs to be fixed.

Cheers,

Joel

> +
> + soc {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + compatible = "simple-bus";
> + interrupt-parent = <&gic>;
> + ranges = <0x0 0xf0000000 0x00900000>;
> +

2018-02-13 08:32:01

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] arm: dts: add Nuvoton NPCM750 device tree

On Tue, Feb 6, 2018 at 12:57 AM, Brendan Higgins
<[email protected]> wrote:
> 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 <[email protected]>
> Reviewed-by: Tomer Maimon <[email protected]>
> Reviewed-by: Avi Fishman <[email protected]>
> Reviewed-by: Joel Stanley <[email protected]>
> Reviewed-by: Rob Herring <[email protected]>
> Tested-by: Tomer Maimon <[email protected]>
> Tested-by: Avi Fishman <[email protected]>
...
> + enable-method = "nuvoton,npcm7xx-smp";

I see this has already been reviewed quite a bit, but I'm curious
about the 'npcm7xx'
part here. Shouldn't that be a real chip name rather than a wildcard?

Arnd

2018-02-13 09:35:37

by Avi Fishman

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] arm: dts: add Nuvoton NPCM750 device tree

On Tue, Feb 13, 2018 at 10:30 AM, Arnd Bergmann <[email protected]> wrote:
> On Tue, Feb 6, 2018 at 12:57 AM, Brendan Higgins
> <[email protected]> wrote:
>> 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 <[email protected]>
>> Reviewed-by: Tomer Maimon <[email protected]>
>> Reviewed-by: Avi Fishman <[email protected]>
>> Reviewed-by: Joel Stanley <[email protected]>
>> Reviewed-by: Rob Herring <[email protected]>
>> Tested-by: Tomer Maimon <[email protected]>
>> Tested-by: Avi Fishman <[email protected]>
> ...
>> + enable-method = "nuvoton,npcm7xx-smp";
>
> I see this has already been reviewed quite a bit, but I'm curious
> about the 'npcm7xx'
> part here. Shouldn't that be a real chip name rather than a wildcard?
>
> Arnd

There is a family of npcm7xx, some with SMP and some without.
For those who has it, it is common for all to use the same
"nuvoton,npcm7xx-smp".

Avi

2018-02-13 19:13:20

by Brendan Higgins

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] arm: dts: add Nuvoton NPCM750 device tree

On Tue, Feb 13, 2018 at 1:29 AM, Avi Fishman <[email protected]> wrote:
> On Tue, Feb 13, 2018 at 10:30 AM, Arnd Bergmann <[email protected]> wrote:
>> On Tue, Feb 6, 2018 at 12:57 AM, Brendan Higgins
>> <[email protected]> wrote:
>>> 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 <[email protected]>
>>> Reviewed-by: Tomer Maimon <[email protected]>
>>> Reviewed-by: Avi Fishman <[email protected]>
>>> Reviewed-by: Joel Stanley <[email protected]>
>>> Reviewed-by: Rob Herring <[email protected]>
>>> Tested-by: Tomer Maimon <[email protected]>
>>> Tested-by: Avi Fishman <[email protected]>
>> ...
>>> + enable-method = "nuvoton,npcm7xx-smp";
>>
>> I see this has already been reviewed quite a bit, but I'm curious
>> about the 'npcm7xx'
>> part here. Shouldn't that be a real chip name rather than a wildcard?
>>
>> Arnd
>
> There is a family of npcm7xx, some with SMP and some without.
> For those who has it, it is common for all to use the same
> "nuvoton,npcm7xx-smp".

I think Arnd is right. In this case it should be "nuvoton,npcm750-smp". We can
use CPU_METHOD_OF_DECLARE to alias to as many compatible properties as needed.

Although everything in the 7xx family currently is either single core or has the
same SMP behavior, you could paint yourself into a corner if you were to make
one SMP device in the 7xx family which behaves differently from all other
devices and then need to come up with new compatible string names just for that.

>
> Avi

2018-02-13 19:54:10

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] arm: dts: add Nuvoton NPCM750 device tree

On Tue, Feb 13, 2018 at 8:12 PM, Brendan Higgins
<[email protected]> wrote:
> On Tue, Feb 13, 2018 at 1:29 AM, Avi Fishman <[email protected]> wrote:
>> On Tue, Feb 13, 2018 at 10:30 AM, Arnd Bergmann <[email protected]> wrote:
>>> On Tue, Feb 6, 2018 at 12:57 AM, Brendan Higgins
>>> <[email protected]> wrote:
>>>> 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 <[email protected]>
>>>> Reviewed-by: Tomer Maimon <[email protected]>
>>>> Reviewed-by: Avi Fishman <[email protected]>
>>>> Reviewed-by: Joel Stanley <[email protected]>
>>>> Reviewed-by: Rob Herring <[email protected]>
>>>> Tested-by: Tomer Maimon <[email protected]>
>>>> Tested-by: Avi Fishman <[email protected]>
>>> ...
>>>> + enable-method = "nuvoton,npcm7xx-smp";
>>>
>>> I see this has already been reviewed quite a bit, but I'm curious
>>> about the 'npcm7xx'
>>> part here. Shouldn't that be a real chip name rather than a wildcard?
>>
>> There is a family of npcm7xx, some with SMP and some without.
>> For those who has it, it is common for all to use the same
>> "nuvoton,npcm7xx-smp".
>
> I think Arnd is right. In this case it should be "nuvoton,npcm750-smp". We can
> use CPU_METHOD_OF_DECLARE to alias to as many compatible properties as needed.
>
> Although everything in the 7xx family currently is either single core or has the
> same SMP behavior, you could paint yourself into a corner if you were to make
> one SMP device in the 7xx family which behaves differently from all other
> devices and then need to come up with new compatible string names just for that.

Right, this is the reason for the very simple 'no wildcards in DT
identifiers' rule.
There simply isn't a reason to make an exception here.

Arnd

2018-02-15 02:31:15

by Joel Stanley

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] arm: dts: add Nuvoton NPCM750 device tree

On Tue, Feb 13, 2018 at 4:52 PM, Joel Stanley <[email protected]> wrote:
> Hi Brendan,
>
> On Tue, Feb 6, 2018 at 10:27 AM, Brendan Higgins
> <[email protected]> wrote:
>> 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 <[email protected]>
>> Reviewed-by: Tomer Maimon <[email protected]>
>> Reviewed-by: Avi Fishman <[email protected]>
>> Reviewed-by: Joel Stanley <[email protected]>
>> Reviewed-by: Rob Herring <[email protected]>
>> Tested-by: Tomer Maimon <[email protected]>
>> Tested-by: Avi Fishman <[email protected]>
>
> This looks well acked, reviewed and tested. How do you plan to have
> the ARM SoC maintainers merge your patches?

Following up on an IRC conversation with Brendan:

The process is normally to create a git branch based on on -rc1, apply
your patches, and send them to the ARM maintainers. You then push a
signed tag to a repository somewhere, send a pull request (a git
request-pull email, not a Github PR) and Arnd, Olof or one of the
other maintainers will pull your tree some time before the next merge
window opens.

Arnd, do we have this documented somewhere for new maintainers to follow?

Cheers,

Joel

2018-02-15 04:00:32

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] arm: dts: add Nuvoton NPCM750 device tree

On February 14, 2018 6:28:51 PM PST, Joel Stanley <[email protected]> wrote:
>On Tue, Feb 13, 2018 at 4:52 PM, Joel Stanley <[email protected]> wrote:
>> Hi Brendan,
>>
>> On Tue, Feb 6, 2018 at 10:27 AM, Brendan Higgins
>> <[email protected]> wrote:
>>> 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 <[email protected]>
>>> Reviewed-by: Tomer Maimon <[email protected]>
>>> Reviewed-by: Avi Fishman <[email protected]>
>>> Reviewed-by: Joel Stanley <[email protected]>
>>> Reviewed-by: Rob Herring <[email protected]>
>>> Tested-by: Tomer Maimon <[email protected]>
>>> Tested-by: Avi Fishman <[email protected]>
>>
>> This looks well acked, reviewed and tested. How do you plan to have
>> the ARM SoC maintainers merge your patches?
>
>Following up on an IRC conversation with Brendan:
>
>The process is normally to create a git branch based on on -rc1, apply
>your patches, and send them to the ARM maintainers. You then push a
>signed tag to a repository somewhere, send a pull request (a git
>request-pull email, not a Github PR) and Arnd, Olof or one of the
>other maintainers will pull your tree some time before the next merge
>window opens.
>
>Arnd, do we have this documented somewhere for new maintainers to
>follow?

I would add a few things that we had to go through before for Broadcom SoCs:

- send your pull requests to [email protected] and copy Arnd, Olof and Kevin

- you would want to get your PGP key signed by as many people as people as possible which should not be a problem if you are in an area with lots of kernel people like the Bay Area (which reminds me I should do that)

- if you are going to be reasonably active every cycle consider getting a kernel.org account to host your tree (we are still not doing that...)

- for future pull requests, you might want to break them into e.g: DTS, board/Kconfig, drivers, defconfig, maintainers file, and have as little dependencies between each branch to minimize merge conflicts

- build test and run test your changes against at least one other platform, e.g: QEMU to check for multiplatform issues

In case this is of any value, there is a script here that will automatically generate pull requests emails for you based on branches matching what was mentioned above, it will also take care of CC'ing the people involved in the different patches:

https://github.com/ffainelli/misc-scripts/blob/master/gen-pull.pl

It still requires you to create an appropriate tag for the pull requests, though I might semi-automate that in the future, at least spawn an editor and offer some guidance, based on commit messages as to what should be in the pull request email/tag.

HTH

--
Florian

2018-02-16 19:25:01

by Brendan Higgins

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] arm: dts: add Nuvoton NPCM750 device tree

<snip>
>>Arnd, do we have this documented somewhere for new maintainers to
>>follow?
>
> I would add a few things that we had to go through before for Broadcom SoCs:
>
> - send your pull requests to [email protected] and copy Arnd, Olof and Kevin
>
> - you would want to get your PGP key signed by as many people as people as possible which should not be a problem if you are in an area with lots of kernel people like the Bay Area (which reminds me I should do that)
>
> - if you are going to be reasonably active every cycle consider getting a kernel.org account to host your tree (we are still not doing that...)
>
> - for future pull requests, you might want to break them into e.g: DTS, board/Kconfig, drivers, defconfig, maintainers file, and have as little dependencies between each branch to minimize merge conflicts
>
> - build test and run test your changes against at least one other platform, e.g: QEMU to check for multiplatform issues
>
> In case this is of any value, there is a script here that will automatically generate pull requests emails for you based on branches matching what was mentioned above, it will also take care of CC'ing the people involved in the different patches:
>
> https://github.com/ffainelli/misc-scripts/blob/master/gen-pull.pl
>
> It still requires you to create an appropriate tag for the pull requests, though I might semi-automate that in the future, at least spawn an editor and offer some guidance, based on commit messages as to what should be in the pull request email/tag.
>
> HTH
>
> --
> Florian

Thanks Florian, this was extremely helpful!