From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tuomas Tynkkynen Date: Mon, 9 Jan 2017 15:34:28 +0200 Subject: [U-Boot] [PATCH] rpi: Fix device tree path on ARM64 In-Reply-To: <42cac7aa-2e13-2ca8-6d1a-226e3f573883@wwwdotorg.org> References: <20170103103935.2385-1-tuomas@tuxera.com> <42cac7aa-2e13-2ca8-6d1a-226e3f573883@wwwdotorg.org> Message-ID: <20170109153428.44f6767e@duuni> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 5 Jan 2017 16:44:43 -0700 Stephen Warren wrote: > On 01/03/2017 03:39 AM, Tuomas Tynkkynen wrote: > > The directory structure of device tree files produced by the kernel's > > 'make dtbs_install' is different on ARM64, the RPi3 device tree file is > > in a 'broadcom' subdirectory there. Make the set_fdtfile function account > > for this so that the distro boot scripts can locate the DTB file. > > I'm not 100% sure there's an expectation/guarantee that "make > dtbs_install" will be used to create the DTB layout that the bootloader > uses, although I suppose this is a reasonable thing to do. > It certainly would be nice from the distro's point of view to have the same scripts work on both ARM and ARM64. > > diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c > > > static void set_fdtfile(void) > > > - fdtfile = model->fdtfile; > > + if (IS_ENABLED(CONFIG_ARM64)) > > + strcat(fdtfile, "broadcom/"); > > + strcat(fdtfile, model->fdtfile); > > Instead of writing code for this, and in particular code that doesn't > check for buffer size/overflow/..., wouldn't it be better to simply edit > the RPi 3 entry in rpi_models_new_scheme[] to contain "broadcom/" in the > DTB filename string? > I did it this way to keep the 32-bit builds looking in the old location, as that's where it was planned to be added for 32-bit ARM: https://patchwork.kernel.org/patch/9148261/ I did consider some preprocessor magic and compile-time string concatenation but this seemed a cleaner way.