[FE training-materials-updates] Flash slides: improve explanation flow

Michael Opdenacker michael.opdenacker at free-electrons.com
Thu Nov 5 07:32:06 CET 2015


Repository : git://git.free-electrons.com/training-materials.git
On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=18f5890bc9a958302f0831f6c57c9ab566459527

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

commit 18f5890bc9a958302f0831f6c57c9ab566459527
Author: Michael Opdenacker <michael.opdenacker at free-electrons.com>
Date:   Thu Nov 5 07:31:18 2015 +0100

    Flash slides: improve explanation flow
    
    - Not complete yet (continuing on another machine)
    
    Signed-off-by: Michael Opdenacker <michael.opdenacker at free-electrons.com>


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

18f5890bc9a958302f0831f6c57c9ab566459527
 .../sysdev-flash-filesystems.tex                   | 197 ++++++++++-----------
 1 file changed, 98 insertions(+), 99 deletions(-)

diff --git a/slides/sysdev-flash-filesystems/sysdev-flash-filesystems.tex b/slides/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
index b6ffc32..bcd9936 100644
--- a/slides/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
+++ b/slides/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
@@ -55,7 +55,7 @@
     \item Far less reliable than NOR flash
     \item Reliability depends on the NAND flash technology (SLC, MLC)
     \item Require additional mechanisms to recover from bit flips: ECC
-      (Error Corrector Code)
+      (Error Correcting Code)
     \item ECC information stored in the OOB (Out-of-band area)
     \end{itemize}
   \item Lifetime
@@ -139,6 +139,7 @@
     \end{itemize}
   \item Unlike block devices, which contains their own partition
     table, the partitioning of MTD devices is described externally
