]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
inmates: e1000-demo: Write RX tail only after enabling the queue
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 2 Feb 2016 20:52:27 +0000 (21:52 +0100)
committerJan Kiszka <jan.kiszka@siemens.com>
Wed, 3 Feb 2016 16:45:40 +0000 (17:45 +0100)
The 82575 ignores all writes prior to enabling the queue or the complete
receiver. Reorder writes, clearing the tail first - just in case.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
inmates/demos/x86/e1000-demo.c

index 6aaa102cd5a256512996dbb014551c4d0fe03857..abb11d02fd7dbcc764039c66838d314e96ddf6e7 100644 (file)
@@ -283,13 +283,15 @@ void inmate_main(void)
        mmio_write32(mmiobar + E1000_REG_RDBAH, 0);
        mmio_write32(mmiobar + E1000_REG_RDLEN, sizeof(rx_ring));
        mmio_write32(mmiobar + E1000_REG_RDH, 0);
-       mmio_write32(mmiobar + E1000_REG_RDT, RX_DESCRIPTORS - 1);
+       mmio_write32(mmiobar + E1000_REG_RDT, 0);
 
        val = mmio_read32(mmiobar + E1000_REG_RCTL);
        val |= E1000_RCTL_EN | E1000_RCTL_BAM | E1000_RCTL_BSIZE_2048 |
                E1000_RCTL_SECRC;
        mmio_write32(mmiobar + E1000_REG_RCTL, val);
 
+       mmio_write32(mmiobar + E1000_REG_RDT, RX_DESCRIPTORS - 1);
+
        mmio_write32(mmiobar + E1000_REG_TDBAL, (unsigned long)&tx_ring);
        mmio_write32(mmiobar + E1000_REG_TDBAH, 0);
        mmio_write32(mmiobar + E1000_REG_TDLEN, sizeof(tx_ring));