1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28#include <common.h>
29#include <asm/ppc4xx.h>
30#include <asm/ppc4xx-i2c.h>
31#include <i2c.h>
32
33#ifdef CONFIG_HARD_I2C
34
35#define I2C_BUS1_BASE_ADDR (CONFIG_SYS_PERIPHERAL_BASE + 0x00000500)
36#define I2C_REGISTERS_BUS1_BASE_ADDRESS I2C_BUS1_BASE_ADDR
37#define IIC_MDBUF1 (&i2c->mdbuf)
38#define IIC_SDBUF1 (&i2c->sdbuf)
39#define IIC_LMADR1 (&i2c->lmadr)
40#define IIC_HMADR1 (&i2c->hmadr)
41#define IIC_CNTL1 (&i2c->cntl)
42#define IIC_MDCNTL1 (&i2c->mdcntl)
43#define IIC_STS1 (&i2c->sts)
44#define IIC_EXTSTS1 (&i2c->extsts)
45#define IIC_LSADR1 (&i2c->lsadr)
46#define IIC_HSADR1 (&i2c->hsadr)
47#define IIC_CLKDIV1 (&i2c->clkdiv)
48#define IIC_INTRMSK1 (&i2c->intrmsk)
49#define IIC_XFRCNT1 (&i2c->xfrcnt)
50#define IIC_XTCNTLSS1 (&i2c->xtcntlss)
51#define IIC_DIRECTCNTL1 (&i2c->directcntl)
52
53void i2c1_init (int speed, int slaveadd);
54int i2c_probe1 (uchar chip);
55int i2c_read1 (uchar chip, uint addr, int alen, uchar * buffer, int len);
56int i2c_write1 (uchar chip, uint addr, int alen, uchar * buffer, int len);
57uchar i2c_reg_read1(uchar i2c_addr, uchar reg);
58void i2c_reg_write1(uchar i2c_addr, uchar reg, uchar val);
59
60#endif
61