romimage.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* kfr2r09 board specific boot code:
  2. * converts the "partner-jet-script.txt" script into assembly
  3. * the assembly code is the first code to be executed in the romImage
  4. */
  5. /* The LIST command is used to include comments in the script */
  6. .macro LIST comment
  7. .endm
  8. /* The ED command is used to write a 32-bit word */
  9. .macro ED, addr, data
  10. mov.l 1f ,r1
  11. mov.l 2f ,r0
  12. mov.l r0, @r1
  13. bra 3f
  14. nop
  15. .align 2
  16. 1: .long \addr
  17. 2: .long \data
  18. 3:
  19. .endm
  20. /* The EW command is used to write a 16-bit word */
  21. .macro EW, addr, data
  22. mov.l 1f ,r1
  23. mov.l 2f ,r0
  24. mov.w r0, @r1
  25. bra 3f
  26. nop
  27. .align 2
  28. 1: .long \addr
  29. 2: .long \data
  30. 3:
  31. .endm
  32. /* The EB command is used to write an 8-bit word */
  33. .macro EB, addr, data
  34. mov.l 1f ,r1
  35. mov.l 2f ,r0
  36. mov.b r0, @r1
  37. bra 3f
  38. nop
  39. .align 2
  40. 1: .long \addr
  41. 2: .long \data
  42. 3:
  43. .endm
  44. /* The WAIT command is used to delay the execution */
  45. .macro WAIT, time
  46. mov.l 2f ,r3
  47. 1:
  48. nop
  49. tst r3, r3
  50. bf/s 1b
  51. dt r3
  52. bra 3f
  53. nop
  54. .align 2
  55. 2: .long \time * 100
  56. 3:
  57. .endm
  58. /* The DD command is used to read a 32-bit word */
  59. .macro DD, addr, addr2, nr
  60. mov.l 1f ,r1
  61. mov.l @r1, r0
  62. bra 2f
  63. nop
  64. .align 2
  65. 1: .long \addr
  66. 2:
  67. .endm
  68. #include "partner-jet-setup.txt"
  69. /* execute icbi after enabling cache */
  70. mov.l 1f, r0
  71. icbi @r0
  72. /* jump to cached area */
  73. mova 2f, r0
  74. jmp @r0
  75. nop
  76. .align 2
  77. 1: .long 0xa8000000
  78. 2: