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

CM3588-NAS: Go fully mainline by adopting the latest mainline changes from kernel 6.11 and U-Boot v2024.10 #7082

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Rockchip RK3588 octa core 16GB RAM SoC eMMC 4x NVMe 2x USB3 USB2 USB-C 2.5GbE
BOARD_NAME="FriendlyElec CM3588 NAS"
BOARDFAMILY="rockchip-rk3588"
BOARD_MAINTAINER=""
BOOTCONFIG="nanopc_cm3588_defconfig" # Enables booting from NVMe. Vendor name, not standard, see hook below, set BOOT_SOC below to compensate
BOARD_MAINTAINER="ColorfulRhino"
BOOTCONFIG="cm3588-nas-rk3588_defconfig" # Mainline defconfig, enables booting from NVMe
BOOT_SOC="rk3588"
KERNEL_TARGET="vendor,current,edge"
FULL_DESKTOP="yes"
BOOT_LOGO="desktop"
IMAGE_PARTITION_TABLE="gpt"
BOOT_FDT_FILE="rockchip/rk3588-nanopc-cm3588-nas.dtb"
BOOT_FDT_FILE="rockchip/rk3588-friendlyelec-cm3588-nas.dtb"
BOOT_SCENARIO="spl-blobs"

function post_family_tweaks__nanopccm3588nas_udev_naming_audios() {
function post_family_tweaks__cm3588_nas_udev_naming_audios() {
display_alert "$BOARD" "Renaming CM3588 audio interfaces to human-readable form" "info"

mkdir -p $SDCARD/etc/udev/rules.d/
Expand All @@ -27,7 +27,7 @@ function post_family_tweaks__nanopccm3588nas_udev_naming_audios() {

# Output from CM3588 syslog with edge kernel 6.8: r8169 0004:41:00.0 enP4p65s0: renamed from eth0
# Note: legacy kernel 5.10 uses driver r8125, edge kernel uses r8169 as of 6.8
function post_family_tweaks__nanopccm3588nas_udev_naming_network_interfaces() {
function post_family_tweaks__cm3588_nas_udev_naming_network_interfaces() {
display_alert "$BOARD" "Renaming CM3588 LAN interface to eth0" "info"

mkdir -p $SDCARD/etc/udev/rules.d/
Expand All @@ -36,25 +36,23 @@ function post_family_tweaks__nanopccm3588nas_udev_naming_network_interfaces() {
EOF
}

# Mainline u-boot or Kwiboo's tree
function post_family_config_branch_edge__nanopccm3588nas_use_mainline_uboot() {
display_alert "$BOARD" "mainline (next branch) u-boot overrides for $BOARD / $BRANCH" "info"
# Mainline U-Boot
function post_family_config__cm3588_nas_use_mainline_uboot() {
display_alert "$BOARD" "Using mainline U-Boot for $BOARD / $BRANCH" "info"

declare -g BOOTCONFIG="nanopc-t6-rk3588_defconfig" # override the default for the board/family
declare -g BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc
declare -g BOOTSOURCE="https://github.com/Kwiboo/u-boot-rockchip.git" # We ❤️ Kwiboo's tree
declare -g BOOTBRANCH="branch:rk3xxx-2024.04" # commit:31522fe7b3c7733313e1c5eb4e340487f6000196 as of 2024-04-01
declare -g BOOTPATCHDIR="v2024.04/board_${BOARD}" # empty; defconfig changes are done in hook below
declare -g BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory
declare -g UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin u-boot-rockchip-spi.bin"
unset uboot_custom_postprocess write_uboot_platform write_uboot_platform_mtd # disable stuff from rockchip64_common; we're using binman here which does all the work already
declare -g BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc
declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git" # We ❤️ Mainline U-Boot
declare -g BOOTBRANCH="tag:v2024.10-rc3"
declare -g BOOTPATCHDIR="v2024.10"
# Don't set BOOTDIR, allow shared U-Boot source directory for disk space efficiency

declare -g UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin"

# Disable stuff from rockchip64_common; we're using binman here which does all the work already
unset uboot_custom_postprocess write_uboot_platform write_uboot_platform_mtd

# Just use the binman-provided u-boot-rockchip.bin, which is ready-to-go
function write_uboot_platform() {
dd "if=$1/u-boot-rockchip.bin" "of=$2" bs=32k seek=1 conv=notrunc status=none
}

function write_uboot_platform_mtd() {
flashcp -v -p "$1/u-boot-rockchip-spi.bin" /dev/mtd0
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: ColorfulRhino <131405023+ColorfulRhino@users.noreply.github.com>
Date: Sun, 11 Aug 2024 15:28:03 +0200
Subject: CM3588-NAS: Add HDMI support

---
arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588-nas.dts | 47 ++++++++++
1 file changed, 47 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588-nas.dts b/arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588-nas.dts
index 111111111111..222222222222 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588-nas.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588-nas.dts
@@ -12,6 +12,7 @@
#include <dt-bindings/input/input.h>
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/usb/pd.h>
+#include <dt-bindings/soc/rockchip,vop2.h>
#include "rk3588-friendlyelec-cm3588.dtsi"

/ {
@@ -225,6 +226,12 @@ &combphy2_psu {
status = "okay";
};

+/* Properties "clock" and "clock-names" introduced by Collabora https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux/-/commit/8fff68cb7cfe1e698445896252e34f79fad41720 */
+&display_subsystem {
+ clocks = <&hdptxphy_hdmi0>;
+ clock-names = "hdmi0_phy_pll";
+};
+
/* GPIO names are in the format "Human-readable-name [SIGNAL_LABEL]" */
/* Signal labels match the official CM3588 NAS SDK schematic revision 2309 */
&gpio0 {
@@ -307,6 +314,31 @@ &gpio4 {
"", "", "", "";
};

+&hdmi0 {
+ // avdd-0v9-supply =
+ // avdd-1v8-supply =
+ /* Dmesg error/warning:
+ * [ +0.000055] dwhdmi-rockchip fde80000.hdmi: Looking up avdd-0v9-supply from device tree
+ * [ +0.000011] dwhdmi-rockchip fde80000.hdmi: Looking up avdd-0v9-supply property in node /hdmi@fde80000 failed
+ * [ +0.000014] dwhdmi-rockchip fde80000.hdmi: supply avdd-0v9 not found, using dummy regulator
+ * [ +0.000080] dwhdmi-rockchip fde80000.hdmi: Looking up avdd-1v8-supply from device tree
+ * [ +0.000010] dwhdmi-rockchip fde80000.hdmi: Looking up avdd-1v8-supply property in node /hdmi@fde80000 failed
+ * [ +0.000010] dwhdmi-rockchip fde80000.hdmi: supply avdd-1v8 not found, using dummy regulator
+ * [ +0.001009] dwhdmi-rockchip fde80000.hdmi: registered ddc I2C bus driver
+ */
+ status = "okay";
+};
+
+&hdmi0_in {
+ hdmi0_in_vp0: endpoint {
+ remote-endpoint = <&vp0_out_hdmi0>;
+ };
+};
+
+&hdptxphy_hdmi0 {
+ status = "okay";
+};
+
/* Connected to MIPI-DSI0 */
&i2c5 {
pinctrl-names = "default";
@@ -776,3 +808,18 @@ usbdp_phy0_dp_altmode_mux: endpoint@1 {
&usbdp_phy1 {
status = "okay";
};
+
+&vop {
+ status = "okay";
+};
+
+&vop_mmu {
+ status = "okay";
+};
+
+&vp0 {
+ vp0_out_hdmi0: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
+ reg = <ROCKCHIP_VOP2_EP_HDMI0>;
+ remote-endpoint = <&hdmi0_in_vp0>;
+ };
+};
--
Armbian

Loading