debug-macro.S 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* linux/include/asm-arm/arch-ebsa285/debug-macro.S
  2. *
  3. * Debugging macro include header
  4. *
  5. * Copyright (C) 1994-1999 Russell King
  6. * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. */
  13. #include <asm/hardware/dec21285.h>
  14. #ifndef CONFIG_DEBUG_DC21285_PORT
  15. /* For NetWinder debugging */
  16. .macro addruart,rx
  17. mrc p15, 0, \rx, c1, c0
  18. tst \rx, #1 @ MMU enabled?
  19. moveq \rx, #0x7c000000 @ physical
  20. movne \rx, #0xff000000 @ virtual
  21. orr \rx, \rx, #0x000003f8
  22. .endm
  23. .macro senduart,rd,rx
  24. strb \rd, [\rx]
  25. .endm
  26. .macro busyuart,rd,rx
  27. 1002: ldrb \rd, [\rx, #0x5]
  28. and \rd, \rd, #0x60
  29. teq \rd, #0x60
  30. bne 1002b
  31. .endm
  32. .macro waituart,rd,rx
  33. 1001: ldrb \rd, [\rx, #0x6]
  34. tst \rd, #0x10
  35. beq 1001b
  36. .endm
  37. #else
  38. /* For EBSA285 debugging */
  39. .equ dc21285_high, ARMCSR_BASE & 0xff000000
  40. .equ dc21285_low, ARMCSR_BASE & 0x00ffffff
  41. .macro addruart,rx
  42. mrc p15, 0, \rx, c1, c0
  43. tst \rx, #1 @ MMU enabled?
  44. moveq \rx, #0x42000000
  45. movne \rx, #dc21285_high
  46. .if dc21285_low
  47. orrne \rx, \rx, #dc21285_low
  48. .endif
  49. .endm
  50. .macro senduart,rd,rx
  51. str \rd, [\rx, #0x160] @ UARTDR
  52. .endm
  53. .macro busyuart,rd,rx
  54. 1001: ldr \rd, [\rx, #0x178] @ UARTFLG
  55. tst \rd, #1 << 3
  56. bne 1001b
  57. .endm
  58. .macro waituart,rd,rx
  59. .endm
  60. #endif