[FE training-materials-updates] sysdev kernel lab: now boot with device tree

Michael Opdenacker michael.opdenacker at free-electrons.com
Tue Oct 15 16:40:25 CEST 2013


Repository : git://git.free-electrons.com/training-materials.git

On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=69c8d7160e6a087b9aea034cd2ccf473e0006932

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

commit 69c8d7160e6a087b9aea034cd2ccf473e0006932
Author: Michael Opdenacker <michael.opdenacker at free-electrons.com>
Date:   Tue Oct 15 16:36:33 2013 +0200

    sysdev kernel lab: now boot with device tree
    
    - Note that the slides will have to be completed too
    - The NAND offsets in the next labs haven't been updated
      yet.
    
    Signed-off-by: Michael Opdenacker <michael.opdenacker at free-electrons.com>


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

69c8d7160e6a087b9aea034cd2ccf473e0006932
 labs/sysdev-kernel-cross-compiling/flash-map.dia   |  216 ++++++++++++++------
 .../sysdev-kernel-cross-compiling.tex              |   93 +++++----
 2 files changed, 217 insertions(+), 92 deletions(-)

diff --git a/labs/sysdev-kernel-cross-compiling/flash-map.dia b/labs/sysdev-kernel-cross-compiling/flash-map.dia
index f11bbf0..20395d5 100644
--- a/labs/sysdev-kernel-cross-compiling/flash-map.dia
+++ b/labs/sysdev-kernel-cross-compiling/flash-map.dia
@@ -94,14 +94,14 @@
     </dia:object>
     <dia:object type="Standard - Line" version="0" id="O1">
       <dia:attribute name="obj_pos">
-        <dia:point val="25,8.2"/>
+        <dia:point val="22.1,8.2"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="24.95,8.15;25.05,12.05"/>
+        <dia:rectangle val="22.05,8.15;22.15,12.05"/>
       </dia:attribute>
       <dia:attribute name="conn_endpoints">
-        <dia:point val="25,8.2"/>
-        <dia:point val="25,12"/>
+        <dia:point val="22.1,8.2"/>
+        <dia:point val="22.1,12"/>
       </dia:attribute>
       <dia:attribute name="numcp">
         <dia:int val="1"/>
@@ -145,10 +145,10 @@
     </dia:object>
     <dia:object type="Standard - Text" version="1" id="O3">
       <dia:attribute name="obj_pos">
-        <dia:point val="19.0863,13.8055"/>
+        <dia:point val="18.6113,13.8055"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="19.0863,13.438;20.7488,13.9005"/>
+        <dia:rectangle val="18.6113,13.438;20.2738,13.9005"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
@@ -162,7 +162,7 @@
             <dia:real val="0.49388886988162994"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="19.0863,13.8055"/>
+            <dia:point val="18.6113,13.8055"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000"/>
@@ -178,10 +178,10 @@
     </dia:object>
     <dia:object type="Standard - Text" version="1" id="O4">
       <dia:attribute name="obj_pos">
-        <dia:point val="23.9512,13.0379"/>
+        <dia:point val="21.0512,13.0379"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="23.9512,12.6704;25.8512,13.1329"/>
+        <dia:rectangle val="21.0512,12.6704;22.9512,13.1329"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
@@ -195,7 +195,7 @@
             <dia:real val="0.49388886988162994"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="23.9512,13.0379"/>
+            <dia:point val="21.0512,13.0379"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000"/>
@@ -232,14 +232,14 @@
     </dia:object>
     <dia:object type="Standard - Line" version="0" id="O6">
       <dia:attribute name="obj_pos">
-        <dia:point val="20,12"/>
+        <dia:point val="19.525,12"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="19.975,11.975;20.025,13.425"/>
+        <dia:rectangle val="19.5,11.975;19.55,13.425"/>
       </dia:attribute>
       <dia:attribute name="conn_endpoints">
-        <dia:point val="20,12"/>
-        <dia:point val="20,13.4"/>
+        <dia:point val="19.525,12"/>
+        <dia:point val="19.525,13.4"/>
       </dia:attribute>
       <dia:attribute name="numcp">
         <dia:int val="1"/>
@@ -250,14 +250,14 @@
     </dia:object>
     <dia:object type="Standard - Line" version="0" id="O7">
       <dia:attribute name="obj_pos">
-        <dia:point val="25,12"/>
+        <dia:point val="22.1,12"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="24.975,11.975;25.025,12.625"/>
+        <dia:rectangle val="22.075,11.975;22.125,12.625"/>
       </dia:attribute>
       <dia:attribute name="conn_endpoints">
-        <dia:point val="25,12"/>
-        <dia:point val="25,12.6"/>
+        <dia:point val="22.1,12"/>
+        <dia:point val="22.1,12.6"/>
       </dia:attribute>
       <dia:attribute name="numcp">
         <dia:int val="1"/>
@@ -268,10 +268,10 @@
     </dia:object>
     <dia:object type="Standard - Text" version="1" id="O8">
       <dia:attribute name="obj_pos">
-        <dia:point val="25.9998,13.8217"/>
+        <dia:point val="23.0498,13.8217"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="25.9998,13.4542;27.8998,13.9167"/>
+        <dia:rectangle val="23.0498,13.4542;24.9498,13.9167"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
@@ -285,7 +285,7 @@
             <dia:real val="0.49388886988162994"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="25.9998,13.8217"/>
+            <dia:point val="23.0498,13.8217"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000"/>
@@ -301,14 +301,14 @@
     </dia:object>
     <dia:object type="Standard - Line" version="0" id="O9">
       <dia:attribute name="obj_pos">
-        <dia:point val="27,12"/>
+        <dia:point val="24.05,12"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="26.975,11.975;27.025,13.425"/>
+        <dia:rectangle val="24.025,11.975;24.075,13.425"/>
       </dia:attribute>
       <dia:attribute name="conn_endpoints">
-        <dia:point val="27,12"/>
-        <dia:point val="27,13.4"/>
+        <dia:point val="24.05,12"/>
+        <dia:point val="24.05,13.4"/>
       </dia:attribute>
       <dia:attribute name="numcp">
         <dia:int val="1"/>
@@ -319,10 +319,10 @@
     </dia:object>
     <dia:object type="Standard - Text" version="1" id="O10">
       <dia:attribute name="obj_pos">
-        <dia:point val="18.4,10.4"/>
+        <dia:point val="18.225,10.4"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="18.4,9.9275;19.5025,10.52"/>
+        <dia:rectangle val="18.225,9.9275;19.3269,10.52"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
@@ -336,7 +336,7 @@
             <dia:real val="0.63499997556209564"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="18.4,10.4"/>
+            <dia:point val="18.225,10.4"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000"/>
@@ -352,10 +352,10 @@
     </dia:object>
     <dia:object type="Standard - Text" version="1" id="O11">
       <dia:attribute name="obj_pos">
-        <dia:point val="21.6,10.4"/>
+        <dia:point val="19.85,10.4"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="21.6,9.9275;23.305,10.52"/>
+        <dia:rectangle val="19.85,9.9275;21.5544,10.52"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
@@ -369,7 +369,7 @@
             <dia:real val="0.63499997556209564"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="21.6,10.4"/>
+            <dia:point val="19.85,10.4"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000"/>
@@ -385,10 +385,10 @@
     </dia:object>
     <dia:object type="Standard - Text" version="1" id="O12">
       <dia:attribute name="obj_pos">
-        <dia:point val="26,10.2"/>
+        <dia:point val="23.075,10.2"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="25.1475,9.58625;26.8525,10.8137"/>
+        <dia:rectangle val="22.2228,9.58625;23.9272,10.8137"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
@@ -403,7 +403,7 @@ env#</dia:string>
             <dia:real val="0.63499997556209564"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="26,10.0588"/>
+            <dia:point val="23.075,10.0588"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000"/>
@@ -452,14 +452,14 @@ env#</dia:string>
     </dia:object>
     <dia:object type="Standard - Line" version="0" id="O14">
       <dia:attribute name="obj_pos">
-        <dia:point val="27,8.20993"/>
+        <dia:point val="24.05,8.20993"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="26.95,8.15993;27.05,12.05"/>
+        <dia:rectangle val="24,8.15993;24.1,12.05"/>
       </dia:attribute>
       <dia:attribute name="conn_endpoints">
-        <dia:point val="27,8.20993"/>
-        <dia:point val="27,12"/>
+        <dia:point val="24.05,8.20993"/>
+        <dia:point val="24.05,12"/>
       </dia:attribute>
       <dia:attribute name="numcp">
         <dia:int val="1"/>
