Comment 1 for bug 1910826

Qiuhao Li (qiuhao) wrote :

A more concise version and corresponding notes. Might help :)

-- [ Reproducer

cat << EOF | ../build/qemu-system-i386 -machine q35 \
-nodefaults -device rtl8139,netdev=net0 \
-netdev user,id=net0 -display none -qtest stdio
outl 0xcf8 0x80000804
outb 0xcfc 0x06
outl 0xcf8 0x80000817
outb 0xcfc 0xff
write 0xff000037 0x1 0x0c
writel 0xff000030 0xff000010
write 0xff000040 0x4 0x100006
write 0xff000044 0x4 0x01
write 0xff000010 0x4 0x01
EOF

-- [ Notes

/* Make the MMIO region start from 0xff000000 */
outl 0xcf8 0x80000817
outb 0xcfc 0xff

/*Command Register: enable receiver and transmitter*/
write 0xff000037 0x1 0x0c

/* set Receive (Rx) Buffer Start Address at 0xff000010 */
/* Note: 0xff000010 - 0xff000000 = 0x10 is the offset of TSD0*/
writel 0xff000030 0xff000010

/* TXRR, Tx Retry Count = 1 */
/* set transmit mode into the loopback */
write 0xff000040 0x4 0x100006

/* Receive Configuration Register: Accept All Packets */
write 0xff000044 0x4 0x01

/* TSD0: set Descriptor Size to 1 and trigger a tranfer*/
write 0xff000010 0x4 0x01