This splits out the sun50i boards from the aarch64 package, updates
the U-Boot version for those boards and includes the new crust SCP
firmware in the image.  The new sun50i package is provided as tgz
file; the diff removes the relevant boards from the aarch64 package.

My idea is to import the sun50i (onhooked to the build) and then apply
the diff.

I probably need some help to make pkg_add -u do the right thing.  For
the previous diff that split things up, sthen@ told me to add some
magic @pkgpath lines.

I tested the new firmware on the nanopi a64 and the orange pi zero 3.
Testing on a few more boards would be welcome.

Thoughts?


Index: sysutils/u-boot/Makefile
===================================================================
RCS file: /cvs/ports/sysutils/u-boot/Makefile,v
retrieving revision 1.99
diff -u -p -r1.99 Makefile
--- sysutils/u-boot/Makefile    26 Nov 2023 21:06:26 -0000      1.99
+++ sysutils/u-boot/Makefile    20 Feb 2024 13:42:22 -0000
@@ -4,5 +4,6 @@
      SUBDIR += riscv64
      SUBDIR += rk356x
      SUBDIR += rk3588
+     SUBDIR += sun50i
 
 .include <bsd.port.subdir.mk>
Index: sysutils/u-boot/Makefile.inc
===================================================================
RCS file: /cvs/ports/sysutils/u-boot/Makefile.inc,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile.inc
--- sysutils/u-boot/Makefile.inc        7 Nov 2023 16:45:50 -0000       1.9
+++ sysutils/u-boot/Makefile.inc        20 Feb 2024 13:42:22 -0000
@@ -59,7 +59,7 @@ FILES=\
 
 do-install:
        ${INSTALL_DATA_DIR} ${PREFIX}/share/u-boot
-.for BOARD in ${BOARDS} ${SUNXI64}
+.for BOARD in ${BOARDS}
        @[ -d ${WRKSRC}/build/${BOARD} ] && \
        echo ${INSTALL_DATA_DIR} ${PREFIX}/share/u-boot/${BOARD} && \
        ${INSTALL_DATA_DIR} ${PREFIX}/share/u-boot/${BOARD} && \
Index: sysutils/u-boot/aarch64/Makefile
===================================================================
RCS file: /cvs/ports/sysutils/u-boot/aarch64/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- sysutils/u-boot/aarch64/Makefile    7 Nov 2023 16:45:50 -0000       1.5
+++ sysutils/u-boot/aarch64/Makefile    20 Feb 2024 13:42:22 -0000
@@ -1,23 +1,8 @@
 VERSION=       2021.10
-REVISION=      8
+REVISION=      9
 
 SOC=           aarch64
 
-SUNXI64=\
-       a64-olinuxino \
-       bananapi_m64 \
-       nanopi_a64 \
-       nanopi_neo2 \
-       orangepi_pc2 \
-       orangepi_prime \
-       orangepi_win \
-       orangepi_zero_plus \
-       pine64-lts \
-       pine64_plus \
-       pine_h64-model-b \
-       pinebook \
-       sopine_baseboard
-
 BOARDS=\
        firefly-rk3399 \
        mvebu_espressobin-88f3720 \
@@ -41,8 +26,6 @@ BUILD_DEPENDS+= devel/arm-none-eabi/gcc,
 CROSS_COMPILE= aarch64-none-elf-
 RK3328_BL31=   ${LOCALBASE}/share/arm-trusted-firmware/rk3328-bl31.elf
 RK3399_BL31=   ${LOCALBASE}/share/arm-trusted-firmware/rk3399-bl31.elf
-SUNXI_BL31=    ${LOCALBASE}/share/arm-trusted-firmware/sun50i_a64-bl31.bin
-SUNXI_H6_BL31= ${LOCALBASE}/share/arm-trusted-firmware/sun50i_h6-bl31.bin
 
 MODPY_ADJ_FILES= arch/arm/mach-rockchip/make_fit_atf.py
 
@@ -69,32 +52,6 @@ do-build:
                O="build/${BOARD}" \
                -f ${MAKE_FILE} ${ALL_TARGET}
 .endif