@@ -474,14 +474,14 @@ env#</dia:string>
     </dia:object>
     <dia:object type="Standard - Line" version="0" id="O15">
       <dia:attribute name="obj_pos">
-        <dia:point val="20,8.2"/>
+        <dia:point val="19.525,8.2"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="19.95,8.15;20.05,12.05"/>
+        <dia:rectangle val="19.475,8.15;19.575,12.05"/>
       </dia:attribute>
       <dia:attribute name="conn_endpoints">
-        <dia:point val="20,8.2"/>
-        <dia:point val="20,12"/>
+        <dia:point val="19.525,8.2"/>
+        <dia:point val="19.525,12"/>
       </dia:attribute>
       <dia:attribute name="numcp">
         <dia:int val="1"/>
@@ -492,14 +492,14 @@ env#</dia:string>
     </dia:object>
     <dia:object type="Standard - Line" version="0" id="O16">
       <dia:attribute name="obj_pos">
-        <dia:point val="29.8,8.2"/>
+        <dia:point val="29.275,8.2"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="29.75,8.15;29.85,12.0401"/>
+        <dia:rectangle val="29.225,8.15;29.325,12.0401"/>
       </dia:attribute>
       <dia:attribute name="conn_endpoints">
-        <dia:point val="29.8,8.2"/>
-        <dia:point val="29.8,11.9901"/>
+        <dia:point val="29.275,8.2"/>
+        <dia:point val="29.275,11.9901"/>
       </dia:attribute>
       <dia:attribute name="numcp">
         <dia:int val="1"/>
@@ -510,10 +510,10 @@ env#</dia:string>
     </dia:object>
     <dia:object type="Standard - Text" version="1" id="O17">
       <dia:attribute name="obj_pos">
-        <dia:point val="28.3,10"/>
+        <dia:point val="27.225,10"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="27.5025,9.70375;29.0975,10.2962"/>
+        <dia:rectangle val="26.4271,9.70375;28.0229,10.2962"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
@@ -527,7 +527,7 @@ env#</dia:string>
             <dia:real val="0.63499997556209564"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="28.3,10.1762"/>
+            <dia:point val="27.225,10.1762"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000"/>
@@ -543,14 +543,14 @@ env#</dia:string>
     </dia:object>
     <dia:object type="Standard - Line" version="0" id="O18">
       <dia:attribute name="obj_pos">
-        <dia:point val="29.8,12"/>
+        <dia:point val="29.275,12"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="29.775,11.975;29.825,12.625"/>
+        <dia:rectangle val="29.25,11.975;29.3,12.625"/>
       </dia:attribute>
       <dia:attribute name="conn_endpoints">
-        <dia:point val="29.8,12"/>
-        <dia:point val="29.8,12.6"/>
+        <dia:point val="29.275,12"/>
+        <dia:point val="29.275,12.6"/>
       </dia:attribute>
       <dia:attribute name="numcp">
         <dia:int val="1"/>
@@ -561,15 +561,15 @@ env#</dia:string>
     </dia:object>
     <dia:object type="Standard - Text" version="1" id="O19">
       <dia:attribute name="obj_pos">
-        <dia:point val="28.8,13"/>
+        <dia:point val="28.25,13"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="28.8,12.6325;30.7,13.095"/>
+        <dia:rectangle val="28.25,12.6325;30.15,13.095"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
           <dia:attribute name="string">
-            <dia:string>#0x7e0000#</dia:string>
+            <dia:string>#0x800000#</dia:string>
           </dia:attribute>
           <dia:attribute name="font">
             <dia:font family="monospace" style="0" name="Courier"/>
@@ -578,7 +578,109 @@ env#</dia:string>
             <dia:real val="0.49388886988162994"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="28.8,13"/>
