Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm64: dts: Add board FriendlyElec CM3588 #151

Merged
merged 2 commits into from
Mar 3, 2024

Conversation

ColorfulRhino
Copy link
Contributor

Hello!

This adds a dts file for the FriendlyElec CM3588 NAS as well as updates the nanopi-6-common dtsi, which is included in CM3588's dts, based on FriendlyElec's recent commits.

The following hardware features have been tested and are working with this dts:

  • all 4 NVMe port, including their respective activity LEDs (NVMe tested with hdparm)
  • EMMC
  • HDMI 4k@60 (tested with Gnome desktop)
  • LAN
  • 2xUSB3, 1xUSB2 (USB-C and OTG/DP mode untested)
  • hardware buttons (power, reset)
  • hardware acceleration for video encoding/decoding (tested with jellyfin-ffmpeg6)

References:
https://github.com/friendlyarm/kernel-rockchip/blob/1fddd62f9911d01edce8401fa5bc247d5e680914/arch/arm64/boot/dts/rockchip/rk3588-nanopi6-common.dtsi
https://github.com/friendlyarm/kernel-rockchip/blob/nanopi6-v6.1.y/arch/arm64/boot/dts/rockchip/rk3588-nanopi6-rev09.dts

Hardware specs:

  • SoC: Rockchip RK3588
    • CPU: Quad-core ARM Cortex-A76(up to 2.4GHz) and quad-core Cortex-A55 CPU (up to 1.8GHz)
    • GPU: Mali-G610 MP4, compatible with OpenGLES 1.1, 2.0, and 3.2, OpenCL up to 2.2 and Vulkan1.2
    • VPU: 8K@60fps H.265 and VP9 decoder, 8K@30fps H.264 decoder, 4K@60fps AV1 decoder, 8K@30fps H.264 and H.265 encoder
    • NPU: 6TOPs, supports INT4/INT8/INT16/FP16
  • RAM: 64-bit 4GB/8GB/16GB LPDDR4X at 2133MHz
  • Flash: 0GB/64GB eMMC, at HS400 mode
  • 1 x microSD interface, support up to SDR104 mode
  • 1 x On-board PCIe 2.5G ethernet controller (RTL8125B)
  • USB:
    • 2 x USB 3.1 Gen1 OTG which combo with DP display(up to 4Kp60)
    • 1 x USB 3.1 Gen1 Host
    • 2 x USB 2.0 Host
  • PCIe:
    • up to 4 x PCIe interfaces
      • 2 x PCIe 2.1 x1 and 2 x PCIe 3.0 x2
      • or 2 x PCIe 2.1 x1 and 1 x PCIe 3.0 x4
      • or 1 x PCIe 2.1 x1, 1 x PCIe 3.0 x2, and 2 x PCIe 3.0 x1
      • or 4 x PCIe 3.0 x1
  • HDMI output:
    • 2 x HDMI outputs which is compatible with HDMI2.1, HDMI2.0, and HDMI1.4 operation
    • one support displays up to 7680x4320@60Hz, another one support up to 4Kp60
    • Support RGB/YUV(up to 10bit) format
  • HDMI input: 1 x HDMI input, up to 4Kp60
  • MIPI RX:
    • 2 x 4lane MIPI DPHY CSI RX which support x4 mode or x2+x2 mode ,compatible with MIPI V1.2
    • 2 x 4lane MIPI_D/CPHY_RX
  • MIPI TX:
    • 2 x 4-lane MIPI D-PHY/C-PHY Combo PHY TX, compatible with MIPI DPHY 2.0 or CPHY 1.1
  • Codec:
    • On-board ALC5616 Codec
    • 1 x stereo headphone output ( 20mW/CH, THD+N <= -80dB, 16Ohm Load )
    • 1 x single-end microphone input
  • GPIO:
    • up to 3 x SPIs, 7 x UARTs, 6 x I2Cs, 15 x PWMs, 3 x I2Ss, 1 x SDIO, 81 x GPIOs
  • others:
    • low power RTC (HYM8563TS) with backup battery input
    • Support 38Khz IR input
    • MASK button for eMMC update, reset button, Power button, and recovery mode button
    • Debug UART,3.3V level, 1500000bps
    • 2 x GPIO Controlled LED (SYS, LED1)
  • Power supply: 5~20VDC input, 15W max
  • PCB: 8 Layers, 55x65x1.6mm
  • Stacking height: 6.6mm
  • Connector: 4 x DF40C-100DP-0.4V(51), the mating connector is DF40HC(3.0)-100DS-0.4V(51)
  • Ambient Operating Temperature: 0℃ to 70℃

