Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Feb 2009 18:51:14 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r188167 - head/sys/dev/exca
Message-ID:  <200902051851.n15IpEqD034995@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Thu Feb  5 18:51:14 2009
New Revision: 188167
URL: http://svn.freebsd.org/changeset/base/188167

Log:
  Add some additional debugging for the memory code.

Modified:
  head/sys/dev/exca/exca.c

Modified: head/sys/dev/exca/exca.c
==============================================================================
--- head/sys/dev/exca/exca.c	Thu Feb  5 18:46:01 2009	(r188166)
+++ head/sys/dev/exca/exca.c	Thu Feb  5 18:51:14 2009	(r188167)
@@ -209,12 +209,9 @@ exca_do_mem_map(struct exca_softc *sc, i
 	exca_putb(sc, map->cardmem_msb, ((offset >> 8) &
 	    EXCA_CARDMEM_ADDRX_MSB_ADDR_MASK) | attrmem);
 
-#ifdef EXCA_DEBUG
-	if (mem->kind & PCCARD_MEM_ATTR)
-		printf("attribtue memory\n");
-	else
-		printf("common memory\n");
-#endif
+	DPRINTF("%s %d-bit memory",
+	    mem->kind & PCCARD_MEM_ATTR ? "attrubute" : "common",
+	    mem->kind & PCCARD_MEM_16BIT ? 16 : 8);
 	exca_setb(sc, EXCA_ADDRWIN_ENABLE, map->memenable |
 	    EXCA_ADDRWIN_ENABLE_MEMCS16);
 
@@ -229,11 +226,11 @@ exca_do_mem_map(struct exca_softc *sc, i
 		r5 = exca_getb(sc, map->cardmem_msb);
 		r6 = exca_getb(sc, map->cardmem_lsb);
 		r7 = exca_getb(sc, map->sysmem_win);
-		printf("exca_do_mem_map win %d: %02x%02x %02x%02x "
-		    "%02x%02x %02x (%08x+%06x.%06x*%06x)\n",
+		printf("exca_do_mem_map win %d: %#02x%#02x %#02x%#02x "
+		    "%#02x%#02x %#02x (%#08x+%#06x.%#06x*%#06x) flags %#x\n",
 		    win, r1, r2, r3, r4, r5, r6, r7,
 		    mem->addr, mem->size, mem->realsize,
-		    mem->cardaddr);
+		    mem->cardaddr, mem->kind);
 	}
 #endif
 }
@@ -259,10 +256,18 @@ exca_mem_map(struct exca_softc *sc, int 
 	}
 	if (win >= EXCA_MEM_WINS)
 		return (ENOSPC);
-	if (((rman_get_start(res) >> EXCA_MEMREG_WIN_SHIFT) & 0xff) != 0 &&
-	    (sc->flags & EXCA_HAS_MEMREG_WIN) == 0) {
-		device_printf(sc->dev, "Does not support mapping above 24M.");
-		return (EINVAL);
+	if (sc->flags & EXCA_HAS_MEMREG_WIN) {
+		if (rman_get_start(res) >> (EXCA_MEMREG_WIN_SHIFT + 8) != 0) {
+			device_printf(sc->dev,
+			    "Does not support mapping above 4GB.");
+			return (EINVAL);
+		}
+	} else {
+		if (rman_get_start(res) >> EXCA_MEMREG_WIN_SHIFT != 0) {
+			device_printf(sc->dev,
+			    "Does not support mapping above 16M.");
+			return (EINVAL);
+		}
 	}
 
 	sc->mem[win].cardaddr = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902051851.n15IpEqD034995>