Prevent LAN9118 driver to finish in hardware error when writing to the BYTE_TEST register.
This register (even if ReadOnly) is used to wake-up the device when it is in low power consumption mode. Add case for BYTE_TEST in lan9118_writel method. Just write some documentation explaining use its use. Signed-off-by: Bertrand Cachet <[email protected]> --- hw/lan9118.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/hw/lan9118.c b/hw/lan9118.c index f8149e6..65096d4 100644 --- a/hw/lan9118.c +++ b/hw/lan9118.c @@ -977,6 +977,15 @@ static void lan9118_writel(void *opaque, target_phys_addr_t offset, s->pmt_ctrl &= ~0x34e; s->pmt_ctrl |= (val & 0x34e); break; + case CSR_BYTE_TEST: + /* Even if this register is marked ReadOnly in the datasheet, + a write to this register will wake up the device when + PM_MODE is currently in D1 or D2 mode. + + As Power Modes are not handled in this driver, we will + leave this case with no implementation. + */ + break; case CSR_GPIO_CFG: /* Probably just enabling LEDs. */ s->gpio_cfg = val & 0x7777071f; -- 1.7.5.4
