Re: [U-Boot] [PATCH v4 1/3] Add README for the Falcon mode

2012-11-24 Thread Stefano Babic
On 23/11/2012 19:10, Vikram Narayanan wrote:
 Hi Stefano,
 
 Sorry for bumping in at v4. Below are some of my comments.
 

No problems, all reviews are welcome ! I fix your comments in V5.

 
 If the offset is known at compile time, why should the end user use the
 above commands to write it? Can't it be automated? Just an idea.

No, it's not - Andreas have already given links to previous threads
where this issue was discussed.

Best regards,
Stefano

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 1/3] Add README for the Falcon mode

2012-11-24 Thread Vikram Narayanan

Hello Andreas,

On 11/24/2012 3:29 AM, Andreas Bießmann wrote:

Dear Vikram Narayanan,

On 23.11.12 19:10, Vikram Narayanan wrote:

snip


+The parameters generated with this step can be saved into NAND at the
offset
+0x80 (value for twister for CONFIG_CMD_SPL_NAND_OFS)
+
+nand erase.part bootparms
+nand write 0x8100 bootparms 0x4000


If the offset is known at compile time, why should the end user use the
above commands to write it? Can't it be automated? Just an idea.


No, please read
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/102326
or
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/147205



Thanks. Clarified.

Regards,
Vikram
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v4 1/3] Add README for the Falcon mode

2012-11-23 Thread Stefano Babic
Simple howto to add support to a board
for booting the kernel from SPL (Falcon mode).

Signed-off-by: Stefano Babic sba...@denx.de
---
Changes in v4:
- fix capitalization, styling, in spl help (Andreas Biessmann)
- move CONFIG_SPL_OS_BOOT before function in doc (Andreas Biessmann)

Changes in v3:
- parameter initrd_addr was removed in V2 (Andreas Biessmann)
- added patch to fix help usage for spl export (Andreas Biessmann)
- Added empty lines (Otavio Salvador)
- add a more exhaustive description explaining that
  spl export does not save into media (Lukasz Majewski).

Changes in v2:
- spelling, language fixes (Andreas Biessman)
- rewrite some unclear sentences
- drop CONFIG_SPL_OS_BOOT_KEY
- make example with twister more exhaustive

 doc/README.falcon |  173 +
 1 file changed, 173 insertions(+)
 create mode 100644 doc/README.falcon

