sunxi: change target to use FIT kernel images

Modernize the target slightly to use kernel+dtb FIT images in all
subtargets. LZMA compression will be used for the cortexa53 devices,
and we'll stay conservative and use gzip for the cortexa7/a8 devices
due to performance differences.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
This commit is contained in:
Zoltan HERPAI 2025-08-03 15:57:15 +02:00
parent 08923d0c90
commit 2586aaef47
11 changed files with 115 additions and 19 deletions

View File

@ -91,6 +91,12 @@ define U-Boot/Bananapro
BUILD_DEVICES:=lemaker_bananapro
endef
define U-Boot/beelink_x2
BUILD_SUBTARGET:=cortexa7
NAME:=Beelink X2 (H3)
BUILD_DEVICES:=roofull_beelink-x2
endef
define U-Boot/Cubieboard
BUILD_SUBTARGET:=cortexa8
NAME:=Cubieboard
@ -112,6 +118,7 @@ endef
define U-Boot/Hummingbird_A31
BUILD_SUBTARGET:=cortexa7
NAME:=Hummingbird A31 board
BUILD_DEVICES:=merrii_hummingbird
endef
define U-Boot/Marsboard_A10
@ -138,6 +145,12 @@ define U-Boot/Linksprite_pcDuino
BUILD_DEVICES:=linksprite_a10-pcduino
endef
define U-Boot/LicheePi_Zero
BUILD_SUBTARGET:=cortexa7
NAME:=Lichee Pi Zero V3s
BUILD_DEVICES:=licheepi_licheepi-zero-dock
endef
define U-Boot/Linksprite_pcDuino3
BUILD_SUBTARGET:=cortexa7
NAME:=Linksprite pcDuino3
@ -337,6 +350,15 @@ define U-Boot/orangepi_zero2
ATF:=h616
endef
define U-Boot/orangepi_zero2w
BUILD_SUBTARGET:=cortexa53
NAME:=Xunlong Orange Pi Zero2W
BUILD_DEVICES:=xunlong_orangepi-zero2w
DEPENDS:=+PACKAGE_u-boot-orangepi_zero2w:trusted-firmware-a-sunxi-h616
UENV:=h616
ATF:=h616
endef
define U-Boot/orangepi_zero3
BUILD_SUBTARGET:=cortexa53
NAME:=Xunlong Orange Pi Zero3
@ -380,6 +402,7 @@ UBOOT_TARGETS := \
bananapi_p2_zero \
Bananapi_M2_Ultra \
Bananapro \
beelink_x2 \
Cubieboard \
Cubieboard2 \
Cubietruck \
@ -387,6 +410,7 @@ UBOOT_TARGETS := \
Marsboard_A10 \
Mele_M9 \
OLIMEX_A13_SOM \
LicheePi_Zero \
Linksprite_pcDuino \
Linksprite_pcDuino3 \
Linksprite_pcDuino3_Nano \
@ -409,6 +433,7 @@ UBOOT_TARGETS := \
orangepi_2 \
orangepi_pc2 \
orangepi_zero2 \
orangepi_zero2w \
orangepi_zero3 \
pangolin \
pine64_plus \

View File

@ -1,7 +1,6 @@
setenv mmc_rootpart 2
part uuid mmc ${mmc_bootdev}:${mmc_rootpart} uuid
setenv loadkernel fatload mmc \$mmc_bootdev \$kernel_addr_r uImage
setenv loaddtb fatload mmc \$mmc_bootdev \$fdt_addr_r dtb
setenv loadkernel fatload mmc \$mmc_bootdev \$kernel_comp_addr_r uImage
setenv bootargs console=ttyS0,115200 earlyprintk root=PARTUUID=${uuid} rootwait earlycon=uart,mmio32,0x01c28000
setenv uenvcmd run loadkernel \&\& run loaddtb \&\& booti \$kernel_addr_r - \$fdt_addr_r
setenv uenvcmd run loadkernel \&\& bootm \$kernel_comp_addr_r
run uenvcmd

View File

