[FE training-materials-updates] sysdev: Update u-boot lab for the Xplained

Maxime Ripard maxime.ripard at free-electrons.com
Sun Jun 15 22:38:28 CEST 2014


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

On branch  : sysdev-xplained
Link       : http://git.free-electrons.com/training-materials/commit/?id=7970165c7624f4ed8145c86da8fab0852c1157f9

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

commit 7970165c7624f4ed8145c86da8fab0852c1157f9
Author: Maxime Ripard <maxime.ripard at free-electrons.com>
Date:   Thu Jun 5 16:48:40 2014 +0200

    sysdev: Update u-boot lab for the Xplained
    
    Drop the boot from MMC to then flash the bootloaders. It was not very
    convenient for several reasons:
      - We would have to compile both AT91bootstrap and u-boot in their NAND and
        MMC flavors, while storing them on the MMC, which would have been
        confusing.
      - U-boot apparently cannot write an AT91Bootstrap image properly
    
    While sam-ba is convenient enough, and shows how to un-brick your board.
    
    Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>


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

7970165c7624f4ed8145c86da8fab0852c1157f9
 labs/sysdev-u-boot/flash-map.dia     |  341 +++++++++++++++++++-----------
 labs/sysdev-u-boot/sysdev-u-boot.tex |  385 +++++++++++++---------------------
 2 files changed, 372 insertions(+), 354 deletions(-)

diff --git a/labs/sysdev-u-boot/flash-map.dia b/labs/sysdev-u-boot/flash-map.dia
index dfa1f2d..c7d202f 100644
--- a/labs/sysdev-u-boot/flash-map.dia
+++ b/labs/sysdev-u-boot/flash-map.dia
@@ -65,19 +65,19 @@
   <dia:layer name="Arrière-plan" visible="true" active="true">
     <dia:object type="Standard - Box" version="0" id="O0">
       <dia:attribute name="obj_pos">
-        <dia:point val="18,8.20993"/>
+        <dia:point val="16.5,2.5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="17.95,8.15993;36.05,12.05"/>
+        <dia:rectangle val="16.45,2.45;20.05,6.55"/>
       </dia:attribute>
       <dia:attribute name="elem_corner">
-        <dia:point val="18,8.20993"/>
+        <dia:point val="16.5,2.5"/>
       </dia:attribute>
       <dia:attribute name="elem_width">
-        <dia:real val="18"/>
+        <dia:real val="3.5"/>
       </dia:attribute>
       <dia:attribute name="elem_height">
-        <dia:real val="3.7900735359673838"/>
+        <dia:real val="4"/>
       </dia:attribute>
       <dia:attribute name="border_width">
         <dia:real val="0.10000000149011612"/>
@@ -92,30 +92,12 @@
         <dia:boolean val="true"/>
       </dia:attribute>
     </dia:object>
-    <dia:object type="Standard - Line" version="0" id="O1">
+    <dia:object type="Standard - Text" version="1" id="O1">
       <dia:attribute name="obj_pos">
-        <dia:point val="25,8.2"/>
+        <dia:point val="16.5,8.5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="24.95,8.15;25.05,12.05"/>
-      </dia:attribute>
-      <dia:attribute name="conn_endpoints">
-        <dia:point val="25,8.2"/>
-        <dia:point val="25,12"/>
-      </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 - Text" version="1" id="O2">
-      <dia:attribute name="obj_pos">
-        <dia:point val="17.6594,12.9731"/>
-      </dia:attribute>
-      <dia:attribute name="obj_bb">
-        <dia:rectangle val="17.6594,12.6056;18.3719,13.0681"/>
+        <dia:rectangle val="16.1438,8.26875;16.8562,8.73125"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
@@ -129,31 +111,31 @@
             <dia:real val="0.49388886988162994"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="17.6594,12.9731"/>
+            <dia:point val="16.5,8.63625"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000"/>
           </dia:attribute>
           <dia:attribute name="alignment">
-            <dia:enum val="0"/>
+            <dia:enum val="1"/>
           </dia:attribute>
         </dia:composite>
       </dia:attribute>
       <dia:attribute name="valign">
-        <dia:enum val="3"/>
+        <dia:enum val="2"/>
       </dia:attribute>
     </dia:object>
-    <dia:object type="Standard - Text" version="1" id="O3">
+    <dia:object type="Standard - Text" version="1" id="O2">
       <dia:attribute name="obj_pos">
-        <dia:point val="19.0863,13.8055"/>
+        <dia:point val="20,8.5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="19.0863,13.438;20.7488,13.9005"/>
+        <dia:rectangle val="19.1687,8.25141;20.8428,8.74859"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
           <dia:attribute name="string">
-            <dia:string>#0x80000#</dia:string>
+            <dia:string>#0x40000#</dia:string>
           </dia:attribute>
           <dia:attribute name="font">
             <dia:font family="monospace" style="0" name="Courier"/>
@@ -162,31 +144,31 @@
             <dia:real val="0.49388886988162994"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="19.0863,13.8055"/>
+            <dia:point val="20,8.63047"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000"/>
           </dia:attribute>
           <dia:attribute name="alignment">
-            <dia:enum val="0"/>
+            <dia:enum val="1"/>
           </dia:attribute>
         </dia:composite>
       </dia:attribute>
       <dia:attribute name="valign">
-        <dia:enum val="3"/>
+        <dia:enum val="2"/>
       </dia:attribute>
     </dia:object>
-    <dia:object type="Standard - Text" version="1" id="O4">
+    <dia:object type="Standard - Text" version="1" id="O3">
       <dia:attribute name="obj_pos">
-        <dia:point val="23.9512,13.0379"/>
+        <dia:point val="23,8.5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="23.9512,12.6704;25.8512,13.1329"/>
+        <dia:rectangle val="22.1687,8.25141;23.8428,8.74859"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
           <dia:attribute name="string">
-            <dia:string>#0x260000#</dia:string>
+            <dia:string>#0xc0000#</dia:string>
           </dia:attribute>
           <dia:attribute name="font">
             <dia:font family="monospace" style="0" name="Courier"/>
@@ -195,30 +177,30 @@
             <dia:real val="0.49388886988162994"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="23.9512,13.0379"/>
+            <dia:point val="23,8.63047"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000"/>
           </dia:attribute>
           <dia:attribute name="alignment">
-            <dia:enum val="0"/>
+            <dia:enum val="1"/>
           </dia:attribute>
         </dia:composite>
       </dia:attribute>
       <dia:attribute name="valign">
-        <dia:enum val="3"/>
+        <dia:enum val="2"/>
       </dia:attribute>
     </dia:object>
-    <dia:object type="Standard - Line" version="0" id="O5">
+    <dia:object type="Standard - Line" version="0" id="O4">
       <dia:attribute name="obj_pos">
-        <dia:point val="18,12"/>
+        <dia:point val="16.5,6.5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="17.975,11.975;18.025,12.625"/>
+        <dia:rectangle val="16.475,6.475;16.525,8.025"/>
       </dia:attribute>
       <dia:attribute name="conn_endpoints">
-        <dia:point val="18,12"/>
-        <dia:point val="18,12.6"/>
+        <dia:point val="16.5,6.5"/>
+        <dia:point val="16.5,8"/>
       </dia:attribute>
       <dia:attribute name="numcp">
         <dia:int val="1"/>
@@ -230,16 +212,16 @@
         <dia:connection handle="0" to="O0" connection="5"/>
       </dia:connections>
     </dia:object>
-    <dia:object type="Standard - Line" version="0" id="O6">
+    <dia:object type="Standard - Line" version="0" id="O5">
       <dia:attribute name="obj_pos">
-        <dia:point val="20,12"/>
+        <dia:point val="20,6.5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="19.975,11.975;20.025,13.425"/>
+        <dia:rectangle val="19.975,6.475;20.025,8.025"/>
       </dia:attribute>
       <dia:attribute name="conn_endpoints">
-        <dia:point val="20,12"/>
-        <dia:point val="20,13.4"/>
+        <dia:point val="20,6.5"/>
+        <dia:point val="20,8"/>
       </dia:attribute>
       <dia:attribute name="numcp">
         <dia:int val="1"/>
@@ -247,17 +229,20 @@
       <dia:attribute name="line_width">
         <dia:real val="0.05000000074505806"/>
       </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O0" connection="7"/>
+      </dia:connections>
     </dia:object>
-    <dia:object type="Standard - Line" version="0" id="O7">
+    <dia:object type="Standard - Line" version="0" id="O6">
       <dia:attribute name="obj_pos">
-        <dia:point val="25,12"/>
+        <dia:point val="23,6.5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="24.975,11.975;25.025,12.625"/>
+        <dia:rectangle val="22.975,6.475;23.025,8.025"/>
       </dia:attribute>
       <dia:attribute name="conn_endpoints">
-        <dia:point val="25,12"/>
-        <dia:point val="25,12.6"/>
+        <dia:point val="23,6.5"/>
+        <dia:point val="23,8"/>
       </dia:attribute>
       <dia:attribute name="numcp">
         <dia:int val="1"/>
@@ -265,18 +250,21 @@
       <dia:attribute name="line_width">
         <dia:real val="0.05000000074505806"/>
       </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O10" connection="7"/>
+      </dia:connections>
     </dia:object>
-    <dia:object type="Standard - Text" version="1" id="O8">
+    <dia:object type="Standard - Text" version="1" id="O7">
       <dia:attribute name="obj_pos">
-        <dia:point val="25.9998,13.8217"/>
+        <dia:point val="26,8.5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="25.9998,13.4542;27.8998,13.9167"/>
+        <dia:rectangle val="25.05,8.26875;26.95,8.73125"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
           <dia:attribute name="string">
-            <dia:string>#0x2e0000#</dia:string>
+            <dia:string>#0x100000#</dia:string>
           </dia:attribute>
           <dia:attribute name="font">
             <dia:font family="monospace" style="0" name="Courier"/>
@@ -285,30 +273,30 @@
             <dia:real val="0.49388886988162994"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="25.9998,13.8217"/>
+            <dia:point val="26,8.63625"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000"/>
           </dia:attribute>
           <dia:attribute name="alignment">
-            <dia:enum val="0"/>
+            <dia:enum val="1"/>
           </dia:attribute>
         </dia:composite>
       </dia:attribute>
       <dia:attribute name="valign">
-        <dia:enum val="3"/>
+        <dia:enum val="2"/>
       </dia:attribute>
     </dia:object>
-    <dia:object type="Standard - Line" version="0" id="O9">
+    <dia:object type="Standard - Line" version="0" id="O8">
       <dia:attribute name="obj_pos">
-        <dia:point val="27,12"/>
+        <dia:point val="26,6.5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="26.975,11.975;27.025,13.425"/>
+        <dia:rectangle val="25.975,6.475;26.025,8.025"/>
       </dia:attribute>
       <dia:attribute name="conn_endpoints">
-        <dia:point val="27,12"/>
-        <dia:point val="27,13.4"/>
+        <dia:point val="26,6.5"/>
+        <dia:point val="26,8"/>
       </dia:attribute>
       <dia:attribute name="numcp">
         <dia:int val="1"/>
@@ -316,46 +304,82 @@
       <dia:attribute name="line_width">
         <dia:real val="0.05000000074505806"/>
       </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O12" connection="7"/>
+      </dia:connections>
     </dia:object>
-    <dia:object type="Standard - Text" version="1" id="O10">
+    <dia:object type="Standard - Text" version="1" id="O9">
       <dia:attribute name="obj_pos">
-        <dia:point val="18.4,10.4"/>
+        <dia:point val="18.25,4.5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="18.4,9.9275;19.5025,10.52"/>
+        <dia:rectangle val="16.69,3.72625;19.81,5.27375"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
           <dia:attribute name="string">
-            <dia:string>#MLO#</dia:string>
+            <dia:string>#AT91
+Bootstrap#</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:real val="0.80000000000000004"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="18.4,10.4"/>
+            <dia:point val="18.25,4.32125"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000"/>
           </dia:attribute>
           <dia:attribute name="alignment">
-            <dia:enum val="0"/>
+            <dia:enum val="1"/>
           </dia:attribute>
         </dia:composite>
       </dia:attribute>
       <dia:attribute name="valign">
-        <dia:enum val="3"/>
+        <dia:enum val="2"/>
+      </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O0" connection="8"/>
+      </dia:connections>
+    </dia:object>
+    <dia:object type="Standard - Box" version="0" id="O10">
+      <dia:attribute name="obj_pos">
+        <dia:point val="20,2.5"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="19.95,2.45;23.05,6.55"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="20,2.5"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="3"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="4"/>
+      </dia:attribute>
+      <dia:attribute name="border_width">
+        <dia:real val="0.10000000149011612"/>
+      </dia:attribute>
+      <dia:attribute name="border_color">
+        <dia:color val="#868686"/>
+      </dia:attribute>
+      <dia:attribute name="inner_color">
+        <dia:color val="#e5e5e5"/>
+      </dia:attribute>
+      <dia:attribute name="show_background">
+        <dia:boolean val="true"/>
       </dia:attribute>
     </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="21.5,4.5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="21.6,9.9275;23.305,10.52"/>
+        <dia:rectangle val="20.425,4.12625;22.575,4.87375"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
@@ -366,29 +390,61 @@
             <dia:font family="sans" style="0" name="Helvetica"/>
           </dia:attribute>
           <dia:attribute name="height">
-            <dia:real val="0.63499997556209564"/>
+            <dia:real val="0.80000000000000004"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="21.6,10.4"/>
+            <dia:point val="21.5,4.72125"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000"/>
           </dia:attribute>
           <dia:attribute name="alignment">
-            <dia:enum val="0"/>
+            <dia:enum val="1"/>
           </dia:attribute>
         </dia:composite>
       </dia:attribute>
       <dia:attribute name="valign">
-        <dia:enum val="3"/>
+        <dia:enum val="2"/>
       </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O10" connection="8"/>
+      </dia:connections>
     </dia:object>
-    <dia:object type="Standard - Text" version="1" id="O12">
+    <dia:object type="Standard - Box" version="0" id="O12">
       <dia:attribute name="obj_pos">
-        <dia:point val="26,10.2"/>
+        <dia:point val="23,2.5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="25.1475,9.58625;26.8525,10.8137"/>
+        <dia:rectangle val="22.95,2.45;26.05,6.55"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="23,2.5"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="3"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="4"/>
+      </dia:attribute>
+      <dia:attribute name="border_width">
+        <dia:real val="0.10000000149011612"/>
+      </dia:attribute>
+      <dia:attribute name="border_color">
+        <dia:color val="#868686"/>
+      </dia:attribute>
+      <dia:attribute name="inner_color">
+        <dia:color val="#e5e5e5"/>
+      </dia:attribute>
+      <dia:attribute name="show_background">
+        <dia:boolean val="true"/>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Text" version="1" id="O13">
+      <dia:attribute name="obj_pos">
+        <dia:point val="24.5,4.5"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="23.425,3.72625;25.575,5.27375"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
@@ -400,10 +456,10 @@ env#</dia:string>
             <dia:font family="sans" style="0" name="Helvetica"/>
           </dia:attribute>
           <dia:attribute name="height">
