diff --git a/config/boards/odroidm1.conf b/config/boards/odroidm1.conf index 860d69114e7d..7382434fb953 100644 --- a/config/boards/odroidm1.conf +++ b/config/boards/odroidm1.conf @@ -12,8 +12,8 @@ IMAGE_PARTITION_TABLE="gpt" FULL_DESKTOP="yes" BOOT_LOGO="desktop" -BOOTBRANCH_BOARD="tag:v2024.07" -BOOTPATCHDIR="v2024.07" +BOOTBRANCH_BOARD="tag:v2025.01" +BOOTPATCHDIR="v2025.01" # but all changes are done in this board file, not patches BOOTCONFIG="odroid-m1-rk3568_defconfig" BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory @@ -21,10 +21,6 @@ BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory # The overlays for this board are prefixed by 'rockchip-rk3568-hk' (see for example patch/kernel/archive/rockchip64-6.6/overlay/rockchip-rk3568-hk-i2c0.dts) OVERLAY_PREFIX="rockchip-rk3568-hk" -# HK's SPI partition on MTD: -# mtd0: start 0 size 917.504 end 917.504 : SPL == start 0x0 size 0xe0000 : SPL -# mtd1: start 917.504 size 131.072 end 1.048.576 : U-Boot Env == start 0xe0000 size 0x20000 : U-Boot Env -# mtd2: start 1.048.576 size 2.097.152 end 3.145.728 : U-Boot == start 0x100000 size 0x200000 : U-Boot function post_family_config__uboot_config() { display_alert "$BOARD" "u-boot ${BOOTBRANCH_BOARD} overrides" "info" BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc @@ -67,14 +63,20 @@ function post_family_tweaks__config_odroidm1_fwenv() { # https://github.com/hardkernel/u-boot/blob/356906e6445378a45ac14ec184fc6e666b22338a/configs/odroid_rk3568_defconfig#L212-L213 # The kernel DT has a convenient partition table, so mtd1 is ready to use, just gotta set the size. # https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/rockchip/rk3568-odroid-m1.dts#L637-L662 + # HK's SPI partition on MTD: + # mtd0: start 0 size 917.504 end 917.504 : SPL == start 0x0 size 0xe0000 : SPL + # mtd1: start 917.504 size 131.072 end 1.048.576 : U-Boot Env == start 0xe0000 size 0x20000 : U-Boot Env + # mtd2: start 1.048.576 size 2.097.152 end 3.145.728 : U-Boot == start 0x100000 size 0x200000 : U-Boot cat <<- 'FW_ENV_CONFIG' > "${SDCARD}"/etc/fw_env.config # MTD on the SPI for the Odroid-M1; this requires the MTD partition table in the board kernel DTS # MTD device name Device offset Env. size Flash sector size Number of sectors /dev/mtd1 0x0000 0x20000 FW_ENV_CONFIG +} - # add a network rule to rename default name +# add a network rule to rename default name +function post_family_tweaks__odroidm1_rename_gmac_eth0() { display_alert "Creating network rename rule for Odroid M1" mkdir -p "${SDCARD}"/etc/udev/rules.d/ cat <<- EOF > "${SDCARD}"/etc/udev/rules.d/70-rename-lan.rules @@ -83,6 +85,22 @@ function post_family_tweaks__config_odroidm1_fwenv() { } +function pre_config_uboot_target__odroidm1_patch_uboot_dtsi_for_ums() { + display_alert "u-boot for ${BOARD}" "u-boot: add to u-boot dtsi for UMS" "info" # avoid a patch, just append to the dtsi file + cat <<- UBOOT_BOARD_DTSI_OTG >> arch/arm/dts/rk3568-odroid-m1-u-boot.dtsi + &usb_host0_xhci { dr_mode = "otg"; }; + UBOOT_BOARD_DTSI_OTG +} + +# "rockchip-common: boot SD card first, then NVMe, then SATA, then USB, then mmc" +# On odroidm1, mmc0 is the eMMC, mmc1 is the SD card slot +function pre_config_uboot_target__odroidm1_patch_rockchip_common_boot_order() { + declare -a rockchip_uboot_targets=("mmc1" "nvme" "scsi" "usb" "mmc0" "pxe" "dhcp" "spi") # for future make-this-generic delight + display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: adjust boot order to '${rockchip_uboot_targets[*]}'" "info" + sed -i -e "s/#define BOOT_TARGETS.*/#define BOOT_TARGETS \"${rockchip_uboot_targets[*]}\"/" include/configs/rockchip-common.h + regular_git diff -u include/configs/rockchip-common.h || true +} + # A better equivalent to patching a defconfig, do changes to .config via code. # For UMS/RockUSB to work in u-boot, &usb_host0_xhci { dr_mode = "otg" } is required. See 0002-board-rockchip-ODROID-M1-override-kernel-DT-for-xhci-otg-dr_mode.patch function post_config_uboot_target__extra_configs_for_odroid-m1() { diff --git a/patch/u-boot/v2024.07/board_odroidm1/0001-rockchip-common-boot-USB-devices-first-then-mmc-s-nvme-scsi.patch b/patch/u-boot/v2024.07/board_odroidm1/0001-rockchip-common-boot-USB-devices-first-then-mmc-s-nvme-scsi.patch deleted file mode 100644 index dcd2886b5cbb..000000000000 --- a/patch/u-boot/v2024.07/board_odroidm1/0001-rockchip-common-boot-USB-devices-first-then-mmc-s-nvme-scsi.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Ricardo Pardini -Date: Wed, 16 Aug 2023 13:54:31 +0200 -Subject: rockchip-common: boot USB devices first, then mmc's, nvme, scsi - ---- - include/configs/rockchip-common.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h -index 111111111111..222222222222 100644 ---- a/include/configs/rockchip-common.h -+++ b/include/configs/rockchip-common.h -@@ -13,7 +13,7 @@ - - #ifndef CONFIG_SPL_BUILD - --#define BOOT_TARGETS "mmc1 mmc0 nvme scsi usb pxe dhcp spi" -+#define BOOT_TARGETS "usb mmc1 mmc0 nvme scsi pxe dhcp spi" - - #ifdef CONFIG_ARM64 - #define ROOT_UUID "B921B045-1DF0-41C3-AF44-4C6F280D3FAE;\0" --- -Armbian - diff --git a/patch/u-boot/v2024.07/board_odroidm1/0002-board-rockchip-ODROID-M1-override-kernel-DT-for-xhci-otg-dr_mode.patch b/patch/u-boot/v2024.07/board_odroidm1/0002-board-rockchip-ODROID-M1-override-kernel-DT-for-xhci-otg-dr_mode.patch deleted file mode 100644 index 9384e83214e4..000000000000 --- a/patch/u-boot/v2024.07/board_odroidm1/0002-board-rockchip-ODROID-M1-override-kernel-DT-for-xhci-otg-dr_mode.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Ricardo Pardini -Date: Fri, 18 Aug 2023 00:22:23 +0200 -Subject: board: rockchip: ODROID-M1: override kernel DT for xhci otg dr_mode - ---- - arch/arm/dts/rk3568-odroid-m1-u-boot.dtsi | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/arch/arm/dts/rk3568-odroid-m1-u-boot.dtsi b/arch/arm/dts/rk3568-odroid-m1-u-boot.dtsi -index 111111111111..222222222222 100644 ---- a/arch/arm/dts/rk3568-odroid-m1-u-boot.dtsi -+++ b/arch/arm/dts/rk3568-odroid-m1-u-boot.dtsi -@@ -21,3 +21,7 @@ - bootph-some-ram; - }; - }; -+ -+&usb_host0_xhci { -+ dr_mode = "otg"; -+}; --- -Armbian -