@ -1,8 +1,6 @@
setenv fdt_high ffffffff
setenv mmc_rootpart 2
part uuid mmc ${mmc_bootdev}:${mmc_rootpart} uuid
setenv loadkernel fatload mmc \$mmc_bootdev \$kernel_addr_r uImage
setenv loaddtb fatload mmc \$mmc_bootdev \$fdt_addr_r dtb
setenv bootargs console=ttyS0,115200 earlyprintk root=PARTUUID=${uuid} rootwait
setenv uenvcmd run loadkernel \&\& run loaddtb \&\& bootm \$kernel_addr_r - \$fdt_addr_r
setenv uenvcmd run loadkernel \&\& bootm \$kernel_addr_r
run uenvcmd

View File

@ -1,7 +1,6 @@
setenv mmc_rootpart 2
part uuid mmc ${mmc_bootdev}:${mmc_rootpart} uuid
setenv loadkernel fatload mmc \$mmc_bootdev \$kernel_addr_r uImage
setenv loaddtb fatload mmc \$mmc_bootdev \$fdt_addr_r dtb
setenv loadkernel fatload mmc \$mmc_bootdev \$kernel_comp_addr_r uImage
setenv bootargs console=ttyS0,115200 earlyprintk root=PARTUUID=${uuid} rootwait
setenv uenvcmd run loadkernel \&\& run loaddtb \&\& booti \$kernel_addr_r - \$fdt_addr_r
setenv uenvcmd run loadkernel \&\& bootm \$kernel_comp_addr_r
run uenvcmd

View File

@ -1,7 +1,6 @@
setenv mmc_rootpart 2
part uuid mmc ${mmc_bootdev}:${mmc_rootpart} uuid
setenv loadkernel fatload mmc \$mmc_bootdev \$kernel_addr_r uImage
setenv loaddtb fatload mmc \$mmc_bootdev \$fdt_addr_r dtb
setenv loadkernel fatload mmc \$mmc_bootdev \$kernel_comp_addr_r uImage
setenv bootargs console=ttyS0,115200 earlyprintk root=PARTUUID=${uuid} rootwait
setenv uenvcmd run loadkernel \&\& run loaddtb \&\& booti \$kernel_addr_r - \$fdt_addr_r
setenv uenvcmd run loadkernel \&\& bootm \$kernel_comp_addr_r
run uenvcmd

View File

@ -1,6 +1,4 @@
setenv fdt_high ffffffff
setenv loadkernel fatload mmc 0 \$kernel_addr_r uImage
setenv loaddtb fatload mmc 0 \$fdt_addr_r dtb
setenv bootargs console=ttyS2,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
setenv uenvcmd run loadkernel \&\& run loaddtb \&\& bootm \$kernel_addr_r - \$fdt_addr_r
setenv uenvcmd run loadkernel \&\& run loaddtb \&\& bootm \$kernel_addr_r
run uenvcmd

View File

@ -16,6 +16,7 @@ CONFIG_NET_DSA=y
CONFIG_NET_DSA_TAG_BRCM=y
CONFIG_NET_DSA_TAG_BRCM_COMMON=y
CONFIG_NET_DSA_TAG_BRCM_LEGACY=y
CONFIG_NET_DSA_TAG_BRCM_LEGACY_FCS=y
CONFIG_NET_DSA_TAG_BRCM_PREPEND=y
CONFIG_NET_SWITCHDEV=y
CONFIG_NOP_USB_XCEIV=y

View File

@ -16,7 +16,6 @@ define Build/sunxi-sdcard
mkfs.fat $@.boot -C $(FAT32_BLOCKS)
mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-boot.scr ::boot.scr
mcopy -i $@.boot $(DTS_DIR)/$(SUNXI_DTS).dtb ::dtb
mcopy -i $@.boot $(IMAGE_KERNEL) ::uImage
./gen_sunxi_sdcard_img.sh $@ \
$@.boot \
@ -34,10 +33,18 @@ define Device/Default
KERNEL := kernel-bin | uImage none
IMAGES := sdcard.img.gz
IMAGE/sdcard.img.gz := sunxi-sdcard | append-metadata | gzip
SUNXI_DTS_DIR :=allwinner/
SUNXI_DTS_DIR := allwinner/
SUNXI_DTS = $$(SUNXI_DTS_DIR)$$(SOC)-$(lastword $(subst _, ,$(1)))
endef
define Device/FitImageLzma
KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(SUNXI_DTS).dtb
endef
define Device/FitImageGzip
KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(SUNXI_DTS).dtb
endef
include $(SUBTARGET).mk
$(eval $(call BuildImage))

