2 * (C) Copyright 2002-2008
5 * SPDX-License-Identifier: GPL-2.0+
8 /* Pull in the current config to define the default environment */
9 #include <linux/kconfig.h>
12 #define __ASSEMBLY__ /* get only #defines from config.h */
20 * To build the utility with the static configuration
21 * comment out the next line.
22 * See included "fw_env.config" sample file
23 * for notes on configuration.
25 #define CONFIG_FILE "/etc/fw_env.config"
28 #define HAVE_REDUND /* For systems with 2 env sectors */
29 #define DEVICE1_NAME "/dev/mtd1"
30 #define DEVICE2_NAME "/dev/mtd2"
31 #define DEVICE1_OFFSET 0x0000
32 #define ENV1_SIZE 0x4000
33 #define DEVICE1_ESIZE 0x4000
34 #define DEVICE1_ENVSECTORS 2
35 #define DEVICE2_OFFSET 0x0000
36 #define ENV2_SIZE 0x4000
37 #define DEVICE2_ESIZE 0x4000
38 #define DEVICE2_ENVSECTORS 2
41 #ifndef CONFIG_BAUDRATE
42 #define CONFIG_BAUDRATE 115200
45 #ifndef CONFIG_BOOTDELAY
46 #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
49 #ifndef CONFIG_BOOTCOMMAND
50 #define CONFIG_BOOTCOMMAND \
52 "setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} " \
53 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; " \
57 extern int fw_printenv(int argc, char *argv[]);
58 extern char *fw_getenv (char *name);
59 extern int fw_setenv (int argc, char *argv[]);
60 extern int fw_parse_script(char *fname);
61 extern int fw_env_open(void);
62 extern int fw_env_write(char *name, char *value);
63 extern int fw_env_close(void);
65 extern unsigned long crc32 (unsigned long, const unsigned char *, unsigned);