diff --git a/doc/README.falcon b/doc/README.falcon
new file mode 100644
index 000..1c041ea
--- /dev/null
+++ b/doc/README.falcon
@@ -0,0 +1,173 @@
+U-Boot Falcon Mode
+
+
+Introduction
+
+
+This document provides an overview how to add support for Falcon Mode
+to a board.
+Falcon Mode is introduced to speed up the booting process, allowing
+to boot a Linux kernel (or whatever image) without a full blown U-Boot.
+
+Falcon Mode relies on the SPL framework. In fact, to make booting faster,
+U-Boot is split into two parts: the SPL (Secondary Program Loader) and U-Boot
+image. In most implementations, SPL is used to start U-Boot when booting from
+a mass storage, such as NAND or SD-Card. SPL has now support for other media,
+and can be generalized seen as a way to start an image performing the minimum
+required initialization. SPL initializes mainly the RAM controller, and after
+that copies U-Boot image into the memory. The Falcon Mode extends this way
+allowing to start the Linux kernel directly from SPL. A new command is added
+to U-Boot to prepare the parameters that SPL must pass to the kernel, using
+ATAGS or Device Tree.
+
+Falcon Mode adds a command under U-Boot to reuse all code responsible to 
prepare
+the interface with the kernel. In usual U-Boot systems, these parameters are
+generated each time before loading the kernel, passing to Linux the address
+in memory where the parameters can be read.
+With Falcon Mode, this snapshot can be saved into persistent storage and SPL is
+informed to load it before running the kernel.
+
+To boot the kernel, these steps under a Falcon-aware U-Boot are required:
+
+1. Boot the board into U-Boot.
+Use the spl export command to generate the kernel parameters area or the DT.
+U-Boot runs as when it boots the kernel, but stops before passing the control
+to the kernel.
+
+2. Save the prepared snapshot into persistent media.
+The address where to save it must be configured into board configuration
+file (CONFIG_CMD_SPL_NAND_OFS for NAND).
+
+3. Boot the board into Falcon Mode. SPL will load the kernel and copy
+the parameters area to the required address.
+
+It is required to implement a custom mechanism to select if SPL loads U-Boot
+or another image.
+
+The value of a GPIO is a simple way to operate the selection, as well as
+reading a character from the SPL console if CONFIG_SPL_CONSOLE is set.
+
+Falcon Mode is generally activated by setting CONFIG_SPL_OS_BOOT. This tells
+SPL that U-Boot is not the only available image that SPL is able to start.
+
+Configuration
+
+CONFIG_CMD_SPL Enable the spl export command.
+   The command spl export is then available in U-Boot
+   mode
+CONFIG_SYS_SPL_ARGS_ADDR   Address in RAM where the parameters must be
+   copied by SPL.
+   In most cases, it is start_of_ram + 0x100
+
+CONFIG_SYS_NAND_SPL_KERNEL_OFFSOffset in NAND where the kernel is 
stored
+
+CONFIG_CMD_SPL_NAND_OFSOffset in NAND where the parameters area was 
saved.
+
+CONFIG_CMD_SPL_WRITE_SIZE  Size of the parameters area to be copied
+
+CONFIG_SPL_OS_BOOT Activate Falcon Mode.
+   A board should implement the following functions:
+
+Function that a board must implement
+
+
+void spl_board_prepare_for_linux(void) : optional
+   Called from SPL before starting the kernel
+
+spl_start_uboot() : required
+   Returns 0 if SPL starts the kernel, 1 if U-Boot
+   must be started.
+
+
+Using spl command
+-
+
+spl - SPL configuration
+
+Usage:
+
+spl export img=atags|fdt [kernel_addr] [initrd_addr] [fdt_addr ]
+
+img: atags or fdt
+kernel_addr: kernel is loaded as part of the boot process, but it is not 
started.
+ This is the address where a kernel image is stored.
+initrd_addr: Address of initial ramdisk
+ can be set to - if fdt_addr without initrd img 

Re: [U-Boot] [PATCH v4 1/3] Add README for the Falcon mode

2012-11-23 Thread Vikram Narayanan

Hi Stefano,

Sorry for bumping in at v4. Below are some of my comments.

On 11/23/2012 9:01 PM, Stefano Babic wrote:

Simple howto to add support to a board
for booting the kernel from SPL (Falcon mode).

Signed-off-by: Stefano Babicsba...@denx.de
---
Changes in v4:
- fix capitalization, styling, in spl help (Andreas Biessmann)
- move CONFIG_SPL_OS_BOOT before function in doc (Andreas Biessmann)


snip

diff --git a/doc/README.falcon b/doc/README.falcon
new file mode 100644
index 000..1c041ea
--- /dev/null
+++ b/doc/README.falcon
@@ -0,0 +1,173 @@
+U-Boot Falcon Mode
+
+
+Introduction
+
+
+This document provides an overview how to add support for Falcon Mode


s/an overview/an overview of/


+to a board.
+Falcon Mode is introduced to speed up the booting process, allowing
+to boot a Linux kernel (or whatever image) without a full blown U-Boot.
+
+Falcon Mode relies on the SPL framework. In fact, to make booting faster,
+U-Boot is split into two parts: the SPL (Secondary Program Loader) and U-Boot
+image. In most implementations, SPL is used to start U-Boot when booting from
+a mass storage, such as NAND or SD-Card. SPL has now support for other media,
+and can be generalized seen as a way to start an image performing the minimum


Rephrase the above line as,
and can generally be seen 


+required initialization. SPL initializes mainly the RAM controller, and after
+that copies U-Boot image into the memory. The Falcon Mode extends this way


