From: Alexey Brodkin Date: Fri, 1 Jul 2016 20:01:57 +0000 (+0300) Subject: cubieboard2: Accommodate U-Boot environment on SD-card X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0ce3963a62df423a939c6f8f9d1f961a71d5d74f;p=buildroot.git cubieboard2: Accommodate U-Boot environment on SD-card According to current "include/configs/sunxi-common.h" U-Boot environment is stored on SD-card with offset 544 kB and its size is limited as 128 kB. Given memory layout of sunxi boards: 1. SPL 2. U-Boot 3. U-Boot environment 4. Partitions (see http://linux-sunxi.org/Bootable_SD_card#SD_Card_Layout for details) we need to make sure the first real partition starts at least with 544+128 kB offset. Adding a small safety gap let's put the first partition with offset 1MB from the beginning of SD-card. Otherwise current setup gets broken as soon as one saves U-Boot environment with "saveenv" which basically overwrites FAT partition with zImage and board no longer boots into Linux kernel. [Peter: extend description, add padding to u-boot partition instead] Signed-off-by: Alexey Brodkin Cc: Erico Nunes Cc: Thomas Petazzoni Cc: Peter Korsgaard Cc: Carlos Quijano Cc: Andi Shyti Signed-off-by: Peter Korsgaard --- diff --git a/board/cubietech/cubieboard2/genimage.cfg b/board/cubietech/cubieboard2/genimage.cfg index 8929a721e5..b082ab0da1 100644 --- a/board/cubietech/cubieboard2/genimage.cfg +++ b/board/cubietech/cubieboard2/genimage.cfg @@ -20,6 +20,7 @@ image sdcard.img { in-partition-table = "no" image = "u-boot-sunxi-with-spl.bin" offset = 8192 + size = 1040384 # 1MB - 8192 } partition boot {