View File

@ -3,12 +3,12 @@
# Copyright (C) 2013-2016 OpenWrt.org
# Copyright (C) 2016 Yousong Zhou
KERNEL_LOADADDR:=0x40008000
KERNEL_LOADADDR:=0x40080000
define Device/sun50i
$(call Device/FitImageLzma)
SUNXI_DTS_DIR := allwinner/
KERNEL_NAME := Image
KERNEL := kernel-bin
endef
define Device/sun50i-a64
@ -127,6 +127,13 @@ define Device/xunlong_orangepi-zero2
endef
TARGET_DEVICES += xunlong_orangepi-zero2
define Device/xunlong_orangepi-zero2w
DEVICE_VENDOR := Xunlong
DEVICE_MODEL := Orange Pi Zero 2W
$(Device/sun50i-h618)
endef
TARGET_DEVICES += xunlong_orangepi-zero2w
define Device/xunlong_orangepi-zero3
DEVICE_VENDOR := Xunlong
DEVICE_MODEL := Orange Pi Zero 3

View File

@ -6,6 +6,7 @@
KERNEL_LOADADDR:=0x40008000
define Device/cubietech_cubieboard2
$(call Device/FitImageGzip)
DEVICE_VENDOR := Cubietech
DEVICE_MODEL := Cubieboard2
DEVICE_PACKAGES:=kmod-ata-sunxi kmod-sun4i-emac kmod-rtc-sunxi
@ -14,6 +15,7 @@ endef
TARGET_DEVICES += cubietech_cubieboard2
define Device/cubietech_cubietruck
$(call Device/FitImageGzip)
DEVICE_VENDOR := Cubietech
DEVICE_MODEL := Cubietruck
DEVICE_PACKAGES:=kmod-ata-sunxi kmod-rtc-sunxi kmod-brcmfmac
@ -22,6 +24,7 @@ endef
TARGET_DEVICES += cubietech_cubietruck
define Device/friendlyarm_nanopi-m1-plus
$(call Device/FitImageGzip)
DEVICE_VENDOR := FriendlyARM
DEVICE_MODEL := NanoPi M1 Plus
DEVICE_PACKAGES:=kmod-leds-gpio kmod-brcmfmac \
@ -31,6 +34,7 @@ endef
TARGET_DEVICES += friendlyarm_nanopi-m1-plus
define Device/friendlyarm_nanopi-neo
$(call Device/FitImageGzip)
DEVICE_VENDOR := FriendlyARM
DEVICE_MODEL := NanoPi NEO
SOC := sun8i-h3
@ -38,6 +42,7 @@ endef
TARGET_DEVICES += friendlyarm_nanopi-neo
define Device/friendlyarm_nanopi-neo-air
$(call Device/FitImageGzip)
DEVICE_VENDOR := FriendlyARM
DEVICE_MODEL := NanoPi NEO Air
DEVICE_PACKAGES := kmod-leds-gpio kmod-brcmfmac \
@ -47,6 +52,7 @@ endef
TARGET_DEVICES += friendlyarm_nanopi-neo-air
define Device/friendlyarm_nanopi-r1
$(call Device/FitImageGzip)
DEVICE_VENDOR := FriendlyARM
DEVICE_MODEL := NanoPi R1
DEVICE_PACKAGES := kmod-usb-net-rtl8152 kmod-leds-gpio \
@ -56,6 +62,7 @@ endef
TARGET_DEVICES += friendlyarm_nanopi-r1
define Device/friendlyarm_zeropi
$(call Device/FitImageGzip)
DEVICE_VENDOR := FriendlyARM
DEVICE_MODEL := ZeroPi
DEVICE_PACKAGES := kmod-rtc-sunxi
@ -64,6 +71,7 @@ endef
TARGET_DEVICES += friendlyarm_zeropi
define Device/lamobo_lamobo-r1
$(call Device/FitImageGzip)
DEVICE_VENDOR := Lamobo
DEVICE_MODEL := Lamobo R1
DEVICE_ALT0_VENDOR := Bananapi
@ -76,6 +84,7 @@ endef
TARGET_DEVICES += lamobo_lamobo-r1
define Device/lemaker_bananapi
$(call Device/FitImageGzip)
DEVICE_VENDOR := LeMaker
DEVICE_MODEL := Banana Pi
DEVICE_PACKAGES:=kmod-rtc-sunxi kmod-ata-sunxi
@ -84,6 +93,7 @@ endef
TARGET_DEVICES += lemaker_bananapi
define Device/sinovoip_bananapi-m2-berry
$(call Device/FitImageGzip)
DEVICE_VENDOR := Sinovoip
DEVICE_MODEL := Banana Pi M2 Berry
DEVICE_PACKAGES:=kmod-ata-sunxi kmod-brcmfmac \
@ -94,6 +104,7 @@ endef
TARGET_DEVICES += sinovoip_bananapi-m2-berry
define Device/sinovoip_bananapi-m2-ultra
$(call Device/FitImageGzip)
DEVICE_VENDOR := Sinovoip
DEVICE_MODEL := Banana Pi M2 Ultra
DEVICE_PACKAGES:=kmod-ata-sunxi kmod-brcmfmac \
@ -104,6 +115,7 @@ endef
TARGET_DEVICES += sinovoip_bananapi-m2-ultra
define Device/lemaker_bananapro
$(call Device/FitImageGzip)
DEVICE_VENDOR := LeMaker
DEVICE_MODEL := Banana Pro
DEVICE_PACKAGES:=kmod-rtc-sunxi kmod-ata-sunxi kmod-brcmfmac \
@ -112,7 +124,17 @@ define Device/lemaker_bananapro
endef
TARGET_DEVICES += lemaker_bananapro
define Device/licheepi_licheepi-zero-dock
$(call Device/FitImageGzip)
DEVICE_VENDOR := LicheePi
DEVICE_MODEL := Zero with Dock (V3s)
DEVICE_PACKAGES:=kmod-rtc-sunxi
SOC := sun8i-v3s
endef
TARGET_DEVICES += licheepi_licheepi-zero-dock
define Device/linksprite_pcduino3
$(call Device/FitImageGzip)
DEVICE_VENDOR := LinkSprite
DEVICE_MODEL := pcDuino3
DEVICE_PACKAGES:=kmod-sun4i-emac kmod-rtc-sunxi kmod-ata-sunxi kmod-rtl8xxxu \
@ -122,6 +144,7 @@ endef
TARGET_DEVICES += linksprite_pcduino3
define Device/linksprite_pcduino3-nano
$(call Device/FitImageGzip)
DEVICE_VENDOR := LinkSprite
DEVICE_MODEL := pcDuino3 Nano
DEVICE_PACKAGES:=kmod-rtc-sunxi kmod-ata-sunxi
@ -130,6 +153,7 @@ endef
TARGET_DEVICES += linksprite_pcduino3-nano
define Device/mele_m9
$(call Device/FitImageGzip)
DEVICE_VENDOR := Mele
DEVICE_MODEL := M9
DEVICE_PACKAGES:=kmod-sun4i-emac kmod-rtl8192cu
@ -137,7 +161,17 @@ define Device/mele_m9
endef
TARGET_DEVICES += mele_m9
define Device/merrii_hummingbird
$(call Device/FitImageGzip)
DEVICE_VENDOR := Merrii
DEVICE_MODEL := Hummingbird
DEVICE_PACKAGES:=kmod-brcmfmac cypress-firmware-43362-sdio wpad-basic-mbedtls
SOC := sun6i-a31
endef
TARGET_DEVICES += merrii_hummingbird
define Device/olimex_a20-olinuxino-lime
$(call Device/FitImageGzip)
DEVICE_VENDOR := Olimex
DEVICE_MODEL := A20-OLinuXino-LIME
DEVICE_PACKAGES:=kmod-ata-sunxi kmod-rtc-sunxi
@ -146,6 +180,7 @@ endef
TARGET_DEVICES += olimex_a20-olinuxino-lime
define Device/olimex_a20-olinuxino-lime2
$(call Device/FitImageGzip)
DEVICE_VENDOR := Olimex
DEVICE_MODEL := A20-OLinuXino-LIME2
DEVICE_PACKAGES:=kmod-ata-sunxi kmod-rtc-sunxi kmod-usb-hid
@ -154,6 +189,7 @@ endef
TARGET_DEVICES += olimex_a20-olinuxino-lime2
define Device/olimex_a20-olinuxino-lime2-emmc
$(call Device/FitImageGzip)
DEVICE_VENDOR := Olimex
DEVICE_MODEL := A20-OLinuXino-LIME2
DEVICE_VARIANT := eMMC
@ -163,6 +199,7 @@ endef
TARGET_DEVICES += olimex_a20-olinuxino-lime2-emmc
define Device/olimex_a20-olinuxino-micro
$(call Device/FitImageGzip)
DEVICE_VENDOR := Olimex
DEVICE_MODEL := A20-OLinuXino-MICRO
DEVICE_PACKAGES:=kmod-ata-sunxi kmod-sun4i-emac kmod-rtc-sunxi
@ -170,7 +207,18 @@ define Device/olimex_a20-olinuxino-micro
endef
TARGET_DEVICES += olimex_a20-olinuxino-micro
define Device/roofull_beelink-x2
$(call Device/FitImageGzip)
DEVICE_VENDOR := Roofull
DEVICE_MODEL := Beelink-X2
DEVICE_PACKAGES:=kmod-leds-gpio kmod-gpio-button-hotplug \
kmod-brcmfmac cypress-firmware-43430-sdio wpad-basic-mbedtls
SOC := sun8i-h3
endef
TARGET_DEVICES += roofull_beelink-x2
define Device/sinovoip_bananapi-m2-plus
$(call Device/FitImageGzip)
DEVICE_VENDOR := Sinovoip
DEVICE_MODEL := Banana Pi M2+
DEVICE_PACKAGES:=kmod-leds-gpio kmod-brcmfmac \
@ -180,6 +228,7 @@ endef
TARGET_DEVICES += sinovoip_bananapi-m2-plus
define Device/sinovoip_bananapi-m3
$(call Device/FitImageGzip)
DEVICE_VENDOR := Sinovoip
DEVICE_MODEL := Banana Pi M3
DEVICE_PACKAGES:=kmod-rtc-sunxi kmod-leds-gpio kmod-rtc-ac100 \
@ -189,6 +238,7 @@ endef
TARGET_DEVICES += sinovoip_bananapi-m3
define Device/sinovoip_bananapi-p2-zero
$(call Device/FitImageGzip)
DEVICE_VENDOR := Sinovoip
DEVICE_MODEL := Banana Pi P2 Zero
DEVICE_PACKAGES:=kmod-leds-gpio kmod-brcmfmac \
@ -198,6 +248,7 @@ endef
TARGET_DEVICES += sinovoip_bananapi-p2-zero
define Device/xunlong_orangepi-one
$(call Device/FitImageGzip)
DEVICE_VENDOR := Xunlong
DEVICE_MODEL := Orange Pi One
DEVICE_PACKAGES:=kmod-rtc-sunxi
@ -206,6 +257,7 @@ endef
TARGET_DEVICES += xunlong_orangepi-one
define Device/xunlong_orangepi-pc
$(call Device/FitImageGzip)
DEVICE_VENDOR := Xunlong
DEVICE_MODEL := Orange Pi PC
DEVICE_PACKAGES:=kmod-gpio-button-hotplug
@ -214,6 +266,7 @@ endef
TARGET_DEVICES += xunlong_orangepi-pc
define Device/xunlong_orangepi-pc-plus
$(call Device/FitImageGzip)
DEVICE_VENDOR := Xunlong
DEVICE_MODEL := Orange Pi PC Plus
DEVICE_PACKAGES:=kmod-gpio-button-hotplug
@ -222,6 +275,7 @@ endef
TARGET_DEVICES += xunlong_orangepi-pc-plus
define Device/xunlong_orangepi-plus
$(call Device/FitImageGzip)
DEVICE_VENDOR := Xunlong
DEVICE_MODEL := Orange Pi Plus
DEVICE_PACKAGES:=kmod-rtc-sunxi
@ -230,6 +284,7 @@ endef
TARGET_DEVICES += xunlong_orangepi-plus
define Device/xunlong_orangepi-r1
$(call Device/FitImageGzip)
DEVICE_VENDOR := Xunlong
DEVICE_MODEL := Orange Pi R1
DEVICE_PACKAGES:=kmod-usb-net-rtl8152
@ -238,6 +293,7 @@ endef
TARGET_DEVICES += xunlong_orangepi-r1
define Device/xunlong_orangepi-zero
$(call Device/FitImageGzip)
DEVICE_VENDOR := Xunlong
DEVICE_MODEL := Orange Pi Zero
DEVICE_PACKAGES:=kmod-rtc-sunxi
@ -246,6 +302,7 @@ endef
TARGET_DEVICES += xunlong_orangepi-zero
define Device/xunlong_orangepi-2
$(call Device/FitImageGzip)
DEVICE_VENDOR := Xunlong
DEVICE_MODEL := Orange Pi 2
DEVICE_PACKAGES:=kmod-rtc-sunxi

