[TG3]: Add tagged status support.
[linux-2.6/verdex.git] / include / asm-mips / sibyte / sb1250_smbus.h
blob287cbfe9efa2ce48c2034ee6485c024fd91fb0bd
1 /* *********************************************************************
2 * SB1250 Board Support Package
3 *
4 * SMBUS Constants File: sb1250_smbus.h
5 *
6 * This module contains constants and macros useful for
7 * manipulating the SB1250's SMbus devices.
8 *
9 * SB1250 specification level: 01/02/2002
11 * Author: Mitch Lichtenberg
13 *********************************************************************
15 * Copyright 2000,2001,2002,2003
16 * Broadcom Corporation. All rights reserved.
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License as
20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * MA 02111-1307 USA
32 ********************************************************************* */
35 #ifndef _SB1250_SMBUS_H
36 #define _SB1250_SMBUS_H
38 #include "sb1250_defs.h"
41 * SMBus Clock Frequency Register (Table 14-2)
44 #define S_SMB_FREQ_DIV 0
45 #define M_SMB_FREQ_DIV _SB_MAKEMASK(13,S_SMB_FREQ_DIV)
46 #define V_SMB_FREQ_DIV(x) _SB_MAKEVALUE(x,S_SMB_FREQ_DIV)
48 #define K_SMB_FREQ_400KHZ 0x1F
49 #define K_SMB_FREQ_100KHZ 0x7D
51 #define S_SMB_CMD 0
52 #define M_SMB_CMD _SB_MAKEMASK(8,S_SMB_CMD)
53 #define V_SMB_CMD(x) _SB_MAKEVALUE(x,S_SMB_CMD)
56 * SMBus control register (Table 14-4)
59 #define M_SMB_ERR_INTR _SB_MAKEMASK1(0)
60 #define M_SMB_FINISH_INTR _SB_MAKEMASK1(1)
61 #define M_SMB_DATA_OUT _SB_MAKEMASK1(4)
62 #define M_SMB_DATA_DIR _SB_MAKEMASK1(5)
63 #define M_SMB_DATA_DIR_OUTPUT M_SMB_DATA_DIR
64 #define M_SMB_CLK_OUT _SB_MAKEMASK1(6)
65 #define M_SMB_DIRECT_ENABLE _SB_MAKEMASK1(7)
68 * SMBus status registers (Table 14-5)
71 #define M_SMB_BUSY _SB_MAKEMASK1(0)
72 #define M_SMB_ERROR _SB_MAKEMASK1(1)
73 #define M_SMB_ERROR_TYPE _SB_MAKEMASK1(2)
74 #define M_SMB_REF _SB_MAKEMASK1(6)
75 #define M_SMB_DATA_IN _SB_MAKEMASK1(7)
78 * SMBus Start/Command registers (Table 14-9)
81 #define S_SMB_ADDR 0
82 #define M_SMB_ADDR _SB_MAKEMASK(7,S_SMB_ADDR)
83 #define V_SMB_ADDR(x) _SB_MAKEVALUE(x,S_SMB_ADDR)
84 #define G_SMB_ADDR(x) _SB_GETVALUE(x,S_SMB_ADDR,M_SMB_ADDR)
86 #define M_SMB_QDATA _SB_MAKEMASK1(7)
88 #define S_SMB_TT 8
89 #define M_SMB_TT _SB_MAKEMASK(3,S_SMB_TT)
90 #define V_SMB_TT(x) _SB_MAKEVALUE(x,S_SMB_TT)
91 #define G_SMB_TT(x) _SB_GETVALUE(x,S_SMB_TT,M_SMB_TT)
93 #define K_SMB_TT_WR1BYTE 0
94 #define K_SMB_TT_WR2BYTE 1
95 #define K_SMB_TT_WR3BYTE 2
96 #define K_SMB_TT_CMD_RD1BYTE 3
97 #define K_SMB_TT_CMD_RD2BYTE 4
98 #define K_SMB_TT_RD1BYTE 5
99 #define K_SMB_TT_QUICKCMD 6
100 #define K_SMB_TT_EEPROMREAD 7
102 #define V_SMB_TT_WR1BYTE V_SMB_TT(K_SMB_TT_WR1BYTE)
103 #define V_SMB_TT_WR2BYTE V_SMB_TT(K_SMB_TT_WR2BYTE)
104 #define V_SMB_TT_WR3BYTE V_SMB_TT(K_SMB_TT_WR3BYTE)
105 #define V_SMB_TT_CMD_RD1BYTE V_SMB_TT(K_SMB_TT_CMD_RD1BYTE)
106 #define V_SMB_TT_CMD_RD2BYTE V_SMB_TT(K_SMB_TT_CMD_RD2BYTE)
107 #define V_SMB_TT_RD1BYTE V_SMB_TT(K_SMB_TT_RD1BYTE)
108 #define V_SMB_TT_QUICKCMD V_SMB_TT(K_SMB_TT_QUICKCMD)
109 #define V_SMB_TT_EEPROMREAD V_SMB_TT(K_SMB_TT_EEPROMREAD)
111 #define M_SMB_PEC _SB_MAKEMASK1(15)
114 * SMBus Data Register (Table 14-6) and SMBus Extra Register (Table 14-7)
117 #define S_SMB_LB 0
118 #define M_SMB_LB _SB_MAKEMASK(8,S_SMB_LB)
119 #define V_SMB_LB(x) _SB_MAKEVALUE(x,S_SMB_LB)
121 #define S_SMB_MB 8
122 #define M_SMB_MB _SB_MAKEMASK(8,S_SMB_MB)
123 #define V_SMB_MB(x) _SB_MAKEVALUE(x,S_SMB_MB)
127 * SMBus Packet Error Check register (Table 14-8)
130 #define S_SPEC_PEC 0
131 #define M_SPEC_PEC _SB_MAKEMASK(8,S_SPEC_PEC)
132 #define V_SPEC_MB(x) _SB_MAKEVALUE(x,S_SPEC_PEC)
135 #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
137 #define S_SMB_CMDH 8
138 #define M_SMB_CMDH _SB_MAKEMASK(8,S_SMBH_CMD)
139 #define V_SMB_CMDH(x) _SB_MAKEVALUE(x,S_SMBH_CMD)
141 #define M_SMB_EXTEND _SB_MAKEMASK1(14)
143 #define M_SMB_DIR _SB_MAKEMASK1(13)
145 #define S_SMB_DFMT 8
146 #define M_SMB_DFMT _SB_MAKEMASK(3,S_SMB_DFMT)
147 #define V_SMB_DFMT(x) _SB_MAKEVALUE(x,S_SMB_DFMT)
148 #define G_SMB_DFMT(x) _SB_GETVALUE(x,S_SMB_DFMT,M_SMB_DFMT)
150 #define K_SMB_DFMT_1BYTE 0
151 #define K_SMB_DFMT_2BYTE 1
152 #define K_SMB_DFMT_3BYTE 2
153 #define K_SMB_DFMT_4BYTE 3
154 #define K_SMB_DFMT_NODATA 4
155 #define K_SMB_DFMT_CMD4BYTE 5
156 #define K_SMB_DFMT_CMD5BYTE 6
157 #define K_SMB_DFMT_RESERVED 7
159 #define V_SMB_DFMT_1BYTE V_SMB_DFMT(K_SMB_DFMT_1BYTE)
160 #define V_SMB_DFMT_2BYTE V_SMB_DFMT(K_SMB_DFMT_2BYTE)
161 #define V_SMB_DFMT_3BYTE V_SMB_DFMT(K_SMB_DFMT_3BYTE)
162 #define V_SMB_DFMT_4BYTE V_SMB_DFMT(K_SMB_DFMT_4BYTE)
163 #define V_SMB_DFMT_NODATA V_SMB_DFMT(K_SMB_DFMT_NODATA)
164 #define V_SMB_DFMT_CMD4BYTE V_SMB_DFMT(K_SMB_DFMT_CMD4BYTE)
165 #define V_SMB_DFMT_CMD5BYTE V_SMB_DFMT(K_SMB_DFMT_CMD5BYTE)
166 #define V_SMB_DFMT_RESERVED V_SMB_DFMT(K_SMB_DFMT_RESERVED)
168 #endif /* 1250 PASS2 || 112x PASS1 */
170 #endif