sbpcmcia.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. * BCM43XX Sonics SiliconBackplane PCMCIA core hardware definitions.
  3. *
  4. * Portions of this code are copyright (c) 2020 Cypress Semiconductor Corporation
  5. *
  6. * Copyright (C) 1999-2020, Broadcom Corporation
  7. *
  8. * Unless you and Broadcom execute a separate written software license
  9. * agreement governing use of this software, this software is licensed to you
  10. * under the terms of the GNU General Public License version 2 (the "GPL"),
  11. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  12. * following added to such license:
  13. *
  14. * As a special exception, the copyright holders of this software give you
  15. * permission to link this software with independent modules, and to copy and
  16. * distribute the resulting executable under terms of your choice, provided that
  17. * you also meet, for each linked independent module, the terms and conditions of
  18. * the license of that module. An independent module is a module which is not
  19. * derived from this software. The special exception does not apply to any
  20. * modifications of the software.
  21. *
  22. * Notwithstanding the above, under no circumstances may you combine this
  23. * software in any way with any other Broadcom software provided under a license
  24. * other than the GPL, without Broadcom's express prior written consent.
  25. *
  26. *
  27. * <<Broadcom-WL-IPTag/Open:>>
  28. *
  29. * $Id: sbpcmcia.h 647676 2016-07-07 02:59:05Z $
  30. */
  31. #ifndef _SBPCMCIA_H
  32. #define _SBPCMCIA_H
  33. /* All the addresses that are offsets in attribute space are divided
  34. * by two to account for the fact that odd bytes are invalid in
  35. * attribute space and our read/write routines make the space appear
  36. * as if they didn't exist. Still we want to show the original numbers
  37. * as documented in the hnd_pcmcia core manual.
  38. */
  39. /* PCMCIA Function Configuration Registers */
  40. #define PCMCIA_FCR (0x700 / 2)
  41. #define FCR0_OFF 0
  42. #define FCR1_OFF (0x40 / 2)
  43. #define FCR2_OFF (0x80 / 2)
  44. #define FCR3_OFF (0xc0 / 2)
  45. #define PCMCIA_FCR0 (0x700 / 2)
  46. #define PCMCIA_FCR1 (0x740 / 2)
  47. #define PCMCIA_FCR2 (0x780 / 2)
  48. #define PCMCIA_FCR3 (0x7c0 / 2)
  49. /* Standard PCMCIA FCR registers */
  50. #define PCMCIA_COR 0
  51. #define COR_RST 0x80
  52. #define COR_LEV 0x40
  53. #define COR_IRQEN 0x04
  54. #define COR_BLREN 0x01
  55. #define COR_FUNEN 0x01
  56. #define PCICIA_FCSR (2 / 2)
  57. #define PCICIA_PRR (4 / 2)
  58. #define PCICIA_SCR (6 / 2)
  59. #define PCICIA_ESR (8 / 2)
  60. #define PCM_MEMOFF 0x0000
  61. #define F0_MEMOFF 0x1000
  62. #define F1_MEMOFF 0x2000
  63. #define F2_MEMOFF 0x3000
  64. #define F3_MEMOFF 0x4000
  65. /* Memory base in the function fcr's */
  66. #define MEM_ADDR0 (0x728 / 2)
  67. #define MEM_ADDR1 (0x72a / 2)
  68. #define MEM_ADDR2 (0x72c / 2)
  69. /* PCMCIA base plus Srom access in fcr0: */
  70. #define PCMCIA_ADDR0 (0x072e / 2)
  71. #define PCMCIA_ADDR1 (0x0730 / 2)
  72. #define PCMCIA_ADDR2 (0x0732 / 2)
  73. #define MEM_SEG (0x0734 / 2)
  74. #define SROM_CS (0x0736 / 2)
  75. #define SROM_DATAL (0x0738 / 2)
  76. #define SROM_DATAH (0x073a / 2)
  77. #define SROM_ADDRL (0x073c / 2)
  78. #define SROM_ADDRH (0x073e / 2)
  79. #define SROM_INFO2 (0x0772 / 2) /* Corerev >= 2 && <= 5 */
  80. #define SROM_INFO (0x07be / 2) /* Corerev >= 6 */
  81. /* Values for srom_cs: */
  82. #define SROM_IDLE 0
  83. #define SROM_WRITE 1
  84. #define SROM_READ 2
  85. #define SROM_WEN 4
  86. #define SROM_WDS 7
  87. #define SROM_DONE 8
  88. /* Fields in srom_info: */
  89. #define SRI_SZ_MASK 0x03
  90. #define SRI_BLANK 0x04
  91. #define SRI_OTP 0x80
  92. #define SROM16K_BANK_SEL_MASK (3 << 11)
  93. #define SROM16K_BANK_SHFT_MASK 11
  94. #define SROM16K_ADDR_SEL_MASK ((1 << SROM16K_BANK_SHFT_MASK) - 1)
  95. #define SROM_PRSNT_MASK 0x1
  96. #define SROM_SUPPORT_SHIFT_MASK 30
  97. #define SROM_SUPPORTED (0x1 << SROM_SUPPORT_SHIFT_MASK)
  98. #define SROM_SIZE_MASK 0x00000006
  99. #define SROM_SIZE_2K 2
  100. #define SROM_SIZE_512 1
  101. #define SROM_SIZE_128 0
  102. #define SROM_SIZE_SHFT_MASK 1
  103. /* Standard tuples we know about */
  104. #define CISTPL_NULL 0x00
  105. #define CISTPL_END 0xff /* End of the CIS tuple chain */
  106. #define CISTPL_OFFSET 0xC0
  107. #define CISTPL_BRCM_HNBU 0x80
  108. #define HNBU_BOARDREV 0x02 /* One byte board revision */
  109. #define HNBU_BOARDTYPE 0x1b /* 2 bytes; boardtype */
  110. #define HNBU_HNBUCIS 0x1d /* what follows is proprietary HNBU CIS format */
  111. #define HNBU_CUSTOM1 0x82 /* 4 byte; For non-BRCM post-mfg additions */
  112. #define HNBU_CUSTOM2 0x83 /* Reserved; For non-BRCM post-mfg additions */
  113. /* sbtmstatelow */
  114. #define SBTML_INT_ACK 0x40000 /* ack the sb interrupt */
  115. #define SBTML_INT_EN 0x20000 /* enable sb interrupt */
  116. /* sbtmstatehigh */
  117. #define SBTMH_INT_STATUS 0x40000 /* sb interrupt status */
  118. #endif /* _SBPCMCIA_H */