View File

@ -6,6 +6,7 @@
KERNEL_LOADADDR:=0x40008000
define Device/cubietech_a10-cubieboard
$(call Device/FitImageGzip)
DEVICE_VENDOR := Cubietech
DEVICE_MODEL := Cubieboard
DEVICE_PACKAGES:=kmod-ata-sunxi kmod-sun4i-emac kmod-rtc-sunxi
@ -14,6 +15,7 @@ endef
TARGET_DEVICES += cubietech_a10-cubieboard
define Device/haoyu_a10-marsboard
$(call Device/FitImageGzip)
DEVICE_VENDOR := HAOYU Electronics
DEVICE_MODEL := MarsBoard A10
DEVICE_PACKAGES:=kmod-ata-core kmod-ata-sunxi kmod-sun4i-emac \
@ -24,6 +26,7 @@ endef
TARGET_DEVICES += haoyu_a10-marsboard
define Device/linksprite_a10-pcduino
$(call Device/FitImageGzip)
DEVICE_VENDOR := LinkSprite
DEVICE_MODEL := pcDuino
DEVICE_PACKAGES:=kmod-sun4i-emac kmod-rtc-sunxi kmod-rtl8192cu
@ -32,6 +35,7 @@ endef
TARGET_DEVICES += linksprite_a10-pcduino
define Device/olimex_a10-olinuxino-lime
$(call Device/FitImageGzip)
DEVICE_VENDOR := Olimex
DEVICE_MODEL := A10-OLinuXino-LIME
DEVICE_PACKAGES:=kmod-ata-sunxi kmod-sun4i-emac kmod-rtc-sunxi
@ -40,6 +44,7 @@ endef
TARGET_DEVICES += olimex_a10-olinuxino-lime
define Device/olimex_a13-olimex-som
$(call Device/FitImageGzip)
DEVICE_VENDOR := Olimex
DEVICE_MODEL := A13-SOM
DEVICE_PACKAGES:=kmod-rtl8192cu
@ -50,6 +55,7 @@ endef
TARGET_DEVICES += olimex_a13-olimex-som
define Device/olimex_a13-olinuxino
$(call Device/FitImageGzip)
DEVICE_VENDOR := Olimex
DEVICE_MODEL := A13-OLinuXino
DEVICE_PACKAGES:=kmod-rtl8192cu