From patchwork Fri Dec 22 17:51:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dan@telent.net X-Patchwork-Id: 13503673 Received: from mail.telent.net (myhtic.telent.net [176.126.240.165]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A03DC2C199 for ; Fri, 22 Dec 2023 17:52:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=telent.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=telent.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=telent.net header.i=@telent.net header.b="MQYlCEY3" Received: from noetbook (2.f.e.a.9.3.6.2.7.b.f.3.1.0.c.4.e.d.0.4.a.3.e.d.0.b.8.0.1.0.0.2.ip6.arpa [IPv6:2001:8b0:de3a:40de:4c01:3fb7:2639:aef2]) by mail.telent.net (Postfix) with ESMTPSA id 420C11098E5 for ; Fri, 22 Dec 2023 17:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=telent.net; s=mail; t=1703267518; bh=Y6bzkN4ddIpwkYWRV27NQpN74wlMBUdX0BC2imLr0m4=; h=From:To:Subject:Date; b=MQYlCEY3b8QeA/+Z9vIM0xXm4aq/1Ro/k24JijVsMOsokQWiz8TDstU+OlnKq5BjS tqX5VdncKhr0ZuPdI1IRmHJAluJcgRbgj+UWG/L68SwCsKYgstLIExtvE/yHDvMrkS CjLX6mlckqGjKVaQa7dmjBw3yKABcFYp2CfDBYvs= From: dan@telent.net To: linux-mips@vger.kernel.org Subject: question: malta doesn't use a1 for fdt from bootloader Date: Fri, 22 Dec 2023 17:51:53 +0000 Message-ID: <87plyyrupy.fsf@telent.net> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Newbie question: I noticed while writing some test automation with QEMU and U-Boot that the Malta kernel appears to ignore any DTB provided by the bootloader, in favour of using the one embedded into the kernel image. Is there a reason behind this, or is it just not a thing that's been changed since the board was converted to use device tree? I patched my own kernel to check $a1 as the "mips generic" kernel does, and it seems to work, but maybe I'm missing something? I did have to rebuild U-Boot with different CONFIG options to make use of it (I don't khow what real hardware Malta uses for a bootloader) so perhaps it has limited use. If the change is acceptable in principle I'll tidy it up and submit a patch with all the proper procedure. Opinions welcome -dan diff --git a/arch/mips/mti-malta/malta-setup.c b/arch/mips/mti-malta/malta-setup.c index 21cb3ac1237b..52e731f9b4e2 100644 --- a/arch/mips/mti-malta/malta-setup.c +++ b/arch/mips/mti-malta/malta-setup.c @@ -192,7 +192,9 @@ static void __init bonito_quirks_setup(void) void __init *plat_get_fdt(void) { - return (void *)__dtb_start; + return (fw_arg0 == -2) ? + (void *) (KSEG1ADDR(fw_arg1)) : + (void *) __dtb_start; } void __init plat_mem_setup(void)