]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/arm/include/asm/arch-rmobile/rcar-mstp.h
arm: rmobile: rcar: Add mstp_setclrbits and mstp_setclrbits_le32
[karo-tx-uboot.git] / arch / arm / include / asm / arch-rmobile / rcar-mstp.h
1 /*
2  * arch/arm/include/asm/arch-rmobile/rcar-mstp.h
3  *
4  * Copyright (C) 2013, 2014 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
5  * Copyright (C) 2013, 2014 Renesas Electronics Corporation
6  *
7  * SPDX-License-Identifier:     GPL-2.0
8  */
9
10 #ifndef __ASM_ARCH_RCAR_MSTP_H
11 #define __ASM_ARCH_RCAR_MSTP_H
12
13 #define mstp_setbits(type, addr, saddr, set) \
14                 out_##type((saddr), in_##type(addr) | (set))
15 #define mstp_clrbits(type, addr, saddr, clear) \
16                 out_##type((saddr), in_##type(addr) & ~(clear))
17 #define mstp_setclrbits(type, addr, set, clear) \
18                 out_##type((addr), (in_##type(addr) | (set)) & ~(clear))
19 #define mstp_setbits_le32(addr, saddr, set) \
20                 mstp_setbits(le32, addr, saddr, set)
21 #define mstp_clrbits_le32(addr, saddr, clear) \
22                 mstp_clrbits(le32, addr, saddr, clear)
23 #define mstp_setclrbits_le32(addr, set, clear) \
24                 mstp_setclrbits(le32, addr, set, clear)
25
26 #endif /* __ASM_ARCH_RCAR_MSTP_H */