srom.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
  4. * All rights reserved.
  5. *
  6. * File: srom.h
  7. *
  8. * Purpose: Implement functions to access eeprom
  9. *
  10. * Author: Jerry Chen
  11. *
  12. * Date: Jan 29, 2003
  13. */
  14. #ifndef __SROM_H__
  15. #define __SROM_H__
  16. /*--------------------- Export Definitions -------------------------*/
  17. #define EEP_MAX_CONTEXT_SIZE 256
  18. #define CB_EEPROM_READBYTE_WAIT 900 /* us */
  19. #define W_MAX_I2CRETRY 0x0fff
  20. /* Contents in the EEPROM */
  21. #define EEP_OFS_PAR 0x00 /* physical address */
  22. #define EEP_OFS_ANTENNA 0x16
  23. #define EEP_OFS_RADIOCTL 0x17
  24. #define EEP_OFS_RFTYPE 0x1B /* for select RF */
  25. #define EEP_OFS_MINCHANNEL 0x1C /* Min Channel # */
  26. #define EEP_OFS_MAXCHANNEL 0x1D /* Max Channel # */
  27. #define EEP_OFS_SIGNATURE 0x1E
  28. #define EEP_OFS_ZONETYPE 0x1F
  29. #define EEP_OFS_RFTABLE 0x20 /* RF POWER TABLE */
  30. #define EEP_OFS_PWR_CCK 0x20
  31. #define EEP_OFS_SETPT_CCK 0x21
  32. #define EEP_OFS_PWR_OFDMG 0x23
  33. #define EEP_OFS_SETPT_OFDMG 0x24
  34. #define EEP_OFS_PWR_FORMULA_OST 0x26
  35. #define EEP_OFS_MAJOR_VER 0x2E
  36. #define EEP_OFS_MINOR_VER 0x2F
  37. #define EEP_OFS_CCK_PWR_TBL 0x30
  38. #define EEP_OFS_CCK_PWR_dBm 0x3F
  39. #define EEP_OFS_OFDM_PWR_TBL 0x40
  40. #define EEP_OFS_OFDM_PWR_dBm 0x4F
  41. /*{{ RobertYu: 20041124 */
  42. #define EEP_OFS_SETPT_OFDMA 0x4E
  43. #define EEP_OFS_OFDMA_PWR_TBL 0x50
  44. /*}}*/
  45. #define EEP_OFS_OFDMA_PWR_dBm 0xD2
  46. /*----------need to remove --------------------*/
  47. #define EEP_OFS_BBTAB_LEN 0x70 /* BB Table Length */
  48. #define EEP_OFS_BBTAB_ADR 0x71 /* BB Table Offset */
  49. #define EEP_OFS_CHECKSUM 0xFF /* reserved area for baseband 28h~78h */
  50. #define EEP_I2C_DEV_ID 0x50 /* EEPROM device address on I2C bus */
  51. /* Bits in EEP_OFS_ANTENNA */
  52. #define EEP_ANTENNA_MAIN 0x01
  53. #define EEP_ANTENNA_AUX 0x02
  54. #define EEP_ANTINV 0x04
  55. /* Bits in EEP_OFS_RADIOCTL */
  56. #define EEP_RADIOCTL_ENABLE 0x80
  57. #define EEP_RADIOCTL_INV 0x01
  58. /*--------------------- Export Types ------------------------------*/
  59. /*--------------------- Export Macros ------------------------------*/
  60. /*--------------------- Export Classes ----------------------------*/
  61. /*--------------------- Export Variables --------------------------*/
  62. /*--------------------- Export Functions --------------------------*/
  63. unsigned char SROMbyReadEmbedded(void __iomem *iobase,
  64. unsigned char byContntOffset);
  65. void SROMvReadAllContents(void __iomem *iobase, unsigned char *pbyEepromRegs);
  66. void SROMvReadEtherAddress(void __iomem *iobase,
  67. unsigned char *pbyEtherAddress);
  68. #endif /* __EEPROM_H__*/