summaryrefslogtreecommitdiffstats
path: root/src/drivers/net
diff options
context:
space:
mode:
authorMike McCormack2017-03-23 16:54:03 +0100
committerMichael Brown2017-03-23 16:54:03 +0100
commita317e9a310d6ea5288edd39d9933e6c2fb2358aa (patch)
treeac888bda4816860e37e94418044d850f401adac1 /src/drivers/net
parent[pcnet32] Eliminate redundant register read (diff)
downloadipxe-a317e9a310d6ea5288edd39d9933e6c2fb2358aa.tar.gz
ipxe-a317e9a310d6ea5288edd39d9933e6c2fb2358aa.tar.xz
ipxe-a317e9a310d6ea5288edd39d9933e6c2fb2358aa.zip
[sky2] Use 32-bit read to read Y2_VAUX_AVAIL
B0_CTST is a 24bit register according to the vendor driver (sk98lin). A 16bit read on B0_CTST will always return 0 for Y2_VAUX_AVAIL (1<<16), so use a 32bit read when testing Y2_VAUX_AVAIL. [This patch is copied directly from the Linux kernel tree.] Signed-off-by: Mike McCormack <mikem@ring3k.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net')
-rw-r--r--src/drivers/net/sky2.c2
-rw-r--r--src/drivers/net/sky2.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/net/sky2.c b/src/drivers/net/sky2.c
index 35ff66c6..211f2246 100644
--- a/src/drivers/net/sky2.c
+++ b/src/drivers/net/sky2.c
@@ -246,7 +246,7 @@ static void sky2_power_aux(struct sky2_hw *hw)
Y2_COR_CLK_LNK2_DIS | Y2_CLK_GAT_LNK2_DIS);
/* switch power to VAUX */
- if (sky2_read16(hw, B0_CTST) & Y2_VAUX_AVAIL)
+ if (sky2_read32(hw, B0_CTST) & Y2_VAUX_AVAIL)
sky2_write8(hw, B0_POWER_CTRL,
(PC_VAUX_ENA | PC_VCC_ENA |
PC_VAUX_ON | PC_VCC_OFF));
diff --git a/src/drivers/net/sky2.h b/src/drivers/net/sky2.h
index 9bb63010..9c331312 100644
--- a/src/drivers/net/sky2.h
+++ b/src/drivers/net/sky2.h
@@ -294,7 +294,7 @@ enum csr_regs {
Y2_CFG_AER = 0x1d00, /* PCI Advanced Error Report region */
};
-/* B0_CTST 16 bit Control/Status register */
+/* B0_CTST 24 bit Control/Status register */
enum {
Y2_VMAIN_AVAIL = 1<<17,/* VMAIN available (YUKON-2 only) */
Y2_VAUX_AVAIL = 1<<16,/* VAUX available (YUKON-2 only) */