-            <dia:real val="0.63499997556209564"/>
+            <dia:real val="0.80000000000000004"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="26,10.0588"/>
+            <dia:point val="24.5,4.32125"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000"/>
@@ -416,78 +472,129 @@ env#</dia:string>
       <dia:attribute name="valign">
         <dia:enum val="2"/>
       </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O12" connection="8"/>
+      </dia:connections>
     </dia:object>
-    <dia:object type="Standard - Text" version="1" id="O13">
+    <dia:object type="Standard - Box" version="0" id="O14">
+      <dia:attribute name="obj_pos">
+        <dia:point val="26,2.5"/>
+      </dia:attribute>
+      <dia:attribute name="obj_bb">
+        <dia:rectangle val="25.95,2.45;29.05,6.55"/>
+      </dia:attribute>
+      <dia:attribute name="elem_corner">
+        <dia:point val="26,2.5"/>
+      </dia:attribute>
+      <dia:attribute name="elem_width">
+        <dia:real val="3"/>
+      </dia:attribute>
+      <dia:attribute name="elem_height">
+        <dia:real val="4"/>
+      </dia:attribute>
+      <dia:attribute name="border_width">
+        <dia:real val="0.10000000149011612"/>
+      </dia:attribute>
+      <dia:attribute name="border_color">
+        <dia:color val="#868686"/>
+      </dia:attribute>
+      <dia:attribute name="inner_color">
+        <dia:color val="#e5e5e5"/>
+      </dia:attribute>
+      <dia:attribute name="show_background">
+        <dia:boolean val="true"/>
+      </dia:attribute>
+    </dia:object>
+    <dia:object type="Standard - Text" version="1" id="O15">
       <dia:attribute name="obj_pos">
-        <dia:point val="31.2,10.2"/>
+        <dia:point val="27.5,4.5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="31.2,9.7275;31.6875,10.32"/>
+        <dia:rectangle val="26.3425,3.32625;28.6575,5.67375"/>
       </dia:attribute>
       <dia:attribute name="text">
         <dia:composite type="text">
           <dia:attribute name="string">
-            <dia:string>#...#</dia:string>
+            <dia:string>#U-Boot
+env
+backup#</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:real val="0.80000000000000004"/>
           </dia:attribute>
           <dia:attribute name="pos">
-            <dia:point val="31.2,10.2"/>
+            <dia:point val="27.5,3.92125"/>
           </dia:attribute>
           <dia:attribute name="color">
             <dia:color val="#000000"/>
           </dia:attribute>
           <dia:attribute name="alignment">
-            <dia:enum val="0"/>
+            <dia:enum val="1"/>
           </dia:attribute>
         </dia:composite>
       </dia:attribute>
       <dia:attribute name="valign">
-        <dia:enum val="3"/>
+        <dia:enum val="2"/>
       </dia:attribute>
+      <dia:connections>
+        <dia:connection handle="0" to="O14" connection="8"/>
+      </dia:connections>
     </dia:object>
-    <dia:object type="Standard - Line" version="0" id="O14">
+    <dia:object type="Standard - Line" version="0" id="O16">
       <dia:attribute name="obj_pos">
-        <dia:point val="27,8.20993"/>
+        <dia:point val="29,6.5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="26.95,8.15993;27.05,12.05"/>
+        <dia:rectangle val="28.975,6.475;29.025,8.025"/>
       </dia:attribute>
       <dia:attribute name="conn_endpoints">
-        <dia:point val="27,8.20993"/>
-        <dia:point val="27,12"/>
+        <dia:point val="29,6.5"/>
+        <dia:point val="29,8"/>
       </dia:attribute>
       <dia:attribute name="numcp">
         <dia:int val="1"/>
       </dia:attribute>
-      <dia:attribute name="line_color">
-        <dia:color val="#868686"/>
+      <dia:attribute name="line_width">
+        <dia:real val="0.05000000074505806"/>
       </dia:attribute>
       <dia:connections>
-        <dia:connection handle="0" to="O0" connection="1"/>
-        <dia:connection handle="1" to="O0" connection="6"/>
+        <dia:connection handle="0" to="O14" connection="7"/>
       </dia:connections>
     </dia:object>
-    <dia:object type="Standard - Line" version="0" id="O15">
+    <dia:object type="Standard - Text" version="1" id="O17">
       <dia:attribute name="obj_pos">
-        <dia:point val="20,8.2"/>
+        <dia:point val="29,8.5"/>
       </dia:attribute>
       <dia:attribute name="obj_bb">
