summaryrefslogtreecommitdiff
path: root/drivers/net/dwc_eth_qos.c
diff options
context:
space:
mode:
authorMattijs Korpershoek <mkorpershoek@baylibre.com>2024-07-19 17:38:54 +0200
committerTom Rini <trini@konsulko.com>2024-07-31 11:19:20 -0600
commitb2345dbdaa864b71cd58bd20b1b9e8440de639c7 (patch)
tree09b8254162a00468f87d5faddaadfc2bdba65557 /drivers/net/dwc_eth_qos.c
parentc9860d7ac530971e81e36c0b993fbfb02a42afb3 (diff)
env: mmc: Fix env loading with CONFIG_SYS_MMC_ENV_PART
When CONFIG_SYS_MMC_ENV_PART=2, the environment is loaded from the USER partition (hwpart=0) instead of from the BOOT1 partition (hwpart=2). IS_ENABLED() cannot be used for non-boolean KConfig options. Its documentation states: > * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', > * 0 otherwise. So in our case, IS_ENABLED(CONFIG_SYS_MMC_ENV_PART) evaluates to 0. Because of this, the hwpart variable is never assigned and mmc_offset() ends up switching back to the USER hwpart (0) instead of BOOT1 (2). Fix it by using #define instead. Tested with: # have CONFIG_SYS_MMC_ENV_PART=2 in defconfig # 1. Erase mmc0boot1 => mmc dev 0 2 => mmc erase 0 400 => mmc read ${loadaddr} 0 400 => md ${loadaddr} 4 82000000: 00000000 00000000 00000000 00000000 ................ # 2. Restore default environment and save to MMC => env default -a -f => saveenv # 3. Read back mmc0boot1 and confirm the env is present => mmc read ${loadaddr} 0 400 => md ${loadaddr} 4 82000000: 13e0632e 72646461 7469665f 3978303d .c..addr_fit=0x9 Fixes: 5b4acb0ff79d ("env: mmc: Apply GPT only on eMMC user HW partition") Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/net/dwc_eth_qos.c')
0 files changed, 0 insertions, 0 deletions