Skip to contentSkip to conversation

a question about falcon mode

DISCUSSION Chan Kim 3 participants 8 messages Nov 25, 2021 – Dec 3, 2021

lore
Share & tools
lore

Chan Kim

author
#0 lore raw

Hello all,

I'm trying to implement falcon mode for our board. Then should I first implement the normal mode(spl + proper)?

It looks like so while I'm reading doc/README.falcon. (It says, after loading kernel, DT etc. I should give 'spl export' command).

Please someone confirm this.

Thank you.

Chan Kim

#1 lore raw
Quoted 8 lines · Chan Kim

Hello all,

I'm trying to implement falcon mode for our board. Then should I first implement the normal mode(spl + proper)?

It looks like so while I'm reading doc/README.falcon. (It says, after loading kernel, DT etc. I should give 'spl export' command).

Falcon mode is a bit board dependent. There are a couple of ways you could go about this.

The first is to have an "fdtargs" partition. This is where "spl export" comes in. Once you run "spl export", it will give a modified dtb at "$fdtargsaddr". It's that DTB that you need to write to your ftdargs partition. For example:

Quoted 2 lines

spl export fdt $loadaddr - $fdt_addr_r
mmc write $fdtargsaddr 0x9800 0x8000

In this example the ftdargs partition starts at sector 0x9800, and is 0x800 sectors long.

The second option is to forget about "spl export" and "fdtargs", and package your kernel, devicetree, and overlays in a FIT container. You'd make sure to enable SPL_LOAD_FIT_APPLY_OVERLAY. There isn't much more to this other than the usual gotcha's with FIT and overlays.

Alex

author
#2 lore raw

Hi Alex,
Thanks for the reply.
So I gather that to be able to use 'spl export fdt' to store the 'snapshot' to the storage I should make the spl program runnable at least to that stage. (being able to load kernel image, dtb, initrd and give the spl export command to capture it to storage like SD card).
What I'm thinking of is to let another processor(cortext-M7 based scp, system control processor) load the u-boot-spl.bin into on-chip RAM and kernel(including initramfs)and dtb into SDRAM all from SD card (RAW mode, no file system) and let the AP(application processor) start from u-boot-spl.bin. In this scheme u-boot-spl doesn't need to load anything and DRAM is already initialized and it just needs to run from kernel image after very minimal setup (passing kernel arguments). Do you think this is possible or an absurd idea? Any comment will be a big help for me.
Thanks!
Chan

Quoted 39 lines

-----Original Message-----
From: Alex G. <[email protected]>
Sent: Thursday, November 25, 2021 11:57 PM
To: Chan Kim <[email protected]>; U-Boot Mailing List <[email protected]>
Subject: Re: a question about falcon mode

Quoted 8 lines · Chan Kim

Hello all,

I'm trying to implement falcon mode for our board. Then should I first implement the normal mode(spl + proper)?

It looks like so while I'm reading doc/README.falcon. (It says, after loading kernel, DT etc. I should give 'spl export' command).

Falcon mode is a bit board dependent. There are a couple of ways you could go about this.

The first is to have an "fdtargs" partition. This is where "spl export" comes in. Once you run "spl export", it will give a modified dtb at "$fdtargsaddr". It's that DTB that you need to write to your ftdargs partition. For example:

> spl export fdt $loadaddr - $fdt_addr_r
> mmc write $fdtargsaddr 0x9800 0x8000

In this example the ftdargs partition starts at sector 0x9800, and is 0x800 sectors long.

The second option is to forget about "spl export" and "fdtargs", and package your kernel, devicetree, and overlays in a FIT container. You'd make sure to enable SPL_LOAD_FIT_APPLY_OVERLAY. There isn't much more to this other than the usual gotcha's with FIT and overlays.

Alex

#3 lore raw
Quoted 5 lines · Chan Kim

Hi Alex,
Thanks for the reply.
So I gather that to be able to use 'spl export fdt' to store the 'snapshot' to the storage I should make the spl program runnable at least to that stage. (being able to load kernel image, dtb, initrd and give the spl export command to capture it to storage like SD card).
What I'm thinking of is to let another processor(cortext-M7 based scp, system control processor) load the u-boot-spl.bin into on-chip RAM and kernel(including initramfs)and dtb into SDRAM all from SD card (RAW mode, no file system) and let the AP(application processor) start from u-boot-spl.bin. In this scheme u-boot-spl doesn't need to load anything and DRAM is already initialized and it just needs to run from kernel image after very minimal setup (passing kernel arguments). Do you think this is possible or an absurd idea? Any comment will be a big help for me.

