]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[realtek] Always set high dword of ring address registers
authorMichael Brown <mcb30@ipxe.org>
Thu, 23 Aug 2012 11:28:50 +0000 (12:28 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 23 Aug 2012 12:35:54 +0000 (13:35 +0100)
Some RTL8169 cards (observed with an RTL8169SC) power up with garbage
values in the ring address registers, and do not clear the registers
on reset.

Fix by always setting the high dword of the ring address registers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/realtek.c

index 3c7b1f856940433bcacb1aa89b59ee8c08b98171..6a119db34a6d9704f346f6004457c6f67b21666d 100644 (file)
@@ -409,11 +409,9 @@ static int realtek_create_ring ( struct realtek_nic *rtl,
 
        /* Program ring address */
        address = virt_to_bus ( ring->desc );
+       writel ( ( ( ( uint64_t ) address ) >> 32 ),
+                rtl->regs + ring->reg + 4 );
        writel ( ( address & 0xffffffffUL ), rtl->regs + ring->reg );
-       if ( sizeof ( physaddr_t ) > sizeof ( uint32_t ) ) {
-               writel ( ( ( ( uint64_t ) address ) >> 32 ),
-                        rtl->regs + ring->reg + 4 );
-       }
        DBGC ( rtl, "REALTEK %p ring %02x is at [%08llx,%08llx)\n",
               rtl, ring->reg, ( ( unsigned long long ) address ),
               ( ( unsigned long long ) address + ring->len ) );