david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[realtek] Use read-modify-write to check for C+ Command register

Some bits in the C+ Command register are always one.  Testing for the
presence of the register must allow for this.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2012-08-23 12:38:37 +01:00
parent 77afdc5643
commit 0e61beb26f
1 changed files with 4 additions and 3 deletions

View File

@ -879,8 +879,9 @@ static void realtek_detect ( struct realtek_nic *rtl ) {
* Try to enable C+ mode and PCI Dual Address Cycle (for
* 64-bit systems), if supported.
*/
cpcr = ( RTL_CPCR_DAC | RTL_CPCR_MULRW | RTL_CPCR_CPRX |
RTL_CPCR_CPTX );
cpcr = readw ( rtl->regs + RTL_CPCR );
cpcr |= ( RTL_CPCR_DAC | RTL_CPCR_MULRW | RTL_CPCR_CPRX |
RTL_CPCR_CPTX );
writew ( cpcr, rtl->regs + RTL_CPCR );
check_cpcr = readw ( rtl->regs + RTL_CPCR );
@ -890,7 +891,7 @@ static void realtek_detect ( struct realtek_nic *rtl ) {
rtl->have_phy_regs = 1;
rtl->tppoll = RTL_TPPOLL_8169;
} else {
if ( check_cpcr == cpcr ) {
if ( ( check_cpcr == cpcr ) && ( cpcr != 0xffff ) ) {
DBGC ( rtl, "REALTEK %p appears to be an RTL8139C+\n",
rtl );
rtl->tppoll = RTL_TPPOLL_8139CP;