cmtt1pos.h
上传用户:qiulin1960
上传日期:2013-10-16
资源大小:2844k
文件大小:27k
源码类别:

Windows CE

开发平台:

Windows_Unix

  1. /*++
  2. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3. ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4. THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5. PARTICULAR PURPOSE.
  6. Copyright (c) 1995-2000 Microsoft Corporation.  All rights reserved.
  7. Module Name:  
  8.   cmtt1pos.h
  9. Abstract:  
  10. this file provides headers for R3910 specific
  11.     functionality specific to cmtt1 E1 engineering build
  12.   
  13. Functions:
  14.   
  15. Notes:
  16. Revision History:
  17. --*/
  18. #ifndef _cmtt1pos_h_
  19. #define _cmtt1pos_h_
  20. #include "poseidon.h"
  21. /* Cmtt1 Interrupt ID's */
  22. #define kSIBSoundHalfInterrupt kSoundHalfInterrupt
  23. #define kSIBSoundFullInterrupt kSoundFullInterrupt
  24. #define kSIBTelHalfInterrupt kTelHalfInterrupt
  25. #define kSIBTelFullInterrupt kTelFullInterrupt
  26. #define kSIBSF0Interrupt kSIBsf0Interrupt
  27. #define kSIBSF1Interrupt kSIBsf1Interrupt
  28. //#define kSIBPositiveInterrupt kSIBPositiveInterrupt
  29. #define kSIBRingDetectPosInterrupt kmfioPositiveInterrupt0
  30. #define kSerialRXInterrupt kUARTARXInterrupt
  31. #define kSerialTXInterrupt kUARTATXInterrupt
  32. #define kSerialDMAFullInterrupt kUARTADMAFullInterrupt
  33. #define kSerialDMAHalfInterrupt kUARTADMAHalfInterrupt
  34. #define kSerialCTSNegInterrupt kmfioNegativeInterrupt30
  35. #define kSerialCTSPosInterrupt kmfioPositiveInterrupt30
  36. #define kSerialDCDNegInterrupt kioNegativeInterrupt4
  37. #define kSerialDCDPosInterrupt kioPositiveInterrupt4
  38. #define kIrDARXInterrupt kUARTBRXInterrupt
  39. #define kIrDATXInterrupt kUARTBTXInterrupt
  40. #define kIrDADMAFullInterrupt kUARTBDMAFullInterrupt
  41. #define kIrDADMAHalfInterrupt kUARTBDMAHalfInterrupt
  42. #define kBatteryACPosInterrupt kPositivePowerInterrupt
  43. #define kBatteryACNegInterrupt kNegativePowerInterrupt
  44. //#define kMagicBusTXBufferAvailableInterrupt kMagicBusTXBufferAvailableInterrupt
  45. //#define kMagicBusTXErrorInterrupt kMagicBusTXErrorInterrupt
  46. //#define kMagicBusEmptyInterrupt kMagicBusEmptyInterrupt
  47. //#define kMagicBusRXErrorInterrupt kMagicBusRXErrorInterrupt
  48. #define kMagicBusCmdDetInterrupt kMagicBusDetInterrupt
  49. //#define kMagicBusDMAFullInterrupt kMagicBusDMAFullInterrupt
  50. //#define kMagicBusPositiveInterrupt kMagicBusPositiveInterrupt
  51. //#define kMagicBusNegativeInterrupt kMagicBusNegativeInterrupt
  52. #define kMiniCard2BusyPosInterrupt kmfioPositiveInterrupt28
  53. #define kMiniCard1DetectNegInterrupt kioNegativeInterrupt6
  54. #define kMiniCard1DetectPosInterrupt kioPositiveInterrupt6
  55. #define kMiniCard2DetectNegInterrupt kioNegativeInterrupt5
  56. #define kMiniCard2DetectPosInterrupt kioPositiveInterrupt5
  57. #define kKeyboardAttentionNegInterrupt kmfioNegativeInterrupt1
  58. #define kKeyboardSPIInPosInterrupt kSPIrcvInterrupt
  59. #define kKeyboardOnButtonPosInterrupt kPositiveOnButtonInterrupt
  60. #define kMModulePosInterrupt kioPositiveInterrupt2
  61. #define kMModuleAttachedNegInterrupt kioNegativeInterrupt0
  62. #define kMModuleAttachedPosInterrupt kioPositiveInterrupt0
  63. #define kMModuleCardWaitPosInterrupt kmfioPositiveInterrupt4
  64. //#define kRTCInterrupt kRTCInterrupt
  65. //#define kAlarmInterrupt kAlarmInterrupt
  66. //#define kPeriodicInterrupt kPeriodicInterrupt
  67. /* Cmtt1 Interrupt Masks */
  68. #define kAudioSoundHalfMask kIntSoundDmaHalfMask
  69. #define kAudioSoundFullMask kIntSoundDmaEndMask
  70. #define kSIBTelHalfMask kIntTelDmaHalfMask
  71. #define kSIBTelFullMask kIntTelDmaEndMask
  72. #define kSIBSF0Mask kIntSibSubFrame0Mask
  73. #define kSIBSF1Mask kIntSibSubFrame1Mask
  74. #define kSIBPositiveMask kIntSibIrqPosMask
  75. #define kSIBRingDetectPosMask kIntMfio0PosMask
  76. #define kSerialRXMask kIntUartAReceiveMask
  77. #define kSerialTXMask kIntUartATransmitMask
  78. #define kSerialDMAFullMask kIntUartADmaEndMask
  79. #define kSerialDMAHalfMask kIntUartADmaHalfMask
  80. #define kSerialCTSNegMask kIntMfio30NegMask
  81. #define kSerialCTSPosMask kIntMfio30PosMask
  82. #define kSerialDCDNegMask kIntIOInt4NegMask
  83. #define kSerialDCDPosMask kIntIOInt4PosMask
  84. #define kIrDARXMask kIntUartBReceiveMask
  85. #define kIrDATXMask kIntUartBTransmitMask
  86. #define kIrDADMAFullMask kIntUartBDmaEndMask
  87. #define kIrDADMAHalfMask kIntUartBDmaHalfMask
  88. #define kBatteryACPosMask kIntPwrIntPosMask
  89. #define kBatteryACNegMask kIntPwrIntNegMask
  90. #define kMagicBusTXBufferAvailableMask kIntMbusTransmitMask
  91. #define kMagicBusTXErrorMask kIntMbusTxErrMask
  92. #define kMagicBusEmptyMask kIntMbusEmptyMask
  93. #define kMagicBusRXErrorMask kIntMbusRxErrMask
  94. #define kMagicBusCmdDetMask kIntMbusCmdDetectMask
  95. #define kMagicBusDMAFullMask kIntMbusDmaEndMask
  96. #define kMagicBusPositiveMask kIntMbusPosMask
  97. #define kMagicBusNegativeMask kIntMbusNegMask
  98. #define kMiniCard2BusyPosMask kIntMfio28PosMask
  99. #define kMiniCard1DetectNegMask kIntIOInt6NegMask
  100. #define kMiniCard1DetectPosMask kIntIOInt6PosMask
  101. #define kMiniCard2DetectNegMask kIntIOInt5NegMask
  102. #define kMiniCard2DetectPosMask kIntIOInt5PosMask
  103. #define kKeyboardAttentionNegMask kIntMfio1NegMask
  104. #define kKeyboardSPIInPosMask kIntSpiReceiveMask
  105. #define kKeyboardOnButtonPosMask kIntOnButPosMask
  106. #define kMModulePosMask kIntIOInt2PosMask
  107. #define kMModuleAttachedNegMask kIntIOInt0NegMask
  108. #define kMModuleAttachedPosMask kIntIOInt0PosMask
  109. #define kMModuleCardWaitPosMask kIntMfio4PosMask
  110. #define kRTCMask kIntRTCRolloverMask
  111. #define kAlarmMask kIntRTCAlarmMask
  112. #define kPeriodicMask kIntPeriodicTimerMask
  113. /* SSP: add the following for power.*/
  114. #define kRescheduleMask                                                 kIntVideoFrameMask
  115. #define kTouchSampleMask                                                kIntVideoDFMask
  116. #define kVidDoneMask                                                    kIntIOInt2PosMask
  117. /* Cmtt1 Hig Priority Interrupt Masks */
  118. #define kMModuleAttachedNegPriorityMask 0x00000002 /* 1 */
  119. #define kMModuleAttachedPosPriorityMask 0x00000002 /* 1 */
  120. #define kMiniCard1DetectNegPriorityMask 0x00000040 /* 6 */
  121. #define kMiniCard1DetectPosPriorityMask 0x00000100 /* 8 */
  122. #define kMiniCard2DetectNegPriorityMask 0x00000040 /* 6 */
  123. #define kMiniCard2DetectPosPriorityMask 0x00000100 /* 8 */
  124. #define kCmtt1HighPriorityMask (kIntGlobalEnMask | kIntEnHighPwrOkMask | 
  125. kMModuleAttachedNegPriorityMask | kMModuleAttachedPosPriorityMask | 
  126. kMiniCard1DetectNegPriorityMask | kMiniCard1DetectPosPriorityMask | 
  127. kMiniCard2DetectNegPriorityMask | kMiniCard2DetectPosPriorityMask)
  128. /* Cmtt1 Standard Wake Interrupt Masks - "and" with current enable register contents */
  129. #define kCmtt1StdInterrupt1Wake 0
  130. #define kCmtt1StdInterrupt2Wake 0 //kMagicBusPositiveMask
  131. #define kCmtt1StdInterrupt3Wake 0 //SSP: kSIBRingDetectPosMask
  132. #define kCmtt1StdInterrupt4Wake 0 //SSP: kKeyboardAttentionNegMask
  133. #define kCmtt1StdInterrupt5Wake kIntOnButPosMask //SSP: (kSerialDCDPosMask | kKeyboardOnButtonPosMask | kRTCMask | kAlarmMask)
  134. #define kCmtt1StdInterrupt6Wake kIntGlobalEnMask
  135. #define kStandardShutdownCode 0xDABBFADD
  136. /* Cmtt1 Emergency Wake Interrupt Masks - set enable register contents to these values */
  137. #define kCmtt1EmergInterrupt1Wake 0
  138. #define kCmtt1EmergInterrupt2Wake 0
  139. #define kCmtt1EmergInterrupt3Wake 0
  140. #define kCmtt1EmergInterrupt4Wake 0
  141. #define kCmtt1EmergInterrupt5Wake kKeyboardOnButtonPosMask
  142. #define kCmtt1EmergInterrupt6Wake kIntGlobalEnMask
  143. #define kEmergencyShutdownCode 0xFEADDEAF
  144. /* Cmtt1 IO and MFIO Pin Masks */
  145. /***** Register Equates (PoseidonModule.ioControl) *****/
  146. #define kMiniCard1DetectDebounceMask kIODebounceSelect6Mask /* 30 */
  147. #define kMiniCard2DetectDebounceMask kIODebounceSelect5Mask /* 29 */
  148. #define kSerialDCDDebounceMask kIODebounceSelect4Mask /* 28 */
  149. #define kSerialDTRDebounceMask kIODebounceSelect3Mask /* 27 */
  150. #define kMModuleInterruptDebounceMask kIODebounceSelect2Mask /* 26 */
  151. #define kMModuleWakeDebounceMask kIODebounceSelect1Mask /* 25 */
  152. #define kMModuleAttachedDebounceMask kIODebounceSelect0Mask /* 24 */
  153. #define kMiniCard1DetectDirectionMask kIOOutputSelect6Mask /* 22 */
  154. #define kMiniCard2DetectDirectionMask kIOOutputSelect5Mask /* 21 */
  155. #define kSerialDCDDirectionMask kIOOutputSelect4Mask /* 20 */
  156. #define kSerialDTRDirectionMask kIOOutputSelect3Mask /* 19 */
  157. #define kMModuleInterruptDirectionMask kIOOutputSelect2Mask /* 18 */
  158. #define kMModuleWakeDirectionMask kIOOutputSelect1Mask /* 17 */
  159. #define kMModuleAttachedDirectionMask kIOOutputSelect0Mask /* 16 */
  160. #define kMiniCard1DetectDataOutMask kIODataOut6Mask /* 14 */
  161. #define kMiniCard2DetectDataOutMask kIODataOut5Mask /* 13 */
  162. #define kSerialDCDDataOutMask kIODataOut4Mask /* 12 */
  163. #define kSerialDTRDataOutMask kIODataOut3Mask /* 11 */
  164. #define kMModuleInterruptDataOutMask kIODataOut2Mask /* 10 */
  165. #define kMModuleWakeDataOutMask kIODataOut1Mask /* 9 */
  166. #define kMModuleAttachedDataOutMask kIODataOut0Mask /* 8 */
  167. #define kMiniCard1DetectDataInMask kIODataIn6Mask /* 6 */
  168. #define kMiniCard2DetectDataInMask kIODataIn5Mask /* 5 */
  169. #define kSerialDCDDataInMask kIODataIn4Mask /* 4 */
  170. #define kSerialDTRDataInMask kIODataIn3Mask /* 3 */
  171. #define kMModuleInterruptDataInMask kIODataIn2Mask /* 2 */
  172. #define kMModuleWakeDataInMask kIODataIn1Mask /* 1 */
  173. #define kMModuleAttachedDataInMask kIODataIn0Mask /* 0 */
  174. /***** Register Equates (PoseidonModule.ioPowerDown) *****/
  175. #define kMiniCard1DetectPowerDownMask kIOPowerDown6Mask /* 6 */
  176. #define kMiniCard2DetectPowerDownMask kIOPowerDown5Mask /* 5 */
  177. #define kSerialDCDPowerDownMask kIOPowerDown4Mask /* 4 */
  178. #define kSerialDTRPowerDownMask kIOPowerDown3Mask /* 3 */
  179. #define kMModuleInterruptPowerDownMask kIOPowerDown2Mask /* 2 */
  180. #define kMModuleWakePowerDownMask kIOPowerDown1Mask /* 1 */
  181. #define kMModuleAttachedPowerDownMask kIOPowerDown0Mask /* 0 */
  182. /***** Register Equates (PoseidonModule.mfioDataOutput) *****/
  183. #define kSerialRTSDataOutMask kIOMfioDataOut31Mask /* 31 */
  184. #define kSerialCTSDataOutMask kIOMfioDataOut30Mask /* 30 */
  185. #define kMiniCard2ResetDataOutMask kIOMfioDataOut29Mask /* 29 */
  186. #define kMiniCard2BusyDataOutMask kIOMfioDataOut28Mask /* 28 */
  187. #define kPowerVCC3DataOutMask kIOMfioDataOut27Mask /* 27 */
  188. #define kPowerDRAMVCCOnDataOutMask kIOMfioDataOut26Mask /* 26 */
  189. #define kDisplayVBacklightOnDataOutMask kIOMfioDataOut25Mask /* 25 */
  190. #define kMagicBusTXDataDataOutMask kIOMfioDataOut24Mask /* 24 */
  191. #define kMagicBusRXDataDataOutMask kIOMfioDataOut23Mask /* 23 */
  192. #define kMiniCard2MCCSDataOutMask kIOMfioDataOut22Mask /* 22 */
  193. #define kMModuleCS2DataOutMask kIOMfioDataOut21Mask /* 21 */
  194. #define kMiniCard1SDADataOutMask kIOMfioDataOut20Mask /* 20 */
  195. #define kMiniCard2SDADataOutMask kIOMfioDataOut19Mask /* 19 */
  196. #define kMiniCardSCLDataOutMask kIOMfioDataOut18Mask /* 18 */
  197. #define kDisplayVLCDOnDataOutMask kIOMfioDataOut17Mask /* 17 */
  198. #define kMagicBusVCCOnDataOutMask kIOMfioDataOut16Mask /* 16 */
  199. #define kKeyboardSPIClockDataOutMask kIOMfioDataOut15Mask /* 15 */
  200. #define kKeyboardSPIOutDataOutMask kIOMfioDataOut14Mask /* 14 */
  201. #define kKeyboardSPIInDataOutMask kIOMfioDataOut13Mask /* 13 */
  202. #define kFlashOnBoardDataOutMask kIOMfioDataOut12Mask /* 12 */
  203. #define kMModuleCardRegDataOutMask kIOMfioDataOut11Mask /* 11 */
  204. #define kMModuleCardIOWriteDataOutMask kIOMfioDataOut10Mask /* 10 */
  205. #define kMModuleCardIOReadDataOutMask kIOMfioDataOut9Mask /* 9 */
  206. #define kMModuleCardCSLDataOutMask kIOMfioDataOut8Mask /* 8 */
  207. #define kMModuleCardCSHDataOutMask kIOMfioDataOut7Mask /* 7 */
  208. #define kMModuleEnFlashRdDataOutMask kIOMfioDataOut6Mask /* 6 */
  209. #define kIrDAShutDownDataOutMask kIOMfioDataOut5Mask /* 5 */
  210. #define kMModuleCardWaitDataOutMask kIOMfioDataOut4Mask /* 4 */
  211. #define kKeyboardWakeDataOutMask kIOMfioDataOut3Mask /* 3 */
  212. #define kKeyboardResetDataOutMask kIOMfioDataOut2Mask /* 2 */
  213. #define kKeyboardAttentionDataOutMask kIOMfioDataOut1Mask /* 1 */
  214. #define kSIBRingDetectDataOutMask kIOMfioDataOut0Mask /* 0 */
  215. /***** Register Equates (PoseidonModule.mfioDirection) *****/
  216. #define kSerialRTSDirectionMask kIOMfioOutputSelect31Mask /* 31 */
  217. #define kSerialCTSDirectionMask kIOMfioOutputSelect30Mask /* 30 */
  218. #define kMiniCard2ResetDirectionMask kIOMfioOutputSelect29Mask /* 29 */
  219. #define kMiniCard2BusyDirectionMask kIOMfioOutputSelect28Mask /* 28 */
  220. #define kPowerVCC3DirectionMask kIOMfioOutputSelect27Mask /* 27 */
  221. #define kPowerDRAMVCCOnDirectionMask kIOMfioOutputSelect26Mask /* 26 */
  222. #define kDisplayVBacklightOnDirectionMask kIOMfioOutputSelect25Mask /* 25 */
  223. #define kMagicBusTXDataDirectionMask kIOMfioOutputSelect24Mask /* 24 */
  224. #define kMagicBusRXDataDirectionMask kIOMfioOutputSelect23Mask /* 23 */
  225. #define kMiniCard2MCCSDirectionMask kIOMfioOutputSelect22Mask /* 22 */
  226. #define kMModuleCS2DirectionMask kIOMfioOutputSelect21Mask /* 21 */
  227. #define kMiniCard1SDADirectionMask kIOMfioOutputSelect20Mask /* 20 */
  228. #define kMiniCard2SDADirectionMask kIOMfioOutputSelect19Mask /* 19 */
  229. #define kMiniCardSCLDirectionMask kIOMfioOutputSelect18Mask /* 18 */
  230. #define kDisplayVLCDOnDirectionMask kIOMfioOutputSelect17Mask /* 17 */
  231. #define kMagicBusVCCOnDirectionMask kIOMfioOutputSelect16Mask /* 16 */
  232. #define kKeyboardSPIClockDirectionMask kIOMfioOutputSelect15Mask /* 15 */
  233. #define kKeyboardSPIOutDirectionMask kIOMfioOutputSelect14Mask /* 14 */
  234. #define kKeyboardSPIInDirectionMask kIOMfioOutputSelect13Mask /* 13 */
  235. #define kFlashOnBoardDirectionMask kIOMfioOutputSelect12Mask /* 12 */
  236. #define kMModuleCardRegDirectionMask kIOMfioOutputSelect11Mask /* 11 */
  237. #define kMModuleCardIOWriteDirectionMask kIOMfioOutputSelect10Mask /* 10 */
  238. #define kMModuleCardIOReadDirectionMask kIOMfioOutputSelect9Mask /* 9 */
  239. #define kMModuleCardCSLDirectionMask kIOMfioOutputSelect8Mask /* 8 */
  240. #define kMModuleCardCSHDirectionMask kIOMfioOutputSelect7Mask /* 7 */
  241. #define kMModuleEnFlashRdDirectionMask kIOMfioOutputSelect6Mask /* 6 */
  242. #define kIrDAShutDownDirectionMask kIOMfioOutputSelect5Mask /* 5 */
  243. #define kMModuleCardWaitDirectionMask kIOMfioOutputSelect4Mask /* 4 */
  244. #define kKeyboardWakeDirectionMask kIOMfioOutputSelect3Mask /* 3 */
  245. #define kKeyboardResetDirectionMask kIOMfioOutputSelect2Mask /* 2 */
  246. #define kKeyboardAttentionDirectionMask kIOMfioOutputSelect1Mask /* 1 */
  247. #define kSIBRingDetectDirectionMask kIOMfioOutputSelect0Mask /* 0 */
  248. /***** Register Equates (PoseidonModule.mfioDataInput) *****/
  249. #define kSerialRTSDataInMask kIOMfioDataIn31Mask /* 31 */
  250. #define kSerialCTSDataInMask kIOMfioDataIn30Mask /* 30 */
  251. #define kMiniCard2ResetDataInMask kIOMfioDataIn29Mask /* 29 */
  252. #define kMiniCard2BusyDataInMask kIOMfioDataIn28Mask /* 28 */
  253. #define kPowerVCC3DataInMask kIOMfioDataIn27Mask /* 27 */
  254. #define kPowerDRAMVCCOnDataInMask kIOMfioDataIn26Mask /* 26 */
  255. #define kDisplayVBacklightOnDataInMask kIOMfioDataIn25Mask /* 25 */
  256. #define kMagicBusTXDataDataInMask kIOMfioDataIn24Mask /* 24 */
  257. #define kMagicBusRXDataDataInMask kIOMfioDataIn23Mask /* 23 */
  258. #define kMiniCard2MCCSDataInMask kIOMfioDataIn22Mask /* 22 */
  259. #define kMModuleCS2DataInMask kIOMfioDataIn21Mask /* 21 */
  260. #define kMiniCard1SDADataInMask kIOMfioDataIn20Mask /* 20 */
  261. #define kMiniCard2SDADataInMask kIOMfioDataIn19Mask /* 19 */
  262. #define kMiniCardSCLDataInMask kIOMfioDataIn18Mask /* 18 */
  263. #define kDisplayVLCDOnDataInMask kIOMfioDataIn17Mask /* 17 */
  264. #define kMagicBusVCCOnDataInMask kIOMfioDataIn16Mask /* 16 */
  265. #define kKeyboardSPIClockDataInMask kIOMfioDataIn15Mask /* 15 */
  266. #define kKeyboardSPIOutDataInMask kIOMfioDataIn14Mask /* 14 */
  267. #define kKeyboardSPIInDataInMask kIOMfioDataIn13Mask /* 13 */
  268. #define kFlashOnBoardDataInMask kIOMfioDataIn12Mask /* 12 */
  269. #define kMModuleCardRegDataInMask kIOMfioDataIn11Mask /* 11 */
  270. #define kMModuleCardIOWriteDataInMask kIOMfioDataIn10Mask /* 10 */
  271. #define kMModuleCardIOReadDataInMask kIOMfioDataIn9Mask /* 9 */
  272. #define kMModuleCardCSLDataInMask kIOMfioDataIn8Mask /* 8 */
  273. #define kMModuleCardCSHDataInMask kIOMfioDataIn7Mask /* 7 */
  274. #define kMModuleEnFlashRdDataInMask kIOMfioDataIn6Mask /* 6 */
  275. #define kIrDAShutDownDataInMask kIOMfioDataIn5Mask /* 5 */
  276. #define kMModuleCardWaitDataInMask kIOMfioDataIn4Mask /* 4 */
  277. #define kKeyboardWakeDataInMask kIOMfioDataIn3Mask /* 3 */
  278. #define kKeyboardResetDataInMask kIOMfioDataIn2Mask /* 2 */
  279. #define kKeyboardAttentionDataInMask kIOMfioDataIn1Mask /* 1 */
  280. #define kSIBRingDetectDataInMask kIOMfioDataIn0Mask /* 0 */
  281. /***** Register Equates (PoseidonModule.mfioSelect) *****/
  282. #define kSerialRTSSelectMask kIOMfioSelect31Mask /* 31 */
  283. #define kSerialCTSSelectMask kIOMfioSelect30Mask /* 30 */
  284. #define kMiniCard2ResetSelectMask kIOMfioSelect29Mask /* 29 */
  285. #define kMiniCard2BusySelectMask kIOMfioSelect28Mask /* 28 */
  286. #define kPowerVCC3SelectMask kIOMfioSelect27Mask /* 27 */
  287. #define kPowerDRAMVCCOnSelectMask kIOMfioSelect26Mask /* 26 */
  288. #define kDisplayVBacklightOnSelectMask kIOMfioSelect25Mask /* 25 */
  289. #define kMagicBusTXDataSelectMask kIOMfioSelect24Mask /* 24 */
  290. #define kMagicBusRXDataSelectMask kIOMfioSelect23Mask /* 23 */
  291. #define kMiniCard2MCCSSelectMask kIOMfioSelect22Mask /* 22 */
  292. #define kMModuleCS2SelectMask kIOMfioSelect21Mask /* 21 */
  293. #define kMiniCard1SDASelectMask kIOMfioSelect20Mask /* 20 */
  294. #define kMiniCard2SDASelectMask kIOMfioSelect19Mask /* 19 */
  295. #define kMiniCardSCLSelectMask kIOMfioSelect18Mask /* 18 */
  296. #define kDisplayVLCDOnSelectMask kIOMfioSelect17Mask /* 17 */
  297. #define kMagicBusVCCOnSelectMask kIOMfioSelect16Mask /* 16 */
  298. #define kKeyboardSPIClockSelectMask kIOMfioSelect15Mask /* 15 */
  299. #define kKeyboardSPIOutSelectMask kIOMfioSelect14Mask /* 14 */
  300. #define kKeyboardSPIInSelectMask kIOMfioSelect13Mask /* 13 */
  301. #define kFlashOnBoardSelectMask kIOMfioSelect12Mask /* 12 */
  302. #define kMModuleCardRegSelectMask kIOMfioSelect11Mask /* 11 */
  303. #define kMModuleCardIOWriteSelectMask kIOMfioSelect10Mask /* 10 */
  304. #define kMModuleCardIOReadSelectMask kIOMfioSelect9Mask /* 9 */
  305. #define kMModuleCardCSLSelectMask kIOMfioSelect8Mask /* 8 */
  306. #define kMModuleCardCSHSelectMask kIOMfioSelect7Mask /* 7 */
  307. #define kMModuleEnFlashRdSelectMask kIOMfioSelect6Mask /* 6 */
  308. #define kIrDAShutDownSelectMask kIOMfioSelect5Mask /* 5 */
  309. #define kMModuleCardWaitSelectMask kIOMfioSelect4Mask /* 4 */
  310. #define kKeyboardWakeSelectMask kIOMfioSelect3Mask /* 3 */
  311. #define kKeyboardResetSelectMask kIOMfioSelect2Mask /* 2 */
  312. #define kKeyboardAttentionSelectMask kIOMfioSelect1Mask /* 1 */
  313. #define kSIBRingDetectSelectMask kIOMfioSelect0Mask /* 0 */
  314. /***** Register Equates (PoseidonModule.mfioPowerDown) *****/
  315. #define kSerialRTSPowerDownMask kIOMfioPowerDown31Mask /* 31 */
  316. #define kSerialCTSPowerDownMask kIOMfioPowerDown30Mask /* 30 */
  317. #define kMiniCard2ResetPowerDownMask kIOMfioPowerDown29Mask /* 29 */
  318. #define kMiniCard2BusyPowerDownMask kIOMfioPowerDown28Mask /* 28 */
  319. #define kPowerVCC3PowerDownMask kIOMfioPowerDown27Mask /* 27 */
  320. #define kPowerDRAMVCCOnPowerDownMask kIOMfioPowerDown26Mask /* 26 */
  321. #define kDisplayVBacklightOnPowerDownMask kIOMfioPowerDown25Mask /* 25 */
  322. #define kMagicBusTXDataPowerDownMask kIOMfioPowerDown24Mask /* 24 */
  323. #define kMagicBusRXDataPowerDownMask kIOMfioPowerDown23Mask /* 23 */
  324. #define kMiniCard2MCCSPowerDownMask kIOMfioPowerDown22Mask /* 22 */
  325. #define kMModuleCS2PowerDownMask kIOMfioPowerDown21Mask /* 21 */
  326. #define kMiniCard1SDAPowerDownMask kIOMfioPowerDown20Mask /* 20 */
  327. #define kMiniCard2SDAPowerDownMask kIOMfioPowerDown19Mask /* 19 */
  328. #define kMiniCardSCLPowerDownMask kIOMfioPowerDown18Mask /* 18 */
  329. #define kDisplayVLCDOnPowerDownMask kIOMfioPowerDown17Mask /* 17 */
  330. #define kMagicBusVCCOnPowerDownMask kIOMfioPowerDown16Mask /* 16 */
  331. #define kKeyboardSPIClockPowerDownMask kIOMfioPowerDown15Mask /* 15 */
  332. #define kKeyboardSPIOutPowerDownMask kIOMfioPowerDown14Mask /* 14 */
  333. #define kKeyboardSPIInPowerDownMask kIOMfioPowerDown13Mask /* 13 */
  334. #define kFlashOnBoardPowerDownMask kIOMfioPowerDown12Mask /* 12 */
  335. #define kMModuleCardRegPowerDownMask kIOMfioPowerDown11Mask /* 11 */
  336. #define kMModuleCardIOWritePowerDownMask kIOMfioPowerDown10Mask /* 10 */
  337. #define kMModuleCardIOReadPowerDownMask kIOMfioPowerDown9Mask /* 9 */
  338. #define kMModuleCardCSLPowerDownMask kIOMfioPowerDown8Mask /* 8 */
  339. #define kMModuleCardCSHPowerDownMask kIOMfioPowerDown7Mask /* 7 */
  340. #define kMModuleEnFlashRdPowerDownMask kIOMfioPowerDown6Mask /* 6 */
  341. #define kIrDAShutDownPowerDownMask kIOMfioPowerDown5Mask /* 5 */
  342. #define kMModuleCardWaitPowerDownMask kIOMfioPowerDown4Mask /* 4 */
  343. #define kKeyboardWakePowerDownMask kIOMfioPowerDown3Mask /* 3 */
  344. #define kKeyboardResetPowerDownMask kIOMfioPowerDown2Mask /* 2 */
  345. #define kKeyboardAttentionPowerDownMask kIOMfioPowerDown1Mask /* 1 */
  346. #define kSIBRingDetectPowerDownMask kIOMfioPowerDown0Mask /* 0 */
  347. /* Cmtt1 Default IO and MFIO Masks */
  348. #define kCmtt1IOControlDefaultMask (kSerialDTRDirectionMask | kMModuleWakeDirectionMask | kSerialDTRDataOutMask)
  349. #define kCmtt1IOPowerDownDefaultMask (kMiniCard1DetectPowerDownMask | kMiniCard2DetectPowerDownMask | 
  350. kSerialDTRPowerDownMask | kMModuleInterruptPowerDownMask | 
  351. kMModuleWakePowerDownMask | kMModuleAttachedPowerDownMask)
  352. #define kCmtt1MFIODataOutputDefaultMask (kMiniCard2ResetDataOutMask | kPowerDRAMVCCOnDataOutMask | 
  353. kKeyboardWakeDataOutMask | kKeyboardResetDataOutMask | 
  354. kDisplayVLCDOnDataOutMask | kSerialRTSDataOutMask)
  355. #define kCmtt1MFIODirectionDefaultMask (kSerialRTSDirectionMask | 
  356. kMiniCard2ResetDirectionMask | kMiniCard2BusyDirectionMask | 
  357. kPowerDRAMVCCOnDirectionMask | kDisplayVBacklightOnDirectionMask | 
  358. kIrDAShutDownDirectionMask | kMiniCard1SDADirectionMask | 
  359. kMiniCard2SDADirectionMask | kMiniCardSCLDirectionMask | 
  360. kDisplayVLCDOnDirectionMask | kMagicBusVCCOnDirectionMask | 
  361. kKeyboardResetDirectionMask)
  362. #define kCmtt1MFIOSelectDefaultMask (kSerialCTSSelectMask | kSerialRTSSelectMask | 
  363. kMiniCard2ResetSelectMask | kMiniCard2BusySelectMask | 
  364. kPowerDRAMVCCOnSelectMask | kDisplayVBacklightOnSelectMask | 
  365. kIrDAShutDownSelectMask | kMiniCard1SDASelectMask | 
  366. kMiniCard2SDASelectMask | kMiniCardSCLSelectMask | 
  367. kDisplayVLCDOnSelectMask | kMagicBusVCCOnSelectMask | 
  368. kFlashOnBoardSelectMask | kMModuleEnFlashRdSelectMask | 
  369. kMModuleCardWaitSelectMask | kKeyboardWakeSelectMask | 
  370. kKeyboardResetSelectMask | kKeyboardAttentionSelectMask | 
  371. kSIBRingDetectSelectMask | kPowerVCC3SelectMask)
  372. #define kCmtt1MFIOPowerDownDefaultMask (kSerialCTSPowerDownMask | kSerialRTSPowerDownMask | 
  373. kMiniCard2ResetPowerDownMask | kMiniCard2BusyPowerDownMask | 
  374. kDisplayVBacklightOnPowerDownMask | kMagicBusTXDataPowerDownMask | 
  375. kMagicBusRXDataPowerDownMask | kIrDAShutDownPowerDownMask | 
  376. kMModuleCS2PowerDownMask | kMiniCard1SDAPowerDownMask | 
  377. kMiniCard2SDAPowerDownMask | kMiniCardSCLPowerDownMask | 
  378. kDisplayVLCDOnPowerDownMask | kFlashOnBoardPowerDownMask | 
  379. kMModuleCardRegPowerDownMask | kMModuleCardIOWritePowerDownMask | 
  380. kMModuleCardIOReadPowerDownMask | kMModuleCardCSLPowerDownMask | 
  381. kMModuleCardCSHPowerDownMask | kMModuleEnFlashRdPowerDownMask | 
  382. kMiniCard2MCCSPowerDownMask | kMModuleCardWaitPowerDownMask)
  383. #ifdef ASM_ONLY
  384. // uses a0, a1, v0, v1; returns rtcLow in v0 and rtcHigh in v1
  385. // must be called with .set noreorder
  386. // label 19 = Ripple
  387. #define ReadRTCNoRippleASM
  388. li a0, kPoseidonModuleAddress;
  389. lw a1, PoseidonModule_rtcLow(a0);
  390. 19:;
  391. lw v1, PoseidonModule_rtcHigh(a0);
  392. lw v0, PoseidonModule_rtcLow(a0);
  393. and v1, 0x000000ff;
  394. bne a1, v0, 19b;
  395. lw a1, PoseidonModule_rtcLow(a0);
  396. // uses a0, a1, a2, a3, v0, v1; ticks passed in a0; returns final rtcLow in v0 and rtcHigh in v1
  397. // must be called with .set noreorder
  398. // label 31 = WaitHighRoll; label 23 = SkipHighRoll; label 35 = LowReadLoop
  399. #define DelayRTCTicksNoRippleASM
  400. move a2, a0;
  401. ReadRTCNoRippleASM;
  402. li a3, 0xffffffff;
  403. subu a3, v0;
  404. bleu a2, a3, 23f;
  405. nop;
  406. subu a2, a3;
  407. move a3, v1;
  408. 31:;
  409. ReadRTCNoRippleASM;
  410. beq v1, a3, 31b;
  411. nop;
  412. 23:;
  413. move a3, v0;
  414. addu a3, a2;
  415. 35:;
  416. ReadRTCNoRippleASM;
  417. bltu v0, a3, 35b;
  418. nop;
  419. #else
  420. /*
  421.  * Get the current RTC, avoiding ripple.  We know that if we
  422.  * sandwich a read of rtcHigh between two consistent reads of
  423.  * rtcLow, we have a non-rippling, consistent rtcHigh.
  424.  */
  425. #define ReadRTCNoRipple(poseidonModule, rtcLowVal, rtcHighVal)
  426. {
  427. do {
  428. rtcLowVal = poseidonModule->rtcLow;
  429. rtcHighVal = poseidonModule->rtcHigh & 0x000000ff;
  430. } while (rtcLowVal != poseidonModule->rtcLow);
  431. }
  432. #define DelayRTCTicksNoRipple(poseidonModule, ticks)
  433. {
  434. ULONG rtcLowVal, rtcHighVal, ticks2, temp;
  435. ReadRTCNoRipple(poseidonModule, rtcLowVal, rtcHighVal);
  436. temp = (ULONG)0xffffffff - rtcLowVal;
  437. ticks2 = ticks;
  438. if (temp < ticks2) {
  439. ticks2 -= temp;
  440. temp = rtcHighVal;
  441. do {
  442. ReadRTCNoRipple(poseidonModule, rtcLowVal, rtcHighVal);
  443. } while (rtcHighVal == temp);
  444. }
  445. temp = rtcLowVal + ticks2;
  446. do {
  447. ReadRTCNoRipple(poseidonModule, rtcLowVal, rtcHighVal);
  448. } while (rtcLowVal  < temp);
  449. }
  450. #endif
  451. /*
  452.  * Miscellaneous I/O
  453.  */
  454. #define kIOResetBettyOffMask kIREnRXPwrMask /* This mask is for PoseidonModule.irControl1 */
  455. /* 
  456.  * Macros
  457.  */
  458. #define AssertBettyResetSignal() 
  459. poseidonHw->irControl1 &= ~kIOResetBettyOffMask;
  460. #define DeAssertBettyResetSignal() 
  461. poseidonHw->irControl1 |= kIOResetBettyOffMask;
  462. #endif