Linux MIPS Architecture development
 help / color / mirror / Atom feed
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	[thread overview]
Message-ID: <87plyyrupy.fsf@telent.net> (raw)


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)

             reply	other threads:[~2023-12-22 17:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-22 17:51 dan [this message]
2023-12-25 13:33 ` question: malta doesn't use a1 for fdt from bootloader Jiaxun Yang
2024-01-03 13:50   ` Jiaxun Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87plyyrupy.fsf@telent.net \
    --to=dan@telent.net \
    --cc=linux-mips@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox