From owner-freebsd-arm@freebsd.org Sun Mar 31 15:57:06 2019 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 011C815636D7 for ; Sun, 31 Mar 2019 15:57:06 +0000 (UTC) (envelope-from freebsdnewbie@freenet.de) Received: from mout0.freenet.de (mout0.freenet.de [IPv6:2001:748:100:40::2:2]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (Client CN "*.freenet.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B0E3875ED for ; Sun, 31 Mar 2019 15:57:05 +0000 (UTC) (envelope-from freebsdnewbie@freenet.de) Received: from [195.4.92.165] (helo=mjail2.freenet.de) by mout0.freenet.de with esmtpa (ID freebsdnewbie@freenet.de) (port 25) (Exim 4.90_1 #2) id 1hAcpS-0002p9-Eo for freebsd-arm@freebsd.org; Sun, 31 Mar 2019 17:57:02 +0200 Received: from [::1] (port=35824 helo=mjail2.freenet.de) by mjail2.freenet.de with esmtpa (ID freebsdnewbie@freenet.de) (Exim 4.90_1 #2) id 1hAcpS-0003tt-DF for freebsd-arm@freebsd.org; Sun, 31 Mar 2019 17:57:02 +0200 Received: from sub6.freenet.de ([195.4.92.125]:54790) by mjail2.freenet.de with esmtpa (ID freebsdnewbie@freenet.de) (Exim 4.90_1 #2) id 1hAcmt-0005Zu-6m for freebsd-arm@freebsd.org; Sun, 31 Mar 2019 17:54:23 +0200 Received: from p4ffc67a1.dip0.t-ipconnect.de ([79.252.103.161]:61107 helo=freebsd-t450.fritz.box) by sub6.freenet.de with esmtpsa (ID freebsdnewbie@freenet.de) (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256) (port 465) (Exim 4.90_1 #2) id 1hAcmt-0007fx-4e for freebsd-arm@freebsd.org; Sun, 31 Mar 2019 17:54:23 +0200 Date: Sun, 31 Mar 2019 17:54:22 +0200 From: Manuel =?ISO-8859-1?Q?St=FChn?= To: freebsd-arm@freebsd.org Subject: Re: efi-loader ignores dtb files? Message-Id: <20190331175422.8bc3cb1b654ad0c5a7c9f533@freenet.de> In-Reply-To: <20190328215048.9dccb364c7ccac59f77bb98f@freenet.de> References: <20190327192320.GA64908@freebsd-t450.fritz.box> <20190328190355.1459c85b48211905f8a3e04a@freenet.de> <20190328215048.9dccb364c7ccac59f77bb98f@freenet.de> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Originated-At: 79.252.103.161!61107 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Mar 2019 15:57:06 -0000 On Thu, 28 Mar 2019 21:50:48 +0100 Manuel St=FChn wrote: > On Thu, 28 Mar 2019 14:10:27 -0500 > Kyle Evans wrote: >=20 > > On Thu, Mar 28, 2019 at 1:30 PM Kyle Evans wrote: > > > > > > On Thu, Mar 28, 2019 at 1:06 PM Manuel St=FChn wrote: > > > > > > > > On Wed, 27 Mar 2019 14:35:26 -0500 > > > > Kyle Evans wrote: > > > [... snip ...] > > > > > I'm not sure off-hand why fdt_overlays were not recognized. I wou= ld > > > > > drop to loader prompt and double check that it actually ended up = in > > > > > the environment, but I don't see any reason off-hand that it woul= dn't. > > > > > > > > I tried to load the overlays from loader prompt by hand like this: > > > > load -t dtbo sun50i-nanopi-neo2-codec.dtbo > > > > load -t dtbo sun50i-nanopi-neo2-sid.dtbo > > > > load -t dtbo sun50i-nanopi-neo2-ths.dtbo > > > > and they got applied correctly and the corresponding devices appear= ed in the OS. > > > > > > > > As another test I did was to not load the base dtb file via loader.= conf but to use the one provided by u-boot/EFI. > > > > The output looked like this > > > > [...] > > > > Using DTB provided by EFI at 0x47ef8000. > > > > Loading DTB overlays: 'sun50i-nanopi-neo2-codec.dtbo,sun50i-nanopi-= neo2-sid,sun50i-nanopi-neo2-ths.dtbo' > > > > /boot/dtb/overlays/sun50i-nanopi-neo2-codec.dtbo size=3D0x11a > > > > /boot/dtb/overlays/sun50i-nanopi-neo2-sid.dtbo size=3D0x1f5 > > > > /boot/dtb/overlays/sun50i-nanopi-neo2-ths.dtbo size=3D0x3c5 > > > > applying DTB overlay '/boot/dtb/overlays/sun50i-nanopi-neo2-codec.d= tbo' > > > > applying DTB overlay '/boot/dtb/overlays/sun50i-nanopi-neo2-sid.dtb= o' > > > > applying DTB overlay '/boot/dtb/overlays/sun50i-nanopi-neo2-ths.dtb= o' > > > > failed to apply overlay: FDT_ERR_NOTFOUND > > > > [...] > > > > In this case the overlays were found and loaded, but did most likel= y not match the u-boot dtb file. > > > > > > > > Is there an issue with loading overlays in conjunction with manuall= y loading dtb files via loader.conf? > > > > > > > > > > Yes, I see a problem -- try something like [0] (not even compile > > > tested, but it should work). I'll start working out a more proper > > > solution. > >=20 > > I've devised a solution that's a little less hacky at [1]. It > > separates out the loading of overlays from platform_load_dtb into its > > own platform_load_overlays. I've left it as a platform-specific thing > > instead of lifting it into the common fdt bits for two reasons: > >=20 > > 1.) We still technically support setting fdt_overlays in the U-Boot > > environment and honoring that, and > > 2.) Not all FDT platforms support overlays as they've not been tested, > > so it's probably best to nop it there for now just in case... > >=20 > > If we're ok with dropping #1 (probably not even used, but we don't > > have a way of measuring usage there) and OK with adding untested > > overlay support to powerpc/{ofw,kboot} then this diff drops > > dramatically and the calls to fdt_platform_load_overlays get replaced > > with fdt_load_dtb_overlays calls.boot/loader_lua.efi > >=20 > > > [0] https://people.freebsd.org/~kevans/overlay-hack.diff > >=20 > > [1] http://people.freebsd.org/~kevans/overlay-lesshack.diff >=20 > Thank you for your patches. I've been trying patch[1] but unfortunately > it seems to not work for me.=20 The patch[1] _does_ work, actually. I only had to realize that the loader-files in /boot seem not being involved in booting the system. After updating /EFI/BOOT/bootaa64.efi with the patched version of boot/loader_lua.efi all the overlays were applied correctly. > Due to my lack of knowledge on how to only > build and install /usr/src/stand=20 Only for the records: how to cross-build and install only /usr/src/stand:=20 % export TARGET=3Darm64 % export TARGET_ARCH=3Daarch64 % export DESTDIR=3D/path/to/install % cd /usr/src/ % make buildenv % cd /usr/src/stand % make && make install > I've built+installed both > kernel+world, but the described behavior did not change; still no > overlays when defining a dtb file in loader.conf. --=20 Manuel