-        <dia:rectangle val="19.95,8.15;20.05,12.05"/>
-      </dia:attribute>
-      <dia:attribute name="conn_endpoints">
-        <dia:point val="20,8.2"/>
-        <dia:point val="20,12"/>
+        <dia:rectangle val="28.05,8.25141;29.9616,8.74859"/>
       </dia:attribute>
-      <dia:attribute name="numcp">
-        <dia:int val="1"/>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#0x140000#</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="29,8.63047"/>
+          </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="line_color">
-        <dia:color val="#868686"/>
+      <dia:attribute name="valign">
+        <dia:enum val="2"/>
       </dia:attribute>
     </dia:object>
   </dia:layer>
diff --git a/labs/sysdev-u-boot/sysdev-u-boot.tex b/labs/sysdev-u-boot/sysdev-u-boot.tex
index 298a54e..8140da4 100644
--- a/labs/sysdev-u-boot/sysdev-u-boot.tex
+++ b/labs/sysdev-u-boot/sysdev-u-boot.tex
@@ -20,122 +20,154 @@ very specific to the hardware platform. There are usually two cases:
 
 \end{itemize}
 
-The IGEPv2 board, which uses the DM3730 or the OMAP3530 processors, falls into
-the second category. The monitor integrated in the ROM reads the MMC/SD
-card to search for a valid bootloader before looking at the internal
-NAND flash for a bootloader. Therefore, by using an MMC/SD card, we can
-start up a OMAP3-based board without having anything installed on it.
+The Xplained board, which uses the SAMA5D3 SoCs, falls into the second
+category. The monitor integrated in the ROM reads the MMC/SD card to
+search for a valid bootloader before looking at the internal NAND
+flash for a bootloader. Whenever nothing's available, it will operate
+in a fallback mode, that will allow to use an external tool through
+USB to reflash some bootloader. Therefore, either by using an MMC/SD
+card or that fallback mode, we can start up a SAMA5D3-based board
+without having anything installed on it.
 
 \section{Setup}
 
 Go to the \code{~/felabs/sysdev/bootloader} directory. 
 
-\section{MMC/SD card setup}
+We're going to use that fallback mode, and its associated tool,
+\code{sam-ba}.
 
-The ROM monitor can read files from a FAT filesystem on the MMC/SD
-card. However, the MMC/SD card must be carefully partitionned, and the
-filesystem carefully created in order to be recognized by the ROM
-monitor. Here are special instructions to format an MMC/SD card
-for the OMAP-based platforms.
-
-First, connect your card reader to your workstation, with the MMC/SD
-card inside. Type the \code{dmesg} command to see which device is used
-by your workstation. In case the device is \code{/dev/sdb}, you will see
-something like:
+We first need to download this tool, from Atmel's website.
 
 \begin{verbatim}
-sd 3:0:0:0: [sdb] 3842048 512-byte hardware sectors: (1.96 GB/1.83 GiB)
+wget http://www.atmel.com/Images/sam-ba_2.12.zip
+unzip sam-ba_2.12.zip
 \end{verbatim}
 
-If your PC has an internal MMC/SD card reader, the device may also been
-seen as \code{/dev/mmcblk0}, and the first partition as
-\code{mmcblk0p1}. \footnote{This is not always the case with internal
-MMC/SD card readers. On some PCs, such devices are behind an internal
-USB bus, and thus are visible in the same way external card readers
-are}. You will see that the MMC/SD card is seen in the same
-way by the IGEPv2 board.
-
-In the following instructions, we will assume that your MMC/SD card
-is seen as \code{/dev/sdb} by your PC workstation.
-
-\fbox{\begin{minipage}{\textwidth}
-{\bfseries
-Caution: read this carefully before proceeding. You could destroy
-existing partitions on your PC!
-
-Do not make the confusion between the device that is used by your
-board to represent your MMC/SD disk (probably \code{/dev/sda}), and the device
-that your workstation uses when the card reader is inserted (probably
-\code{/dev/sdb}).
+\section{Setting up serial communication with the board}
 
-So, don't use the \code{/dev/sda} device to reflash your MMC disk from
-your workstation. People have already destroyed their Windows
-partition by making this mistake.}
-\end{minipage}}
+Plug the Xplained board on your computer using the provided
+USB-to-serial cable. When plugged-in, a serial port should appear,
+\code{/dev/ttyUSB0}.
 
-You can also run \code{cat /proc/partitions} to list all block devices
-in your system. Again, make sure to distinguish the SD/MMC card from the
-hard drive of your development workstation!
+You can also see this device appear by looking at the output of
+\code{dmesg}.
 
-Type the \code{mount} command to check your currently mounted
-partitions. If MMC/SD partitions are mounted, unmount them:
+To communicate with the board through the serial port, install a
+serial communication program, such as \code{picocom}:
 
 \begin{verbatim}
-$ sudo umount /dev/sdb1
-$ sudo umount /dev/sdb2
-...
+sudo apt-get install picocom
 \end{verbatim}
 
-Now, clear possible MMC/SD card contents remaining from previous training 
-sessions:
+You also need to make your user belong to the \code{dialout} group to be
+allowed to write to the serial console:
 
 \begin{verbatim}
