From owner-freebsd-arm@freebsd.org Sat Oct 17 01:27:27 2020 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5E3D445395 for ; Sat, 17 Oct 2020 01:27:27 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic307-8.consmr.mail.gq1.yahoo.com (sonic307-8.consmr.mail.gq1.yahoo.com [98.137.64.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CClkQ2PMhz4RQK for ; Sat, 17 Oct 2020 01:27:25 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: i8SmqLIVM1mvZEkHl9VCcvSgOk6IR96ZYhasCVU6Vq4iLSRw9uQL6cXSa2su.3y Ps1KvaAtljbvd8U8gwv6XP5lIDGC7BUyF3VehU9k_bn7kqmlnbIPjeBCZX6pupHMoBkPGO3a9SHK .IxO3nhf7vDxQGWIu7OTTmZ21giH1oV6EuifelULk9.bM9qD2TYtkbVKVdEaHAzOVWhlHih5qtfJ 1P0.YgWzCHg2whHgwZ..O4M0wEOyG8nlK.i0VzBgr3R4lQATTdAwVWN_PiW4h1TAPeK.4SZ76XR. MnQl8JVBNL0ifElyYIu.qBa9.oxWlp9M6WKzULQ4.2d5.9pwH9ioUKZfzmTOYInA1GKLCcMi41rx U39Rl7GJuuUwFTkIuQI2hmDUXNa0wHn54U5JUtY52MgAFL2Mfh0IQOSn2QTfwFLVIJhKpGrmQPlI VZmT0R98lacn9MakOMfQiOgpcaGbjsZkrP8O3Lgh3N4BIMrtd6jdSXoXNbZpeOwVMSQYtMLb9iGY VgcMZIdjQevJXIsrmWP1QlO5uJF41dtAd0_z0W4_raKF5FXOL4oSGk6Iw7bNzRaXwa_rroeJ._SE 8rlvHM13hjv1QrQ8YTy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+0000 Received: by smtp418.mail.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID af5ee3ae2b18dd27b4424a6f28fd6c19; Sat, 17 Oct 2020 01:27:21 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Experience report: u-boot update 2020.07 -> 2020.10 seems to go fairly well on the few u-boots that I've tested Message-Id: Date: Fri, 16 Oct 2020 18:27:21 -0700 To: freebsd-arm X-Mailer: Apple Mail (2.3608.120.23.2.1) References: X-Rspamd-Queue-Id: 4CClkQ2PMhz4RQK X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.01 / 15.00]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-0.51)[-0.514]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.990]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.002]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[98.137.64.32:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.64.32:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-arm] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 01:27:27 -0000 I've built (via poudriere), installed, and booted the following upgrades (ones that I've working hardware for): u-boot-orangepi-plus-2e: 2020.07 -> 2020.10 u-boot-rock64: 2020.07 -> 2020.10 u-boot-rpi2: 2020.07 -> 2020.10 u-boot-rpi3: 2020.07 -> 2020.10 u-boot-rpi4: 2020.07 -> 2020.10 The rpi*'s were for experiments with using modern firmware (and eeprom content for the rpi4). Initial problems turned out to be RPi* firmware problems, instead of u-boot or armstub8*.bin problems. One issue for the RPi3 and RPi4 is that FreeBSD ended up with no /dev/mmcsd*'s. But this may well be rpi .dtb files or fdt output from the firmware needing to be tracked --instead of being a u-boot issue. Like before 2020.10, u-boot does not yet deal with 8 GiByte RPi4B's xHCI/USB. I'd not count this against any potential u-boot vintage upgrade. All my testing is from/for a head -r365932 context. I've built the following upgrades but the hardware for using them bit the dust some time ago or is now very flaky/unreliable to use: u-boot-pine64: 2020.07 -> 2020.10 u-boot-sinovoip-bpi-m3: 2020.07 -> 2020.10 The updates above are all based on: # svnlite status /usr/ports/sysutils/ M /usr/ports/sysutils/u-boot-master/Makefile M /usr/ports/sysutils/u-boot-master/distinfo M /usr/ports/sysutils/u-boot-pine64/Makefile ? = /usr/ports/sysutils/u-boot-rpi3/files/patch-board__raspberrypi__rpi__lowle= vel_init.S ? = /usr/ports/sysutils/u-boot-rpi3/files/patch-board__raspberrypi__rpi__rpi.c= ? = /usr/ports/sysutils/u-boot-rpi4/files/patch-board__raspberrypi__rpi__lowle= vel_init.S ? = /usr/ports/sysutils/u-boot-rpi4/files/patch-board__raspberrypi__rpi__rpi.c= M /usr/ports/sysutils/u-boot-tools/Makefile M /usr/ports/sysutils/u-boot-tools/distinfo One possible oddity in the below is that I added u-boot (the ELF file) to UBOOT_PLIST_RPI in order to have a file that my normal tools could look at easily. Either (A) that change should be removed or (B) having the ELF file installed for that purpose should be done more generally. Something to consider. The pine64 change just avoids a race during its build activity: adding MAKE_JOBS_UNSAFE=3Dyes . (This has been in my environment for a long time.) I will note that the ports activity is against head -r544650. I've not updated the port trees in some time but the ports involved do not change often. # svnlite diff /usr/ports/sysutils/u-boot-tools/ Index: /usr/ports/sysutils/u-boot-tools/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /usr/ports/sysutils/u-boot-tools/Makefile (revision 544650) +++ /usr/ports/sysutils/u-boot-tools/Makefile (working copy) @@ -2,7 +2,7 @@ # $FreeBSD$ =20 PORTNAME=3D u-boot-tools -DISTVERSION=3D 2020.07 +DISTVERSION=3D 2020.10 CATEGORIES=3D sysutils MASTER_SITES=3D ftp://ftp.denx.de/pub/u-boot/ DISTNAME=3D u-boot-${PORTVERSION} Index: /usr/ports/sysutils/u-boot-tools/distinfo =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /usr/ports/sysutils/u-boot-tools/distinfo (revision 544650) +++ /usr/ports/sysutils/u-boot-tools/distinfo (working copy) @@ -1,3 +1,3 @@ -TIMESTAMP =3D 1594115686 -SHA256 (u-boot-2020.07.tar.bz2) =3D = c1f5bf9ee6bb6e648edbf19ce2ca9452f614b08a9f886f1a566aa42e8cf05f6a -SIZE (u-boot-2020.07.tar.bz2) =3D 15338841 +TIMESTAMP =3D 1602203101 +SHA256 (u-boot-2020.10.tar.bz2) =3D = 0d481bbdc05c0ee74908ec2f56a6daa53166cc6a78a0e4fac2ac5d025770a622 +SIZE (u-boot-2020.10.tar.bz2) =3D 15784894 # svnlite diff /usr/ports/sysutils/u-boot-master/ Index: /usr/ports/sysutils/u-boot-master/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /usr/ports/sysutils/u-boot-master/Makefile (revision 544650) +++ /usr/ports/sysutils/u-boot-master/Makefile (working copy) @@ -79,7 +79,7 @@ UBOOT_MOVE_ZYNQ_7000=3D${WRKSRC}/spl/boot.bin ${.CURDIR}/files/uEnv.txt =20 # Overrides for RPI family -UBOOT_PLIST_RPI=3D u-boot.bin +UBOOT_PLIST_RPI=3D u-boot.bin u-boot UBOOT_METADATA_RPI_FILES=3D ${UBOOT_PLIST_RPI} UBOOT_METADATA_RPI_METHOD=3D file =20 @@ -111,7 +111,7 @@ .if !defined(UBOOT_VERSION) && defined(UBOOT_VERSION_${FAMILY:tu}) UBOOT_VERSION=3D${UBOOT_VERSION_${FAMILY:tu}} .endif -UBOOT_VERSION?=3D 2020.07 +UBOOT_VERSION?=3D 2020.10 =20 # If a slave port defines a PORTREVISION use it .if defined(U_BOOT_SLAVE_PORTREVISION_${UBOOT_VERSION}) Index: /usr/ports/sysutils/u-boot-master/distinfo =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /usr/ports/sysutils/u-boot-master/distinfo (revision 544650) +++ /usr/ports/sysutils/u-boot-master/distinfo (working copy) @@ -1,13 +1,5 @@ -TIMESTAMP =3D 1594110266 -SHA256 (u-boot/u-boot-2020.07.tar.bz2) =3D = c1f5bf9ee6bb6e648edbf19ce2ca9452f614b08a9f886f1a566aa42e8cf05f6a -SIZE (u-boot/u-boot-2020.07.tar.bz2) =3D 15338841 +TIMESTAMP =3D 1602204297 +SHA256 (u-boot/u-boot-2020.10.tar.bz2) =3D = 0d481bbdc05c0ee74908ec2f56a6daa53166cc6a78a0e4fac2ac5d025770a622 +SIZE (u-boot/u-boot-2020.10.tar.bz2) =3D 15784894 SHA256 (u-boot/939129/raw) =3D = 2a4ebf283aec8e74ec77b3cb071c6883f73807454ca94fea78361c7391187b97 SIZE (u-boot/939129/raw) =3D 310 -SHA256 (u-boot/1036621/raw) =3D = 28dbd66d14fab9dc782ce091d3c132a226b8425f6503c329ee8a7031b79b52f7 -SIZE (u-boot/1036621/raw) =3D 480 -SHA256 (u-boot/1173473/raw) =3D = 4f182d6f99b1d868237607200d64a1d8a2d57ea44fc25ca49bce929ad6457228 -SIZE (u-boot/1173473/raw) =3D 433 -SHA256 (u-boot/1172554/raw) =3D = d1a39d7d6487cfb481392e7ea4f0bf0d209c08e0c3426c29d7eeaeb9b806cf42 -SIZE (u-boot/1172554/raw) =3D 640 -SHA256 (u-boot/1172555/raw) =3D = 09d17a62fb6bc7c7ab73bfc7061fc5da2b5a32e7deb098c9f76aed8ff8991751 -SIZE (u-boot/1172555/raw) =3D 568 # svnlite diff /usr/ports/sysutils/u-boot-pine64/ Index: /usr/ports/sysutils/u-boot-pine64/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /usr/ports/sysutils/u-boot-pine64/Makefile (revision 544650) +++ /usr/ports/sysutils/u-boot-pine64/Makefile (working copy) @@ -6,4 +6,6 @@ BOARD_CONFIG=3D pine64_plus_defconfig FAMILY=3D allwinner64 =20 +MAKE_JOBS_UNSAFE=3Dyes + .include "${MASTERDIR}/Makefile" The RPi3 and RPi4 patches are for handling extra behavior of the armstub8.bin and armstub8-gic.bin : having u-boot explicitly avoid using some associated memory. So far as I know this goes beyond what upstream expects and would require upstream to update interface definitions before they would accept even similar code. The content is the same for the RPi3 and RPi4, despite the duplications as I've done things in my environment. # more = /usr/ports/sysutils/u-boot-rpi3/files/patch-board__raspberrypi__rpi__lowle= vel_init.S --- board/raspberrypi/rpi/lowlevel_init.S.orig 2020-10-05 = 08:15:32.000000000 -0700 +++ board/raspberrypi/rpi/lowlevel_init.S 2020-10-13 = 11:33:39.273950000 -0700 @@ -18,9 +18,22 @@ #ifdef CONFIG_ARM64 adr x8, fw_dtb_pointer str x0, [x8] +#if defined(CONFIG_EFI_LOADER) + /* Setup to allow reserving the stack and such that is */ + /* after the likes of FreeBSD armstub8-gic.bin in RAM. */ + adr x8, armstub_rsrvd + str x1, [x8] +#endif #else ldr r8, =3Dfw_dtb_pointer str r2, [r8] +#if defined(CONFIG_EFI_LOADER) +#error "Before aarch64 does not use armstub*.bin files" + /* Setup to allow reserving the stack and such that is */ + /* after the likes of a armstub*.bin in RAM. */ + ldr r8, =3Darmstub_rsrvd + str r3, [r8] +#endif #endif =20 /* Returns */ (After the #error, I choose to show what the code would be like if later put to use. It is another thing an actual update might want to omit.) # more = /usr/ports/sysutils/u-boot-rpi4/files/patch-board__raspberrypi__rpi__lowle= vel_init.S --- board/raspberrypi/rpi/lowlevel_init.S.orig 2020-10-05 = 08:15:32.000000000 -0700 +++ board/raspberrypi/rpi/lowlevel_init.S 2020-10-13 = 11:33:39.273950000 -0700 @@ -18,9 +18,22 @@ #ifdef CONFIG_ARM64 adr x8, fw_dtb_pointer str x0, [x8] +#if defined(CONFIG_EFI_LOADER) + /* Setup to allow reserving the stack and such that is */ + /* after the likes of FreeBSD armstub8-gic.bin in RAM. */ + adr x8, armstub_rsrvd + str x1, [x8] +#endif #else ldr r8, =3Dfw_dtb_pointer str r2, [r8] +#if defined(CONFIG_EFI_LOADER) +#error "Before aarch64 does not use armstub*.bin files" + /* Setup to allow reserving the stack and such that is */ + /* after the likes of a armstub*.bin in RAM. */ + ldr r8, =3Darmstub_rsrvd + str r3, [r8] +#endif #endif =20 /* Returns */ # more = /usr/ports/sysutils/u-boot-rpi3/files/patch-board__raspberrypi__rpi__rpi.c= --- board/raspberrypi/rpi/rpi.c.orig 2020-10-05 08:15:32.000000000 = -0700 +++ board/raspberrypi/rpi/rpi.c 2020-10-13 11:02:15.582706000 -0700 @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -33,6 +34,7 @@ * does not get cleared later. */ unsigned long __section(".data") fw_dtb_pointer; +unsigned long __section(".data") armstub_rsrvd; =20 /* TODO(sjg@chromium.org): Move these to the msg.c file */ struct msg_get_arm_mem { @@ -494,4 +496,29 @@ #endif =20 return 0; +} + +void board_lmb_reserve(struct lmb *lmb) +{ +#ifdef CONFIG_EFI_LOADER + /* + * NOTE: lmb_reserve (and more) does not deal with overlaps with + * pre-existing reservations. + * But board_lmb_reserve is called before the original + * first-page is added. So use knowledge of what will = happen + * later to avoid overlaps. + */ + + phys_addr_t base =3D 0x0u; + phys_addr_t size =3D CONFIG_RPI_EFI_NR_SPIN_PAGES << = EFI_PAGE_SHIFT; + if (size < armstub_rsrvd) size =3D armstub_rsrvd; + + if (size <=3D EFI_PAGE_SIZE) return; + + /* Avoid future overlap */ + base +=3D EFI_PAGE_SIZE; + size -=3D EFI_PAGE_SIZE; + + lmb_reserve(lmb, base, size); +#endif } # more = /usr/ports/sysutils/u-boot-rpi4/files/patch-board__raspberrypi__rpi__rpi.c= --- board/raspberrypi/rpi/rpi.c.orig 2020-10-05 08:15:32.000000000 = -0700 +++ board/raspberrypi/rpi/rpi.c 2020-10-13 11:02:15.582706000 -0700 @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -33,6 +34,7 @@ * does not get cleared later. */ unsigned long __section(".data") fw_dtb_pointer; +unsigned long __section(".data") armstub_rsrvd; =20 /* TODO(sjg@chromium.org): Move these to the msg.c file */ struct msg_get_arm_mem { @@ -494,4 +496,29 @@ #endif =20 return 0; +} + +void board_lmb_reserve(struct lmb *lmb) +{ +#ifdef CONFIG_EFI_LOADER + /* + * NOTE: lmb_reserve (and more) does not deal with overlaps with + * pre-existing reservations. + * But board_lmb_reserve is called before the original + * first-page is added. So use knowledge of what will = happen + * later to avoid overlaps. + */ + + phys_addr_t base =3D 0x0u; + phys_addr_t size =3D CONFIG_RPI_EFI_NR_SPIN_PAGES << = EFI_PAGE_SHIFT; + if (size < armstub_rsrvd) size =3D armstub_rsrvd; + + if (size <=3D EFI_PAGE_SIZE) return; + + /* Avoid future overlap */ + base +=3D EFI_PAGE_SIZE; + size -=3D EFI_PAGE_SIZE; + + lmb_reserve(lmb, base, size); +#endif } =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)