1 /* 2 * (C) Copyright 2002-2008 3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 * 5 * SPDX-License-Identifier: GPL-2.0+ 6 */ 7 8 /* Pull in the current config to define the default environment */ 9 #include <linux/kconfig.h> 10 11 #ifndef __ASSEMBLY__ 12 #define __ASSEMBLY__ /* get only #defines from config.h */ 13 #include <config.h> 14 #undef __ASSEMBLY__ 15 #else 16 #include <config.h> 17 #endif 18 19 /* 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. 24 */ 25 #define CONFIG_FILE "/etc/fw_env.config" 26 27 #ifndef CONFIG_FILE 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 39 #endif 40 41 #ifndef CONFIG_BAUDRATE 42 #define CONFIG_BAUDRATE 115200 43 #endif 44 45 #ifndef CONFIG_BOOTDELAY 46 #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */ 47 #endif 48 49 #ifndef CONFIG_BOOTCOMMAND 50 #define CONFIG_BOOTCOMMAND \ 51 "bootp; " \ 52 "setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} " \ 53 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; " \ 54 "bootm" 55 #endif 56 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); 64 65 extern unsigned long crc32 (unsigned long, const unsigned char *, unsigned); 66