blob: e15ec0a27ee80757686bb585115143a636f6fc46 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +01002/*
3 * Copyright (C) 2008 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +01004 */
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 Iwamatsubaa9f9b2009-06-16 22:29:15 +090018 mov.w \data ,r0
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010019 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
301:
31 nop
32 tst r3, r3
33 bf/s 1b
34 dt r3
35.endm
36
37#endif /* __ASSEMBLY__ */
38#endif /* __MACRO_H__ */