u-boot/env
Patrick Delaunay d72267049b env: mmc : align erase address and size on erase_grp_size
On eMMC device, the erase_grp_size > 1 so the address and size for the
erase block command in env/mmc.c can be unaligned on erase group size and
some strange trace occurs and the result is not guarantee by MMC devices.

The SD-Card behavior doesn't change as erase_grp_size = 1 for SD-Card.

For example, on eMMC present on STM32MP15C-EV1 and before the patch:

  STM32MP> env erase

  Erasing Environment on MMC...

  Caution! Your devices Erase group is 0x400
  The erase range would be change to 0x2000~0x27ff

  16 blocks erased: OK

  Caution! Your devices Erase group is 0x400
  The erase range would be change to 0x2000~0x23ff

  16 blocks erased: OK
  OK

After this patch:
  STM32MP> env erase
  Erasing Environment on MMC...
  1024 blocks erased at 0x2000: OK
  1024 blocks erased at 0x2000: OK
  OK

Here the 2 copies of U-Boot environment are in the same devices Erase
group: it is erased twice.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-06-15 15:34:18 +09:00
..
attr.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
callback.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
common.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
eeprom.c env: Drop env_get_char_spec() and old, unused .get_char() implementations 2021-10-21 12:50:48 -06:00
embedded.c env: Allow U-Boot scripts to be placed in a .env file 2021-11-16 14:35:08 -05:00
env.c env: Implement lower priority arch_env_get_location() 2022-04-21 09:08:40 -04:00
ext4.c env: add ENV_ERASE_PTR macro 2021-04-16 17:32:34 -04:00
fat.c env: fat: Allow overriding interface, device and partition 2022-04-07 16:50:53 -04:00
flags.c env: Fix warning when forcing environment without ENV_ACCESS_IGNORE_FORCE 2021-04-16 11:55:55 -04:00
flash.c env: flash: Cosmetic fix 2021-10-31 12:26:44 -06:00
Kconfig Convert CONFIG_ETHPRIME to Kconfig 2022-03-18 12:48:17 -04:00
Makefile env: remove callback.o for an SPL build 2020-04-24 10:09:59 -04:00
mmc.c env: mmc : align erase address and size on erase_grp_size 2022-06-15 15:34:18 +09:00
nand.c env: nand: Put ENV_INVALID into gd->env_valid if default environment 2021-10-31 12:26:44 -06:00
nowhere.c env: nowhere: Cosmetic fix 2021-10-31 12:26:44 -06:00
nvram.c env: nvram: Cosmetic fix in env_nvram_init() 2021-10-31 12:26:44 -06:00
onenand.c mtd: Remove mtd_erase_callback() entirely 2021-10-23 15:47:33 +05:30
remote.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
sata.c env: Discern environment coming from external storage 2020-07-31 10:13:00 -04:00
sf.c spi: spi_flash_probe_bus_cs() rely on DT for spi speed and mode 2022-05-23 09:33:10 -04:00
ubi.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00