Skip to contentSkip to conversation

doc: Convert README.commands.spl to rST

PATCH In review Tom Rini 2 participants 6 messages Sep 12, 2025 – Sep 15, 2025

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 doc: Convert README.commands.spl to rST

This converts the existing README.commands.spl file to rST as doc/usage/cmd/spl.rst and adds it to the command index. Minimal rewording is done to the previous contents, to make it fit better with the overall style of documentation now.

---
Cc: Heinrich Schuchardt <[email protected]>

---
 doc/README.commands.spl | 31 --------------------------
 doc/usage/cmd/spl.rst   | 48 +++++++++++++++++++++++++++++++++++++++++
 doc/usage/index.rst     |  1 +
 3 files changed, 49 insertions(+), 31 deletions(-)
 delete mode 100644 doc/README.commands.spl
 create mode 100644 doc/usage/cmd/spl.rst
doc/README.commands.spl deleted +0 -31
deleted file mode 100644
index ecfd3ca9ee58..000000000000
@@ -1,31 +0,0 @@
-The spl command is used to export a boot parameter image to RAM. Later
-it may implement more functions connected to the SPL.
-
-SUBCOMMAND EXPORT
-To execute the command everything has to be in place as if bootm should be
-used. (kernel image, initrd-image, fdt-image etc.)
-
-export has two subcommands:
-	atags: exports the ATAGS
-	fdt: exports the FDT
-
-Call is:
-spl export <fdt|atags> [kernel_addr] [initrd_addr] [fdt_addr if fdt]
-
-
-TYPICAL CALL
-
-on OMAP3:
-nandecc hw
-nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/
-spl export atags			/* export ATAGS */
-nand erase 0x680000 0x20000		/* erase - one page */
-nand write 0x80000100 0x680000 0x20000	/* write the image - one page */
-
-call with FDT:
-nandecc hw
-nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/
-tftpboot 0x80000100 devkit8000.dtb /* Read fdt */
-spl export fdt 0x82000000 - 0x80000100	/* export FDT */
-nand erase 0x680000 0x20000		/* erase - one page */
-nand write <adress shown by spl export> 0x680000 0x20000
doc/usage/cmd/spl.rst new file +48 -0

48 lines not on this page · raw message

doc/usage/index.rst +1 -0
index 3a48521d5d56..a34db5cb627b 100644
@@ -124,6 +124,7 @@ Shell commands
    cmd/sntp
    cmd/sound
    cmd/source
+   cmd/spl
    cmd/tcpm
    cmd/temperature
    cmd/test
Signature · 1 line
2.43.0
#1 lore raw
Quoted 59 lines · Tom Rini

This converts the existing README.commands.spl file to rST as doc/usage/cmd/spl.rst and adds it to the command index. Minimal rewording is done to the previous contents, to make it fit better with the overall style of documentation now.

---
Cc: Heinrich Schuchardt <[email protected]>

---
  doc/README.commands.spl | 31 --------------------------
  doc/usage/cmd/spl.rst   | 48 +++++++++++++++++++++++++++++++++++++++++
  doc/usage/index.rst     |  1 +
  3 files changed, 49 insertions(+), 31 deletions(-)

delete mode 100644 doc/README.commands.spl
create mode 100644 doc/usage/cmd/spl.rst

doc/README.commands.spl deleted +0 -31
deleted file mode 100644
index ecfd3ca9ee58..000000000000
@@ -1,31 +0,0 @@
-The spl command is used to export a boot parameter image to RAM. Later
-it may implement more functions connected to the SPL.
-
-SUBCOMMAND EXPORT
-To execute the command everything has to be in place as if bootm should be
-used. (kernel image, initrd-image, fdt-image etc.)
-
-export has two subcommands:
-	atags: exports the ATAGS
-	fdt: exports the FDT
-
-Call is:
-spl export <fdt|atags> [kernel_addr] [initrd_addr] [fdt_addr if fdt]
-
-
-TYPICAL CALL
-
-on OMAP3:
-nandecc hw
-nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/
-spl export atags			/* export ATAGS */
-nand erase 0x680000 0x20000		/* erase - one page */
-nand write 0x80000100 0x680000 0x20000	/* write the image - one page */
-
-call with FDT:
-nandecc hw
-nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/
-tftpboot 0x80000100 devkit8000.dtb /* Read fdt */
-spl export fdt 0x82000000 - 0x80000100	/* export FDT */
-nand erase 0x680000 0x20000		/* erase - one page */
-nand write <adress shown by spl export> 0x680000 0x20000
doc/usage/cmd/spl.rst new file +0 -0
new file mode 100644
index 000000000000..59471c65a623

doc/usage/cmd/spl.rst line 1

Quoted 1 line
doc/usage/cmd/spl.rst new file +1 -0
@@ -0,0 +1,48 @@
+.. SPDX-License-Identifier: GPL-2.0+:

%s/GPL-2.0+/GPL-2.0-OR-LATER/

Cf. https://spdx.org/licenses/GPL-2.0-or-later.html

doc/usage/cmd/spl.rst line 14

Quoted 13 lines
doc/usage/cmd/spl.rst new file +13 -0
+
+.. index::
+   single: spl (command)
+
+spl command
+===========
+
+Synopsis
+--------
+
+::
+
+    spl export <fdt|atags> [kernel_addr] [initrd_addr] [fdt_addr if fdt]

Those brackets cannot be correct. I definitively cannot remove the kernel_addr and provide an initrd_addr instead. Do you mean:

spl export <fdt|atags> [kernel_addr [initrd_addr [fdt_addr if fdt]]]

doc/usage/cmd/spl.rst line 19

Quoted 5 lines
doc/usage/cmd/spl.rst new file +5 -0
+
+Description
+-----------
+
+The *spl* command is used to export a boot parameter image to RAM. Later

In the current state the man-page is not very helpful. Please, move the more extensive description from doc/develop/falcon.rst here.

* I would not know what a "boot parameter image" might be. Please, explain it for a novice user.
* Please, describe what each parameter is used for.
* Please, explain what atags refers to. I would assume you mean what is described in https://developer.arm.com/documentation/den0013/0400/Boot-Code/Booting-Linux/Kernel-parameters-using-ATAGs. But don't expect a novice user to know.
* What does the command do if "fdt" is used?

doc/usage/cmd/spl.rst line 23

Quoted 4 lines
doc/usage/cmd/spl.rst new file +4 -0
+it may implement more functions connected to the SPL.
+
+spl export
+~~~~~~~~~~

This heading makes no sense.

doc/usage/cmd/spl.rst line 25

Quoted 2 lines
doc/usage/cmd/spl.rst new file +2 -0
+
+To execute the command everything has to be in place as if bootm should be

Bootm can for instance boot a FIT image with an EFI binary.
I wouldn't expect this to work when booting in Falcon mode where EFI is not available.

This sentence should be replaced by a meaningful description.

doc/usage/cmd/spl.rst line 27

Quoted 2 lines
doc/usage/cmd/spl.rst new file +2 -0
+used. (kernel image, initrd-image, fdt-image if used). The first argument
+passed to the export subcommand must be either atags or fdt, which signifies if

%s/signifies/indicates/

doc/usage/cmd/spl.rst line 28

Quoted 1 line
doc/usage/cmd/spl.rst new file +1 -0
+we are preparing an ATAGS or device tree for export.

Isn't ATAGs the plural form of ATAG?
Why would you write 'an ATAGS' if there are multiple tags?

Please, describe under which circumstances and with which values these environment variables are filled and what they are used for.

* fdtargsaddr
* fdtargslen

doc/usage/cmd/spl.rst line 36

Quoted 8 lines
doc/usage/cmd/spl.rst new file +8 -0
+
+Example
+-------
+
+On an OMAP3 platform with ATAGS::
+
+    => nandecc hw
+    => nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/

What format must the image have to be used for booting? A FIT image?

doc/usage/cmd/spl.rst line 37

Quoted 1 line
doc/usage/cmd/spl.rst new file +1 -0
+    => spl export atags			/* export ATAGS */

Is spl export atags never used with kernel_addr, initrd_addr, fdt_addr?

Does spl export atags without further arguments create any ATAGs? Where would it take the values from?

doc/usage/cmd/spl.rst line 39

Quoted 2 lines
doc/usage/cmd/spl.rst new file +2 -0
+    => nand erase 0x680000 0x20000		/* erase - one page */
+    => nand write 0x80000100 0x680000 0x20000	/* write the image - one page */

What is written to nand here?
What relevance have these magic addresses?
How would a user know which address to use?

doc/usage/cmd/spl.rst line 46

Quoted 7 lines
doc/usage/cmd/spl.rst new file +7 -0
+
+On an OMAP3 platform with device tree::
+
+    => nandecc hw
+    => nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/
+    => tftpboot 0x80000100 devkit8000.dtb /* Read fdt */
+    => spl export fdt 0x82000000 - 0x80000100	/* export FDT */

Why would anybody use a device-tree from a TFTP server in conjunction with a kernel from nand?

doc/usage/cmd/spl.rst line 48

Quoted 2 lines
doc/usage/cmd/spl.rst new file +2 -0
+    => nand erase 0x680000 0x20000		/* erase - one page */
+    => nand write <adress shown by spl export> 0x680000 0x20000

The address seems to be gd->bd->bi_boot_params which is hard coded in board files and not visible to the user. This is just gruesome. The address should be exported to a variable to be usable in scripts.

Which customizing is needed to use the spl command? These settings seem to be relevant and should be described in sufficient detail:

CONFIG_CMD_SPL
CONFIG_OF_LIBFDT
CONFIG_CMD_SPL_WRITE_SIZE
CONFIG_SUPPORT_PASSING_ATAGS
CONFIG_SYS_BOOT_RAMDISK_HIGH

Which return values does the command provide?

Best regards

Heinrich

Quoted 12 lines
doc/usage/index.rst +1 -0
index 3a48521d5d56..a34db5cb627b 100644
@@ -124,6 +124,7 @@ Shell commands
     cmd/sntp
     cmd/sound
     cmd/source
+   cmd/spl
     cmd/tcpm
     cmd/temperature
     cmd/test
author
#2 lore raw
Quoted 64 lines · Heinrich Schuchardt
Quoted 59 lines · Tom Rini

This converts the existing README.commands.spl file to rST as doc/usage/cmd/spl.rst and adds it to the command index. Minimal rewording is done to the previous contents, to make it fit better with the overall style of documentation now.

---
Cc: Heinrich Schuchardt <[email protected]>

---
  doc/README.commands.spl | 31 --------------------------
  doc/usage/cmd/spl.rst   | 48 +++++++++++++++++++++++++++++++++++++++++
  doc/usage/index.rst     |  1 +
  3 files changed, 49 insertions(+), 31 deletions(-)

delete mode 100644 doc/README.commands.spl
create mode 100644 doc/usage/cmd/spl.rst

doc/README.commands.spl deleted +0 -31
deleted file mode 100644
index ecfd3ca9ee58..000000000000
@@ -1,31 +0,0 @@
-The spl command is used to export a boot parameter image to RAM. Later
-it may implement more functions connected to the SPL.
-
-SUBCOMMAND EXPORT
-To execute the command everything has to be in place as if bootm should be
-used. (kernel image, initrd-image, fdt-image etc.)
-
-export has two subcommands:
-	atags: exports the ATAGS
-	fdt: exports the FDT
-
-Call is:
-spl export <fdt|atags> [kernel_addr] [initrd_addr] [fdt_addr if fdt]
-
-
-TYPICAL CALL
-
-on OMAP3:
-nandecc hw
-nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/
-spl export atags			/* export ATAGS */
-nand erase 0x680000 0x20000		/* erase - one page */
-nand write 0x80000100 0x680000 0x20000	/* write the image - one page */
-
-call with FDT:
-nandecc hw
-nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/
-tftpboot 0x80000100 devkit8000.dtb /* Read fdt */
-spl export fdt 0x82000000 - 0x80000100	/* export FDT */
-nand erase 0x680000 0x20000		/* erase - one page */
-nand write <adress shown by spl export> 0x680000 0x20000
doc/usage/cmd/spl.rst new file +0 -0
new file mode 100644
index 000000000000..59471c65a623

doc/usage/cmd/spl.rst line 1

Quoted 1 line
doc/usage/cmd/spl.rst new file +1 -0
@@ -0,0 +1,48 @@
+.. SPDX-License-Identifier: GPL-2.0+:

%s/GPL-2.0+/GPL-2.0-OR-LATER/

Quoted 1 line

Cf. https://spdx.org/licenses/GPL-2.0-or-later.html

Yes, and it's not a hard requirement to use the new tag, checkpatch.pl doesn't even complain. I got this from the existing command I copied, FWIW.

Quoted 18 lines
Quoted 4 lines
doc/usage/cmd/spl.rst new file +3 -0
+
+.. index::
+   single: spl (command)

doc/usage/cmd/spl.rst line 14

Quoted 10 lines
doc/usage/cmd/spl.rst new file +10 -0
+
+spl command
+===========
+
+Synopsis
+--------
+
+::
+
+    spl export <fdt|atags> [kernel_addr] [initrd_addr] [fdt_addr if fdt]

Those brackets cannot be correct. I definitively cannot remove the kernel_addr and provide an initrd_addr instead. Do you mean:

Quoted 1 line

spl export <fdt|atags> [kernel_addr [initrd_addr [fdt_addr if fdt]]]

It's what the command itself says currently, however.

I'd be happy to do a follow-up patch to fix both.

Quoted 8 lines

doc/usage/cmd/spl.rst line 19

Quoted 5 lines
doc/usage/cmd/spl.rst new file +5 -0
+
+Description
+-----------
+
+The *spl* command is used to export a boot parameter image to RAM. Later

In the current state the man-page is not very helpful. Please, move the more extensive description from doc/develop/falcon.rst here.