-.endfor
-.for BOARD in ${SUNXI64}
-.if "${BOARD:M*_h64*}"
-       cd ${WRKSRC} && \
-           mkdir -p build/${BOARD} && \
-           ${SETENV} ${MAKE_ENV} BL31=${SUNXI_H6_BL31} ${MAKE_PROGRAM} \
-               ${MAKE_FLAGS} O="build/${BOARD}" \
-               -f ${MAKE_FILE} "${BOARD}"_defconfig && \
-           ${SETENV} ${MAKE_ENV} BL31=${SUNXI_H6_BL31} ${MAKE_PROGRAM} \
-               ${MAKE_FLAGS} O="build/${BOARD}" \
-               -f ${MAKE_FILE} ${ALL_TARGET}
-.else
-       cd ${WRKSRC} && \
-           mkdir -p build/${BOARD} && \
-           ${SETENV} ${MAKE_ENV} BL31=${SUNXI_BL31} ${MAKE_PROGRAM} \
-               ${MAKE_FLAGS} O="build/${BOARD}" \
-               -f ${MAKE_FILE} "${BOARD}"_defconfig && \
-           ${SETENV} ${MAKE_ENV} BL31=${SUNXI_BL31} ${MAKE_PROGRAM} \
-               ${MAKE_FLAGS} O="build/${BOARD}" \
-               -f ${MAKE_FILE} ${ALL_TARGET}
-.endif
-       if [[ -f ${WRKSRC}/build/${BOARD}/spl/sunxi-spl.bin && \
-             -f ${WRKSRC}/build/${BOARD}/u-boot.itb ]]; then \
-               cd ${WRKSRC}/build/${BOARD} && \
-                   cat spl/sunxi-spl.bin u-boot.itb > 
u-boot-sunxi-with-spl.bin ; \
-       fi
 .endfor
 
 .include <bsd.port.mk>
Index: sysutils/u-boot/aarch64/patches/patch-arch_arm_dts_Makefile
===================================================================
RCS file: sysutils/u-boot/aarch64/patches/patch-arch_arm_dts_Makefile
diff -N sysutils/u-boot/aarch64/patches/patch-arch_arm_dts_Makefile
--- sysutils/u-boot/aarch64/patches/patch-arch_arm_dts_Makefile 11 Aug 2023 
19:48:27 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-Hook up the dtb to the build for PINE H64 model B.
-
-Index: arch/arm/dts/Makefile
---- arch/arm/dts/Makefile.orig
-+++ arch/arm/dts/Makefile
-@@ -642,6 +642,7 @@ dtb-$(CONFIG_MACH_SUN50I_H6) += \
-       sun50i-h6-orangepi-lite2.dtb \
-       sun50i-h6-orangepi-one-plus.dtb \
-       sun50i-h6-pine-h64.dtb \
-+      sun50i-h6-pine-h64-model-b.dtb \
-       sun50i-h6-tanix-tx6.dtb
- dtb-$(CONFIG_MACH_SUN50I_H616) += \
-       sun50i-h616-orangepi-zero2.dtb
Index: 
sysutils/u-boot/aarch64/patches/patch-arch_arm_dts_sun50i-h6-pine-h64-model-b_dts
===================================================================
RCS file: 
sysutils/u-boot/aarch64/patches/patch-arch_arm_dts_sun50i-h6-pine-h64-model-b_dts
diff -N 
sysutils/u-boot/aarch64/patches/patch-arch_arm_dts_sun50i-h6-pine-h64-model-b_dts
--- 
sysutils/u-boot/aarch64/patches/patch-arch_arm_dts_sun50i-h6-pine-h64-model-b_dts
   11 Aug 2023 19:48:27 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,58 +0,0 @@
