pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils update u-boot-rockpro64 and u-boot-pinebook-p...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ce2e306ac2db
branches:  trunk
changeset: 373531:ce2e306ac2db
user:      mrg <mrg%pkgsrc.org@localhost>
date:      Fri Feb 11 22:06:22 2022 +0000

description:
update u-boot-rockpro64 and u-boot-pinebook-pro to u-boot 2022.01.

tested in sd, emmc, and spi on rockpro64, and on emmc on pbp.

should not affect u-boot-rockpro64-ayufan, but should finally
make it obsolete as the SPI version works again.

diffstat:

 sysutils/u-boot-pinebook-pro/MESSAGE  |   9 +++++----
 sysutils/u-boot-pinebook-pro/Makefile |   6 ++++--
 sysutils/u-boot-rockpro64/MESSAGE     |  14 +++++++++-----
 sysutils/u-boot-rockpro64/Makefile    |   7 ++++---
 sysutils/u-boot/u-boot-rockchip.mk    |  34 +++++++++++++++++++++++++++++-----
 5 files changed, 51 insertions(+), 19 deletions(-)

diffs (150 lines):

diff -r 3b142f1f05e3 -r ce2e306ac2db sysutils/u-boot-pinebook-pro/MESSAGE
--- a/sysutils/u-boot-pinebook-pro/MESSAGE      Fri Feb 11 21:46:14 2022 +0000
+++ b/sysutils/u-boot-pinebook-pro/MESSAGE      Fri Feb 11 22:06:22 2022 +0000
@@ -1,17 +1,18 @@
 ===========================================================================
-$NetBSD: MESSAGE,v 1.4 2020/02/22 11:55:36 mrg Exp $
+$NetBSD: MESSAGE,v 1.5 2022/02/11 22:06:22 mrg Exp $
 
 Examples command to install U-Boot to an empty SD card:
 
-# dd if=${LOCALBASE}/share/u-boot/pinebook-pro/rksd_loader.img seek=64 of=/dev/rld0d
+# dd if=${LOCALBASE}/share/u-boot/pinebook-pro/rksd_loader.img seek=64 of=/dev/rld0d conv=sync
 
 Alternatively, to install to SPI flash:
 
-dd if=${LOCALBASE}/share/u-boot/pinebook-pro/rkspi_loader.img bs=64k of=/dev/spiflash0
+dd if=${LOCALBASE}/share/u-boot/pinebook-pro/rkspi_loader.img bs=64k of=/dev/spiflash0 conv=sync
 
 You should make sure that the space is otherwise cleared of data, as old
 images may fool the boot loader paths.
 
-See also http://opensource.rock-chips.com/wiki_Boot_option
+See also NetBSD installboot(8) and
+http://opensource.rock-chips.com/wiki_Boot_option
 
 ===========================================================================
diff -r 3b142f1f05e3 -r ce2e306ac2db sysutils/u-boot-pinebook-pro/Makefile
--- a/sysutils/u-boot-pinebook-pro/Makefile     Fri Feb 11 21:46:14 2022 +0000
+++ b/sysutils/u-boot-pinebook-pro/Makefile     Fri Feb 11 22:06:22 2022 +0000
@@ -1,10 +1,12 @@
-# $NetBSD: Makefile,v 1.13 2021/08/12 07:30:23 wiz Exp $
+# $NetBSD: Makefile,v 1.14 2022/02/11 22:06:22 mrg Exp $
 
 UBOOT_TARGET=          pinebook-pro
 UBOOT_CONFIG=          pinebook-pro-rk3399_defconfig
 UBOOT_BIN=             idbloader.img rksd_loader.img rkspi_loader.img u-boot.itb
 UBOOT_IMAGE_TYPE=      rk3399
-UBOOT_VERSION?=                2021.07
+UBOOT_VERSION?=                2022.01
+UBOOT_MKIMAGE_RKSPI=   1
+UBOOT_RK_SPI_OFF=      768
 
 UBOOT_INSTALLBOOT_PLIST=       installboot.plist
 
diff -r 3b142f1f05e3 -r ce2e306ac2db sysutils/u-boot-rockpro64/MESSAGE
--- a/sysutils/u-boot-rockpro64/MESSAGE Fri Feb 11 21:46:14 2022 +0000
+++ b/sysutils/u-boot-rockpro64/MESSAGE Fri Feb 11 22:06:22 2022 +0000
@@ -1,14 +1,18 @@
 ===========================================================================
-$NetBSD: MESSAGE,v 1.3 2019/08/13 21:28:47 tnn Exp $
+$NetBSD: MESSAGE,v 1.4 2022/02/11 22:06:23 mrg Exp $
 
-Example command to install U-Boot to an empty SD card:
+Example command to install U-Boot to an empty eMMC or SD card:
 
-# dd if=${LOCALBASE}/share/u-boot/rockpro64/rksd_loader.img seek=64 of=/dev/rld0d
+# dd if=${LOCALBASE}/share/u-boot/rockpro64/rksd_loader.img seek=64 of=/dev/rld0d conv=sync
 
 Alternatively, to install to SPI flash:
 
-dd if=${LOCALBASE}/share/u-boot/rockpro64/rkspi_loader.img bs=64k of=/dev/spiflash0
+dd if=${LOCALBASE}/share/u-boot/rockpro64/rkspi_loader.img bs=64k of=/dev/spiflash0 conv=sync
 
