[bootlin/training-materials updates] master: QEMU labs: fix editenv command (712d197a)

Michael Opdenacker michael.opdenacker at bootlin.com
Sun Nov 15 22:46:04 CET 2020

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


commit 712d197aa9523208bf3c86fba9b9d7fe96e0b616
Author: Michael Opdenacker <michael.opdenacker at bootlin.com>
Date:   Sun Nov 15 22:46:04 2020 +0100

    QEMU labs: fix editenv command
    - Add a patch to fix the command (thanks to Arnaud Aujon Chevallier)
    - Also add support for the "bootd" command (boot)
    - Explain that "boot" is a shortcut for "bootd"
    - Tested on U-Boot v2020.04
    Signed-off-by: Michael Opdenacker <michael.opdenacker at bootlin.com>


 .../bootloader/data/vexpress_flags_reset.patch          | 12 ++++++++++++
 labs/sysdev-u-boot-qemu/sysdev-u-boot-qemu.tex          | 17 +++++++++++++----
 .../sysdev-bootloaders-u-boot.tex                       |  4 ++--
 3 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/lab-data/embedded-linux-qemu/bootloader/data/vexpress_flags_reset.patch b/lab-data/embedded-linux-qemu/bootloader/data/vexpress_flags_reset.patch
new file mode 100644
index 00000000..488e9ab7
--- /dev/null
+++ b/lab-data/embedded-linux-qemu/bootloader/data/vexpress_flags_reset.patch
@@ -0,0 +1,12 @@
+diff --git a/board/armltd/vexpress/vexpress_common.c b/board/armltd/vexpress/vexpress_common.c
+index 70f6cd80d5..8fea8ff352 100644
+--- a/board/armltd/vexpress/vexpress_common.c
++++ b/board/armltd/vexpress/vexpress_common.c
+@@ -55,7 +55,6 @@ int board_init(void)
+ {
+ 	gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR;
+ 	gd->bd->bi_arch_number = MACH_TYPE_VEXPRESS;
+-	gd->flags = 0;
+ 	icache_enable();
+ 	flash__init();
diff --git a/labs/sysdev-u-boot-qemu/sysdev-u-boot-qemu.tex b/labs/sysdev-u-boot-qemu/sysdev-u-boot-qemu.tex
index f115ed9b..87f2fdbc 100644
--- a/labs/sysdev-u-boot-qemu/sysdev-u-boot-qemu.tex
+++ b/labs/sysdev-u-boot-qemu/sysdev-u-boot-qemu.tex
@@ -11,9 +11,16 @@ following ones, we will use a QEMU emulated ARM Vexpress Cortex A9 board.
 \section{Configuring U-Boot}
-Download U-Boot v2020.04 and configure it
-to support the ARM Vexpress Cortex A9 board
+Download U-Boot v2020.04.
+First apply a patch that fixes the \code{editenv} command in U-Boot:
+cd u-boot-2020.04
+cat ../data/vexpress_flags_reset.patch | patch -p1
+Now configure U-Boot to support the ARM Vexpress Cortex A9 board
 Get an understanding of U-Boot's configuration and compilation steps
 by reading the \code{README} file, and specifically the {\em Building
@@ -42,6 +49,9 @@ to further edit your bootloader features:
         The above two settings correspond to the arguments of the
         \code{fatload} command.
+\item Also add support for the \code{editenv} (\code{CONFIG_CMD_EDITENV})
+    and \code{bootd} (which can be abbreviated as \code{boot}, \code{CONFIG_CMD_BOOTD})
+    that are not present in the default configuration for our board.
 In recent versions of U-Boot and for some boards, you will
@@ -56,7 +66,6 @@ compiling by using the \code{-jX} option with \code{make}, where X
 is the number of parallel jobs used for compiling. Twice the
 number of CPU cores is a good value.}, which will build U-Boot.
 This generates several binaries, including \code{u-boot} and
diff --git a/slides/sysdev-bootloaders-u-boot/sysdev-bootloaders-u-boot.tex b/slides/sysdev-bootloaders-u-boot/sysdev-bootloaders-u-boot.tex
index 25724459..4db4b2ea 100644
--- a/slides/sysdev-bootloaders-u-boot/sysdev-bootloaders-u-boot.tex
+++ b/slides/sysdev-bootloaders-u-boot/sysdev-bootloaders-u-boot.tex
@@ -235,8 +235,8 @@ GNU ld (crosstool-NG 2.34
       support contributed by Bootlin})...
   \item \code{tftp}, loads a file from the network to RAM (example given later)
   \item \code{ping}, to test the network
-  \item \code{boot}, runs the default boot command, stored in
-    \code{bootcmd}
+  \item \code{bootd} (can be abbreviated as \code{boot}), runs the default
+    boot command, stored in \code{bootcmd}
   \item \code{bootz <address>}, starts a kernel image loaded at the
     given address in RAM

More information about the training-materials-updates mailing list