-$ sudo dd if=/dev/zero of=/dev/sdb bs=1M count=256
+sudo adduser $USER dialout
 \end{verbatim}
 
-As we explained earlier, the TI OMAP rom monitor needs special partition geometry settings
-to read partition contents. The MMC/SD card must have 255 heads and 63 sectors.
+You need to log out and in again for the group change to be effective.
+
+Run \code{picocom -b 115200 /dev/ttyUSB0}, to start serial
+communication on \code{/dev/ttyUSB0}, with a baudrate of 115200. If
+you wish to exit \code{picocom}, press \code{[Ctrl][a]} followed by
+\code{[Ctrl][x]}.
+
+\section{AT91Bootstrap Setup}
 
-Let's use the \code{cfdisk} command to create a first partition with these settings:
+The boot process is done in two steps with the ROM monitor trying to
+execute a first piece of software, called \code{AT91Bootstrap}, from
+its internal SRAM, that will initialize the DRAM, load \code{U-Boot}
+that will in turn load Linux and execute it.
 
-\code{sudo cfdisk -h 255 -s 63 /dev/sdb}
+As far as bootloaders are concerned, the layout of the NAND flash will
+look like:
 
-In the \code{cfdisk} interface, create a first primary partition, starting from the beginning,
-with a 64 MB size, a \code{Bootable} type and a \code{0C} type (\code{W95 FAT32 (LBA)}).
-Press \code{Write} when you are done.
+\begin{center}
+  \includegraphics[width=\textwidth]{labs/sysdev-u-boot/flash-map.pdf}
+\end{center}
 
-If you used \code{fdisk} before, you should find \code{cfdisk} much more convenient!
+\begin{itemize}
+\item Offset \code{0x0} for the first stage bootloader is dictated by
+  the hardware: the ROM code of the SAMA5D3 looks for a bootloader at
+  offset \code{0x0} in the NAND flash.
+\item Offset \code{0x40000} for the second stage bootloader is decided
+  by the first stage bootloader. This can be changed by changing the
+  AT91Bootstrap configuration.
+\item Offset \code{0xc0000} of the U-Boot environment is decided by
+  U-Boot. This can be changed by modifying the U-Boot configuration.
+\end{itemize}
 
-Format this new partition in FAT32, with the \code{boot} label (name):
+The first item to compile is AT91Bootstrap that you can fetch from
+Atmel's github account:
 
 \begin{verbatim}
-sudo mkfs.vfat -n boot -F 32 /dev/sdb1
+git clone git://github.com/linux4sam/at91bootstrap.git -b at91bootstrap-3.x
+cd at91bootstrap
 \end{verbatim}
 
-Then, remove and insert your card again.
+Then, we first need to configure the build system for our setup. We're
+going to need a few informations for this:
+
+\begin{itemize}
+\item Which board you want to run AT91Bootstrap on
+\item Which device should AT91Bootstrap will be stored on
+\item What component you want AT91Boostrap to load
+\end{itemize}
+
+You can get the list of the supported board by listing the
+\code{board} directory. You'll see that in each of these folder, we
+have a bunch of \code{defconfig} files, that are the supported
+combinations. In our case, we will load U-Boot, from the NAND.
+
+Then, you've found the right defconfig, load it using
+\code{make <defconfig_name>}, and you can start the compilation using
+\code{make}\footnote{You can speed up the 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.}. Don't forget to set the \code{CROSS_COMPILE}
+environment variable!
+
+At the end of the compilation, you should have a file called
+\code{sama5d3_xplained-nandflashboot-uboot-*.bin}, in the
+\code{binaries} folder.
+
+In order, to flash it, we need to do a few things. First, remove the
+\code{NAND CS} jumper on the board. It's next to the pin header
+closest to the Micro-USB plug. Reset the board, and put the jumper
+back. On the serial port, you should see \code{RomBoot}.
+
+Then, start \code{sam-ba} as root. You'll get a small window. Select
+the \code{ttyACM0} connection, and the \code{sama5d3x-ek} board. Hit
+\code{Connect}.
+
+You need to:
+\begin{itemize}
+\item Hit the NANDFlash tab
+\item In the scripts choices, select \code{Enable NandFlash} and hit \code{Execute}
+\item Select \code{Erase All}, and execute the command
+\item Then, select \code{Enable OS PMECC} parameters in order to
+  change the NAND ECC parameters to what RomBOOT expects. Change the
+  number of ECC bits to 4, and the ECC offset to 36.
+\item Finally, send the image we just compiled using the command
+  \code{Send Boot File}
+\end{itemize}
 
-Your MMC/SD card is ready to use.
+AT91Bootstrap should be flashed now, keep sam-ba opened, and move to
+the next section.
 
 \section{U-Boot setup}
 
-Download U-Boot from the mainline igep download site:
+Download U-Boot using git:
 
 \begin{verbatim}
-wget ftp://ftp.denx.de/pub/u-boot/u-boot-2013.10.tar.bz2
-tar xvf u-boot-2013.10.tar.bz2
-cd u-boot-2013.10
+git clone http://git.denx.de/u-boot.git
+cd u-boot
 \end{verbatim}
 
