U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jorge Ramirez <jorge.ramirez@oss.qualcomm.com>
To: neil.armstrong@linaro.org
Cc: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>,
	caleb.connolly@linaro.org, sumit.garg@kernel.org,
	u-boot-qcom@groups.io, u-boot@lists.denx.de
Subject: Re: [PATCH 6/7] mach-snapdragon: board interface to enforce fdt
Date: Mon, 7 Apr 2025 11:52:54 +0200	[thread overview]
Message-ID: <Z/Ogdhdy1NPmQdt/@trex> (raw)
In-Reply-To: <9b6d42e1-1582-4250-8325-641f29d2030b@linaro.org>

On 07/04/25 11:04:30, neil.armstrong@linaro.org wrote:
> Hi,
> 
> On 07/04/2025 10:19, Jorge Ramirez-Ortiz wrote:
> > Some platforms might require the external fdt to boot.
> 
> Why ? we may want to build the fdt in, and discard the external fdt for some reasons.

on the db820c, the device tree that u-boot builds is passed to the LK
appendeded with the image via fastboot: the LK, processes it, ammends
the device tree and then hands it back to u-boot.

see the boot trace:

[2830] Only one appended non-skales DTB, select it.                                                                                                                                        
[2850] cmdline:  androidboot.bootdevice=624000.ufshc androidboot.verifiedbootstate=orange androidboot.veritymode=enforcing androidboot.serialno=2f490ecf androidboot.baseband=apq mdss_mdp0
[2860] Updating device tree: start                                                                                                                                                         
[2860] Updating device tree: done                                                                                                                                                          
[2870] Return value from recv_data: 14                                                                                                                                                     
[2880] RPM GLINK UnInit                                                                                                                                                                    
[2880] Qseecom De-Init Done in Appsbl                                                                                                                                                      
[2880] booting linux @ 0x80080000, ramdisk @ 0x82200000 (0), tags/device tree @ 0x82000000                                                                                                 
[2890] Jumping to kernel via monitor                                                                                                                                                       
                                                                                                                                                                                           
                                                                                                                                                                                           
U-Boot 2025.04-rc5-00022-gccd064439bc2 (Apr 07 2025 - 10:06:51 +0200)                                                                                                                      
Qualcomm-DragonBoard 820C                                                                                                                                                                  
                              

It is this external fdt that we need; so I thought allowing the board to
request the external fdt explicitily might make sense.

if you have some other idea/suggestion, please let me know, happy to abide.

> 
> > 
> > This change provides a mechanism to the board initializaion code to make
> > the requet explicit.
> > 
> > Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
> > ---
> >   arch/arm/mach-snapdragon/board.c | 13 +++++++++++++
> >   1 file changed, 13 insertions(+)
> > 
> > diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c
> > index 2ef936aab75..1bca9dce20f 100644
> > --- a/arch/arm/mach-snapdragon/board.c
> > +++ b/arch/arm/mach-snapdragon/board.c
> > @@ -150,7 +150,13 @@ static void show_psci_version(void)
> >   /* We support booting U-Boot with an internal DT when running as a first-stage bootloader
> >    * or for supporting quirky devices where it's easier to leave the downstream DT in place
> >    * to improve ABL compatibility. Otherwise, we use the DT provided by ABL.
> > + *
> > + * Alternatively the board can enforce the external fdt.
> >    */
> > +bool __weak qcom_board_fdt_external(void)
> > +{
> > +	return false;
> > +}
> >   int board_fdt_blob_setup(void **fdtp)
> >   {
> >   	struct fdt_header *fdt;
> > @@ -161,6 +167,12 @@ int board_fdt_blob_setup(void **fdtp)
> >   	external_valid = fdt && !fdt_check_header(fdt);
> >   	internal_valid = !fdt_check_header(*fdtp);
> > +	if (qcom_board_fdt_external() && external_valid) {
> > +		debug("Using external FDT\n");
> > +		*fdtp = fdt;
> > +		goto out;
> > +	}
> > +
> >   	/*
> >   	 * There is no point returning an error here, U-Boot can't do anything useful in this situation.
> >   	 * Bail out while we can still print a useful error message.
> > @@ -178,6 +190,7 @@ int board_fdt_blob_setup(void **fdtp)
> >   		*fdtp = fdt;
> >   	}
> > +out:
> >   	/*
> >   	 * Parse the /memory node while we're here,
> >   	 * this makes it easy to do other things early.
> 

  reply	other threads:[~2025-04-07  9:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07  8:19 Dragonboard 820c - fix board support Jorge Ramirez-Ortiz
2025-04-07  8:19 ` [PATCH 1/7] board: qualcomm: dragonboard820c: udpate readme Jorge Ramirez-Ortiz
2025-04-07  9:01   ` neil.armstrong
2025-04-07  8:19 ` [PATCH 2/7] clk/qcom: apq8096: fix set rate for the uart clock Jorge Ramirez-Ortiz
2025-04-07  9:01   ` neil.armstrong
2025-04-07  8:19 ` [PATCH 3/7] mmc: msm_sdhci: handle bulk clock initialization error Jorge Ramirez-Ortiz
2025-04-07  9:02   ` neil.armstrong
2025-04-07  9:10     ` Neil Armstrong
2025-04-07  9:38       ` Jorge Ramirez
2025-04-07  9:53         ` Neil Armstrong
2025-04-07 10:36           ` Jorge Ramirez
2025-04-07  8:19 ` [PATCH 4/7] clk/qcom: apq8096: fix the sdhci clock Jorge Ramirez-Ortiz
2025-04-07  9:03   ` neil.armstrong
2025-04-07  8:19 ` [PATCH 5/7] configs: dragonboard820: enable GPIO Jorge Ramirez-Ortiz
2025-04-07  9:03   ` neil.armstrong
2025-04-07  8:19 ` [PATCH 6/7] mach-snapdragon: board interface to enforce fdt Jorge Ramirez-Ortiz
2025-04-07  9:04   ` neil.armstrong
2025-04-07  9:52     ` Jorge Ramirez [this message]
2025-04-07 10:02   ` Caleb Connolly
2025-04-07 10:33     ` Jorge Ramirez
2025-04-07  8:19 ` [PATCH 7/7] board: qualcommm: dragonboard820c: external fdt Jorge Ramirez-Ortiz

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=Z/Ogdhdy1NPmQdt/@trex \
    --to=jorge.ramirez@oss.qualcomm.com \
    --cc=caleb.connolly@linaro.org \
    --cc=neil.armstrong@linaro.org \
    --cc=sumit.garg@kernel.org \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.denx.de \
    /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