+            <dia:point val="28.25,13"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="0"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:attribute name="valign">
+        <dia:enum val="3"/>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Text" version="1" id="O20">
+      <dia:attribute name="obj_pos">
+        <dia:point val="24.7,10"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="24.1762,9.70375;25.2237,10.2962"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#DTB#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="sans" style="0" name="Helvetica"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.63499997556209564"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="24.7,10.1762"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="#000000"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="1"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:attribute name="valign">
+        <dia:enum val="2"/>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Line" version="0" id="O21">
+      <dia:attribute name="obj_pos">
+        <dia:point val="25.365,8.195"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="25.315,8.145;25.415,12.0351"/>
+      </dia:attribute>
+      <dia:attribute name="conn_endpoints">
+        <dia:point val="25.365,8.195"/>
+        <dia:point val="25.365,11.9851"/>
+      </dia:attribute>
+      <dia:attribute name="numcp">
+        <dia:int val="1"/>
+      </dia:attribute>
+      <dia:attribute name="line_color">
+        <dia:color val="#868686"/>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Line" version="0" id="O22">
+      <dia:attribute name="obj_pos">
+        <dia:point val="25.365,11.995"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="25.34,11.97;25.39,12.62"/>
+      </dia:attribute>
+      <dia:attribute name="conn_endpoints">
+        <dia:point val="25.365,11.995"/>
+        <dia:point val="25.365,12.595"/>
+      </dia:attribute>
+      <dia:attribute name="numcp">
+        <dia:int val="1"/>
+      </dia:attribute>
+      <dia:attribute name="line_width">
+        <dia:real val="0.05000000074505806"/>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Text" version="1" id="O23">
+      <dia:attribute name="obj_pos">
+        <dia:point val="24.44,12.9875"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="24.44,12.62;26.34,13.0825"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#0x300000#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="monospace" style="0" name="Courier"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="0.49388886988162994"/>
+          </dia:attribute>
+          <dia:attribute name="pos">
+            <dia:point val="24.44,12.9875"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000"/>
diff --git a/labs/sysdev-kernel-cross-compiling/sysdev-kernel-cross-compiling.tex b/labs/sysdev-kernel-cross-compiling/sysdev-kernel-cross-compiling.tex
index 2a08f93..a3bdf22 100644
--- a/labs/sysdev-kernel-cross-compiling/sysdev-kernel-cross-compiling.tex
+++ b/labs/sysdev-kernel-cross-compiling/sysdev-kernel-cross-compiling.tex
@@ -62,16 +62,22 @@ In the kernel configuration :
 
 \begin{itemize}
 
-\item Make sure to disable \code{CONFIG_PROVE_LOCKING}. This option is
-  currently causing problems with the JFFS2 filesystem. This option is
-  in \code{Kernel Hacking} $\rightarrow$
-  \code{Lock debugging: prove locking correctness}.
-
+% TODO: check that we don't need this any more
+%\item Make sure to disable \code{CONFIG_PROVE_LOCKING}. This option is
+%  currently causing problems with the JFFS2 filesystem. This option is
+%  in \code{Kernel Hacking} $\rightarrow$
+%  \code{Lock debugging: prove locking correctness}.
+
+\item Disable support for the IGEPv2 board compiled into the kernel
+  (\code{CONFIG_MACH_IGEP0020}). We will boot our kernel with a device
+  tree for our board, and won't compile the board description
+  file (\code{arch/arm/mach-omap2/board-igep0020.c} in the kernel
+  sources.). You will have to review dependencies to be able to disable
+  this kernel configuration setting. 
 \item As an experiment, let's change the kernel compression from Gzip
   to LZMA. This compression algorithm is far more efficient than Gzip,
   in terms of compression ratio, at the expense of a higher
   decompression time.
-
 \end{itemize}
 
 \section{Cross compiling}
@@ -86,11 +92,13 @@ and wait a while for the kernel to compile. Don't forget to use
 \code{make -j<n>} if you have multiple cores on your machine!
 
 Look at the end of the kernel build output to see which file contains
-the kernel image.
+the kernel image. You can also see the Device Tree \code{.dtb} files
+which got compiled. Find which \code{.dtb} file corresponds to your
+board.
 
 However, the default image produced by the kernel build process is not
 suitable to be booted from U-Boot. A post-processing operation must be
-performed using the mkimage tool provided by U-Boot developers. This
+performed using the \code{mkimage} tool provided by U-Boot developers. This
 tool has already been installed in your system as part of the
 \code{u-boot-tools} package. To run the post-processing operation on
 the kernel image, simply run:
@@ -129,15 +137,18 @@ We will use TFTP to load the kernel image to the IGEP board:
 
 \begin{itemize}
 
-\item On your workstation, make sure your \code{uImage} file is in the
+\item On your workstation, copy the \code{uImage} and DTB files to the
   directory exposed by the TFP server.
 
 \item On the target, load \code{uImage} from TFTP into RAM at address
   0x80000000:\\
   \code{tftp 0x80000000 uImage}
 
