2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2012-12-12 04:16:24 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2012
|
|
|
|
* Joe Hershberger, National Instruments, joe.hershberger@ni.com
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ENV_CALLBACK_H__
|
|
|
|
#define __ENV_CALLBACK_H__
|
|
|
|
|
2012-12-12 04:16:31 +00:00
|
|
|
#include <env_flags.h>
|
2012-12-12 04:16:24 +00:00
|
|
|
#include <linker_lists.h>
|
|
|
|
#include <search.h>
|
|
|
|
|
|
|
|
#define ENV_CALLBACK_VAR ".callbacks"
|
|
|
|
|
|
|
|
/* Board configs can define additional static callback bindings */
|
|
|
|
#ifndef CONFIG_ENV_CALLBACK_LIST_STATIC
|
|
|
|
#define CONFIG_ENV_CALLBACK_LIST_STATIC
|
|
|
|
#endif
|
|
|
|
|
2012-12-12 04:16:30 +00:00
|
|
|
#ifdef CONFIG_SILENT_CONSOLE
|
|
|
|
#define SILENT_CALLBACK "silent:silent,"
|
|
|
|
#else
|
|
|
|
#define SILENT_CALLBACK
|
|
|
|
#endif
|
|
|
|
|
2015-05-20 19:27:20 +00:00
|
|
|
#ifdef CONFIG_REGEX
|
|
|
|
#define ENV_DOT_ESCAPE "\\"
|
|
|
|
#else
|
|
|
|
#define ENV_DOT_ESCAPE
|
|
|
|
#endif
|
|
|
|
|
2015-05-20 19:27:23 +00:00
|
|
|
#ifdef CONFIG_CMD_DNS
|
|
|
|
#define DNS_CALLBACK "dnsip:dnsip,"
|
|
|
|
#else
|
|
|
|
#define DNS_CALLBACK
|
|
|
|
#endif
|
|
|
|
|
2019-09-02 08:10:34 +00:00
|
|
|
#ifdef CONFIG_NET
|
2015-05-20 19:27:23 +00:00
|
|
|
#define NET_CALLBACKS \
|
|
|
|
"bootfile:bootfile," \
|
|
|
|
"ipaddr:ipaddr," \
|
|
|
|
"gatewayip:gatewayip," \
|
|
|
|
"netmask:netmask," \
|
|
|
|
"serverip:serverip," \
|
|
|
|
"nvlan:nvlan," \
|
|
|
|
"vlan:vlan," \
|
2015-05-20 19:27:26 +00:00
|
|
|
DNS_CALLBACK \
|
2015-06-22 22:57:36 +00:00
|
|
|
"eth" ETHADDR_WILDCARD "addr:ethaddr,"
|
2015-05-20 19:27:23 +00:00
|
|
|
#else
|
|
|
|
#define NET_CALLBACKS
|
|
|
|
#endif
|
|
|
|
|
2022-04-25 05:31:08 +00:00
|
|
|
#ifdef CONFIG_BOOTSTD
|
|
|
|
#define BOOTSTD_CALLBACK "bootmeths:bootmeths,"
|
|
|
|
#else
|
|
|
|
#define BOOTSTD_CALLBACK
|
|
|
|
#endif
|
|
|
|
|
2012-12-12 04:16:24 +00:00
|
|
|
/*
|
|
|
|
* This list of callback bindings is static, but may be overridden by defining
|
|
|
|
* a new association in the ".callbacks" environment variable.
|
|
|
|
*/
|
2015-05-20 19:27:20 +00:00
|
|
|
#define ENV_CALLBACK_LIST_STATIC ENV_DOT_ESCAPE ENV_CALLBACK_VAR ":callbacks," \
|
|
|
|
ENV_DOT_ESCAPE ENV_FLAGS_VAR ":flags," \
|
2012-12-12 04:16:27 +00:00
|
|
|
"baudrate:baudrate," \
|
2015-05-20 19:27:23 +00:00
|
|
|
NET_CALLBACKS \
|
2022-04-25 05:31:08 +00:00
|
|
|
BOOTSTD_CALLBACK \
|
2012-12-12 04:16:28 +00:00
|
|
|
"loadaddr:loadaddr," \
|
2012-12-12 04:16:30 +00:00
|
|
|
SILENT_CALLBACK \
|
2012-12-12 04:16:29 +00:00
|
|
|
"stdin:console,stdout:console,stderr:console," \
|
2017-09-01 12:42:03 +00:00
|
|
|
"serial#:serialno," \
|
2012-12-12 04:16:24 +00:00
|
|
|
CONFIG_ENV_CALLBACK_LIST_STATIC
|
|
|
|
|
2020-02-27 13:56:10 +00:00
|
|
|
#ifndef CONFIG_SPL_BUILD
|
2019-08-02 15:44:18 +00:00
|
|
|
void env_callback_init(struct env_entry *var_entry);
|
2020-02-27 13:56:10 +00:00
|
|
|
#else
|
|
|
|
static inline void env_callback_init(struct env_entry *var_entry)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
2012-12-12 04:16:24 +00:00
|
|
|
|
|
|
|
#endif /* __ENV_CALLBACK_H__ */
|