registers.h 74 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946
  1. /*
  2. * This file is provided under a dual BSD/GPLv2 license. When using or
  3. * redistributing this file, you may do so under either license.
  4. *
  5. * GPL LICENSE SUMMARY
  6. *
  7. * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of version 2 of the GNU General Public License as
  11. * published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  21. * The full GNU General Public License is included in this distribution
  22. * in the file called LICENSE.GPL.
  23. *
  24. * BSD LICENSE
  25. *
  26. * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
  27. * All rights reserved.
  28. *
  29. * Redistribution and use in source and binary forms, with or without
  30. * modification, are permitted provided that the following conditions
  31. * are met:
  32. *
  33. * * Redistributions of source code must retain the above copyright
  34. * notice, this list of conditions and the following disclaimer.
  35. * * Redistributions in binary form must reproduce the above copyright
  36. * notice, this list of conditions and the following disclaimer in
  37. * the documentation and/or other materials provided with the
  38. * distribution.
  39. * * Neither the name of Intel Corporation nor the names of its
  40. * contributors may be used to endorse or promote products derived
  41. * from this software without specific prior written permission.
  42. *
  43. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  44. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  45. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  46. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  47. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  48. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  49. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  50. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  51. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  52. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  53. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  54. */
  55. #ifndef _SCU_REGISTERS_H_
  56. #define _SCU_REGISTERS_H_
  57. /**
  58. * This file contains the constants and structures for the SCU memory mapped
  59. * registers.
  60. *
  61. *
  62. */
  63. #define SCU_VIIT_ENTRY_ID_MASK (0xC0000000)
  64. #define SCU_VIIT_ENTRY_ID_SHIFT (30)
  65. #define SCU_VIIT_ENTRY_FUNCTION_MASK (0x0FF00000)
  66. #define SCU_VIIT_ENTRY_FUNCTION_SHIFT (20)
  67. #define SCU_VIIT_ENTRY_IPPTMODE_MASK (0x0001F800)
  68. #define SCU_VIIT_ENTRY_IPPTMODE_SHIFT (12)
  69. #define SCU_VIIT_ENTRY_LPVIE_MASK (0x00000F00)
  70. #define SCU_VIIT_ENTRY_LPVIE_SHIFT (8)
  71. #define SCU_VIIT_ENTRY_STATUS_MASK (0x000000FF)
  72. #define SCU_VIIT_ENTRY_STATUS_SHIFT (0)
  73. #define SCU_VIIT_ENTRY_ID_INVALID (0 << SCU_VIIT_ENTRY_ID_SHIFT)
  74. #define SCU_VIIT_ENTRY_ID_VIIT (1 << SCU_VIIT_ENTRY_ID_SHIFT)
  75. #define SCU_VIIT_ENTRY_ID_IIT (2 << SCU_VIIT_ENTRY_ID_SHIFT)
  76. #define SCU_VIIT_ENTRY_ID_VIRT_EXP (3 << SCU_VIIT_ENTRY_ID_SHIFT)
  77. #define SCU_VIIT_IPPT_SSP_INITIATOR (0x01 << SCU_VIIT_ENTRY_IPPTMODE_SHIFT)
  78. #define SCU_VIIT_IPPT_SMP_INITIATOR (0x02 << SCU_VIIT_ENTRY_IPPTMODE_SHIFT)
  79. #define SCU_VIIT_IPPT_STP_INITIATOR (0x04 << SCU_VIIT_ENTRY_IPPTMODE_SHIFT)
  80. #define SCU_VIIT_IPPT_INITIATOR \
  81. (\
  82. SCU_VIIT_IPPT_SSP_INITIATOR \
  83. | SCU_VIIT_IPPT_SMP_INITIATOR \
  84. | SCU_VIIT_IPPT_STP_INITIATOR \
  85. )
  86. #define SCU_VIIT_STATUS_RNC_VALID (0x01 << SCU_VIIT_ENTRY_STATUS_SHIFT)
  87. #define SCU_VIIT_STATUS_ADDRESS_VALID (0x02 << SCU_VIIT_ENTRY_STATUS_SHIFT)
  88. #define SCU_VIIT_STATUS_RNI_VALID (0x04 << SCU_VIIT_ENTRY_STATUS_SHIFT)
  89. #define SCU_VIIT_STATUS_ALL_VALID \
  90. (\
  91. SCU_VIIT_STATUS_RNC_VALID \
  92. | SCU_VIIT_STATUS_ADDRESS_VALID \
  93. | SCU_VIIT_STATUS_RNI_VALID \
  94. )
  95. #define SCU_VIIT_IPPT_SMP_TARGET (0x10 << SCU_VIIT_ENTRY_IPPTMODE_SHIFT)
  96. /**
  97. * struct scu_viit_entry - This is the SCU Virtual Initiator Table Entry
  98. *
  99. *
  100. */
  101. struct scu_viit_entry {
  102. /**
  103. * This must be encoded as to the type of initiator that is being constructed
  104. * for this port.
  105. */
  106. u32 status;
  107. /**
  108. * Virtual initiator high SAS Address
  109. */
  110. u32 initiator_sas_address_hi;
  111. /**
  112. * Virtual initiator low SAS Address
  113. */
  114. u32 initiator_sas_address_lo;
  115. /**
  116. * This must be 0
  117. */
  118. u32 reserved;
  119. };
  120. /* IIT Status Defines */
  121. #define SCU_IIT_ENTRY_ID_MASK (0xC0000000)
  122. #define SCU_IIT_ENTRY_ID_SHIFT (30)
  123. #define SCU_IIT_ENTRY_STATUS_UPDATE_MASK (0x20000000)
  124. #define SCU_IIT_ENTRY_STATUS_UPDATE_SHIFT (29)
  125. #define SCU_IIT_ENTRY_LPI_MASK (0x00000F00)
  126. #define SCU_IIT_ENTRY_LPI_SHIFT (8)
  127. #define SCU_IIT_ENTRY_STATUS_MASK (0x000000FF)
  128. #define SCU_IIT_ENTRY_STATUS_SHIFT (0)
  129. /* IIT Remote Initiator Defines */
  130. #define SCU_IIT_ENTRY_REMOTE_TAG_MASK (0x0000FFFF)
  131. #define SCU_IIT_ENTRY_REMOTE_TAG_SHIFT (0)
  132. #define SCU_IIT_ENTRY_REMOTE_RNC_MASK (0x0FFF0000)
  133. #define SCU_IIT_ENTRY_REMOTE_RNC_SHIFT (16)
  134. #define SCU_IIT_ENTRY_ID_INVALID (0 << SCU_IIT_ENTRY_ID_SHIFT)
  135. #define SCU_IIT_ENTRY_ID_VIIT (1 << SCU_IIT_ENTRY_ID_SHIFT)
  136. #define SCU_IIT_ENTRY_ID_IIT (2 << SCU_IIT_ENTRY_ID_SHIFT)
  137. #define SCU_IIT_ENTRY_ID_VIRT_EXP (3 << SCU_IIT_ENTRY_ID_SHIFT)
  138. /**
  139. * struct scu_iit_entry - This will be implemented later when we support
  140. * virtual functions
  141. *
  142. *
  143. */
  144. struct scu_iit_entry {
  145. u32 status;
  146. u32 remote_initiator_sas_address_hi;
  147. u32 remote_initiator_sas_address_lo;
  148. u32 remote_initiator;
  149. };
  150. /* Generate a value for an SCU register */
  151. #define SCU_GEN_VALUE(name, value) \
  152. (((value) << name ## _SHIFT) & (name ## _MASK))
  153. /*
  154. * Generate a bit value for an SCU register
  155. * Make sure that the register MASK is just a single bit */
  156. #define SCU_GEN_BIT(name) \
  157. SCU_GEN_VALUE(name, ((u32)1))
  158. #define SCU_SET_BIT(name, reg_value) \
  159. ((reg_value) | SCU_GEN_BIT(name))
  160. #define SCU_CLEAR_BIT(name, reg_value) \
  161. ((reg_value)$ ~(SCU_GEN_BIT(name)))
  162. /*
  163. * *****************************************************************************
  164. * Unions for bitfield definitions of SCU Registers
  165. * SMU Post Context Port
  166. * ***************************************************************************** */
  167. #define SMU_POST_CONTEXT_PORT_CONTEXT_INDEX_SHIFT (0)
  168. #define SMU_POST_CONTEXT_PORT_CONTEXT_INDEX_MASK (0x00000FFF)
  169. #define SMU_POST_CONTEXT_PORT_LOGICAL_PORT_INDEX_SHIFT (12)
  170. #define SMU_POST_CONTEXT_PORT_LOGICAL_PORT_INDEX_MASK (0x0000F000)
  171. #define SMU_POST_CONTEXT_PORT_PROTOCOL_ENGINE_SHIFT (16)
  172. #define SMU_POST_CONTEXT_PORT_PROTOCOL_ENGINE_MASK (0x00030000)
  173. #define SMU_POST_CONTEXT_PORT_COMMAND_CONTEXT_SHIFT (18)
  174. #define SMU_POST_CONTEXT_PORT_COMMAND_CONTEXT_MASK (0x00FC0000)
  175. #define SMU_POST_CONTEXT_PORT_RESERVED_MASK (0xFF000000)
  176. #define SMU_PCP_GEN_VAL(name, value) \
  177. SCU_GEN_VALUE(SMU_POST_CONTEXT_PORT_ ## name, value)
  178. /* ***************************************************************************** */
  179. #define SMU_INTERRUPT_STATUS_COMPLETION_SHIFT (31)
  180. #define SMU_INTERRUPT_STATUS_COMPLETION_MASK (0x80000000)
  181. #define SMU_INTERRUPT_STATUS_QUEUE_SUSPEND_SHIFT (1)
  182. #define SMU_INTERRUPT_STATUS_QUEUE_SUSPEND_MASK (0x00000002)
  183. #define SMU_INTERRUPT_STATUS_QUEUE_ERROR_SHIFT (0)
  184. #define SMU_INTERRUPT_STATUS_QUEUE_ERROR_MASK (0x00000001)
  185. #define SMU_INTERRUPT_STATUS_RESERVED_MASK (0x7FFFFFFC)
  186. #define SMU_ISR_GEN_BIT(name) \
  187. SCU_GEN_BIT(SMU_INTERRUPT_STATUS_ ## name)
  188. #define SMU_ISR_QUEUE_ERROR SMU_ISR_GEN_BIT(QUEUE_ERROR)
  189. #define SMU_ISR_QUEUE_SUSPEND SMU_ISR_GEN_BIT(QUEUE_SUSPEND)
  190. #define SMU_ISR_COMPLETION SMU_ISR_GEN_BIT(COMPLETION)
  191. /* ***************************************************************************** */
  192. #define SMU_INTERRUPT_MASK_COMPLETION_SHIFT (31)
  193. #define SMU_INTERRUPT_MASK_COMPLETION_MASK (0x80000000)
  194. #define SMU_INTERRUPT_MASK_QUEUE_SUSPEND_SHIFT (1)
  195. #define SMU_INTERRUPT_MASK_QUEUE_SUSPEND_MASK (0x00000002)
  196. #define SMU_INTERRUPT_MASK_QUEUE_ERROR_SHIFT (0)
  197. #define SMU_INTERRUPT_MASK_QUEUE_ERROR_MASK (0x00000001)
  198. #define SMU_INTERRUPT_MASK_RESERVED_MASK (0x7FFFFFFC)
  199. #define SMU_IMR_GEN_BIT(name) \
  200. SCU_GEN_BIT(SMU_INTERRUPT_MASK_ ## name)
  201. #define SMU_IMR_QUEUE_ERROR SMU_IMR_GEN_BIT(QUEUE_ERROR)
  202. #define SMU_IMR_QUEUE_SUSPEND SMU_IMR_GEN_BIT(QUEUE_SUSPEND)
  203. #define SMU_IMR_COMPLETION SMU_IMR_GEN_BIT(COMPLETION)
  204. /* ***************************************************************************** */
  205. #define SMU_INTERRUPT_COALESCING_CONTROL_TIMER_SHIFT (0)
  206. #define SMU_INTERRUPT_COALESCING_CONTROL_TIMER_MASK (0x0000001F)
  207. #define SMU_INTERRUPT_COALESCING_CONTROL_NUMBER_SHIFT (8)
  208. #define SMU_INTERRUPT_COALESCING_CONTROL_NUMBER_MASK (0x0000FF00)
  209. #define SMU_INTERRUPT_COALESCING_CONTROL_RESERVED_MASK (0xFFFF00E0)
  210. #define SMU_ICC_GEN_VAL(name, value) \
  211. SCU_GEN_VALUE(SMU_INTERRUPT_COALESCING_CONTROL_ ## name, value)
  212. /* ***************************************************************************** */
  213. #define SMU_TASK_CONTEXT_RANGE_START_SHIFT (0)
  214. #define SMU_TASK_CONTEXT_RANGE_START_MASK (0x00000FFF)
  215. #define SMU_TASK_CONTEXT_RANGE_ENDING_SHIFT (16)
  216. #define SMU_TASK_CONTEXT_RANGE_ENDING_MASK (0x0FFF0000)
  217. #define SMU_TASK_CONTEXT_RANGE_ENABLE_SHIFT (31)
  218. #define SMU_TASK_CONTEXT_RANGE_ENABLE_MASK (0x80000000)
  219. #define SMU_TASK_CONTEXT_RANGE_RESERVED_MASK (0x7000F000)
  220. #define SMU_TCR_GEN_VAL(name, value) \
  221. SCU_GEN_VALUE(SMU_TASK_CONTEXT_RANGE_ ## name, value)
  222. #define SMU_TCR_GEN_BIT(name, value) \
  223. SCU_GEN_BIT(SMU_TASK_CONTEXT_RANGE_ ## name)
  224. /* ***************************************************************************** */
  225. #define SMU_COMPLETION_QUEUE_PUT_POINTER_SHIFT (0)
  226. #define SMU_COMPLETION_QUEUE_PUT_POINTER_MASK (0x00003FFF)
  227. #define SMU_COMPLETION_QUEUE_PUT_CYCLE_BIT_SHIFT (15)
  228. #define SMU_COMPLETION_QUEUE_PUT_CYCLE_BIT_MASK (0x00008000)
  229. #define SMU_COMPLETION_QUEUE_PUT_EVENT_POINTER_SHIFT (16)
  230. #define SMU_COMPLETION_QUEUE_PUT_EVENT_POINTER_MASK (0x03FF0000)
  231. #define SMU_COMPLETION_QUEUE_PUT_EVENT_CYCLE_BIT_SHIFT (26)
  232. #define SMU_COMPLETION_QUEUE_PUT_EVENT_CYCLE_BIT_MASK (0x04000000)
  233. #define SMU_COMPLETION_QUEUE_PUT_RESERVED_MASK (0xF8004000)
  234. #define SMU_CQPR_GEN_VAL(name, value) \
  235. SCU_GEN_VALUE(SMU_COMPLETION_QUEUE_PUT_ ## name, value)
  236. #define SMU_CQPR_GEN_BIT(name) \
  237. SCU_GEN_BIT(SMU_COMPLETION_QUEUE_PUT_ ## name)
  238. /* ***************************************************************************** */
  239. #define SMU_COMPLETION_QUEUE_GET_POINTER_SHIFT (0)
  240. #define SMU_COMPLETION_QUEUE_GET_POINTER_MASK (0x00003FFF)
  241. #define SMU_COMPLETION_QUEUE_GET_CYCLE_BIT_SHIFT (15)
  242. #define SMU_COMPLETION_QUEUE_GET_CYCLE_BIT_MASK (0x00008000)
  243. #define SMU_COMPLETION_QUEUE_GET_EVENT_POINTER_SHIFT (16)
  244. #define SMU_COMPLETION_QUEUE_GET_EVENT_POINTER_MASK (0x03FF0000)
  245. #define SMU_COMPLETION_QUEUE_GET_EVENT_CYCLE_BIT_SHIFT (26)
  246. #define SMU_COMPLETION_QUEUE_GET_EVENT_CYCLE_BIT_MASK (0x04000000)
  247. #define SMU_COMPLETION_QUEUE_GET_ENABLE_SHIFT (30)
  248. #define SMU_COMPLETION_QUEUE_GET_ENABLE_MASK (0x40000000)
  249. #define SMU_COMPLETION_QUEUE_GET_EVENT_ENABLE_SHIFT (31)
  250. #define SMU_COMPLETION_QUEUE_GET_EVENT_ENABLE_MASK (0x80000000)
  251. #define SMU_COMPLETION_QUEUE_GET_RESERVED_MASK (0x38004000)
  252. #define SMU_CQGR_GEN_VAL(name, value) \
  253. SCU_GEN_VALUE(SMU_COMPLETION_QUEUE_GET_ ## name, value)
  254. #define SMU_CQGR_GEN_BIT(name) \
  255. SCU_GEN_BIT(SMU_COMPLETION_QUEUE_GET_ ## name)
  256. #define SMU_CQGR_CYCLE_BIT \
  257. SMU_CQGR_GEN_BIT(CYCLE_BIT)
  258. #define SMU_CQGR_EVENT_CYCLE_BIT \
  259. SMU_CQGR_GEN_BIT(EVENT_CYCLE_BIT)
  260. #define SMU_CQGR_GET_POINTER_SET(value) \
  261. SMU_CQGR_GEN_VAL(POINTER, value)
  262. /* ***************************************************************************** */
  263. #define SMU_COMPLETION_QUEUE_CONTROL_QUEUE_LIMIT_SHIFT (0)
  264. #define SMU_COMPLETION_QUEUE_CONTROL_QUEUE_LIMIT_MASK (0x00003FFF)
  265. #define SMU_COMPLETION_QUEUE_CONTROL_EVENT_LIMIT_SHIFT (16)
  266. #define SMU_COMPLETION_QUEUE_CONTROL_EVENT_LIMIT_MASK (0x03FF0000)
  267. #define SMU_COMPLETION_QUEUE_CONTROL_RESERVED_MASK (0xFC00C000)
  268. #define SMU_CQC_GEN_VAL(name, value) \
  269. SCU_GEN_VALUE(SMU_COMPLETION_QUEUE_CONTROL_ ## name, value)
  270. #define SMU_CQC_QUEUE_LIMIT_SET(value) \
  271. SMU_CQC_GEN_VAL(QUEUE_LIMIT, value)
  272. #define SMU_CQC_EVENT_LIMIT_SET(value) \
  273. SMU_CQC_GEN_VAL(EVENT_LIMIT, value)
  274. /* ***************************************************************************** */
  275. #define SMU_DEVICE_CONTEXT_CAPACITY_MAX_TC_SHIFT (0)
  276. #define SMU_DEVICE_CONTEXT_CAPACITY_MAX_TC_MASK (0x00000FFF)
  277. #define SMU_DEVICE_CONTEXT_CAPACITY_MAX_LP_SHIFT (12)
  278. #define SMU_DEVICE_CONTEXT_CAPACITY_MAX_LP_MASK (0x00007000)
  279. #define SMU_DEVICE_CONTEXT_CAPACITY_MAX_RNC_SHIFT (15)
  280. #define SMU_DEVICE_CONTEXT_CAPACITY_MAX_RNC_MASK (0x07FF8000)
  281. #define SMU_DEVICE_CONTEXT_CAPACITY_MAX_PEG_SHIFT (27)
  282. #define SMU_DEVICE_CONTEXT_CAPACITY_MAX_PEG_MASK (0x08000000)
  283. #define SMU_DEVICE_CONTEXT_CAPACITY_RESERVED_MASK (0xF0000000)
  284. #define SMU_DCC_GEN_VAL(name, value) \
  285. SCU_GEN_VALUE(SMU_DEVICE_CONTEXT_CAPACITY_ ## name, value)
  286. #define SMU_DCC_GET_MAX_PEG(value) \
  287. (\
  288. ((value) & SMU_DEVICE_CONTEXT_CAPACITY_MAX_PEG_MASK) \
  289. >> SMU_DEVICE_CONTEXT_CAPACITY_MAX_LP_SHIFT \
  290. )
  291. #define SMU_DCC_GET_MAX_LP(value) \
  292. (\
  293. ((value) & SMU_DEVICE_CONTEXT_CAPACITY_MAX_LP_MASK) \
  294. >> SMU_DEVICE_CONTEXT_CAPACITY_MAX_LP_SHIFT \
  295. )
  296. #define SMU_DCC_GET_MAX_TC(value) \
  297. (\
  298. ((value) & SMU_DEVICE_CONTEXT_CAPACITY_MAX_TC_MASK) \
  299. >> SMU_DEVICE_CONTEXT_CAPACITY_MAX_TC_SHIFT \
  300. )
  301. #define SMU_DCC_GET_MAX_RNC(value) \
  302. (\
  303. ((value) & SMU_DEVICE_CONTEXT_CAPACITY_MAX_RNC_MASK) \
  304. >> SMU_DEVICE_CONTEXT_CAPACITY_MAX_RNC_SHIFT \
  305. )
  306. /* -------------------------------------------------------------------------- */
  307. #define SMU_CONTROL_STATUS_TASK_CONTEXT_RANGE_ENABLE_SHIFT (0)
  308. #define SMU_CONTROL_STATUS_TASK_CONTEXT_RANGE_ENABLE_MASK (0x00000001)
  309. #define SMU_CONTROL_STATUS_COMPLETION_BYTE_SWAP_ENABLE_SHIFT (1)
  310. #define SMU_CONTROL_STATUS_COMPLETION_BYTE_SWAP_ENABLE_MASK (0x00000002)
  311. #define SMU_CONTROL_STATUS_CONTEXT_RAM_INIT_COMPLETED_SHIFT (16)
  312. #define SMU_CONTROL_STATUS_CONTEXT_RAM_INIT_COMPLETED_MASK (0x00010000)
  313. #define SMU_CONTROL_STATUS_SCHEDULER_RAM_INIT_COMPLETED_SHIFT (17)
  314. #define SMU_CONTROL_STATUS_SCHEDULER_RAM_INIT_COMPLETED_MASK (0x00020000)
  315. #define SMU_CONTROL_STATUS_RESERVED_MASK (0xFFFCFFFC)
  316. #define SMU_SMUCSR_GEN_BIT(name) \
  317. SCU_GEN_BIT(SMU_CONTROL_STATUS_ ## name)
  318. #define SMU_SMUCSR_SCHEDULER_RAM_INIT_COMPLETED \
  319. (SMU_SMUCSR_GEN_BIT(SCHEDULER_RAM_INIT_COMPLETED))
  320. #define SMU_SMUCSR_CONTEXT_RAM_INIT_COMPLETED \
  321. (SMU_SMUCSR_GEN_BIT(CONTEXT_RAM_INIT_COMPLETED))
  322. #define SCU_RAM_INIT_COMPLETED \
  323. (\
  324. SMU_SMUCSR_CONTEXT_RAM_INIT_COMPLETED \
  325. | SMU_SMUCSR_SCHEDULER_RAM_INIT_COMPLETED \
  326. )
  327. /* -------------------------------------------------------------------------- */
  328. #define SMU_SOFTRESET_CONTROL_RESET_PEG0_PE0_SHIFT (0)
  329. #define SMU_SOFTRESET_CONTROL_RESET_PEG0_PE0_MASK (0x00000001)
  330. #define SMU_SOFTRESET_CONTROL_RESET_PEG0_PE1_SHIFT (1)
  331. #define SMU_SOFTRESET_CONTROL_RESET_PEG0_PE1_MASK (0x00000002)
  332. #define SMU_SOFTRESET_CONTROL_RESET_PEG0_PE2_SHIFT (2)
  333. #define SMU_SOFTRESET_CONTROL_RESET_PEG0_PE2_MASK (0x00000004)
  334. #define SMU_SOFTRESET_CONTROL_RESET_PEG0_PE3_SHIFT (3)
  335. #define SMU_SOFTRESET_CONTROL_RESET_PEG0_PE3_MASK (0x00000008)
  336. #define SMU_SOFTRESET_CONTROL_RESET_PEG1_PE0_SHIFT (8)
  337. #define SMU_SOFTRESET_CONTROL_RESET_PEG1_PE0_MASK (0x00000100)
  338. #define SMU_SOFTRESET_CONTROL_RESET_PEG1_PE1_SHIFT (9)
  339. #define SMU_SOFTRESET_CONTROL_RESET_PEG1_PE1_MASK (0x00000200)
  340. #define SMU_SOFTRESET_CONTROL_RESET_PEG1_PE2_SHIFT (10)
  341. #define SMU_SOFTRESET_CONTROL_RESET_PEG1_PE2_MASK (0x00000400)
  342. #define SMU_SOFTRESET_CONTROL_RESET_PEG1_PE3_SHIFT (11)
  343. #define SMU_SOFTRESET_CONTROL_RESET_PEG1_PE3_MASK (0x00000800)
  344. #define SMU_RESET_PROTOCOL_ENGINE(peg, pe) \
  345. ((1 << (pe)) << ((peg) * 8))
  346. #define SMU_RESET_PEG_PROTOCOL_ENGINES(peg) \
  347. (\
  348. SMU_RESET_PROTOCOL_ENGINE(peg, 0) \
  349. | SMU_RESET_PROTOCOL_ENGINE(peg, 1) \
  350. | SMU_RESET_PROTOCOL_ENGINE(peg, 2) \
  351. | SMU_RESET_PROTOCOL_ENGINE(peg, 3) \
  352. )
  353. #define SMU_RESET_ALL_PROTOCOL_ENGINES() \
  354. (\
  355. SMU_RESET_PEG_PROTOCOL_ENGINES(0) \
  356. | SMU_RESET_PEG_PROTOCOL_ENGINES(1) \
  357. )
  358. #define SMU_SOFTRESET_CONTROL_RESET_WIDE_PORT_PEG0_LP0_SHIFT (16)
  359. #define SMU_SOFTRESET_CONTROL_RESET_WIDE_PORT_PEG0_LP0_MASK (0x00010000)
  360. #define SMU_SOFTRESET_CONTROL_RESET_WIDE_PORT_PEG0_LP2_SHIFT (17)
  361. #define SMU_SOFTRESET_CONTROL_RESET_WIDE_PORT_PEG0_LP2_MASK (0x00020000)
  362. #define SMU_SOFTRESET_CONTROL_RESET_WIDE_PORT_PEG1_LP0_SHIFT (18)
  363. #define SMU_SOFTRESET_CONTROL_RESET_WIDE_PORT_PEG1_LP0_MASK (0x00040000)
  364. #define SMU_SOFTRESET_CONTROL_RESET_WIDE_PORT_PEG1_LP2_SHIFT (19)
  365. #define SMU_SOFTRESET_CONTROL_RESET_WIDE_PORT_PEG1_LP2_MASK (0x00080000)
  366. #define SMU_RESET_WIDE_PORT_QUEUE(peg, wide_port) \
  367. ((1 << ((wide_port) / 2)) << ((peg) * 2) << 16)
  368. #define SMU_SOFTRESET_CONTROL_RESET_PEG0_SHIFT (20)
  369. #define SMU_SOFTRESET_CONTROL_RESET_PEG0_MASK (0x00100000)
  370. #define SMU_SOFTRESET_CONTROL_RESET_PEG1_SHIFT (21)
  371. #define SMU_SOFTRESET_CONTROL_RESET_PEG1_MASK (0x00200000)
  372. #define SMU_SOFTRESET_CONTROL_RESET_SCU_SHIFT (22)
  373. #define SMU_SOFTRESET_CONTROL_RESET_SCU_MASK (0x00400000)
  374. /*
  375. * It seems to make sense that if you are going to reset the protocol
  376. * engine group that you would also reset all of the protocol engines */
  377. #define SMU_RESET_PROTOCOL_ENGINE_GROUP(peg) \
  378. (\
  379. (1 << ((peg) + 20)) \
  380. | SMU_RESET_WIDE_PORT_QUEUE(peg, 0) \
  381. | SMU_RESET_WIDE_PORT_QUEUE(peg, 1) \
  382. | SMU_RESET_PEG_PROTOCOL_ENGINES(peg) \
  383. )
  384. #define SMU_RESET_ALL_PROTOCOL_ENGINE_GROUPS() \
  385. (\
  386. SMU_RESET_PROTOCOL_ENGINE_GROUP(0) \
  387. | SMU_RESET_PROTOCOL_ENGINE_GROUP(1) \
  388. )
  389. #define SMU_RESET_SCU() (0xFFFFFFFF)
  390. /* ***************************************************************************** */
  391. #define SMU_TASK_CONTEXT_ASSIGNMENT_STARTING_SHIFT (0)
  392. #define SMU_TASK_CONTEXT_ASSIGNMENT_STARTING_MASK (0x00000FFF)
  393. #define SMU_TASK_CONTEXT_ASSIGNMENT_ENDING_SHIFT (16)
  394. #define SMU_TASK_CONTEXT_ASSIGNMENT_ENDING_MASK (0x0FFF0000)
  395. #define SMU_TASK_CONTEXT_ASSIGNMENT_RANGE_CHECK_ENABLE_SHIFT (31)
  396. #define SMU_TASK_CONTEXT_ASSIGNMENT_RANGE_CHECK_ENABLE_MASK (0x80000000)
  397. #define SMU_TASK_CONTEXT_ASSIGNMENT_RESERVED_MASK (0x7000F000)
  398. #define SMU_TCA_GEN_VAL(name, value) \
  399. SCU_GEN_VALUE(SMU_TASK_CONTEXT_ASSIGNMENT_ ## name, value)
  400. #define SMU_TCA_GEN_BIT(name) \
  401. SCU_GEN_BIT(SMU_TASK_CONTEXT_ASSIGNMENT_ ## name)
  402. /* ***************************************************************************** */
  403. #define SCU_SDMA_UNSOLICITED_FRAME_QUEUE_CONTROL_QUEUE_SIZE_SHIFT (0)
  404. #define SCU_SDMA_UNSOLICITED_FRAME_QUEUE_CONTROL_QUEUE_SIZE_MASK (0x00000FFF)
  405. #define SCU_SDMA_UNSOLICITED_FRAME_QUEUE_CONTROL_RESERVED_MASK (0xFFFFF000)
  406. #define SCU_UFQC_GEN_VAL(name, value) \
  407. SCU_GEN_VALUE(SCU_SDMA_UNSOLICITED_FRAME_QUEUE_CONTROL_ ## name, value)
  408. #define SCU_UFQC_QUEUE_SIZE_SET(value) \
  409. SCU_UFQC_GEN_VAL(QUEUE_SIZE, value)
  410. /* ***************************************************************************** */
  411. #define SCU_SDMA_UNSOLICITED_FRAME_QUEUE_PUT_POINTER_SHIFT (0)
  412. #define SCU_SDMA_UNSOLICITED_FRAME_QUEUE_PUT_POINTER_MASK (0x00000FFF)
  413. #define SCU_SDMA_UNSOLICITED_FRAME_QUEUE_PUT_CYCLE_BIT_SHIFT (12)
  414. #define SCU_SDMA_UNSOLICITED_FRAME_QUEUE_PUT_CYCLE_BIT_MASK (0x00001000)
  415. #define SCU_SDMA_UNSOLICITED_FRAME_QUEUE_PUT_RESERVED_MASK (0xFFFFE000)
  416. #define SCU_UFQPP_GEN_VAL(name, value) \
  417. SCU_GEN_VALUE(SCU_SDMA_UNSOLICITED_FRAME_QUEUE_PUT_ ## name, value)
  418. #define SCU_UFQPP_GEN_BIT(name) \
  419. SCU_GEN_BIT(SCU_SDMA_UNSOLICITED_FRAME_QUEUE_PUT_ ## name)
  420. /*
  421. * *****************************************************************************
  422. * * SDMA Registers
  423. * ***************************************************************************** */
  424. #define SCU_SDMA_UNSOLICITED_FRAME_QUEUE_GET_POINTER_SHIFT (0)
  425. #define SCU_SDMA_UNSOLICITED_FRAME_QUEUE_GET_POINTER_MASK (0x00000FFF)
  426. #define SCU_SDMA_UNSOLICITED_FRAME_QUEUE_GET_CYCLE_BIT_SHIFT (12)
  427. #define SCU_SDMA_UNSOLICITED_FRAME_QUEUE_GET_CYCLE_BIT_MASK (12)
  428. #define SCU_SDMA_UNSOLICITED_FRAME_QUEUE_GET_ENABLE_BIT_SHIFT (31)
  429. #define SCU_SDMA_UNSOLICITED_FRAME_QUEUE_GET_ENABLE_BIT_MASK (0x80000000)
  430. #define SCU_SDMA_UNSOLICITED_FRAME_QUEUE_GET_RESERVED_MASK (0x7FFFE000)
  431. #define SCU_UFQGP_GEN_VAL(name, value) \
  432. SCU_GEN_VALUE(SCU_SDMA_UNSOLICITED_FRAME_QUEUE_GET_ ## name, value)
  433. #define SCU_UFQGP_GEN_BIT(name) \
  434. SCU_GEN_BIT(SCU_SDMA_UNSOLICITED_FRAME_QUEUE_GET_ ## name)
  435. #define SCU_UFQGP_CYCLE_BIT(value) \
  436. SCU_UFQGP_GEN_BIT(CYCLE_BIT, value)
  437. #define SCU_UFQGP_GET_POINTER(value) \
  438. SCU_UFQGP_GEN_VALUE(POINTER, value)
  439. #define SCU_UFQGP_ENABLE(value) \
  440. (SCU_UFQGP_GEN_BIT(ENABLE) | value)
  441. #define SCU_UFQGP_DISABLE(value) \
  442. (~SCU_UFQGP_GEN_BIT(ENABLE) & value)
  443. #define SCU_UFQGP_VALUE(bit, value) \
  444. (SCU_UFQGP_CYCLE_BIT(bit) | SCU_UFQGP_GET_POINTER(value))
  445. /* ***************************************************************************** */
  446. #define SCU_PDMA_CONFIGURATION_ADDRESS_MODIFIER_SHIFT (0)
  447. #define SCU_PDMA_CONFIGURATION_ADDRESS_MODIFIER_MASK (0x0000FFFF)
  448. #define SCU_PDMA_CONFIGURATION_PCI_RELAXED_ORDERING_ENABLE_SHIFT (16)
  449. #define SCU_PDMA_CONFIGURATION_PCI_RELAXED_ORDERING_ENABLE_MASK (0x00010000)
  450. #define SCU_PDMA_CONFIGURATION_PCI_NO_SNOOP_ENABLE_SHIFT (17)
  451. #define SCU_PDMA_CONFIGURATION_PCI_NO_SNOOP_ENABLE_MASK (0x00020000)
  452. #define SCU_PDMA_CONFIGURATION_BIG_ENDIAN_CONTROL_BYTE_SWAP_SHIFT (18)
  453. #define SCU_PDMA_CONFIGURATION_BIG_ENDIAN_CONTROL_BYTE_SWAP_MASK (0x00040000)
  454. #define SCU_PDMA_CONFIGURATION_BIG_ENDIAN_CONTROL_XPI_SGL_FETCH_SHIFT (19)
  455. #define SCU_PDMA_CONFIGURATION_BIG_ENDIAN_CONTROL_XPI_SGL_FETCH_MASK (0x00080000)
  456. #define SCU_PDMA_CONFIGURATION_BIG_ENDIAN_CONTROL_XPI_RX_HEADER_RAM_WRITE_SHIFT (20)
  457. #define SCU_PDMA_CONFIGURATION_BIG_ENDIAN_CONTROL_XPI_RX_HEADER_RAM_WRITE_MASK (0x00100000)
  458. #define SCU_PDMA_CONFIGURATION_BIG_ENDIAN_CONTROL_XPI_UF_ADDRESS_FETCH_SHIFT (21)
  459. #define SCU_PDMA_CONFIGURATION_BIG_ENDIAN_CONTROL_XPI_UF_ADDRESS_FETCH_MASK (0x00200000)
  460. #define SCU_PDMA_CONFIGURATION_ADDRESS_MODIFIER_SELECT_SHIFT (22)
  461. #define SCU_PDMA_CONFIGURATION_ADDRESS_MODIFIER_SELECT_MASK (0x00400000)
  462. #define SCU_PDMA_CONFIGURATION_RESERVED_MASK (0xFF800000)
  463. #define SCU_PDMACR_GEN_VALUE(name, value) \
  464. SCU_GEN_VALUE(SCU_PDMA_CONFIGURATION_ ## name, value)
  465. #define SCU_PDMACR_GEN_BIT(name) \
  466. SCU_GEN_BIT(SCU_PDMA_CONFIGURATION_ ## name)
  467. #define SCU_PDMACR_BE_GEN_BIT(name) \
  468. SCU_PCMACR_GEN_BIT(BIG_ENDIAN_CONTROL_ ## name)
  469. /* ***************************************************************************** */
  470. #define SCU_CDMA_CONFIGURATION_PCI_RELAXED_ORDERING_ENABLE_SHIFT (8)
  471. #define SCU_CDMA_CONFIGURATION_PCI_RELAXED_ORDERING_ENABLE_MASK (0x00000100)
  472. #define SCU_CDMACR_GEN_BIT(name) \
  473. SCU_GEN_BIT(SCU_CDMA_CONFIGURATION_ ## name)
  474. /*
  475. * *****************************************************************************
  476. * * SCU Link Layer Registers
  477. * ***************************************************************************** */
  478. #define SCU_LINK_LAYER_SPEED_NEGOTIATION_TIMER_VALUES_TIMEOUT_SHIFT (0)
  479. #define SCU_LINK_LAYER_SPEED_NEGOTIATION_TIMER_VALUES_TIMEOUT_MASK (0x000000FF)
  480. #define SCU_LINK_LAYER_SPEED_NEGOTIATION_TIMER_VALUES_LOCK_TIME_SHIFT (8)
  481. #define SCU_LINK_LAYER_SPEED_NEGOTIATION_TIMER_VALUES_LOCK_TIME_MASK (0x0000FF00)
  482. #define SCU_LINK_LAYER_SPEED_NEGOTIATION_TIMER_VALUES_RATE_CHANGE_DELAY_SHIFT (16)
  483. #define SCU_LINK_LAYER_SPEED_NEGOTIATION_TIMER_VALUES_RATE_CHANGE_DELAY_MASK (0x00FF0000)
  484. #define SCU_LINK_LAYER_SPEED_NEGOTIATION_TIMER_VALUES_DWORD_SYNC_TIMEOUT_SHIFT (24)
  485. #define SCU_LINK_LAYER_SPEED_NEGOTIATION_TIMER_VALUES_DWORD_SYNC_TIMEOUT_MASK (0xFF000000)
  486. #define SCU_LINK_LAYER_SPEED_NECGOIATION_TIMER_VALUES_REQUIRED_MASK (0x00000000)
  487. #define SCU_LINK_LAYER_SPEED_NECGOIATION_TIMER_VALUES_DEFAULT_MASK (0x7D00676F)
  488. #define SCU_LINK_LAYER_SPEED_NECGOIATION_TIMER_VALUES_RESERVED_MASK (0x00FF0000)
  489. #define SCU_SAS_SPDTOV_GEN_VALUE(name, value) \
  490. SCU_GEN_VALUE(SCU_LINK_LAYER_SPEED_NEGOTIATION_TIMER_VALUES_ ## name, value)
  491. #define SCU_LINK_STATUS_DWORD_SYNC_AQUIRED_SHIFT (2)
  492. #define SCU_LINK_STATUS_DWORD_SYNC_AQUIRED_MASK (0x00000004)
  493. #define SCU_LINK_STATUS_TRANSMIT_PORT_SELECTION_DONE_SHIFT (4)
  494. #define SCU_LINK_STATUS_TRANSMIT_PORT_SELECTION_DONE_MASK (0x00000010)
  495. #define SCU_LINK_STATUS_RECEIVER_CREDIT_EXHAUSTED_SHIFT (5)
  496. #define SCU_LINK_STATUS_RECEIVER_CREDIT_EXHAUSTED_MASK (0x00000020)
  497. #define SCU_LINK_STATUS_RESERVED_MASK (0xFFFFFFCD)
  498. #define SCU_SAS_LLSTA_GEN_BIT(name) \
  499. SCU_GEN_BIT(SCU_LINK_STATUS_ ## name)
  500. /* TODO: Where is the SATA_PSELTOV register? */
  501. /*
  502. * *****************************************************************************
  503. * * SCU SAS Maximum Arbitration Wait Time Timeout Register
  504. * ***************************************************************************** */
  505. #define SCU_SAS_MAX_ARBITRATION_WAIT_TIME_TIMEOUT_VALUE_SHIFT (0)
  506. #define SCU_SAS_MAX_ARBITRATION_WAIT_TIME_TIMEOUT_VALUE_MASK (0x00007FFF)
  507. #define SCU_SAS_MAX_ARBITRATION_WAIT_TIME_TIMEOUT_SCALE_SHIFT (15)
  508. #define SCU_SAS_MAX_ARBITRATION_WAIT_TIME_TIMEOUT_SCALE_MASK (0x00008000)
  509. #define SCU_SAS_MAWTTOV_GEN_VALUE(name, value) \
  510. SCU_GEN_VALUE(SCU_SAS_MAX_ARBITRATION_WAIT_TIME_TIMEOUT_ ## name, value)
  511. #define SCU_SAS_MAWTTOV_GEN_BIT(name) \
  512. SCU_GEN_BIT(SCU_SAS_MAX_ARBITRATION_WAIT_TIME_TIMEOUT_ ## name)
  513. /*
  514. * TODO: Where is the SAS_LNKTOV regsiter?
  515. * TODO: Where is the SAS_PHYTOV register? */
  516. #define SCU_SAS_TRANSMIT_IDENTIFICATION_SMP_TARGET_SHIFT (1)
  517. #define SCU_SAS_TRANSMIT_IDENTIFICATION_SMP_TARGET_MASK (0x00000002)
  518. #define SCU_SAS_TRANSMIT_IDENTIFICATION_STP_TARGET_SHIFT (2)
  519. #define SCU_SAS_TRANSMIT_IDENTIFICATION_STP_TARGET_MASK (0x00000004)
  520. #define SCU_SAS_TRANSMIT_IDENTIFICATION_SSP_TARGET_SHIFT (3)
  521. #define SCU_SAS_TRANSMIT_IDENTIFICATION_SSP_TARGET_MASK (0x00000008)
  522. #define SCU_SAS_TRANSMIT_IDENTIFICATION_DA_SATA_HOST_SHIFT (8)
  523. #define SCU_SAS_TRANSMIT_IDENTIFICATION_DA_SATA_HOST_MASK (0x00000100)
  524. #define SCU_SAS_TRANSMIT_IDENTIFICATION_SMP_INITIATOR_SHIFT (9)
  525. #define SCU_SAS_TRANSMIT_IDENTIFICATION_SMP_INITIATOR_MASK (0x00000200)
  526. #define SCU_SAS_TRANSMIT_IDENTIFICATION_STP_INITIATOR_SHIFT (10)
  527. #define SCU_SAS_TRANSMIT_IDENTIFICATION_STP_INITIATOR_MASK (0x00000400)
  528. #define SCU_SAS_TRANSMIT_IDENTIFICATION_SSP_INITIATOR_SHIFT (11)
  529. #define SCU_SAS_TRANSMIT_IDENTIFICATION_SSP_INITIATOR_MASK (0x00000800)
  530. #define SCU_SAS_TRANSMIT_IDENTIFICATION_REASON_CODE_SHIFT (16)
  531. #define SCU_SAS_TRANSMIT_IDENTIFICATION_REASON_CODE_MASK (0x000F0000)
  532. #define SCU_SAS_TRANSMIT_IDENTIFICATION_ADDRESS_FRAME_TYPE_SHIFT (24)
  533. #define SCU_SAS_TRANSMIT_IDENTIFICATION_ADDRESS_FRAME_TYPE_MASK (0x0F000000)
  534. #define SCU_SAS_TRANSMIT_IDENTIFICATION_DEVICE_TYPE_SHIFT (28)
  535. #define SCU_SAS_TRANSMIT_IDENTIFICATION_DEVICE_TYPE_MASK (0x70000000)
  536. #define SCU_SAS_TRANSMIT_IDENTIFICATION_RESERVED_MASK (0x80F0F1F1)
  537. #define SCU_SAS_TIID_GEN_VAL(name, value) \
  538. SCU_GEN_VALUE(SCU_SAS_TRANSMIT_IDENTIFICATION_ ## name, value)
  539. #define SCU_SAS_TIID_GEN_BIT(name) \
  540. SCU_GEN_BIT(SCU_SAS_TRANSMIT_IDENTIFICATION_ ## name)
  541. /* SAS Identify Frame PHY Identifier Register */
  542. #define SCU_LINK_LAYER_IDENTIFY_FRAME_PHY_IDENTIFIER_BREAK_REPLY_CAPABLE_SHIFT (16)
  543. #define SCU_LINK_LAYER_IDENTIFY_FRAME_PHY_IDENTIFIER_BREAK_REPLY_CAPABLE_MASK (0x00010000)
  544. #define SCU_LINK_LAYER_IDENTIFY_FRAME_PHY_IDENTIFIER_REQUESTED_INSIDE_ZPSDS_SHIFT (17)
  545. #define SCU_LINK_LAYER_IDENTIFY_FRAME_PHY_IDENTIFIER_REQUESTED_INSIDE_ZPSDS_MASK (0x00020000)
  546. #define SCU_LINK_LAYER_IDENTIFY_FRAME_PHY_IDENTIFIER_INSIDE_ZPSDS_PERSISTENT_SHIFT (18)
  547. #define SCU_LINK_LAYER_IDENTIFY_FRAME_PHY_IDENTIFIER_INSIDE_ZPSDS_PERSISTENT_MASK (0x00040000)
  548. #define SCU_LINK_LAYER_IDENTIFY_FRAME_PHY_IDENTIFIER_ID_SHIFT (24)
  549. #define SCU_LINK_LAYER_IDENTIFY_FRAME_PHY_IDENTIFIER_ID_MASK (0xFF000000)
  550. #define SCU_LINK_LAYER_IDENTIFY_FRAME_PHY_IDENTIFIER_RESERVED_MASK (0x00F800FF)
  551. #define SCU_SAS_TIPID_GEN_VALUE(name, value) \
  552. SCU_GEN_VALUE(SCU_LINK_LAYER_IDENTIFY_FRAME_PHY_IDENTIFIER_ ## name, value)
  553. #define SCU_SAS_TIPID_GEN_BIT(name) \
  554. SCU_GEN_BIT(SCU_LINK_LAYER_IDENTIFY_FRAME_PHY_IDENTIFIER_ ## name)
  555. #define SCU_SAS_PHY_CONFIGURATION_TX_PARITY_CHECK_SHIFT (4)
  556. #define SCU_SAS_PHY_CONFIGURATION_TX_PARITY_CHECK_MASK (0x00000010)
  557. #define SCU_SAS_PHY_CONFIGURATION_TX_BAD_CRC_SHIFT (6)
  558. #define SCU_SAS_PHY_CONFIGURATION_TX_BAD_CRC_MASK (0x00000040)
  559. #define SCU_SAS_PHY_CONFIGURATION_DISABLE_SCRAMBLER_SHIFT (7)
  560. #define SCU_SAS_PHY_CONFIGURATION_DISABLE_SCRAMBLER_MASK (0x00000080)
  561. #define SCU_SAS_PHY_CONFIGURATION_DISABLE_DESCRAMBLER_SHIFT (8)
  562. #define SCU_SAS_PHY_CONFIGURATION_DISABLE_DESCRAMBLER_MASK (0x00000100)
  563. #define SCU_SAS_PHY_CONFIGURATION_DISABLE_CREDIT_INSERTION_SHIFT (9)
  564. #define SCU_SAS_PHY_CONFIGURATION_DISABLE_CREDIT_INSERTION_MASK (0x00000200)
  565. #define SCU_SAS_PHY_CONFIGURATION_SUSPEND_PROTOCOL_ENGINE_SHIFT (11)
  566. #define SCU_SAS_PHY_CONFIGURATION_SUSPEND_PROTOCOL_ENGINE_MASK (0x00000800)
  567. #define SCU_SAS_PHY_CONFIGURATION_SATA_SPINUP_HOLD_SHIFT (12)
  568. #define SCU_SAS_PHY_CONFIGURATION_SATA_SPINUP_HOLD_MASK (0x00001000)
  569. #define SCU_SAS_PHY_CONFIGURATION_TRANSMIT_PORT_SELECTION_SIGNAL_SHIFT (13)
  570. #define SCU_SAS_PHY_CONFIGURATION_TRANSMIT_PORT_SELECTION_SIGNAL_MASK (0x00002000)
  571. #define SCU_SAS_PHY_CONFIGURATION_HARD_RESET_SHIFT (14)
  572. #define SCU_SAS_PHY_CONFIGURATION_HARD_RESET_MASK (0x00004000)
  573. #define SCU_SAS_PHY_CONFIGURATION_OOB_ENABLE_SHIFT (15)
  574. #define SCU_SAS_PHY_CONFIGURATION_OOB_ENABLE_MASK (0x00008000)
  575. #define SCU_SAS_PHY_CONFIGURATION_ENABLE_FRAME_TX_INSERT_ALIGN_SHIFT (23)
  576. #define SCU_SAS_PHY_CONFIGURATION_ENABLE_FRAME_TX_INSERT_ALIGN_MASK (0x00800000)
  577. #define SCU_SAS_PHY_CONFIGURATION_FORWARD_IDENTIFY_FRAME_SHIFT (27)
  578. #define SCU_SAS_PHY_CONFIGURATION_FORWARD_IDENTIFY_FRAME_MASK (0x08000000)
  579. #define SCU_SAS_PHY_CONFIGURATION_DISABLE_BYTE_TRANSPOSE_STP_FRAME_SHIFT (28)
  580. #define SCU_SAS_PHY_CONFIGURATION_DISABLE_BYTE_TRANSPOSE_STP_FRAME_MASK (0x10000000)
  581. #define SCU_SAS_PHY_CONFIGURATION_OOB_RESET_SHIFT (29)
  582. #define SCU_SAS_PHY_CONFIGURATION_OOB_RESET_MASK (0x20000000)
  583. #define SCU_SAS_PHY_CONFIGURATION_THREE_IAF_ENABLE_SHIFT (30)
  584. #define SCU_SAS_PHY_CONFIGURATION_THREE_IAF_ENABLE_MASK (0x40000000)
  585. #define SCU_SAS_PHY_CONFIGURATION_OOB_ALIGN0_ENABLE_SHIFT (31)
  586. #define SCU_SAS_PHY_CONFIGURATION_OOB_ALIGN0_ENABLE_MASK (0x80000000)
  587. #define SCU_SAS_PHY_CONFIGURATION_REQUIRED_MASK (0x0100000F)
  588. #define SCU_SAS_PHY_CONFIGURATION_DEFAULT_MASK (0x4180100F)
  589. #define SCU_SAS_PHY_CONFIGURATION_RESERVED_MASK (0x00000000)
  590. #define SCU_SAS_PCFG_GEN_BIT(name) \
  591. SCU_GEN_BIT(SCU_SAS_PHY_CONFIGURATION_ ## name)
  592. #define SCU_LINK_LAYER_ALIGN_INSERTION_FREQUENCY_GENERAL_SHIFT (0)
  593. #define SCU_LINK_LAYER_ALIGN_INSERTION_FREQUENCY_GENERAL_MASK (0x000007FF)
  594. #define SCU_LINK_LAYER_ALIGN_INSERTION_FREQUENCY_CONNECTED_SHIFT (16)
  595. #define SCU_LINK_LAYER_ALIGN_INSERTION_FREQUENCY_CONNECTED_MASK (0x00ff0000)
  596. #define SCU_ALIGN_INSERTION_FREQUENCY_GEN_VAL(name, value) \
  597. SCU_GEN_VALUE(SCU_LINK_LAYER_ALIGN_INSERTION_FREQUENCY_##name, value)
  598. #define SCU_LINK_LAYER_ENABLE_SPINUP_CONTROL_COUNT_SHIFT (0)
  599. #define SCU_LINK_LAYER_ENABLE_SPINUP_CONTROL_COUNT_MASK (0x0003FFFF)
  600. #define SCU_LINK_LAYER_ENABLE_SPINUP_CONTROL_ENABLE_SHIFT (31)
  601. #define SCU_LINK_LAYER_ENABLE_SPINUP_CONTROL_ENABLE_MASK (0x80000000)
  602. #define SCU_LINK_LAYER_ENABLE_SPINUP_CONTROL_RESERVED_MASK (0x7FFC0000)
  603. #define SCU_ENSPINUP_GEN_VAL(name, value) \
  604. SCU_GEN_VALUE(SCU_LINK_LAYER_ENABLE_SPINUP_CONTROL_ ## name, value)
  605. #define SCU_ENSPINUP_GEN_BIT(name) \
  606. SCU_GEN_BIT(SCU_LINK_LAYER_ENABLE_SPINUP_CONTROL_ ## name)
  607. #define SCU_LINK_LAYER_PHY_CAPABILITIES_TXSSCTYPE_SHIFT (1)
  608. #define SCU_LINK_LAYER_PHY_CAPABILITIES_TXSSCTYPE_MASK (0x00000002)
  609. #define SCU_LINK_LAYER_PHY_CAPABILITIES_RLLRATE_SHIFT (4)
  610. #define SCU_LINK_LAYER_PHY_CAPABILITIES_RLLRATE_MASK (0x000000F0)
  611. #define SCU_LINK_LAYER_PHY_CAPABILITIES_SWO15GBPS_SHIFT (8)
  612. #define SCU_LINK_LAYER_PHY_CAPABILITIES_SWO15GBPS_MASK (0x00000100)
  613. #define SCU_LINK_LAYER_PHY_CAPABILITIES_SW15GBPS_SHIFT (9)
  614. #define SCU_LINK_LAYER_PHY_CAPABILITIES_SW15GBPS_MASK (0x00000201)
  615. #define SCU_LINK_LAYER_PHY_CAPABILITIES_SWO30GBPS_SHIFT (10)
  616. #define SCU_LINK_LAYER_PHY_CAPABILITIES_SWO30GBPS_MASK (0x00000401)
  617. #define SCU_LINK_LAYER_PHY_CAPABILITIES_SW30GBPS_SHIFT (11)
  618. #define SCU_LINK_LAYER_PHY_CAPABILITIES_SW30GBPS_MASK (0x00000801)
  619. #define SCU_LINK_LAYER_PHY_CAPABILITIES_SWO60GBPS_SHIFT (12)
  620. #define SCU_LINK_LAYER_PHY_CAPABILITIES_SWO60GBPS_MASK (0x00001001)
  621. #define SCU_LINK_LAYER_PHY_CAPABILITIES_SW60GBPS_SHIFT (13)
  622. #define SCU_LINK_LAYER_PHY_CAPABILITIES_SW60GBPS_MASK (0x00002001)
  623. #define SCU_LINK_LAYER_PHY_CAPABILITIES_EVEN_PARITY_SHIFT (31)
  624. #define SCU_LINK_LAYER_PHY_CAPABILITIES_EVEN_PARITY_MASK (0x80000000)
  625. #define SCU_LINK_LAYER_PHY_CAPABILITIES_DEFAULT_MASK (0x00003F01)
  626. #define SCU_LINK_LAYER_PHY_CAPABILITIES_REQUIRED_MASK (0x00000001)
  627. #define SCU_LINK_LAYER_PHY_CAPABILITIES_RESERVED_MASK (0x7FFFC00D)
  628. #define SCU_SAS_PHYCAP_GEN_VAL(name, value) \
  629. SCU_GEN_VALUE(SCU_LINK_LAYER_PHY_CAPABILITIES_ ## name, value)
  630. #define SCU_SAS_PHYCAP_GEN_BIT(name) \
  631. SCU_GEN_BIT(SCU_LINK_LAYER_PHY_CAPABILITIES_ ## name)
  632. #define SCU_LINK_LAYER_PHY_SOURCE_ZONE_GROUP_CONTROL_VIRTUAL_EXPANDER_PHY_ZONE_GROUP_SHIFT (0)
  633. #define SCU_LINK_LAYER_PHY_SOURCE_ZONE_GROUP_CONTROL_VIRTUAL_EXPANDER_PHY_ZONE_GROUP_MASK (0x000000FF)
  634. #define SCU_LINK_LAYER_PHY_SOURCE_ZONE_GROUP_CONTROL_INSIDE_SOURCE_ZONE_GROUP_SHIFT (31)
  635. #define SCU_LINK_LAYER_PHY_SOURCE_ZONE_GROUP_CONTROL_INSIDE_SOURCE_ZONE_GROUP_MASK (0x80000000)
  636. #define SCU_LINK_LAYER_PHY_SOURCE_ZONE_GROUP_CONTROL_RESERVED_MASK (0x7FFFFF00)
  637. #define SCU_PSZGCR_GEN_VAL(name, value) \
  638. SCU_GEN_VALUE(SCU_LINK_LAYER_PHY_SOURCE_ZONE_GROUP_CONTROL_ ## name, value)
  639. #define SCU_PSZGCR_GEN_BIT(name) \
  640. SCU_GEN_BIT(SCU_LINK_LAYER_PHY_SOURCE_ZONE_GROUP_CONTROL_ ## name)
  641. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ZONE0_LOCKED_SHIFT (1)
  642. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ZONE0_LOCKED_MASK (0x00000002)
  643. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ZONE0_UPDATING_SHIFT (2)
  644. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ZONE0_UPDATING_MASK (0x00000004)
  645. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ZONE1_LOCKED_SHIFT (4)
  646. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ZONE1_LOCKED_MASK (0x00000010)
  647. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ZONE1_UPDATING_SHIFT (5)
  648. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ZONE1_UPDATING_MASK (0x00000020)
  649. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ZPT_ASSOCIATION_PE0_SHIFT (16)
  650. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ZPT_ASSOCIATION_PE0_MASK (0x00030000)
  651. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_AIP_ENABLE_PE0_SHIFT (19)
  652. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_AIP_ENABLE_PE0_MASK (0x00080000)
  653. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ZPT_ASSOCIATION_PE1_SHIFT (20)
  654. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ZPT_ASSOCIATION_PE1_MASK (0x00300000)
  655. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_AIP_ENABLE_PE1_SHIFT (23)
  656. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_AIP_ENABLE_PE1_MASK (0x00800000)
  657. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ZPT_ASSOCIATION_PE2_SHIFT (24)
  658. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ZPT_ASSOCIATION_PE2_MASK (0x03000000)
  659. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_AIP_ENABLE_PE2_SHIFT (27)
  660. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_AIP_ENABLE_PE2_MASK (0x08000000)
  661. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ZPT_ASSOCIATION_PE3_SHIFT (28)
  662. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ZPT_ASSOCIATION_PE3_MASK (0x30000000)
  663. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_AIP_ENABLE_PE3_SHIFT (31)
  664. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_AIP_ENABLE_PE3_MASK (0x80000000)
  665. #define SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_RESERVED_MASK (0x4444FFC9)
  666. #define SCU_PEG_SCUVZECR_GEN_VAL(name, val) \
  667. SCU_GEN_VALUE(SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ ## name, val)
  668. #define SCU_PEG_SCUVZECR_GEN_BIT(name) \
  669. SCU_GEN_BIT(SCU_PROTOCOL_ENGINE_GROUP_VIRTUAL_ZONING_EXPANDER_CONTROL_ ## name)
  670. /*
  671. * *****************************************************************************
  672. * * Port Task Scheduler registers shift and mask values
  673. * ***************************************************************************** */
  674. #define SCU_PTSG_CONTROL_IT_NEXUS_TIMEOUT_SHIFT (0)
  675. #define SCU_PTSG_CONTROL_IT_NEXUS_TIMEOUT_MASK (0x0000FFFF)
  676. #define SCU_PTSG_CONTROL_TASK_TIMEOUT_SHIFT (16)
  677. #define SCU_PTSG_CONTROL_TASK_TIMEOUT_MASK (0x00FF0000)
  678. #define SCU_PTSG_CONTROL_PTSG_ENABLE_SHIFT (24)
  679. #define SCU_PTSG_CONTROL_PTSG_ENABLE_MASK (0x01000000)
  680. #define SCU_PTSG_CONTROL_ETM_ENABLE_SHIFT (25)
  681. #define SCU_PTSG_CONTROL_ETM_ENABLE_MASK (0x02000000)
  682. #define SCU_PTSG_CONTROL_DEFAULT_MASK (0x00020002)
  683. #define SCU_PTSG_CONTROL_REQUIRED_MASK (0x00000000)
  684. #define SCU_PTSG_CONTROL_RESERVED_MASK (0xFC000000)
  685. #define SCU_PTSGCR_GEN_VAL(name, val) \
  686. SCU_GEN_VALUE(SCU_PTSG_CONTROL_ ## name, val)
  687. #define SCU_PTSGCR_GEN_BIT(name) \
  688. SCU_GEN_BIT(SCU_PTSG_CONTROL_ ## name)
  689. /* ***************************************************************************** */
  690. #define SCU_PTSG_REAL_TIME_CLOCK_SHIFT (0)
  691. #define SCU_PTSG_REAL_TIME_CLOCK_MASK (0x0000FFFF)
  692. #define SCU_PTSG_REAL_TIME_CLOCK_RESERVED_MASK (0xFFFF0000)
  693. #define SCU_RTCR_GEN_VAL(name, val) \
  694. SCU_GEN_VALUE(SCU_PTSG_ ## name, val)
  695. #define SCU_PTSG_REAL_TIME_CLOCK_CONTROL_PRESCALER_VALUE_SHIFT (0)
  696. #define SCU_PTSG_REAL_TIME_CLOCK_CONTROL_PRESCALER_VALUE_MASK (0x00FFFFFF)
  697. #define SCU_PTSG_REAL_TIME_CLOCK_CONTROL_RESERVED_MASK (0xFF000000)
  698. #define SCU_RTCCR_GEN_VAL(name, val) \
  699. SCU_GEN_VALUE(SCU_PTSG_REAL_TIME_CLOCK_CONTROL_ ## name, val)
  700. #define SCU_PTSG_PORT_TASK_SCHEDULER_CONTROL_SUSPEND_SHIFT (0)
  701. #define SCU_PTSG_PORT_TASK_SCHEDULER_CONTROL_SUSPEND_MASK (0x00000001)
  702. #define SCU_PTSG_PORT_TASK_SCHEDULER_CONTROL_ENABLE_SHIFT (1)
  703. #define SCU_PTSG_PORT_TASK_SCHEDULER_CONTROL_ENABLE_MASK (0x00000002)
  704. #define SCU_PTSG_PORT_TASK_SCHEDULER_CONTROL_RESERVED_MASK (0xFFFFFFFC)
  705. #define SCU_PTSxCR_GEN_BIT(name) \
  706. SCU_GEN_BIT(SCU_PTSG_PORT_TASK_SCHEDULER_CONTROL_ ## name)
  707. #define SCU_PTSG_PORT_TASK_SCHEDULER_STATUS_NEXT_RN_VALID_SHIFT (0)
  708. #define SCU_PTSG_PORT_TASK_SCHEDULER_STATUS_NEXT_RN_VALID_MASK (0x00000001)
  709. #define SCU_PTSG_PORT_TASK_SCHEDULER_STATUS_ACTIVE_RNSC_LIST_VALID_SHIFT (1)
  710. #define SCU_PTSG_PORT_TASK_SCHEDULER_STATUS_ACTIVE_RNSC_LIST_VALID_MASK (0x00000002)
  711. #define SCU_PTSG_PORT_TASK_SCHEDULER_STATUS_PTS_SUSPENDED_SHIFT (2)
  712. #define SCU_PTSG_PORT_TASK_SCHEDULER_STATUS_PTS_SUSPENDED_MASK (0x00000004)
  713. #define SCU_PTSG_PORT_TASK_SCHEDULER_STATUS_RESERVED_MASK (0xFFFFFFF8)
  714. #define SCU_PTSxSR_GEN_BIT(name) \
  715. SCU_GEN_BIT(SCU_PTSG_PORT_TASK_SCHEDULER_STATUS_ ## name)
  716. /*
  717. * *****************************************************************************
  718. * * SGPIO Register shift and mask values
  719. * ***************************************************************************** */
  720. #define SCU_SGPIO_CONTROL_SGPIO_ENABLE_SHIFT (0)
  721. #define SCU_SGPIO_CONTROL_SGPIO_ENABLE_MASK (0x00000001)
  722. #define SCU_SGPIO_CONTROL_SGPIO_SERIAL_CLOCK_SELECT_SHIFT (1)
  723. #define SCU_SGPIO_CONTROL_SGPIO_SERIAL_CLOCK_SELECT_MASK (0x00000002)
  724. #define SCU_SGPIO_CONTROL_SGPIO_SERIAL_SHIFT_WIDTH_SELECT_SHIFT (2)
  725. #define SCU_SGPIO_CONTROL_SGPIO_SERIAL_SHIFT_WIDTH_SELECT_MASK (0x00000004)
  726. #define SCU_SGPIO_CONTROL_SGPIO_TEST_BIT_SHIFT (15)
  727. #define SCU_SGPIO_CONTROL_SGPIO_TEST_BIT_MASK (0x00008000)
  728. #define SCU_SGPIO_CONTROL_SGPIO_RESERVED_MASK (0xFFFF7FF8)
  729. #define SCU_SGICRx_GEN_BIT(name) \
  730. SCU_GEN_BIT(SCU_SGPIO_CONTROL_SGPIO_ ## name)
  731. #define SCU_SGPIO_PROGRAMMABLE_BLINK_REGISTER_R0_SHIFT (0)
  732. #define SCU_SGPIO_PROGRAMMABLE_BLINK_REGISTER_R0_MASK (0x0000000F)
  733. #define SCU_SGPIO_PROGRAMMABLE_BLINK_REGISTER_R1_SHIFT (4)
  734. #define SCU_SGPIO_PROGRAMMABLE_BLINK_REGISTER_R1_MASK (0x000000F0)
  735. #define SCU_SGPIO_PROGRAMMABLE_BLINK_REGISTER_R2_SHIFT (8)
  736. #define SCU_SGPIO_PROGRAMMABLE_BLINK_REGISTER_R2_MASK (0x00000F00)
  737. #define SCU_SGPIO_PROGRAMMABLE_BLINK_REGISTER_R3_SHIFT (12)
  738. #define SCU_SGPIO_PROGRAMMABLE_BLINK_REGISTER_R3_MASK (0x0000F000)
  739. #define SCU_SGPIO_PROGRAMMABLE_BLINK_REGISTER_RESERVED_MASK (0xFFFF0000)
  740. #define SCU_SGPBRx_GEN_VAL(name, value) \
  741. SCU_GEN_VALUE(SCU_SGPIO_PROGRAMMABLE_BLINK_REGISTER_ ## name, value)
  742. #define SCU_SGPIO_START_DRIVE_LOWER_R0_SHIFT (0)
  743. #define SCU_SGPIO_START_DRIVE_LOWER_R0_MASK (0x00000003)
  744. #define SCU_SGPIO_START_DRIVE_LOWER_R1_SHIFT (4)
  745. #define SCU_SGPIO_START_DRIVE_LOWER_R1_MASK (0x00000030)
  746. #define SCU_SGPIO_START_DRIVE_LOWER_R2_SHIFT (8)
  747. #define SCU_SGPIO_START_DRIVE_LOWER_R2_MASK (0x00000300)
  748. #define SCU_SGPIO_START_DRIVE_LOWER_R3_SHIFT (12)
  749. #define SCU_SGPIO_START_DRIVE_LOWER_R3_MASK (0x00003000)
  750. #define SCU_SGPIO_START_DRIVE_LOWER_RESERVED_MASK (0xFFFF8888)
  751. #define SCU_SGSDLRx_GEN_VAL(name, value) \
  752. SCU_GEN_VALUE(SCU_SGPIO_START_DRIVE_LOWER_ ## name, value)
  753. #define SCU_SGPIO_START_DRIVE_UPPER_R0_SHIFT (0)
  754. #define SCU_SGPIO_START_DRIVE_UPPER_R0_MASK (0x00000003)
  755. #define SCU_SGPIO_START_DRIVE_UPPER_R1_SHIFT (4)
  756. #define SCU_SGPIO_START_DRIVE_UPPER_R1_MASK (0x00000030)
  757. #define SCU_SGPIO_START_DRIVE_UPPER_R2_SHIFT (8)
  758. #define SCU_SGPIO_START_DRIVE_UPPER_R2_MASK (0x00000300)
  759. #define SCU_SGPIO_START_DRIVE_UPPER_R3_SHIFT (12)
  760. #define SCU_SGPIO_START_DRIVE_UPPER_R3_MASK (0x00003000)
  761. #define SCU_SGPIO_START_DRIVE_UPPER_RESERVED_MASK (0xFFFF8888)
  762. #define SCU_SGSDURx_GEN_VAL(name, value) \
  763. SCU_GEN_VALUE(SCU_SGPIO_START_DRIVE_LOWER_ ## name, value)
  764. #define SCU_SGPIO_SERIAL_INPUT_DATA_LOWER_D0_SHIFT (0)
  765. #define SCU_SGPIO_SERIAL_INPUT_DATA_LOWER_D0_MASK (0x00000003)
  766. #define SCU_SGPIO_SERIAL_INPUT_DATA_LOWER_D1_SHIFT (4)
  767. #define SCU_SGPIO_SERIAL_INPUT_DATA_LOWER_D1_MASK (0x00000030)
  768. #define SCU_SGPIO_SERIAL_INPUT_DATA_LOWER_D2_SHIFT (8)
  769. #define SCU_SGPIO_SERIAL_INPUT_DATA_LOWER_D2_MASK (0x00000300)
  770. #define SCU_SGPIO_SERIAL_INPUT_DATA_LOWER_D3_SHIFT (12)
  771. #define SCU_SGPIO_SERIAL_INPUT_DATA_LOWER_D3_MASK (0x00003000)
  772. #define SCU_SGPIO_SERIAL_INPUT_DATA_LOWER_RESERVED_MASK (0xFFFF8888)
  773. #define SCU_SGSIDLRx_GEN_VAL(name, value) \
  774. SCU_GEN_VALUE(SCU_SGPIO_SERIAL_INPUT_DATA_LOWER_ ## name, value)
  775. #define SCU_SGPIO_SERIAL_INPUT_DATA_UPPER_D0_SHIFT (0)
  776. #define SCU_SGPIO_SERIAL_INPUT_DATA_UPPER_D0_MASK (0x00000003)
  777. #define SCU_SGPIO_SERIAL_INPUT_DATA_UPPER_D1_SHIFT (4)
  778. #define SCU_SGPIO_SERIAL_INPUT_DATA_UPPER_D1_MASK (0x00000030)
  779. #define SCU_SGPIO_SERIAL_INPUT_DATA_UPPER_D2_SHIFT (8)
  780. #define SCU_SGPIO_SERIAL_INPUT_DATA_UPPER_D2_MASK (0x00000300)
  781. #define SCU_SGPIO_SERIAL_INPUT_DATA_UPPER_D3_SHIFT (12)
  782. #define SCU_SGPIO_SERIAL_INPUT_DATA_UPPER_D3_MASK (0x00003000)
  783. #define SCU_SGPIO_SERIAL_INPUT_DATA_UPPER_RESERVED_MASK (0xFFFF8888)
  784. #define SCU_SGSIDURx_GEN_VAL(name, value) \
  785. SCU_GEN_VALUE(SCU_SGPIO_SERIAL_INPUT_DATA_LOWER_ ## name, value)
  786. #define SCU_SGPIO_VENDOR_SPECIFIC_CODE_SHIFT (0)
  787. #define SCU_SGPIO_VENDOR_SPECIFIC_CODE_MASK (0x0000000F)
  788. #define SCU_SGPIO_VENDOR_SPECIFIC_CODE_RESERVED_MASK (0xFFFFFFF0)
  789. #define SCU_SGVSCR_GEN_VAL(value) \
  790. SCU_GEN_VALUE(SCU_SGPIO_VENDOR_SPECIFIC_CODE ## name, value)
  791. #define SCU_SGPIO_OUPUT_DATA_SELECT_INPUT_DATA0_SHIFT (0)
  792. #define SCU_SGPIO_OUPUT_DATA_SELECT_INPUT_DATA0_MASK (0x00000003)
  793. #define SCU_SGPIO_OUPUT_DATA_SELECT_INVERT_INPUT_DATA0_SHIFT (2)
  794. #define SCU_SGPIO_OUPUT_DATA_SELECT_INVERT_INPUT_DATA0_MASK (0x00000004)
  795. #define SCU_SGPIO_OUPUT_DATA_SELECT_JOG_ENABLE_DATA0_SHIFT (3)
  796. #define SCU_SGPIO_OUPUT_DATA_SELECT_JOG_ENABLE_DATA0_MASK (0x00000008)
  797. #define SCU_SGPIO_OUPUT_DATA_SELECT_INPUT_DATA1_SHIFT (4)
  798. #define SCU_SGPIO_OUPUT_DATA_SELECT_INPUT_DATA1_MASK (0x00000030)
  799. #define SCU_SGPIO_OUPUT_DATA_SELECT_INVERT_INPUT_DATA1_SHIFT (6)
  800. #define SCU_SGPIO_OUPUT_DATA_SELECT_INVERT_INPUT_DATA1_MASK (0x00000040)
  801. #define SCU_SGPIO_OUPUT_DATA_SELECT_JOG_ENABLE_DATA1_SHIFT (7)
  802. #define SCU_SGPIO_OUPUT_DATA_SELECT_JOG_ENABLE_DATA1_MASK (0x00000080)
  803. #define SCU_SGPIO_OUPUT_DATA_SELECT_INPUT_DATA2_SHIFT (8)
  804. #define SCU_SGPIO_OUPUT_DATA_SELECT_INPUT_DATA2_MASK (0x00000300)
  805. #define SCU_SGPIO_OUPUT_DATA_SELECT_INVERT_INPUT_DATA2_SHIFT (10)
  806. #define SCU_SGPIO_OUPUT_DATA_SELECT_INVERT_INPUT_DATA2_MASK (0x00000400)
  807. #define SCU_SGPIO_OUPUT_DATA_SELECT_JOG_ENABLE_DATA2_SHIFT (11)
  808. #define SCU_SGPIO_OUPUT_DATA_SELECT_JOG_ENABLE_DATA2_MASK (0x00000800)
  809. #define SCU_SGPIO_OUPUT_DATA_SELECT_RESERVED_MASK (0xFFFFF000)
  810. #define SCU_SGODSR_GEN_VAL(name, value) \
  811. SCU_GEN_VALUE(SCU_SGPIO_OUPUT_DATA_SELECT_ ## name, value)
  812. #define SCU_SGODSR_GEN_BIT(name) \
  813. SCU_GEN_BIT(SCU_SGPIO_OUPUT_DATA_SELECT_ ## name)
  814. /*
  815. * *****************************************************************************
  816. * * SMU Registers
  817. * ***************************************************************************** */
  818. /*
  819. * ----------------------------------------------------------------------------
  820. * SMU Registers
  821. * These registers are based off of BAR0
  822. *
  823. * To calculate the offset for other functions use
  824. * BAR0 + FN# * SystemPageSize * 2
  825. *
  826. * The TCA is only accessable from FN#0 (Physical Function) and each
  827. * is programmed by (BAR0 + SCU_SMU_TCA_OFFSET + (FN# * 0x04)) or
  828. * TCA0 for FN#0 is at BAR0 + 0x0400
  829. * TCA1 for FN#1 is at BAR0 + 0x0404
  830. * etc.
  831. * ----------------------------------------------------------------------------
  832. * Accessable to all FN#s */
  833. #define SCU_SMU_PCP_OFFSET 0x0000
  834. #define SCU_SMU_AMR_OFFSET 0x0004
  835. #define SCU_SMU_ISR_OFFSET 0x0010
  836. #define SCU_SMU_IMR_OFFSET 0x0014
  837. #define SCU_SMU_ICC_OFFSET 0x0018
  838. #define SCU_SMU_HTTLBAR_OFFSET 0x0020
  839. #define SCU_SMU_HTTUBAR_OFFSET 0x0024
  840. #define SCU_SMU_TCR_OFFSET 0x0028
  841. #define SCU_SMU_CQLBAR_OFFSET 0x0030
  842. #define SCU_SMU_CQUBAR_OFFSET 0x0034
  843. #define SCU_SMU_CQPR_OFFSET 0x0040
  844. #define SCU_SMU_CQGR_OFFSET 0x0044
  845. #define SCU_SMU_CQC_OFFSET 0x0048
  846. /* Accessable to FN#0 only */
  847. #define SCU_SMU_RNCLBAR_OFFSET 0x0080
  848. #define SCU_SMU_RNCUBAR_OFFSET 0x0084
  849. #define SCU_SMU_DCC_OFFSET 0x0090
  850. #define SCU_SMU_DFC_OFFSET 0x0094
  851. #define SCU_SMU_SMUCSR_OFFSET 0x0098
  852. #define SCU_SMU_SCUSRCR_OFFSET 0x009C
  853. #define SCU_SMU_SMAW_OFFSET 0x00A0
  854. #define SCU_SMU_SMDW_OFFSET 0x00A4
  855. /* Accessable to FN#0 only */
  856. #define SCU_SMU_TCA_OFFSET 0x0400
  857. /* Accessable to all FN#s */
  858. #define SCU_SMU_MT_MLAR0_OFFSET 0x2000
  859. #define SCU_SMU_MT_MUAR0_OFFSET 0x2004
  860. #define SCU_SMU_MT_MDR0_OFFSET 0x2008
  861. #define SCU_SMU_MT_VCR0_OFFSET 0x200C
  862. #define SCU_SMU_MT_MLAR1_OFFSET 0x2010
  863. #define SCU_SMU_MT_MUAR1_OFFSET 0x2014
  864. #define SCU_SMU_MT_MDR1_OFFSET 0x2018
  865. #define SCU_SMU_MT_VCR1_OFFSET 0x201C
  866. #define SCU_SMU_MPBA_OFFSET 0x3000
  867. /**
  868. * struct smu_registers - These are the SMU registers
  869. *
  870. *
  871. */
  872. struct smu_registers {
  873. /* 0x0000 PCP */
  874. u32 post_context_port;
  875. /* 0x0004 AMR */
  876. u32 address_modifier;
  877. u32 reserved_08;
  878. u32 reserved_0C;
  879. /* 0x0010 ISR */
  880. u32 interrupt_status;
  881. /* 0x0014 IMR */
  882. u32 interrupt_mask;
  883. /* 0x0018 ICC */
  884. u32 interrupt_coalesce_control;
  885. u32 reserved_1C;
  886. /* 0x0020 HTTLBAR */
  887. u32 host_task_table_lower;
  888. /* 0x0024 HTTUBAR */
  889. u32 host_task_table_upper;
  890. /* 0x0028 TCR */
  891. u32 task_context_range;
  892. u32 reserved_2C;
  893. /* 0x0030 CQLBAR */
  894. u32 completion_queue_lower;
  895. /* 0x0034 CQUBAR */
  896. u32 completion_queue_upper;
  897. u32 reserved_38;
  898. u32 reserved_3C;
  899. /* 0x0040 CQPR */
  900. u32 completion_queue_put;
  901. /* 0x0044 CQGR */
  902. u32 completion_queue_get;
  903. /* 0x0048 CQC */
  904. u32 completion_queue_control;
  905. u32 reserved_4C;
  906. u32 reserved_5x[4];
  907. u32 reserved_6x[4];
  908. u32 reserved_7x[4];
  909. /*
  910. * Accessable to FN#0 only
  911. * 0x0080 RNCLBAR */
  912. u32 remote_node_context_lower;
  913. /* 0x0084 RNCUBAR */
  914. u32 remote_node_context_upper;
  915. u32 reserved_88;
  916. u32 reserved_8C;
  917. /* 0x0090 DCC */
  918. u32 device_context_capacity;
  919. /* 0x0094 DFC */
  920. u32 device_function_capacity;
  921. /* 0x0098 SMUCSR */
  922. u32 control_status;
  923. /* 0x009C SCUSRCR */
  924. u32 soft_reset_control;
  925. /* 0x00A0 SMAW */
  926. u32 mmr_address_window;
  927. /* 0x00A4 SMDW */
  928. u32 mmr_data_window;
  929. u32 reserved_A8;
  930. u32 reserved_AC;
  931. /* A whole bunch of reserved space */
  932. u32 reserved_Bx[4];
  933. u32 reserved_Cx[4];
  934. u32 reserved_Dx[4];
  935. u32 reserved_Ex[4];
  936. u32 reserved_Fx[4];
  937. u32 reserved_1xx[64];
  938. u32 reserved_2xx[64];
  939. u32 reserved_3xx[64];
  940. /*
  941. * Accessable to FN#0 only
  942. * 0x0400 TCA */
  943. u32 task_context_assignment[256];
  944. /* MSI-X registers not included */
  945. };
  946. /*
  947. * *****************************************************************************
  948. * SDMA Registers
  949. * ***************************************************************************** */
  950. #define SCU_SDMA_BASE 0x6000
  951. #define SCU_SDMA_PUFATLHAR_OFFSET 0x0000
  952. #define SCU_SDMA_PUFATUHAR_OFFSET 0x0004
  953. #define SCU_SDMA_UFLHBAR_OFFSET 0x0008
  954. #define SCU_SDMA_UFUHBAR_OFFSET 0x000C
  955. #define SCU_SDMA_UFQC_OFFSET 0x0010
  956. #define SCU_SDMA_UFQPP_OFFSET 0x0014
  957. #define SCU_SDMA_UFQGP_OFFSET 0x0018
  958. #define SCU_SDMA_PDMACR_OFFSET 0x001C
  959. #define SCU_SDMA_CDMACR_OFFSET 0x0080
  960. /**
  961. * struct scu_sdma_registers - These are the SCU SDMA Registers
  962. *
  963. *
  964. */
  965. struct scu_sdma_registers {
  966. /* 0x0000 PUFATLHAR */
  967. u32 uf_address_table_lower;
  968. /* 0x0004 PUFATUHAR */
  969. u32 uf_address_table_upper;
  970. /* 0x0008 UFLHBAR */
  971. u32 uf_header_base_address_lower;
  972. /* 0x000C UFUHBAR */
  973. u32 uf_header_base_address_upper;
  974. /* 0x0010 UFQC */
  975. u32 unsolicited_frame_queue_control;
  976. /* 0x0014 UFQPP */
  977. u32 unsolicited_frame_put_pointer;
  978. /* 0x0018 UFQGP */
  979. u32 unsolicited_frame_get_pointer;
  980. /* 0x001C PDMACR */
  981. u32 pdma_configuration;
  982. /* Reserved until offset 0x80 */
  983. u32 reserved_0020_007C[0x18];
  984. /* 0x0080 CDMACR */
  985. u32 cdma_configuration;
  986. /* Remainder SDMA register space */
  987. u32 reserved_0084_0400[0xDF];
  988. };
  989. /*
  990. * *****************************************************************************
  991. * * SCU Link Registers
  992. * ***************************************************************************** */
  993. #define SCU_PEG0_OFFSET 0x0000
  994. #define SCU_PEG1_OFFSET 0x8000
  995. #define SCU_TL0_OFFSET 0x0000
  996. #define SCU_TL1_OFFSET 0x0400
  997. #define SCU_TL2_OFFSET 0x0800
  998. #define SCU_TL3_OFFSET 0x0C00
  999. #define SCU_LL_OFFSET 0x0080
  1000. #define SCU_LL0_OFFSET (SCU_TL0_OFFSET + SCU_LL_OFFSET)
  1001. #define SCU_LL1_OFFSET (SCU_TL1_OFFSET + SCU_LL_OFFSET)
  1002. #define SCU_LL2_OFFSET (SCU_TL2_OFFSET + SCU_LL_OFFSET)
  1003. #define SCU_LL3_OFFSET (SCU_TL3_OFFSET + SCU_LL_OFFSET)
  1004. /* Transport Layer Offsets (PEG + TL) */
  1005. #define SCU_TLCR_OFFSET 0x0000
  1006. #define SCU_TLADTR_OFFSET 0x0004
  1007. #define SCU_TLTTMR_OFFSET 0x0008
  1008. #define SCU_TLEECR0_OFFSET 0x000C
  1009. #define SCU_STPTLDARNI_OFFSET 0x0010
  1010. #define SCU_TLCR_HASH_SAS_CHECKING_ENABLE_SHIFT (0)
  1011. #define SCU_TLCR_HASH_SAS_CHECKING_ENABLE_MASK (0x00000001)
  1012. #define SCU_TLCR_CLEAR_TCI_NCQ_MAPPING_TABLE_SHIFT (1)
  1013. #define SCU_TLCR_CLEAR_TCI_NCQ_MAPPING_TABLE_MASK (0x00000002)
  1014. #define SCU_TLCR_STP_WRITE_DATA_PREFETCH_SHIFT (3)
  1015. #define SCU_TLCR_STP_WRITE_DATA_PREFETCH_MASK (0x00000008)
  1016. #define SCU_TLCR_CMD_NAK_STATUS_CODE_SHIFT (4)
  1017. #define SCU_TLCR_CMD_NAK_STATUS_CODE_MASK (0x00000010)
  1018. #define SCU_TLCR_RESERVED_MASK (0xFFFFFFEB)
  1019. #define SCU_TLCR_GEN_BIT(name) \
  1020. SCU_GEN_BIT(SCU_TLCR_ ## name)
  1021. /**
  1022. * struct scu_transport_layer_registers - These are the SCU Transport Layer
  1023. * registers
  1024. *
  1025. *
  1026. */
  1027. struct scu_transport_layer_registers {
  1028. /* 0x0000 TLCR */
  1029. u32 control;
  1030. /* 0x0004 TLADTR */
  1031. u32 arbitration_delay_timer;
  1032. /* 0x0008 TLTTMR */
  1033. u32 timer_test_mode;
  1034. /* 0x000C reserved */
  1035. u32 reserved_0C;
  1036. /* 0x0010 STPTLDARNI */
  1037. u32 stp_rni;
  1038. /* 0x0014 TLFEWPORCTRL */
  1039. u32 tlfe_wpo_read_control;
  1040. /* 0x0018 TLFEWPORDATA */
  1041. u32 tlfe_wpo_read_data;
  1042. /* 0x001C RXTLSSCSR1 */
  1043. u32 rxtl_single_step_control_status_1;
  1044. /* 0x0020 RXTLSSCSR2 */
  1045. u32 rxtl_single_step_control_status_2;
  1046. /* 0x0024 AWTRDDCR */
  1047. u32 tlfe_awt_retry_delay_debug_control;
  1048. /* Remainder of TL memory space */
  1049. u32 reserved_0028_007F[0x16];
  1050. };
  1051. /* Protocol Engine Group Registers */
  1052. #define SCU_SCUVZECRx_OFFSET 0x1080
  1053. /* Link Layer Offsets (PEG + TL + LL) */
  1054. #define SCU_SAS_SPDTOV_OFFSET 0x0000
  1055. #define SCU_SAS_LLSTA_OFFSET 0x0004
  1056. #define SCU_SATA_PSELTOV_OFFSET 0x0008
  1057. #define SCU_SAS_TIMETOV_OFFSET 0x0010
  1058. #define SCU_SAS_LOSTOT_OFFSET 0x0014
  1059. #define SCU_SAS_LNKTOV_OFFSET 0x0018
  1060. #define SCU_SAS_PHYTOV_OFFSET 0x001C
  1061. #define SCU_SAS_AFERCNT_OFFSET 0x0020
  1062. #define SCU_SAS_WERCNT_OFFSET 0x0024
  1063. #define SCU_SAS_TIID_OFFSET 0x0028
  1064. #define SCU_SAS_TIDNH_OFFSET 0x002C
  1065. #define SCU_SAS_TIDNL_OFFSET 0x0030
  1066. #define SCU_SAS_TISSAH_OFFSET 0x0034
  1067. #define SCU_SAS_TISSAL_OFFSET 0x0038
  1068. #define SCU_SAS_TIPID_OFFSET 0x003C
  1069. #define SCU_SAS_TIRES2_OFFSET 0x0040
  1070. #define SCU_SAS_ADRSTA_OFFSET 0x0044
  1071. #define SCU_SAS_MAWTTOV_OFFSET 0x0048
  1072. #define SCU_SAS_FRPLDFIL_OFFSET 0x0054
  1073. #define SCU_SAS_RFCNT_OFFSET 0x0060
  1074. #define SCU_SAS_TFCNT_OFFSET 0x0064
  1075. #define SCU_SAS_RFDCNT_OFFSET 0x0068
  1076. #define SCU_SAS_TFDCNT_OFFSET 0x006C
  1077. #define SCU_SAS_LERCNT_OFFSET 0x0070
  1078. #define SCU_SAS_RDISERRCNT_OFFSET 0x0074
  1079. #define SCU_SAS_CRERCNT_OFFSET 0x0078
  1080. #define SCU_STPCTL_OFFSET 0x007C
  1081. #define SCU_SAS_PCFG_OFFSET 0x0080
  1082. #define SCU_SAS_CLKSM_OFFSET 0x0084
  1083. #define SCU_SAS_TXCOMWAKE_OFFSET 0x0088
  1084. #define SCU_SAS_TXCOMINIT_OFFSET 0x008C
  1085. #define SCU_SAS_TXCOMSAS_OFFSET 0x0090
  1086. #define SCU_SAS_COMINIT_OFFSET 0x0094
  1087. #define SCU_SAS_COMWAKE_OFFSET 0x0098
  1088. #define SCU_SAS_COMSAS_OFFSET 0x009C
  1089. #define SCU_SAS_SFERCNT_OFFSET 0x00A0
  1090. #define SCU_SAS_CDFERCNT_OFFSET 0x00A4
  1091. #define SCU_SAS_DNFERCNT_OFFSET 0x00A8
  1092. #define SCU_SAS_PRSTERCNT_OFFSET 0x00AC
  1093. #define SCU_SAS_CNTCTL_OFFSET 0x00B0
  1094. #define SCU_SAS_SSPTOV_OFFSET 0x00B4
  1095. #define SCU_FTCTL_OFFSET 0x00B8
  1096. #define SCU_FRCTL_OFFSET 0x00BC
  1097. #define SCU_FTWMRK_OFFSET 0x00C0
  1098. #define SCU_ENSPINUP_OFFSET 0x00C4
  1099. #define SCU_SAS_TRNTOV_OFFSET 0x00C8
  1100. #define SCU_SAS_PHYCAP_OFFSET 0x00CC
  1101. #define SCU_SAS_PHYCTL_OFFSET 0x00D0
  1102. #define SCU_SAS_LLCTL_OFFSET 0x00D8
  1103. #define SCU_AFE_XCVRCR_OFFSET 0x00DC
  1104. #define SCU_AFE_LUTCR_OFFSET 0x00E0
  1105. #define SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_ALIGN_DETECTION_SHIFT (0UL)
  1106. #define SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_ALIGN_DETECTION_MASK (0x000000FFUL)
  1107. #define SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_HOT_PLUG_SHIFT (8UL)
  1108. #define SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_HOT_PLUG_MASK (0x0000FF00UL)
  1109. #define SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_COMSAS_DETECTION_SHIFT (16UL)
  1110. #define SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_COMSAS_DETECTION_MASK (0x00FF0000UL)
  1111. #define SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_RATE_CHANGE_SHIFT (24UL)
  1112. #define SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_RATE_CHANGE_MASK (0xFF000000UL)
  1113. #define SCU_SAS_PHYTOV_GEN_VAL(name, value) \
  1114. SCU_GEN_VALUE(SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_##name, value)
  1115. #define SCU_SAS_LINK_LAYER_CONTROL_MAX_LINK_RATE_SHIFT (0)
  1116. #define SCU_SAS_LINK_LAYER_CONTROL_MAX_LINK_RATE_MASK (0x00000003)
  1117. #define SCU_SAS_LINK_LAYER_CONTROL_MAX_LINK_RATE_GEN1 (0)
  1118. #define SCU_SAS_LINK_LAYER_CONTROL_MAX_LINK_RATE_GEN2 (1)
  1119. #define SCU_SAS_LINK_LAYER_CONTROL_MAX_LINK_RATE_GEN3 (2)
  1120. #define SCU_SAS_LINK_LAYER_CONTROL_BROADCAST_PRIMITIVE_SHIFT (2)
  1121. #define SCU_SAS_LINK_LAYER_CONTROL_BROADCAST_PRIMITIVE_MASK (0x000003FC)
  1122. #define SCU_SAS_LINK_LAYER_CONTROL_CLOSE_NO_ACTIVE_TASK_DISABLE_SHIFT (16)
  1123. #define SCU_SAS_LINK_LAYER_CONTROL_CLOSE_NO_ACTIVE_TASK_DISABLE_MASK (0x00010000)
  1124. #define SCU_SAS_LINK_LAYER_CONTROL_CLOSE_NO_OUTBOUND_TASK_DISABLE_SHIFT (17)
  1125. #define SCU_SAS_LINK_LAYER_CONTROL_CLOSE_NO_OUTBOUND_TASK_DISABLE_MASK (0x00020000)
  1126. #define SCU_SAS_LINK_LAYER_CONTROL_NO_OUTBOUND_TASK_TIMEOUT_SHIFT (24)
  1127. #define SCU_SAS_LINK_LAYER_CONTROL_NO_OUTBOUND_TASK_TIMEOUT_MASK (0xFF000000)
  1128. #define SCU_SAS_LINK_LAYER_CONTROL_RESERVED (0x00FCFC00)
  1129. #define SCU_SAS_LLCTL_GEN_VAL(name, value) \
  1130. SCU_GEN_VALUE(SCU_SAS_LINK_LAYER_CONTROL_ ## name, value)
  1131. #define SCU_SAS_LLCTL_GEN_BIT(name) \
  1132. SCU_GEN_BIT(SCU_SAS_LINK_LAYER_CONTROL_ ## name)
  1133. /* #define SCU_FRXHECR_DCNT_OFFSET 0x00B0 */
  1134. #define SCU_PSZGCR_OFFSET 0x00E4
  1135. #define SCU_SAS_RECPHYCAP_OFFSET 0x00E8
  1136. /* #define SCU_TX_LUTSEL_OFFSET 0x00B8 */
  1137. #define SCU_SAS_PTxC_OFFSET 0x00D4 /* Same offset as SAS_TCTSTM */
  1138. /**
  1139. * struct scu_link_layer_registers - SCU Link Layer Registers
  1140. *
  1141. *
  1142. */
  1143. struct scu_link_layer_registers {
  1144. /* 0x0000 SAS_SPDTOV */
  1145. u32 speed_negotiation_timers;
  1146. /* 0x0004 SAS_LLSTA */
  1147. u32 link_layer_status;
  1148. /* 0x0008 SATA_PSELTOV */
  1149. u32 port_selector_timeout;
  1150. u32 reserved0C;
  1151. /* 0x0010 SAS_TIMETOV */
  1152. u32 timeout_unit_value;
  1153. /* 0x0014 SAS_RCDTOV */
  1154. u32 rcd_timeout;
  1155. /* 0x0018 SAS_LNKTOV */
  1156. u32 link_timer_timeouts;
  1157. /* 0x001C SAS_PHYTOV */
  1158. u32 sas_phy_timeouts;
  1159. /* 0x0020 SAS_AFERCNT */
  1160. u32 received_address_frame_error_counter;
  1161. /* 0x0024 SAS_WERCNT */
  1162. u32 invalid_dword_counter;
  1163. /* 0x0028 SAS_TIID */
  1164. u32 transmit_identification;
  1165. /* 0x002C SAS_TIDNH */
  1166. u32 sas_device_name_high;
  1167. /* 0x0030 SAS_TIDNL */
  1168. u32 sas_device_name_low;
  1169. /* 0x0034 SAS_TISSAH */
  1170. u32 source_sas_address_high;
  1171. /* 0x0038 SAS_TISSAL */
  1172. u32 source_sas_address_low;
  1173. /* 0x003C SAS_TIPID */
  1174. u32 identify_frame_phy_id;
  1175. /* 0x0040 SAS_TIRES2 */
  1176. u32 identify_frame_reserved;
  1177. /* 0x0044 SAS_ADRSTA */
  1178. u32 received_address_frame;
  1179. /* 0x0048 SAS_MAWTTOV */
  1180. u32 maximum_arbitration_wait_timer_timeout;
  1181. /* 0x004C SAS_PTxC */
  1182. u32 transmit_primitive;
  1183. /* 0x0050 SAS_RORES */
  1184. u32 error_counter_event_notification_control;
  1185. /* 0x0054 SAS_FRPLDFIL */
  1186. u32 frxq_payload_fill_threshold;
  1187. /* 0x0058 SAS_LLHANG_TOT */
  1188. u32 link_layer_hang_detection_timeout;
  1189. u32 reserved_5C;
  1190. /* 0x0060 SAS_RFCNT */
  1191. u32 received_frame_count;
  1192. /* 0x0064 SAS_TFCNT */
  1193. u32 transmit_frame_count;
  1194. /* 0x0068 SAS_RFDCNT */
  1195. u32 received_dword_count;
  1196. /* 0x006C SAS_TFDCNT */
  1197. u32 transmit_dword_count;
  1198. /* 0x0070 SAS_LERCNT */
  1199. u32 loss_of_sync_error_count;
  1200. /* 0x0074 SAS_RDISERRCNT */
  1201. u32 running_disparity_error_count;
  1202. /* 0x0078 SAS_CRERCNT */
  1203. u32 received_frame_crc_error_count;
  1204. /* 0x007C STPCTL */
  1205. u32 stp_control;
  1206. /* 0x0080 SAS_PCFG */
  1207. u32 phy_configuration;
  1208. /* 0x0084 SAS_CLKSM */
  1209. u32 clock_skew_management;
  1210. /* 0x0088 SAS_TXCOMWAKE */
  1211. u32 transmit_comwake_signal;
  1212. /* 0x008C SAS_TXCOMINIT */
  1213. u32 transmit_cominit_signal;
  1214. /* 0x0090 SAS_TXCOMSAS */
  1215. u32 transmit_comsas_signal;
  1216. /* 0x0094 SAS_COMINIT */
  1217. u32 cominit_control;
  1218. /* 0x0098 SAS_COMWAKE */
  1219. u32 comwake_control;
  1220. /* 0x009C SAS_COMSAS */
  1221. u32 comsas_control;
  1222. /* 0x00A0 SAS_SFERCNT */
  1223. u32 received_short_frame_count;
  1224. /* 0x00A4 SAS_CDFERCNT */
  1225. u32 received_frame_without_credit_count;
  1226. /* 0x00A8 SAS_DNFERCNT */
  1227. u32 received_frame_after_done_count;
  1228. /* 0x00AC SAS_PRSTERCNT */
  1229. u32 phy_reset_problem_count;
  1230. /* 0x00B0 SAS_CNTCTL */
  1231. u32 counter_control;
  1232. /* 0x00B4 SAS_SSPTOV */
  1233. u32 ssp_timer_timeout_values;
  1234. /* 0x00B8 FTCTL */
  1235. u32 ftx_control;
  1236. /* 0x00BC FRCTL */
  1237. u32 frx_control;
  1238. /* 0x00C0 FTWMRK */
  1239. u32 ftx_watermark;
  1240. /* 0x00C4 ENSPINUP */
  1241. u32 notify_enable_spinup_control;
  1242. /* 0x00C8 SAS_TRNTOV */
  1243. u32 sas_training_sequence_timer_values;
  1244. /* 0x00CC SAS_PHYCAP */
  1245. u32 phy_capabilities;
  1246. /* 0x00D0 SAS_PHYCTL */
  1247. u32 phy_control;
  1248. u32 reserved_d4;
  1249. /* 0x00D8 LLCTL */
  1250. u32 link_layer_control;
  1251. /* 0x00DC AFE_XCVRCR */
  1252. u32 afe_xcvr_control;
  1253. /* 0x00E0 AFE_LUTCR */
  1254. u32 afe_lookup_table_control;
  1255. /* 0x00E4 PSZGCR */
  1256. u32 phy_source_zone_group_control;
  1257. /* 0x00E8 SAS_RECPHYCAP */
  1258. u32 receive_phycap;
  1259. u32 reserved_ec;
  1260. /* 0x00F0 SNAFERXRSTCTL */
  1261. u32 speed_negotiation_afe_rx_reset_control;
  1262. /* 0x00F4 SAS_SSIPMCTL */
  1263. u32 power_management_control;
  1264. /* 0x00F8 SAS_PSPREQ_PRIM */
  1265. u32 sas_pm_partial_request_primitive;
  1266. /* 0x00FC SAS_PSSREQ_PRIM */
  1267. u32 sas_pm_slumber_request_primitive;
  1268. /* 0x0100 SAS_PPSACK_PRIM */
  1269. u32 sas_pm_ack_primitive_register;
  1270. /* 0x0104 SAS_PSNAK_PRIM */
  1271. u32 sas_pm_nak_primitive_register;
  1272. /* 0x0108 SAS_SSIPMTOV */
  1273. u32 sas_primitive_timeout;
  1274. u32 reserved_10c;
  1275. /* 0x0110 - 0x011C PLAPRDCTRLxREG */
  1276. u32 pla_product_control[4];
  1277. /* 0x0120 PLAPRDSUMREG */
  1278. u32 pla_product_sum;
  1279. /* 0x0124 PLACONTROLREG */
  1280. u32 pla_control;
  1281. /* Remainder of memory space 896 bytes */
  1282. u32 reserved_0128_037f[0x96];
  1283. };
  1284. /*
  1285. * 0x00D4 // Same offset as SAS_TCTSTM SAS_PTxC
  1286. * u32 primitive_transmit_control; */
  1287. /*
  1288. * ----------------------------------------------------------------------------
  1289. * SGPIO
  1290. * ---------------------------------------------------------------------------- */
  1291. #define SCU_SGPIO_OFFSET 0x1400
  1292. /* #define SCU_SGPIO_OFFSET 0x6000 // later moves to 0x1400 see HSD 652625 */
  1293. #define SCU_SGPIO_SGICR_OFFSET 0x0000
  1294. #define SCU_SGPIO_SGPBR_OFFSET 0x0004
  1295. #define SCU_SGPIO_SGSDLR_OFFSET 0x0008
  1296. #define SCU_SGPIO_SGSDUR_OFFSET 0x000C
  1297. #define SCU_SGPIO_SGSIDLR_OFFSET 0x0010
  1298. #define SCU_SGPIO_SGSIDUR_OFFSET 0x0014
  1299. #define SCU_SGPIO_SGVSCR_OFFSET 0x0018
  1300. /* Address from 0x0820 to 0x083C */
  1301. #define SCU_SGPIO_SGODSR_OFFSET 0x0020
  1302. /**
  1303. * struct scu_sgpio_registers - SCU SGPIO Registers
  1304. *
  1305. *
  1306. */
  1307. struct scu_sgpio_registers {
  1308. /* 0x0000 SGPIO_SGICR */
  1309. u32 interface_control;
  1310. /* 0x0004 SGPIO_SGPBR */
  1311. u32 blink_rate;
  1312. /* 0x0008 SGPIO_SGSDLR */
  1313. u32 start_drive_lower;
  1314. /* 0x000C SGPIO_SGSDUR */
  1315. u32 start_drive_upper;
  1316. /* 0x0010 SGPIO_SGSIDLR */
  1317. u32 serial_input_lower;
  1318. /* 0x0014 SGPIO_SGSIDUR */
  1319. u32 serial_input_upper;
  1320. /* 0x0018 SGPIO_SGVSCR */
  1321. u32 vendor_specific_code;
  1322. /* 0x0020 SGPIO_SGODSR */
  1323. u32 ouput_data_select[8];
  1324. /* Remainder of memory space 256 bytes */
  1325. u32 reserved_1444_14ff[0x31];
  1326. };
  1327. /*
  1328. * *****************************************************************************
  1329. * * Defines for VIIT entry offsets
  1330. * * Access additional entries by SCU_VIIT_BASE + index * 0x10
  1331. * ***************************************************************************** */
  1332. #define SCU_VIIT_BASE 0x1c00
  1333. struct scu_viit_registers {
  1334. u32 registers[256];
  1335. };
  1336. /*
  1337. * *****************************************************************************
  1338. * * SCU PORT TASK SCHEDULER REGISTERS
  1339. * ***************************************************************************** */
  1340. #define SCU_PTSG_BASE 0x1000
  1341. #define SCU_PTSG_PTSGCR_OFFSET 0x0000
  1342. #define SCU_PTSG_RTCR_OFFSET 0x0004
  1343. #define SCU_PTSG_RTCCR_OFFSET 0x0008
  1344. #define SCU_PTSG_PTS0CR_OFFSET 0x0010
  1345. #define SCU_PTSG_PTS0SR_OFFSET 0x0014
  1346. #define SCU_PTSG_PTS1CR_OFFSET 0x0018
  1347. #define SCU_PTSG_PTS1SR_OFFSET 0x001C
  1348. #define SCU_PTSG_PTS2CR_OFFSET 0x0020
  1349. #define SCU_PTSG_PTS2SR_OFFSET 0x0024
  1350. #define SCU_PTSG_PTS3CR_OFFSET 0x0028
  1351. #define SCU_PTSG_PTS3SR_OFFSET 0x002C
  1352. #define SCU_PTSG_PCSPE0CR_OFFSET 0x0030
  1353. #define SCU_PTSG_PCSPE1CR_OFFSET 0x0034
  1354. #define SCU_PTSG_PCSPE2CR_OFFSET 0x0038
  1355. #define SCU_PTSG_PCSPE3CR_OFFSET 0x003C
  1356. #define SCU_PTSG_ETMTSCCR_OFFSET 0x0040
  1357. #define SCU_PTSG_ETMRNSCCR_OFFSET 0x0044
  1358. /**
  1359. * struct scu_port_task_scheduler_registers - These are the control/stats pairs
  1360. * for each Port Task Scheduler.
  1361. *
  1362. *
  1363. */
  1364. struct scu_port_task_scheduler_registers {
  1365. u32 control;
  1366. u32 status;
  1367. };
  1368. /**
  1369. * struct scu_port_task_scheduler_group_registers - These are the PORT Task
  1370. * Scheduler registers
  1371. *
  1372. *
  1373. */
  1374. struct scu_port_task_scheduler_group_registers {
  1375. /* 0x0000 PTSGCR */
  1376. u32 control;
  1377. /* 0x0004 RTCR */
  1378. u32 real_time_clock;
  1379. /* 0x0008 RTCCR */
  1380. u32 real_time_clock_control;
  1381. /* 0x000C */
  1382. u32 reserved_0C;
  1383. /*
  1384. * 0x0010 PTS0CR
  1385. * 0x0014 PTS0SR
  1386. * 0x0018 PTS1CR
  1387. * 0x001C PTS1SR
  1388. * 0x0020 PTS2CR
  1389. * 0x0024 PTS2SR
  1390. * 0x0028 PTS3CR
  1391. * 0x002C PTS3SR */
  1392. struct scu_port_task_scheduler_registers port[4];
  1393. /*
  1394. * 0x0030 PCSPE0CR
  1395. * 0x0034 PCSPE1CR
  1396. * 0x0038 PCSPE2CR
  1397. * 0x003C PCSPE3CR */
  1398. u32 protocol_engine[4];
  1399. /* 0x0040 ETMTSCCR */
  1400. u32 tc_scanning_interval_control;
  1401. /* 0x0044 ETMRNSCCR */
  1402. u32 rnc_scanning_interval_control;
  1403. /* Remainder of memory space 128 bytes */
  1404. u32 reserved_1048_107f[0x0E];
  1405. };
  1406. #define SCU_PTSG_SCUVZECR_OFFSET 0x003C
  1407. /*
  1408. * *****************************************************************************
  1409. * * AFE REGISTERS
  1410. * ***************************************************************************** */
  1411. #define SCU_AFE_MMR_BASE 0xE000
  1412. /*
  1413. * AFE 0 is at offset 0x0800
  1414. * AFE 1 is at offset 0x0900
  1415. * AFE 2 is at offset 0x0a00
  1416. * AFE 3 is at offset 0x0b00 */
  1417. struct scu_afe_transceiver {
  1418. /* 0x0000 AFE_XCVR_CTRL0 */
  1419. u32 afe_xcvr_control0;
  1420. /* 0x0004 AFE_XCVR_CTRL1 */
  1421. u32 afe_xcvr_control1;
  1422. /* 0x0008 */
  1423. u32 reserved_0008;
  1424. /* 0x000c afe_dfx_rx_control0 */
  1425. u32 afe_dfx_rx_control0;
  1426. /* 0x0010 AFE_DFX_RX_CTRL1 */
  1427. u32 afe_dfx_rx_control1;
  1428. /* 0x0014 */
  1429. u32 reserved_0014;
  1430. /* 0x0018 AFE_DFX_RX_STS0 */
  1431. u32 afe_dfx_rx_status0;
  1432. /* 0x001c AFE_DFX_RX_STS1 */
  1433. u32 afe_dfx_rx_status1;
  1434. /* 0x0020 */
  1435. u32 reserved_0020;
  1436. /* 0x0024 AFE_TX_CTRL */
  1437. u32 afe_tx_control;
  1438. /* 0x0028 AFE_TX_AMP_CTRL0 */
  1439. u32 afe_tx_amp_control0;
  1440. /* 0x002c AFE_TX_AMP_CTRL1 */
  1441. u32 afe_tx_amp_control1;
  1442. /* 0x0030 AFE_TX_AMP_CTRL2 */
  1443. u32 afe_tx_amp_control2;
  1444. /* 0x0034 AFE_TX_AMP_CTRL3 */
  1445. u32 afe_tx_amp_control3;
  1446. /* 0x0038 afe_tx_ssc_control */
  1447. u32 afe_tx_ssc_control;
  1448. /* 0x003c */
  1449. u32 reserved_003c;
  1450. /* 0x0040 AFE_RX_SSC_CTRL0 */
  1451. u32 afe_rx_ssc_control0;
  1452. /* 0x0044 AFE_RX_SSC_CTRL1 */
  1453. u32 afe_rx_ssc_control1;
  1454. /* 0x0048 AFE_RX_SSC_CTRL2 */
  1455. u32 afe_rx_ssc_control2;
  1456. /* 0x004c AFE_RX_EQ_STS0 */
  1457. u32 afe_rx_eq_status0;
  1458. /* 0x0050 AFE_RX_EQ_STS1 */
  1459. u32 afe_rx_eq_status1;
  1460. /* 0x0054 AFE_RX_CDR_STS */
  1461. u32 afe_rx_cdr_status;
  1462. /* 0x0058 */
  1463. u32 reserved_0058;
  1464. /* 0x005c AFE_CHAN_CTRL */
  1465. u32 afe_channel_control;
  1466. /* 0x0060-0x006c */
  1467. u32 reserved_0060_006c[0x04];
  1468. /* 0x0070 AFE_XCVR_EC_STS0 */
  1469. u32 afe_xcvr_error_capture_status0;
  1470. /* 0x0074 AFE_XCVR_EC_STS1 */
  1471. u32 afe_xcvr_error_capture_status1;
  1472. /* 0x0078 AFE_XCVR_EC_STS2 */
  1473. u32 afe_xcvr_error_capture_status2;
  1474. /* 0x007c afe_xcvr_ec_status3 */
  1475. u32 afe_xcvr_error_capture_status3;
  1476. /* 0x0080 AFE_XCVR_EC_STS4 */
  1477. u32 afe_xcvr_error_capture_status4;
  1478. /* 0x0084 AFE_XCVR_EC_STS5 */
  1479. u32 afe_xcvr_error_capture_status5;
  1480. /* 0x0088-0x00fc */
  1481. u32 reserved_008c_00fc[0x1e];
  1482. };
  1483. /**
  1484. * struct scu_afe_registers - AFE Regsiters
  1485. *
  1486. *
  1487. */
  1488. /* Uaoa AFE registers */
  1489. struct scu_afe_registers {
  1490. /* 0Xe000 AFE_BIAS_CTRL */
  1491. u32 afe_bias_control;
  1492. u32 reserved_0004;
  1493. /* 0x0008 AFE_PLL_CTRL0 */
  1494. u32 afe_pll_control0;
  1495. /* 0x000c AFE_PLL_CTRL1 */
  1496. u32 afe_pll_control1;
  1497. /* 0x0010 AFE_PLL_CTRL2 */
  1498. u32 afe_pll_control2;
  1499. /* 0x0014 AFE_CB_STS */
  1500. u32 afe_common_block_status;
  1501. /* 0x0018-0x007c */
  1502. u32 reserved_18_7c[0x1a];
  1503. /* 0x0080 AFE_PMSN_MCTRL0 */
  1504. u32 afe_pmsn_master_control0;
  1505. /* 0x0084 AFE_PMSN_MCTRL1 */
  1506. u32 afe_pmsn_master_control1;
  1507. /* 0x0088 AFE_PMSN_MCTRL2 */
  1508. u32 afe_pmsn_master_control2;
  1509. /* 0x008C-0x00fc */
  1510. u32 reserved_008c_00fc[0x1D];
  1511. /* 0x0100 AFE_DFX_MST_CTRL0 */
  1512. u32 afe_dfx_master_control0;
  1513. /* 0x0104 AFE_DFX_MST_CTRL1 */
  1514. u32 afe_dfx_master_control1;
  1515. /* 0x0108 AFE_DFX_DCL_CTRL */
  1516. u32 afe_dfx_dcl_control;
  1517. /* 0x010c AFE_DFX_DMON_CTRL */
  1518. u32 afe_dfx_digital_monitor_control;
  1519. /* 0x0110 AFE_DFX_AMONP_CTRL */
  1520. u32 afe_dfx_analog_p_monitor_control;
  1521. /* 0x0114 AFE_DFX_AMONN_CTRL */
  1522. u32 afe_dfx_analog_n_monitor_control;
  1523. /* 0x0118 AFE_DFX_NTL_STS */
  1524. u32 afe_dfx_ntl_status;
  1525. /* 0x011c AFE_DFX_FIFO_STS0 */
  1526. u32 afe_dfx_fifo_status0;
  1527. /* 0x0120 AFE_DFX_FIFO_STS1 */
  1528. u32 afe_dfx_fifo_status1;
  1529. /* 0x0124 AFE_DFX_MPAT_CTRL */
  1530. u32 afe_dfx_master_pattern_control;
  1531. /* 0x0128 AFE_DFX_P0_CTRL */
  1532. u32 afe_dfx_p0_control;
  1533. /* 0x012c-0x01a8 AFE_DFX_P0_DRx */
  1534. u32 afe_dfx_p0_data[32];
  1535. /* 0x01ac */
  1536. u32 reserved_01ac;
  1537. /* 0x01b0-0x020c AFE_DFX_P0_IRx */
  1538. u32 afe_dfx_p0_instruction[24];
  1539. /* 0x0210 */
  1540. u32 reserved_0210;
  1541. /* 0x0214 AFE_DFX_P1_CTRL */
  1542. u32 afe_dfx_p1_control;
  1543. /* 0x0218-0x245 AFE_DFX_P1_DRx */
  1544. u32 afe_dfx_p1_data[16];
  1545. /* 0x0258-0x029c */
  1546. u32 reserved_0258_029c[0x12];
  1547. /* 0x02a0-0x02bc AFE_DFX_P1_IRx */
  1548. u32 afe_dfx_p1_instruction[8];
  1549. /* 0x02c0-0x2fc */
  1550. u32 reserved_02c0_02fc[0x10];
  1551. /* 0x0300 AFE_DFX_TX_PMSN_CTRL */
  1552. u32 afe_dfx_tx_pmsn_control;
  1553. /* 0x0304 AFE_DFX_RX_PMSN_CTRL */
  1554. u32 afe_dfx_rx_pmsn_control;
  1555. u32 reserved_0308;
  1556. /* 0x030c AFE_DFX_NOA_CTRL0 */
  1557. u32 afe_dfx_noa_control0;
  1558. /* 0x0310 AFE_DFX_NOA_CTRL1 */
  1559. u32 afe_dfx_noa_control1;
  1560. /* 0x0314 AFE_DFX_NOA_CTRL2 */
  1561. u32 afe_dfx_noa_control2;
  1562. /* 0x0318 AFE_DFX_NOA_CTRL3 */
  1563. u32 afe_dfx_noa_control3;
  1564. /* 0x031c AFE_DFX_NOA_CTRL4 */
  1565. u32 afe_dfx_noa_control4;
  1566. /* 0x0320 AFE_DFX_NOA_CTRL5 */
  1567. u32 afe_dfx_noa_control5;
  1568. /* 0x0324 AFE_DFX_NOA_CTRL6 */
  1569. u32 afe_dfx_noa_control6;
  1570. /* 0x0328 AFE_DFX_NOA_CTRL7 */
  1571. u32 afe_dfx_noa_control7;
  1572. /* 0x032c-0x07fc */
  1573. u32 reserved_032c_07fc[0x135];
  1574. /* 0x0800-0x0bfc */
  1575. struct scu_afe_transceiver scu_afe_xcvr[4];
  1576. /* 0x0c00-0x0ffc */
  1577. u32 reserved_0c00_0ffc[0x0100];
  1578. };
  1579. struct scu_protocol_engine_group_registers {
  1580. u32 table[0xE0];
  1581. };
  1582. struct scu_viit_iit {
  1583. u32 table[256];
  1584. };
  1585. /**
  1586. * Placeholder for the ZONE Partition Table information ZONING will not be
  1587. * included in the 1.1 release.
  1588. *
  1589. *
  1590. */
  1591. struct scu_zone_partition_table {
  1592. u32 table[2048];
  1593. };
  1594. /**
  1595. * Placeholder for the CRAM register since I am not sure if we need to
  1596. * read/write to these registers as yet.
  1597. *
  1598. *
  1599. */
  1600. struct scu_completion_ram {
  1601. u32 ram[128];
  1602. };
  1603. /**
  1604. * Placeholder for the FBRAM registers since I am not sure if we need to
  1605. * read/write to these registers as yet.
  1606. *
  1607. *
  1608. */
  1609. struct scu_frame_buffer_ram {
  1610. u32 ram[128];
  1611. };
  1612. #define scu_scratch_ram_SIZE_IN_DWORDS 256
  1613. /**
  1614. * Placeholder for the scratch RAM registers.
  1615. *
  1616. *
  1617. */
  1618. struct scu_scratch_ram {
  1619. u32 ram[scu_scratch_ram_SIZE_IN_DWORDS];
  1620. };
  1621. /**
  1622. * Placeholder since I am not yet sure what these registers are here for.
  1623. *
  1624. *
  1625. */
  1626. struct noa_protocol_engine_partition {
  1627. u32 reserved[64];
  1628. };
  1629. /**
  1630. * Placeholder since I am not yet sure what these registers are here for.
  1631. *
  1632. *
  1633. */
  1634. struct noa_hub_partition {
  1635. u32 reserved[64];
  1636. };
  1637. /**
  1638. * Placeholder since I am not yet sure what these registers are here for.
  1639. *
  1640. *
  1641. */
  1642. struct noa_host_interface_partition {
  1643. u32 reserved[64];
  1644. };
  1645. /**
  1646. * struct transport_link_layer_pair - The SCU Hardware pairs up the TL
  1647. * registers with the LL registers so we must place them adjcent to make the
  1648. * array of registers in the PEG.
  1649. *
  1650. *
  1651. */
  1652. struct transport_link_layer_pair {
  1653. struct scu_transport_layer_registers tl;
  1654. struct scu_link_layer_registers ll;
  1655. };
  1656. /**
  1657. * struct scu_peg_registers - SCU Protocol Engine Memory mapped register space.
  1658. * These registers are unique to each protocol engine group. There can be
  1659. * at most two PEG for a single SCU part.
  1660. *
  1661. *
  1662. */
  1663. struct scu_peg_registers {
  1664. struct transport_link_layer_pair pe[4];
  1665. struct scu_port_task_scheduler_group_registers ptsg;
  1666. struct scu_protocol_engine_group_registers peg;
  1667. struct scu_sgpio_registers sgpio;
  1668. u32 reserved_01500_1BFF[0x1C0];
  1669. struct scu_viit_entry viit[64];
  1670. struct scu_zone_partition_table zpt0;
  1671. struct scu_zone_partition_table zpt1;
  1672. };
  1673. /**
  1674. * struct scu_registers - SCU regsiters including both PEG registers if we turn
  1675. * on that compile option. All of these registers are in the memory mapped
  1676. * space returned from BAR1.
  1677. *
  1678. *
  1679. */
  1680. struct scu_registers {
  1681. /* 0x0000 - PEG 0 */
  1682. struct scu_peg_registers peg0;
  1683. /* 0x6000 - SDMA and Miscellaneous */
  1684. struct scu_sdma_registers sdma;
  1685. struct scu_completion_ram cram;
  1686. struct scu_frame_buffer_ram fbram;
  1687. u32 reserved_6800_69FF[0x80];
  1688. struct noa_protocol_engine_partition noa_pe;
  1689. struct noa_hub_partition noa_hub;
  1690. struct noa_host_interface_partition noa_if;
  1691. u32 reserved_6d00_7fff[0x4c0];
  1692. /* 0x8000 - PEG 1 */
  1693. struct scu_peg_registers peg1;
  1694. /* 0xE000 - AFE Registers */
  1695. struct scu_afe_registers afe;
  1696. /* 0xF000 - reserved */
  1697. u32 reserved_f000_211fff[0x80c00];
  1698. /* 0x212000 - scratch RAM */
  1699. struct scu_scratch_ram scratch_ram;
  1700. };
  1701. #endif /* _SCU_REGISTERS_HEADER_ */