arm: sunplus: add SP7021 LTPP3G2 board support
Subsystems (3)
cover arm: sunplus: add SP7021 LTPP3G2 board support
This series adds device tree support for the Tibbo LTPP3G2 board, which is based on the Sunplus SP7021 SoC (quad-core ARM Cortex-A7).
Patch 1 adds peripheral device nodes to the SP7021 SoC DTSI for peripherals whose drivers are already upstream: PWM, watchdog, eMMC, and the L2SW Ethernet switch.
Patch 2 adds a DTS for the LTPP3G2 board itself, enabling those peripherals and configuring the board-specific pinmux and Ethernet topology. It also updates the defconfig to enable the relevant drivers.
Tested on the Tibbo LTPP3G2 board with linux-next 20260901.
Andrew Gaylard (2):
arm: dts: sunplus: add peripheral device nodes to sp7021.dtsi
arm: sunplus: add Tibbo LTPP3G2 board support; update defconfig
arch/arm/boot/dts/sunplus/Makefile | 5 +- .../dts/sunplus/sunplus-sp7021-ltpp3g2.dts | 301 ++++++++++++++++++ arch/arm/boot/dts/sunplus/sunplus-sp7021.dtsi | 48 +++ arch/arm/configs/sp7021_defconfig | 30 ++ 4 files changed, 381 insertions(+), 3 deletions(-) create mode 100644 arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts
Signature · 1 line
2.53.0
PATCH 1/2 arm: dts: sunplus: add peripheral device nodes to sp7021.dtsi
Add device tree nodes for SP7021 peripherals whose drivers are already upstream:
- PWM controller
- Watchdog/STC timer
- eMMC controller (mmc0)
- Ethernet switch (L2SW)
--- arch/arm/boot/dts/sunplus/sunplus-sp7021.dtsi | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+)
arch/arm/boot/dts/sunplus/sunplus-sp7021.dtsi +48 -0
@@ -291,6 +291,54 @@ uart4: serial@8780 { pinctrl-0 = <&uart4_pins>; status = "disabled"; }; + + pwm: pwm@7a00 { + #pwm-cells = <2>; + compatible = "sunplus,sp7021-pwm"; + reg = <0x7a00 0x80>; + clocks = <&clkc CLK_DISP_PWM>; + resets = <&rstc RST_DISP_PWM>; + status = "disabled"; + }; + + wdt: watchdog@630 { + compatible = "sunplus,sp7021-wdt"; + reg = <0x630 0x08>, <0x274 0x04>; + clocks = <&clkc CLK_STC0>; + resets = <&rstc RST_STC0>; + status = "disabled"; + }; + + mmc0: mmc@3b00 { + compatible = "sunplus,sp7021-mmc"; + reg = <0x3b00 0x180>; + interrupts = <20 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clkc CLK_CARD_CTL0>; + resets = <&rstc RST_CARD_CTL0>; + pinctrl-names = "default"; + pinctrl-0 = <&emmc_pins>; + bus-width = <8>; + max-frequency = <52000000>; + non-removable; + disable-wp; + cap-mmc-highspeed; + mmc-ddr-3_3v; + no-sdio; + no-sd; + status = "disabled"; + }; + + l2sw: ethernet@108000 { + compatible = "sunplus,sp7021-emac"; + reg = <0x108000 0x400>; + interrupts = <66 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clkc CLK_L2SW>, <&clkc PLL_E_25>, + <&clkc PLL_E_2P5>, <&clkc PLL_E_112P5>; + clock-names = "l2sw", "plle_25", "plle_2p5", "plle_112p5"; + resets = <&rstc RST_L2SW>; + status = "disabled"; + }; + }; leds {
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH 1/2] arm: dts: sunplus: add peripheral device nodes to sp7021.dtsi
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [Medium] The Ethernet switch node ('l2sw') specifies multiple clocks and a 'clock-names' property, which…
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] The Ethernet switch node ('l2sw') specifies multiple clocks and a 'clock-names' property, which violate the sunplus,sp7021-emac binding schema.
- [Medium] The PWM node defines a 'resets' property which is undocumented and forbidden by the sunplus,sp7021-pwm.yaml binding schema.
- [Medium] The Ethernet controller node ('l2sw') unconditionally omits required properties in the .dtsi.
--
commit 7acbbeff4684bdd9972c059005ca817139e446fa
Author: Andrew Gaylard <[email protected]>
arm: dts: sunplus: add peripheral device nodes to sp7021.dtsi
This patch adds device tree nodes for the PWM controller, watchdog, eMMC controller, and Ethernet switch to the SP7021 device tree include file.
Quoted 5 lines
arch/arm/boot/dts/sunplus/sunplus-sp7021.dtsi +0
-0@@ -291,6 +291,54 @@ uart4: serial@8780 {
[ ... ]
arch/arm/boot/dts/sunplus/sunplus-sp7021.dtsi uart4: serial@8780 { · line 300
Quoted 6 lines
arch/arm/boot/dts/sunplus/sunplus-sp7021.dtsi +6
-0+ pwm: pwm@7a00 { + #pwm-cells = <2>; + compatible = "sunplus,sp7021-pwm"; + reg = <0x7a00 0x80>; + clocks = <&clkc CLK_DISP_PWM>; + resets = <&rstc RST_DISP_PWM>;
[Severity: Medium]
Does the sunplus,sp7021-pwm.yaml binding schema support the resets property?
The schema appears to lack a definition for resets and specifies
unevaluatedProperties: false, which causes a schema validation error when compiling the device tree with dtbs_check.
Quoted 2 lines
arch/arm/boot/dts/sunplus/sunplus-sp7021.dtsi +2
-0+ status = "disabled"; + };
[ ... ]
arch/arm/boot/dts/sunplus/sunplus-sp7021.dtsi uart4: serial@8780 { · line 333
Quoted 3 lines
arch/arm/boot/dts/sunplus/sunplus-sp7021.dtsi +3
-0+ l2sw: ethernet@108000 { + compatible = "sunplus,sp7021-emac"; + reg = <0x108000 0x400>;
[Severity: Medium]
Will this node cause dtbs_check validation to fail because it omits several required properties?
The sunplus,sp7021-emac.yaml schema lists pinctrl-0, pinctrl-names, ethernet-ports, and mdio as required. Including this include file in a board device tree without overriding the node to supply these properties triggers validation errors, as setting status = "disabled" does not bypass schema requirements.
arch/arm/boot/dts/sunplus/sunplus-sp7021.dtsi uart4: serial@8780 { · line 337
Quoted 4 lines
arch/arm/boot/dts/sunplus/sunplus-sp7021.dtsi +4
-0+ interrupts = <66 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clkc CLK_L2SW>, <&clkc PLL_E_25>, + <&clkc PLL_E_2P5>, <&clkc PLL_E_112P5>; + clock-names = "l2sw", "plle_25", "plle_2p5", "plle_112p5";
[Severity: Medium]
Do these properties conflict with the constraints defined in the EMAC YAML schema?
The sunplus,sp7021-emac.yaml schema explicitly restricts clocks to a maximum of one item and enforces additionalProperties: false, making the clock-names property invalid.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH 2/2 arm: sunplus: add Tibbo LTPP3G2 board support; update defconfig
In reply to Andrew GaylardAdd a device tree source for the Tibbo LTPP3G2 board based on the SP7021 SoC. The board features a quad-core ARM Cortex-A7 processor, 4GB eMMC, 10/100 Ethernet via the L2SW switch, and a PWM-controlled LED.
Enable CONFIG_ARM_ERRATA_814220 to work around a known Cortex-A7 r0p5 erratum.
Enable CGROUP and SECURITY so that the shipped rootfs will boot.
--- arch/arm/boot/dts/sunplus/Makefile | 5 +- .../dts/sunplus/sunplus-sp7021-ltpp3g2.dts | 301 ++++++++++++++++++ arch/arm/configs/sp7021_defconfig | 30 ++ 3 files changed, 333 insertions(+), 3 deletions(-) create mode 100644 arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts
arch/arm/boot/dts/sunplus/Makefile +2 -3
@@ -1,5 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 dtb-$(CONFIG_SOC_SP7021) += \ - sunplus-sp7021-demo-v3.dtb -dtb-$(CONFIG_SOC_SP7021) += \ - sunplus-sp7021-demo-v3.dtb + sunplus-sp7021-demo-v3.dtb \ + sunplus-sp7021-ltpp3g2.dtb
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts new file +301 -0
301 lines not on this page · raw message
arch/arm/configs/sp7021_defconfig +30 -0
@@ -1,4 +1,7 @@ CONFIG_SYSVIPC=y +CONFIG_CGROUPS=y +CONFIG_CGROUP_SCHED=y +CONFIG_MEMCG=y CONFIG_NO_HZ_IDLE=y CONFIG_HIGH_RES_TIMERS=y CONFIG_PREEMPT=y
@@ -16,6 +19,7 @@ CONFIG_PERF_EVENTS=y CONFIG_ARCH_SUNPLUS=y # CONFIG_VDSO is not set CONFIG_SMP=y +CONFIG_ARM_ERRATA_814220=y CONFIG_THUMB2_KERNEL=y CONFIG_ARCH_FORCE_MAX_ORDER=11 CONFIG_VFP=y
@@ -24,11 +28,16 @@ CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODVERSIONS=y # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +CONFIG_NET=y +CONFIG_UNIX=y +CONFIG_INET=y CONFIG_UEVENT_HELPER=y CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_BLK_DEV_LOOP=y +CONFIG_NETDEVICES=y +CONFIG_SP7021_EMAC=y CONFIG_INPUT_SPARSEKMAP=y CONFIG_INPUT_EVDEV=y # CONFIG_INPUT_KEYBOARD is not set
@@ -36,6 +45,25 @@ CONFIG_INPUT_EVDEV=y # CONFIG_LEGACY_PTYS is not set # CONFIG_HW_RANDOM is not set # CONFIG_HWMON is not set +CONFIG_SPI=y +CONFIG_SPI_SUNPLUS_SP7021=y +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y +CONFIG_EEPROM_AT24=y +CONFIG_MMC=y +CONFIG_MMC_SUNPLUS=y +CONFIG_WATCHDOG=y +CONFIG_WATCHDOG_SYSFS=y +CONFIG_SUNPLUS_WATCHDOG=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_SUNPLUS=y +CONFIG_NVMEM=y +CONFIG_NVMEM_SUNPLUS_OCOTP=y +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y # CONFIG_IOMMU_SUPPORT is not set CONFIG_RESET_CONTROLLER=y CONFIG_EXT4_FS=y
@@ -51,6 +79,8 @@ CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ASCII=y CONFIG_NLS_ISO8859_1=y CONFIG_NLS_UTF8=y +CONFIG_SECURITY=y +CONFIG_SECURITY_NETWORK=y CONFIG_PRINTK_TIME=y CONFIG_DYNAMIC_DEBUG=y CONFIG_MAGIC_SYSRQ=y
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH 2/2] arm: sunplus: add Tibbo LTPP3G2 board support; update defconfig
Thank you for your contribution! Sashiko AI review found 7 potential issue(s) to consider: - [Medium] The `rtc` node uses a non-existent `charging-mode` property that is unsupported by the driver…
Thank you for your contribution! Sashiko AI review found 7 potential issue(s) to consider:
- [Medium] The rtc node uses a non-existent charging-mode property that is unsupported by the driver and violates device tree bindings.
- [Medium] The EEPROM node uses an invalid compatible string at,24c16 instead of atmel,24c16.
- [Medium] The CONFIG_I2C_GPIO option is not enabled in sp7021_defconfig, which is required for the i2c_tps bus to function.
- [Medium] The board DTS creates a new root led node rather than overriding the SoC's &leds node, leading to duplicate gpio-leds instances.
- [Low] Invalid properties spi-cpha and spi-cpol applied directly to SPI controller nodes.
- [Low] The i2c_tps node uses deprecated properties gpios, i2c-gpio,scl-open-drain, and i2c-gpio,sda-open-drain, violating the i2c-gpio schema.
- [Low] The led@2 node uses a unit address in its name but lacks a reg property.
--
commit 21c4fb2cd185ac71c6b0d8d79e82b451794aa5c2
Author: Andrew Gaylard <[email protected]>
arm: sunplus: add Tibbo LTPP3G2 board support; update defconfig
This commit adds a device tree source for the Tibbo LTPP3G2 board based on the SP7021 SoC. It includes node configurations for various peripherals like I2C, SPI, RTC, and Ethernet. It also updates the defconfig to enable the necessary options for the board to boot correctly.
Quoted 6 lines
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts new file +0
-0@@ -0,0 +1,301 @@
[ ... ]
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts line 31
Quoted 2 lines
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts new file +2
-0+ led { + compatible = "gpio-leds";
[Severity: Medium]
Does creating a new root "led" node here rather than overriding the SoC's existing "&leds" node from sunplus-sp7021.dtsi create duplicate gpio-leds instances? This could result in an led subsystem sysfs naming conflict and potential issues with the SoC's default floating pin mapping, since both nodes contain a "system-led" subnode.
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts line 41
Quoted 10 lines
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts new file +10
-0+ pinctrl-names = "default", "sleep"; + pinctrl-0 = <&gpio_leds_pins>; + pinctrl-1 = <&leds_s0_slp>; + system-led { + label = "system-led"; + gpios = <&pctl 6 GPIO_ACTIVE_HIGH>; + default-state = "off"; + linux,default-trigger = "heartbeat"; + }; + led@2 {
[Severity: Low]
Does this node violate the Devicetree Specification by including a unit address ("@2") without a corresponding "reg" property? This will trigger a unit_address_vs_reg compiler warning.
Quoted 9 lines
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts new file +9
-0+ label = "SG"; + gpios = <&pctl 7 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + default-state = "off"; + }; + }; + + i2c_tps: i2c-tps { /* eeprom */ + compatible = "i2c-gpio";
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts line 60
Quoted 10 lines
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts new file +10
-0+ i2c-gpio,scl-open-drain; + i2c-gpio,sda-open-drain; + i2c-gpio,delay-us = <1>; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&pins_i2ctps>; + gpios = <&pctl 2 GPIO_ACTIVE_HIGH /* SDA */ + &pctl 1 GPIO_ACTIVE_HIGH /* SCL */ + >;
[Severity: Low]
Is this node using deprecated properties for the i2c-gpio binding? The schema requires "sda-gpios" and "scl-gpios", whereas using "gpios" alongside the boolean open-drain flags triggers dtbs_check validation errors.
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts line 62
Quoted 2 lines
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts new file +2
-0+ eeprom: eeprom@50 { + compatible = "at,24c16";
[Severity: Medium]
Is "at,24c16" an invalid compatible string for the Atmel EEPROM? The correct vendor prefix for Atmel is "atmel". Using this non-existent string could prevent the at24 EEPROM driver from matching and probing, making the device inaccessible.
Quoted 5 lines
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts new file +5
-0+ reg = <0x50>; + pagesize = <16>; + }; + }; +};
[ ... ]
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts
Quoted 3 lines
+&spi_controller0 {
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts new file +2
-0+ spi-cpha; + spi-cpol;
[Severity: Low]
Are these slave-specific flags incorrectly placed on the master controller node instead of the peripheral nodes? While the SPI controller driver ignores them on the controller node, this violates device tree schemas and causes dtbs_check validation errors.
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts line 85
Quoted 8 lines
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts new file +8
-0+ pinctrl-names = "default"; + pinctrl-0 = <&pins_spi0>; + status = "disabled"; +}; + +&spi_controller1 { + spi-cpha; + spi-cpol;
[Severity: Low]
Are these slave-specific flags also incorrectly placed on this master controller node?
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts line 91
Quoted 6 lines
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts new file +6
-0+ status = "disabled"; +}; + +&spi_controller2 { + spi-cpha; + spi-cpol;
[Severity: Low]
Are these slave-specific flags also incorrectly placed on this master controller node?
Quoted 2 lines
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts new file +2
-0+ status = "disabled"; +};
[ ... ]
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts line 167
Quoted 2 lines
+&rtc {
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts new file +1
-0+ charging-mode = <0xE>;
[Severity: Medium]
Is "charging-mode" a non-existent legacy property? This violates the schema and is unsupported by the driver, silently failing to configure the battery trickle charger hardware, which could prevent the RTC battery from charging.
Quoted 4 lines
arch/arm/boot/dts/sunplus/sunplus-sp7021-ltpp3g2.dts new file +4
-0+ /* + * 0xE Disable + * 0x1 0.86mA (2K Ohm with diode) + * 0x5 1.81mA (250 Ohm with diode)
[ ... ]
Quoted 4 lines
arch/arm/configs/sp7021_defconfig +0
-0
[ ... ]
arch/arm/configs/sp7021_defconfig CONFIG_INPUT_EVDEV=y · line 52
Quoted 9 lines
arch/arm/configs/sp7021_defconfig +5
-0@@ -36,6 +45,25 @@ CONFIG_INPUT_EVDEV=y # CONFIG_LEGACY_PTYS is not set # CONFIG_HW_RANDOM is not set # CONFIG_HWMON is not set +CONFIG_SPI=y +CONFIG_SPI_SUNPLUS_SP7021=y +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y +CONFIG_EEPROM_AT24=y
[Severity: Medium]
Is CONFIG_I2C_GPIO missing from this configuration? Since the board adds an EEPROM on the i2c_tps bus using the "i2c-gpio" compatible, failing to enable CONFIG_I2C_GPIO (which is a tristate and not selected by default) will prevent the bus from probing and break access to the EEPROM.
Quoted 2 lines
arch/arm/configs/sp7021_defconfig +2
-0+CONFIG_MMC=y +CONFIG_MMC_SUNPLUS=y
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Re: [PATCH 0/2] arm: sunplus: add SP7021 LTPP3G2 board support -- withdrawn
In reply to Andrew GaylardQuoted 2 lines · Andrew Gaylard
This series adds device tree support for the Tibbo LTPP3G2 board, which is based on the Sunplus SP7021 SoC (quad-core ARM Cortex-A7).
sashiko-bot found several issues with this series. Please don't review it, I'll fix them and re-send.