Rephrase ..

SPL mainly initializes the RAM controller, and then copies U-boot image 
to the main memory.



+allowing to start the Linux kernel directly from SPL. A new command is added
+to U-Boot to prepare the parameters that SPL must pass to the kernel, using
+ATAGS or Device Tree.
+
+Falcon Mode adds a command under U-Boot to reuse all code responsible to 
prepare


Already it is mentioned that 'a new command is added'. The above line is 
redundant then. Please rephrase it.



+the interface with the kernel. In usual U-Boot systems, these parameters are
+generated each time before loading the kernel, passing to Linux the address
+in memory where the parameters can be read.
+With Falcon Mode, this snapshot can be saved into persistent storage and SPL is
+informed to load it before running the kernel.
+
+To boot the kernel, these steps under a Falcon-aware U-Boot are required:
+
+1. Boot the board into U-Boot.
+Use the spl export command to generate the kernel parameters area or the DT.
+U-Boot runs as when it boots the kernel, but stops before passing the control
+to the kernel.
+
+2. Save the prepared snapshot into persistent media.
+The address where to save it must be configured into board configuration
+file (CONFIG_CMD_SPL_NAND_OFS for NAND).
+
+3. Boot the board into Falcon Mode. SPL will load the kernel and copy
+the parameters area to the required address.


copy the parameters which is saved in the persistent media to the 


+
+It is required to implement a custom mechanism to select if SPL loads U-Boot
+or another image.
+
+The value of a GPIO is a simple way to operate the selection, as well as
+reading a character from the SPL console if CONFIG_SPL_CONSOLE is set.
+
+Falcon Mode is generally activated by setting CONFIG_SPL_OS_BOOT. This tells
+SPL that U-Boot is not the only available image that SPL is able to start.
+
+Configuration
+
+CONFIG_CMD_SPL Enable the spl export command.
+   The command spl export is then available in U-Boot
+   mode
+CONFIG_SYS_SPL_ARGS_ADDR   Address in RAM where the parameters must be
+   copied by SPL.
+   In most cases, it isstart_of_ram  + 0x100


A space in between is and ''


+
+CONFIG_SYS_NAND_SPL_KERNEL_OFFSOffset in NAND where the kernel is 
stored
+
+CONFIG_CMD_SPL_NAND_OFSOffset in NAND where the parameters area was 
saved.


Can the above be renamed to include the word 'PARAMS'? But becomes 
lengthy. Any suggestions?



+
+CONFIG_CMD_SPL_WRITE_SIZE  Size of the parameters area to be copied
+
+CONFIG_SPL_OS_BOOT Activate Falcon Mode.
+   A board should implement the following functions:


Is there a big difference between the line above and the one below?


+Function that a board must implement
+
+
+void spl_board_prepare_for_linux(void) : optional
+   Called from SPL before starting the kernel
+
+spl_start_uboot() : required
+   Returns 0 if SPL starts the kernel, 1 if U-Boot
+   must be started.
+
+
+Using spl command
+-
+
+spl - SPL configuration
+
+Usage:
+
+spl exportimg=atags|fdt  [kernel_addr] [initrd_addr] [fdt_addr ]
+
+img: atags or fdt
+kernel_addr: kernel is loaded as part of the boot process, but it is not 
started.
+ This is the address where a kernel image is stored.

Re: [U-Boot] [PATCH v4 1/3] Add README for the Falcon mode

2012-11-23 Thread Andreas Bießmann
Dear Vikram Narayanan,

On 23.11.12 19:10, Vikram Narayanan wrote:

snip

 +The parameters generated with this step can be saved into NAND at the
 offset
 +0x80 (value for twister for CONFIG_CMD_SPL_NAND_OFS)
 +
 +nand erase.part bootparms
 +nand write 0x8100 bootparms 0x4000
 
 If the offset is known at compile time, why should the end user use the
 above commands to write it? Can't it be automated? Just an idea.

No, please read
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/102326
or
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/147205

Best regards

Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot