From cf4365e76752057fac8d66efa0a2c7a0f00fb86f Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 13 Sep 2025 19:49:35 +0800 Subject: [PATCH] rockchip: use per-SoC defined kernel loadaddr The FIT loadaddr on RK3308/RK3566/RK3568/RK358x is 0x02000000 instead of 0x02080000, while on RK3576 it's 0x42000000, which is quite different from the former SoCs and incompatible with current kernel loadaddr value. Signed-off-by: Tianling Shen Link: https://github.com/openwrt/openwrt/pull/20041 Signed-off-by: Hauke Mehrtens --- target/linux/rockchip/image/armv8.mk | 121 +++++++++++++++++---------- 1 file changed, 79 insertions(+), 42 deletions(-) diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk index 3135d4c5b7..56cf702bbb 100644 --- a/target/linux/rockchip/image/armv8.mk +++ b/target/linux/rockchip/image/armv8.mk @@ -2,164 +2,201 @@ # # Copyright (C) 2020 Sarah Maedel -# FIT will be loaded at 0x02080000. Leave 16M for that, align it to 2M and load the kernel after it. -KERNEL_LOADADDR := 0x03200000 +define Device/rk3308 + SOC := rk3308 + KERNEL_LOADADDR := 0x03000000 +endef + +define Device/rk3328 + SOC := rk3328 + KERNEL_LOADADDR := 0x03200000 +endef + +define Device/rk3399 + SOC := rk3399 + KERNEL_LOADADDR := 0x03200000 +endef + +define Device/rk3566 + SOC := rk3566 + KERNEL_LOADADDR := 0x03000000 +endef + +define Device/rk3568 + SOC := rk3568 + KERNEL_LOADADDR := 0x03000000 +endef + +define Device/rk3582 + SOC := rk3582 + KERNEL_LOADADDR := 0x03000000 +endef + +define Device/rk3588 + SOC := rk3588 + KERNEL_LOADADDR := 0x03000000 +endef + +define Device/rk3588s + SOC := rk3588s + KERNEL_LOADADDR := 0x03000000 +endef define Device/armsom_sige7 + $(Device/rk3588) DEVICE_VENDOR := ArmSoM DEVICE_MODEL := Sige7 DEVICE_ALT0_VENDOR := Bananapi DEVICE_ALT0_MODEL := BPi-M7 - SOC := rk3588 DEVICE_DTS := rk3588-armsom-sige7 DEVICE_PACKAGES := kmod-r8169 endef TARGET_DEVICES += armsom_sige7 define Device/firefly_roc-rk3328-cc + $(Device/rk3328) DEVICE_VENDOR := Firefly DEVICE_MODEL := ROC-RK3328-CC - SOC := rk3328 DEVICE_DTS := rk3328-roc-cc UBOOT_DEVICE_NAME := roc-cc-rk3328 endef TARGET_DEVICES += firefly_roc-rk3328-cc define Device/friendlyarm_nanopc-t4 + $(Device/rk3399) DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPC T4 - SOC := rk3399 DEVICE_PACKAGES := kmod-brcmfmac brcmfmac-nvram-4356-sdio cypress-firmware-4356-sdio endef TARGET_DEVICES += friendlyarm_nanopc-t4 define Device/friendlyarm_nanopc-t6 + $(Device/rk3588) DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPC T6 - SOC := rk3588 DEVICE_PACKAGES := kmod-r8169 endef TARGET_DEVICES += friendlyarm_nanopc-t6 define Device/friendlyarm_nanopi-r2c + $(Device/rk3328) DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R2C - SOC := rk3328 DEVICE_PACKAGES := kmod-usb-net-rtl8152 endef TARGET_DEVICES += friendlyarm_nanopi-r2c define Device/friendlyarm_nanopi-r2c-plus + $(Device/rk3328) DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R2C Plus - SOC := rk3328 DEVICE_PACKAGES := kmod-usb-net-rtl8152 endef TARGET_DEVICES += friendlyarm_nanopi-r2c-plus define Device/friendlyarm_nanopi-r2s + $(Device/rk3328) DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R2S - SOC := rk3328 DEVICE_PACKAGES := kmod-usb-net-rtl8152 endef TARGET_DEVICES += friendlyarm_nanopi-r2s define Device/friendlyarm_nanopi-r3s + $(Device/rk3566) DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R3S - SOC := rk3566 DEVICE_PACKAGES := kmod-r8169 endef TARGET_DEVICES += friendlyarm_nanopi-r3s define Device/friendlyarm_nanopi-r4s + $(Device/rk3399) DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R4S DEVICE_VARIANT := 4GB LPDDR4 - SOC := rk3399 DEVICE_PACKAGES := kmod-r8169 endef TARGET_DEVICES += friendlyarm_nanopi-r4s define Device/friendlyarm_nanopi-r4s-enterprise + $(Device/rk3399) DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R4S Enterprise Edition DEVICE_VARIANT := 4GB LPDDR4 - SOC := rk3399 UBOOT_DEVICE_NAME := nanopi-r4s-rk3399 DEVICE_PACKAGES := kmod-r8169 endef TARGET_DEVICES += friendlyarm_nanopi-r4s-enterprise define Device/friendlyarm_nanopi-r5c + $(Device/rk3568) DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R5C - SOC := rk3568 DEVICE_PACKAGES := kmod-r8169 kmod-rtw88-8822ce rtl8822ce-firmware wpad-basic-mbedtls endef TARGET_DEVICES += friendlyarm_nanopi-r5c define Device/friendlyarm_nanopi-r5s + $(Device/rk3568) DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R5S - SOC := rk3568 DEVICE_PACKAGES := kmod-r8169 endef TARGET_DEVICES += friendlyarm_nanopi-r5s define Device/friendlyarm_nanopi-r6c + $(Device/rk3588s) DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R6C - SOC := rk3588s DEVICE_PACKAGES := kmod-r8169 endef TARGET_DEVICES += friendlyarm_nanopi-r6c define Device/friendlyarm_nanopi-r6s + $(Device/rk3588s) DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R6S - SOC := rk3588s DEVICE_PACKAGES := kmod-r8169 endef TARGET_DEVICES += friendlyarm_nanopi-r6s define Device/lunzn_fastrhino-r66s + $(Device/rk3568) DEVICE_VENDOR := Lunzn DEVICE_MODEL := FastRhino R66S - SOC := rk3568 DEVICE_PACKAGES := kmod-r8169 endef TARGET_DEVICES += lunzn_fastrhino-r66s define Device/pine64_rock64 + $(Device/rk3328) DEVICE_VENDOR := Pine64 DEVICE_MODEL := Rock64 - SOC := rk3328 endef TARGET_DEVICES += pine64_rock64 define Device/pine64_rockpro64 + $(Device/rk3399) DEVICE_VENDOR := Pine64 DEVICE_MODEL := RockPro64 - SOC := rk3399 SUPPORTED_DEVICES += pine64,rockpro64-v2.1 endef TARGET_DEVICES += pine64_rockpro64 define Device/radxa_cm3-io + $(Device/rk3566) DEVICE_VENDOR := Radxa DEVICE_MODEL := CM3 IO - SOC := rk3566 DEVICE_DTS := rk3566-radxa-cm3-io UBOOT_DEVICE_NAME := radxa-cm3-io-rk3566 endef TARGET_DEVICES += radxa_cm3-io define Device/radxa_e25 + $(Device/rk3568) DEVICE_VENDOR := Radxa DEVICE_MODEL := E25 - SOC := rk3568 DEVICE_DTS := rk3568-radxa-e25 BOOT_SCRIPT := radxa-e25 UBOOT_DEVICE_NAME := radxa-e25-rk3568 @@ -168,9 +205,9 @@ endef TARGET_DEVICES += radxa_e25 define Device/radxa_e52c + $(Device/rk3582) DEVICE_VENDOR := Radxa DEVICE_MODEL := E52C - SOC := rk3582 UBOOT_DEVICE_NAME := generic-rk3588 DEVICE_DTS := rk3582-radxa-e52c DEVICE_PACKAGES := blkdiscard kmod-r8169 @@ -178,74 +215,74 @@ endef TARGET_DEVICES += radxa_e52c define Device/radxa_rock-3a + $(Device/rk3568) DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK 3A - SOC := rk3568 SUPPORTED_DEVICES := radxa,rock3a DEVICE_PACKAGES := kmod-usb-net-cdc-ncm kmod-usb-net-rndis endef TARGET_DEVICES += radxa_rock-3a define Device/radxa_rock-3b + $(Device/rk3568) DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK 3B - SOC := rk3568 DEVICE_PACKAGES := kmod-usb-net-cdc-ncm kmod-usb-net-rndis endef TARGET_DEVICES += radxa_rock-3b define Device/radxa_rock-3c + $(Device/rk3566) DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK 3C - SOC := rk3566 DEVICE_PACKAGES := kmod-usb-net-cdc-ncm kmod-usb-net-rndis endef TARGET_DEVICES += radxa_rock-3c define Device/radxa_rock-4c-plus + $(Device/rk3399) DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK 4C+ - SOC := rk3399 endef TARGET_DEVICES += radxa_rock-4c-plus define Device/radxa_rock-4se + $(Device/rk3399) DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK 4SE - SOC := rk3399 endef TARGET_DEVICES += radxa_rock-4se define Device/radxa_rock-5-itx + $(Device/rk3588) DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK 5 ITX/ITX+ - SOC := rk3588 DEVICE_PACKAGES := blkdiscard block-mount kmod-ata-ahci kmod-hwmon-pwmfan kmod-nvme kmod-r8169 kmod-rtw89-8852be wpad-basic-mbedtls endef TARGET_DEVICES += radxa_rock-5-itx define Device/radxa_rock-5a + $(Device/rk3588s) DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK 5A - SOC := rk3588s UBOOT_DEVICE_NAME := rock5a-rk3588s DEVICE_PACKAGES := blkdiscard block-mount kmod-ata-ahci kmod-hwmon-pwmfan kmod-nvme kmod-r8169 kmod-rtw89-8852be wpad-basic-mbedtls endef TARGET_DEVICES += radxa_rock-5a define Device/radxa_rock-5b + $(Device/rk3588) DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK 5B - SOC := rk3588 UBOOT_DEVICE_NAME := rock5b-rk3588 DEVICE_PACKAGES := blkdiscard block-mount kmod-hwmon-pwmfan kmod-nvme kmod-r8169 kmod-rtw89-8852be wpad-basic-mbedtls endef TARGET_DEVICES += radxa_rock-5b define Device/radxa_rock-5b-plus + $(Device/rk3588) DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK 5B+ - SOC := rk3588 UBOOT_DEVICE_NAME := generic-rk3588 DEVICE_DTS := rk3588-rock-5b-plus DEVICE_PACKAGES := blkdiscard block-mount kmod-hwmon-pwmfan kmod-nvme kmod-r8169 kmod-rtw89-8852be wpad-basic-mbedtls @@ -253,17 +290,17 @@ endef TARGET_DEVICES += radxa_rock-5b-plus define Device/radxa_rock-5c + $(Device/rk3588s) DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK 5C/5C Lite - SOC := rk3588s DEVICE_PACKAGES := blkdiscard block-mount kmod-ata-ahci kmod-hwmon-pwmfan kmod-nvme kmod-r8169 endef TARGET_DEVICES += radxa_rock-5c define Device/radxa_rock-5t + $(Device/rk3588) DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK 5T - SOC := rk3588 UBOOT_DEVICE_NAME := generic-rk3588 DEVICE_DTS := rk3588-rock-5t DEVICE_PACKAGES := blkdiscard block-mount iwlwifi-firmware-ax210 kmod-hwmon-pwmfan kmod-iwlwifi kmod-nvme kmod-r8169 wpad-basic-mbedtls @@ -271,34 +308,34 @@ endef TARGET_DEVICES += radxa_rock-5t define Device/radxa_rock-pi-4a + $(Device/rk3399) DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK Pi 4A - SOC := rk3399 SUPPORTED_DEVICES := radxa,rockpi4a radxa,rockpi4 UBOOT_DEVICE_NAME := rock-pi-4-rk3399 endef TARGET_DEVICES += radxa_rock-pi-4a define Device/radxa_rock-pi-e + $(Device/rk3328) DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK Pi E - SOC := rk3328 endef TARGET_DEVICES += radxa_rock-pi-e define Device/radxa_rock-pi-e-v3 + $(Device/rk3328) DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK Pi E v3.0 - SOC := rk3328 DEVICE_DTS := rk3328-rock-pi-e DEVICE_PACKAGES := kmod-rtw88-8723du kmod-rtw88-8821cu kmod-usb-net-cdc-ncm kmod-usb-net-rndis wpad-basic-mbedtls endef TARGET_DEVICES += radxa_rock-pi-e-v3 define Device/radxa_rock-pi-s + $(Device/rk3308) DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK Pi S - SOC := rk3308 SUPPORTED_DEVICES := radxa,rockpis BOOT_SCRIPT := rock-pi-s DEVICE_PACKAGES := kmod-rtw88-8723ds kmod-usb-net-cdc-ncm kmod-usb-net-rndis wpad-basic-mbedtls @@ -306,9 +343,9 @@ endef TARGET_DEVICES += radxa_rock-pi-s define Device/radxa_zero-3e + $(Device/rk3566) DEVICE_VENDOR := Radxa DEVICE_MODEL := ZERO 3E - SOC := rk3566 DEVICE_DTS := rk3566-radxa-zero-3e UBOOT_DEVICE_NAME := radxa-zero-3-rk3566 DEVICE_PACKAGES := kmod-usb-net-cdc-ncm kmod-usb-net-rndis @@ -316,9 +353,9 @@ endef TARGET_DEVICES += radxa_zero-3e define Device/radxa_zero-3w + $(Device/rk3566) DEVICE_VENDOR := Radxa DEVICE_MODEL := ZERO 3W - SOC := rk3566 DEVICE_DTS := rk3566-radxa-zero-3w UBOOT_DEVICE_NAME := radxa-zero-3-rk3566 DEVICE_PACKAGES := kmod-usb-net-cdc-ncm kmod-usb-net-rndis @@ -326,26 +363,26 @@ endef TARGET_DEVICES += radxa_zero-3w define Device/sinovoip_bpi-r2-pro + $(Device/rk3568) DEVICE_VENDOR := Sinovoip DEVICE_MODEL := Bananapi-R2 Pro - SOC := rk3568 SUPPORTED_DEVICES := sinovoip,rk3568-bpi-r2pro DEVICE_PACKAGES := kmod-ata-ahci-dwc endef TARGET_DEVICES += sinovoip_bpi-r2-pro define Device/xunlong_orangepi-r1-plus + $(Device/rk3328) DEVICE_VENDOR := Xunlong DEVICE_MODEL := Orange Pi R1 Plus - SOC := rk3328 DEVICE_PACKAGES := kmod-usb-net-rtl8152 endef TARGET_DEVICES += xunlong_orangepi-r1-plus define Device/xunlong_orangepi-r1-plus-lts + $(Device/rk3328) DEVICE_VENDOR := Xunlong DEVICE_MODEL := Orange Pi R1 Plus LTS - SOC := rk3328 DEVICE_PACKAGES := kmod-usb-net-rtl8152 endef TARGET_DEVICES += xunlong_orangepi-r1-plus-lts -- 2.30.2