I'm not sure if that mode is currently supported. You could try using CONFIG_SPL_RAM_SUPPORT=y, and one of two things:
a) Package your kernel and DTB in a FIT.
b) Extend common/spl/spl_ram.c to support the 'snapshot' dtb

Alex

Quoted 46 lines

Thanks!
Chan

Quoted 39 lines

-----Original Message-----
From: Alex G. <[email protected]>
Sent: Thursday, November 25, 2021 11:57 PM
To: Chan Kim <[email protected]>; U-Boot Mailing List <[email protected]>
Subject: Re: a question about falcon mode

Quoted 8 lines · Chan Kim

Hello all,

I'm trying to implement falcon mode for our board. Then should I first implement the normal mode(spl + proper)?

It looks like so while I'm reading doc/README.falcon. (It says, after loading kernel, DT etc. I should give 'spl export' command).

Falcon mode is a bit board dependent. There are a couple of ways you could go about this.

The first is to have an "fdtargs" partition. This is where "spl export" comes in. Once you run "spl export", it will give a modified dtb at "$fdtargsaddr". It's that DTB that you need to write to your ftdargs partition. For example:

> spl export fdt $loadaddr - $fdt_addr_r
> mmc write $fdtargsaddr 0x9800 0x8000

In this example the ftdargs partition starts at sector 0x9800, and is 0x800 sectors long.

The second option is to forget about "spl export" and "fdtargs", and package your kernel, devicetree, and overlays in a FIT container. You'd make sure to enable SPL_LOAD_FIT_APPLY_OVERLAY. There isn't much more to this other than the usual gotcha's with FIT and overlays.

Alex

#4 lore raw
In reply to Alex G.

Hi Alex,

Just a quick remarque that intrigued me:

Quoted 22 lines · Alex G.
Quoted 8 lines · Chan Kim

Hello all,

I'm trying to implement falcon mode for our board. Then should I first implement the normal mode(spl + proper)?

It looks like so while I'm reading doc/README.falcon. (It says, after loading kernel, DT etc. I should give 'spl export' command).

Falcon mode is a bit board dependent. There are a couple of ways you could go about this.

The first is to have an "fdtargs" partition. This is where "spl export" comes in. Once you run "spl export", it will give a modified dtb at "$fdtargsaddr". It's that DTB that you need to write to your ftdargs partition. For example:

> spl export fdt $loadaddr - $fdt_addr_r
> mmc write $fdtargsaddr 0x9800 0x8000

Quoted 9 lines

In this example the ftdargs partition starts at sector 0x9800, and is 0x800 sectors long.

The second option is to forget about "spl export" and "fdtargs", and package your kernel, devicetree, and overlays in a FIT container. You'd make sure to enable SPL_LOAD_FIT_APPLY_OVERLAY. There isn't much more to this other than the usual gotcha's with FIT and overlays.

Do you mean by this that the SPL has the capability to generate the "fdtargs" by it self (if we provide it with the dtb in the fitImage) ?

Form my last experience with the falcon mode, I had a - not sure - conclusion that the only way to generate the "fdtargs" is by using the "spl export" command from uboot cmdline !
because the reality of the fdtargs blob, as its name indicates, is not just the fdt but it has also the bootargs (inside the chosen node ) that are required by the kernel. So if you give only the DTB to the SPL it will not work - to my knowledge -, cuz the data that will be passed to the kernel needs to contain also the bootargs !

Can you please confirm to me if this capability is implemented on the SPL and that we can actually forget about the "spl export" command ?

Thanks
And apologies Chan for jumping on your thread,

Best regards,
--
Abder

#5 lore raw
Quoted 49 lines · Abder

Hi Alex,

Just a quick remarque that intrigued me:

Quoted 22 lines · Alex G.
Quoted 8 lines · Chan Kim

Hello all,

I'm trying to implement falcon mode for our board. Then should I first implement the normal mode(spl + proper)?