-\item Boot the kernel:\\
-  \code{bootm 0x80000000}
+\item Now, also load the DTB file into RAM at address 0x81000000:\\
+  \code{tftp 0x81000000 omap3-igep0020.dtb}
+
+\item Boot the kernel with its device tree:\\
+  \code{bootm 0x80000000 - 0x81000000}
 
 \end{itemize}
 
@@ -150,63 +161,75 @@ Waiting for root device /dev/mmcblk0p2...
 This is expected: we haven't provided a working root filesystem for
 our device yet.
 
-You can automate now all this every time the board is booted or
+You can now automate all this every time the board is booted or
 reset. Reset the board, and specify a different \code{bootcmd}:
 
+{\scriptsize
 \begin{verbatim}
-setenv bootcmd 'tftp 80000000 uImage;bootm 80000000'
+setenv bootcmd 'tftp 80000000 uImage; tftp 81000000 omap3-igep0020.dtb; bootm 80000000 - 81000000'
 saveenv
 \end{verbatim}
+}
 
-\section{Flashing the kernel in NAND flash}
+\section{Flashing the kernel and DTB in NAND flash}
 
 In order to let the kernel boot on the board autonomously, we can
-flash it in the NAND flash available on the IGEP. The NAND flash can
-be manipulated in U-Boot using the \code{nand} command, which
-features several subcommands. Run \code{help nand} to see the
-available subcommands and their options.
+flash the kernel image and DTB in the NAND flash available on the IGEP
+board. See the bootloader lab for details about U-boot's \code{nand}
+command.
 
 After storing the first stage bootloader, U-boot and its environment
-variables, we will keep a special area in NAND flash for the Linux
-kernel image.  This 4th partition will be 5 MiB big, from NAND offset
-0x2e0000 to 0x7e0000.
+variables, we will keep special areas in NAND flash for the DTB
+and Linux kernel images:
 
 \begin{center}
   \includegraphics[width=\textwidth]{labs/sysdev-kernel-cross-compiling/flash-map.pdf}
 \end{center}
 
-So, let's start by erasing the corresponding 5 MiB of NAND flash:
+So, let's start by erasing the corresponding 128 MiB of NAND flash
+for the DTB:
 
 \begin{verbatim}
-nand erase 0x2e0000 0x500000
+nand erase 0x2e0000 0x20000
         (NAND offset) (size)
 \end{verbatim}
 
-Then, copy the kernel from TFTP into memory, using the same address as
-before.
+Then, let's errra the 5 MiB of NAND flash for the kernel image:
+
+\begin{verbatim}
+nand erase 0x300000 0x500000
+\end{verbatim}
+
+Then, copy the DTB and kernel binaries from TFTP into memory, using the
+same addresses as before.
 
-Then, flash the kernel image:
+Then, flash the DTB and kernel binaries:
 
 \begin{verbatim}
-nand write 0x80000000 0x2e0000 0x500000
+nand write 0x81000000 0x2e0000 0x20000
            (RAM addr) (NAND offset) (size)
+nand write 0x80000000 0x300000 0x500000
 \end{verbatim}
 
 Power your board off and on, to clear RAM contents. We should now be
-able to load the kernel image from NAND and boot it using:
+able to load the DTB and kernel image from NAND and boot with:
 
 \begin{verbatim}
-nboot 0x80000000 0        0x2e0000
+nand read 0x81000000 0x2e0000 0x20000
+nboot 0x80000000 0        0x300000
       (RAM addr) (device) (NAND offset)
-bootm 0x80000000
+bootm 0x80000000 - 0x81000000
 \end{verbatim}
 
-\code{nboot} copies the kernel to RAM and then, \code{bootm} executes
-it.
+\code{nboot} copies the kernel to RAM, using the \code{uImage} headers
+to know how many bytes to copy. \footnote{\code{nboot} can save a lot 
+of boot time, as it avoids having to copy a pessimistic number of
+bytes from flash to RAM. Note that U-boot is not always configured
+with \code{nboot} support.}.
 
-Write an U-Boot script that automates the kernel download and flashing
-procedure. Finally, adjust the \code{bootcmd} so that the IGEP board
-boots using the kernel in Flash.
+Write a U-Boot script that automates the DTB + kernel download
+and flashing procedure. Finally, adjust \code{bootcmd} so that
+the IGEP board boots using the kernel in Flash.
 
 Now, power off the board and power it on again to check that it boots
 fine from NAND flash. Check that this is really your own version of



More information about the training-materials-updates mailing list