Skip to content

Commit a5448ef

Browse files
mlegenovicigorpecovnik
authored andcommitted
Odroid M2: initial support
1 parent b8423db commit a5448ef

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

config/boards/odroidm2.csc

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Rockchip RK3588s SoC octa core 4-16GB SoC eMMC USB3 NvME
2+
BOARD_NAME="Odroid M2"
3+
BOARDFAMILY="rockchip64"
4+
BOARD_MAINTAINER="mlegenovic"
5+
BOOT_SOC="rk3588"
6+
KERNEL_TARGET="edge"
7+
BOOT_FDT_FILE="rockchip/rk3588s-odroid-m2.dtb"
8+
BOOT_SCENARIO="binman"
9+
IMAGE_PARTITION_TABLE="gpt"
10+
FULL_DESKTOP="no"
11+
BOOT_LOGO="yes"
12+
13+
BOOTBRANCH_BOARD="tag:v2025.04-rc2"
14+
BOOTBRANCH="${BOOTBRANCH_BOARD}"
15+
BOOTPATCHDIR="v2025.04-rc2"
16+
17+
BOOTCONFIG="odroid-m2-rk3588s_defconfig"
18+
BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory
19+
20+
OVERLAY_PREFIX='rockchip-rk3588'
21+
22+
function post_family_config__uboot_config() {
23+
display_alert "$BOARD" "u-boot ${BOOTBRANCH_BOARD} overrides" "info"
24+
BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc
25+
UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/$BL31_BLOB ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin"
26+
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
27+
28+
# Just use the binman-provided u-boot-rockchip.bin, which is ready-to-go
29+
function write_uboot_platform() {
30+
dd if=${1}/u-boot-rockchip.bin of=${2} bs=32k seek=1 conv=fsync
31+
}
32+
}
33+
34+
# "rockchip-common: boot SD card first, then NVMe, then SATA, then USB, then mmc"
35+
# On odroidm2, mmc0 is the eMMC, mmc1 is the SD card slot
36+
function pre_config_uboot_target__odroidm2_patch_rockchip_common_boot_order() {
37+
declare -a rockchip_uboot_targets=("mmc1" "nvme" "mmc0" "usb" "pxe" "dhcp") # for future make-this-generic delight
38+
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: adjust boot order to '${rockchip_uboot_targets[*]}'" "info"
39+
sed -i -e "s/#define BOOT_TARGETS.*/#define BOOT_TARGETS \"${rockchip_uboot_targets[*]}\"/" include/configs/rockchip-common.h
40+
regular_git diff -u include/configs/rockchip-common.h || true
41+
}
42+
43+
# add a network rule to rename default name
44+
function post_family_tweaks__odroidm2_rename_gmac_eth0() {
45+
display_alert "Creating network rename rule for Odroid M2"
46+
mkdir -p "${SDCARD}"/etc/udev/rules.d/
47+
cat <<- EOF > "${SDCARD}"/etc/udev/rules.d/70-rename-lan.rules
48+
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="end*", NAME="eth0"
49+
EOF
50+
51+
}

0 commit comments

Comments
 (0)