aboutsummaryrefslogtreecommitdiff
path: root/hw/i2c
diff options
context:
space:
mode:
authorHang Yu <francis_yuu@stu.pku.edu.cn>2023-08-12 14:52:30 +0800
committerCédric Le Goater <clg@kaod.org>2023-09-01 11:40:04 +0200
commitacc3d20ab21b1e55619089d15ac29cf26e373fc9 (patch)
treefc777a4932eff4240ac29d371b2e8f487e177872 /hw/i2c
parent961faf3ddbd8ffcdf776bbcf88af0bc97218114a (diff)
hw/i2c/aspeed: Add support for buffer organization
Added support for the buffer organization option in pool buffer control register.when set to 1,The buffer is split into two parts: Lower 16 bytes for Tx and higher 16 bytes for Rx. Signed-off-by: Hang Yu <francis_yuu@stu.pku.edu.cn> Reviewed-by: Cédric Le Goater <clg@kaod.org> [ clg: checkpatch fixes ] Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'hw/i2c')
-rw-r--r--hw/i2c/aspeed_i2c.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c
index 44905d7899..7275d40749 100644
--- a/hw/i2c/aspeed_i2c.c
+++ b/hw/i2c/aspeed_i2c.c
@@ -297,6 +297,10 @@ static void aspeed_i2c_bus_recv(AspeedI2CBus *bus)
if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_cmd, RX_BUFF_EN)) {
uint8_t *pool_base = aic->bus_pool_base(bus);
+ if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_pool_ctrl,
+ BUF_ORGANIZATION)) {
+ pool_base += 16;
+ }
for (i = 0; i < pool_rx_count; i++) {
pool_base[i] = i2c_recv(bus->bus);