nvram.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. * nvram.c - NVRAM type information;
  44. *
  45. * nvram.h
  46. *
  47. * nvram codes for display purposes;
  48. *
  49. * Contributor(s):
  50. * Charles Maier
  51. *
  52. *--------------------------------------------------------------------*/
  53. #ifndef NVRAM_SOURCE
  54. #define NVRAM_SOURCE
  55. #include "../tools/types.h"
  56. #include "../tools/symbol.h"
  57. #include "../ram/nvram.h"
  58. #define NVRAM_TYPES (sizeof (nvram_types) / sizeof (struct _type_))
  59. static const struct _type_ nvram_types [] =
  60. {
  61. {
  62. 0x00000005,
  63. "500KB"
  64. },
  65. {
  66. 0x00000010,
  67. "1MB"
  68. },
  69. {
  70. 0x00000011,
  71. "M25P20"
  72. },
  73. {
  74. 0x00000012,
  75. "M25P40"
  76. },
  77. {
  78. 0x00000013,
  79. "M25P80"
  80. },
  81. {
  82. 0x00000014,
  83. "M25P16_ES"
  84. },
  85. {
  86. 0x00000015,
  87. "M25P32_ES"
  88. },
  89. {
  90. 0x00000016,
  91. "M25P64_ES"
  92. },
  93. {
  94. 0x00000046,
  95. "AT26DF161"
  96. },
  97. {
  98. 0x00000146,
  99. "AT26DF161A"
  100. },
  101. {
  102. 0x00001020,
  103. "M25P05A"
  104. },
  105. {
  106. 0x00001120,
  107. "M25P10A"
  108. },
  109. {
  110. 0x00001402,
  111. "S25FL016AOLMFI01"
  112. },
  113. {
  114. 0x00001420,
  115. "M25P80"
  116. },
  117. {
  118. 0x00001520,
  119. "M25P16"
  120. },
  121. {
  122. 0x00001532,
  123. "FM25S16/FM25Q16"
  124. },
  125. {
  126. 0x00001571,
  127. "M25PX16"
  128. },
  129. {
  130. 0x00001620,
  131. "M25P32"
  132. },
  133. {
  134. 0x00001632,
  135. "FM25Q32"
  136. },
  137. {
  138. 0x00001720,
  139. "M25P64"
  140. },
  141. {
  142. 0x00004125,
  143. "SST25VF016B"
  144. }
  145. };
  146. char const * NVRAMName (uint16_t NVRAMTYPE)
  147. {
  148. return (typename (nvram_types, NVRAM_TYPES, NVRAMTYPE, "Unknown NVRAM Type"));
  149. }
  150. #endif