-Copy the device tree file for PINE H64 model B from Linux kernel:
-https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts?h=v5.14
-
-Index: arch/arm/dts/sun50i-h6-pine-h64-model-b.dts
---- arch/arm/dts/sun50i-h6-pine-h64-model-b.dts.orig
-+++ arch/arm/dts/sun50i-h6-pine-h64-model-b.dts
-@@ -0,0 +1,51 @@
-+// SPDX-License-Identifier: (GPL-2.0+ or MIT)
-+/*
-+ * Copyright (C) 2019 Corentin LABBE <[email protected]>
-+ */
-+
-+#include "sun50i-h6-pine-h64.dts"
-+
-+/ {
-+      model = "Pine H64 model B";
-+      compatible = "pine64,pine-h64-model-b", "allwinner,sun50i-h6";
-+
-+      /delete-node/ reg_gmac_3v3;
-+
-+      wifi_pwrseq: wifi_pwrseq {
-+              compatible = "mmc-pwrseq-simple";
-+              reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /* PM3 */
-+              post-power-on-delay-ms = <200>;
-+      };
-+};
-+
-+&hdmi_connector {
-+      /delete-property/ ddc-en-gpios;
-+};
-+
-+&emac {
-+      phy-supply = <&reg_aldo2>;
-+};
-+
-+&mmc1 {
-+      vmmc-supply = <&reg_cldo3>;
-+      vqmmc-supply = <&reg_aldo1>;
-+      mmc-pwrseq = <&wifi_pwrseq>;
-+      bus-width = <4>;
-+      non-removable;
-+      status = "okay";
-+};
-+
-+&uart1 {
-+      pinctrl-names = "default";
-+      pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
-+      uart-has-rtscts;
-+      status = "okay";
-+
-+      bluetooth {
-+              compatible = "realtek,rtl8723bs-bt";
-+              device-wake-gpios = <&r_pio 1 2 GPIO_ACTIVE_HIGH>; /* PM2 */
-+              host-wake-gpios = <&r_pio 1 1 GPIO_ACTIVE_HIGH>; /* PM1 */
-+              enable-gpios = <&r_pio 1 4 GPIO_ACTIVE_HIGH>; /* PM4 */
-+              max-speed = <1500000>;
-+      };
-+};
Index: sysutils/u-boot/aarch64/pkg/PLIST
===================================================================
RCS file: /cvs/ports/sysutils/u-boot/aarch64/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- sysutils/u-boot/aarch64/pkg/PLIST   2 Sep 2023 14:33:03 -0000       1.2
+++ sysutils/u-boot/aarch64/pkg/PLIST   20 Feb 2024 13:42:22 -0000
@@ -1,20 +1,6 @@
 @pkgpath sysutils/u-boot-pinebook
 @pkgpath sysutils/u-boot,aarch64
 share/u-boot/
-share/u-boot/a64-olinuxino/
-share/u-boot/a64-olinuxino/sunxi-spl.bin
-@comment share/u-boot/a64-olinuxino/u-boot
-@comment share/u-boot/a64-olinuxino/u-boot-spl.bin
-share/u-boot/a64-olinuxino/u-boot-sunxi-with-spl.bin
-@comment share/u-boot/a64-olinuxino/u-boot.bin
-@comment share/u-boot/a64-olinuxino/u-boot.img
-share/u-boot/bananapi_m64/
-share/u-boot/bananapi_m64/sunxi-spl.bin
-@comment share/u-boot/bananapi_m64/u-boot
-@comment share/u-boot/bananapi_m64/u-boot-spl.bin
-share/u-boot/bananapi_m64/u-boot-sunxi-with-spl.bin
-@comment share/u-boot/bananapi_m64/u-boot.bin
-@comment share/u-boot/bananapi_m64/u-boot.img
 share/u-boot/firefly-rk3399/
 share/u-boot/firefly-rk3399/idbloader.img
 @comment share/u-boot/firefly-rk3399/u-boot
@@ -61,70 +47,6 @@ share/u-boot/nanopi-r4s-rk3399/u-boot-ro
 @comment share/u-boot/nanopi-r4s-rk3399/u-boot.bin
 @comment share/u-boot/nanopi-r4s-rk3399/u-boot.img
 share/u-boot/nanopi-r4s-rk3399/u-boot.itb
