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