[FE training-materials-updates] sysdev-flash-filesystems: use DT booting for this lab

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Mon Dec 2 10:39:16 CET 2013

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

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


commit 6618c8c59b3afca11a77f8898c37a269cba5ee9a
Author: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Date:   Mon Dec 2 10:37:36 2013 +0100

    sysdev-flash-filesystems: use DT booting for this lab
    Add a kernel patch that fixes the ECC problem on IGEP, which allows to
    continue to boot in DT mode for the flash filesystem lab.
    Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>


 ...01-ARM-omap-switch-back-to-SW-ECC-on-IGEP.patch |   28 ++++++++++++++++++++
 .../sysdev-flash-filesystems.tex                   |   28 +++++++++++---------
 2 files changed, 43 insertions(+), 13 deletions(-)

diff --git a/lab-data/sysdev/flash-filesystems/data/0001-ARM-omap-switch-back-to-SW-ECC-on-IGEP.patch b/lab-data/sysdev/flash-filesystems/data/0001-ARM-omap-switch-back-to-SW-ECC-on-IGEP.patch
new file mode 100644
index 0000000..c416623
--- /dev/null
+++ b/lab-data/sysdev/flash-filesystems/data/0001-ARM-omap-switch-back-to-SW-ECC-on-IGEP.patch
@@ -0,0 +1,28 @@
+From 71acf2b437708aad5891e5244b97fa399534493d Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
+Date: Mon, 2 Dec 2013 10:32:33 +0100
+Subject: [PATCH] ARM: omap: switch back to SW ECC on IGEP
+Idea provided by Javier Martinez Canillas <javier at dowhile0.org>.
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
+ arch/arm/boot/dts/omap3-igep0020.dts | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+diff --git a/arch/arm/boot/dts/omap3-igep0020.dts b/arch/arm/boot/dts/omap3-igep0020.dts
+index e8c4828..5e3f58c 100644
+--- a/arch/arm/boot/dts/omap3-igep0020.dts
++++ b/arch/arm/boot/dts/omap3-igep0020.dts
+@@ -75,7 +75,7 @@
+ 		linux,mtd-name= "micron,mt29c4g96maz";
+ 		reg = <0 0 0>;
+ 		nand-bus-width = <16>;
+-		ti,nand-ecc-opt = "bch8";
++		ti,nand-ecc-opt = "sw";
+ 		gpmc,sync-clk-ps = <0>;
+ 		gpmc,cs-on-ns = <0>;
diff --git a/labs/sysdev-flash-filesystems/sysdev-flash-filesystems.tex b/labs/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
index 42534cb..25f4b07 100644
--- a/labs/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
+++ b/labs/sysdev-flash-filesystems/sysdev-flash-filesystems.tex
@@ -28,9 +28,17 @@ be:
 \section{Enabling NAND flash and filesystems}
-Recompile your kernel with support for JFFS2 and for support for MTD
-partitions specified in the kernel command line
+Apply the \code{0001-ARM-omap-switch-back-to-SW-ECC-on-IGEP.patch}
+patch available in the
+\code{$HOME/felabs/sysdev/flash-filesystems/data} directory to your
+kernel tree. This patch fixes a problem of the 3.11.x/3.12 kernel,
+which caused the kernel to use a different ECC scheme than the U-Boot
+bootloader, making it impossible to flash from U-Boot, and read from
+the kernel.
+After applying this patch, recompile your kernel with support for
+JFFS2 and for support for MTD partitions specified in the kernel
+command line (\code{CONFIG_MTD_CMDLINE_PARTS}).
 Also enable support for the flash chips on the board
 (\code{CONFIG_MTD_NAND_OMAP2}). You also need to enable support for
@@ -38,16 +46,6 @@ hardware BCH error correction (\code{CONFIG_NAND_OMAP_BCH}) and select
 the \code{8 bits / 512 bytes (recommended)} mode
-{\bf In this lab, you will also have to compile and boot a kernel without
-using the Device Tree. At least in Linux 3.11 and 3.12, there is an
-issue between the ECC mode declared in the IGEP Device Tree and the ECC
-configuration in U-boot 2013.10. The consequence is that JFFS2 images
-flashed from U-boot will cause ECC errors in Linux.}
-Therefore, compile your kernel with \code{CONFIG_MACH_IGEP0020} and
-boot your kernel without loading the Device Tree (\code{bootm
 Last but not least, disable \code{CONFIG_PROVE_LOCKING}. This option is
 currently causing problems with the JFFS2 filesystem. This option is
 in \code{Kernel Hacking} $\rightarrow$
@@ -82,6 +80,10 @@ remaining size of the flash, from 0x300000 to the end. Remember that
 you can look at U-Boot booting messages to find what is the size of
 the NAND flash.
+Before flashing JFFS2 images, make sure they will be flashed during
+the software ECC scheme, by running the \code{nandecc sw} command in
 Using the \code{tftp} command, download and flash the kernel image at
 the correct location.

More information about the training-materials-updates mailing list