nvram.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /*====================================================================*
  2. *
  3. * Copyright (c) 2013 Qualcomm Atheros, Inc.
  4. *
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or
  8. * without modification, are permitted (subject to the limitations
  9. * in the disclaimer below) provided that the following conditions
  10. * are met:
  11. *
  12. * * Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. *
  15. * * Redistributions in binary form must reproduce the above
  16. * copyright notice, this list of conditions and the following
  17. * disclaimer in the documentation and/or other materials
  18. * provided with the distribution.
  19. *
  20. * * Neither the name of Qualcomm Atheros nor the names of
  21. * its contributors may be used to endorse or promote products
  22. * derived from this software without specific prior written
  23. * permission.
  24. *
  25. * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
  26. * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE
  27. * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
  28. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  29. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  30. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
  31. * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  32. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  33. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  34. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  36. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  37. * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  38. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. *--------------------------------------------------------------------*/
  41. /*====================================================================*
  42. *
  43. * nvnvm.h - nvram definitions and declarations;
  44. *
  45. * The Boot ROM reads a linked list of NVM headers containing
  46. * information about the size, location and execution address
  47. * of various software images;
  48. *
  49. * See INT6300 Boot ROM Software Design Specification for more
  50. * information; the document may not be available to some
  51. * customers so don't push it;
  52. *
  53. *. Qualcomm Atheros HomePlug AV Powerline Toolkit;
  54. *: Copyright (c) 2006-2010 by Intellon Corporation; ALL RIGHTS RESERVED;
  55. *; For demonstration and evaluation only; Not for production use.
  56. *
  57. * Contributor(s):
  58. * Charles Maier
  59. *
  60. *--------------------------------------------------------------------*/
  61. #ifndef NVRAM_HEADER
  62. #define NVRAM_HEADER
  63. /*====================================================================*
  64. * system header files;
  65. *--------------------------------------------------------------------*/
  66. #include <stdint.h>
  67. /*====================================================================*
  68. * custom header files;
  69. *--------------------------------------------------------------------*/
  70. #include "../tools/types.h"
  71. /*====================================================================*
  72. * constants;
  73. *--------------------------------------------------------------------*/
  74. #define NVRAM_500KB 0x00000005
  75. #define NVRAM_1MB 0x00000010
  76. #define NVRAM_2MB 0x00000011
  77. #define NVRAM_4MB 0x00000012
  78. #define NVRAM_8MB 0x00000013
  79. #define NVRAM_16MB 0x00000014
  80. #define NVRAM_32MB 0x00000015
  81. #define NVRAM_M25P20 = 0x00000011;
  82. #define NVRAM_M25P40 = 0x00000012;
  83. #define NVRAM_M25P80 = 0x00000013;
  84. #define NVRAM_M25P16_ES = 0x00000014;
  85. #define NVRAM_M25P32_ES = 0x00000015;
  86. #define NVRAM_M25P64_ES = 0x00000016;
  87. #define NVRAM_AT26DF161 = 0x00000046;
  88. #define NVRAM_AT26DF161A = 0x00000146;
  89. #define NVRAM_M25P05A = 0x00001020;
  90. #define NVRAM_M25P10A = 0x00001120;
  91. #define NVRAM_M25P16 = 0x00001520;
  92. #define NVRAM_M25PX16 = 0x00001571;
  93. #define NVRAM_M25P32 = 0x00001620;
  94. #define NVRAM_M25P64 = 0x00001720;
  95. #define NVRAM_FM25S16 = 0x00001532;
  96. #define NVRAM_FM25Q16 = 0x00001532;
  97. #define NVRAM_FM25Q32 = 0x00001632;
  98. #define NVRAM_SST25VF016B = 0x00004125;
  99. /*====================================================================*
  100. * variables;
  101. *--------------------------------------------------------------------*/
  102. #ifndef __GNUC__
  103. #pragma pack (push,1)
  104. #endif
  105. typedef struct __packed config_nvram
  106. {
  107. uint32_t NVRAMTYPE;
  108. uint32_t NVRAMPAGE;
  109. uint32_t NVRAMBLOCK;
  110. uint32_t NVRAMSIZE;
  111. }
  112. config_nvram;
  113. #ifndef __GNUC__
  114. #pragma pack (pop)
  115. #endif
  116. /*====================================================================*
  117. * functions;
  118. *--------------------------------------------------------------------*/
  119. void nvrampeek (struct config_nvram *);
  120. char const * NVRAMName (uint16_t nvramtype);
  121. /*====================================================================*
  122. *
  123. *--------------------------------------------------------------------*/
  124. #endif