[FE training-materials-updates] Update MMC to reflash BBB boards

Michael Opdenacker michael.opdenacker at free-electrons.com
Tue May 27 11:46:38 CEST 2014


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

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

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

commit ded382764072a055837ecfe6354a404cf967e860
Author: Michael Opdenacker <michael.opdenacker at free-electrons.com>
Date:   Tue May 27 11:28:13 2014 +0200

    Update MMC to reflash BBB boards
    
    Signed-off-by: Michael Opdenacker <michael.opdenacker at free-electrons.com>


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

ded382764072a055837ecfe6354a404cf967e860
 lab-data/linux/bootloader/beaglebone-black/MLO     |  Bin 98240 -> 76908 bytes
 .../bootloader/beaglebone-black/{MLO => MLO.final} |  Bin 98240 -> 98240 bytes
 .../linux/bootloader/beaglebone-black/README.txt   |   32 +++++++----
 .../src/0001-BBB-configuration-ignoring-eMMC.patch |   58 ++++++++++++++++++++
 .../bootloader/beaglebone-black/src/rootfs.tar.xz  |  Bin 566260 -> 567276 bytes
 .../linux/bootloader/beaglebone-black/u-boot.img   |  Bin 304776 -> 328920 bytes
 .../{u-boot.img => u-boot.img.final}               |  Bin 304776 -> 304776 bytes
 lab-data/linux/bootloader/beaglebone-black/uImage  |  Bin 5818568 -> 5818616 bytes
 8 files changed, 79 insertions(+), 11 deletions(-)

diff --git a/lab-data/linux/bootloader/beaglebone-black/MLO b/lab-data/linux/bootloader/beaglebone-black/MLO
index e5eb30d..d2cae75 100644
Binary files a/lab-data/linux/bootloader/beaglebone-black/MLO and b/lab-data/linux/bootloader/beaglebone-black/MLO differ
diff --git a/lab-data/linux/bootloader/beaglebone-black/MLO b/lab-data/linux/bootloader/beaglebone-black/MLO.final
similarity index 100%
copy from lab-data/linux/bootloader/beaglebone-black/MLO
copy to lab-data/linux/bootloader/beaglebone-black/MLO.final
diff --git a/lab-data/linux/bootloader/beaglebone-black/README.txt b/lab-data/linux/bootloader/beaglebone-black/README.txt
index b5734d2..61c9946 100644
--- a/lab-data/linux/bootloader/beaglebone-black/README.txt
+++ b/lab-data/linux/bootloader/beaglebone-black/README.txt
@@ -9,6 +9,12 @@ Tested on the following board revisions:
 - Rev A5C
 - Rev A6
 
+Caution: this procedure can erase data installed on the board eMMC.
+This won't make your board unusable though. 
+
+If you want to install a distribution again on the eMMC, just go to
+http://beagleboard.org/latest-images and follow instructions.
+
 Make a bootable micro-SD card
 -----------------------------
 
@@ -40,13 +46,13 @@ Now, format the first partition in FAT format:
 sudo mkfs.vfat -F 16 /dev/mmcblk0p1 -n boot
 
 Remove the card and insert it again. It should automatically be mounted
-'/media/BOOT' (or '/media/$USER/BOOT' if you are using Ubuntu 12.10 or later).
+'/media/boot' (or '/media/$USER/boot' if you are using Ubuntu 12.10 or later).
 
 Now, copy the below files to this partition:
 
-cp am335x-boneblack.dtb MLO u-boot.img uEnv.txt uImage /media/$USER/BOOT
+cp am335x-boneblack.dtb MLO u-boot.img MLO.final u-boot.img.final uEnv.txt uImage /media/$USER/boot
 
-Now, unmount '/media/$USER/BOOT' and you are done!
+Now, unmount '/media/$USER/boot' and you are done!
 
 Using your bootable micro-SD card
 ---------------------------------
@@ -85,14 +91,13 @@ If the partitions need fixing and reformating, the root filesystem
 you will boot on contains many useful commands, in particular 'fdisk'
 and 'mkfs.vfat'.
 
-Restoring factory defaults
---------------------------
+The provided root filesystem may not be sufficient for all needs though.
+For example, we failed to create a partition table with correct eMMC 
+geometry settings with the provided fdisk command. fsck.vfat is not
+available either.
 
