blob: 72499ead76f986b1629faad3ee6cbbe5c602a491 [file] [log] [blame]
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +01001/*
2 * Copyright (C) 2008 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
3 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +01005 */
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 Iwamatsubaa9f9b2009-06-16 22:29:15 +090019 mov.w \data ,r0
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010020 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
311:
32 nop
33 tst r3, r3
34 bf/s 1b
35 dt r3
36.endm
37
38#endif /* __ASSEMBLY__ */
39#endif /* __MACRO_H__ */