From 589759577bde8e6d0aea7f03c2dfd48e63f3e5a1 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 25 Jun 2015 17:56:46 +0200 Subject: [PATCH] chip-fel-flash.sh: add comments in the prepare_images function Signed-off-by: Boris Brezillon --- chip-fel-flash.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chip-fel-flash.sh b/chip-fel-flash.sh index c047daf..5c1eadb 100755 --- a/chip-fel-flash.sh +++ b/chip-fel-flash.sh @@ -30,6 +30,10 @@ prepare_images() { rm $out fi + # The BROM cannot read 16K pages: it only reads 8k of data at most. + # Split the SPL image in 8k chunks and pad each chunk with 8k of random + # data to limit the impact of repeated patterns on the MLC chip. + dd if=$in of=$out bs=8k count=1 skip=0 conv=sync dd if=/dev/urandom of=$out bs=8k count=1 seek=1 conv=sync dd if=$in of=$out bs=8k count=1 skip=1 seek=2 conv=sync @@ -38,6 +42,7 @@ prepare_images() { dd if=/dev/urandom of=$out bs=8k count=1 seek=5 conv=sync PADDED_SPL_SIZE=`stat --printf="%s" $out | xargs printf "0x%08x"` + # Align the u-boot image on a page boundary dd if=$UBOOT of=$PADDED_UBOOT bs=16k conv=sync PADDED_UBOOT_SIZE=`stat --printf="%s" $PADDED_UBOOT | xargs printf "0x%08x"` }