xref: /openbmc/u-boot/tools/env/README (revision 6aff3115b90780933d390d2b471479179927468d)
1*6aff3115Swdenk
2*6aff3115SwdenkThis is a demo implementation of a Linux command line tool to access
3*6aff3115Swdenkthe U-Boot's environment variables.
4*6aff3115Swdenk
5*6aff3115SwdenkConfiguration is done via #defines in the fw_env.h file. The
6*6aff3115Swdenkfollowing lines are relevant:
7*6aff3115Swdenk
8*6aff3115Swdenk#define HAVE_REDUND	/* For systems with 2 env sectors */
9*6aff3115Swdenk#define DEVICE1_NAME	"/dev/mtd1"
10*6aff3115Swdenk#define DEVICE2_NAME	"/dev/mtd2"
11*6aff3115Swdenk#define ENV1_SIZE	0x4000
12*6aff3115Swdenk#define DEVICE1_ESIZE	0x4000
13*6aff3115Swdenk#define ENV2_SIZE	0x4000
14*6aff3115Swdenk#define DEVICE2_ESIZE	0x4000
15*6aff3115Swdenk
16*6aff3115SwdenkCurrent configuration matches the environment layout of the TRAB
17*6aff3115Swdenkboard.
18*6aff3115Swdenk
19*6aff3115SwdenkUn-define HAVE_REDUND, if you want to use the utlities on a system
20*6aff3115Swdenkthat does not have support for redundant environment enabled. The
21*6aff3115SwdenkDEVICEx_NAME constants define which MTD character device(s) is (are)
22*6aff3115Swdenkto be used to access the environment. If HAVE_REDUND is undefined,
23*6aff3115SwdenkDEVICE2_NAME is ignored, as is ENV2_SIZE and DEVICE2_ESIZE. ENVx_SIZE
24*6aff3115Swdenkdefines the size in bytes taken by the environment, which may be less
25*6aff3115Swdenkthen flash sector size, if the environment takes less then 1 sector.
26*6aff3115SwdenkDEVICEx_ESIZE defines the size of the first sector in the flash
27*6aff3115Swdenkpartition where the environment resides. It is assumed that the
28*6aff3115Swdenkenvironment is located in the first ENVx_SIZE bytes of the device
29*6aff3115SwdenkDEVICEx_NAME.
30