summaryrefslogtreecommitdiff
path: root/board/xilinx/versal-net/board.c
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@amd.com>2024-03-22 12:43:17 +0100
committerMichal Simek <michal.simek@amd.com>2024-04-02 15:07:22 +0200
commit097ccdf9623d650aebe32ea98828d81503f63a10 (patch)
treeadb2e849b6753fe46f9a1f215792b092a4a86c91 /board/xilinx/versal-net/board.c
parent8e462bf3bdea694dbc359de5933fd3aabd8c7ac3 (diff)
xilinx: Do not call private env_get_location() when !ENV_IS_NOWHERE
Private function for finding out location of environment is not working when ENV_IS_NOWHERE is disabled. The reason is that current fallback is ENVL_UNKNOWN when CONFIG_ENV_IS_NOWHERE is not enabled. The code could be updated like this - return ENVL_NOWHERE; + if (IS_ENABLED(CONFIG_ENV_IS_NOWHERE)) + return ENVL_NOWHERE; + return ENVL_UNKNOWN; But then boot is still not working because ENVL_UNKNOWN has no driver and env_init() returns -ENODEV. That's why it is better not to define board specific env_get_location() because then weak env_get_location() is used which is going over env_locations[] and returning locations which are actually enabled in u-boot instance. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/830b9c93d30688cfa8a5cbb0388e79deb7731f29.1711107795.git.michal.simek@amd.com
Diffstat (limited to 'board/xilinx/versal-net/board.c')
-rw-r--r--board/xilinx/versal-net/board.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/board/xilinx/versal-net/board.c b/board/xilinx/versal-net/board.c
index aecaeb65745..da03024e162 100644
--- a/board/xilinx/versal-net/board.c
+++ b/board/xilinx/versal-net/board.c
@@ -372,6 +372,7 @@ void reset_cpu(void)
{
}
+#if defined(CONFIG_ENV_IS_NOWHERE)
enum env_location env_get_location(enum env_operation op, int prio)
{
u8 bootmode = versal_net_get_bootmode();
@@ -401,3 +402,4 @@ enum env_location env_get_location(enum env_operation op, int prio)
return ENVL_NOWHERE;
}
}
+#endif