Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / unicore32 / include / mach / regs-i2c.h
blobb41aa7c9243053956a2d5d29550898d13638ec9b
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * PKUnity Inter-integrated Circuit (I2C) Registers
4 */
6 /*
7 * Control Reg I2C_CON.
8 */
9 #define I2C_CON (PKUNITY_I2C_BASE + 0x0000)
11 * Target Address Reg I2C_TAR.
13 #define I2C_TAR (PKUNITY_I2C_BASE + 0x0004)
15 * Data buffer and command Reg I2C_DATACMD.
17 #define I2C_DATACMD (PKUNITY_I2C_BASE + 0x0010)
19 * Enable Reg I2C_ENABLE.
21 #define I2C_ENABLE (PKUNITY_I2C_BASE + 0x006C)
23 * Status Reg I2C_STATUS.
25 #define I2C_STATUS (PKUNITY_I2C_BASE + 0x0070)
27 * Tx FIFO Length Reg I2C_TXFLR.
29 #define I2C_TXFLR (PKUNITY_I2C_BASE + 0x0074)
31 * Rx FIFO Length Reg I2C_RXFLR.
33 #define I2C_RXFLR (PKUNITY_I2C_BASE + 0x0078)
35 * Enable Status Reg I2C_ENSTATUS.
37 #define I2C_ENSTATUS (PKUNITY_I2C_BASE + 0x009C)
39 #define I2C_CON_MASTER FIELD(1, 1, 0)
40 #define I2C_CON_SPEED_STD FIELD(1, 2, 1)
41 #define I2C_CON_SPEED_FAST FIELD(2, 2, 1)
42 #define I2C_CON_RESTART FIELD(1, 1, 5)
43 #define I2C_CON_SLAVEDISABLE FIELD(1, 1, 6)
45 #define I2C_DATACMD_READ FIELD(1, 1, 8)
46 #define I2C_DATACMD_WRITE FIELD(0, 1, 8)
47 #define I2C_DATACMD_DAT_MASK FMASK(8, 0)
48 #define I2C_DATACMD_DAT(v) FIELD((v), 8, 0)
50 #define I2C_ENABLE_ENABLE FIELD(1, 1, 0)
51 #define I2C_ENABLE_DISABLE FIELD(0, 1, 0)
53 #define I2C_STATUS_RFF FIELD(1, 1, 4)
54 #define I2C_STATUS_RFNE FIELD(1, 1, 3)
55 #define I2C_STATUS_TFE FIELD(1, 1, 2)
56 #define I2C_STATUS_TFNF FIELD(1, 1, 1)
57 #define I2C_STATUS_ACTIVITY FIELD(1, 1, 0)
59 #define I2C_ENSTATUS_ENABLE FIELD(1, 1, 0)
61 #define I2C_TAR_THERMAL 0x4f
62 #define I2C_TAR_SPD 0x50
63 #define I2C_TAR_PWIC 0x55
64 #define I2C_TAR_EEPROM 0x57