aboutsummaryrefslogtreecommitdiff
path: root/include/hw
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.ibm.com>2023-03-31 13:30:49 -0400
committerThomas Huth <thuth@redhat.com>2023-04-20 11:25:32 +0200
commita3ebb580a21c89d22ac5f52bd70814c997f28893 (patch)
tree69d2516db2aa586b7a497d651830805d16f725ca /include/hw
parent2243299a748dbc7581205e043dcdb66627a062dd (diff)
downloadqemu-a3ebb580a21c89d22ac5f52bd70814c997f28893.zip
qemu-a3ebb580a21c89d22ac5f52bd70814c997f28893.tar.gz
qemu-a3ebb580a21c89d22ac5f52bd70814c997f28893.tar.bz2
qtest: Add functions for accessing devices on Aspeed I2C controller
Add read and write functions for accessing registers of I2C devices connected to the Aspeed I2C controller. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Ninad Palsule <ninad@linux.ibm.com> Message-Id: <20230331173051.3857801-2-stefanb@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/i2c/aspeed_i2c.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/hw/i2c/aspeed_i2c.h b/include/hw/i2c/aspeed_i2c.h
index adc904d..51c944e 100644
--- a/include/hw/i2c/aspeed_i2c.h
+++ b/include/hw/i2c/aspeed_i2c.h
@@ -38,6 +38,13 @@ OBJECT_DECLARE_TYPE(AspeedI2CState, AspeedI2CClass, ASPEED_I2C)
#define ASPEED_I2C_OLD_NUM_REG 11
#define ASPEED_I2C_NEW_NUM_REG 22
+#define A_I2CD_M_STOP_CMD BIT(5)
+#define A_I2CD_M_RX_CMD BIT(3)
+#define A_I2CD_M_TX_CMD BIT(1)
+#define A_I2CD_M_START_CMD BIT(0)
+
+#define A_I2CD_MASTER_EN BIT(0)
+
/* Tx State Machine */
#define I2CD_TX_STATE_MASK 0xf
#define I2CD_IDLE 0x0