arm64: dts: rockchip: Add Vicharak Vaaman2 board support
Subsystems (4)
v3 cover arm64: dts: rockchip: Add Vicharak Vaaman2 board support
This patch series adds device tree support for the Vicharak Vaaman2, a single-board computer based on the Rockchip RK3588 SoC.
The Vaaman2 board features include:
- RK3588 SoC
- eMMC storage and microSD support
- RK806 PMIC and multiple RK8602/RK8603 regulators
- Real-time clock and status LED
- UART serial console and SARADC
Note: This series is generated on top of the Vicharak Axon v8 series.
Changes since v2:
- Moved 'compatible' before 'reg' in the PMIC node to follow DT coding style convention.
- Verified with dtbs_check: no warnings.
Hrushiraj Gandhi (2):
dt-bindings: arm: rockchip: Add Vicharak Vaaman2
arm64: dts: rockchip: Add Vicharak Vaaman2 board
.../devicetree/bindings/arm/rockchip.yaml | 5 + arch/arm64/boot/dts/rockchip/Makefile | 1 + .../dts/rockchip/rk3588-vicharak-vaaman2.dts | 547 ++++++++++++++++++ 3 files changed, 553 insertions(+) create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-vicharak-vaaman2.dts
Signature · 1 line
2.47.3
PATCH v3 1/2 dt-bindings: arm: rockchip: Add Vicharak Vaaman2
Add device tree binding documentation for the Vicharak Vaaman2, a single-board computer based on the Rockchip RK3588 SoC.
--- Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +5 -0
@@ -1311,6 +1311,11 @@ properties: - const: vicharak,axon - const: rockchip,rk3588 + - description: Vicharak Vaaman2 + items: + - const: vicharak,vaaman2 + - const: rockchip,rk3588 + - description: WolfVision PF5 mainboard items: - const: wolfvision,rk3568-pf5
Signature · 1 line
2.47.3
PATCH v3 1/3 netdevsim: fix use-after-free of ethtool debugfs data
In reply to Hrushiraj Gandhidebugfs files created by nsim_ethtool_init() store raw pointers directly into the netdevsim struct, which lives in the net_device private data kmalloc slab.
If the ethtool subdirectory outlives the netdevsim struct, a concurrent reader can trigger a slab-use-after-free by passing debugfs_file_get() (which only checks dentry lifetime) and then dereferencing the freed data pointer in e.g. debugfs_u32_get().
In __nsim_dev_port_del(), nsim_destroy() is called before nsim_dev_port_debugfs_exit(). nsim_destroy() ends with free_netdev(), while nsim_dev_port_debugfs_exit() removes the port's debugfs directory afterwards. This means the slab is freed before the ethtool debugfs files that point into it are removed.
The same window exists on nsim_create()'s error path: nsim_ethtool_init() creates debugfs files under ddir with pointers into ns before nsim_init_netdevsim()/nsim_init_netdevsim_vf(), which can fail. The err_free_netdev label then calls free_netdev() while those ethtool debugfs entries are still live.
All other features that create per-port debugfs files (pp_hold, queue_reset, vlan) already remove their own entries explicitly in nsim_destroy() before free_netdev(). ethtool is the only one that does not. Fix this by saving the ethtool dentry in struct nsim_ethtool and calling debugfs_remove_recursive() on it before free_netdev() in both nsim_destroy() and the nsim_create() error path. The port ddir teardown is left to nsim_dev_port_debugfs_exit() as before.
---
v3:
- Instead of removing the entire port ddir before free_netdev(), save and remove only the ethtool dentry. All other features (pp_hold, queue_reset, vlan) already clean up after themselves; ethtool is the only exception. This aligns ethtool with how the other features behave, as suggested by Jakub Kicinski.
v2:
- Also fix the same use-after-free window on the error path of nsim_create() as suggested by Simon Horman.
- Shorten the code comment in nsim_destroy() to be more concise.
--- drivers/net/netdevsim/ethtool.c | 1 + drivers/net/netdevsim/netdev.c | 9 +++++++++ drivers/net/netdevsim/netdevsim.h | 1 + 3 files changed, 11 insertions(+)
drivers/net/netdevsim/ethtool.c +1 -0
@@ -252,6 +252,7 @@ void nsim_ethtool_init(struct netdevsim *ns) ns->ethtool.channels = ns->nsim_bus_dev->num_queues; ethtool =debugfs_create_dir ("ethtool" , ns->nsim_dev_port->ddir); + ns->ethtool.ddir = ethtool;debugfs_create_u32 ("get_err" ,0600 , ethtool, &ns->ethtool.get_err);debugfs_create_u32 ("set_err" ,0600 , ethtool, &ns->ethtool.set_err);
drivers/net/netdevsim/netdev.c +9 -0
@@ -1165,6 +1165,7 @@ struct netdevsim *nsim_create(struct nsim_dev *nsim_dev,return ns; err_free_netdev: +debugfs_remove_recursive (ns->ethtool.ddir);free_netdev (dev);return ERR_PTR (err); }
@@ -1214,6 +1215,14 @@ void nsim_destroy(struct netdevsim *ns) ns->page =NULL ; } +/* +* Remove the ethtool debugfs directory before free_netdev() releases +* the netdevsim struct to prevent use-after-free in concurrent readers. +* Other per-port debugfs files are already removed above, and the port +* ddir itself is cleaned up by nsim_dev_port_debugfs_exit(). +*/ +debugfs_remove_recursive (ns->ethtool.ddir); +free_netdev (dev); }
drivers/net/netdevsim/netdevsim.h +1 -0
@@ -95,6 +95,7 @@ struct nsim_ethtool {struct ethtool_coalesce coalesce;struct ethtool_ringparam ring;struct ethtool_fecparam fec; +struct dentry *ddir; };struct nsim_rq {
Signature · 1 line
2.47.3
PATCH v3 2/2 arm64: dts: rockchip: Add Vicharak Vaaman2 board
In reply to Hrushiraj GandhiAdd device tree for the Vicharak Vaaman2, a single-board computer based on the Rockchip RK3588 SoC.
The board features:
- RK3588 SoC with 4x Cortex-A76 (big) + 4x Cortex-A55 (little)
- eMMC storage via SDHCI (HS400)
- microSD card via SDMMC
- RK806 PMIC on SPI2 providing all required power domains
- Two RK8602/RK8603 CPU regulators on I2C0 (big clusters)
- RK8602 NPU regulator on I2C1
- HYM8563 RTC on I2C0
- Status LED on GPIO2_C5 (active-low, heartbeat trigger)
- UART2 as serial console at 1500000 baud
- SARADC with 1.8V reference
--- arch/arm64/boot/dts/rockchip/Makefile | 1 + .../dts/rockchip/rk3588-vicharak-vaaman2.dts | 547 ++++++++++++++++++ 2 files changed, 548 insertions(+) create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-vicharak-vaaman2.dts
arch/arm64/boot/dts/rockchip/Makefile +1 -0
@@ -214,6 +214,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-tiger-haikou-video-demo.dtbo dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-toybrick-x0.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-turing-rk1.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-vicharak-axon.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-vicharak-vaaman2.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-coolpi-4b.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-evb1-v10.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-gameforce-ace.dtb
arch/arm64/boot/dts/rockchip/rk3588-vicharak-vaaman2.dts new file +547 -0
547 lines not on this page · raw message
Signature · 1 line
2.47.3
PATCH v3 2/3 dt-bindings: arm: rockchip: Add Vicharak Vaaman2
In reply to Hrushiraj GandhiAdd device tree binding documentation for the Vicharak Vaaman2, a single-board computer based on the Rockchip RK3588 SoC.
--- Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +5 -0
@@ -1311,6 +1311,11 @@ properties: - const: vicharak,axon - const: rockchip,rk3588 + - description: Vicharak Vaaman2 + items: + - const: vicharak,vaaman2 + - const: rockchip,rk3588 + - description: WolfVision PF5 mainboard items: - const: wolfvision,rk3568-pf5
Signature · 1 line
2.47.3
PATCH v3 3/3 arm64: dts: rockchip: Add Vicharak Vaaman2 board
In reply to Hrushiraj GandhiAdd device tree for the Vicharak Vaaman2, a single-board computer based on the Rockchip RK3588 SoC.
The board features:
- RK3588 SoC with 4x Cortex-A76 (big) + 4x Cortex-A55 (little)
- eMMC storage via SDHCI (HS400)
- microSD card via SDMMC
- RK806 PMIC on SPI2 providing all required power domains
- Two RK8602/RK8603 CPU regulators on I2C0 (big clusters)
- RK8602 NPU regulator on I2C1
- HYM8563 RTC on I2C0
- Status LED on GPIO2_C5 (active-low, heartbeat trigger)
- UART2 as serial console at 1500000 baud
- SARADC with 1.8V reference
--- arch/arm64/boot/dts/rockchip/Makefile | 1 + .../dts/rockchip/rk3588-vicharak-vaaman2.dts | 547 ++++++++++++++++++ 2 files changed, 548 insertions(+) create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-vicharak-vaaman2.dts
arch/arm64/boot/dts/rockchip/Makefile +1 -0
@@ -214,6 +214,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-tiger-haikou-video-demo.dtbo dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-toybrick-x0.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-turing-rk1.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-vicharak-axon.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-vicharak-vaaman2.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-coolpi-4b.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-evb1-v10.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-gameforce-ace.dtb
arch/arm64/boot/dts/rockchip/rk3588-vicharak-vaaman2.dts new file +547 -0
547 lines not on this page · raw message
Signature · 1 line
2.47.3