xref: /rk3399_rockchip-uboot/tools/env/fw_env.h (revision 0b367380a52ac36b552d40ed1b10064d894e35a9)
16aff3115Swdenk /*
2bc11756dSGrant Erickson  * (C) Copyright 2002-2008
36aff3115Swdenk  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
46aff3115Swdenk  *
51a459660SWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0+
66aff3115Swdenk  */
76aff3115Swdenk 
8e3c52f2bSTom Rini /* Pull in the current config to define the default environment */
9*0b367380SPeter Robinson #include <linux/kconfig.h>
10*0b367380SPeter Robinson 
11e3c52f2bSTom Rini #ifndef __ASSEMBLY__
12e3c52f2bSTom Rini #define __ASSEMBLY__ /* get only #defines from config.h */
13e3c52f2bSTom Rini #include <config.h>
14e3c52f2bSTom Rini #undef	__ASSEMBLY__
15e3c52f2bSTom Rini #else
16e3c52f2bSTom Rini #include <config.h>
17e3c52f2bSTom Rini #endif
18e3c52f2bSTom Rini 
19d0fb80c3Swdenk /*
209cbfee6dSFrans Meulenbroeks  * To build the utility with the static configuration
219cbfee6dSFrans Meulenbroeks  * comment out the next line.
22566e5cf4SWolfgang Denk  * See included "fw_env.config" sample file
23d0fb80c3Swdenk  * for notes on configuration.
24d0fb80c3Swdenk  */
25d791b1dcSwdenk #define CONFIG_FILE     "/etc/fw_env.config"
26d0fb80c3Swdenk 
27497f2053SJoe Hershberger #ifndef CONFIG_FILE
286aff3115Swdenk #define HAVE_REDUND /* For systems with 2 env sectors */
296aff3115Swdenk #define DEVICE1_NAME      "/dev/mtd1"
306aff3115Swdenk #define DEVICE2_NAME      "/dev/mtd2"
31d0fb80c3Swdenk #define DEVICE1_OFFSET    0x0000
326aff3115Swdenk #define ENV1_SIZE         0x4000
335d5cc384SFrans Meulenbroeks #define DEVICE1_ESIZE     0x4000
345d5cc384SFrans Meulenbroeks #define DEVICE1_ENVSECTORS     2
35d0fb80c3Swdenk #define DEVICE2_OFFSET    0x0000
366aff3115Swdenk #define ENV2_SIZE         0x4000
375d5cc384SFrans Meulenbroeks #define DEVICE2_ESIZE     0x4000
385d5cc384SFrans Meulenbroeks #define DEVICE2_ENVSECTORS     2
39497f2053SJoe Hershberger #endif
406aff3115Swdenk 
41e3c52f2bSTom Rini #ifndef CONFIG_BAUDRATE
42e3c52f2bSTom Rini #define CONFIG_BAUDRATE		115200
43e3c52f2bSTom Rini #endif
44e3c52f2bSTom Rini 
45e3c52f2bSTom Rini #ifndef CONFIG_BOOTDELAY
46e3c52f2bSTom Rini #define CONFIG_BOOTDELAY	5	/* autoboot after 5 seconds	*/
47e3c52f2bSTom Rini #endif
48e3c52f2bSTom Rini 
49e3c52f2bSTom Rini #ifndef CONFIG_BOOTCOMMAND
50e3c52f2bSTom Rini #define CONFIG_BOOTCOMMAND							\
51e3c52f2bSTom Rini 	"bootp; "								\
52e3c52f2bSTom Rini 	"setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} "	\
53e3c52f2bSTom Rini 	"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; "	\
54e3c52f2bSTom Rini 	"bootm"
55e3c52f2bSTom Rini #endif
56e3c52f2bSTom Rini 
57bc11756dSGrant Erickson extern int   fw_printenv(int argc, char *argv[]);
586de66b35SMarkus Klotzbücher extern char *fw_getenv  (char *name);
596aff3115Swdenk extern int fw_setenv  (int argc, char *argv[]);
60bd7b26f8SStefano Babic extern int fw_parse_script(char *fname);
61bd7b26f8SStefano Babic extern int fw_env_open(void);
62bd7b26f8SStefano Babic extern int fw_env_write(char *name, char *value);
63bd7b26f8SStefano Babic extern int fw_env_close(void);
646aff3115Swdenk 
656aff3115Swdenk extern unsigned	long  crc32	 (unsigned long, const unsigned char *, unsigned);
66