blob: b0ac592faf73d86b265219c9534dff80cce6ea88 [file] [log] [blame]
wdenk935ecca2002-08-06 20:46:37 +00001#ifndef _440_i2c_h_
2#define _440_i2c_h_
3
4#define I2C_BASE_ADDR (CFG_PERIPHERAL_BASE + 0x00000400)
5
6#define I2C_REGISTERS_BASE_ADDRESS I2C_BASE_ADDR
7#define IIC_MDBUF (I2C_REGISTERS_BASE_ADDRESS+IICMDBUF)
8#define IIC_SDBUF (I2C_REGISTERS_BASE_ADDRESS+IICSDBUF)
9#define IIC_LMADR (I2C_REGISTERS_BASE_ADDRESS+IICLMADR)
10#define IIC_HMADR (I2C_REGISTERS_BASE_ADDRESS+IICHMADR)
11#define IIC_CNTL (I2C_REGISTERS_BASE_ADDRESS+IICCNTL)
12#define IIC_MDCNTL (I2C_REGISTERS_BASE_ADDRESS+IICMDCNTL)
13#define IIC_STS (I2C_REGISTERS_BASE_ADDRESS+IICSTS)
14#define IIC_EXTSTS (I2C_REGISTERS_BASE_ADDRESS+IICEXTSTS)
15#define IIC_LSADR (I2C_REGISTERS_BASE_ADDRESS+IICLSADR)
16#define IIC_HSADR (I2C_REGISTERS_BASE_ADDRESS+IICHSADR)
17#define IIC_CLKDIV (I2C_REGISTERS_BASE_ADDRESS+IICCLKDIV)
18#define IIC_INTRMSK (I2C_REGISTERS_BASE_ADDRESS+IICINTRMSK)
19#define IIC_XFRCNT (I2C_REGISTERS_BASE_ADDRESS+IICXFRCNT)
20#define IIC_XTCNTLSS (I2C_REGISTERS_BASE_ADDRESS+IICXTCNTLSS)
21#define IIC_DIRECTCNTL (I2C_REGISTERS_BASE_ADDRESS+IICDIRECTCNTL)
22
23/* MDCNTL Register Bit definition */
24#define IIC_MDCNTL_HSCL 0x01
25#define IIC_MDCNTL_EUBS 0x02
26#define IIC_MDCNTL_EINT 0x04
27#define IIC_MDCNTL_ESM 0x08
28#define IIC_MDCNTL_FSM 0x10
29#define IIC_MDCNTL_EGC 0x20
30#define IIC_MDCNTL_FMDB 0x40
31#define IIC_MDCNTL_FSDB 0x80
32
33/* CNTL Register Bit definition */
34#define IIC_CNTL_PT 0x01
35#define IIC_CNTL_READ 0x02
36#define IIC_CNTL_CHT 0x04
37#define IIC_CNTL_RPST 0x08
38/* bit 2/3 for Transfer count*/
39#define IIC_CNTL_AMD 0x40
40#define IIC_CNTL_HMT 0x80
41
42/* STS Register Bit definition */
43#define IIC_STS_PT 0X01
44#define IIC_STS_IRQA 0x02
45#define IIC_STS_ERR 0X04
46#define IIC_STS_SCMP 0x08
47#define IIC_STS_MDBF 0x10
48#define IIC_STS_MDBS 0X20
49#define IIC_STS_SLPR 0x40
50#define IIC_STS_SSS 0x80
51
52/* EXTSTS Register Bit definition */
53#define IIC_EXTSTS_XFRA 0X01
54#define IIC_EXTSTS_ICT 0X02
55#define IIC_EXTSTS_LA 0X04
56
57/* XTCNTLSS Register Bit definition */
58#define IIC_XTCNTLSS_SRST 0x01
59#define IIC_XTCNTLSS_EPI 0x02
60#define IIC_XTCNTLSS_SDBF 0x04
61#define IIC_XTCNTLSS_SBDD 0x08
62#define IIC_XTCNTLSS_SWS 0x10
63#define IIC_XTCNTLSS_SWC 0x20
64#define IIC_XTCNTLSS_SRS 0x40
65#define IIC_XTCNTLSS_SRC 0x80
66#endif