-See also http://opensource.rock-chips.com/wiki_Boot_option
+You should make sure that the space is otherwise cleared of data, as old
+images may fool the boot loader paths.
+
+See also NetBSD installboot(8) and
+http://opensource.rock-chips.com/wiki_Boot_option
 
 ===========================================================================
diff -r 3b142f1f05e3 -r ce2e306ac2db sysutils/u-boot-rockpro64/Makefile
--- a/sysutils/u-boot-rockpro64/Makefile        Fri Feb 11 21:46:14 2022 +0000
+++ b/sysutils/u-boot-rockpro64/Makefile        Fri Feb 11 22:06:22 2022 +0000
@@ -1,11 +1,12 @@
-# $NetBSD: Makefile,v 1.15 2021/08/12 07:30:23 wiz Exp $
+# $NetBSD: Makefile,v 1.16 2022/02/11 22:06:23 mrg Exp $
 
 UBOOT_TARGET=          rockpro64
 UBOOT_CONFIG=          rockpro64-rk3399_defconfig
 UBOOT_BIN=             idbloader.img rksd_loader.img rkspi_loader.img u-boot.itb
 UBOOT_IMAGE_TYPE=      rk3399
-UBOOT_VERSION?=                2021.07
-PKGREVISION=           1
+UBOOT_VERSION?=                2022.01
+UBOOT_MKIMAGE_RKSPI=   1
+UBOOT_RK_SPI_OFF=      768
 
 UBOOT_INSTALLBOOT_PLIST=       installboot.plist
 
diff -r 3b142f1f05e3 -r ce2e306ac2db sysutils/u-boot/u-boot-rockchip.mk
--- a/sysutils/u-boot/u-boot-rockchip.mk        Fri Feb 11 21:46:14 2022 +0000
+++ b/sysutils/u-boot/u-boot-rockchip.mk        Fri Feb 11 22:06:22 2022 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: u-boot-rockchip.mk,v 1.11 2021/06/25 08:28:57 mrg Exp $
+# $NetBSD: u-boot-rockchip.mk,v 1.12 2022/02/11 22:06:22 mrg Exp $
 #
 # should be used by sysutils/u-boot-rock64/Makefile
 # used by sysutils/u-boot-rockpro64/Makefile
+# used by sysutils/u-boot-rockpro64-ayufan/Makefile
 # used by sysutils/u-boot-pinebook-pro/Makefile
 
 # Common makefile fragment for rockchip based u-boot targets.
@@ -13,19 +14,42 @@
 
 UBOOT_VERSION?=                2020.01-rc5
 
-MAKE_ENV+=             BL31=${PREFIX}/share/arm-trusted-firmware/${UBOOT_IMAGE_TYPE}/bl31.elf
+.if ${UBOOT_IMAGE_TYPE} == "rk3399"
+TFA=                   trusted-firmware-a
+.else
+TFA=                   arm-trusted-firmware
+.endif
+
+# Earlier SPIs were at sector 1024, but newer u-boot has a DT that
+# loads them from 768.  Until all are converted, leave the default
+# at 1024.
+UBOOT_RK_SPI_OFF?=     1024
+
+MAKE_ENV+=             BL31=${PREFIX}/share/${TFA}/${UBOOT_IMAGE_TYPE}/bl31.elf
 
 post-build:
-# wrap everything up into a single file that can be written to an SD card
+# wrap everything up into a single file that can be written to an SD card.
+# note that the SD image starts at sector 64, and 64 + 448 = 512, so the
+# u-boot.itb is loaded at 256KiB on the card iteslf.
        cp ${WRKSRC}/idbloader.img ${WRKSRC}/rksd_loader.img
        dd if=${WRKSRC}/u-boot.itb seek=448 conv=notrunc of=${WRKSRC}/rksd_loader.img
+.if defined(UBOOT_MKIMAGE_RKSPI)
+        ${WRKSRC}/tools/mkimage \
+               -n rk3399 \
+               -T rkspi \
+               -d ${WRKSRC}/tpl/u-boot-tpl.bin:${WRKSRC}/spl/u-boot-spl.bin \
+               ${WRKSRC}/rkspi_loader.img
+.else
 # build SPI NOR flash image. See dev-ayufan/build.mk.
        set -e; b=0; while [ "$$b" != 128 ]; do \
                dd bs=2k count=1; \
                dd if=/dev/zero bs=2k count=1; \
                b=$$(expr $$b + 1); \
        done < ${WRKSRC}/idbloader.img > ${WRKSRC}/rkspi_loader.img 2> /dev/null
-       dd if=${WRKSRC}/u-boot.itb seek=1024 conv=notrunc of=${WRKSRC}/rkspi_loader.img
+.endif
+       dd if=${WRKSRC}/u-boot.itb seek=${UBOOT_RK_SPI_OFF} conv=notrunc of=${WRKSRC}/rkspi_loader.img
 
-.include "../../sysutils/arm-trusted-firmware-${UBOOT_IMAGE_TYPE}/buildlink3.mk"
+BUILD_TARGET+= V=1
+
+.include "../../sysutils/${TFA}-${UBOOT_IMAGE_TYPE}/buildlink3.mk"
 .include "../../sysutils/u-boot/u-boot-arm64.mk"



Home | Main Index | Thread Index | Old Index