icedcc.S 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * arch/arm/include/debug/icedcc.S
  3. *
  4. * Copyright (C) 1994-1999 Russell King
  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. */
  11. @@ debug using ARM EmbeddedICE DCC channel
  12. .macro addruart, rp, rv, tmp
  13. .endm
  14. #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
  15. .macro senduart, rd, rx
  16. mcr p14, 0, \rd, c0, c5, 0
  17. .endm
  18. .macro busyuart, rd, rx
  19. 1001:
  20. mrc p14, 0, \rx, c0, c1, 0
  21. tst \rx, #0x20000000
  22. beq 1001b
  23. .endm
  24. .macro waituart, rd, rx
  25. mov \rd, #0x2000000
  26. 1001:
  27. subs \rd, \rd, #1
  28. bmi 1002f
  29. mrc p14, 0, \rx, c0, c1, 0
  30. tst \rx, #0x20000000
  31. bne 1001b
  32. 1002:
  33. .endm
  34. #elif defined(CONFIG_CPU_XSCALE)
  35. .macro senduart, rd, rx
  36. mcr p14, 0, \rd, c8, c0, 0
  37. .endm
  38. .macro busyuart, rd, rx
  39. 1001:
  40. mrc p14, 0, \rx, c14, c0, 0
  41. tst \rx, #0x10000000
  42. beq 1001b
  43. .endm
  44. .macro waituart, rd, rx
  45. mov \rd, #0x10000000
  46. 1001:
  47. subs \rd, \rd, #1
  48. bmi 1002f
  49. mrc p14, 0, \rx, c14, c0, 0
  50. tst \rx, #0x10000000
  51. bne 1001b
  52. 1002:
  53. .endm
  54. #else
  55. .macro senduart, rd, rx
  56. mcr p14, 0, \rd, c1, c0, 0
  57. .endm
  58. .macro busyuart, rd, rx
  59. 1001:
  60. mrc p14, 0, \rx, c0, c0, 0
  61. tst \rx, #2
  62. beq 1001b
  63. .endm
  64. .macro waituart, rd, rx
  65. mov \rd, #0x2000000
  66. 1001:
  67. subs \rd, \rd, #1
  68. bmi 1002f
  69. mrc p14, 0, \rx, c0, c0, 0
  70. tst \rx, #2
  71. bne 1001b
  72. 1002:
  73. .endm
  74. #endif /* CONFIG_CPU_V6 */