]> git.ipfire.org Git - thirdparty/u-boot.git/blame - include/env_callback.h
Prepare v2024.10-rc5
[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
17/* Board configs can define additional static callback bindings */
6e7df1d1
TR
18#ifndef CFG_ENV_CALLBACK_LIST_STATIC
19#define CFG_ENV_CALLBACK_LIST_STATIC
170ab110
JH
20#endif
21
e080d545
JH
22#ifdef CONFIG_SILENT_CONSOLE
23#define SILENT_CALLBACK "silent:silent,"
24#else
25#define SILENT_CALLBACK
26#endif
27
bdf1fe4e
JH
28#ifdef CONFIG_REGEX
29#define ENV_DOT_ESCAPE "\\"
30#else
31#define ENV_DOT_ESCAPE
32#endif
33
fd305633
JH
34#ifdef CONFIG_CMD_DNS
35#define DNS_CALLBACK "dnsip:dnsip,"
36#else
37#define DNS_CALLBACK
38#endif
39
cccc05ee 40#ifdef CONFIG_NET
fd305633
JH
41#define NET_CALLBACKS \
42 "bootfile:bootfile," \
43 "ipaddr:ipaddr," \
44 "gatewayip:gatewayip," \
45 "netmask:netmask," \
46 "serverip:serverip," \
47 "nvlan:nvlan," \
48 "vlan:vlan," \
6e0d26c0 49 DNS_CALLBACK \
f7848d90 50 "eth" ETHADDR_WILDCARD "addr:ethaddr,"
fd305633
JH
51#else
52#define NET_CALLBACKS
53#endif
54
1dfa4ef1
VM
55#ifdef CONFIG_IPV6
56#define NET6_CALLBACKS \
57 "ip6addr:ip6addr," \
58 "serverip6:serverip6," \
59 "gatewayip6:gatewayip6,"
60#else
61#define NET6_CALLBACKS
62#endif
63
d42243fe
SG
64#ifdef CONFIG_BOOTSTD_FULL
65#define BOOTSTD_CALLBACK \
66 "bootmeths:bootmeths," \
67 "bootargs:bootargs,"
a950d31a
SG
68#else
69#define BOOTSTD_CALLBACK
70#endif
71
170ab110
JH
72/*
73 * This list of callback bindings is static, but may be overridden by defining
74 * a new association in the ".callbacks" environment variable.
75 */
bdf1fe4e
JH
76#define ENV_CALLBACK_LIST_STATIC ENV_DOT_ESCAPE ENV_CALLBACK_VAR ":callbacks," \
77 ENV_DOT_ESCAPE ENV_FLAGS_VAR ":flags," \
32057717 78 "baudrate:baudrate," \
fd305633 79 NET_CALLBACKS \
1dfa4ef1 80 NET6_CALLBACKS \
a950d31a 81 BOOTSTD_CALLBACK \
1cf0a8b2 82 "loadaddr:loadaddr," \
e080d545 83 SILENT_CALLBACK \
849d5d9c 84 "stdin:console,stdout:console,stderr:console," \
de4e4eda 85 "serial#:serialno," \
6e7df1d1 86 CFG_ENV_CALLBACK_LIST_STATIC
170ab110 87
e13df08a 88#ifndef CONFIG_SPL_BUILD
dd2408ca 89void env_callback_init(struct env_entry *var_entry);
e13df08a
RV
90#else
91static inline void env_callback_init(struct env_entry *var_entry)
92{
93}
94#endif
170ab110 95
170ab110 96#endif /* __ENV_CALLBACK_H__ */