]>
Commit | Line | Data |
---|---|---|
b79316f2 SR |
1 | /* |
2 | * Copyright (C) 2005 Sandburst Corporation | |
3 | * | |
1a459660 | 4 | * SPDX-License-Identifier: GPL-2.0+ |
b79316f2 SR |
5 | */ |
6 | ||
7 | /* | |
8 | * Ported from i2c driver for ppc4xx by AS HARNOIS by | |
9 | * Travis B. Sawyer | |
10 | * Sandburst Corporation | |
11 | */ | |
12 | #include <common.h> | |
b36df561 SR |
13 | #include <asm/ppc4xx.h> |
14 | #include <asm/ppc4xx-i2c.h> | |
b79316f2 SR |
15 | #include <i2c.h> |
16 | ||
b79316f2 SR |
17 | #ifdef CONFIG_HARD_I2C |
18 | ||
6d0f6bcf | 19 | #define I2C_BUS1_BASE_ADDR (CONFIG_SYS_PERIPHERAL_BASE + 0x00000500) |
b79316f2 | 20 | #define I2C_REGISTERS_BUS1_BASE_ADDRESS I2C_BUS1_BASE_ADDR |
072e754b HS |
21 | #define IIC_MDBUF1 (&i2c->mdbuf) |
22 | #define IIC_SDBUF1 (&i2c->sdbuf) | |
23 | #define IIC_LMADR1 (&i2c->lmadr) | |
24 | #define IIC_HMADR1 (&i2c->hmadr) | |
25 | #define IIC_CNTL1 (&i2c->cntl) | |
26 | #define IIC_MDCNTL1 (&i2c->mdcntl) | |
27 | #define IIC_STS1 (&i2c->sts) | |
28 | #define IIC_EXTSTS1 (&i2c->extsts) | |
29 | #define IIC_LSADR1 (&i2c->lsadr) | |
30 | #define IIC_HSADR1 (&i2c->hsadr) | |
31 | #define IIC_CLKDIV1 (&i2c->clkdiv) | |
32 | #define IIC_INTRMSK1 (&i2c->intrmsk) | |
33 | #define IIC_XFRCNT1 (&i2c->xfrcnt) | |
34 | #define IIC_XTCNTLSS1 (&i2c->xtcntlss) | |
35 | #define IIC_DIRECTCNTL1 (&i2c->directcntl) | |
b79316f2 SR |
36 | |
37 | void i2c1_init (int speed, int slaveadd); | |
38 | int i2c_probe1 (uchar chip); | |
39 | int i2c_read1 (uchar chip, uint addr, int alen, uchar * buffer, int len); | |
40 | int i2c_write1 (uchar chip, uint addr, int alen, uchar * buffer, int len); | |
41 | uchar i2c_reg_read1(uchar i2c_addr, uchar reg); | |
42 | void i2c_reg_write1(uchar i2c_addr, uchar reg, uchar val); | |
43 | ||
3d078ce6 | 44 | #endif /* CONFIG_HARD_I2C */ |