-At any time, you should be able to restore the original 'MLO' 
-and 'u-boot.img' files on the eMMC storage. To do this, boot on
-your special micro-SD card, access the command line on the serial console,
-mount the eMMC boot partition (/dev/mmcblk1p1), and copy
-the 'MLO.factory' and 'u-boot.img.factory' files to 'MLO' and 'u-boot.img'.
+Should you need more standard tools, you may boot the board with
+an MMC card with Debian on it (see http://beagleboard.org/latest-images).
 
 ===============================
 How the binaries where compiled
@@ -117,7 +122,12 @@ Compiling U-Boot
 Clone the mainline U-boot sources:
 git clone git://git.denx.de/u-boot.git
 git tag
-git checkout v2013.10
+git checkout v2014.04
+
+Apply a special configuration to ignore the U-Boot environment in eMMC
+
+git checkout -b reflash-from-mmc
+git apply 0001-BBB-configuration-ignoring-eMMC.patch (file available in the src/ directory)
 
 export ARCH=arm
 export CROSS_COMPILE=arm-linux-gnueabi-
diff --git a/lab-data/linux/bootloader/beaglebone-black/src/0001-BBB-configuration-ignoring-eMMC.patch b/lab-data/linux/bootloader/beaglebone-black/src/0001-BBB-configuration-ignoring-eMMC.patch
new file mode 100644
index 0000000..125f949
--- /dev/null
+++ b/lab-data/linux/bootloader/beaglebone-black/src/0001-BBB-configuration-ignoring-eMMC.patch
@@ -0,0 +1,58 @@
+From 9e705c6d8ea4bf7a65f1217ce5cb2114ef3fbfc0 Mon Sep 17 00:00:00 2001
+From: Michael Opdenacker <michael.opdenacker at free-electrons.com>
+Date: Tue, 27 May 2014 11:21:16 +0200
+Subject: [PATCH] BBB configuration ignoring eMMC
+
+- Useful to boot the BBB from MMC and completely ignore
+  the U-Boot environment that could be stored on eMMC.
+
+Signed-off-by: Michael Opdenacker <michael.opdenacker at free-electrons.com>
+---
+ boards.cfg                   | 2 +-
+ include/configs/am335x_evm.h | 9 ++++-----
+ 2 files changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/boards.cfg b/boards.cfg
+index b4203f1..86a361d 100644
+--- a/boards.cfg
++++ b/boards.cfg
+@@ -264,7 +264,7 @@ Active  arm         armv7          am33xx      siemens         dxr2
+ Active  arm         armv7          am33xx      siemens         pxm2                pxm2                                 -                                                                                                                                 Roger Meier <r.meier at siemens.com>
+ Active  arm         armv7          am33xx      siemens         rut                 rut                                  -                                                                                                                                 Roger Meier <r.meier at siemens.com>
+ Active  arm         armv7          am33xx      silica          pengwyn             pengwyn                              -                                                                                                                                 Lothar Felten <lothar.felten at gmail.com>
+-Active  arm         armv7          am33xx      ti              am335x              am335x_boneblack                     am335x_evm:SERIAL1,CONS_INDEX=1,EMMC_BOOT                                                                                         Tom Rini <trini at ti.com>
++Active  arm         armv7          am33xx      ti              am335x              am335x_boneblack                     am335x_evm:SERIAL1,CONS_INDEX=1                                                                                         Tom Rini <trini at ti.com>
+ Active  arm         armv7          am33xx      ti              am335x              am335x_evm                           am335x_evm:SERIAL1,CONS_INDEX=1,NAND                                                                                              Tom Rini <trini at ti.com>
+ Active  arm         armv7          am33xx      ti              am335x              am335x_evm_nor                       am335x_evm:SERIAL1,CONS_INDEX=1,NAND,NOR                                                                                          Tom Rini <trini at ti.com>
+ Active  arm         armv7          am33xx      ti              am335x              am335x_evm_norboot                   am335x_evm:SERIAL1,CONS_INDEX=1,NOR,NOR_BOOT                                                                                      Tom Rini <trini at ti.com>
+diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
+index ea9e758..a5fb466 100644
+--- a/include/configs/am335x_evm.h
++++ b/include/configs/am335x_evm.h
+@@ -32,6 +32,8 @@
+ /* Always 128 KiB env size */
+ #define CONFIG_ENV_SIZE			(128 << 10)
+ 
++#define CONFIG_ENV_IS_NOWHERE
++
+ /* Enhance our eMMC support / experience. */
+ #define CONFIG_CMD_GPT
+ #define CONFIG_EFI_PARTITION
+@@ -173,12 +175,9 @@
+ #endif
+ 
+ #define CONFIG_BOOTCOMMAND \
+-	"run findfdt; " \
+-	"run mmcboot;" \
+-	"setenv mmcdev 1; " \
+-	"setenv bootpart 1:2; " \
++	"setenv mmcdev 0; " \
++	"setenv bootpart 0; " \
+ 	"run mmcboot;" \
+-	"run nandboot;"
+ 
+ /* NS16550 Configuration */
+ #define CONFIG_SYS_NS16550_COM1		0x44e09000	/* Base EVM has UART0 */
+-- 
+1.9.1
+
diff --git a/lab-data/linux/bootloader/beaglebone-black/src/rootfs.tar.xz b/lab-data/linux/bootloader/beaglebone-black/src/rootfs.tar.xz
index ae22518..a918381 100644
Binary files a/lab-data/linux/bootloader/beaglebone-black/src/rootfs.tar.xz and b/lab-data/linux/bootloader/beaglebone-black/src/rootfs.tar.xz differ
diff --git a/lab-data/linux/bootloader/beaglebone-black/u-boot.img b/lab-data/linux/bootloader/beaglebone-black/u-boot.img
index bf8c9fc..be21efc 100644
Binary files a/lab-data/linux/bootloader/beaglebone-black/u-boot.img and b/lab-data/linux/bootloader/beaglebone-black/u-boot.img differ
diff --git a/lab-data/linux/bootloader/beaglebone-black/u-boot.img b/lab-data/linux/bootloader/beaglebone-black/u-boot.img.final
similarity index 100%
copy from lab-data/linux/bootloader/beaglebone-black/u-boot.img
copy to lab-data/linux/bootloader/beaglebone-black/u-boot.img.final
diff --git a/lab-data/linux/bootloader/beaglebone-black/uImage b/lab-data/linux/bootloader/beaglebone-black/uImage
index b5fc0fc..2ee9b53 100644
Binary files a/lab-data/linux/bootloader/beaglebone-black/uImage and b/lab-data/linux/bootloader/beaglebone-black/uImage differ



More information about the training-materials-updates mailing list