From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tuomas Tynkkynen Date: Thu, 18 Oct 2018 01:25:03 +0300 Subject: [U-Boot] [PATCH 2/2] ARM: qemu-arm: define fdt_addr_r In-Reply-To: References: <20181012050757.6925-1-takahiro.akashi@linaro.org> <20181012050757.6925-2-takahiro.akashi@linaro.org> <20181015040106.78c6f7a2@thinkpad> <20181015051417.GB32578@linaro.org> Message-ID: <20181018012503.736bd2bb@thinkpad> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Alexander, On Tue, 16 Oct 2018 15:04:26 +0200 Alexander Graf wrote: ... > > > >> Glancing at cmd/pxe.c, > >> there is a problem though, in that if ${fdt_addr_r} were defined, > >> a PXE file using the FDTDIR directive would attempt loading a dtb > >> file named "-qemu-arm.dtb" instead of falling back to using > >> ${fdt_addr}. That bug would need to be fixed first before applying > >> this patch. > > Well, and that load will fail and everyone's happy, no? No, because currently if DTB loading from the filesystem/tftp is attempted and it fails, it aborts the boot. It doesn't matter if it's via a 'FDT' or 'FDTDIR' directive. In the case of typical hardware that's probably the desired behaviour. I guess the qemu_arm + FDTDIR case can be fixed by not attempting a .dtb load if the default fdtfile is not known due to $soc or $board being unset. At least I doubt that some other board could be relying on a filename containing literally "" :) > IMHO we should > fall back to $fdtcontroladdr always FWIW, to me the idea of passing $fdtcontroladdr to the OS has always filled me with dread. On top of the usual backwards- and forwards-compatibility problems that happen when mixing and matching kernels and DTBs from different releases, you now have to deal with issues like U-Boot specific .dts that are majorly diverged from Linux ones, or where the .dts is otherwise from Linux but the U-Boot specific additions break it for Linux, or where the .dts used is wrong for the specific hardware revision but close enough for U-Boot's purposes, and so on... - Tuomas