romimage-macros.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef __ROMIMAGE_MACRO_H
  2. #define __ROMIMAGE_MACRO_H
  3. /* The LIST command is used to include comments in the script */
  4. .macro LIST comment
  5. .endm
  6. /* The ED command is used to write a 32-bit word */
  7. .macro ED, addr, data
  8. mov.l 1f, r1
  9. mov.l 2f, r0
  10. mov.l r0, @r1
  11. bra 3f
  12. nop
  13. .align 2
  14. 1 : .long \addr
  15. 2 : .long \data
  16. 3 :
  17. .endm
  18. /* The EW command is used to write a 16-bit word */
  19. .macro EW, addr, data
  20. mov.l 1f, r1
  21. mov.l 2f, r0
  22. mov.w r0, @r1
  23. bra 3f
  24. nop
  25. .align 2
  26. 1 : .long \addr
  27. 2 : .long \data
  28. 3 :
  29. .endm
  30. /* The EB command is used to write an 8-bit word */
  31. .macro EB, addr, data
  32. mov.l 1f, r1
  33. mov.l 2f, r0
  34. mov.b r0, @r1
  35. bra 3f
  36. nop
  37. .align 2
  38. 1 : .long \addr
  39. 2 : .long \data
  40. 3 :
  41. .endm
  42. /* The WAIT command is used to delay the execution */
  43. .macro WAIT, time
  44. mov.l 2f, r3
  45. 1 :
  46. nop
  47. tst r3, r3
  48. bf/s 1b
  49. dt r3
  50. bra 3f
  51. nop
  52. .align 2
  53. 2 : .long \time * 100
  54. 3 :
  55. .endm
  56. /* The DD command is used to read a 32-bit word */
  57. .macro DD, addr, addr2, nr
  58. mov.l 1f, r1
  59. mov.l @r1, r0
  60. bra 2f
  61. nop
  62. .align 2
  63. 1 : .long \addr
  64. 2 :
  65. .endm
  66. #endif /* __ROMIMAGE_MACRO_H */