@samitouri / QOSamiQemu / commits / 84001254ec

hw/i3c/aspeed_i3c: Add register RO field masks

Adds read-only register masks for the Aspeed I3C controller registers. Signed-off-by: Joe Komlodi <komlodi@google.com> Reviewed-by: Patrick Venture <venture@google.com> Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com> Tested-by: Jithu Joseph <jithu.joseph@oss.qualcomm.com> Link: https://lore.kernel.org/qemu-devel/20260225021158.1586584-9-jamin_lin@aspeedtech.com Signed-off-by: Cédric Le Goater <clg@redhat.com>

Jamin Lin committed Feb 25, 2026 at 02:12 UTC 84001254ecbcd892fca5d0d529a856a121e36da3
1 file changed +16
hw/i3c/aspeed_i3c.c
+16
@@ -74,6 +74,21 @@ REG32(I3C6_REG1, 0x64)
74 FIELD(I3C6_REG1, SA_EN, 15, 1)
75 FIELD(I3C6_REG1, INST_ID, 16, 4)
76
77 +static const uint32_t ast2600_i3c_controller_ro[ASPEED_I3C_NR_REGS] = {
78 + [R_I3C1_REG0] = 0xcc000000,
79 + [R_I3C1_REG1] = 0xfff00000,
80 + [R_I3C2_REG0] = 0xcc000000,
81 + [R_I3C2_REG1] = 0xfff00000,
82 + [R_I3C3_REG0] = 0xcc000000,
83 + [R_I3C3_REG1] = 0xfff00000,
84 + [R_I3C4_REG0] = 0xcc000000,
85 + [R_I3C4_REG1] = 0xfff00000,
86 + [R_I3C5_REG0] = 0xcc000000,
87 + [R_I3C5_REG1] = 0xfff00000,
88 + [R_I3C6_REG0] = 0xcc000000,
89 + [R_I3C6_REG1] = 0xfff00000,
90 +};
91 +
92 static uint64_t aspeed_i3c_read(void *opaque, hwaddr addr, unsigned int size)
93 {
94 AspeedI3CState *s = ASPEED_I3C(opaque);
@@ -97,6 +112,7 @@ static void aspeed_i3c_write(void *opaque,
112
113 addr >>= 2;
114
115 + data &= ~ast2600_i3c_controller_ro[addr];
116 /* I3C controller register */
117 switch (addr) {
118 case R_I3C1_REG1: