Features supported in SB700 code:
[coreboot.git] / src / southbridge / amd / sb700 / sb700_smbus.h
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2010 Advanced Micro Devices, Inc.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
18  */
19
20 #ifndef SB700_SMBUS_H
21 #define SB700_SMBUS_H
22
23 //#include <stdint.h>
24
25 #define SMBHSTSTAT 0x0
26 #define SMBSLVSTAT 0x1
27 #define SMBHSTCTRL 0x2
28 #define SMBHSTCMD  0x3
29 #define SMBHSTADDR 0x4
30 #define SMBHSTDAT0 0x5
31 #define SMBHSTDAT1 0x6
32 #define SMBHSTBLKDAT 0x7
33
34 #define SMBSLVCTRL 0x8
35 #define SMBSLVCMD_SHADOW 0x9
36 #define SMBSLVEVT 0xa
37 #define SMBSLVDAT 0xc
38
39 #define AX_INDXC  0
40 #define AX_INDXP  1
41 #define AXCFG     2
42 #define ABCFG     3
43
44 #define AB_INDX   0xCD8
45 #define AB_DATA   (AB_INDX+4)
46
47 /* Between 1-10 seconds, We should never timeout normally
48  * Longer than this is just painful when a timeout condition occurs.
49  */
50 #define SMBUS_TIMEOUT (100*1000*10)
51
52 #define abcfg_reg(reg, mask, val)       \
53         alink_ab_indx((ABCFG), (reg), (mask), (val))
54 #define axcfg_reg(reg, mask, val)       \
55         alink_ab_indx((AXCFG), (reg), (mask), (val))
56 #define axindxc_reg(reg, mask, val)     \
57         alink_ax_indx(0, (reg), (mask), (val))
58 #define axindxp_reg(reg, mask, val)     \
59         alink_ax_indx(1, (reg), (mask), (val))
60
61
62 #endif