From patchwork Mon Nov 14 09:39:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: LAN9118: Handling write to BYTE_TEST register Date: Sun, 13 Nov 2011 23:39:57 -0000 From: bertrand.cachet@heig-vd.ch X-Patchwork-Id: 125504 Message-Id: <1321263597-17479-1-git-send-email-bertrand.cachet@heig-vd.ch> To: Cc: Bertrand Cachet 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 --- 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;