-Then, apply the
-\code{0001-arm-omap-i2c-don-t-zero-cnt-in-i2c_write.patch} patch from
-this lab's \code{data} directory:
+We're going to use the latest released version: \code{2014.07-rc2}.
 
-{\small
-\begin{verbatim}
-cat /path/to/0001-arm-omap-i2c-don-t-zero-cnt-in-i2c_write.patch | \
-   patch -p1
-\end{verbatim}
-}
+Switch to this version using \code{git checkout v2014.07-rc2}.
 
 Get an understanding of its configuration and compilation steps by
 reading the \code{README} file, and specifically the {\em Building the
@@ -149,186 +181,65 @@ Basically, you need to:
 
 \item run \code{make <NAME>_config}, where \code{<NAME>} is the name
   of your board as declared in the \code{boards.cfg} file. There are
-  two flavors of the IGEPv2: since the RevC6 they use a NAND flash
-  (\code{igep0020_nand}) and before this revision they were a OneNAND flash
-  (\code{igep0020}). Note that for our platform, the configuration
-  file is \code{include/configs/igep00x0.h}. Read this file to get an
+  two flavors of the Xplained: one to run from the SD card
+  (\code{sama5d3_xplained_mmc}) and one to run from the NAND flash
+  (\code{sama5d3_xplained_nandflash}). Since we're going to boot on
+  the NAND, use the latter. Note that for our platform, both these
+  choices are sharing most of their configuration, that is defined in
+  \code{include/configs/sama5d3_xplained.h}. Read this file to get an
   idea of how a U-Boot configuration file is written;
 
-\item Finally, run \code{make}\footnote{You can speed up the 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 should build U-Boot.
+\item Finally, run \code{make}, which should build U-Boot.
 
 \end{itemize}
 
-You can now copy the generated \code{MLO} and \code{u-boot.img} files
-to the MMC card. \code{MLO} is the first stage bootloader,
-\code{u-boot.img} is the second stage bootloader.
-
-Unmount the MMC card partition.
-
-\section{Setting up serial communication with the board}
-
-Plug the IGEPv2 board on your computer using the provided
-USB-to-serial cable. When plugged-in, a serial port should appear,
-\code{/dev/ttyUSB0}.
-
-You can also see this device appear by looking at the output of
-\code{dmesg}.
-
-To communicate with the board through the serial port, install a
-serial communication program, such as \code{picocom}:
+Now, in sam-ba, in the \code{Send File Name} field, set the path to
+the \code{u-boot.bin} that was just compiled, and set the address to
+\code{0x40000}. Click on the \code{Send File} button.
 
-\begin{verbatim}
-sudo apt-get install picocom
-\end{verbatim}
+\section{Testing U-Boot}
 
-You also need to make your user belong to the \code{dialout} group to be
-allowed to write to the serial console:
+Reset the board and check that it boots your new bootloaders. You can
+verify this by checking the build dates:
 
 \begin{verbatim}
-sudo adduser $USER dialout
-\end{verbatim}
-
-You need to log out and in again for the group change to be effective.
-
-Run \code{picocom -b 115200 /dev/ttyUSB0}, to start serial
-communication on \code{/dev/ttyUSB0}, with a baudrate of 115200. If
-you wish to exit \code{picocom}, press \code{[Ctrl][a]} followed by
-\code{[Ctrl][x]}.
-
-\section{Testing U-Boot on the MMC card}
+AT91Bootstrap 3.6.2-00090-g1e8fd41ce714 (mercredi 4 juin 2014, 11:08:41 (UTC+0200))
 
-Insert the MMC card into the IGEP board, reset the board and check
-that it boots your new bootloaders. You can verify this by checking
-the build dates:
-
-\begin{verbatim}
-U-Boot SPL 2013.10 (Nov 15 2013 - 14:12:51)
-reading u-boot.img
-reading u-boot.img
+NAND: ONFI flash detected
+NAND: Manufacturer ID: 0x2c Chip ID: 0x32
+NAND: Disable On-Die ECC
+NAND: Initialize PMECC params, cap: 0x4, sector: 0x200
+NAND: Image: Copy 0x80000 bytes from 0x40000 to 0x26f00000
+NAND: Done to load image
 
 
-U-Boot 2013.10 (Nov 15 2013 - 14:12:51)
+U-Boot 2014.07-rc2 (Jun 04 2014 - 12:38:09)
 
-OMAP36XX/37XX-GP ES1.2, CPU-OPP2, L3-200MHz, Max CPU Clock 1 Ghz
-IGEPv2 + LPDDR/NAND
-I2C:   ready
-DRAM:  512 MiB
-NAND:  512 MiB
-MMC:   OMAP SD/MMC: 0
+CPU: SAMA5D36
+Crystal frequency:       12 MHz
+CPU clock        :      528 MHz
+Master clock     :      132 MHz
+DRAM:  256 MiB
+NAND:  256 MiB
+MMC:   mci: 0
 *** Warning - bad CRC, using default environment
 
 In:    serial
 Out:   serial
 Err:   serial
-Die ID #415c00029ff80000015913d80702502a
-Net:   smc911x-0
-Hit any key to stop autoboot:  0 
+Net:   gmac0
+Warning: failed to set MAC address
+, macb0
+Warning: failed to set MAC address
 \end{verbatim}
 
-The message \code{reading u-boot.img} also confirms that U-Boot has
-been loaded from the MMC device. You don't get it when you boot from
-NAND flash (there are no files on raw flash anyway).
-
 Interrupt the countdown to enter the U-Boot shell:
 \begin{verbatim}
 U-Boot #
 \end{verbatim}
 
-In U-Boot, type the \code{help} command, and explore the few commands available.
-
-\section{Reflashing from U-boot}
-
-We will flash U-boot and later the kernel and filesystem in NAND
-flash. As far as bootloaders are concerned, the layout of the NAND
-flash will look like:
-
-\begin{center}
-  \includegraphics[width=\textwidth]{labs/sysdev-u-boot/flash-map.pdf}
-\end{center}
-
-\begin{itemize}
-\item Offset \code{0x0} for the first stage bootloader is dictated by
-  the hardware: the ROM code of the OMAP looks for a bootloader at
-  offset \code{0x0} in the NAND flash.
-\item Offset \code{0x80000} for the second stage bootloader is decided
-  by the first stage bootloader. This can be changed by changing the
-  U-Boot configuration.
-\item Offset \code{0x260000} of the U-Boot environment is also decided
-  by the U-Boot configuration.
-\end{itemize}
-
-Let's first erase the whole NAND storage to remove its existing
-contents. This way, we are sure that what we find in NAND comes from
-our own manipulations:
-
-\begin{verbatim}
-nand erase.chip
-\end{verbatim}
-
-We are going to flash the first stage bootloader in NAND. To do so,
-type the following commands:
-
-\begin{verbatim}
-fatload mmc 0 80000000 MLO
-\end{verbatim}
-This loads the file from MMC 0 partition 0 to memory at address
-0x80000000.
-
-\begin{verbatim}
-nandecc hw
-\end{verbatim}
-
-This tells U-Boot to write data to NAND using the hardware ECC
-algorithm, which the ROM code of the OMAP uses to load the first stage
-bootloader.
-
-\begin{verbatim}
-nand erase 0 80000
-\end{verbatim}
-
-This command erases a 0x80000 byte long space of NAND flash from
-offset 0\footnote{Of course, this is not needed here if you erased the
-  whole NAND contents as instructed earlier. However, we prefer to
-  write it here so that you don't forget next time you write anything
-  to NAND.}.
-
-\begin{verbatim}
-nand write 80000000 0 80000
-\end{verbatim}
-
-This command writes data to NAND flash. The source is 0x80000000
-(where we've loaded the file to store in the flash) and the
-destination is offset 0 of NAND flash. The length of the copy is
-0x80000 bytes, which corresponds to the space we've just erased
-before. It is important to erase the flash space before trying to
-write on it.
-
-Now that the first stage has been transfered to NAND flash, you can
-now do the same with U-Boot.
-
-The storage offset of U-Boot in the NAND is 0x80000 (just after the
-space reserved for the first stage bootloader) and the length is
-0x1e0000.
-
-After flashing the U-Boot image, also erase the U-boot environment
-variables defined by the manufacturer or by previous users of your
-board:
-
-\begin{verbatim}
-nand erase 260000 80000
-\end{verbatim}
-
-You can remove MMC card, then reset the IGEP board. You should see the
-freshly flashed U-Boot starting.
-
-You should now see the U-Boot prompt:
-
-\begin{verbatim}
-U-Boot #
-\end{verbatim}
+In U-Boot, type the \code{help} command, and explore the few commands
+available.
 
 \section{Setting up Ethernet communication}
 
@@ -413,7 +324,7 @@ the directory exported through TFTP on your development
 workstation. Then, from U-Boot, do:
 
 \begin{verbatim}
-tftp 0x80000000 textfile.txt
+tftp 0x22000000 textfile.txt
 \end{verbatim}
 
 {\bf Caution: known issue in Ubuntu 12.04 and later}:
@@ -431,7 +342,7 @@ location is part of the board DRAM). You can verify that the download
 was successful by dumping the contents of the memory:
 
 \begin{verbatim}
-md 0x80000000
+md 0x22000000
 \end{verbatim}
 
 We will see in the next labs how to use U-Boot to download, flash and
@@ -440,6 +351,6 @@ boot a kernel.
 \section{Rescue binaries}
 
 If you have trouble generating binaries that work properly, or later
-make a mistake that causes you to loose your \code{MLO} and
-\code{u-boot.img} files, you will find working versions under
-\code{data/} in the current lab directory.
+make a mistake that causes you to loose your bootloader binaries, you
+will find working versions under \code{data/} in the current lab
+directory.



More information about the training-materials-updates mailing list