It looks like so while I'm reading doc/README.falcon. (It says, after loading kernel, DT etc. I should give 'spl export' command).

Falcon mode is a bit board dependent. There are a couple of ways you could go about this.

The first is to have an "fdtargs" partition. This is where "spl export" comes in. Once you run "spl export", it will give a modified dtb at "$fdtargsaddr". It's that DTB that you need to write to your ftdargs partition. For example:

> spl export fdt $loadaddr - $fdt_addr_r
> mmc write $fdtargsaddr 0x9800 0x8000

Quoted 9 lines

In this example the ftdargs partition starts at sector 0x9800, and is 0x800 sectors long.

The second option is to forget about "spl export" and "fdtargs", and package your kernel, devicetree, and overlays in a FIT container. You'd make sure to enable SPL_LOAD_FIT_APPLY_OVERLAY. There isn't much more to this other than the usual gotcha's with FIT and overlays.

Do you mean by this that the SPL has the capability to generate the "fdtargs" by it self (if we provide it with the dtb in the fitImage) ?

Form my last experience with the falcon mode, I had a - not sure - conclusion that the only way to generate the "fdtargs" is by using the "spl export" command from uboot cmdline !
because the reality of the fdtargs blob, as its name indicates, is not just the fdt but it has also the bootargs (inside the chosen node ) that are required by the kernel. So if you give only the DTB to the SPL it will not work - to my knowledge -, cuz the data that will be passed to the kernel needs to contain also the bootargs !

Quoted 2 lines

Can you please confirm to me if this capability is implemented on the SPL and that we can actually forget about the "spl export" command ?

It might not be obvious that an overlay can contain the "/chosen" node with the appropriate bootargs:

/dts-v1/;
/plugin/;

/ {
	fragment@1 {
		target-path = "/chosen";
		__overlay__ {
			bootargs = "root=blablabla console=ttyeS0";
		};
	};
};
Quoted 8 lines

Thanks
And apologies Chan for jumping on your thread,

Best regards,
--
Abder

#6 lore raw

Hi Alex,

Well yeah! I thought about that, my question was deliberately open to that answer too... but what I was looking for is if a dynamic capability was (already) implemented in the SPL for generating the fdtargs i.e., taking the dtb and the bootargs env variable (plus calculating the address and size of the initramfs if used) and putting all that info in the fdtarg blob just like u-boot does ! But surely that also can be implemented in the SPL. I'm willing to try that in the near future... and eventually submit a patch for it, if everything goes as expected !

Thanks for the reply though, and the snippet code too !

Best regards
--
Abder

Quoted 78 lines · Alex G.
Quoted 49 lines · Abder

Hi Alex,

Just a quick remarque that intrigued me:

Quoted 22 lines · Alex G.
Quoted 8 lines · Chan Kim

Hello all,

I'm trying to implement falcon mode for our board. Then should I first implement the normal mode(spl + proper)?

It looks like so while I'm reading doc/README.falcon. (It says, after loading kernel, DT etc. I should give 'spl export' command).

Falcon mode is a bit board dependent. There are a couple of ways you could go about this.

The first is to have an "fdtargs" partition. This is where "spl export" comes in. Once you run "spl export", it will give a modified dtb at "$fdtargsaddr". It's that DTB that you need to write to your ftdargs partition. For example:

> spl export fdt $loadaddr - $fdt_addr_r
> mmc write $fdtargsaddr 0x9800 0x8000

Quoted 9 lines

In this example the ftdargs partition starts at sector 0x9800, and is 0x800 sectors long.

The second option is to forget about "spl export" and "fdtargs", and package your kernel, devicetree, and overlays in a FIT container. You'd make sure to enable SPL_LOAD_FIT_APPLY_OVERLAY. There isn't much more to this other than the usual gotcha's with FIT and overlays.

Do you mean by this that the SPL has the capability to generate the "fdtargs" by it self (if we provide it with the dtb in the fitImage) ?

Form my last experience with the falcon mode, I had a - not sure - conclusion that the only way to generate the "fdtargs" is by using the "spl export" command from uboot cmdline !
because the reality of the fdtargs blob, as its name indicates, is not just the fdt but it has also the bootargs (inside the chosen node ) that are required by the kernel. So if you give only the DTB to the SPL it will not work - to my knowledge -, cuz the data that will be passed to the kernel needs to contain also the bootargs !

