nvram.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*====================================================================*
  2. *
  3. * Copyright (c) 2013 Qualcomm Atheros, Inc.
  4. *
  5. * All rights reserved.
  6. *
  7. *====================================================================*/
  8. /*====================================================================*
  9. *
  10. * nvnvm.h - nvram definitions and declarations;
  11. *
  12. * The Boot ROM reads a linked list of NVM headers containing
  13. * information about the size, location and execution address
  14. * of various software images;
  15. *
  16. * See INT6300 Boot ROM Software Design Specification for more
  17. * information; the document may not be available to some
  18. * customers so don't push it;
  19. *
  20. * Contributor(s):
  21. * Charles Maier <cmaier@qca.qualcomm.com>
  22. *
  23. *--------------------------------------------------------------------*/
  24. #ifndef NVRAM_HEADER
  25. #define NVRAM_HEADER
  26. /*====================================================================*
  27. * system header files;
  28. *--------------------------------------------------------------------*/
  29. #include <stdint.h>
  30. /*====================================================================*
  31. * custom header files;
  32. *--------------------------------------------------------------------*/
  33. #include "../tools/types.h"
  34. /*====================================================================*
  35. * constants;
  36. *--------------------------------------------------------------------*/
  37. #define NVRAM_500KB 0x00000005
  38. #define NVRAM_1MB 0x00000010
  39. #define NVRAM_2MB 0x00000011
  40. #define NVRAM_4MB 0x00000012
  41. #define NVRAM_8MB 0x00000013
  42. #define NVRAM_16MB 0x00000014
  43. #define NVRAM_32MB 0x00000015
  44. #define NVRAM_M25P20 = 0x00000011;
  45. #define NVRAM_M25P40 = 0x00000012;
  46. #define NVRAM_M25P80 = 0x00000013;
  47. #define NVRAM_M25P16_ES = 0x00000014;
  48. #define NVRAM_M25P32_ES = 0x00000015;
  49. #define NVRAM_M25P64_ES = 0x00000016;
  50. #define NVRAM_AT26DF161 = 0x00000046;
  51. #define NVRAM_AT26DF161A = 0x00000146;
  52. #define NVRAM_M25P05A = 0x00001020;
  53. #define NVRAM_M25P10A = 0x00001120;
  54. #define NVRAM_M25P16 = 0x00001520;
  55. #define NVRAM_M25PX16 = 0x00001571;
  56. #define NVRAM_M25P32 = 0x00001620;
  57. #define NVRAM_M25P64 = 0x00001720;
  58. #define NVRAM_FM25S16 = 0x00001532;
  59. #define NVRAM_FM25Q16 = 0x00001532;
  60. #define NVRAM_FM25Q32 = 0x00001632;
  61. #define NVRAM_SST25VF016B = 0x00004125;
  62. /*====================================================================*
  63. * variables;
  64. *--------------------------------------------------------------------*/
  65. #ifndef __GNUC__
  66. #pragma pack (push,1)
  67. #endif
  68. typedef struct __packed config_nvram
  69. {
  70. uint32_t NVRAMTYPE;
  71. uint32_t NVRAMPAGE;
  72. uint32_t NVRAMBLOCK;
  73. uint32_t NVRAMSIZE;
  74. }
  75. config_nvram;
  76. #ifndef __GNUC__
  77. #pragma pack (pop)
  78. #endif
  79. /*====================================================================*
  80. * functions;
  81. *--------------------------------------------------------------------*/
  82. void nvrampeek (struct config_nvram *);
  83. char const * NVRAMName (uint16_t nvramtype);
  84. /*====================================================================*
  85. *
  86. *--------------------------------------------------------------------*/
  87. #endif