[bootlin/training-materials updates] master: Boot time: U-Boot Falcon mode lab fixes (5849c2cf)

Michael Opdenacker michael.opdenacker at bootlin.com
Mon May 2 16:26:10 CEST 2022


Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/5849c2cfb167dffadb2895ede99e7b32dd92499f

>---------------------------------------------------------------

commit 5849c2cfb167dffadb2895ede99e7b32dd92499f
Author: Michael Opdenacker <michael.opdenacker at bootlin.com>
Date:   Mon May 2 16:26:10 2022 +0200

    Boot time: U-Boot Falcon mode lab fixes
    
    Signed-off-by: Michael Opdenacker <michael.opdenacker at bootlin.com>


>---------------------------------------------------------------

5849c2cfb167dffadb2895ede99e7b32dd92499f
 labs/boot-time-bootloader/boot-time-bootloader.tex | 66 ++++++++++++----------
 1 file changed, 36 insertions(+), 30 deletions(-)

diff --git a/labs/boot-time-bootloader/boot-time-bootloader.tex b/labs/boot-time-bootloader/boot-time-bootloader.tex
index f08434e6..2228f097 100644
--- a/labs/boot-time-bootloader/boot-time-bootloader.tex
+++ b/labs/boot-time-bootloader/boot-time-bootloader.tex
@@ -84,29 +84,32 @@ Copy this \code{uImage} file to your SD card boot partition.
 We also need a few features to be enabled in the U-Boot SPL. So start
 U-Boot's \code{make menuconfig}:
 \begin{itemize}
-\item In the \code{Environment menu}, make sure that
-      \code{SPL Environment is in a FAT filesystem} is selected
-      (\projconfigval{u-boot}{CONFIG_SPL_ENV_IS_IN_FAT}{y}). This way, we
-      can have a \code{boot_os} environment variable that if set to
-      \code{yes}, will allow to boot Linux directly. See the
-      \projfunc{u-boot}{spl_start_uboot} function in the
-      \projfile{u-boot}{board/ti/am335x/board.c} file for details. A
-      faster option to skip reading the environment would be to
-      modify this function so that it always returns \code{0}.
-\item In the \code{SPL / TPL} menu, enable {\em Support SPL loading
-      and booting of Legacy images}
-      (\projconfigval{u-boot}{CONFIG_SPL_LEGACY_IMAGE_SUPPORT}{y}).
-      That's needed to support loading the legacy \code{uImage} file.
+\item In the \code{SPL / TPL} menu,
+      \begin{itemize}
+      \item Enable {\em Support SPL loading and booting of Legacy images}
+            (\projconfigval{u-boot}{CONFIG_SPL_LEGACY_IMAGE_SUPPORT}{y}).
+            That's needed to support loading the legacy \code{uImage} file.
+      \item Also make sure \projconfigval{u-boot}{CONFIG_SPL_OS_BOOT}{y}
+            ({\em Activate Falcon Mode}).
+            That's the case for our current configuration, but configurations
+            for other boards may not have this by default.
+      \end{itemize}
 \end{itemize}
 
-Also make sure that \projconfigval{u-boot}{CONFIG_SPL_OS_BOOT}{y}
-({\em Activate Falcon Mode}).
-That's the case for our current configuration, but configurations
-for other boards may not have this by default.
+Also modify the \projfunc{u-boot}{spl_start_uboot} function in the
+\projfile{u-boot}{board/ti/am335x/board.c}, to remove the block
+of lines under \code{#ifdef CONFIG_SPL_ENV_SUPPORT}. There seems to be
+issues loading the environment from FAT, and loading an environment file
+from a file is expensive anyway. Note that in the current U-Boot code,
+we cannot disable \projconfig{u-boot}{CONFIG_SPL_ENV_SUPPORT}, because
+it breaks some driver code.
 
-Compile U-Boot again
-and copy the \code{u-boot.img} and \code{MLO} files to the boot
-partition too.
+Look at the rest of the \projfile{u-boot}{board/ti/am335x/board.c} file:
+we can still fall back to starting U-Boot if we send a \code{c} key
+in the serial console.
+
+Compile U-Boot again and copy the \code{u-boot.img} and \code{MLO}
+files to the boot partition.
 
 Now, let's run the final preparation step. We will set the
 \code{bootargs} environment variable, load the kernel and DTB, and
@@ -166,6 +169,9 @@ the SPL and the kernel.
 
 If this doesn't work yet, please ask your instructor for advice and help.
 
+You can also try to send \code{c} characters at reset time to make
+the SPL fall back to loading U-Boot.
+
 When it works, update your table again:
 
 \begin{tabular}{| l | l | r |}
@@ -189,20 +195,20 @@ When it works, update your table again:
 There are several things we can do to try to further optimize things:
 
 \begin{itemize}
-\item Reduce the features of the U-Boot SPL to make it load faster,
-      modify \projfunc{u-boot}{spl_start_uboot} so that it doesn't have
-      to load an environment. Also try loading the \code{uImage} file
-      directly from raw MMC, so that there is no FAT intermediate layer.
+\item Remove the warnings and information messages from the SPL
+      to save a bit of time.
+\item Reduce the features of the U-Boot SPL to make it load faster.
+\item Make the SPL load the \code{uImage} file directly from raw MMC,
+      so that there is no FAT intermediate layer.
 \item As our storage is now faster, it can be interesting to explore the
       various kernel compression schemes again. The optimum solution may be a
       different one.
 \item Look for a solution to eliminate the delay detecting the USB
       webcam.
-\item If you don't manage to get rid of this delay, at least take
-      advantage of this spare time to show signs of life on the screen, by
-      implementing a splashscreen. You can even implement an animation.
-      One thing you can do is use BusyBox's \code{fbsplash} tool, to first
-      show an image on the framebuffer, and then even show a progress bar
-      (knowing how much time you have to wait for the camera to be ready).
+\item If you don't manage to get rid of this delay, an idea is to modify
+      \code{ffmpeg} to wait for the video device once it's ready to
+      access it. This way, you start loading and initializing
+      \code{ffmpeg} right away, and the video can be played as soon as
+      the video device is ready. Parallelism always helps!
 \end{itemize}
 




More information about the training-materials-updates mailing list