eeprom.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * Intel Wireless Multicomm 3200 WiFi driver
  3. *
  4. * Copyright (C) 2009 Intel Corporation. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * * Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * * Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in
  14. * the documentation and/or other materials provided with the
  15. * distribution.
  16. * * Neither the name of Intel Corporation nor the names of its
  17. * contributors may be used to endorse or promote products derived
  18. * from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. *
  32. *
  33. * Intel Corporation <ilw@linux.intel.com>
  34. * Samuel Ortiz <samuel.ortiz@intel.com>
  35. * Zhu Yi <yi.zhu@intel.com>
  36. *
  37. */
  38. #ifndef __IWM_EEPROM_H__
  39. #define __IWM_EEPROM_H__
  40. enum {
  41. IWM_EEPROM_SIG = 0,
  42. IWM_EEPROM_FIRST = IWM_EEPROM_SIG,
  43. IWM_EEPROM_VERSION,
  44. IWM_EEPROM_OEM_HW_VERSION,
  45. IWM_EEPROM_MAC_VERSION,
  46. IWM_EEPROM_CARD_ID,
  47. IWM_EEPROM_RADIO_CONF,
  48. IWM_EEPROM_SKU_CAP,
  49. IWM_EEPROM_INDIRECT_OFFSET,
  50. IWM_EEPROM_CALIB_RXIQ_OFFSET = IWM_EEPROM_INDIRECT_OFFSET,
  51. IWM_EEPROM_INDIRECT_DATA,
  52. IWM_EEPROM_CALIB_RXIQ = IWM_EEPROM_INDIRECT_DATA,
  53. IWM_EEPROM_LAST,
  54. };
  55. #define IWM_EEPROM_SIG_OFF 0x00
  56. #define IWM_EEPROM_VERSION_OFF (0x54 << 1)
  57. #define IWM_EEPROM_OEM_HW_VERSION_OFF (0x56 << 1)
  58. #define IWM_EEPROM_MAC_VERSION_OFF (0x30 << 1)
  59. #define IWM_EEPROM_CARD_ID_OFF (0x5d << 1)
  60. #define IWM_EEPROM_RADIO_CONF_OFF (0x58 << 1)
  61. #define IWM_EEPROM_SKU_CAP_OFF (0x55 << 1)
  62. #define IWM_EEPROM_CALIB_CONFIG_OFF (0x7c << 1)
  63. #define IWM_EEPROM_SIG_LEN 4
  64. #define IWM_EEPROM_VERSION_LEN 2
  65. #define IWM_EEPROM_OEM_HW_VERSION_LEN 2
  66. #define IWM_EEPROM_MAC_VERSION_LEN 1
  67. #define IWM_EEPROM_CARD_ID_LEN 2
  68. #define IWM_EEPROM_RADIO_CONF_LEN 2
  69. #define IWM_EEPROM_SKU_CAP_LEN 2
  70. #define IWM_EEPROM_INDIRECT_LEN 2
  71. #define IWM_MAX_EEPROM_DATA_LEN 240
  72. #define IWM_EEPROM_LEN 0x800
  73. #define IWM_EEPROM_MIN_ALLOWED_VERSION 0x0610
  74. #define IWM_EEPROM_MAX_ALLOWED_VERSION 0x0700
  75. #define IWM_EEPROM_CURRENT_VERSION 0x0612
  76. #define IWM_EEPROM_SKU_CAP_BAND_24GHZ (1 << 4)
  77. #define IWM_EEPROM_SKU_CAP_BAND_52GHZ (1 << 5)
  78. #define IWM_EEPROM_SKU_CAP_11N_ENABLE (1 << 6)
  79. enum {
  80. IWM_EEPROM_CALIB_CAL_HDR,
  81. IWM_EEPROM_CALIB_TX_POWER,
  82. IWM_EEPROM_CALIB_XTAL,
  83. IWM_EEPROM_CALIB_TEMPERATURE,
  84. IWM_EEPROM_CALIB_RX_BB_FILTER,
  85. IWM_EEPROM_CALIB_RX_IQ,
  86. IWM_EEPROM_CALIB_MAX,
  87. };
  88. #define IWM_EEPROM_CALIB_RXIQ_OFF (IWM_EEPROM_CALIB_CONFIG_OFF + \
  89. (IWM_EEPROM_CALIB_RX_IQ << 1))
  90. #define IWM_EEPROM_CALIB_RXIQ_LEN sizeof(struct iwm_lmac_calib_rxiq)
  91. struct iwm_eeprom_entry {
  92. char *name;
  93. u32 offset;
  94. u32 length;
  95. };
  96. int iwm_eeprom_init(struct iwm_priv *iwm);
  97. void iwm_eeprom_exit(struct iwm_priv *iwm);
  98. u8 *iwm_eeprom_access(struct iwm_priv *iwm, u8 eeprom_id);
  99. #endif