summaryrefslogtreecommitdiffstats
path: root/sys/dev/sk
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2004-11-13 20:21:57 +0000
committerbz <bz@FreeBSD.org>2004-11-13 20:21:57 +0000
commita67c7e75123103251e304a51ba19d0530b75981d (patch)
treeda0ebb40a033eb4e93ee142ee7e4c5bde34b2805 /sys/dev/sk
parent7204610fc8f2c52843fcd25dbe3ef07791f99492 (diff)
downloadFreeBSD-src-a67c7e75123103251e304a51ba19d0530b75981d.zip
FreeBSD-src-a67c7e75123103251e304a51ba19d0530b75981d.tar.gz
Set ramsize depending on a value from eprom instead of using
hardcoded 128k for Yukon devices. 88E8001 only has 64k of on-chip RAM[1]. [1] http://www.marvell.com/products/pcconn/yukon/Yukon_88E8001_10_073103_final.pdf Tested by: amd64, current Approved by: rwatson (mentor) MFC after: 1 week
Diffstat (limited to 'sys/dev/sk')
-rw-r--r--sys/dev/sk/if_sk.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c
index d00980a..ab4bdd1 100644
--- a/sys/dev/sk/if_sk.c
+++ b/sys/dev/sk/if_sk.c
@@ -1503,6 +1503,7 @@ skc_attach(dev)
{
struct sk_softc *sc;
int unit, error = 0, rid, *port;
+ uint8_t skrs;
sc = device_get_softc(dev);
unit = device_get_unit(dev);
@@ -1563,9 +1564,10 @@ skc_attach(dev)
/* Read and save vital product data from EEPROM. */
sk_vpd_read(sc);
+ skrs = sk_win_read_1(sc, SK_EPROM0);
if (sc->sk_type == SK_GENESIS) {
/* Read and save RAM size and RAMbuffer offset */
- switch(sk_win_read_1(sc, SK_EPROM0)) {
+ switch(skrs) {
case SK_RAMSIZE_512K_64:
sc->sk_ramsize = 0x80000;
sc->sk_rboff = SK_RBOFF_0;
@@ -1588,8 +1590,12 @@ skc_attach(dev)
error = ENXIO;
goto fail;
}
- } else {
- sc->sk_ramsize = 0x20000;
+ } else { /* SK_YUKON */
+ if (skrs == 0x00) {
+ sc->sk_ramsize = 0x20000;
+ } else {
+ sc->sk_ramsize = skrs * (1<<12);
+ }
sc->sk_rboff = SK_RBOFF_0;
}
OpenPOWER on IntegriCloud