summaryrefslogtreecommitdiff
path: root/drivers/ddr/marvell/a38x/ddr3_training_ip_engine.h
diff options
context:
space:
mode:
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>2024-09-12 15:41:41 +0200
committerTom Rini <trini@konsulko.com>2024-10-01 08:44:39 -0600
commitc1131aca9adfb2861dd34ba0e45f593874adcd81 (patch)
treed32b02a18f1f19d2eedb5035bb45bb97211cc155 /drivers/ddr/marvell/a38x/ddr3_training_ip_engine.h
parent9402e3bb8c5dea255af7ad2854aed8f09a08bcf8 (diff)
env: mmc: rework mmc_env_partition_by_guid() to work with two separate partitions
Having two separate partitions for use in a redundant environment setup works just fine, if one only relies on setting CONFIG_ENV_OFFSET and CONFIG_ENV_OFFSET_REDUND. However, if CONFIG_PARTITION_TYPE_GUID is enabled, the current logic in mmc_env_partition_by_guid() means that only the first partition will ever be considered, and prior to the previous commit, lead to silent data corruption. Extend the logic so that, when we are looking for the location for the second copy of the environment, we keep track of whether we have already found one matching partition. If a second match is found, return that, but also modify *copy so that the logic in the caller will use the last ENV_SIZE bytes of that second partition - in my case, and I suppose that would be typical, both partitions have been created with a size of exactly the desired ENV_SIZE. When only a single matching partition exists, the behaviour is unchanged: We return that single partition, and *copy is left as-is, so the logic in the caller will either use the last (copy==0) or second-to-last (copy==1) ENV_SIZE bytes. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Diffstat (limited to 'drivers/ddr/marvell/a38x/ddr3_training_ip_engine.h')
0 files changed, 0 insertions, 0 deletions