fw_env.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. /* Pull in the current config to define the default environment */
  8. #include <linux/kconfig.h>
  9. #ifndef __ASSEMBLY__
  10. #define __ASSEMBLY__ /* get only #defines from config.h */
  11. #include <config.h>
  12. #undef __ASSEMBLY__
  13. #else
  14. #include <config.h>
  15. #endif
  16. /*
  17. * To build the utility with the static configuration
  18. * comment out the next line.
  19. * See included "fw_env.config" sample file
  20. * for notes on configuration.
  21. */
  22. #define CONFIG_FILE "/etc/fw_env.config"
  23. #ifndef CONFIG_FILE
  24. #define HAVE_REDUND /* For systems with 2 env sectors */
  25. #define DEVICE1_NAME "/dev/mtd1"
  26. #define DEVICE2_NAME "/dev/mtd2"
  27. #define DEVICE1_OFFSET 0x0000
  28. #define ENV1_SIZE 0x4000
  29. #define DEVICE1_ESIZE 0x4000
  30. #define DEVICE1_ENVSECTORS 2
  31. #define DEVICE2_OFFSET 0x0000
  32. #define ENV2_SIZE 0x4000
  33. #define DEVICE2_ESIZE 0x4000
  34. #define DEVICE2_ENVSECTORS 2
  35. #endif
  36. #ifndef CONFIG_BAUDRATE
  37. #define CONFIG_BAUDRATE 115200
  38. #endif
  39. #ifndef CONFIG_BOOTDELAY
  40. #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
  41. #endif
  42. #ifndef CONFIG_BOOTCOMMAND
  43. #define CONFIG_BOOTCOMMAND \
  44. "bootp; " \
  45. "setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} " \
  46. "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; " \
  47. "bootm"
  48. #endif
  49. extern int fw_printenv(int argc, char *argv[]);
  50. extern char *fw_getenv (char *name);
  51. extern int fw_setenv (int argc, char *argv[]);
  52. extern int fw_parse_script(char *fname);
  53. extern int fw_env_open(void);
  54. extern int fw_env_write(char *name, char *value);
  55. extern int fw_env_close(void);
  56. extern unsigned long crc32 (unsigned long, const unsigned char *, unsigned);