From nobody Sun Apr 17 11:41:07 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7C3FFCFA920 for ; Sun, 17 Apr 2022 11:41:19 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic311-23.consmr.mail.gq1.yahoo.com (sonic311-23.consmr.mail.gq1.yahoo.com [98.137.65.204]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kh7SG3RtXz3D9t for ; Sun, 17 Apr 2022 11:41:18 +0000 (UTC) (envelope-from marklmi@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1650195671; bh=ATxhoqN69VVQ4VctrJg3/Hw5aIQdygLGzw8dsR5uCHM=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=DtuF6rIVGbvG2ktXT1cv7Y8yKxDw1qE5fRC+ehDt8uPuUJxtgI/gf8EYHFLW7aLSfs0te/RCM50ntVmeQCAbM0et/Lj+sYaAoYc0MrIou0p5nkMqNJBblXi7T22Bj8AntBXzvx7iWkcv3xK/qcpxBAIWgU4VWbohXlbks3iaj3YVF5/+7xoH0D6KDxRR1aLfneJuxE90eTJxe9gE31slfyATSqrCFnCHVoF7q3mWq324qBfyf2cXsNSvwSUcQBm/dwj2acF81xbdQYyKY4CGuX5rwifSVdh6vF+j10zI1XKiqCJXHxXJ4u8WKlRqhhgDgsMpNCa/xnPiaVnfkAJymg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1650195671; bh=B33DqZLP++oIyYK2jxoDLS9krUAdnWYpRTXAi4U+tRi=; h=X-Sonic-MF:From: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gJG19nKtP8xgpQBmYzcjHg 7B4hyktvEY2uGxKjhnQjYroqIhbl.z.mz7Ne8mYIlRVGkh3iiy7BfJ0AN.l9ktolLVCMzG6YT5oL mbRei5KE1CfaWOaldB5TSGlm6_3xQUEVNVJfBX4cV21S7OAouaDOEp23.nzUWZfw5IQUzE2pkjll D6Ec7f6bmDkREfcTBECl.vlfjMmuKa2k0xDiO21WfdOrj..3thWIouvCVlrx3QHRX4rwAjY2sDer gyEuVK8vpgfos_72bTUNLDoK4dpCsQ27ksko7A8s7suQuXxFkJ7FIeUciMqffvXBHx8BJhLelKUD 3SR2Q1eX9mlk0syeWwIiVBYpkSmOVZ5bMALbaz1.W1spviDPl9Q9k6cQ.g2UvE1Jp76lm2S2BZ9U mnhB77tnoPmfViWmNG6N3zGbNgcgC8f9imEyGVTg3tFlMzW07aSRd4qMDxDluEIKbKc5F8cKqO1P rMCrk8sit.NFSWJgY7Us7cGNuKz1YpCwYUbDvgo8mEa4zfCQ.XjiHSczdtF624mw8DUB_V_3o9Q- - X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.gq1.yahoo.com with HTTP; Sun, 17 Apr 2022 11:41:11 +0000 Received: by hermes--canary-production-gq1-665697845d-ftzwk (VZM Hermes SMTP Server) with ESMTPA ID 881da988dfe6eeb042830fa86b88812a; Sun, 17 Apr 2022 11:41:08 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: A FreeBSD port to build a RPI_EFI.fd matching https://github.com/pftf/RPi4 versioning? Message-Id: Date: Sun, 17 Apr 2022 04:41:07 -0700 To: Free BSD X-Mailer: Apple Mail (2.3654.120.0.1.13) References: X-Rspamd-Queue-Id: 4Kh7SG3RtXz3D9t X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=DtuF6rIV; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.65.204 as permitted sender) smtp.mailfrom=marklmi@yahoo.com X-Spamd-Result: default: False [-0.50 / 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(-1.00)[-1.000]; 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]; SUBJECT_ENDS_QUESTION(1.00)[]; ARC_NA(0.00)[]; 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.000]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.204:from]; MLMMJ_DEST(0.00)[freebsd-arm]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.65.204:from]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N One of the things about the sysutils/edk2@rpi4 port flavor is that it does not build the same tested/in-use releases as the project that develops the EDK2 support for the RPi4: different commits are used. I wonder if it would be worthwhile to have a port that has the purpose of building what matches some https://github.com/pftf/RPi4 release. So I tried to make a variant of sysutils/edk2 that does build such. (I'm new to creating a port, even as a textually minor variation of another one.) Part of the prompt for this is OpenBSD has taken the route of: QUOTE of https://www.openbsd.org/arm64.html : Some Raspberry Pi models that do not work with the included U-Boot (e.g. Raspberry Pi 400) can instead be booted using EDK2-based UEFI firmware. END QUOTE (Where the link in that text is to: https://github.com/pftf/RPi4 .) I suspect such may well be true of the RPi4B C0T parts that do not have the odd size limitations, such as a 3 GiBytes limitation. As for https://github.com/pftf/RPi4 vs. tianocore . . . All https://github.com/pftf/RPi4 really does is hold a git repository that has the https://github.com/tianocore/edk2* and such needed as submodules --plus having a patch or two. (I ignore .github/workflows material here.) I made a variant of sysutils/edk2 that only targets allowing tracking of what https://github.com/pftf/RPi4 uses from tianocore (and what that in turn uses). For now, I used the example of matching v1.33 for https://github.com/pftf/RPi4 (the most recent release). The core of it is: PORTNAME=3D edk2-pftf-rpi4 DISTVERSIONPREFIX=3D v DISTVERSION=3D 1.33 CATEGORIES=3D sysutils . . . COMMENT=3D EDK2 Firmware matching a github.com/pftf/RPi4 version # Tags for tianocore submodules needed. (Note: pftf/RPi3 does not # match pftf/RPi4 .) Same tags as git submodule status reports for # manually following the pftf/RPi4 steps. # Also later true of GH_TAGNAME for edk2. PLATFORM_TAG=3D 958fc02b15 NONOSI_TAG=3D 0320db9 # Tags for non-tianocore submodules used by tianocore for the # pftf/RPi4 build. BROTLI_TAG has a 2nd use, handled via the # post-extract make target. (Some submodules are not listed # because they are unused for pftf/RPi4 .) Note: pftf/RPi3 # does not match pftf/RPI4 . OPENSSL_TAG=3D OpenSSL_1_1_1j SOFTFLOAT_TAG=3D b64af41 ONIGURUMA_TAG=3D v6.9.4_mark1 BROTLI_TAG=3D v1.0.9-36-gf4153a0 # Note: git submodule status showed v1.0.9-35-gf4153a0 but that # failed here and when I counted I got 36. So I tried 36 --and it # worked. One oddity that I ran into is a known problem for FreeBSD's /lib/libgcc_s.so.1 vs. aarch64 g++ code generation. I documented that with: USE_GCC=3D 11:build # Note: # I needed to use a -Wl,-rpath=3D/usr/local/lib/gcc* to work around # FreeBSD's /lib/libgcc_s.so.1 having incomplete/inaccurate # coverage for aarch64 g++ code generation's use of libgcc_s.so.1 . # Otherwise tools built, such as VfrCompile, get the following # when run: "ld-elf.so.1: /lib/libgcc_s.so.1: version GCC_4.5.0 # required by /usr/local/lib/gcc11/libstdc++.so.6 not found". # I did not see a supported way to have an automatically # adjusting -Wl,-rpath=3D/usr/local/lib/gcc* . . . . # Avoid: "ld-elf.so.1: /lib/libgcc_s.so.1: version GCC_4.5.0 # required by /usr/local/lib/gcc11/libstdc++.so.6 not found" # (that is from /lib/libgcc_s.so.1 having incomplete/inaccurate # coverage for aarch64 g++ code generation's use of libgcc_s.so.1 ): EXTRA_LDFLAGS+=3D -Wl,-rpath=3D${LOCALBASE}/lib/gcc11 . . . # Emulate source edk2/edksetup.sh MAKE_ENV+=3D WORKSPACE=3D${WRKDIR} \ = PACKAGES_PATH=3D${WRKDIR}/edk2-${GH_TAGNAME}:${WRKDIR}/edk2-platforms-${PL= ATFORM_TAG}:${WRKDIR}/edk2-non-osi-${NONOSI_TAG} \ CONF_PATH=3D${WRKDIR}/edk2-${GH_TAGNAME}/Conf \ EDK_TOOLS_PATH=3D${WRKDIR}/edk2-${GH_TAGNAME}/BaseTools = \ = PATH=3D${WRKDIR}/edk2-${GH_TAGNAME}/BaseTools/BinWrappers/PosixLike:${PATH= } \ PYTHON_COMMAND=3Dpython3 \ PYTHONHASHSEED=3D1 \ EXTRA_LDFLAGS=3D${EXTRA_LDFLAGS} I kept the original patch file names. One I could list in EXTRA_PATCHES and the other was used via post-patch: # Using same patch file names as pftf/RPi4 : EXTRA_PATCHES=3D = ${FILESDIR}/0001-MdeModulePkg-UefiBootManagerLib-Signal-ReadyToBoot-o.patc= h:-p1 . . . # Using same patch file names as pftf/RPi4 : post-patch: ${PATCH} -d ${WRKDIR}/edk2-platforms-${PLATFORM_TAG} -p1 -s < = ${FILESDIR}/0002-Check-for-Boot-Discovery-Policy-change.patch pkg-descr and distinfo were updated as well. poudriere testport seemed to be happy with things. portlint only complains about the limitation to exactly gcc11 (or whatever is listed there). But I've not actually tested the image built (yet?). Note that, unlike sysutils/edk2@rpi4 , the port does build to completion. (sysutils/edk2@FLAVOR builds have been failing for a very long time for versions of gcc that handle C's newer VLA notation correctly (Variable Length Array). This is because brotli violated the C language definition but gcc10 and before ignored the issue. (Otherwise the other things likely would have also been broken.) But, even when it built, I avoided the mix of versions that no development team was testing for the platform(s) of interest to me.) So I got far enough along to ask: does a port for this purpose seem worthwhile? I'll note that FreeBSD still has no ACPI drivers supporting the use of the RPi4B's: A) built-in microsd card slot B) built-in EtherNet port I use USB devices for such when using https://github.com/pftf/RPi4 . It is possible that I'll get access to a RPi4B with a C0T part (no odd size limitations) that is also Rev 1.5 (new PMIC) instead of Rev 1.4 . So I may end up able to test booting and operation of an example of such. =3D=3D=3D Mark Millard marklmi at yahoo.com