Files
Claude 6753c5f3db Fix defects found in a code sweep and a TRM cross-check
Security Engine: CTR ignored its input and returned the raw keystream;
CBC encrypt skipped the IV on the first block and saved the wrong
chaining value, so every CMAC over more than one block was wrong; OFB
was broken. The datapath now follows INPUT_SEL/XOR_POS/VCTRAM_SEL the
way bdk drives it, and matches OpenSSL for ECB, CBC, OFB, CTR and
CMAC. SHA-256 works in parts (SHA_CONTINUE), SE_OP_CTX_SAVE reads keys
back as se_aes_ctx_get_keys() expects, unwrap honours the word quad,
guest block counts and LL sizes are bounded, and unreachable buffers
end the op with an error.

Soft reboot now resets the whole SoC (GPIO/pinmux cache, UARTs, I2C,
PMC, CAR, flow controller, SE, touch, SDMMC, display, ACTMON, ...)
while keeping what hardware keeps (PMC SCRATCH0, the RTC, and the PMIC
unless the reboot is a power cycle). DRAM gets fresh zero pages
instead of a memset that made all 2 GB resident; stale BPMP
translations are dropped; CPSR returns to SVC; scripts restart.

Execution: a branch to address 0 no longer hangs the emulator
(until=0 made PC 0 an exit); bdk's reset-then-bpmp_halt() reboots
instead of exiting; an untimed halt with CPU0 running parks the BPMP
and lets CPU0 continue; CPU0 starts in the same batch it is released
in; CPU0 drops translations of pages the BPMP rewrote; shared models
no longer see time run backwards.

TRM cross-check: RST_CPUG_CMPLX resets to 0x2000feef and CPU0 runs on
CPURESET0/CORERESET0/L2RESET/NONCPURESET (bit names corrected); RAM
repair clears REQ and sets STS, and is no longer a run condition;
refused releases are re-evaluated; MSELECT ENABLE_PCIE_APERTURE gates
PCIe; RST_DEVICES_W/Y direct writes land; DL_UP is read-only; the
whole config aperture and memory window decode; OSC_CTRL reports
38.4 MHz; PLLE/PLLREFE no longer get bit 27 forced into a divider;
PMC is a R/W register file; RTC SECONDS counts; FLOW halt modes follow
17.2.2 and STOP_UNTIL_IRQ wakes on the armed TMR; UART IIR/IER/
loopback MSR; I2C NOACK code and empty I2C4/I2C6 buses; pinmux reset
values; the COP ACTMON counts halt time.

Peripherals: MAX77620 LDO power-good follows the rail (hwtest's
gamecard probe no longer fails), the Erista GPU MAX77621 answers at
0x1C, regulators ACK per generation, RTC CONTROL is binary/24h, PS3
card detect reads "slot empty", packet-mode I2C parses 4 bytes per
word, rawnand I/O splits at part boundaries, eMMC returns to its user
area on CMD0, ADMA2 descriptors decode per spec, SD CMD6/ACMD13 data
reaches the programmed buffer, ERR_INTERRUPT is reported, R1 follows
block commands.

Frontend and tooling: touch events queue instead of overwriting each
other, map through rotation overrides and bdk's edge offset, and use
finger ID 0; a scripted press is always seen before its release;
zeroed fuses persist in the ini; dropped UTF-8 paths open on Windows;
bad --input-script is an error; test scripts check exit status and
missing arguments; make_sd.py quotes names and picks a FAT32-valid
cluster size; the Dockerfile marks the mount safe for git.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YYewwDPujjo5B2xRyC5Grb
2026-09-25 17:45:02 +00:00

473 lines
17 KiB
C++

#include "i2c3.h"
#include "trace.h"
#include "../emu_state.h"
#include "memory_map.h"
#include <array>
#include <cstdio>
#include <cstring>
#include <vector>
// ============================================================================
// I²C3 + STMFTS (FTS4) touchscreen stub
//
// Reference:
// - hekate/bdk/soc/i2c.c — Tegra I²C controller register protocol
// - hekate/bdk/input/touch.{c,h} — STMFTS / FTS4 wire protocol on I²C3@0x49
//
// Hekate uses two I²C transfer modes:
// * Normal mode: writes/reads ≤8 bytes via CMD_DATA1/CMD_DATA2 with a single
// CMD_ADDR0+CNFG round-trip. Used for short FTS4 commands.
// * Packet mode: variable-length, FIFO-driven. A 3-word header is pushed to
// TX_FIFO, then payload words. Combined write+read sequences use a
// REP_START header followed by a READ header. Used for FTS4 register
// reads (HW_REG_READ, FB_REG_READ) and event polling.
//
// This stub captures TX bytes from both modes into `tx_buf`, runs an
// `execute()` step that interprets the FTS4 command and produces RX bytes
// in `rx_buf`, and serves those bytes back through CMD_DATA1/2 (normal) or
// RX_FIFO (packet).
// ============================================================================
namespace {
// ---- FTS4 command opcodes (subset we need) ----
constexpr uint8_t FTS4_CMD_READ_INFO = 0x80;
constexpr uint8_t FTS4_CMD_READ_STATUS = 0x84;
constexpr uint8_t FTS4_CMD_READ_ONE_EVENT = 0x85;
constexpr uint8_t FTS4_CMD_READ_ALL_EVENT = 0x86;
constexpr uint8_t FTS4_CMD_LATEST_EVENT = 0x87;
constexpr uint8_t FTS4_CMD_MS_MT_SENSE_OFF = 0x92;
constexpr uint8_t FTS4_CMD_MS_MT_SENSE_ON = 0x93;
constexpr uint8_t FTS4_CMD_SYSTEM_RESET = 0xA0;
constexpr uint8_t FTS4_CMD_CLEAR_EVENT_STACK = 0xA1;
constexpr uint8_t FTS4_CMD_HW_REG_READ = 0xB6; // also HW_REG_WRITE
constexpr uint8_t FTS4_CMD_SWITCH_SENSE_MODE = 0xC3;
constexpr uint8_t FTS4_CMD_VENDOR = 0xCF;
constexpr uint8_t FTS4_CMD_FB_REG_READ = 0xD0; // also FB_REG_WRITE
constexpr uint8_t FTS4_VENDOR_GPIO_STATE = 0x01;
// ---- FTS4 HW register addresses (accessed via 0xB6) ----
constexpr uint16_t FTS4_HW_REG_CHIP_ID_INFO_ALT = 0x0002; // returns chip_id at bytes [3..4]
constexpr uint16_t FTS4_HW_REG_CHIP_ID_INFO = 0x0004; // returns chip_id at bytes [1..2]
constexpr uint16_t FTS4_HW_REG_EVENT_COUNT = 0x0023;
constexpr uint16_t FTS4_HW_REG_SYS_RESET = 0x0028;
// ---- FTS4 chip identity ----
constexpr uint16_t FTS4_CHIP_ID = 0x3670;
// ---- FTS4 event opcodes (low nibble of event[0]) ----
constexpr uint8_t FTS4_EV_NO_EVENT = 0x00;
constexpr uint8_t FTS4_EV_MULTI_TOUCH_ENTER = 0x03;
constexpr uint8_t FTS4_EV_MULTI_TOUCH_LEAVE = 0x04;
constexpr uint8_t FTS4_EV_MULTI_TOUCH_MOTION = 0x05;
constexpr uint8_t FTS4_EV_CONTROLLER_READY = 0x10;
constexpr uint8_t FTS4_EV_VENDOR = 0x20;
// ---- Tegra I²C packet header flags (mmio.h-style bit positions) ----
constexpr uint32_t I2C_HEADER_CONT_XFER = 1u << 15;
constexpr uint32_t I2C_HEADER_REP_START = 1u << 16;
constexpr uint32_t I2C_HEADER_READ = 1u << 19;
// ---- I²C controller register offsets (within I2C3_BASE) ----
constexpr uint32_t I2C_CNFG = 0x00;
constexpr uint32_t I2C_CMD_ADDR0 = 0x04;
constexpr uint32_t I2C_CMD_DATA1 = 0x0C;
constexpr uint32_t I2C_CMD_DATA2 = 0x10;
constexpr uint32_t I2C_STATUS = 0x1C;
constexpr uint32_t I2C_TX_FIFO = 0x50;
constexpr uint32_t I2C_RX_FIFO = 0x54;
constexpr uint32_t I2C_PACKET_TRANSFER_STATUS = 0x58;
constexpr uint32_t I2C_FIFO_CONTROL = 0x5C;
constexpr uint32_t I2C_FIFO_STATUS = 0x60;
constexpr uint32_t I2C_INT_STATUS = 0x68;
constexpr uint32_t I2C_CONFIG_LOAD = 0x8C;
constexpr uint32_t CNFG_CMD1_READ = 1u << 6; // 0=write, 1=read
constexpr uint32_t CNFG_NORMAL_MODE_GO = 1u << 9;
constexpr uint32_t CNFG_PACKET_MODE_GO = 1u << 10;
constexpr uint32_t INT_STATUS_BUS_CLEAR_DONE = 1u << 11;
// ---- I²C controller state ----
uint8_t slave_addr = 0; // 7-bit target slave
bool dir_read = false; // last direction set via CMD_ADDR0 / packet header
uint32_t cmd_data[2] = {0}; // staged CMD_DATA1/CMD_DATA2 for normal-mode writes
uint32_t last_cnfg = 0; // last value written to CNFG; the driver does a
// read-modify-write to set NORMAL_MODE_GO, so we
// must echo this back through i2c3_read.
// Packet-mode header parser
enum PktState { PKT_HDR_W1, PKT_HDR_W2, PKT_HDR_W3, PKT_PAYLOAD };
PktState pkt_state = PKT_HDR_W1;
uint32_t pkt_size = 0; // expected payload bytes (size-1 from header word 2)
uint32_t pkt_recv = 0; // payload bytes received so far
bool pkt_is_combined = false; // true if write phase of REP_START combined op (defer execute)
// FTS4 command/response buffers
std::vector<uint8_t> tx_buf; // accumulated TX bytes (cmd byte first)
std::vector<uint8_t> rx_buf; // staged RX bytes
size_t rx_pos = 0; // read pointer into rx_buf
// FTS4 event stack (head = oldest event). Each entry is one 8-byte event.
std::vector<std::array<uint8_t, 8>> ev_stack;
// ---- Helpers ----
void push_event(uint8_t op, uint8_t finger, uint16_t x, uint16_t y, uint16_t pressure) {
std::array<uint8_t, 8> ev = {0};
ev[0] = (uint8_t)((finger << 4) | (op & 0x0F));
ev[1] = (uint8_t)((x >> 4) & 0xFF);
ev[2] = (uint8_t)((y >> 4) & 0xFF);
ev[3] = (uint8_t)(((x & 0xF) << 4) | (y & 0xF));
ev[4] = (uint8_t)(pressure & 0xFF);
ev[5] = (uint8_t)((pressure >> 8) & 0xFF);
ev[6] = 0x40; // pressure modifier sentinel — touch.c uses 0x40 fallback
ev[7] = 0x00;
if (ev_stack.size() < 32) ev_stack.push_back(ev);
}
void push_controller_ready() {
std::array<uint8_t, 8> ev = {FTS4_EV_CONTROLLER_READY, 0, 0, 0, 0, 0, 0, 0};
if (ev_stack.size() < 32) ev_stack.push_back(ev);
}
// Move whatever SDL has queued into the FTS4 event stack, oldest first.
void try_emit_pending_touch(EmuState *state) {
EmuState::TouchEvent ev;
while (ev_stack.size() < 32 && state->touch_take(&ev)) {
// pressure: a small non-zero value keeps z below the 500-palm-reject
// threshold in touch.c (z = (pressure_lo|pressure_hi<<8) << 6 / (mod+0x40)).
uint16_t pressure = (ev.op == FTS4_EV_MULTI_TOUCH_LEAVE) ? 0 : 0x10;
push_event(ev.op, state->tc_finger_id, ev.x, ev.y, pressure);
}
}
// Pop oldest event into 8-byte buffer; on empty, return NO_EVENT.
void pop_event_to(uint8_t *buf) {
if (ev_stack.empty()) {
std::memset(buf, 0, 8);
buf[0] = FTS4_EV_NO_EVENT;
return;
}
std::memcpy(buf, ev_stack.front().data(), 8);
ev_stack.erase(ev_stack.begin());
}
// Run the buffered TX as an FTS4 command; populate rx_buf for the read phase.
void execute(EmuState *state, uint32_t expected_rx_size) {
rx_buf.clear();
rx_pos = 0;
if (tx_buf.empty()) return;
uint8_t cmd = tx_buf[0];
if (slave_addr != 0x49) {
// Not the touchscreen — return zeros (no other slaves modelled on I²C3).
if (dir_read) rx_buf.assign(expected_rx_size ? expected_rx_size : 1, 0);
return;
}
switch (cmd) {
case FTS4_CMD_HW_REG_READ: { // 0xB6 — also HW_REG_WRITE
if (tx_buf.size() < 3) break;
uint16_t reg = ((uint16_t)tx_buf[1] << 8) | tx_buf[2];
if (dir_read) {
// HW_REG_READ
if (reg == FTS4_HW_REG_CHIP_ID_INFO) {
// touch.c expects: chip_id = buf[1]<<8 | buf[2]; fw = buf[3]<<8 | buf[4]
rx_buf = {0x00,
(uint8_t)(FTS4_CHIP_ID >> 8), (uint8_t)(FTS4_CHIP_ID & 0xFF),
0x00, 0x01, // fw_ver = 0x0001
0x00, 0x00}; // config_id, config_ver
} else if (reg == FTS4_HW_REG_CHIP_ID_INFO_ALT) {
// Anti-clone check: chip_id at bytes [3..4]
rx_buf = {0x00, 0x00, 0x00,
(uint8_t)(FTS4_CHIP_ID >> 8), (uint8_t)(FTS4_CHIP_ID & 0xFF),
0x00, 0x00};
} else if (reg == FTS4_HW_REG_EVENT_COUNT) {
try_emit_pending_touch(state);
// touch_get_event_count: returns buf[1] >> 1
uint8_t cnt = (uint8_t)ev_stack.size();
rx_buf = {0x00, (uint8_t)(cnt << 1)};
} else {
rx_buf.assign(expected_rx_size ? expected_rx_size : 4, 0);
}
} else {
// HW_REG_WRITE: tx_buf[1..2] = reg, tx_buf[3..] = value
if (reg == FTS4_HW_REG_SYS_RESET && tx_buf.size() >= 4 && tx_buf[3] == 0x80) {
ev_stack.clear();
push_controller_ready();
}
// Other HW writes: ignored.
}
break;
}
case FTS4_CMD_FB_REG_READ: { // 0xD0
// touch_get_fw_info() does two reads:
// 1. cmd = {0xD0, 0x00, 0x60}; reads 3 bytes. Hekate then forms the
// next address as cmd[1] = buf[2]; cmd[2] = buf[1]; — i.e. the
// payload of the second read lives at offset (buf[2] << 8) | buf[1].
// We hand back {x, 0x70, 0x00} so the second read targets 0x0070.
// 2. cmd = {0xD0, 0x00, 0x70}; reads 9 bytes. Hekate decodes it as
// fw_id = (buf[1] << 24) | (buf[2] << 16) | (buf[3] << 8) | buf[4]
// ftb_ver = (buf[6] << 8) | buf[5]
// fw_rev = (buf[8] << 8) | buf[7]
if (tx_buf.size() >= 3) {
uint16_t fb_off = ((uint16_t)tx_buf[1] << 8) | tx_buf[2];
if (fb_off == 0x0060) {
rx_buf = {0x00, 0x70, 0x00};
break;
}
if (fb_off == 0x0070) {
uint32_t fw = state->touch_fw_id.load();
uint16_t ftb = state->touch_ftb_ver.load();
uint16_t rev = state->touch_fw_rev.load();
rx_buf = {
0x00,
(uint8_t)((fw >> 24) & 0xFF), (uint8_t)((fw >> 16) & 0xFF),
(uint8_t)((fw >> 8) & 0xFF), (uint8_t)(fw & 0xFF),
(uint8_t)(ftb & 0xFF), (uint8_t)((ftb >> 8) & 0xFF),
(uint8_t)(rev & 0xFF), (uint8_t)((rev >> 8) & 0xFF),
};
break;
}
}
// Anything else: zero-pad to whatever the controller expects.
rx_buf.assign(expected_rx_size ? expected_rx_size : 4, 0);
break;
}
case FTS4_CMD_VENDOR: { // 0xCF
// touch_get_panel_vendor() sends one byte (FTS4_VENDOR_GPIO_STATE) and
// waits for an FTS4_EV_VENDOR event whose status byte matches. The event
// payload (tmp[2..]) carries gpio0/gpio1/gpio2, looked up against the
// _panels[] table in Hekate's bdk/input/touch.c. We mirror that table.
static constexpr uint8_t kPanelGpios[][3] = {
{1, 1, 1}, // 0: NISSHA NFT-K12D
{0, 1, 1}, // 1: GiS GGM6 B2X
{0, 0, 0}, // 2: NISSHA NBF-K9A
{1, 0, 0}, // 3: GiS 5.5"
{0, 0, 1}, // 4: Samsung TSP
{1, 0, 1}, // 5: GiS VA 6.2" (Hekate stores idx=-1 for this row)
};
if (tx_buf.size() >= 2 && tx_buf[1] == FTS4_VENDOR_GPIO_STATE) {
uint8_t idx = state->touch_panel_idx.load();
if (idx >= sizeof(kPanelGpios) / sizeof(kPanelGpios[0])) idx = 0;
std::array<uint8_t, 8> ev = {
FTS4_EV_VENDOR, FTS4_VENDOR_GPIO_STATE,
kPanelGpios[idx][0], kPanelGpios[idx][1], kPanelGpios[idx][2],
0, 0, 0,
};
if (ev_stack.size() < 32) ev_stack.push_back(ev);
}
break;
}
case FTS4_CMD_LATEST_EVENT:
case FTS4_CMD_READ_ONE_EVENT:
case FTS4_CMD_READ_ALL_EVENT: {
try_emit_pending_touch(state);
rx_buf.resize(8);
pop_event_to(rx_buf.data());
break;
}
case FTS4_CMD_SYSTEM_RESET:
ev_stack.clear();
push_controller_ready();
break;
case FTS4_CMD_CLEAR_EVENT_STACK:
ev_stack.clear();
break;
case FTS4_CMD_MS_MT_SENSE_ON:
case FTS4_CMD_MS_MT_SENSE_OFF:
case FTS4_CMD_SWITCH_SENSE_MODE:
case FTS4_CMD_READ_INFO:
case FTS4_CMD_READ_STATUS:
default:
// Unmodelled writes are ACKed silently; unmodelled reads return zeros.
if (dir_read) rx_buf.assign(expected_rx_size ? expected_rx_size : 1, 0);
break;
}
TRACE("[i2c3] EXEC slave=0x%02X dir=%c cmd=0x%02X tx=%zuB rx=%zuB stack=%zu\n",
slave_addr, dir_read ? 'R' : 'W', cmd, tx_buf.size(), rx_buf.size(),
ev_stack.size());
}
// Pack up to 4 bytes from rx_buf at the current read pointer into a u32.
uint32_t pull_rx_word() {
uint32_t v = 0;
for (size_t i = 0; i < 4 && rx_pos + i < rx_buf.size(); ++i) {
v |= ((uint32_t)rx_buf[rx_pos + i]) << (i * 8);
}
rx_pos += 4;
return v;
}
} // namespace
void i2c3_reset(EmuState *state) {
slave_addr = 0;
dir_read = false;
cmd_data[0] = cmd_data[1] = 0;
last_cnfg = 0;
pkt_state = PKT_HDR_W1;
pkt_size = pkt_recv = 0;
pkt_is_combined = false;
tx_buf.clear();
rx_buf.clear();
rx_pos = 0;
ev_stack.clear();
EmuState::TouchEvent ev;
while (state->touch_take(&ev)) {
}
state->tc_pressed = false;
}
uint32_t i2c3_read(EmuState *state, uint64_t addr) {
uint32_t offset = (uint32_t)(addr - I2C3_BASE);
switch (offset) {
case I2C_CNFG:
// The driver does CNFG = (CNFG & ~NORMAL_MODE_GO) | NORMAL_MODE_GO to kick
// off a transfer; if we returned 0, the size field would be lost. Echo the
// last written CNFG value back so the read-modify-write preserves config.
return last_cnfg;
case I2C_CMD_DATA1:
return pull_rx_word();
case I2C_CMD_DATA2:
return pull_rx_word();
case I2C_STATUS:
return 0; // not busy, no NACK
case I2C_RX_FIFO:
return pull_rx_word();
case I2C_PACKET_TRANSFER_STATUS: {
// Bits 4..15 = bytes transferred. Driver compares == (size - 1).
uint32_t bytes = pkt_size;
return (bytes ? (bytes - 1) << 4 : 0);
}
case I2C_FIFO_STATUS: {
size_t left = (rx_pos < rx_buf.size()) ? (rx_buf.size() - rx_pos) : 0;
uint32_t words = (uint32_t)((left + 3) / 4);
if (words > 8) words = 8;
return words; // RX_FIFO_FULL_CNT in low 4 bits
}
case I2C_INT_STATUS:
return INT_STATUS_BUS_CLEAR_DONE;
case I2C_CONFIG_LOAD:
return 0; // load complete
default:
return 0;
}
(void)state;
}
void i2c3_write(EmuState *state, uint64_t addr, uint32_t val) {
uint32_t offset = (uint32_t)(addr - I2C3_BASE);
switch (offset) {
case I2C_CNFG: {
last_cnfg = val;
bool packet_go = val & CNFG_PACKET_MODE_GO;
bool normal_go = val & CNFG_NORMAL_MODE_GO;
bool is_read = val & CNFG_CMD1_READ;
uint32_t total = ((val >> 1) & 0x7) + 1; // (size-1)+1 in bits [3:1]
if (normal_go) {
if (!is_read) {
// Capture TX bytes from CMD_DATA1/CMD_DATA2.
tx_buf.clear();
for (uint32_t i = 0; i < total; ++i) {
uint32_t word = (i < 4) ? cmd_data[0] : cmd_data[1];
uint8_t b = (word >> ((i % 4) * 8)) & 0xFF;
tx_buf.push_back(b);
}
dir_read = false;
execute(state, 0);
} else {
// Read direction — rx_buf was prepared by the preceding write+execute.
// Driver will read CMD_DATA1 (and DATA2 if total > 4) next.
dir_read = true;
// If no rx prepared (e.g. raw read with no preceding write), produce zeros.
if (rx_buf.empty()) rx_buf.assign(total, 0);
rx_pos = 0;
}
}
if (packet_go) {
// Reset packet header parser; subsequent TX_FIFO writes start a fresh packet.
pkt_state = PKT_HDR_W1;
pkt_size = 0;
pkt_recv = 0;
}
break;
}
case I2C_CMD_ADDR0:
slave_addr = (val >> 1) & 0x7F;
dir_read = (val & 1);
break;
case I2C_CMD_DATA1:
cmd_data[0] = val;
break;
case I2C_CMD_DATA2:
cmd_data[1] = val;
break;
case I2C_TX_FIFO: {
switch (pkt_state) {
case PKT_HDR_W1:
pkt_state = PKT_HDR_W2;
break;
case PKT_HDR_W2:
pkt_size = val + 1;
pkt_state = PKT_HDR_W3;
break;
case PKT_HDR_W3: {
bool is_read = val & I2C_HEADER_READ;
bool is_rep_start = val & I2C_HEADER_REP_START;
// Re-extract slave addr from header (bits 1..7 = addr<<1, bit 0 = R/W flag)
uint8_t hdr_slave = (val >> 1) & 0x7F;
slave_addr = hdr_slave;
dir_read = is_read;
if (is_read) {
// Combined read phase: produce RX from previously buffered TX.
execute(state, pkt_size);
pkt_state = PKT_HDR_W1;
} else {
// Write phase. Defer execute if a read header is expected to follow.
tx_buf.clear();
pkt_recv = 0;
pkt_is_combined = is_rep_start;
pkt_state = PKT_PAYLOAD;
}
break;
}
case PKT_PAYLOAD:
for (int b = 0; b < 4 && pkt_recv < pkt_size; ++b) {
tx_buf.push_back((val >> (b * 8)) & 0xFF);
pkt_recv++;
}
if (pkt_recv >= pkt_size) {
if (!pkt_is_combined) {
// Pure write (CONT_XFER) — execute now with no expected RX.
execute(state, 0);
}
// Combined writes defer execution to the upcoming READ header.
pkt_state = PKT_HDR_W1;
}
break;
}
break;
}
case I2C_FIFO_CONTROL:
if (val & 0x1) { // RX_FIFO_FLUSH
rx_pos = rx_buf.size();
}
break;
case I2C_INT_STATUS:
// Write-1-clear from driver — no internal state to clear.
break;
case I2C_CONFIG_LOAD:
// Auto-clears in real HW; we already report 0 on read.
break;
default:
break;
}
}