From nobody Sun Apr 17 17:28:42 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 556B25D3240 for ; Sun, 17 Apr 2022 17:28:56 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic315-54.consmr.mail.gq1.yahoo.com (sonic315-54.consmr.mail.gq1.yahoo.com [98.137.65.30]) (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 4KhH9M2pkTz4f5G for ; Sun, 17 Apr 2022 17:28:55 +0000 (UTC) (envelope-from marklmi@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1650216528; bh=oooY1uAaB0Ip8a5a3UXJScnKN9pY37wf0ikbFA2I5kc=; h=From:Subject:Date:References:To:In-Reply-To:From:Subject:Reply-To; b=CFcEsrG5uVJgpdmxAGxtJWWMccJO7qxxVBg6QXU7qFdhevExfwnwZf/xApn4hKVD8Quu0xxU7X1gHQjW8YL8/GvXTw4cPhLLcx9NZbIcPV/BJpeqcGWiqgcbLx8YiqFl6cgz31sZveMLJmIe//3a911QihkVAbrRCwF6wUMGdwYBBSDA3nZ7jUtqdRFc40Vy87CKDsQ2ka/kJvN1cb88LCBDnkkFKzc1bJw/c0wkr2sXln1dfFZg7OH7EKcjeDBRuaV8Jgzoks4tZ73tcrgzNEfm808aInOTRr2ZSifUVdQIMplQSsFWR4sj1wsN9klFlqIQfDY/TDjEjLKZCJJsDA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1650216528; bh=0OEvXvhYFuHtweH7UfmKgyp1IKgFLKWyKSXJe2eEqrs=; h=X-Sonic-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z_ikotKUhV71BDmk0Eg4Mje6TafwOxPdgtbywunu1xYf0Y9ZhcC5Ye SWJQPpAgCAvposwxqLp564a4uLBryXENVl4QYA1xx3W4CbjrOUsMyM.g.khRKhDE1caUOWA37WWZ zzZmZDZ.boxJw9yD9CVlrgT0XlqyZKIQ2MqAfGVW_pr_ZtmAi9y7eN7DqiPMDEQTJnBUPckbKkkj lBFZCb.CN04jPb4E5tpjB_PaIDAF1DODznnySj_KZSlbv9WIjhvBl9k7WFhTtZmi5mQ4sBADhxAV O9lHPVvl.esUw_7.AHj2GF0fmmR.G2xFz7Rmc8l7dHf.g30dtJtVhwL2Txn2_NAayftCK8x1D3NV DUWK.NzdFJtlJ7Ww.9XBAqpRFLUIQjyTJH8P_O26E0wE2DAd4Wkx7XE_Jto8lFD7MrCjUqnW6MVc aNstDOuhcndsToaDay7V6JLFDHYiUQP8u6tXrbvZzzRB2J9EDvSu2EfdK6McpgHdIu80IvF__hua gpC1JcupprpeCanlTz02DrPufgbZ39Jo2zJvCXhtu0FOvwtqRtBLq_Z0uTWF55gBk2qC8ZBA- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Sun, 17 Apr 2022 17:28:48 +0000 Received: by hermes--canary-production-ne1-c7c4f6977-qcc8c (VZM Hermes SMTP Server) with ESMTPA ID c20d29c1388adb58255adc8e949b169b; Sun, 17 Apr 2022 17:28:44 +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: Re: A FreeBSD port to build a RPI_EFI.fd matching https://github.com/pftf/RPi4 versioning? Date: Sun, 17 Apr 2022 10:28:42 -0700 References: To: Free BSD In-Reply-To: Message-Id: <4B03F462-5C34-4B36-9075-586CFE59037C@yahoo.com> X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4KhH9M2pkTz4f5G X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=CFcEsrG5; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.65.30 as permitted sender) smtp.mailfrom=marklmi@yahoo.com X-Spamd-Result: default: False [1.40 / 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]; 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_SHORT(0.90)[0.898]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.30:from]; MLMMJ_DEST(0.00)[freebsd-arm]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.65.30:from]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N On 2022-Apr-17, at 04:41, Mark Millard wrote: > 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. >=20 > 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.) >=20 > Part of the prompt for this is OpenBSD has taken the route of: >=20 > 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 >=20 > (Where the link in that text is to: https://github.com/pftf/RPi4 .) >=20 > 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. >=20 > As for https://github.com/pftf/RPi4 vs. tianocore . . . >=20 > 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.) >=20 > 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). >=20 > The core of it is: >=20 > 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 >=20 > # 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 >=20 > # 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. >=20 > 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: >=20 > 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} >=20 > I kept the original patch file names. One I could list in > EXTRA_PATCHES and the other was used via post-patch: >=20 > # 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 >=20 > pkg-descr and distinfo were updated as well. >=20 > poudriere testport seemed to be happy with things. > portlint only complains about the limitation to > exactly gcc11 (or whatever is listed there). >=20 > 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.) >=20 > So I got far enough along to ask: does a port for this > purpose seem worthwhile? >=20 > I'll note that FreeBSD still has no ACPI drivers > supporting the use of the RPi4B's: >=20 > A) built-in microsd card slot > B) built-in EtherNet port >=20 > I use USB devices for such when using > https://github.com/pftf/RPi4 . >=20 > 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. >=20 I should have noted that I've not done anything (yet?) about getting a copy of the RPi* firmware that https://github.com/pftf/RPi4 bundles in a release (v1.33 here). As stands, it is only the EDK2's RPI_EFI.fd that is provided. Part of what https://github.com/pftf/RPi4 provides is that they develop a working combination and update when problems are discovered, such a reverting to older RPi* firmware. =3D=3D=3D Mark Millard marklmi at yahoo.com