changed to 4 MB padding also in chip-flash to prevent bit flips

This commit is contained in:
Alex Kaplan 2016-01-09 22:31:57 -08:00
parent 1a2acbc0d8
commit 631503a187

View File

@ -103,7 +103,7 @@ SPL="$BUILDROOT_OUTPUT_DIR/images/sunxi-spl.bin"
SPL_MEM_ADDR=0x43000000 SPL_MEM_ADDR=0x43000000
UBOOT="$BUILDROOT_OUTPUT_DIR/images/u-boot-dtb.bin" UBOOT="$BUILDROOT_OUTPUT_DIR/images/u-boot-dtb.bin"
PADDED_UBOOT="$TMPDIR/padded-uboot" PADDED_UBOOT="$TMPDIR/padded-uboot"
PADDED_UBOOT_SIZE=0xc0000 PADDED_UBOOT_SIZE=0x400000
UBOOT_MEM_ADDR=0x4a000000 UBOOT_MEM_ADDR=0x4a000000
UBI="$BUILDROOT_OUTPUT_DIR/images/rootfs.ubi" UBI="$BUILDROOT_OUTPUT_DIR/images/rootfs.ubi"
SPARSE_UBI="${TMPDIR}/rootfs.ubi.sparse" SPARSE_UBI="${TMPDIR}/rootfs.ubi.sparse"
@ -126,17 +126,17 @@ prepare_images() {
exit 1 exit 1
fi fi
PADDED_SPL_SIZE=$(filesize "${PADDED_SPL}") PADDED_SPL_SIZE=$(filesize "${PADDED_SPL}")
PADDED_SPL_SIZE=$(($PADDED_SPL_SIZE / ($PAGE_SIZE + $OOB_SIZE))) PADDED_SPL_SIZE=$(($PADDED_SPL_SIZE / ($PAGE_SIZE + $OOB_SIZE)))
PADDED_SPL_SIZE=$(echo $PADDED_SPL_SIZE | xargs printf "0x%08x") PADDED_SPL_SIZE=$(echo $PADDED_SPL_SIZE | xargs printf "0x%08x")
log "PADDED_SPL_SIZE=$PADDED_SPL_SIZE" log "PADDED_SPL_SIZE=$PADDED_SPL_SIZE"
# Align the u-boot image on a page boundary # Align the u-boot image on block boundary
dd if="$UBOOT" of="$PADDED_UBOOT" bs=16k conv=sync dd if="$UBOOT" of="$PADDED_UBOOT" bs=4MB conv=sync
UBOOT_SIZE=`filesize "$PADDED_UBOOT" | xargs printf "0x%08x"` UBOOT_SIZE=`filesize "$PADDED_UBOOT" | xargs printf "0x%08x"`
log "UBOOT_SIZE=${UBOOT_SIZE}" log "UBOOT_SIZE=${UBOOT_SIZE}"
log "PADDED_UBOOT_SIZE=${PADDED_UBOOT_SIZE}" log "PADDED_UBOOT_SIZE=${PADDED_UBOOT_SIZE}"
dd if=/dev/urandom of="$PADDED_UBOOT" seek=$((UBOOT_SIZE / 0x4000)) bs=16k count=$(((PADDED_UBOOT_SIZE - UBOOT_SIZE) / 0x4000)) dd if=/dev/urandom of="$PADDED_UBOOT" seek=$((UBOOT_SIZE / 0x4000)) bs=16k count=$(((PADDED_UBOOT_SIZE - UBOOT_SIZE) / 0x4000))
} }
prepare_uboot_script() { prepare_uboot_script() {