https://github.com/friendlyarm/kernel-rockchip/
The following commits from the vendor dtsi file have been used:

ARM64: dts: rockchip: enable crypto node for nanopi5/6
Signed-off-by: jensen <[email protected]>

arm64: dts: rockchip: update ir-key-table for nanopi6
Signed-off-by: jensen <[email protected]>

ARM64: dts: rockchip: apply the EVB changes to nanopi5/6
Signed-off-by: jensen <[email protected]>

ARM64: dts: rockchip: enable watchdog for nanopi5/6
Signed-off-by: jensen <[email protected]>

Some documentation for the watchdog can be found here:
https://wiki.t-firefly.com/en/ROC-RK3588-PC/usage_watchdog.html

Watchdog and crypto has been successfully tested on CM3588.
Tested and working:

- all 4 NVMe port, including their respective activity LEDs (NVMe tested with hdparm)
- HDMI 4k@60 (tested with Gnome desktop), more will likely work too
- LAN
- 2xUSB3, 1xUSB2 (USB-C and OTG/DP mode untested)
- hardware buttons (power, reset)
- hardware acceleration for video encoding/decoding (tested with jellyfin-ffmpeg6)
@amazingfate amazingfate merged commit 8f20ea7 into armbian:rk-5.10-rkr6 Mar 3, 2024
2 checks passed
Joshua-Riek pushed a commit to Joshua-Riek/linux-rockchip that referenced this pull request Sep 1, 2024
When enabling UBSAN on Raspberry Pi 5, we get the following warning:

[  387.894977] UBSAN: array-index-out-of-bounds in drivers/gpu/drm/v3d/v3d_sched.c:320:3
[  387.903868] index 7 is out of range for type '__u32 [7]'
[  387.909692] CPU: 0 PID: 1207 Comm: kworker/u16:2 Tainted: G        WC         6.10.3-v8-16k-numa armbian#151
[  387.919166] Hardware name: Raspberry Pi 5 Model B Rev 1.0 (DT)
[  387.925961] Workqueue: v3d_csd drm_sched_run_job_work [gpu_sched]
[  387.932525] Call trace:
[  387.935296]  dump_backtrace+0x170/0x1b8
[  387.939403]  show_stack+0x20/0x38
[  387.942907]  dump_stack_lvl+0x90/0xd0
[  387.946785]  dump_stack+0x18/0x28
[  387.950301]  __ubsan_handle_out_of_bounds+0x98/0xd0
[  387.955383]  v3d_csd_job_run+0x3a8/0x438 [v3d]
[  387.960707]  drm_sched_run_job_work+0x520/0x6d0 [gpu_sched]
[  387.966862]  process_one_work+0x62c/0xb48
[  387.971296]  worker_thread+0x468/0x5b0
[  387.975317]  kthread+0x1c4/0x1e0
[  387.978818]  ret_from_fork+0x10/0x20
[  387.983014] ---[ end trace ]---

This happens because the UAPI provides only seven configuration
registers and we are reading the eighth position of this u32 array.

Therefore, fix the out-of-bounds read in `v3d_csd_job_run()` by
accessing only seven positions on the '__u32 [7]' array. The eighth
register exists indeed on V3D 7.1, but it isn't currently used. That
being so, let's guarantee that it remains unused and add a note that it
could be set in a future patch.

Fixes: 0ad5bc1 ("drm/v3d: fix up register addresses for V3D 7.x")
Reported-by: Tvrtko Ursulin <[email protected]>
Signed-off-by: Maíra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants