ocd.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. /*
  2. * AVR32 OCD Interface and register definitions
  3. *
  4. * Copyright (C) 2004-2007 Atmel Corporation
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __ASM_AVR32_OCD_H
  11. #define __ASM_AVR32_OCD_H
  12. /* OCD Register offsets. Abbreviations used below:
  13. *
  14. * BP Breakpoint
  15. * Comm Communication
  16. * DT Data Trace
  17. * PC Program Counter
  18. * PID Process ID
  19. * R/W Read/Write
  20. * WP Watchpoint
  21. */
  22. #define OCD_DID 0x0000 /* Device ID */
  23. #define OCD_DC 0x0008 /* Development Control */
  24. #define OCD_DS 0x0010 /* Development Status */
  25. #define OCD_RWCS 0x001c /* R/W Access Control */
  26. #define OCD_RWA 0x0024 /* R/W Access Address */
  27. #define OCD_RWD 0x0028 /* R/W Access Data */
  28. #define OCD_WT 0x002c /* Watchpoint Trigger */
  29. #define OCD_DTC 0x0034 /* Data Trace Control */
  30. #define OCD_DTSA0 0x0038 /* DT Start Addr Channel 0 */
  31. #define OCD_DTSA1 0x003c /* DT Start Addr Channel 1 */
  32. #define OCD_DTEA0 0x0048 /* DT End Addr Channel 0 */
  33. #define OCD_DTEA1 0x004c /* DT End Addr Channel 1 */
  34. #define OCD_BWC0A 0x0058 /* PC BP/WP Control 0A */
  35. #define OCD_BWC0B 0x005c /* PC BP/WP Control 0B */
  36. #define OCD_BWC1A 0x0060 /* PC BP/WP Control 1A */
  37. #define OCD_BWC1B 0x0064 /* PC BP/WP Control 1B */
  38. #define OCD_BWC2A 0x0068 /* PC BP/WP Control 2A */
  39. #define OCD_BWC2B 0x006c /* PC BP/WP Control 2B */
  40. #define OCD_BWC3A 0x0070 /* Data BP/WP Control 3A */
  41. #define OCD_BWC3B 0x0074 /* Data BP/WP Control 3B */
  42. #define OCD_BWA0A 0x0078 /* PC BP/WP Address 0A */
  43. #define OCD_BWA0B 0x007c /* PC BP/WP Address 0B */
  44. #define OCD_BWA1A 0x0080 /* PC BP/WP Address 1A */
  45. #define OCD_BWA1B 0x0084 /* PC BP/WP Address 1B */
  46. #define OCD_BWA2A 0x0088 /* PC BP/WP Address 2A */
  47. #define OCD_BWA2B 0x008c /* PC BP/WP Address 2B */
  48. #define OCD_BWA3A 0x0090 /* Data BP/WP Address 3A */
  49. #define OCD_BWA3B 0x0094 /* Data BP/WP Address 3B */
  50. #define OCD_NXCFG 0x0100 /* Nexus Configuration */
  51. #define OCD_DINST 0x0104 /* Debug Instruction */
  52. #define OCD_DPC 0x0108 /* Debug Program Counter */
  53. #define OCD_CPUCM 0x010c /* CPU Control Mask */
  54. #define OCD_DCCPU 0x0110 /* Debug Comm CPU */
  55. #define OCD_DCEMU 0x0114 /* Debug Comm Emulator */
  56. #define OCD_DCSR 0x0118 /* Debug Comm Status */
  57. #define OCD_PID 0x011c /* Ownership Trace PID */
  58. #define OCD_EPC0 0x0120 /* Event Pair Control 0 */
  59. #define OCD_EPC1 0x0124 /* Event Pair Control 1 */
  60. #define OCD_EPC2 0x0128 /* Event Pair Control 2 */
  61. #define OCD_EPC3 0x012c /* Event Pair Control 3 */
  62. #define OCD_AXC 0x0130 /* AUX port Control */
  63. /* Bits in DID */
  64. #define OCD_DID_MID_START 1
  65. #define OCD_DID_MID_SIZE 11
  66. #define OCD_DID_PN_START 12
  67. #define OCD_DID_PN_SIZE 16
  68. #define OCD_DID_RN_START 28
  69. #define OCD_DID_RN_SIZE 4
  70. /* Bits in DC */
  71. #define OCD_DC_TM_START 0
  72. #define OCD_DC_TM_SIZE 2
  73. #define OCD_DC_EIC_START 3
  74. #define OCD_DC_EIC_SIZE 2
  75. #define OCD_DC_OVC_START 5
  76. #define OCD_DC_OVC_SIZE 3
  77. #define OCD_DC_SS_BIT 8
  78. #define OCD_DC_DBR_BIT 12
  79. #define OCD_DC_DBE_BIT 13
  80. #define OCD_DC_EOS_START 20
  81. #define OCD_DC_EOS_SIZE 2
  82. #define OCD_DC_SQA_BIT 22
  83. #define OCD_DC_IRP_BIT 23
  84. #define OCD_DC_IFM_BIT 24
  85. #define OCD_DC_TOZ_BIT 25
  86. #define OCD_DC_TSR_BIT 26
  87. #define OCD_DC_RID_BIT 27
  88. #define OCD_DC_ORP_BIT 28
  89. #define OCD_DC_MM_BIT 29
  90. #define OCD_DC_RES_BIT 30
  91. #define OCD_DC_ABORT_BIT 31
  92. /* Bits in DS */
  93. #define OCD_DS_SSS_BIT 0
  94. #define OCD_DS_SWB_BIT 1
  95. #define OCD_DS_HWB_BIT 2
  96. #define OCD_DS_HWE_BIT 3
  97. #define OCD_DS_STP_BIT 4
  98. #define OCD_DS_DBS_BIT 5
  99. #define OCD_DS_BP_START 8
  100. #define OCD_DS_BP_SIZE 8
  101. #define OCD_DS_INC_BIT 24
  102. #define OCD_DS_BOZ_BIT 25
  103. #define OCD_DS_DBA_BIT 26
  104. #define OCD_DS_EXB_BIT 27
  105. #define OCD_DS_NTBF_BIT 28
  106. /* Bits in RWCS */
  107. #define OCD_RWCS_DV_BIT 0
  108. #define OCD_RWCS_ERR_BIT 1
  109. #define OCD_RWCS_CNT_START 2
  110. #define OCD_RWCS_CNT_SIZE 14
  111. #define OCD_RWCS_CRC_BIT 19
  112. #define OCD_RWCS_NTBC_START 20
  113. #define OCD_RWCS_NTBC_SIZE 2
  114. #define OCD_RWCS_NTE_BIT 22
  115. #define OCD_RWCS_NTAP_BIT 23
  116. #define OCD_RWCS_WRAPPED_BIT 24
  117. #define OCD_RWCS_CCTRL_START 25
  118. #define OCD_RWCS_CCTRL_SIZE 2
  119. #define OCD_RWCS_SZ_START 27
  120. #define OCD_RWCS_SZ_SIZE 3
  121. #define OCD_RWCS_RW_BIT 30
  122. #define OCD_RWCS_AC_BIT 31
  123. /* Bits in RWA */
  124. #define OCD_RWA_RWA_START 0
  125. #define OCD_RWA_RWA_SIZE 32
  126. /* Bits in RWD */
  127. #define OCD_RWD_RWD_START 0
  128. #define OCD_RWD_RWD_SIZE 32
  129. /* Bits in WT */
  130. #define OCD_WT_DTE_START 20
  131. #define OCD_WT_DTE_SIZE 3
  132. #define OCD_WT_DTS_START 23
  133. #define OCD_WT_DTS_SIZE 3
  134. #define OCD_WT_PTE_START 26
  135. #define OCD_WT_PTE_SIZE 3
  136. #define OCD_WT_PTS_START 29
  137. #define OCD_WT_PTS_SIZE 3
  138. /* Bits in DTC */
  139. #define OCD_DTC_T0WP_BIT 0
  140. #define OCD_DTC_T1WP_BIT 1
  141. #define OCD_DTC_ASID0EN_BIT 2
  142. #define OCD_DTC_ASID0_START 3
  143. #define OCD_DTC_ASID0_SIZE 8
  144. #define OCD_DTC_ASID1EN_BIT 11
  145. #define OCD_DTC_ASID1_START 12
  146. #define OCD_DTC_ASID1_SIZE 8
  147. #define OCD_DTC_RWT1_START 28
  148. #define OCD_DTC_RWT1_SIZE 2
  149. #define OCD_DTC_RWT0_START 30
  150. #define OCD_DTC_RWT0_SIZE 2
  151. /* Bits in DTSA0 */
  152. #define OCD_DTSA0_DTSA_START 0
  153. #define OCD_DTSA0_DTSA_SIZE 32
  154. /* Bits in DTSA1 */
  155. #define OCD_DTSA1_DTSA_START 0
  156. #define OCD_DTSA1_DTSA_SIZE 32
  157. /* Bits in DTEA0 */
  158. #define OCD_DTEA0_DTEA_START 0
  159. #define OCD_DTEA0_DTEA_SIZE 32
  160. /* Bits in DTEA1 */
  161. #define OCD_DTEA1_DTEA_START 0
  162. #define OCD_DTEA1_DTEA_SIZE 32
  163. /* Bits in BWC0A */
  164. #define OCD_BWC0A_ASIDEN_BIT 0
  165. #define OCD_BWC0A_ASID_START 1
  166. #define OCD_BWC0A_ASID_SIZE 8
  167. #define OCD_BWC0A_EOC_BIT 14
  168. #define OCD_BWC0A_AME_BIT 25
  169. #define OCD_BWC0A_BWE_START 30
  170. #define OCD_BWC0A_BWE_SIZE 2
  171. /* Bits in BWC0B */
  172. #define OCD_BWC0B_ASIDEN_BIT 0
  173. #define OCD_BWC0B_ASID_START 1
  174. #define OCD_BWC0B_ASID_SIZE 8
  175. #define OCD_BWC0B_EOC_BIT 14
  176. #define OCD_BWC0B_AME_BIT 25
  177. #define OCD_BWC0B_BWE_START 30
  178. #define OCD_BWC0B_BWE_SIZE 2
  179. /* Bits in BWC1A */
  180. #define OCD_BWC1A_ASIDEN_BIT 0
  181. #define OCD_BWC1A_ASID_START 1
  182. #define OCD_BWC1A_ASID_SIZE 8
  183. #define OCD_BWC1A_EOC_BIT 14
  184. #define OCD_BWC1A_AME_BIT 25
  185. #define OCD_BWC1A_BWE_START 30
  186. #define OCD_BWC1A_BWE_SIZE 2
  187. /* Bits in BWC1B */
  188. #define OCD_BWC1B_ASIDEN_BIT 0
  189. #define OCD_BWC1B_ASID_START 1
  190. #define OCD_BWC1B_ASID_SIZE 8
  191. #define OCD_BWC1B_EOC_BIT 14
  192. #define OCD_BWC1B_AME_BIT 25
  193. #define OCD_BWC1B_BWE_START 30
  194. #define OCD_BWC1B_BWE_SIZE 2
  195. /* Bits in BWC2A */
  196. #define OCD_BWC2A_ASIDEN_BIT 0
  197. #define OCD_BWC2A_ASID_START 1
  198. #define OCD_BWC2A_ASID_SIZE 8
  199. #define OCD_BWC2A_EOC_BIT 14
  200. #define OCD_BWC2A_AMB_START 20
  201. #define OCD_BWC2A_AMB_SIZE 5
  202. #define OCD_BWC2A_AME_BIT 25
  203. #define OCD_BWC2A_BWE_START 30
  204. #define OCD_BWC2A_BWE_SIZE 2
  205. /* Bits in BWC2B */
  206. #define OCD_BWC2B_ASIDEN_BIT 0
  207. #define OCD_BWC2B_ASID_START 1
  208. #define OCD_BWC2B_ASID_SIZE 8
  209. #define OCD_BWC2B_EOC_BIT 14
  210. #define OCD_BWC2B_AME_BIT 25
  211. #define OCD_BWC2B_BWE_START 30
  212. #define OCD_BWC2B_BWE_SIZE 2
  213. /* Bits in BWC3A */
  214. #define OCD_BWC3A_ASIDEN_BIT 0
  215. #define OCD_BWC3A_ASID_START 1
  216. #define OCD_BWC3A_ASID_SIZE 8
  217. #define OCD_BWC3A_SIZE_START 9
  218. #define OCD_BWC3A_SIZE_SIZE 3
  219. #define OCD_BWC3A_EOC_BIT 14
  220. #define OCD_BWC3A_BWO_START 16
  221. #define OCD_BWC3A_BWO_SIZE 2
  222. #define OCD_BWC3A_BME_START 20
  223. #define OCD_BWC3A_BME_SIZE 4
  224. #define OCD_BWC3A_BRW_START 28
  225. #define OCD_BWC3A_BRW_SIZE 2
  226. #define OCD_BWC3A_BWE_START 30
  227. #define OCD_BWC3A_BWE_SIZE 2
  228. /* Bits in BWC3B */
  229. #define OCD_BWC3B_ASIDEN_BIT 0
  230. #define OCD_BWC3B_ASID_START 1
  231. #define OCD_BWC3B_ASID_SIZE 8
  232. #define OCD_BWC3B_SIZE_START 9
  233. #define OCD_BWC3B_SIZE_SIZE 3
  234. #define OCD_BWC3B_EOC_BIT 14
  235. #define OCD_BWC3B_BWO_START 16
  236. #define OCD_BWC3B_BWO_SIZE 2
  237. #define OCD_BWC3B_BME_START 20
  238. #define OCD_BWC3B_BME_SIZE 4
  239. #define OCD_BWC3B_BRW_START 28
  240. #define OCD_BWC3B_BRW_SIZE 2
  241. #define OCD_BWC3B_BWE_START 30
  242. #define OCD_BWC3B_BWE_SIZE 2
  243. /* Bits in BWA0A */
  244. #define OCD_BWA0A_BWA_START 0
  245. #define OCD_BWA0A_BWA_SIZE 32
  246. /* Bits in BWA0B */
  247. #define OCD_BWA0B_BWA_START 0
  248. #define OCD_BWA0B_BWA_SIZE 32
  249. /* Bits in BWA1A */
  250. #define OCD_BWA1A_BWA_START 0
  251. #define OCD_BWA1A_BWA_SIZE 32
  252. /* Bits in BWA1B */
  253. #define OCD_BWA1B_BWA_START 0
  254. #define OCD_BWA1B_BWA_SIZE 32
  255. /* Bits in BWA2A */
  256. #define OCD_BWA2A_BWA_START 0
  257. #define OCD_BWA2A_BWA_SIZE 32
  258. /* Bits in BWA2B */
  259. #define OCD_BWA2B_BWA_START 0
  260. #define OCD_BWA2B_BWA_SIZE 32
  261. /* Bits in BWA3A */
  262. #define OCD_BWA3A_BWA_START 0
  263. #define OCD_BWA3A_BWA_SIZE 32
  264. /* Bits in BWA3B */
  265. #define OCD_BWA3B_BWA_START 0
  266. #define OCD_BWA3B_BWA_SIZE 32
  267. /* Bits in NXCFG */
  268. #define OCD_NXCFG_NXARCH_START 0
  269. #define OCD_NXCFG_NXARCH_SIZE 4
  270. #define OCD_NXCFG_NXOCD_START 4
  271. #define OCD_NXCFG_NXOCD_SIZE 4
  272. #define OCD_NXCFG_NXPCB_START 8
  273. #define OCD_NXCFG_NXPCB_SIZE 4
  274. #define OCD_NXCFG_NXDB_START 12
  275. #define OCD_NXCFG_NXDB_SIZE 4
  276. #define OCD_NXCFG_MXMSEO_BIT 16
  277. #define OCD_NXCFG_NXMDO_START 17
  278. #define OCD_NXCFG_NXMDO_SIZE 4
  279. #define OCD_NXCFG_NXPT_BIT 21
  280. #define OCD_NXCFG_NXOT_BIT 22
  281. #define OCD_NXCFG_NXDWT_BIT 23
  282. #define OCD_NXCFG_NXDRT_BIT 24
  283. #define OCD_NXCFG_NXDTC_START 25
  284. #define OCD_NXCFG_NXDTC_SIZE 3
  285. #define OCD_NXCFG_NXDMA_BIT 28
  286. /* Bits in DINST */
  287. #define OCD_DINST_DINST_START 0
  288. #define OCD_DINST_DINST_SIZE 32
  289. /* Bits in CPUCM */
  290. #define OCD_CPUCM_BEM_BIT 1
  291. #define OCD_CPUCM_FEM_BIT 2
  292. #define OCD_CPUCM_REM_BIT 3
  293. #define OCD_CPUCM_IBEM_BIT 4
  294. #define OCD_CPUCM_IEEM_BIT 5
  295. /* Bits in DCCPU */
  296. #define OCD_DCCPU_DATA_START 0
  297. #define OCD_DCCPU_DATA_SIZE 32
  298. /* Bits in DCEMU */
  299. #define OCD_DCEMU_DATA_START 0
  300. #define OCD_DCEMU_DATA_SIZE 32
  301. /* Bits in DCSR */
  302. #define OCD_DCSR_CPUD_BIT 0
  303. #define OCD_DCSR_EMUD_BIT 1
  304. /* Bits in PID */
  305. #define OCD_PID_PROCESS_START 0
  306. #define OCD_PID_PROCESS_SIZE 32
  307. /* Bits in EPC0 */
  308. #define OCD_EPC0_RNG_START 0
  309. #define OCD_EPC0_RNG_SIZE 2
  310. #define OCD_EPC0_CE_BIT 4
  311. #define OCD_EPC0_ECNT_START 16
  312. #define OCD_EPC0_ECNT_SIZE 16
  313. /* Bits in EPC1 */
  314. #define OCD_EPC1_RNG_START 0
  315. #define OCD_EPC1_RNG_SIZE 2
  316. #define OCD_EPC1_ATB_BIT 5
  317. #define OCD_EPC1_AM_BIT 6
  318. /* Bits in EPC2 */
  319. #define OCD_EPC2_RNG_START 0
  320. #define OCD_EPC2_RNG_SIZE 2
  321. #define OCD_EPC2_DB_START 2
  322. #define OCD_EPC2_DB_SIZE 2
  323. /* Bits in EPC3 */
  324. #define OCD_EPC3_RNG_START 0
  325. #define OCD_EPC3_RNG_SIZE 2
  326. #define OCD_EPC3_DWE_BIT 2
  327. /* Bits in AXC */
  328. #define OCD_AXC_DIV_START 0
  329. #define OCD_AXC_DIV_SIZE 4
  330. #define OCD_AXC_AXE_BIT 8
  331. #define OCD_AXC_AXS_BIT 9
  332. #define OCD_AXC_DDR_BIT 10
  333. #define OCD_AXC_LS_BIT 11
  334. #define OCD_AXC_REX_BIT 12
  335. #define OCD_AXC_REXTEN_BIT 13
  336. /* Constants for DC:EIC */
  337. #define OCD_EIC_PROGRAM_AND_DATA_TRACE 0
  338. #define OCD_EIC_BREAKPOINT 1
  339. #define OCD_EIC_NOP 2
  340. /* Constants for DC:OVC */
  341. #define OCD_OVC_OVERRUN 0
  342. #define OCD_OVC_DELAY_CPU_BTM 1
  343. #define OCD_OVC_DELAY_CPU_DTM 2
  344. #define OCD_OVC_DELAY_CPU_BTM_DTM 3
  345. /* Constants for DC:EOS */
  346. #define OCD_EOS_NOP 0
  347. #define OCD_EOS_DEBUG_MODE 1
  348. #define OCD_EOS_BREAKPOINT_WATCHPOINT 2
  349. #define OCD_EOS_THQ 3
  350. /* Constants for RWCS:NTBC */
  351. #define OCD_NTBC_OVERWRITE 0
  352. #define OCD_NTBC_DISABLE 1
  353. #define OCD_NTBC_BREAKPOINT 2
  354. /* Constants for RWCS:CCTRL */
  355. #define OCD_CCTRL_AUTO 0
  356. #define OCD_CCTRL_CACHED 1
  357. #define OCD_CCTRL_UNCACHED 2
  358. /* Constants for RWCS:SZ */
  359. #define OCD_SZ_BYTE 0
  360. #define OCD_SZ_HALFWORD 1
  361. #define OCD_SZ_WORD 2
  362. /* Constants for WT:PTS */
  363. #define OCD_PTS_DISABLED 0
  364. #define OCD_PTS_PROGRAM_0B 1
  365. #define OCD_PTS_PROGRAM_1A 2
  366. #define OCD_PTS_PROGRAM_1B 3
  367. #define OCD_PTS_PROGRAM_2A 4
  368. #define OCD_PTS_PROGRAM_2B 5
  369. #define OCD_PTS_DATA_3A 6
  370. #define OCD_PTS_DATA_3B 7
  371. /* Constants for DTC:RWT1 */
  372. #define OCD_RWT1_NO_TRACE 0
  373. #define OCD_RWT1_DATA_READ 1
  374. #define OCD_RWT1_DATA_WRITE 2
  375. #define OCD_RWT1_DATA_READ_WRITE 3
  376. /* Constants for DTC:RWT0 */
  377. #define OCD_RWT0_NO_TRACE 0
  378. #define OCD_RWT0_DATA_READ 1
  379. #define OCD_RWT0_DATA_WRITE 2
  380. #define OCD_RWT0_DATA_READ_WRITE 3
  381. /* Constants for BWC0A:BWE */
  382. #define OCD_BWE_DISABLED 0
  383. #define OCD_BWE_BREAKPOINT_ENABLED 1
  384. #define OCD_BWE_WATCHPOINT_ENABLED 3
  385. /* Constants for BWC0B:BWE */
  386. #define OCD_BWE_DISABLED 0
  387. #define OCD_BWE_BREAKPOINT_ENABLED 1
  388. #define OCD_BWE_WATCHPOINT_ENABLED 3
  389. /* Constants for BWC1A:BWE */
  390. #define OCD_BWE_DISABLED 0
  391. #define OCD_BWE_BREAKPOINT_ENABLED 1
  392. #define OCD_BWE_WATCHPOINT_ENABLED 3
  393. /* Constants for BWC1B:BWE */
  394. #define OCD_BWE_DISABLED 0
  395. #define OCD_BWE_BREAKPOINT_ENABLED 1
  396. #define OCD_BWE_WATCHPOINT_ENABLED 3
  397. /* Constants for BWC2A:BWE */
  398. #define OCD_BWE_DISABLED 0
  399. #define OCD_BWE_BREAKPOINT_ENABLED 1
  400. #define OCD_BWE_WATCHPOINT_ENABLED 3
  401. /* Constants for BWC2B:BWE */
  402. #define OCD_BWE_DISABLED 0
  403. #define OCD_BWE_BREAKPOINT_ENABLED 1
  404. #define OCD_BWE_WATCHPOINT_ENABLED 3
  405. /* Constants for BWC3A:SIZE */
  406. #define OCD_SIZE_BYTE_ACCESS 4
  407. #define OCD_SIZE_HALFWORD_ACCESS 5
  408. #define OCD_SIZE_WORD_ACCESS 6
  409. #define OCD_SIZE_DOUBLE_WORD_ACCESS 7
  410. /* Constants for BWC3A:BRW */
  411. #define OCD_BRW_READ_BREAK 0
  412. #define OCD_BRW_WRITE_BREAK 1
  413. #define OCD_BRW_ANY_ACCES_BREAK 2
  414. /* Constants for BWC3A:BWE */
  415. #define OCD_BWE_DISABLED 0
  416. #define OCD_BWE_BREAKPOINT_ENABLED 1
  417. #define OCD_BWE_WATCHPOINT_ENABLED 3
  418. /* Constants for BWC3B:SIZE */
  419. #define OCD_SIZE_BYTE_ACCESS 4
  420. #define OCD_SIZE_HALFWORD_ACCESS 5
  421. #define OCD_SIZE_WORD_ACCESS 6
  422. #define OCD_SIZE_DOUBLE_WORD_ACCESS 7
  423. /* Constants for BWC3B:BRW */
  424. #define OCD_BRW_READ_BREAK 0
  425. #define OCD_BRW_WRITE_BREAK 1
  426. #define OCD_BRW_ANY_ACCES_BREAK 2
  427. /* Constants for BWC3B:BWE */
  428. #define OCD_BWE_DISABLED 0
  429. #define OCD_BWE_BREAKPOINT_ENABLED 1
  430. #define OCD_BWE_WATCHPOINT_ENABLED 3
  431. /* Constants for EPC0:RNG */
  432. #define OCD_RNG_DISABLED 0
  433. #define OCD_RNG_EXCLUSIVE 1
  434. #define OCD_RNG_INCLUSIVE 2
  435. /* Constants for EPC1:RNG */
  436. #define OCD_RNG_DISABLED 0
  437. #define OCD_RNG_EXCLUSIVE 1
  438. #define OCD_RNG_INCLUSIVE 2
  439. /* Constants for EPC2:RNG */
  440. #define OCD_RNG_DISABLED 0
  441. #define OCD_RNG_EXCLUSIVE 1
  442. #define OCD_RNG_INCLUSIVE 2
  443. /* Constants for EPC2:DB */
  444. #define OCD_DB_DISABLED 0
  445. #define OCD_DB_CHAINED_B 1
  446. #define OCD_DB_CHAINED_A 2
  447. #define OCD_DB_AHAINED_A_AND_B 3
  448. /* Constants for EPC3:RNG */
  449. #define OCD_RNG_DISABLED 0
  450. #define OCD_RNG_EXCLUSIVE 1
  451. #define OCD_RNG_INCLUSIVE 2
  452. #ifndef __ASSEMBLER__
  453. /* Register access macros */
  454. static inline unsigned long __ocd_read(unsigned int reg)
  455. {
  456. return __builtin_mfdr(reg);
  457. }
  458. static inline void __ocd_write(unsigned int reg, unsigned long value)
  459. {
  460. __builtin_mtdr(reg, value);
  461. }
  462. #define ocd_read(reg) __ocd_read(OCD_##reg)
  463. #define ocd_write(reg, value) __ocd_write(OCD_##reg, value)
  464. struct task_struct;
  465. void ocd_enable(struct task_struct *child);
  466. void ocd_disable(struct task_struct *child);
  467. #endif /* !__ASSEMBLER__ */
  468. #endif /* __ASM_AVR32_OCD_H */