diff --git a/board/orangepi_zero_2w/bl31.bin b/board/orangepi_zero_2w/bl31.bin new file mode 100755 index 0000000..746cb9e Binary files /dev/null and b/board/orangepi_zero_2w/bl31.bin differ diff --git a/configs/orangepi_pc_defconfig b/configs/orangepi_pc_defconfig index be7f5fd..b6a05d4 100644 --- a/configs/orangepi_pc_defconfig +++ b/configs/orangepi_pc_defconfig @@ -27,6 +27,8 @@ export UCLIBC_CONFIG_FILE=${root}/board/${BOARD_NAME}/uclibc-1.0.50.config export KERNEL_VERSION=6.13.3 export KERNEL_CONFIG_FILE=${root}/board/${BOARD_NAME}/linux-${KERNEL_VERSION}.config +export UBOOT_DEFCONFIG=orangepi_pc_defconfig + export ZLIB_ENABLE=y export DROPBEAR_ENABLE=y export IMAGE_USABLE_ENABLE=y diff --git a/configs/orangepi_zero_2w_defconfig b/configs/orangepi_zero_2w_defconfig index 720dcf8..25ed272 100644 --- a/configs/orangepi_zero_2w_defconfig +++ b/configs/orangepi_zero_2w_defconfig @@ -27,6 +27,8 @@ export UCLIBC_CONFIG_FILE=$root/board/${BOARD_NAME}/uclibc-1.0.50.config export KERNEL_VERSION=6.8.6 export KERNEL_CONFIG_FILE=${root}/board/${BOARD_NAME}/linux-${KERNEL_VERSION}.config +export UBOOT_DEFCONFIG=orangepi_zero2w_defconfig + export ZLIB_ENABLE=y export DROPBEAR_ENABLE=y export IMAGE_USABLE_ENABLE=y @@ -43,5 +45,5 @@ export HOSTAPD_ENABLE=y export OPENSSL_ENABLE=y export DNSMASQ_ENABLE=y export IPTABLES_ENABLE=y -export KO8821AU_ENABLE=y +export KO8821AU_ENABLE=n #-------------------------------------- diff --git a/scripts/config.sh b/scripts/config.sh index 720dcf8..25ed272 100755 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -27,6 +27,8 @@ export UCLIBC_CONFIG_FILE=$root/board/${BOARD_NAME}/uclibc-1.0.50.config export KERNEL_VERSION=6.8.6 export KERNEL_CONFIG_FILE=${root}/board/${BOARD_NAME}/linux-${KERNEL_VERSION}.config +export UBOOT_DEFCONFIG=orangepi_zero2w_defconfig + export ZLIB_ENABLE=y export DROPBEAR_ENABLE=y export IMAGE_USABLE_ENABLE=y @@ -43,5 +45,5 @@ export HOSTAPD_ENABLE=y export OPENSSL_ENABLE=y export DNSMASQ_ENABLE=y export IPTABLES_ENABLE=y -export KO8821AU_ENABLE=y +export KO8821AU_ENABLE=n #-------------------------------------- diff --git a/scripts/kernel.sh b/scripts/kernel.sh index 7fe5f11..0643c48 100755 --- a/scripts/kernel.sh +++ b/scripts/kernel.sh @@ -22,7 +22,9 @@ kernel() { printf "$UGREEN** Building Linux Kernel\n$RESET" make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- $makeflags # &>> $fulllogfile check $? "Build Linux Kernel" - ls -lh arch/$ARCH/boot/zImage + KIMAGE=zImage + [ "$ARCH" = "arm64" ] && KIMAGE=Image + ls -lh arch/$ARCH/boot/$KIMAGE } # kernel #----------------------------------------------------------- @@ -54,7 +56,9 @@ kernel_with_rootfs() { printf "$UGREEN** Installing Linux Kernel into images path\n$RESET" # make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE INSTALL_MOD_PATH=$rootfspath modules_install # &>> $fulllogfile # rm -v $rootfspath/usr/lib/modules/6.1.91/{source,build} - cp -v arch/$ARCH/boot/zImage $sdroot/boot + KIMAGE=zImage + [ "$ARCH" = "arm64" ] && KIMAGE=Image + cp -v arch/$ARCH/boot/$KIMAGE $sdroot/boot check $? "Install Linux Kernel into images path" } #----------------------------------------------------------- diff --git a/scripts/sdroot.sh b/scripts/sdroot.sh index f8ab4a4..551bfc3 100755 --- a/scripts/sdroot.sh +++ b/scripts/sdroot.sh @@ -20,6 +20,7 @@ sdroot() { printf "$GREEN** Copy extlinux.conf\n$RESET" cp -v $root/extlinux/extlinux.conf $sdroot/boot/extlinux check $? "Copy extlinux.conf" + [ "$ARCH" = "arm64" ] && sed -i "s/zImage/Image/g" $sdroot/boot/extlinux/extlinux.conf kernel_with_rootfs uboot printf "$GREEN** Creating rootfs.ext4\n$RESET" @@ -74,7 +75,9 @@ sdroot_usable() { initramfs cp -v $build/initramfs.img $sdroot/boot - cp -v $build/kernel/linux-6.13.3/arch/$ARCH/boot/zImage $sdroot/boot + KIMAGE=zImage + [ "$ARCH" = "arm64" ] && KIMAGE=Image + cp -v $build/kernel/linux-6.13.3/arch/$ARCH/boot/$KIMAGE $sdroot/boot uboot printf "$GREEN** Creating rootfs.ext4\n$RESET" cd $out @@ -96,6 +99,7 @@ sdroot_usable() { check $? "Copy genimage.cfg" sed -i "s/FILEUUID/$uuid/g" genimage.cfg sed -i "s/ROOTUUID/$uuid/g" $sdroot/boot/extlinux/extlinux.conf + [ "$ARCH" = "arm64" ] && sed -i "s/zImage/Image/g" $sdroot/boot/extlinux/extlinux.conf sed -i "s/sdcard.img/sdcard_usable.img/g" genimage.cfg mkdir -v rootmnt sudo mount -v rootfs.ext4 rootmnt diff --git a/scripts/uboot.sh b/scripts/uboot.sh index 71b25ba..23ae54f 100755 --- a/scripts/uboot.sh +++ b/scripts/uboot.sh @@ -15,12 +15,20 @@ uboot() { check $? "Extract uboot" cd u-boot-$uboot_version # cp -rv $root/uclibc/config-1.0.50 .config - make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- orangepi_pc_defconfig + make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE- $UBOOT_DEFCONFIG check $? "Configure uboot" - make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE- $makeflags # &>> $fulllogfile + if [ "$BOARD_NAME" = "orangepi_pc" ]; then + make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE- $makeflags # &>> $fulllogfile + elif [ "$BOARD_NAME" = "orangepi_zero_2w" ]; then + make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE- BL31=$root/board/$BOARD_NAME/bl31.bin $makeflags + fi check $? "Build uboot" cp -v u-boot-sunxi-with-spl.bin $out - cp -v arch/arm/dts/sun8i-h3-orangepi-pc.dtb $sdroot/boot/dtbs + if [ "$ARCH" = "arm" ]; then + cp -v arch/arm/dts/sun8i-h3-orangepi-pc.dtb $sdroot/boot/dtbs + elif [ "$ARCH" = "arm64" ]; then + cp -v dts/upstream/src/arm64/allwinner/sun50i-h618-orangepi-zero2w.dtb $sdroot/boot/dtbs + fi # make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE DESTDIR=$rootfspath install # &>> $fulllogfile check $? "Install uboot to out directory" check $? "Build and install uboot to out directory"