Commit 8a3a7e2270b3 ("env: Pass additional parameters to the env
lookup function") dropped the default action if driver doesn't have
get_char() defined. This causes failure to get environmental
variables from NOR flash. Add back this default action for now.

Signed-off-by: York Sun <york....@nxp.com>
CC: Maxime Ripard <maxime.rip...@free-electrons.com>
---
Limited test on LS1043ARDB.

 env/env.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/env/env.c b/env/env.c
index edfb575..210bae2 100644
--- a/env/env.c
+++ b/env/env.c
@@ -159,7 +159,7 @@ int env_get_char(int index)
                int ret;
 
                if (!drv->get_char)
-                       continue;
+                       return *(uchar *)(gd->env_addr + index);
 
                if (!env_has_inited(drv->location))
                        continue;
-- 
2.7.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to