debug-macro.S 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* linux/include/asm-arm/arch-s3c2410/debug-macro.S
  2. *
  3. * Debugging macro include header
  4. *
  5. * Copyright (C) 1994-1999 Russell King
  6. * Copyright (C) 2005 Simtec Electronics
  7. *
  8. * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. */
  14. #include <asm/arch/map.h>
  15. #include <asm/arch/regs-gpio.h>
  16. #include <asm/plat-s3c/regs-serial.h>
  17. #include <asm/plat-s3c/debug-macro.S>
  18. #define S3C2410_UART1_OFF (0x4000)
  19. #define SHIFT_2440TXF (14-9)
  20. .macro addruart, rx
  21. mrc p15, 0, \rx, c1, c0
  22. tst \rx, #1
  23. ldreq \rx, = S3C24XX_PA_UART
  24. ldrne \rx, = S3C24XX_VA_UART
  25. #if CONFIG_DEBUG_S3C2410_UART != 0
  26. add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART)
  27. #endif
  28. .endm
  29. .macro fifo_full rd, rx
  30. @ check for arm920 vs arm926. currently assume all arm926
  31. @ devices have an 64 byte FIFO identical to the s3c2440
  32. mrc p15, 0, \rd, c0, c0
  33. and \rd, \rd, #0xff0
  34. teq \rd, #0x260
  35. beq 1004f
  36. mrc p15, 0, \rd, c1, c0
  37. tst \rd, #1
  38. addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
  39. addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
  40. bic \rd, \rd, #0xff000
  41. ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ]
  42. and \rd, \rd, #0x00ff0000
  43. teq \rd, #0x00440000 @ is it 2440?
  44. 1004:
  45. ldr \rd, [ \rx, # S3C2410_UFSTAT ]
  46. moveq \rd, \rd, lsr #SHIFT_2440TXF
  47. tst \rd, #S3C2410_UFSTAT_TXFULL
  48. .endm
  49. .macro fifo_level rd, rx
  50. mrc p15, 0, \rd, c1, c0
  51. tst \rd, #1
  52. addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
  53. addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
  54. bic \rd, \rd, #0xff000
  55. ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ]
  56. and \rd, \rd, #0x00ff0000
  57. teq \rd, #0x00440000 @ is it 2440?
  58. ldr \rd, [ \rx, # S3C2410_UFSTAT ]
  59. andne \rd, \rd, #S3C2410_UFSTAT_TXMASK
  60. andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK
  61. .endm