You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

102 lines
2.8 KiB

  1. set AIC_SMR [expr $AT91C_BASE_AIC + 0x00000000 ]
  2. global AIC_SMR
  3. set AIC_SVR [expr $AT91C_BASE_AIC + 0x00000080 ]
  4. global AIC_SVR
  5. set AIC_IVR [expr $AT91C_BASE_AIC + 0x00000100 ]
  6. global AIC_IVR
  7. set AIC_FVR [expr $AT91C_BASE_AIC + 0x00000104 ]
  8. global AIC_FVR
  9. set AIC_ISR [expr $AT91C_BASE_AIC + 0x00000108 ]
  10. global AIC_ISR
  11. set AIC_IPR [expr $AT91C_BASE_AIC + 0x0000010C ]
  12. global AIC_IPR
  13. set AIC_IMR [expr $AT91C_BASE_AIC + 0x00000110 ]
  14. global AIC_IMR
  15. set AIC_CISR [expr $AT91C_BASE_AIC + 0x00000114 ]
  16. global AIC_CISR
  17. set AIC_IECR [expr $AT91C_BASE_AIC + 0x00000120 ]
  18. global AIC_IECR
  19. set AIC_IDCR [expr $AT91C_BASE_AIC + 0x00000124 ]
  20. global AIC_IDCR
  21. set AIC_ICCR [expr $AT91C_BASE_AIC + 0x00000128 ]
  22. global AIC_ICCR
  23. set AIC_ISCR [expr $AT91C_BASE_AIC + 0x0000012C ]
  24. global AIC_ISCR
  25. set AIC_EOICR [expr $AT91C_BASE_AIC + 0x00000130 ]
  26. global AIC_EOICR
  27. set AIC_SPU [expr $AT91C_BASE_AIC + 0x00000134 ]
  28. global AIC_SPU
  29. set AIC_DCR [expr $AT91C_BASE_AIC + 0x00000138 ]
  30. global AIC_DCR
  31. set AIC_FFER [expr $AT91C_BASE_AIC + 0x00000140 ]
  32. global AIC_FFER
  33. set AIC_FFDR [expr $AT91C_BASE_AIC + 0x00000144 ]
  34. global AIC_FFDR
  35. set AIC_FFSR [expr $AT91C_BASE_AIC + 0x00000148 ]
  36. global AIC_FFSR
  37. proc aic_enable_disable_list { VAL ENAME DNAME } {
  38. global AT91C_ID
  39. show_mmr32_bits AT91C_ID $VAL
  40. }
  41. proc show_AIC_IPR_helper { NAME ADDR VAL } {
  42. aic_enable_disable_list $VAL "IRQ PENDING" "irq not-pending"
  43. }
  44. proc show_AIC_IMR_helper { NAME ADDR VAL } {
  45. aic_enable_disable_list $VAL "IRQ ENABLED" "irq disabled"
  46. }
  47. proc show_AIC { } {
  48. global AIC_SMR
  49. if [catch { mem2array aaa 32 $AIC_SMR [expr 32 * 4] } msg ] {
  50. error [format "%s (%s)" $msg AIC_SMR]
  51. }
  52. echo "AIC_SMR: Mode & Type"
  53. global AT91C_ID
  54. for { set x 0 } { $x < 32 } { } {
  55. echo -n " "
  56. echo -n [format "%2d: %5s 0x%08x | " $x $AT91C_ID($x) $aaa($x)]
  57. incr x
  58. echo -n [format "%2d: %5s 0x%08x | " $x $AT91C_ID($x) $aaa($x)]
  59. incr x
  60. echo -n [format "%2d: %5s 0x%08x | " $x $AT91C_ID($x) $aaa($x)]
  61. incr x
  62. echo [format "%2d: %5s 0x%08x" $x $AT91C_ID($x) $aaa($x)]
  63. incr x
  64. }
  65. global AIC_SVR
  66. if [catch { mem2array aaa 32 $AIC_SVR [expr 32 * 4] } msg ] {
  67. error [format "%s (%s)" $msg AIC_SVR]
  68. }
  69. echo "AIC_SVR: Vectors"
  70. for { set x 0 } { $x < 32 } { } {
  71. echo -n " "
  72. echo -n [format "%2d: %5s 0x%08x | " $x $AT91C_ID($x) $aaa($x)]
  73. incr x
  74. echo -n [format "%2d: %5s 0x%08x | " $x $AT91C_ID($x) $aaa($x)]
  75. incr x
  76. echo -n [format "%2d: %5s 0x%08x | " $x $AT91C_ID($x) $aaa($x)]
  77. incr x
  78. echo [format "%2d: %5s 0x%08x" $x $AT91C_ID($x) $aaa($x)]
  79. incr x
  80. }
  81. foreach REG {
  82. AIC_IVR AIC_FVR AIC_ISR
  83. AIC_IPR AIC_IMR AIC_CISR AIC_IECR AIC_IDCR
  84. AIC_ICCR AIC_ISCR AIC_EOICR AIC_SPU AIC_DCR
  85. AIC_FFER AIC_FFDR AIC_FFSR } {
  86. if [catch { show_mmr32_reg $REG } msg ] {
  87. error $msg
  88. break
  89. }
  90. }
  91. }