-share/u-boot/nanopi_a64/
-share/u-boot/nanopi_a64/sunxi-spl.bin
-@comment share/u-boot/nanopi_a64/u-boot
-@comment share/u-boot/nanopi_a64/u-boot-spl.bin
-share/u-boot/nanopi_a64/u-boot-sunxi-with-spl.bin
-@comment share/u-boot/nanopi_a64/u-boot.bin
-@comment share/u-boot/nanopi_a64/u-boot.img
-share/u-boot/nanopi_neo2/
-share/u-boot/nanopi_neo2/sunxi-spl.bin
-@comment share/u-boot/nanopi_neo2/u-boot
-@comment share/u-boot/nanopi_neo2/u-boot-spl.bin
-share/u-boot/nanopi_neo2/u-boot-sunxi-with-spl.bin
-@comment share/u-boot/nanopi_neo2/u-boot.bin
-@comment share/u-boot/nanopi_neo2/u-boot.img
-share/u-boot/orangepi_pc2/
-share/u-boot/orangepi_pc2/sunxi-spl.bin
-@comment share/u-boot/orangepi_pc2/u-boot
-@comment share/u-boot/orangepi_pc2/u-boot-spl.bin
-share/u-boot/orangepi_pc2/u-boot-sunxi-with-spl.bin
-@comment share/u-boot/orangepi_pc2/u-boot.bin
-@comment share/u-boot/orangepi_pc2/u-boot.img
-share/u-boot/orangepi_prime/
-share/u-boot/orangepi_prime/sunxi-spl.bin
-@comment share/u-boot/orangepi_prime/u-boot
-@comment share/u-boot/orangepi_prime/u-boot-spl.bin
-share/u-boot/orangepi_prime/u-boot-sunxi-with-spl.bin
-@comment share/u-boot/orangepi_prime/u-boot.bin
-@comment share/u-boot/orangepi_prime/u-boot.img
-share/u-boot/orangepi_win/
-share/u-boot/orangepi_win/sunxi-spl.bin
-@comment share/u-boot/orangepi_win/u-boot
-@comment share/u-boot/orangepi_win/u-boot-spl.bin
-share/u-boot/orangepi_win/u-boot-sunxi-with-spl.bin
-@comment share/u-boot/orangepi_win/u-boot.bin
-@comment share/u-boot/orangepi_win/u-boot.img
-share/u-boot/orangepi_zero_plus/
-share/u-boot/orangepi_zero_plus/sunxi-spl.bin
-@comment share/u-boot/orangepi_zero_plus/u-boot
-@comment share/u-boot/orangepi_zero_plus/u-boot-spl.bin
-share/u-boot/orangepi_zero_plus/u-boot-sunxi-with-spl.bin
-@comment share/u-boot/orangepi_zero_plus/u-boot.bin
-@comment share/u-boot/orangepi_zero_plus/u-boot.img
-share/u-boot/pine64-lts/
-share/u-boot/pine64-lts/sunxi-spl.bin
-@comment share/u-boot/pine64-lts/u-boot
-@comment share/u-boot/pine64-lts/u-boot-spl.bin
-share/u-boot/pine64-lts/u-boot-sunxi-with-spl.bin
-@comment share/u-boot/pine64-lts/u-boot.bin
-@comment share/u-boot/pine64-lts/u-boot.img
-share/u-boot/pine64_plus/
-share/u-boot/pine64_plus/sunxi-spl.bin
-@comment share/u-boot/pine64_plus/u-boot
-@comment share/u-boot/pine64_plus/u-boot-spl.bin
-share/u-boot/pine64_plus/u-boot-sunxi-with-spl.bin
-@comment share/u-boot/pine64_plus/u-boot.bin
-@comment share/u-boot/pine64_plus/u-boot.img
-share/u-boot/pine_h64-model-b/
-share/u-boot/pine_h64-model-b/sunxi-spl.bin
-@comment share/u-boot/pine_h64-model-b/u-boot
-@comment share/u-boot/pine_h64-model-b/u-boot-spl.bin
-share/u-boot/pine_h64-model-b/u-boot-sunxi-with-spl.bin
-@comment share/u-boot/pine_h64-model-b/u-boot.bin
-@comment share/u-boot/pine_h64-model-b/u-boot.img
-share/u-boot/pinebook/
 share/u-boot/pinebook-pro-rk3399/
 share/u-boot/pinebook-pro-rk3399/idbloader.img
 @comment share/u-boot/pinebook-pro-rk3399/u-boot
@@ -133,12 +55,6 @@ share/u-boot/pinebook-pro-rk3399/u-boot-
 @comment share/u-boot/pinebook-pro-rk3399/u-boot.bin
 @comment share/u-boot/pinebook-pro-rk3399/u-boot.img
 share/u-boot/pinebook-pro-rk3399/u-boot.itb
-share/u-boot/pinebook/sunxi-spl.bin
-@comment share/u-boot/pinebook/u-boot
-@comment share/u-boot/pinebook/u-boot-spl.bin
-share/u-boot/pinebook/u-boot-sunxi-with-spl.bin
-@comment share/u-boot/pinebook/u-boot.bin
-@comment share/u-boot/pinebook/u-boot.img
 share/u-boot/qemu_arm64/
 share/u-boot/qemu_arm64/u-boot
 share/u-boot/qemu_arm64/u-boot.bin
@@ -185,10 +101,3 @@ share/u-boot/rockpro64-rk3399/u-boot.itb
 share/u-boot/rpi_arm64/
 @comment share/u-boot/rpi_arm64/u-boot
 share/u-boot/rpi_arm64/u-boot.bin
-share/u-boot/sopine_baseboard/
-share/u-boot/sopine_baseboard/sunxi-spl.bin
-@comment share/u-boot/sopine_baseboard/u-boot
-@comment share/u-boot/sopine_baseboard/u-boot-spl.bin
-share/u-boot/sopine_baseboard/u-boot-sunxi-with-spl.bin
-@comment share/u-boot/sopine_baseboard/u-boot.bin
-@comment share/u-boot/sopine_baseboard/u-boot.img

Attachment: u-boot-sun50i.tgz
Description: Binary data

Reply via email to