mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-08-22 09:58:52 +09:00
![Maxime Ripard](/assets/img/avatar_default.png)
The U-Boot binary may trip over its actual allocated size in the storage. In such a case, the environment will not be readable anymore (because corrupted when the new image was flashed), and any attempt at using saveenv to reconstruct the environment will result in a corrupted U-Boot binary. Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
27 lines
660 B
Plaintext
27 lines
660 B
Plaintext
#include <config.h>
|
|
|
|
/*
|
|
* This is the maximum size the U-Boot binary can be, which is basically
|
|
* the start of the environment, minus the start of the U-Boot binary in
|
|
* the MMC. This makes the assumption that the MMC is using 512-bytes
|
|
* blocks, but devices using something other than that remains to be
|
|
* seen.
|
|
*/
|
|
#define UBOOT_MMC_MAX_SIZE (CONFIG_ENV_OFFSET - (CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512))
|
|
|
|
/ {
|
|
binman {
|
|
filename = "u-boot-sunxi-with-spl.bin";
|
|
pad-byte = <0xff>;
|
|
blob {
|
|
filename = "spl/sunxi-spl.bin";
|
|
};
|
|
u-boot-img {
|
|
#ifdef CONFIG_MMC
|
|
size = <UBOOT_MMC_MAX_SIZE>;
|
|
#endif
|
|
pos = <CONFIG_SPL_PAD_TO>;
|
|
};
|
|
};
|
|
};
|