]> git.ipfire.org Git - thirdparty/u-boot.git/blame - include/env_callback.h
Merge tag 'qcom-main-20250714' of https://source.denx.de/u-boot/custodians/u-boot...
[thirdparty/u-boot.git] / include / env_callback.h
CommitLineData
83d290c5 1/* SPDX-License-Identifier: GPL-2.0+ */
170ab110
JH
2/*
3 * (C) Copyright 2012
4 * Joe Hershberger, National Instruments, joe.hershberger@ni.com
170ab110
JH
5 */
6
7#ifndef __ENV_CALLBACK_H__
8#define __ENV_CALLBACK_H__
9
03de305e 10#include <config.h>
2598090b 11#include <env_flags.h>
170ab110
JH
12#include <linker_lists.h>
13#include <search.h>
14
15#define ENV_CALLBACK_VAR ".callbacks"
16
e080d545
JH
17#ifdef CONFIG_SILENT_CONSOLE
18#define SILENT_CALLBACK "silent:silent,"
19#else
20#define SILENT_CALLBACK
21#endif
22
bdf1fe4e
JH
23#ifdef CONFIG_REGEX
24#define ENV_DOT_ESCAPE "\\"
25#else
26#define ENV_DOT_ESCAPE
27#endif
28
fd305633
JH
29#ifdef CONFIG_CMD_DNS
30#define DNS_CALLBACK "dnsip:dnsip,"
31#else
32#define DNS_CALLBACK
33#endif
34
6aa9c0f4 35#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
fd305633
JH
36#define NET_CALLBACKS \
37 "bootfile:bootfile," \
38 "ipaddr:ipaddr," \
39 "gatewayip:gatewayip," \
40 "netmask:netmask," \
41 "serverip:serverip," \
42 "nvlan:nvlan," \
43 "vlan:vlan," \
6e0d26c0 44 DNS_CALLBACK \
f7848d90 45 "eth" ETHADDR_WILDCARD "addr:ethaddr,"
fd305633
JH
46#else
47#define NET_CALLBACKS
48#endif
49
1dfa4ef1
VM
50#ifdef CONFIG_IPV6
51#define NET6_CALLBACKS \
52 "ip6addr:ip6addr," \
53 "serverip6:serverip6," \
54 "gatewayip6:gatewayip6,"
55#else
56#define NET6_CALLBACKS
57#endif
58
d42243fe
SG
59#ifdef CONFIG_BOOTSTD_FULL
60#define BOOTSTD_CALLBACK \
61 "bootmeths:bootmeths," \
62 "bootargs:bootargs,"
a950d31a
SG
63#else
64#define BOOTSTD_CALLBACK
65#endif
66
4b178455
RV
67#ifdef CONFIG_DFU
68#define DFU_CALLBACK "dfu_alt_info:dfu_alt_info,"
69#else
70#define DFU_CALLBACK
71#endif
72
170ab110
JH
73/*
74 * This list of callback bindings is static, but may be overridden by defining
75 * a new association in the ".callbacks" environment variable.
76 */
bdf1fe4e
JH
77#define ENV_CALLBACK_LIST_STATIC ENV_DOT_ESCAPE ENV_CALLBACK_VAR ":callbacks," \
78 ENV_DOT_ESCAPE ENV_FLAGS_VAR ":flags," \
32057717 79 "baudrate:baudrate," \
fd305633 80 NET_CALLBACKS \
1dfa4ef1 81 NET6_CALLBACKS \
a950d31a 82 BOOTSTD_CALLBACK \
4b178455 83 DFU_CALLBACK \
1cf0a8b2 84 "loadaddr:loadaddr," \
e080d545 85 SILENT_CALLBACK \
849d5d9c 86 "stdin:console,stdout:console,stderr:console," \
de4e4eda 87 "serial#:serialno," \
dca82739 88 CONFIG_ENV_CALLBACK_LIST_STATIC
170ab110 89
f38956a6 90#ifndef CONFIG_XPL_BUILD
dd2408ca 91void env_callback_init(struct env_entry *var_entry);
e13df08a
RV
92#else
93static inline void env_callback_init(struct env_entry *var_entry)
94{
95}
96#endif
170ab110 97
170ab110 98#endif /* __ENV_CALLBACK_H__ */