Jean-Christophe PLAGNIOL-VILLARD | b9c2172 | 2008-12-20 19:29:49 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> |
| 3 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Jean-Christophe PLAGNIOL-VILLARD | b9c2172 | 2008-12-20 19:29:49 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __MACRO_H__ |
| 8 | #define __MACRO_H__ |
| 9 | #ifdef __ASSEMBLY__ |
| 10 | |
| 11 | .macro write32, addr, data |
| 12 | mov.l \addr ,r1 |
| 13 | mov.l \data ,r0 |
| 14 | mov.l r0, @r1 |
| 15 | .endm |
| 16 | |
| 17 | .macro write16, addr, data |
| 18 | mov.l \addr ,r1 |
Nobuhiro Iwamatsu | a988f38 | 2009-06-16 22:29:15 +0900 | [diff] [blame] | 19 | mov.w \data ,r0 |
Jean-Christophe PLAGNIOL-VILLARD | b9c2172 | 2008-12-20 19:29:49 +0100 | [diff] [blame] | 20 | mov.w r0, @r1 |
| 21 | .endm |
| 22 | |
| 23 | .macro write8, addr, data |
| 24 | mov.l \addr ,r1 |
| 25 | mov.l \data ,r0 |
| 26 | mov.b r0, @r1 |
| 27 | .endm |
| 28 | |
| 29 | .macro wait_timer, time |
| 30 | mov.l \time ,r3 |
| 31 | 1: |
| 32 | nop |
| 33 | tst r3, r3 |
| 34 | bf/s 1b |
| 35 | dt r3 |
| 36 | .endm |
| 37 | |
| 38 | #endif /* __ASSEMBLY__ */ |
| 39 | #endif /* __MACRO_H__ */ |