tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc9630 / sci.h
1 /*
2  * Copyright (C) 2012 Spreadtrum Communications Inc.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  */
15
16 /**
17  * sci_glb_read - read value from d-die global register
18  * @reg: global register address
19  * @msk:
20  *
21  * If read all bits, set msk = -1
22  *
23  * Return read value and mask.
24  */
25 u32 sci_glb_read(u32 reg, u32 msk);
26
27 /**
28  * sci_glb_write - safely write value to d-die global register
29  * @reg: global register address
30  * @val:
31  * @msk:
32  *
33  * If write all bits, set msk = -1
34  *
35  * Returns success (0) or negative errno.
36  */
37 int sci_glb_write(u32 reg, u32 val, u32 msk);
38
39 /**
40  * sci_glb_set - force set bit to d-die global register
41  * @reg: global register address
42  * @bit: commonly, only set one bit
43  *
44  *
45  * tiger use stand-alone xxx_set/xxx_clr address for all global register
46  *
47  * Returns success (0) or negative errno.
48  */
49 int sci_glb_set(u32 reg, u32 bit);
50
51 /**
52  * sci_glb_clr - force clr bit to d-die gglobal register
53  * @reg: global register address
54  * @bit: commonly, only clear one bit
55  *
56  *
57  * tiger use stand-alone xxx_set/xxx_clr address for all d-die global register
58  *
59  * Returns success (0) or negative errno.
60  */
61 int sci_glb_clr(u32 reg, u32 bit);
62
63 #define sci_glb_raw_read(reg)           sci_glb_read(reg, -1UL)
64 #define sci_glb_raw_write(reg, val)     sci_glb_write(reg, val, -1UL)
65
66 #define sci_assert(condition)   do { WARN_ON(!(condition)); }while(0)
67