Переглянути джерело

[realtek] Clear bit 24 of RCR

On an Asus Z87-K motherboard with an onboard 8168 NIC, booting into
Windows 7 and then warm rebooting into iPXE results in a broken RX
datapath: packets can be transmitted successfully but garbage is
received.  A cold reboot clears the problem.

A dump of the PHY registers reveals only one difference: in the
failure case the bits ADVERTISE_PAUSE_CAP and ADVERTISE_PAUSE_ASYM are
cleared.  Explicitly setting these bits does not fix the problem.

A dump of the MAC registers reveals a few differences, of which the
most obvious culprit is the undocumented bit 24 of the Receive
Configuration Register (RCR), which is set in the failure case.
Explicitly clearing this bit does fix the problem.

Reported-by: Sebastian Nielsen <ipxe@sebbe.eu>
Reported-by: Oliver Rath <rath@mglug.de>
Debugged-by: Sebastian Nielsen <ipxe@sebbe.eu>
Tested-by: Sebastian Nielsen <ipxe@sebbe.eu>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 роки тому
джерело
коміт
ccb6e5c627
2 змінених файлів з 3 додано та 2 видалено
  1. 2
    2
      src/drivers/net/realtek.c
  2. 1
    0
      src/drivers/net/realtek.h

+ 2
- 2
src/drivers/net/realtek.c Переглянути файл

708
 
708
 
709
 	/* Configure receiver */
709
 	/* Configure receiver */
710
 	rcr = readl ( rtl->regs + RTL_RCR );
710
 	rcr = readl ( rtl->regs + RTL_RCR );
711
-	rcr &= ~( RTL_RCR_RXFTH_MASK | RTL_RCR_RBLEN_MASK |
712
-		  RTL_RCR_MXDMA_MASK );
711
+	rcr &= ~( RTL_RCR_STOP_WORKING | RTL_RCR_RXFTH_MASK |
712
+		  RTL_RCR_RBLEN_MASK | RTL_RCR_MXDMA_MASK );
713
 	rcr |= ( RTL_RCR_RXFTH_DEFAULT | RTL_RCR_RBLEN_DEFAULT |
713
 	rcr |= ( RTL_RCR_RXFTH_DEFAULT | RTL_RCR_RBLEN_DEFAULT |
714
 		 RTL_RCR_MXDMA_DEFAULT | RTL_RCR_WRAP | RTL_RCR_AB |
714
 		 RTL_RCR_MXDMA_DEFAULT | RTL_RCR_WRAP | RTL_RCR_AB |
715
 		 RTL_RCR_AM | RTL_RCR_APM | RTL_RCR_AAP );
715
 		 RTL_RCR_AM | RTL_RCR_APM | RTL_RCR_AAP );

+ 1
- 0
src/drivers/net/realtek.h Переглянути файл

140
 
140
 
141
 /** Receive (Rx) Configuration Register (dword) */
141
 /** Receive (Rx) Configuration Register (dword) */
142
 #define RTL_RCR 0x44
142
 #define RTL_RCR 0x44
143
+#define RTL_RCR_STOP_WORKING	0x01000000UL /**< Here be dragons */
143
 #define RTL_RCR_RXFTH(x)	( (x) << 13 ) /**< Receive FIFO threshold */
144
 #define RTL_RCR_RXFTH(x)	( (x) << 13 ) /**< Receive FIFO threshold */
144
 #define RTL_RCR_RXFTH_MASK	RTL_RCR_RXFTH ( 0x7 )
145
 #define RTL_RCR_RXFTH_MASK	RTL_RCR_RXFTH ( 0x7 )
145
 #define RTL_RCR_RXFTH_DEFAULT	RTL_RCR_RXFTH ( 0x7 /* Whole packet */ )
146
 #define RTL_RCR_RXFTH_DEFAULT	RTL_RCR_RXFTH ( 0x7 /* Whole packet */ )

Завантаження…
Відмінити
Зберегти