Commit c2cc649
committed
[ot] hw/opentitan: fix Earlgrey GPIO DIRECT_OUT/DIRECT_OE readback
ot_gpio_eg_read() returned s->regs[reg] for DIRECT_OUT and DIRECT_OE.
Those register slots are only updated on a direct write, but firmware
that drives outputs through MASKED_OUT_{LOWER,UPPER} /
MASKED_OE_{LOWER,UPPER} updates s->data_out / s->data_oe and never the
DIRECT_* register slots. As a result a value set via a masked write was
not observable through a DIRECT_OUT read, which read back as 0.
DIRECT_OUT and the MASKED_OUT registers are alternate views of the same
output data register on real hardware (likewise DIRECT_OE and MASKED_OE),
so return the live s->data_out / s->data_oe instead.
Signed-off-by: Miguel Osorio <miguelosorio@google.com>1 parent b28bb56 commit c2cc649
1 file changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
344 | | - | |
345 | 343 | | |
346 | 344 | | |
347 | 345 | | |
348 | 346 | | |
349 | 347 | | |
350 | 348 | | |
351 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
352 | 363 | | |
353 | 364 | | |
354 | 365 | | |
| |||
0 commit comments