summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/sk/if_sk.c12
-rw-r--r--sys/pci/if_sk.c12
2 files changed, 18 insertions, 6 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;
}
diff --git a/sys/pci/if_sk.c b/sys/pci/if_sk.c
index d00980a..ab4bdd1 100644
--- a/sys/pci/if_sk.c
+++ b/sys/pci/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