Quoted 2 lines

Can you please confirm to me if this capability is implemented on the SPL and that we can actually forget about the "spl export" command ?

It might not be obvious that an overlay can contain the "/chosen" node with the appropriate bootargs:

/dts-v1/;
/plugin/;

/ {
        fragment@1 {
                target-path = "/chosen";
                __overlay__ {
                        bootargs = "root=blablabla console=ttyeS0";
                };
        };
};
Quoted 8 lines

Thanks
And apologies Chan for jumping on your thread,

Best regards,
--
Abder

author
#7 lore raw

Hi, Alex and Abder,
Thank you for the comments.
Those will be a good hint for me (especially CONFIG_SPL_RAM_SUPPORT , using FIT image etc..) in reading the document and doing the experiment later. Best regards
Chan

Quoted 109 lines

-----Original Message-----
From: Abder <[email protected]>
Sent: Wednesday, December 1, 2021 9:16 PM
To: Alex G. <[email protected]>
Cc: Chan Kim <[email protected]>; U-Boot Mailing List <[email protected]>
Subject: Re: a question about falcon mode

Hi Alex,

Well yeah! I thought about that, my question was deliberately open to that answer too... but what I was looking for is if a dynamic capability was (already) implemented in the SPL for generating the fdtargs i.e., taking the dtb and the bootargs env variable (plus calculating the address and size of the initramfs if used) and putting all that info in the fdtarg blob just like u-boot does !
But surely that also can be implemented in the SPL. I'm willing to try that in the near future... and eventually submit a patch for it, if everything goes as expected !

Thanks for the reply though, and the snippet code too !

Best regards
--
Abder

Quoted 16 lines · Alex G.
Quoted 12 lines · Abder

Hi Alex,

Just a quick remarque that intrigued me:

Quoted 7 lines · Alex G.
Quoted 5 lines · Chan Kim

Hello all,

I'm trying to implement falcon mode for our board. Then should I first implement the normal mode(spl + proper)?

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

It looks like so while I'm reading doc/README.falcon. (It says, after loading kernel, DT etc. I should give 'spl export' command).

Falcon mode is a bit board dependent. There are a couple of ways you could go about this.

The first is to have an "fdtargs" partition. This is where "spl

export"

Quoted 12 lines
Quoted 12 lines
Quoted 12 lines

comes in. Once you run "spl export", it will give a modified dtb at "$fdtargsaddr". It's that DTB that you need to write to your ftdargs partition. For example:

> spl export fdt $loadaddr - $fdt_addr_r
> mmc write $fdtargsaddr 0x9800 0x8000

In this example the ftdargs partition starts at sector 0x9800, and is
0x800 sectors long.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

The second option is to forget about "spl export" and "fdtargs", and package your kernel, devicetree, and overlays in a FIT container. You'd make sure to enable SPL_LOAD_FIT_APPLY_OVERLAY. There isn't much more to this other than the usual gotcha's with FIT

and overlays.

Quoted 14 lines
Quoted 14 lines
Quoted 1 line

Do you mean by this that the SPL has the capability to generate the "fdtargs" by it self (if we provide it with the dtb in the fitImage) ?

Form my last experience with the falcon mode, I had a - not sure - conclusion that the only way to generate the "fdtargs" is by using the "spl export" command from uboot cmdline !
because the reality of the fdtargs blob, as its name indicates, is not just the fdt but it has also the bootargs (inside the chosen node ) that are required by the kernel. So if you give only the DTB to the SPL it will not work - to my knowledge -, cuz the data that will be passed to the kernel needs to contain also the bootargs !

Quoted 2 lines
Quoted 2 lines

Can you please confirm to me if this capability is implemented on the SPL and that we can actually forget about the "spl export"

command ?

Quoted 23 lines

It might not be obvious that an overlay can contain the "/chosen" node with the appropriate bootargs:

/dts-v1/;
/plugin/;

/ {
        fragment@1 {
                target-path = "/chosen";
                __overlay__ {
                        bootargs = "root=blablabla console=ttyeS0";
                };
        };
};
Quoted 8 lines

Thanks
And apologies Chan for jumping on your thread,

Best regards,
--
Abder