summaryrefslogtreecommitdiff
path: root/env
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2024-01-19 08:02:58 -0500
committerTom Rini <[email protected]>2024-01-19 08:02:58 -0500
commitcb493752394adec8db1d6f5e9b8fb3c43e13f10a (patch)
treeb6019220b9a4c2a8ec6eb410a7ef2cded70f4ef0 /env
parentf7cca7ccc5117eaafcc2bde91ad1bed6fee7cfc3 (diff)
parentc16c7ac2fe69f3cebbfc921c5b023dccc12cd198 (diff)
Merge tag 'u-boot-rockchip-20240119' of https://source.denx.de/u-boot/custodians/u-boot-rockchip
- Add board: rk3328 FriendlyARM NanoPi R2C Plus, rk3588 Turing RK1 SoM; - Enable SPI boot for rk3588 and rk3528; - Set boot device in SPL as common code; - other misc fixes;
Diffstat (limited to 'env')
-rw-r--r--env/common.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/env/common.c b/env/common.c
index 656748c1f5b..beebbd163bf 100644
--- a/env/common.c
+++ b/env/common.c
@@ -351,14 +351,24 @@ bool env_get_autostart(void)
*/
char *env_get_default(const char *name)
{
- if (env_get_from_linear(default_environment, name,
- (char *)(gd->env_buf),
- sizeof(gd->env_buf)) >= 0)
+ int ret;
+
+ ret = env_get_default_into(name, (char *)(gd->env_buf),
+ sizeof(gd->env_buf));
+ if (ret >= 0)
return (char *)(gd->env_buf);
return NULL;
}
+/*
+ * Look up the variable from the default environment and store its value in buf
+ */
+int env_get_default_into(const char *name, char *buf, unsigned int len)
+{
+ return env_get_from_linear(default_environment, name, buf, len);
+}
+
void env_set_default(const char *s, int flags)
{
if (s) {