+    (don't want to put it in a flash sector which could become bad)
     \begin{itemize}
     \item Specified in the board Device Tree
     \item Hard-coded into the kernel code (if no Device Tree)
@@ -157,113 +158,20 @@
 \end{frame}
 
 \begin{frame}
-  \frametitle{U-Boot: manipulating NAND devices}
-  U-Boot provides a set of commands to manipulate NAND devices,
-  grouped under the \code{nand} command
-  \begin{itemize}
-  \item \code{nand info}\\
-    Show available NAND devices and characteristics
-  \item \code{nand device [dev]}\\
-    Select or display the active NAND device
-  \item \code{nand read[.option] <addr> <offset|partname> <size>}\\
-    Read data from NAND
-  \item \code{nand write[.option] <addr> <offset|partname> <size>}\\
-    Write data on NAND
-    \begin{itemize}
-      \item Use \code{nand write.trimffs} to avoid writing empty pages
-      (those filled with \code{0xff})
-    \end{itemize}
-  \item \code{nand erase <offset> <size>}\\
-    Erase a NAND region
-  \item \code{nand erase.part <partname>}\\
-    Erase a NAND partition
-  \item More commands for debugging purposes
-  \end{itemize}
-\end{frame}
-
-\begin{frame}
-  \frametitle{U-Boot: manipulating NOR devices (1)}
-  \begin{itemize}
-  \item U-Boot provides a set of commands to manipulate NOR devices
-  \item Memory mapped NOR devices
-    \begin{itemize}
-    \item \code{flinfo [devid]} display information of all NOR devices
-      or a specific one if \code{devid} is provided
-    \item \code{cp.[bwl] <src> <target> <count>} read/write data frm/to
-      the NOR device
-    \item \code{erase <start> <end>} or \code{erase <start> +<len>}
-      erase a memory region
-    \item \code{erase bank <bankid>} erase a memory bank
-    \item \code{erase all} erase all banks
-    \item \code{protect on|off <range-description>} protect a memory
-      range
-    \end{itemize}
-  \end{itemize}
-\end{frame}
-
-\begin{frame}
-  \frametitle{U-Boot: manipulating NOR devices (2)}
-  \begin{itemize}
-  \item SPI NOR devices
-    \begin{itemize}
-    \item Grouped under the \code{sf} command
-    \item \code{sf probre [[bus:]cs] [hz] [mode]} probe a NOR device on
-    \item \code{sf read|write <addr> <offset> <len>} read/write data
-       from/to a SPI NOR
-    \item \code{sf erase <offset> +<len>} erase a memory region
-    \item \code{sf update <addr> <offset> <len>} erase + write operation
-    \end{itemize}
-  \end{itemize}
-\end{frame}
-
-\begin{frame}
-  \frametitle{U-Boot: using MTD partitions}
+  \frametitle{U-Boot: defining MTD partitions (1)}
   \begin{itemize}
   \item U-Boot provides a way to define MTD partitions on top of flash
     devices
-  \item Using partitions eases the manipulation of flash devices, which might
-    be particularly error prone
-  \item Requires two environment variables:
-    \begin{itemize}
-    \item \code{mtdids} attaches an {\em mtdid} to a flash device.
-      Example: \code{setenv mtdids <devid>=<mtdid>[,<devid>=<mtdid>]}
-      \begin{itemize}
-      \item \code{devid}: device identifier retrieved with
-        \code{nand info} or \code{flinfo}
-      \item \code{mtdid}: mtd identifier (should match Linux MTD device
-        name). It is displayed when booting the Linux kernel.
-      \end{itemize}
-    \item \code{mtdparts} defines the partitions for the different devices
-    \end{itemize}
-  \item Use the \code{mtdparts} command to setup the configuration
-    specified by the \code{mtdids} and \code{mtdparts} variables
-  \item Use flash specific commands (depends on your flash device type),
+  \item Named partitions are easier to use, and much less error prone than using offsets.
+  \item U-Boot partition definitions can also be used by Linux too,
+    eliminating the risk of mismatches between Linux and U-Boot. 
+  \item Use flash specific commands (detailed soon),
     and pass partition names instead of numerical offsets
   \item Example: \code{nand erase.part <partname>}
   \end{itemize}
 \end{frame}
 
 \begin{frame}[fragile]
-  \frametitle{U-Boot: defining MTD partitions (1)}
-  \begin{itemize}
-  \item \code{mtdparts} format: \code{<mtdid>:<partition>[,partition]}
-  \item \code{partition} format: \code{<size>[@offset](<name>)[ro]}
-  \item \code{mtdid} is the MTD device name assigned by Linux. It
-    is displayed at boot time (and can be retrieved using \code{dmesg}):
-  \end{itemize}
-\tiny
-\begin{verbatim}
-NAND device: Manufacturer ID: 0x2c, Chip ID: 0xbc (Micron NAND 512MiB 1,8V 16-bit)
-Creating 5 MTD partitions on "omap2-nand.0":
-0x000000000000-0x000000080000 : "X-Loader"
-0x000000080000-0x000000200000 : "U-Boot"
-0x000000200000-0x000000280000 : "Environment"
-0x000000280000-0x000000580000 : "Kernel"
-0x000000580000-0x000020000000 : "File System"
-\end{verbatim}
-\end{frame}
-
-\begin{frame}[fragile]
   \frametitle{U-Boot: defining MTD partitions (2)}
   \begin{itemize}
   \item Example:
@@ -289,6 +197,37 @@ setenv mtdparts mtdparts=omap2-nand.0:512k(X-Loader)ro,1536k(U-Boot)ro,512k(Env)
   \end{itemize}
 \end{frame}
 
+
+\begin{frame}[fragile]
+  \frametitle{U-Boot: defining MTD partitions (3)}
+  Details about the two environment variables needed by U-Boot:
+  \begin{itemize}
+  \item \code{mtdids} attaches an {\em mtdid} to a flash device.\\
+    \code{setenv mtdids <devid>=<mtdid>[,<devid>=<mtdid>]}
+    \begin{itemize}
+    \item \code{devid}: device identifier retrieved with
+      \code{nand info} or \code{flinfo}
+    \item \code{mtdid}: mtd identifier (should match Linux MTD device
+      name). It is displayed when booting the Linux kernel:
+\tiny
+\begin{verbatim}
+NAND device: Manufacturer ID: 0x2c, Chip ID: 0xbc (Micron NAND 512MiB 1,8V 16-bit)
+Creating 5 MTD partitions on "omap2-nand.0":
+0x000000000000-0x000000080000 : "X-Loader"
+0x000000080000-0x000000200000 : "U-Boot"
+0x000000200000-0x000000280000 : "Environment"
+0x000000280000-0x000000580000 : "Kernel"
+0x000000580000-0x000020000000 : "File System"
+\end{verbatim}
+    \end{itemize}
+  \item \code{mtdparts} defines partitions for the different devices\\
+  \code{setenv mtdparts <mtdid>:<partition>[,partition]}\\
+  \code{partition} format: \code{<size>[@offset](<name>)[ro]}
+  \end{itemize}
+  Use the \code{mtdparts} command to setup the configuration
+  specified by the \code{mtdids} and \code{mtdparts} variables
+\end{frame}
+
 \begin{frame}
   \frametitle{Linux: MTD devices interface with user space}
   \begin{itemize}
@@ -348,6 +287,66 @@ setenv mtdparts mtdparts=omap2-nand.0:512k(X-Loader)ro,1536k(U-Boot)ro,512k(Env)
 \end{frame}
 
 \begin{frame}
+  \frametitle{U-Boot: manipulating NAND devices}
+  U-Boot provides a set of commands to manipulate NAND devices,
+  grouped under the \code{nand} command
+  \begin{itemize}
+  \item \code{nand info}\\
+    Show available NAND devices and characteristics
+  \item \code{nand device [dev]}\\
+    Select or display the active NAND device
+  \item \code{nand read[.option] <addr> <offset|partname> <size>}\\
+    Read data from NAND
+  \item \code{nand write[.option] <addr> <offset|partname> <size>}\\
+    Write data on NAND
+    \begin{itemize}
+      \item Use \code{nand write.trimffs} to avoid writing empty pages
+      (those filled with \code{0xff})
+    \end{itemize}
+  \item \code{nand erase <offset> <size>}\\
+    Erase a NAND region
+  \item \code{nand erase.part <partname>}\\
+    Erase a NAND partition
+  \item More commands for debugging purposes
+  \end{itemize}
+\end{frame}
+
+\begin{frame}
+  \frametitle{U-Boot: manipulating NOR devices (1)}
+  \begin{itemize}
+  \item U-Boot provides a set of commands to manipulate NOR devices
+  \item Memory mapped NOR devices
+    \begin{itemize}
+    \item \code{flinfo [devid]} display information of all NOR devices
+      or a specific one if \code{devid} is provided
+    \item \code{cp.[bwl] <src> <target> <count>} read/write data frm/to
+      the NOR device
+    \item \code{erase <start> <end>} or \code{erase <start> +<len>}
+      erase a memory region
+    \item \code{erase bank <bankid>} erase a memory bank
+    \item \code{erase all} erase all banks
+    \item \code{protect on|off <range-description>} protect a memory
+      range
+    \end{itemize}
+  \end{itemize}
+\end{frame}
+
+\begin{frame}
+  \frametitle{U-Boot: manipulating NOR devices (2)}
+  \begin{itemize}
+  \item SPI NOR devices
+    \begin{itemize}
+    \item Grouped under the \code{sf} command
+    \item \code{sf probre [[bus:]cs] [hz] [mode]} probe a NOR device on
+    \item \code{sf read|write <addr> <offset> <len>} read/write data
+       from/to a SPI NOR
+    \item \code{sf erase <offset> +<len>} erase a memory region
+    \item \code{sf update <addr> <offset> <len>} erase + write operation
+    \end{itemize}
+  \end{itemize}
+\end{frame}
+
+\begin{frame}
   \frametitle{Linux: user space flash management tools}
   \begin{itemize}
   \item \code{mtd-utils} is a set of utilities to manipulate MTD devices




More information about the training-materials-updates mailing list