| Kuninori Morimoto | 378a569 | 2009-09-10 01:39:52 +0000 | [diff] [blame] | 1 | #ifndef __ROMIMAGE_MACRO_H | 
|  | 2 | #define __ROMIMAGE_MACRO_H | 
|  | 3 |  | 
|  | 4 | /* The LIST command is used to include comments in the script */ | 
|  | 5 | .macro	LIST comment | 
|  | 6 | .endm | 
|  | 7 |  | 
|  | 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 |  | 
|  | 21 | /* The EW command is used to write a 16-bit word */ | 
|  | 22 | .macro  EW, addr, data | 
|  | 23 | mov.l 1f, r1 | 
|  | 24 | mov.l 2f, r0 | 
|  | 25 | mov.w r0, @r1 | 
|  | 26 | bra 3f | 
|  | 27 | nop | 
|  | 28 | .align 2 | 
|  | 29 | 1 :	.long \addr | 
|  | 30 | 2 :	.long \data | 
|  | 31 | 3 : | 
|  | 32 | .endm | 
|  | 33 |  | 
|  | 34 | /* The EB command is used to write an 8-bit word */ | 
|  | 35 | .macro  EB, addr, data | 
|  | 36 | mov.l 1f, r1 | 
|  | 37 | mov.l 2f, r0 | 
|  | 38 | mov.b r0, @r1 | 
|  | 39 | bra 3f | 
|  | 40 | nop | 
|  | 41 | .align 2 | 
|  | 42 | 1 :	.long \addr | 
|  | 43 | 2 :	.long \data | 
|  | 44 | 3 : | 
|  | 45 | .endm | 
|  | 46 |  | 
|  | 47 | /* The WAIT command is used to delay the execution */ | 
|  | 48 | .macro  WAIT, time | 
|  | 49 | mov.l  2f, r3 | 
|  | 50 | 1 : | 
|  | 51 | nop | 
|  | 52 | tst     r3, r3 | 
|  | 53 | bf/s    1b | 
|  | 54 | dt      r3 | 
|  | 55 | bra	3f | 
|  | 56 | nop | 
|  | 57 | .align 2 | 
|  | 58 | 2 :	.long \time * 100 | 
|  | 59 | 3 : | 
|  | 60 | .endm | 
|  | 61 |  | 
|  | 62 | /* The DD command is used to read a 32-bit word */ | 
|  | 63 | .macro  DD, addr, addr2, nr | 
|  | 64 | mov.l 1f, r1 | 
|  | 65 | mov.l @r1, r0 | 
|  | 66 | bra 2f | 
|  | 67 | nop | 
|  | 68 | .align 2 | 
|  | 69 | 1 :	.long \addr | 
|  | 70 | 2 : | 
|  | 71 | .endm | 
|  | 72 |  | 
|  | 73 | #endif /* __ROMIMAGE_MACRO_H */ |