* [PATCH v7 0/4] arm64: dts: nuvoton: add NPCM845 SoC and EVB support
@ 2026-07-08 12:53 Tomer Maimon
2026-07-08 12:53 ` [PATCH v7 1/4] arm64: dts: nuvoton: npcm845: Drop redundant timer clock-names Tomer Maimon
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Tomer Maimon @ 2026-07-08 12:53 UTC (permalink / raw)
To: andrew, robh, krzk+dt, conor+dt
Cc: openbmc, devicetree, linux-kernel, avifishman70, tmaimon77,
tali.perry1, venture, yuenn, benjaminfair
This series fixes the remaining timer binding issue and adds device tree
support for peripherals on the Nuvoton NPCM845 SoC and its Evaluation
Board (EVB).
The first patch drops the undocumented timer0 clock-names property.
The second patch reorders timer0 and PECI so the APB child nodes stay in
ascending unit-address order.
The third patch introduces peripheral nodes for Ethernet, MMC, SPI, USB,
RNG, ADC, PWM-FAN, I2C, and OP-TEE firmware in the NPCM845 SoC device
tree.
The fourth patch enables these peripherals for the NPCM845-EVB, adding
MDIO nodes, reserved memory, aliases, and board-specific configurations
such as PHY modes and SPI flash partitions.
The NPCM8XX device tree was tested on NPCM845 evaluation board.
Addressed comments from:
- sashiko-bot
Changes since version 6:
- remove IPMI i2C device.
- Add FIX enable property.
- Keep patches 1-3 unchanged.
Changes since version 5:
- Add no-map to the tip_reserved firmware memory region.
- Drop the unsupported snps,eee-force-disable property from gmac1.
- Rework the FIU0 boot flash layout into nested fixed-partitions
under the bmc container.
- Keep patches 1-3 unchanged.
Changes since version 4:
- Split the timer0 clock-names cleanup into a separate first patch.
- Remove nuvoton,sysgcr from udc8 and udc9.
- Rename apb: bus@f0000000 back to apb.
- Rename spix-mode to nuvoton,spix-mode.
- Keep cooling-levels as 32-bit cells while encoding fan-tach-ch
as /bits/ 8.
Changes since version 3:
- reomve tmp100.
Changes since version 2:
- Fix dts warning
- Arrange node order by ascending unit address.
Changes since version 1:
- Fix commit message
- Fix dtbs_check warnings.
Tomer Maimon (4):
arm64: dts: nuvoton: npcm845: Drop redundant timer clock-names
arm64: dts: nuvoton: npcm845: Reorder timer0 and PECI nodes
arm64: dts: nuvoton: npcm845: Add peripheral nodes
arm64: dts: nuvoton: npcm845-evb: Add peripheral nodes
.../dts/nuvoton/nuvoton-common-npcm8xx.dtsi | 721 +++++++++++++++++-
.../boot/dts/nuvoton/nuvoton-npcm845-evb.dts | 404 ++++++++++
.../boot/dts/nuvoton/nuvoton-npcm845.dtsi | 11 +-
3 files changed, 1117 insertions(+), 19 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v7 1/4] arm64: dts: nuvoton: npcm845: Drop redundant timer clock-names
2026-07-08 12:53 [PATCH v7 0/4] arm64: dts: nuvoton: add NPCM845 SoC and EVB support Tomer Maimon
@ 2026-07-08 12:53 ` Tomer Maimon
2026-07-08 12:53 ` [PATCH v7 2/4] arm64: dts: nuvoton: npcm845: Reorder timer0 and PECI nodes Tomer Maimon
` (2 subsequent siblings)
3 siblings, 0 replies; 10+ messages in thread
From: Tomer Maimon @ 2026-07-08 12:53 UTC (permalink / raw)
To: andrew, robh, krzk+dt, conor+dt
Cc: openbmc, devicetree, linux-kernel, avifishman70, tmaimon77,
tali.perry1, venture, yuenn, benjaminfair
The NPCM845 timer0 node references a single clock, but its
clock-names property is not described by the timer binding. Drop the
undocumented name so the DTS matches the binding.
Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
---
arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
index c781190b4..9e4fa2669 100644
--- a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
+++ b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
@@ -73,7 +73,6 @@ timer0: timer@8000 {
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
reg = <0x8000 0x1C>;
clocks = <&refclk>;
- clock-names = "refclk";
};
serial0: serial@0 {
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v7 2/4] arm64: dts: nuvoton: npcm845: Reorder timer0 and PECI nodes
2026-07-08 12:53 [PATCH v7 0/4] arm64: dts: nuvoton: add NPCM845 SoC and EVB support Tomer Maimon
2026-07-08 12:53 ` [PATCH v7 1/4] arm64: dts: nuvoton: npcm845: Drop redundant timer clock-names Tomer Maimon
@ 2026-07-08 12:53 ` Tomer Maimon
2026-07-08 12:59 ` sashiko-bot
2026-07-08 12:53 ` [PATCH v7 3/4] arm64: dts: nuvoton: npcm845: Add peripheral nodes Tomer Maimon
2026-07-08 12:53 ` [PATCH v7 4/4] arm64: dts: nuvoton: npcm845-evb: " Tomer Maimon
3 siblings, 1 reply; 10+ messages in thread
From: Tomer Maimon @ 2026-07-08 12:53 UTC (permalink / raw)
To: andrew, robh, krzk+dt, conor+dt
Cc: openbmc, devicetree, linux-kernel, avifishman70, tmaimon77,
tali.perry1, venture, yuenn, benjaminfair
Move the timer0 and PECI nodes so the APB children are ordered by
ascending unit address.
Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
---
.../dts/nuvoton/nuvoton-common-npcm8xx.dtsi | 25 ++++++++++++-------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
index 9e4fa2669..0e5feabf2 100644
--- a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
+++ b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
@@ -59,15 +59,6 @@ apb {
ranges = <0x0 0x0 0xf0000000 0x00300000>,
<0xfff00000 0x0 0xfff00000 0x00016000>;
- peci: peci-controller@100000 {
- compatible = "nuvoton,npcm845-peci";
- reg = <0x100000 0x1000>;
- interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&clk NPCM8XX_CLK_APB3>;
- cmd-timeout-ms = <1000>;
- status = "disabled";
- };
-
timer0: timer@8000 {
compatible = "nuvoton,npcm845-timer";
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
@@ -138,6 +129,13 @@ serial6: serial@6000 {
status = "disabled";
};
+ timer0: timer@8000 {
+ compatible = "nuvoton,npcm845-timer";
+ interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+ reg = <0x8000 0x1C>;
+ clocks = <&refclk>;
+ };
+
watchdog0: watchdog@801c {
compatible = "nuvoton,npcm845-wdt", "nuvoton,npcm750-wdt";
interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
@@ -161,6 +159,15 @@ watchdog2: watchdog@a01c {
status = "disabled";
clocks = <&refclk>;
};
+
+ peci: peci-controller@100000 {
+ compatible = "nuvoton,npcm845-peci";
+ reg = <0x100000 0x1000>;
+ interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk NPCM8XX_CLK_APB3>;
+ cmd-timeout-ms = <1000>;
+ status = "disabled";
+ };
};
};
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v7 3/4] arm64: dts: nuvoton: npcm845: Add peripheral nodes
2026-07-08 12:53 [PATCH v7 0/4] arm64: dts: nuvoton: add NPCM845 SoC and EVB support Tomer Maimon
2026-07-08 12:53 ` [PATCH v7 1/4] arm64: dts: nuvoton: npcm845: Drop redundant timer clock-names Tomer Maimon
2026-07-08 12:53 ` [PATCH v7 2/4] arm64: dts: nuvoton: npcm845: Reorder timer0 and PECI nodes Tomer Maimon
@ 2026-07-08 12:53 ` Tomer Maimon
2026-07-08 13:11 ` sashiko-bot
2026-07-08 12:53 ` [PATCH v7 4/4] arm64: dts: nuvoton: npcm845-evb: " Tomer Maimon
3 siblings, 1 reply; 10+ messages in thread
From: Tomer Maimon @ 2026-07-08 12:53 UTC (permalink / raw)
To: andrew, robh, krzk+dt, conor+dt
Cc: openbmc, devicetree, linux-kernel, avifishman70, tmaimon77,
tali.perry1, venture, yuenn, benjaminfair
Extend the NPCM845 SoC DTSI with the peripheral controller nodes needed
by the evaluation board and downstream platforms. Add the Ethernet MACs,
USB device controllers and PHY, MMC controller, FIU controllers, memory
controller, RNG, ADC, PWM/FAN controller, and I2C buses. Also add the
OP-TEE firmware node needed to describe these blocks.
Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
---
.../dts/nuvoton/nuvoton-common-npcm8xx.dtsi | 695 +++++++++++++++++-
.../boot/dts/nuvoton/nuvoton-npcm845.dtsi | 11 +-
2 files changed, 697 insertions(+), 9 deletions(-)
diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
index 0e5feabf2..7608dcf54 100644
--- a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
+++ b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
@@ -4,6 +4,7 @@
#include <dt-bindings/clock/nuvoton,npcm845-clk.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/gpio/gpio.h>
/ {
#address-cells = <2>;
@@ -35,6 +36,11 @@ gic: interrupt-controller@dfff9000 {
};
};
+ udc0_phy: usb-phy {
+ compatible = "usb-nop-xceiv";
+ #phy-cells = <0>;
+ };
+
ahb {
#address-cells = <2>;
#size-cells = <2>;
@@ -51,6 +57,252 @@ clk: rstc: reset-controller@f0801000 {
#clock-cells = <1>;
};
+ gmac1: ethernet@f0804000 {
+ device_type = "network";
+ compatible = "snps,dwmac-3.72a", "snps,dwmac";
+ reg = <0x0 0xf0804000 0x0 0x2000>;
+ interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq";
+ clocks = <&clk NPCM8XX_CLK_AHB>;
+ clock-names = "stmmaceth";
+ pinctrl-names = "default";
+ pinctrl-0 = <&rg2_pins
+ &rg2mdio_pins>;
+ status = "disabled";
+ };
+
+ gmac2: ethernet@f0806000 {
+ device_type = "network";
+ compatible = "snps,dwmac-3.72a", "snps,dwmac";
+ reg = <0x0 0xf0806000 0x0 0x2000>;
+ interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq";
+ clocks = <&clk NPCM8XX_CLK_AHB>;
+ clock-names = "stmmaceth";
+ pinctrl-names = "default";
+ pinctrl-0 = <&r1_pins
+ &r1err_pins
+ &r1md_pins>;
+ status = "disabled";
+ };
+
+ gmac3: ethernet@f0808000 {
+ device_type = "network";
+ compatible = "snps,dwmac-3.72a", "snps,dwmac";
+ reg = <0x0 0xf0808000 0x0 0x2000>;
+ interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq";
+ clocks = <&clk NPCM8XX_CLK_AHB>;
+ clock-names = "stmmaceth";
+ pinctrl-names = "default";
+ pinctrl-0 = <&r2_pins
+ &r2err_pins
+ &r2md_pins>;
+ status = "disabled";
+ };
+
+ mc: memory-controller@f0824000 {
+ compatible = "nuvoton,npcm845-memory-controller";
+ reg = <0x0 0xf0824000 0x0 0x1000>;
+ interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+ };
+
+ udc0: usb@f0830000 {
+ compatible = "nuvoton,npcm845-udc", "nuvoton,npcm750-udc";
+ reg = <0x0 0xf0830000 0x0 0x1000
+ 0x0 0xfffeb000 0x0 0x800>;
+ interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk NPCM8XX_CLK_SU>;
+ clock-names = "clk_usb_bridge";
+
+ phys = <&udc0_phy>;
+ phy_type = "utmi_wide";
+ dr_mode = "peripheral";
+ status = "disabled";
+ };
+
+ udc1: usb@f0831000 {
+ compatible = "nuvoton,npcm845-udc", "nuvoton,npcm750-udc";
+ reg = <0x0 0xf0831000 0x0 0x1000
+ 0x0 0xfffeb800 0x0 0x800>;
+ interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk NPCM8XX_CLK_SU>;
+ clock-names = "clk_usb_bridge";
+
+ phys = <&udc0_phy>;
+ phy_type = "utmi_wide";
+ dr_mode = "peripheral";
+ status = "disabled";
+ };
+
+ udc2: usb@f0832000 {
+ compatible = "nuvoton,npcm845-udc", "nuvoton,npcm750-udc";
+ reg = <0x0 0xf0832000 0x0 0x1000
+ 0x0 0xfffec000 0x0 0x800>;
+ interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk NPCM8XX_CLK_SU>;
+ clock-names = "clk_usb_bridge";
+
+ phys = <&udc0_phy>;
+ phy_type = "utmi_wide";
+ dr_mode = "peripheral";
+ status = "disabled";
+ };
+
+ udc3: usb@f0833000 {
+ compatible = "nuvoton,npcm845-udc", "nuvoton,npcm750-udc";
+ reg = <0x0 0xf0833000 0x0 0x1000
+ 0x0 0xfffec800 0x0 0x800>;
+ interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk NPCM8XX_CLK_SU>;
+ clock-names = "clk_usb_bridge";
+
+ phys = <&udc0_phy>;
+ phy_type = "utmi_wide";
+ dr_mode = "peripheral";
+ status = "disabled";
+ };
+
+ udc4: usb@f0834000 {
+ compatible = "nuvoton,npcm845-udc", "nuvoton,npcm750-udc";
+ reg = <0x0 0xf0834000 0x0 0x1000
+ 0x0 0xfffed000 0x0 0x800>;
+ interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk NPCM8XX_CLK_SU>;
+ clock-names = "clk_usb_bridge";
+
+ phys = <&udc0_phy>;
+ phy_type = "utmi_wide";
+ dr_mode = "peripheral";
+ status = "disabled";
+ };
+
+ udc5: usb@f0835000 {
+ compatible = "nuvoton,npcm845-udc", "nuvoton,npcm750-udc";
+ reg = <0x0 0xf0835000 0x0 0x1000
+ 0x0 0xfffed800 0x0 0x800>;
+ interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk NPCM8XX_CLK_SU>;
+ clock-names = "clk_usb_bridge";
+
+ phys = <&udc0_phy>;
+ phy_type = "utmi_wide";
+ dr_mode = "peripheral";
+ status = "disabled";
+ };
+
+ udc6: usb@f0836000 {
+ compatible = "nuvoton,npcm845-udc", "nuvoton,npcm750-udc";
+ reg = <0x0 0xf0836000 0x0 0x1000
+ 0x0 0xfffee000 0x0 0x800>;
+ interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk NPCM8XX_CLK_SU>;
+ clock-names = "clk_usb_bridge";
+
+ phys = <&udc0_phy>;
+ phy_type = "utmi_wide";
+ dr_mode = "peripheral";
+ status = "disabled";
+ };
+
+ udc7: usb@f0837000 {
+ compatible = "nuvoton,npcm845-udc", "nuvoton,npcm750-udc";
+ reg = <0x0 0xf0837000 0x0 0x1000
+ 0x0 0xfffee800 0x0 0x800>;
+ interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk NPCM8XX_CLK_SU>;
+ clock-names = "clk_usb_bridge";
+
+ phys = <&udc0_phy>;
+ phy_type = "utmi_wide";
+ dr_mode = "peripheral";
+ status = "disabled";
+ };
+
+ udc8: usb@f0838000 {
+ compatible = "nuvoton,npcm845-udc", "nuvoton,npcm750-udc";
+ reg = <0x0 0xf0838000 0x0 0x1000
+ 0x0 0xfffef000 0x0 0x800>;
+ interrupts = <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk NPCM8XX_CLK_SU>;
+ clock-names = "clk_usb_bridge";
+
+ phys = <&udc0_phy>;
+ phy_type = "utmi_wide";
+ dr_mode = "peripheral";
+ status = "disabled";
+ };
+
+ udc9: usb@f0839000 {
+ compatible = "nuvoton,npcm845-udc", "nuvoton,npcm750-udc";
+ reg = <0x0 0xf0839000 0x0 0x1000
+ 0x0 0xfffef800 0x0 0x800>;
+ interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk NPCM8XX_CLK_SU>;
+ clock-names = "clk_usb_bridge";
+
+ phys = <&udc0_phy>;
+ phy_type = "utmi_wide";
+ dr_mode = "peripheral";
+ status = "disabled";
+ };
+
+ sdhci: mmc@f0842000 {
+ compatible = "nuvoton,npcm845-sdhci";
+ reg = <0x0 0xf0842000 0x0 0x100>;
+ interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk NPCM8XX_CLK_AHB>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc8_pins
+ &mmc_pins>;
+ status = "disabled";
+ };
+
+ fiu0: spi@fb000000 {
+ compatible = "nuvoton,npcm845-fiu";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0x0 0xfb000000 0x0 0x1000>;
+ reg-names = "control";
+ clocks = <&clk NPCM8XX_CLK_SPI0>;
+ status = "disabled";
+ };
+
+ fiu1: spi@fb002000 {
+ compatible = "nuvoton,npcm845-fiu";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0x0 0xfb002000 0x0 0x1000>;
+ reg-names = "control";
+ clocks = <&clk NPCM8XX_CLK_SPI1>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi1_pins>;
+ status = "disabled";
+ };
+
+ fiu3: spi@c0000000 {
+ compatible = "nuvoton,npcm845-fiu";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0x0 0xc0000000 0x0 0x1000>;
+ reg-names = "control";
+ clocks = <&clk NPCM8XX_CLK_SPI3>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi3_pins>;
+ status = "disabled";
+ };
+
+ fiux: spi@fb001000 {
+ compatible = "nuvoton,npcm845-fiu";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0x0 0xfb001000 0x0 0x1000>,
+ <0x0 0xf8000000 0x0 0x2000000>;
+ reg-names = "control", "memory";
+ clocks = <&clk NPCM8XX_CLK_SPIX>;
+ status = "disabled";
+ };
+
apb {
#address-cells = <1>;
#size-cells = <1>;
@@ -59,13 +311,6 @@ apb {
ranges = <0x0 0x0 0xf0000000 0x00300000>,
<0xfff00000 0x0 0xfff00000 0x00016000>;
- timer0: timer@8000 {
- compatible = "nuvoton,npcm845-timer";
- interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
- reg = <0x8000 0x1C>;
- clocks = <&refclk>;
- };
-
serial0: serial@0 {
compatible = "nuvoton,npcm845-uart", "nuvoton,npcm750-uart";
reg = <0x0 0x1000>;
@@ -168,6 +413,442 @@ peci: peci-controller@100000 {
cmd-timeout-ms = <1000>;
status = "disabled";
};
+
+ rng: rng@b000 {
+ compatible = "nuvoton,npcm845-rng";
+ reg = <0xb000 0x8>;
+ status = "disabled";
+ };
+
+ adc: adc@c000 {
+ compatible = "nuvoton,npcm845-adc";
+ reg = <0xC000 0x8>;
+ interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk NPCM8XX_CLK_ADC>;
+ resets = <&rstc 0x20 27>;
+ status = "disabled";
+ };
+
+ i2c0: i2c@80000 {
+ reg = <0x80000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb0_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c1: i2c@81000 {
+ reg = <0x81000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb1_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c2: i2c@82000 {
+ reg = <0x82000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb2_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c3: i2c@83000 {
+ reg = <0x83000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb3_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c4: i2c@84000 {
+ reg = <0x84000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 132 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb4_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c5: i2c@85000 {
+ reg = <0x85000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb5_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c6: i2c@86000 {
+ reg = <0x86000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb6_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c7: i2c@87000 {
+ reg = <0x87000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb7_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c8: i2c@88000 {
+ reg = <0x88000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb8_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c9: i2c@89000 {
+ reg = <0x89000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb9_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c10: i2c@8a000 {
+ reg = <0x8a000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb10_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c11: i2c@8b000 {
+ reg = <0x8b000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb11_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c12: i2c@8c000 {
+ reg = <0x8c000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb12_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c13: i2c@8d000 {
+ reg = <0x8d000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb13_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c14: i2c@8e000 {
+ reg = <0x8e000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb14_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c15: i2c@8f000 {
+ reg = <0x8f000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb15_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c16: i2c@fff00000 {
+ reg = <0xfff00000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb16_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c17: i2c@fff01000 {
+ reg = <0xfff01000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb17_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c18: i2c@fff02000 {
+ reg = <0xfff02000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb18_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c19: i2c@fff03000 {
+ reg = <0xfff03000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb19_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c20: i2c@fff04000 {
+ reg = <0xfff04000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb20_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c21: i2c@fff05000 {
+ reg = <0xfff05000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb21_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c22: i2c@fff06000 {
+ reg = <0xfff06000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb22_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c23: i2c@fff07000 {
+ reg = <0xfff07000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&smb23_pins>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c24: i2c@fff08000 {
+ reg = <0xfff08000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c25: i2c@fff09000 {
+ reg = <0xfff09000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ i2c26: i2c@fff0a000 {
+ reg = <0xfff0a000 0x1000>;
+ compatible = "nuvoton,npcm845-i2c";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clocks = <&clk NPCM8XX_CLK_APB2>;
+ clock-frequency = <100000>;
+ interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
+ nuvoton,sys-mgr = <&gcr>;
+ status = "disabled";
+ };
+
+ pwm_fan:pwm-fan-controller@103000 {
+ compatible = "nuvoton,npcm845-pwm-fan";
+ reg = <0x103000 0x3000>,
+ <0x180000 0x8000>;
+ reg-names = "pwm", "fan";
+ clocks = <&clk NPCM8XX_CLK_APB3>,
+ <&clk NPCM8XX_CLK_APB4>;
+ clock-names = "pwm","fan";
+ interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pwm0_pins &pwm1_pins
+ &pwm2_pins &pwm3_pins
+ &pwm4_pins &pwm5_pins
+ &pwm6_pins &pwm7_pins
+ &pwm8_pins &pwm9_pins
+ &pwm10_pins &pwm11_pins
+ &fanin0_pins &fanin1_pins
+ &fanin2_pins &fanin3_pins
+ &fanin4_pins &fanin5_pins
+ &fanin6_pins &fanin7_pins
+ &fanin8_pins &fanin9_pins
+ &fanin10_pins &fanin11_pins
+ &fanin12_pins &fanin13_pins
+ &fanin14_pins &fanin15_pins>;
+ status = "disabled";
+ };
+
+ pspi: spi@201000 {
+ compatible = "nuvoton,npcm845-pspi";
+ reg = <0x201000 0x1000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pspi_pins>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk NPCM8XX_CLK_APB5>;
+ clock-names = "clk_apb5";
+ resets = <&rstc 0x24 23>;
+ status = "disabled";
+ };
+
};
};
diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845.dtsi b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845.dtsi
index 8239d9a9f..21dea3236 100644
--- a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845.dtsi
+++ b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845.dtsi
@@ -64,8 +64,8 @@ arm-pmu {
};
psci {
- compatible = "arm,psci-1.0";
- method = "smc";
+ compatible = "arm,psci-1.0";
+ method = "smc";
};
timer {
@@ -75,4 +75,11 @@ timer {
<GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
<GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
};
+
+ firmware {
+ optee {
+ compatible = "linaro,optee-tz";
+ method = "smc";
+ };
+ };
};
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v7 4/4] arm64: dts: nuvoton: npcm845-evb: Add peripheral nodes
2026-07-08 12:53 [PATCH v7 0/4] arm64: dts: nuvoton: add NPCM845 SoC and EVB support Tomer Maimon
` (2 preceding siblings ...)
2026-07-08 12:53 ` [PATCH v7 3/4] arm64: dts: nuvoton: npcm845: Add peripheral nodes Tomer Maimon
@ 2026-07-08 12:53 ` Tomer Maimon
2026-07-08 13:08 ` sashiko-bot
3 siblings, 1 reply; 10+ messages in thread
From: Tomer Maimon @ 2026-07-08 12:53 UTC (permalink / raw)
To: andrew, robh, krzk+dt, conor+dt
Cc: openbmc, devicetree, linux-kernel, avifishman70, tmaimon77,
tali.perry1, venture, yuenn, benjaminfair
Enable peripheral support for the NPCM845 evaluation board by wiring up
the SoC controller nodes to the board design. Add board aliases,
GPIO-backed MDIO buses for the external PHYs, a reserved-memory region
for TIP firmware, and flash partitions for the FIU boot flash. Enable
the Ethernet MACs, MMC controller, FIU controllers, USB device
controllers, ADC, RNG, PWM/FAN controller, I2C buses, and PECI
interface with the board-specific pinctrl and PHY connections they
require.
Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
---
.../boot/dts/nuvoton/nuvoton-npcm845-evb.dts | 404 ++++++++++++++++++
1 file changed, 404 insertions(+)
diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
index 5edf5d133..7717c3a8f 100644
--- a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
+++ b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
@@ -10,6 +10,42 @@ / {
aliases {
serial0 = &serial0;
+ ethernet1 = &gmac1;
+ ethernet2 = &gmac2;
+ ethernet3 = &gmac3;
+ mdio-gpio0 = &mdio0;
+ mdio-gpio1 = &mdio1;
+ fiu0 = &fiu0;
+ fiu1 = &fiu3;
+ fiu2 = &fiux;
+ fiu3 = &fiu1;
+ i2c0 = &i2c0;
+ i2c1 = &i2c1;
+ i2c2 = &i2c2;
+ i2c3 = &i2c3;
+ i2c4 = &i2c4;
+ i2c5 = &i2c5;
+ i2c6 = &i2c6;
+ i2c7 = &i2c7;
+ i2c8 = &i2c8;
+ i2c9 = &i2c9;
+ i2c10 = &i2c10;
+ i2c11 = &i2c11;
+ i2c12 = &i2c12;
+ i2c13 = &i2c13;
+ i2c14 = &i2c14;
+ i2c15 = &i2c15;
+ i2c16 = &i2c16;
+ i2c17 = &i2c17;
+ i2c18 = &i2c18;
+ i2c19 = &i2c19;
+ i2c20 = &i2c20;
+ i2c21 = &i2c21;
+ i2c22 = &i2c22;
+ i2c23 = &i2c23;
+ i2c24 = &i2c24;
+ i2c25 = &i2c25;
+ i2c26 = &i2c26;
};
chosen {
@@ -26,12 +62,380 @@ refclk: refclk-25mhz {
clock-frequency = <25000000>;
#clock-cells = <0>;
};
+
+ reserved-memory {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+
+ tip_reserved: tip@0 {
+ reg = <0x0 0x0 0x0 0x6200000>;
+ no-map;
+ };
+ };
+
+ mdio0: mdio-0 {
+ compatible = "virtual,mdio-gpio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>,
+ <&gpio1 26 GPIO_ACTIVE_HIGH>;
+
+ phy0: ethernet-phy@0 {
+ reg = <0>;
+ };
+ };
+
+ mdio1: mdio-1 {
+ compatible = "virtual,mdio-gpio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ gpios = <&gpio2 27 GPIO_ACTIVE_HIGH>,
+ <&gpio2 28 GPIO_ACTIVE_HIGH>;
+
+ phy1: ethernet-phy@0 {
+ reg = <0>;
+ };
+ };
+};
+
+&gmac1 {
+ phy-mode = "rgmii-id";
+ status = "okay";
+};
+
+&gmac2 {
+ phy-mode = "rmii";
+ pinctrl-names = "default";
+ pinctrl-0 = <&r1_pins
+ &r1oen_pins>;
+ phy-handle = <&phy0>;
+ status = "okay";
+};
+
+&gmac3 {
+ phy-mode = "rmii";
+ pinctrl-names = "default";
+ pinctrl-0 = <&r2_pins
+ &r2oen_pins>;
+ phy-handle = <&phy1>;
+ status = "okay";
};
&serial0 {
status = "okay";
};
+&fiu0 {
+ status = "okay";
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ spi-rx-bus-width = <1>;
+ reg = <0>;
+ spi-max-frequency = <5000000>;
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ bmc@0 {
+ compatible = "fixed-partitions";
+ label = "bmc";
+ reg = <0x00000000 0x04000000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ u-boot@0 {
+ label = "u-boot";
+ reg = <0x00000000 0x007C0000>;
+ };
+ u-boot-env@7c0000 {
+ label = "u-boot-env";
+ reg = <0x007C0000 0x00040000>;
+ };
+ kernel@800000 {
+ label = "kernel";
+ reg = <0x00800000 0x00800000>;
+ };
+ rofs@1000000 {
+ label = "rofs";
+ reg = <0x01000000 0x02C00000>;
+ };
+ rwfs@3c00000 {
+ label = "rwfs";
+ reg = <0x03C00000 0x00400000>;
+ };
+ };
+ };
+ };
+};
+
+&fiu1 {
+ status = "okay";
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ spi-rx-bus-width = <2>;
+ spi-tx-bus-width = <2>;
+ reg = <0>;
+ spi-max-frequency = <5000000>;
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ partition@0 {
+ label = "spi1-system1";
+ reg = <0x0 0x0>;
+ };
+ };
+ };
+};
+
+&fiu3 {
+ pinctrl-0 = <&spi3_pins>, <&spi3quad_pins>;
+ status = "okay";
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ spi-rx-bus-width = <1>;
+ reg = <0>;
+ spi-max-frequency = <5000000>;
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ partition@0 {
+ label = "spi3-system1";
+ reg = <0x0 0x0>;
+ };
+ };
+ };
+};
+
+&fiux {
+ status = "okay";
+ nuvoton,spix-mode;
+};
+
+&sdhci {
+ status = "okay";
+};
+
+&udc0 {
+ status = "okay";
+};
+
+&udc1 {
+ status = "okay";
+};
+
+&udc2 {
+ status = "okay";
+};
+
+&udc3 {
+ status = "okay";
+};
+
+&udc4 {
+ status = "okay";
+};
+
+&udc5 {
+ status = "okay";
+};
+
+&udc6 {
+ status = "okay";
+};
+
+&udc7 {
+ status = "okay";
+};
+
+&mc {
+ status = "okay";
+};
+
+&peci {
+ status = "okay";
+};
+
+&rng {
+ status = "okay";
+};
+
+&adc {
+ #io-channel-cells = <1>;
+ status = "okay";
+};
+
&watchdog1 {
status = "okay";
};
+
+&pwm_fan {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pwm0_pins &pwm1_pins
+ &pwm2_pins &pwm3_pins
+ &pwm4_pins &pwm5_pins
+ &pwm6_pins &pwm7_pins
+ &fanin0_pins &fanin1_pins
+ &fanin2_pins &fanin3_pins
+ &fanin4_pins &fanin5_pins
+ &fanin6_pins &fanin7_pins>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ fan@0 {
+ reg = <0x00>;
+ fan-tach-ch = /bits/ 8 <0x0 0x1>;
+ cooling-levels = <127 255>;
+ };
+ fan@1 {
+ reg = <0x01>;
+ fan-tach-ch = /bits/ 8 <0x2 0x3>;
+ cooling-levels = <127 255>;
+ };
+ fan@2 {
+ reg = <0x02>;
+ fan-tach-ch = /bits/ 8 <0x4 0x5>;
+ cooling-levels = <127 255>;
+ };
+ fan@3 {
+ reg = <0x03>;
+ fan-tach-ch = /bits/ 8 <0x6 0x7>;
+ cooling-levels = <127 255>;
+ };
+ fan@4 {
+ reg = <0x04>;
+ fan-tach-ch = /bits/ 8 <0x8 0x9>;
+ cooling-levels = <127 255>;
+ };
+ fan@5 {
+ reg = <0x05>;
+ fan-tach-ch = /bits/ 8 <0xa 0xb>;
+ cooling-levels = <127 255>;
+ };
+ fan@6 {
+ reg = <0x06>;
+ fan-tach-ch = /bits/ 8 <0xc 0xd>;
+ cooling-levels = <127 255>;
+ };
+ fan@7 {
+ reg = <0x07>;
+ fan-tach-ch = /bits/ 8 <0xe 0xf>;
+ cooling-levels = <127 255>;
+ };
+};
+
+&i2c0 {
+ status = "okay";
+};
+
+&i2c1 {
+ status = "okay";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ eeprom@50 {
+ compatible = "atmel,24c256";
+ reg = <0x50>;
+ };
+};
+
+&i2c2 {
+ status = "okay";
+};
+
+&i2c3 {
+ status = "okay";
+};
+
+&i2c4 {
+ status = "okay";
+};
+
+&i2c5 {
+ status = "okay";
+};
+
+&i2c6 {
+ status = "okay";
+};
+
+&i2c7 {
+ status = "okay";
+};
+
+&i2c8 {
+ status = "okay";
+};
+
+&i2c9 {
+ status = "okay";
+};
+
+&i2c10 {
+ status = "okay";
+};
+
+&i2c11 {
+ status = "okay";
+};
+
+&i2c12 {
+ status = "okay";
+};
+
+&i2c13 {
+ status = "okay";
+};
+
+&i2c14 {
+ status = "okay";
+};
+
+&i2c15 {
+ status = "okay";
+};
+
+&i2c16 {
+ status = "okay";
+};
+
+&i2c17 {
+ status = "okay";
+};
+
+&i2c18 {
+ status = "okay";
+};
+
+&i2c19 {
+ status = "okay";
+};
+
+&i2c20 {
+ status = "okay";
+};
+
+&i2c21 {
+ status = "okay";
+};
+
+&i2c22 {
+ status = "okay";
+};
+
+&i2c23 {
+ status = "okay";
+};
+
+&i2c24 {
+ status = "okay";
+};
+
+&i2c25 {
+ status = "okay";
+};
+
+&i2c26 {
+ status = "okay";
+};
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v7 2/4] arm64: dts: nuvoton: npcm845: Reorder timer0 and PECI nodes
2026-07-08 12:53 ` [PATCH v7 2/4] arm64: dts: nuvoton: npcm845: Reorder timer0 and PECI nodes Tomer Maimon
@ 2026-07-08 12:59 ` sashiko-bot
0 siblings, 0 replies; 10+ messages in thread
From: sashiko-bot @ 2026-07-08 12:59 UTC (permalink / raw)
To: Tomer Maimon; +Cc: robh, conor+dt, devicetree
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The patch duplicates the `timer0` node instead of moving it, resulting in a duplicate node and label definition that will cause a Device Tree Compiler (DTC) error.
--
--- Patch [2]: [PATCH v7 2/4] arm64: dts: nuvoton: npcm845: Reorder timer0 and PECI nodes ---
commit 1450734310ae6f4872b7fb3d37cc7db1efd0ebca
Author: Tomer Maimon <tmaimon77@gmail.com>
arm64: dts: nuvoton: npcm845: Reorder timer0 and PECI nodes
Move the timer0 and PECI nodes so the APB children are ordered by
ascending unit address.
> diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
> --- a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
> +++ b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
> @@ -59,15 +59,6 @@ apb {
> ranges = <0x0 0x0 0xf0000000 0x00300000>,
> <0xfff00000 0x0 0xfff00000 0x00016000>;
>
> - peci: peci-controller@100000 {
> - compatible = "nuvoton,npcm845-peci";
> - reg = <0x100000 0x1000>;
> - interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
> - clocks = <&clk NPCM8XX_CLK_APB3>;
> - cmd-timeout-ms = <1000>;
> - status = "disabled";
> - };
> -
> timer0: timer@8000 {
> compatible = "nuvoton,npcm845-timer";
> interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
[ ... ]
> @@ -138,6 +129,13 @@ serial6: serial@6000 {
> status = "disabled";
> };
>
> + timer0: timer@8000 {
> + compatible = "nuvoton,npcm845-timer";
> + interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
> + reg = <0x8000 0x1C>;
> + clocks = <&refclk>;
> + };
> +
[Severity: Low]
Will this result in a duplicate node and label definition during dtbs
compilation?
It appears this patch adds timer0 to its new sorted location but misses
removing the original timer0 node from the top of the apb bus. This typically
causes a duplicate label error from the Device Tree Compiler.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260708125352.1915040-1-tmaimon77@gmail.com?part=2
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v7 4/4] arm64: dts: nuvoton: npcm845-evb: Add peripheral nodes
2026-07-08 12:53 ` [PATCH v7 4/4] arm64: dts: nuvoton: npcm845-evb: " Tomer Maimon
@ 2026-07-08 13:08 ` sashiko-bot
2026-07-08 15:45 ` Tomer Maimon
0 siblings, 1 reply; 10+ messages in thread
From: sashiko-bot @ 2026-07-08 13:08 UTC (permalink / raw)
To: Tomer Maimon; +Cc: conor+dt, devicetree, robh
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The device tree aliases for fiu1 and fiu3 are swapped, causing mismatched physical interfaces and partition labels.
--
--- Patch [4]: [PATCH v7 4/4] arm64: dts: nuvoton: npcm845-evb: Add peripheral nodes ---
commit addb487f93312d5fc6f3c9be5cafae0cfda32949
Author: Tomer Maimon <tmaimon77@gmail.com>
arm64: dts: nuvoton: npcm845-evb: Add peripheral nodes
This commit enables peripheral support for the NPCM845 evaluation board by
wiring up the SoC controller nodes to the board design. It adds board aliases,
MDIO buses, reserved memory, flash partitions, and enables various controllers.
> diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
> index 5edf5d13342da..7717c3a8f76d2 100644
> --- a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
> +++ b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
> @@ -10,6 +10,42 @@ / {
>
> aliases {
> serial0 = &serial0;
> + ethernet1 = &gmac1;
> + ethernet2 = &gmac2;
> + ethernet3 = &gmac3;
> + mdio-gpio0 = &mdio0;
> + mdio-gpio1 = &mdio1;
> + fiu0 = &fiu0;
> + fiu1 = &fiu3;
> + fiu2 = &fiux;
> + fiu3 = &fiu1;
[Severity: Medium]
Are the aliases for fiu1 and fiu3 swapped here?
The underlying node for &fiu1 is labeled "spi1-system1" and &fiu3 is labeled
"spi3-system1" later in the device tree. Could this cross-wiring cause
userspace scripts or tools that rely on fixed controller IDs to write to or
read from the wrong SPI flash partition?
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260708125352.1915040-1-tmaimon77@gmail.com?part=4
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v7 3/4] arm64: dts: nuvoton: npcm845: Add peripheral nodes
2026-07-08 12:53 ` [PATCH v7 3/4] arm64: dts: nuvoton: npcm845: Add peripheral nodes Tomer Maimon
@ 2026-07-08 13:11 ` sashiko-bot
2026-07-08 16:52 ` Tomer Maimon
0 siblings, 1 reply; 10+ messages in thread
From: sashiko-bot @ 2026-07-08 13:11 UTC (permalink / raw)
To: Tomer Maimon; +Cc: robh, conor+dt, devicetree
Thank you for your contribution! Sashiko AI review found 6 potential issue(s) to consider:
New issues:
- [Medium] The `fiu0`, `fiu1`, and `fiu3` SPI flash controllers omit the required `memory` mapping region.
- [Low] The `pspi` (Peripheral SPI) controller is added but not documented in the commit message.
Pre-existing issues:
- [High] The IRQ name passed to `devm_request_irq` is allocated on the stack, leading to a dangling pointer in the IRQ subsystem.
- [High] The fan ISR calculates the module index using virtual IRQ numbers, leading to an out-of-bounds array access and memory corruption.
- [High] The USB device controller driver fails to save the allocated `ci_hdrc` pointer, causing a deterministic NULL pointer dereference on device removal.
- [High] The EDAC driver frees its main control structure on the probe error path while a device-managed interrupt is still registered and active.
--
--- Patch [3]: [PATCH v7 3/4] arm64: dts: nuvoton: npcm845: Add peripheral nodes ---
commit f606ce99eafc7d4c8e2d67d9d5119b1c25593a16
Author: Tomer Maimon <tmaimon77@gmail.com>
Subject: arm64: dts: nuvoton: npcm845: Add peripheral nodes
This commit extends the NPCM845 SoC DTSI by adding peripheral controller nodes
needed by the evaluation board and downstream platforms. It adds nodes for
Ethernet, USB, MMC, FIU, memory controller, RNG, ADC, PWM/FAN, I2C, and the
OP-TEE firmware.
> Extend the NPCM845 SoC DTSI with the peripheral controller nodes needed
> by the evaluation board and downstream platforms. Add the Ethernet MACs,
> USB device controllers and PHY, MMC controller, FIU controllers, memory
> controller, RNG, ADC, PWM/FAN controller, and I2C buses. Also add the
> OP-TEE firmware node needed to describe these blocks.
[Severity: Low]
The pspi (Peripheral SPI) controller node is added by this patch, but it
isn't mentioned in the commit message. Should it be included in this summary?
> diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
> index 0e5feabf2d718..7608dcf5489c4 100644
> --- a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
> +++ b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
[ ... ]
> + mc: memory-controller@f0824000 {
> + compatible = "nuvoton,npcm845-memory-controller";
> + reg = <0x0 0xf0824000 0x0 0x1000>;
> + interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
> + };
[Severity: High]
This is a pre-existing issue, but adding this memory controller node exposes
a vulnerability in the EDAC driver (drivers/edac/npcm_edac.c).
In drivers/edac/npcm_edac.c:setup_irq(), a devres-managed interrupt is
registered and the hardware is unmasked:
ret = devm_request_irq(&pdev->dev, irq, edac_ecc_isr, 0,
dev_name(&pdev->dev), mci);
...
regmap_write(npcm_regmap, pdata->ctl_int_mask_master,
pdata->int_mask_master_non_ecc_mask);
If edac_mc_add_mc() fails later in edac_probe(), the code jumps to the error
path and frees the main control structure:
free_edac_mc:
edac_mc_free(mci);
return rc;
Since the interrupt remains registered and active until devres teardown,
could the hardware assert an ECC interrupt during this window, causing
edac_ecc_isr() to dereference the freed mci pointer?
[ ... ]
> + udc0: usb@f0830000 {
> + compatible = "nuvoton,npcm845-udc", "nuvoton,npcm750-udc";
> + reg = <0x0 0xf0830000 0x0 0x1000
> + 0x0 0xfffeb000 0x0 0x800>;
> + interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&clk NPCM8XX_CLK_SU>;
> + clock-names = "clk_usb_bridge";
> +
> + phys = <&udc0_phy>;
> + phy_type = "utmi_wide";
> + dr_mode = "peripheral";
> + status = "disabled";
> + };
[Severity: High]
This isn't a bug introduced by this patch, but adding these USB controller
nodes exposes an issue in drivers/usb/chipidea/ci_hdrc_npcm.c.
In drivers/usb/chipidea/ci_hdrc_npcm.c:npcm_udc_probe(), plat_ci is
successfully returned but never assigned to ci->ci:
plat_ci = ci_hdrc_add_device(dev, pdev->resource, pdev->num_resources,
&ci->pdata);
if (IS_ERR(plat_ci)) { ... }
When the device is removed, npcm_udc_remove() passes the uninitialized ci->ci
pointer to ci_hdrc_remove_device(), which immediately dereferences it.
Could this lead to a NULL pointer dereference during device unbind?
[ ... ]
> + fiu0: spi@fb000000 {
> + compatible = "nuvoton,npcm845-fiu";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <0x0 0xfb000000 0x0 0x1000>;
> + reg-names = "control";
> + clocks = <&clk NPCM8XX_CLK_SPI0>;
> + status = "disabled";
> + };
> +
> + fiu1: spi@fb002000 {
> + compatible = "nuvoton,npcm845-fiu";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <0x0 0xfb002000 0x0 0x1000>;
> + reg-names = "control";
> + clocks = <&clk NPCM8XX_CLK_SPI1>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&spi1_pins>;
> + status = "disabled";
> + };
> +
> + fiu3: spi@c0000000 {
> + compatible = "nuvoton,npcm845-fiu";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <0x0 0xc0000000 0x0 0x1000>;
> + reg-names = "control";
> + clocks = <&clk NPCM8XX_CLK_SPI3>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&spi3_pins>;
> + status = "disabled";
> + };
[Severity: Medium]
Do these FIU controller nodes need a 'memory' mapping region?
Without the 'memory' register range, the SPI driver might fail to use
memory-mapped direct reads and drop to UMA (manual) mode, degrading
performance. The fiux node below includes it, but fiu0, fiu1, and fiu3
do not.
[ ... ]
> + pwm_fan:pwm-fan-controller@103000 {
> + compatible = "nuvoton,npcm845-pwm-fan";
> + reg = <0x103000 0x3000>,
> + <0x180000 0x8000>;
> + reg-names = "pwm", "fan";
> + clocks = <&clk NPCM8XX_CLK_APB3>,
> + <&clk NPCM8XX_CLK_APB4>;
> + clock-names = "pwm","fan";
> + interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
[ ... ]
> + status = "disabled";
> + };
[Severity: High]
This isn't a bug introduced by this patch, but enabling this PWM/FAN
controller node triggers a dangling pointer bug in
drivers/hwmon/npcm750-pwm-fan.c.
In drivers/hwmon/npcm750-pwm-fan.c:npcm7xx_pwm_fan_probe(), the IRQ name is
allocated on the stack:
char name[20];
...
sprintf(name, "NPCM7XX-FAN-MD%d", i);
ret = devm_request_irq(dev, data->fan_irq[i], npcm7xx_fan_isr, 0, name,
(void *)data);
Since devm_request_irq() stores the name pointer in the IRQ descriptor, the
stack frame destruction upon probe return leaves a dangling pointer.
Could this cause a use-after-free or panic when userspace reads
/proc/interrupts?
[Severity: High]
This is also a pre-existing issue, but there is another bug in
drivers/hwmon/npcm750-pwm-fan.c that this node exposes.
In drivers/hwmon/npcm750-pwm-fan.c:npcm7xx_fan_isr(), the module index is
derived by subtracting the first virtual IRQ from the incoming virtual IRQ:
module = irq - data->fan_irq[0];
spin_lock_irqsave(&data->fan_lock[module], flags);
Because the kernel's irqdomain does not guarantee that virtual IRQs are
contiguous or allocated in order, could this subtraction result in an
out-of-bounds array access and memory corruption when acquiring the spinlock?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260708125352.1915040-1-tmaimon77@gmail.com?part=3
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v7 4/4] arm64: dts: nuvoton: npcm845-evb: Add peripheral nodes
2026-07-08 13:08 ` sashiko-bot
@ 2026-07-08 15:45 ` Tomer Maimon
0 siblings, 0 replies; 10+ messages in thread
From: Tomer Maimon @ 2026-07-08 15:45 UTC (permalink / raw)
To: sashiko-reviews; +Cc: conor+dt, devicetree, robh
Hi,
On Wed, 8 Jul 2026 at 16:08, <sashiko-bot@kernel.org> wrote:
>
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The device tree aliases for fiu1 and fiu3 are swapped, causing mismatched physical interfaces and partition labels.
> --
>
> --- Patch [4]: [PATCH v7 4/4] arm64: dts: nuvoton: npcm845-evb: Add peripheral nodes ---
> commit addb487f93312d5fc6f3c9be5cafae0cfda32949
> Author: Tomer Maimon <tmaimon77@gmail.com>
>
> arm64: dts: nuvoton: npcm845-evb: Add peripheral nodes
>
> This commit enables peripheral support for the NPCM845 evaluation board by
> wiring up the SoC controller nodes to the board design. It adds board aliases,
> MDIO buses, reserved memory, flash partitions, and enables various controllers.
>
> > diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
> > index 5edf5d13342da..7717c3a8f76d2 100644
> > --- a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
> > +++ b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
> > @@ -10,6 +10,42 @@ / {
> >
> > aliases {
> > serial0 = &serial0;
> > + ethernet1 = &gmac1;
> > + ethernet2 = &gmac2;
> > + ethernet3 = &gmac3;
> > + mdio-gpio0 = &mdio0;
> > + mdio-gpio1 = &mdio1;
> > + fiu0 = &fiu0;
> > + fiu1 = &fiu3;
> > + fiu2 = &fiux;
> > + fiu3 = &fiu1;
>
> [Severity: Medium]
> Are the aliases for fiu1 and fiu3 swapped here?
No, it is explained in the dt-binding
Alias convention:
The '/aliases' node should define:
For NPCM7xx: fiu0=&fiu0; fiu1=&fiu3; fiu2=&fiux;
For NPCM8xx: fiu0=&fiu0; fiu1=&fiu3; fiu2=&fiux; fiu3=&fiu1;
>
> The underlying node for &fiu1 is labeled "spi1-system1" and &fiu3 is labeled
> "spi3-system1" later in the device tree. Could this cross-wiring cause
> userspace scripts or tools that rely on fixed controller IDs to write to or
> read from the wrong SPI flash partition?
>
> [ ... ]
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20260708125352.1915040-1-tmaimon77@gmail.com?part=4
Thanks,
Tomer
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v7 3/4] arm64: dts: nuvoton: npcm845: Add peripheral nodes
2026-07-08 13:11 ` sashiko-bot
@ 2026-07-08 16:52 ` Tomer Maimon
0 siblings, 0 replies; 10+ messages in thread
From: Tomer Maimon @ 2026-07-08 16:52 UTC (permalink / raw)
To: sashiko-reviews; +Cc: robh, conor+dt, devicetree
On Wed, 8 Jul 2026 at 16:11, <sashiko-bot@kernel.org> wrote:
>
> Thank you for your contribution! Sashiko AI review found 6 potential issue(s) to consider:
>
> New issues:
> - [Medium] The `fiu0`, `fiu1`, and `fiu3` SPI flash controllers omit the required `memory` mapping region.
No, it is explained in the dt-binding
Alias convention:
The '/aliases' node should define:
For NPCM7xx: fiu0=&fiu0; fiu1=&fiu3; fiu2=&fiux;
For NPCM8xx: fiu0=&fiu0; fiu1=&fiu3; fiu2=&fiux; fiu3=&fiu1;
> - [Low] The `pspi` (Peripheral SPI) controller is added but not documented in the commit message.
Will be changed in V8
>
> Pre-existing issues:
> - [High] The IRQ name passed to `devm_request_irq` is allocated on the stack, leading to a dangling pointer in the IRQ subsystem.
> - [High] The fan ISR calculates the module index using virtual IRQ numbers, leading to an out-of-bounds array access and memory corruption.
> - [High] The USB device controller driver fails to save the allocated `ci_hdrc` pointer, causing a deterministic NULL pointer dereference on device removal.
> - [High] The EDAC driver frees its main control structure on the probe error path while a device-managed interrupt is still registered and active.
> --
>
> --- Patch [3]: [PATCH v7 3/4] arm64: dts: nuvoton: npcm845: Add peripheral nodes ---
> commit f606ce99eafc7d4c8e2d67d9d5119b1c25593a16
> Author: Tomer Maimon <tmaimon77@gmail.com>
> Subject: arm64: dts: nuvoton: npcm845: Add peripheral nodes
>
> This commit extends the NPCM845 SoC DTSI by adding peripheral controller nodes
> needed by the evaluation board and downstream platforms. It adds nodes for
> Ethernet, USB, MMC, FIU, memory controller, RNG, ADC, PWM/FAN, I2C, and the
> OP-TEE firmware.
>
> > Extend the NPCM845 SoC DTSI with the peripheral controller nodes needed
> > by the evaluation board and downstream platforms. Add the Ethernet MACs,
> > USB device controllers and PHY, MMC controller, FIU controllers, memory
> > controller, RNG, ADC, PWM/FAN controller, and I2C buses. Also add the
> > OP-TEE firmware node needed to describe these blocks.
>
> [Severity: Low]
> The pspi (Peripheral SPI) controller node is added by this patch, but it
> isn't mentioned in the commit message. Should it be included in this summary?
>
> > diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
> > index 0e5feabf2d718..7608dcf5489c4 100644
> > --- a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
> > +++ b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
> [ ... ]
> > + mc: memory-controller@f0824000 {
> > + compatible = "nuvoton,npcm845-memory-controller";
> > + reg = <0x0 0xf0824000 0x0 0x1000>;
> > + interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
> > + };
>
> [Severity: High]
> This is a pre-existing issue, but adding this memory controller node exposes
> a vulnerability in the EDAC driver (drivers/edac/npcm_edac.c).
>
> In drivers/edac/npcm_edac.c:setup_irq(), a devres-managed interrupt is
> registered and the hardware is unmasked:
>
> ret = devm_request_irq(&pdev->dev, irq, edac_ecc_isr, 0,
> dev_name(&pdev->dev), mci);
> ...
> regmap_write(npcm_regmap, pdata->ctl_int_mask_master,
> pdata->int_mask_master_non_ecc_mask);
>
> If edac_mc_add_mc() fails later in edac_probe(), the code jumps to the error
> path and frees the main control structure:
>
> free_edac_mc:
> edac_mc_free(mci);
> return rc;
>
> Since the interrupt remains registered and active until devres teardown,
> could the hardware assert an ECC interrupt during this window, causing
> edac_ecc_isr() to dereference the freed mci pointer?
Yes, should be changed
>
> [ ... ]
> > + udc0: usb@f0830000 {
> > + compatible = "nuvoton,npcm845-udc", "nuvoton,npcm750-udc";
> > + reg = <0x0 0xf0830000 0x0 0x1000
> > + 0x0 0xfffeb000 0x0 0x800>;
> > + interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
> > + clocks = <&clk NPCM8XX_CLK_SU>;
> > + clock-names = "clk_usb_bridge";
> > +
> > + phys = <&udc0_phy>;
> > + phy_type = "utmi_wide";
> > + dr_mode = "peripheral";
> > + status = "disabled";
> > + };
>
> [Severity: High]
> This isn't a bug introduced by this patch, but adding these USB controller
> nodes exposes an issue in drivers/usb/chipidea/ci_hdrc_npcm.c.
>
> In drivers/usb/chipidea/ci_hdrc_npcm.c:npcm_udc_probe(), plat_ci is
> successfully returned but never assigned to ci->ci:
>
> plat_ci = ci_hdrc_add_device(dev, pdev->resource, pdev->num_resources,
> &ci->pdata);
> if (IS_ERR(plat_ci)) { ... }
>
> When the device is removed, npcm_udc_remove() passes the uninitialized ci->ci
> pointer to ci_hdrc_remove_device(), which immediately dereferences it.
>
> Could this lead to a NULL pointer dereference during device unbind?
>
> [ ... ]
> > + fiu0: spi@fb000000 {
> > + compatible = "nuvoton,npcm845-fiu";
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > + reg = <0x0 0xfb000000 0x0 0x1000>;
> > + reg-names = "control";
> > + clocks = <&clk NPCM8XX_CLK_SPI0>;
> > + status = "disabled";
> > + };
> > +
> > + fiu1: spi@fb002000 {
> > + compatible = "nuvoton,npcm845-fiu";
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > + reg = <0x0 0xfb002000 0x0 0x1000>;
> > + reg-names = "control";
> > + clocks = <&clk NPCM8XX_CLK_SPI1>;
> > + pinctrl-names = "default";
> > + pinctrl-0 = <&spi1_pins>;
> > + status = "disabled";
> > + };
> > +
> > + fiu3: spi@c0000000 {
> > + compatible = "nuvoton,npcm845-fiu";
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > + reg = <0x0 0xc0000000 0x0 0x1000>;
> > + reg-names = "control";
> > + clocks = <&clk NPCM8XX_CLK_SPI3>;
> > + pinctrl-names = "default";
> > + pinctrl-0 = <&spi3_pins>;
> > + status = "disabled";
> > + };
>
> [Severity: Medium]
> Do these FIU controller nodes need a 'memory' mapping region?
>
> Without the 'memory' register range, the SPI driver might fail to use
> memory-mapped direct reads and drop to UMA (manual) mode, degrading
> performance. The fiux node below includes it, but fiu0, fiu1, and fiu3
> do not.
>
> [ ... ]
> > + pwm_fan:pwm-fan-controller@103000 {
> > + compatible = "nuvoton,npcm845-pwm-fan";
> > + reg = <0x103000 0x3000>,
> > + <0x180000 0x8000>;
> > + reg-names = "pwm", "fan";
> > + clocks = <&clk NPCM8XX_CLK_APB3>,
> > + <&clk NPCM8XX_CLK_APB4>;
> > + clock-names = "pwm","fan";
> > + interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
> > + <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
> > + <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
> > + <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
> > + <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
> > + <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
> > + <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
> > + <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
> [ ... ]
> > + status = "disabled";
> > + };
>
> [Severity: High]
> This isn't a bug introduced by this patch, but enabling this PWM/FAN
> controller node triggers a dangling pointer bug in
> drivers/hwmon/npcm750-pwm-fan.c.
>
> In drivers/hwmon/npcm750-pwm-fan.c:npcm7xx_pwm_fan_probe(), the IRQ name is
> allocated on the stack:
>
> char name[20];
> ...
> sprintf(name, "NPCM7XX-FAN-MD%d", i);
> ret = devm_request_irq(dev, data->fan_irq[i], npcm7xx_fan_isr, 0, name,
> (void *)data);
>
> Since devm_request_irq() stores the name pointer in the IRQ descriptor, the
> stack frame destruction upon probe return leaves a dangling pointer.
>
> Could this cause a use-after-free or panic when userspace reads
> /proc/interrupts?
>
> [Severity: High]
> This is also a pre-existing issue, but there is another bug in
> drivers/hwmon/npcm750-pwm-fan.c that this node exposes.
>
> In drivers/hwmon/npcm750-pwm-fan.c:npcm7xx_fan_isr(), the module index is
> derived by subtracting the first virtual IRQ from the incoming virtual IRQ:
>
> module = irq - data->fan_irq[0];
> spin_lock_irqsave(&data->fan_lock[module], flags);
>
> Because the kernel's irqdomain does not guarantee that virtual IRQs are
> contiguous or allocated in order, could this subtraction result in an
> out-of-bounds array access and memory corruption when acquiring the spinlock?
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20260708125352.1915040-1-tmaimon77@gmail.com?part=3
Thanks,
Tomer
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-07-08 17:00 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08 12:53 [PATCH v7 0/4] arm64: dts: nuvoton: add NPCM845 SoC and EVB support Tomer Maimon
2026-07-08 12:53 ` [PATCH v7 1/4] arm64: dts: nuvoton: npcm845: Drop redundant timer clock-names Tomer Maimon
2026-07-08 12:53 ` [PATCH v7 2/4] arm64: dts: nuvoton: npcm845: Reorder timer0 and PECI nodes Tomer Maimon
2026-07-08 12:59 ` sashiko-bot
2026-07-08 12:53 ` [PATCH v7 3/4] arm64: dts: nuvoton: npcm845: Add peripheral nodes Tomer Maimon
2026-07-08 13:11 ` sashiko-bot
2026-07-08 16:52 ` Tomer Maimon
2026-07-08 12:53 ` [PATCH v7 4/4] arm64: dts: nuvoton: npcm845-evb: " Tomer Maimon
2026-07-08 13:08 ` sashiko-bot
2026-07-08 15:45 ` Tomer Maimon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).