As I said in the commit message, it's a conversion with minimal changes. I'd be happy to do a follow-up however improving it (and making cmd/spl.c's help text also better/correct).

Quoted 8 lines

* I would not know what a "boot parameter image" might be. Please, explain
it for a novice user.
* Please, describe what each parameter is used for.
* Please, explain what atags refers to. I would assume you mean what is
described in https://developer.arm.com/documentation/den0013/0400/Boot-Code/Booting-Linux/Kernel-parameters-using-ATAGs.
But don't expect a novice user to know.
* What does the command do if "fdt" is used?

Quoted 6 lines

doc/usage/cmd/spl.rst line 23

Quoted 4 lines
doc/usage/cmd/spl.rst new file +4 -0
+it may implement more functions connected to the SPL.
+
+spl export
+~~~~~~~~~~

This heading makes no sense.

I just copied doc/usage/cmd/acpi.rst for format as it's the first file. I'd be happy to look at a better example.

Quoted 7 lines

doc/usage/cmd/spl.rst line 25

Quoted 1 line
doc/usage/cmd/spl.rst new file +1 -0
+To execute the command everything has to be in place as if bootm should be

Bootm can for instance boot a FIT image with an EFI binary.
I wouldn't expect this to work when booting in Falcon mode where EFI is not available.

This sentence should be replaced by a meaningful description.

I don't understand what's unclear, sorry. And yes, Falcon mode and EFI aren't compatible, but that should be spelled out in doc/develop/falcon.rst and not here I think.

Quoted 9 lines

doc/usage/cmd/spl.rst line 27

Quoted 3 lines
doc/usage/cmd/spl.rst new file +2 -0
+used. (kernel image, initrd-image, fdt-image if used). The first argument
+passed to the export subcommand must be either atags or fdt, which signifies if

%s/signifies/indicates/

doc/usage/cmd/spl.rst line 28

Quoted 1 line
doc/usage/cmd/spl.rst new file +1 -0
+we are preparing an ATAGS or device tree for export.

Isn't ATAGs the plural form of ATAG?

The most consistent usage is "ATAGS" and not "ATAGs".

Quoted 7 lines

Why would you write 'an ATAGS' if there are multiple tags?

Please, describe under which circumstances and with which values these environment variables are filled and what they are used for.

* fdtargsaddr
* fdtargslen

These are covered in doc/develop/falcon.rst which should be linked from this document I think.

Quoted 11 lines

doc/usage/cmd/spl.rst line 36

Quoted 8 lines
doc/usage/cmd/spl.rst new file +8 -0
+
+Example
+-------
+
+On an OMAP3 platform with ATAGS::
+
+    => nandecc hw
+    => nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/

What format must the image have to be used for booting? A FIT image?

Quoted 6 lines

doc/usage/cmd/spl.rst line 37

Quoted 1 line
doc/usage/cmd/spl.rst new file +1 -0
+    => spl export atags			/* export ATAGS */

Is spl export atags never used with kernel_addr, initrd_addr, fdt_addr?

Does spl export atags without further arguments create any ATAGs? Where would it take the values from?

Working with ATAGS was indeed "fun". I'd honestly rather follow-up and remove ATAGS support from Falcon mode since it's 2025 and not 2012, but the point of this patch is to move doc/README.* content to rST so that we can then go "oof, that needs work" and try and improve it.

Quoted 6 lines

doc/usage/cmd/spl.rst line 39

Quoted 2 lines
doc/usage/cmd/spl.rst new file +2 -0
+    => nand erase 0x680000 0x20000		/* erase - one page */
+    => nand write 0x80000100 0x680000 0x20000	/* write the image - one page */

What is written to nand here?
What relevance have these magic addresses?
How would a user know which address to use?

More of the magic of ATAGS, which we can be glad aren't relevant anymore. It's always at that magic 0x100 offset. And the "on OMAP3" is the key to decoding the rest.

Quoted 9 lines

doc/usage/cmd/spl.rst line 46

Quoted 6 lines
doc/usage/cmd/spl.rst new file +6 -0
+On an OMAP3 platform with device tree::
+
+    => nandecc hw
+    => nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/
+    => tftpboot 0x80000100 devkit8000.dtb /* Read fdt */
+    => spl export fdt 0x82000000 - 0x80000100	/* export FDT */

Why would anybody use a device-tree from a TFTP server in conjunction with a kernel from nand?

It was the example at the time. But, because there's not a device tree on NAND, that's what spl export is creating.

Quoted 7 lines

doc/usage/cmd/spl.rst line 46

Quoted 3 lines
doc/usage/cmd/spl.rst new file +2 -0
+    => nand erase 0x680000 0x20000		/* erase - one page */
+    => nand write <adress shown by spl export> 0x680000 0x20000

The address seems to be gd->bd->bi_boot_params which is hard coded in board files and not visible to the user. This is just gruesome. The address should be exported to a variable to be usable in scripts.

Preparing a board for falcon mode isn't a general task, you need to know what your platform is and where things are because you're about to make it a lot less flexible.

Quoted 8 lines

Which customizing is needed to use the spl command? These settings seem to be relevant and should be described in sufficient detail:

CONFIG_CMD_SPL
CONFIG_OF_LIBFDT
CONFIG_CMD_SPL_WRITE_SIZE
CONFIG_SUPPORT_PASSING_ATAGS
CONFIG_SYS_BOOT_RAMDISK_HIGH

Some of these I suspect so, yes.

Quoted 1 line

Which return values does the command provide?

Only the standard ones. A quick grep on "on success" in doc/usage/cmd says we aren't consistent about this phrasing nor inclusion to start with. I think we should update the "General rules" section of doc/usage/cmdline.rst to state that "The return value $? is 0 (true) on success and 1 (false) on failure unless otherwise noted.".

Signature · 1 line
Tom
#3 lore raw

Am 13. September 2025 17:18:07 MESZ schrieb Tom Rini <[email protected]>:

Quoted 89 lines · Heinrich Schuchardt
Quoted 64 lines · Tom Rini
Quoted 59 lines

This converts the existing README.commands.spl file to rST as doc/usage/cmd/spl.rst and adds it to the command index. Minimal rewording is done to the previous contents, to make it fit better with the overall style of documentation now.

---
Cc: Heinrich Schuchardt <[email protected]>

---
  doc/README.commands.spl | 31 --------------------------
  doc/usage/cmd/spl.rst   | 48 +++++++++++++++++++++++++++++++++++++++++
  doc/usage/index.rst     |  1 +
  3 files changed, 49 insertions(+), 31 deletions(-)

delete mode 100644 doc/README.commands.spl
create mode 100644 doc/usage/cmd/spl.rst

doc/README.commands.spl deleted +0 -31
deleted file mode 100644
index ecfd3ca9ee58..000000000000
@@ -1,31 +0,0 @@
-The spl command is used to export a boot parameter image to RAM. Later
-it may implement more functions connected to the SPL.
-
-SUBCOMMAND EXPORT
-To execute the command everything has to be in place as if bootm should be
-used. (kernel image, initrd-image, fdt-image etc.)
-
-export has two subcommands:
-	atags: exports the ATAGS
-	fdt: exports the FDT
-
-Call is:
-spl export <fdt|atags> [kernel_addr] [initrd_addr] [fdt_addr if fdt]
-
-
-TYPICAL CALL
-
-on OMAP3:
-nandecc hw
-nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/
-spl export atags			/* export ATAGS */
-nand erase 0x680000 0x20000		/* erase - one page */
-nand write 0x80000100 0x680000 0x20000	/* write the image - one page */
-
-call with FDT:
-nandecc hw
-nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/
-tftpboot 0x80000100 devkit8000.dtb /* Read fdt */
-spl export fdt 0x82000000 - 0x80000100	/* export FDT */
-nand erase 0x680000 0x20000		/* erase - one page */
-nand write <adress shown by spl export> 0x680000 0x20000
doc/usage/cmd/spl.rst new file +0 -0
new file mode 100644
index 000000000000..59471c65a623

doc/usage/cmd/spl.rst line 1

Quoted 1 line
doc/usage/cmd/spl.rst new file +1 -0
@@ -0,0 +1,48 @@
+.. SPDX-License-Identifier: GPL-2.0+:

%s/GPL-2.0+/GPL-2.0-OR-LATER/

Quoted 1 line

Cf. https://spdx.org/licenses/GPL-2.0-or-later.html

Yes, and it's not a hard requirement to use the new tag, checkpatch.pl doesn't even complain. I got this from the existing command I copied, FWIW.

Quoted 18 lines
Quoted 4 lines
doc/usage/cmd/spl.rst new file +3 -0
+
+.. index::
+   single: spl (command)

doc/usage/cmd/spl.rst line 14

Quoted 10 lines
doc/usage/cmd/spl.rst new file +10 -0
+
+spl command
+===========
+
+Synopsis
+--------
+
+::
+
+    spl export <fdt|atags> [kernel_addr] [initrd_addr] [fdt_addr if fdt]

Those brackets cannot be correct. I definitively cannot remove the kernel_addr and provide an initrd_addr instead. Do you mean:

Quoted 5 lines
Quoted 1 line

spl export <fdt|atags> [kernel_addr [initrd_addr [fdt_addr if fdt]]]

It's what the command itself says currently, however.

I'd be happy to do a follow-up patch to fix both.

I am fine with the current patch if you supply the follow up.

Quoted 111 lines
Quoted 9 lines

doc/usage/cmd/spl.rst line 19

Quoted 6 lines
doc/usage/cmd/spl.rst new file +5 -0
+
+Description
+-----------
+
+The *spl* command is used to export a boot parameter image to RAM. Later

In the current state the man-page is not very helpful. Please, move the more extensive description from doc/develop/falcon.rst here.

As I said in the commit message, it's a conversion with minimal changes. I'd be happy to do a follow-up however improving it (and making cmd/spl.c's help text also better/correct).

Quoted 8 lines

* I would not know what a "boot parameter image" might be. Please, explain
it for a novice user.
* Please, describe what each parameter is used for.
* Please, explain what atags refers to. I would assume you mean what is
described in https://developer.arm.com/documentation/den0013/0400/Boot-Code/Booting-Linux/Kernel-parameters-using-ATAGs.
But don't expect a novice user to know.
* What does the command do if "fdt" is used?

Quoted 6 lines

doc/usage/cmd/spl.rst line 23

Quoted 4 lines
doc/usage/cmd/spl.rst new file +4 -0
+it may implement more functions connected to the SPL.
+
+spl export
+~~~~~~~~~~

This heading makes no sense.

I just copied doc/usage/cmd/acpi.rst for format as it's the first file. I'd be happy to look at a better example.

Quoted 7 lines

doc/usage/cmd/spl.rst line 25

Quoted 1 line
doc/usage/cmd/spl.rst new file +1 -0
+To execute the command everything has to be in place as if bootm should be

Bootm can for instance boot a FIT image with an EFI binary.
I wouldn't expect this to work when booting in Falcon mode where EFI is not available.

This sentence should be replaced by a meaningful description.

I don't understand what's unclear, sorry. And yes, Falcon mode and EFI aren't compatible, but that should be spelled out in doc/develop/falcon.rst and not here I think.

Quoted 9 lines

doc/usage/cmd/spl.rst line 27

Quoted 3 lines
doc/usage/cmd/spl.rst new file +2 -0
+used. (kernel image, initrd-image, fdt-image if used). The first argument
+passed to the export subcommand must be either atags or fdt, which signifies if

%s/signifies/indicates/

doc/usage/cmd/spl.rst line 28

Quoted 1 line
doc/usage/cmd/spl.rst new file +1 -0
+we are preparing an ATAGS or device tree for export.

Isn't ATAGs the plural form of ATAG?

The most consistent usage is "ATAGS" and not "ATAGs".

Quoted 7 lines

Why would you write 'an ATAGS' if there are multiple tags?

Please, describe under which circumstances and with which values these environment variables are filled and what they are used for.

* fdtargsaddr
* fdtargslen

These are covered in doc/develop/falcon.rst which should be linked from this document I think.

Quoted 11 lines

doc/usage/cmd/spl.rst line 36

Quoted 8 lines
doc/usage/cmd/spl.rst new file +8 -0
+
+Example
+-------
+
+On an OMAP3 platform with ATAGS::
+
+    => nandecc hw
+    => nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/

What format must the image have to be used for booting? A FIT image?

Quoted 6 lines

doc/usage/cmd/spl.rst line 37

Quoted 1 line
doc/usage/cmd/spl.rst new file +1 -0
+    => spl export atags			/* export ATAGS */

Is spl export atags never used with kernel_addr, initrd_addr, fdt_addr?

Does spl export atags without further arguments create any ATAGs? Where would it take the values from?

Working with ATAGS was indeed "fun". I'd honestly rather follow-up and remove ATAGS support from Falcon mode since it's 2025 and not 2012, but the point of this patch is to move doc/README.* content to rST so that we can then go "oof, that needs work" and try and improve it.

Quoted 6 lines

doc/usage/cmd/spl.rst line 39

Quoted 2 lines
doc/usage/cmd/spl.rst new file +2 -0
+    => nand erase 0x680000 0x20000		/* erase - one page */
+    => nand write 0x80000100 0x680000 0x20000	/* write the image - one page */

What is written to nand here?
What relevance have these magic addresses?
How would a user know which address to use?

More of the magic of ATAGS, which we can be glad aren't relevant anymore. It's always at that magic 0x100 offset. And the "on OMAP3" is the key to decoding the rest.

Quoted 9 lines

doc/usage/cmd/spl.rst line 46

Quoted 6 lines
doc/usage/cmd/spl.rst new file +6 -0
+On an OMAP3 platform with device tree::
+
+    => nandecc hw
+    => nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/
+    => tftpboot 0x80000100 devkit8000.dtb /* Read fdt */
+    => spl export fdt 0x82000000 - 0x80000100	/* export FDT */

Why would anybody use a device-tree from a TFTP server in conjunction with a kernel from nand?

Quoted 3 lines

It was the example at the time. But, because there's not a device tree on NAND, that's what spl export is creating.

It is unclear what the command does due to the incompleteness of this man-page.

Is it copying the device-tree? Is it creating ATAGs?

Is it adding ATAGs to a device-tree copy?

Quoted 15 lines
Quoted 7 lines

doc/usage/cmd/spl.rst line 46

Quoted 3 lines
doc/usage/cmd/spl.rst new file +2 -0
+    => nand erase 0x680000 0x20000		/* erase - one page */
+    => nand write <adress shown by spl export> 0x680000 0x20000

The address seems to be gd->bd->bi_boot_params which is hard coded in board files and not visible to the user. This is just gruesome. The address should be exported to a variable to be usable in scripts.

Preparing a board for falcon mode isn't a general task, you need to know what your platform is and where things are because you're about to make it a lot less flexible.

Quoted 3 lines

Which customizing is needed to use the spl command? These settings seem to be relevant and should be described in sufficient detail:

Quoted 7 lines
Quoted 5 lines

CONFIG_CMD_SPL
CONFIG_OF_LIBFDT
CONFIG_CMD_SPL_WRITE_SIZE
CONFIG_SUPPORT_PASSING_ATAGS
CONFIG_SYS_BOOT_RAMDISK_HIGH

Some of these I suspect so, yes.

All of these impact the spl command.

Best regards

Heinrich

Quoted 9 lines
Quoted 2 lines

Which return values does the command provide?

Only the standard ones. A quick grep on "on success" in doc/usage/cmd says we aren't consistent about this phrasing nor inclusion to start with. I think we should update the "General rules" section of doc/usage/cmdline.rst to state that "The return value $? is 0 (true) on success and 1 (false) on failure unless otherwise noted.".

author
#4 lore raw
Quoted 90 lines · Heinrich Schuchardt

Am 13. September 2025 17:18:07 MESZ schrieb Tom Rini <[email protected]>:

Quoted 89 lines · Heinrich Schuchardt
Quoted 64 lines · Tom Rini
Quoted 59 lines

This converts the existing README.commands.spl file to rST as doc/usage/cmd/spl.rst and adds it to the command index. Minimal rewording is done to the previous contents, to make it fit better with the overall style of documentation now.

---
Cc: Heinrich Schuchardt <[email protected]>

---
  doc/README.commands.spl | 31 --------------------------
  doc/usage/cmd/spl.rst   | 48 +++++++++++++++++++++++++++++++++++++++++
  doc/usage/index.rst     |  1 +
  3 files changed, 49 insertions(+), 31 deletions(-)

delete mode 100644 doc/README.commands.spl
create mode 100644 doc/usage/cmd/spl.rst

doc/README.commands.spl deleted +0 -31
deleted file mode 100644
index ecfd3ca9ee58..000000000000
@@ -1,31 +0,0 @@
-The spl command is used to export a boot parameter image to RAM. Later
-it may implement more functions connected to the SPL.
-
-SUBCOMMAND EXPORT
-To execute the command everything has to be in place as if bootm should be
-used. (kernel image, initrd-image, fdt-image etc.)
-
-export has two subcommands:
-	atags: exports the ATAGS
-	fdt: exports the FDT
-
-Call is:
-spl export <fdt|atags> [kernel_addr] [initrd_addr] [fdt_addr if fdt]
-
-
-TYPICAL CALL
-
-on OMAP3:
-nandecc hw
-nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/
-spl export atags			/* export ATAGS */
-nand erase 0x680000 0x20000		/* erase - one page */
-nand write 0x80000100 0x680000 0x20000	/* write the image - one page */
-
-call with FDT:
-nandecc hw
-nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/
-tftpboot 0x80000100 devkit8000.dtb /* Read fdt */
-spl export fdt 0x82000000 - 0x80000100	/* export FDT */
-nand erase 0x680000 0x20000		/* erase - one page */
-nand write <adress shown by spl export> 0x680000 0x20000
doc/usage/cmd/spl.rst new file +0 -0
new file mode 100644
index 000000000000..59471c65a623

doc/usage/cmd/spl.rst line 1

Quoted 1 line
doc/usage/cmd/spl.rst new file +1 -0
@@ -0,0 +1,48 @@
+.. SPDX-License-Identifier: GPL-2.0+:

%s/GPL-2.0+/GPL-2.0-OR-LATER/

Quoted 1 line

Cf. https://spdx.org/licenses/GPL-2.0-or-later.html

Yes, and it's not a hard requirement to use the new tag, checkpatch.pl doesn't even complain. I got this from the existing command I copied, FWIW.

Quoted 18 lines
Quoted 4 lines
doc/usage/cmd/spl.rst new file +3 -0
+
+.. index::
+   single: spl (command)

doc/usage/cmd/spl.rst line 14

Quoted 10 lines
doc/usage/cmd/spl.rst new file +10 -0
+
+spl command
+===========
+
+Synopsis
+--------
+
+::
+
+    spl export <fdt|atags> [kernel_addr] [initrd_addr] [fdt_addr if fdt]

Those brackets cannot be correct. I definitively cannot remove the kernel_addr and provide an initrd_addr instead. Do you mean:

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

spl export <fdt|atags> [kernel_addr [initrd_addr [fdt_addr if fdt]]]

It's what the command itself says currently, however.

I'd be happy to do a follow-up patch to fix both.

I am fine with the current patch if you supply the follow up.

OK. But I also think that based on some of your questions, the first step is to just rip out ATAGS from here. We have zero cases in tree of ATAGS and SPL_OS_BOOT support, and this is an extremely legacy case. Deleting that will make things a bit clearer overall. The next part is that yes, two sentences doesn't explain what's going on here well if you don't already know what's going on here.

Signature · 1 line
Tom
#5 lore raw

Am 15. September 2025 19:42:31 MESZ schrieb Tom Rini <[email protected]>:

Quoted 97 lines · Heinrich Schuchardt
Quoted 96 lines

Am 13. September 2025 17:18:07 MESZ schrieb Tom Rini <[email protected]>:

Quoted 94 lines · Heinrich Schuchardt
Quoted 64 lines · Tom Rini
Quoted 59 lines

This converts the existing README.commands.spl file to rST as doc/usage/cmd/spl.rst and adds it to the command index. Minimal rewording is done to the previous contents, to make it fit better with the overall style of documentation now.

---
Cc: Heinrich Schuchardt <[email protected]>

---
  doc/README.commands.spl | 31 --------------------------
  doc/usage/cmd/spl.rst   | 48 +++++++++++++++++++++++++++++++++++++++++
  doc/usage/index.rst     |  1 +
  3 files changed, 49 insertions(+), 31 deletions(-)

delete mode 100644 doc/README.commands.spl
create mode 100644 doc/usage/cmd/spl.rst

doc/README.commands.spl deleted +0 -31
deleted file mode 100644
index ecfd3ca9ee58..000000000000
@@ -1,31 +0,0 @@
-The spl command is used to export a boot parameter image to RAM. Later
-it may implement more functions connected to the SPL.
-
-SUBCOMMAND EXPORT
-To execute the command everything has to be in place as if bootm should be
-used. (kernel image, initrd-image, fdt-image etc.)
-
-export has two subcommands:
-	atags: exports the ATAGS
-	fdt: exports the FDT
-
-Call is:
-spl export <fdt|atags> [kernel_addr] [initrd_addr] [fdt_addr if fdt]
-
-
-TYPICAL CALL
-
-on OMAP3:
-nandecc hw
-nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/
-spl export atags			/* export ATAGS */
-nand erase 0x680000 0x20000		/* erase - one page */
-nand write 0x80000100 0x680000 0x20000	/* write the image - one page */
-
-call with FDT:
-nandecc hw
-nand read 0x82000000 0x280000 0x400000	/* Read kernel image from NAND*/
-tftpboot 0x80000100 devkit8000.dtb /* Read fdt */
-spl export fdt 0x82000000 - 0x80000100	/* export FDT */
-nand erase 0x680000 0x20000		/* erase - one page */
-nand write <adress shown by spl export> 0x680000 0x20000
doc/usage/cmd/spl.rst new file +0 -0
new file mode 100644
index 000000000000..59471c65a623

doc/usage/cmd/spl.rst line 1

Quoted 1 line
doc/usage/cmd/spl.rst new file +1 -0
@@ -0,0 +1,48 @@
+.. SPDX-License-Identifier: GPL-2.0+:

%s/GPL-2.0+/GPL-2.0-OR-LATER/

Quoted 1 line

Cf. https://spdx.org/licenses/GPL-2.0-or-later.html

Yes, and it's not a hard requirement to use the new tag, checkpatch.pl doesn't even complain. I got this from the existing command I copied, FWIW.

Quoted 18 lines
Quoted 4 lines
doc/usage/cmd/spl.rst new file +3 -0
+
+.. index::
+   single: spl (command)

doc/usage/cmd/spl.rst line 14

Quoted 10 lines
doc/usage/cmd/spl.rst new file +10 -0
+
+spl command
+===========
+
+Synopsis
+--------
+
+::
+
+    spl export <fdt|atags> [kernel_addr] [initrd_addr] [fdt_addr if fdt]

Those brackets cannot be correct. I definitively cannot remove the kernel_addr and provide an initrd_addr instead. Do you mean:

Quoted 1 line

spl export <fdt|atags> [kernel_addr [initrd_addr [fdt_addr if fdt]]]

It's what the command itself says currently, however.

I'd be happy to do a follow-up patch to fix both.

Quoted 9 lines
Quoted 1 line

I am fine with the current patch if you supply the follow up.

OK. But I also think that based on some of your questions, the first step is to just rip out ATAGS from here. We have zero cases in tree of ATAGS and SPL_OS_BOOT support, and this is an extremely legacy case. Deleting that will make things a bit clearer overall. The next part is that yes, two sentences doesn't explain what's going on here well if you don't already know what's going on here.

From what I read ATAGs are used to boot ARM systems that do not yet support device-trees. This seems to be incompatible with our driver model.

Thus, eliminating all ATAG related code is a reasonable way forward.

Best regards

Heinrich