X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fenvironment.h;h=50c62c5645c8dbfbe8b528c3e9add17d1bcdb8bf;hb=c960ef29cd1bffccb84366cc6ca9c290cb3c36a0;hp=d29f82cb5d6faf148f126df5aa2207928a1628ef;hpb=6e6cf015e7cdd7ca83a933320a81201972bd5e5e;p=u-boot diff --git a/include/environment.h b/include/environment.h index d29f82cb5d..50c62c5645 100644 --- a/include/environment.h +++ b/include/environment.h @@ -1,8 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * (C) Copyright 2002 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. - * - * SPDX-License-Identifier: GPL-2.0+ */ #ifndef _ENVIRONMENT_H_ @@ -188,6 +187,7 @@ enum env_valid { }; enum env_location { + ENVL_UNKNOWN, ENVL_EEPROM, ENVL_EXT4, ENVL_FAT, @@ -202,24 +202,20 @@ enum env_location { ENVL_NOWHERE, ENVL_COUNT, - ENVL_UNKNOWN, +}; + +/* value for the various operations we want to perform on the env */ +enum env_operation { + ENVOP_GET_CHAR, /* we want to call the get_char function */ + ENVOP_INIT, /* we want to call the init function */ + ENVOP_LOAD, /* we want to call the load function */ + ENVOP_SAVE, /* we want to call the save function */ }; struct env_driver { const char *name; enum env_location location; - /** - * get_char() - Read a character from the environment - * - * This method is optional. If not provided, a default implementation - * will read from gd->env_addr. - * - * @index: Index of character to read (0=first) - * @return character read, or -ve on error - */ - int (*get_char)(int index); - /** * load() - Load the environment from storage * @@ -289,16 +285,10 @@ int env_export(env_t *env_out); #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT /* Select and import one of two redundant environments */ -int env_import_redund(const char *buf1, const char *buf2); +int env_import_redund(const char *buf1, int buf1_status, + const char *buf2, int buf2_status); #endif -/** - * env_driver_lookup_default() - Look up the default environment driver - * - * @return pointer to driver, or NULL if none (which should not happen) - */ -struct env_driver *env_driver_lookup_default(void); - /** * env_get_char() - Get a character from the early environment * @@ -323,6 +313,15 @@ int env_load(void); */ int env_save(void); +/** + * env_fix_drivers() - Updates envdriver as per relocation + */ +void env_fix_drivers(void); + +void eth_parse_enetaddr(const char *addr, uint8_t *enetaddr); +int eth_env_get_enetaddr(const char *name, uint8_t *enetaddr); +int eth_env_set_enetaddr(const char *name, const uint8_t *enetaddr); + #endif /* DO_DEPS_ONLY */ #endif /* _ENVIRONMENT_H_ */