summaryrefslogtreecommitdiffstats
path: root/sys/alpha/pci/tsunami.c
diff options
context:
space:
mode:
authorgallatin <gallatin@FreeBSD.org>1999-11-03 01:16:11 +0000
committergallatin <gallatin@FreeBSD.org>1999-11-03 01:16:11 +0000
commitcc3fdb5fc5dedeaa2f62e6949bb5a44dfd5f4aa5 (patch)
treed3c462aaadc10bbf7c44fe2b7f8886cf61bcdd77 /sys/alpha/pci/tsunami.c
parentef92fd8274559bbe8abe33a3ef8a69ba13bbb52f (diff)
downloadFreeBSD-src-cc3fdb5fc5dedeaa2f62e6949bb5a44dfd5f4aa5.zip
FreeBSD-src-cc3fdb5fc5dedeaa2f62e6949bb5a44dfd5f4aa5.tar.gz
Add a second direct map window to increase the maximum RAM this platform
can deal with from 1GB to 2GB. I have no way to test with >1GB because I don't have high enough density memory to get any one box over 1GB. However, I have tested it on xp1000 & ds10 with < 1GB of memory & have verified that it does no harm.
Diffstat (limited to 'sys/alpha/pci/tsunami.c')
-rw-r--r--sys/alpha/pci/tsunami.c71
1 files changed, 43 insertions, 28 deletions
diff --git a/sys/alpha/pci/tsunami.c b/sys/alpha/pci/tsunami.c
index 32fbdcb..43b8b4d 100644
--- a/sys/alpha/pci/tsunami.c
+++ b/sys/alpha/pci/tsunami.c
@@ -413,37 +413,52 @@ static driver_t tsunami_driver = {
static void
pchip_init(volatile tsunami_pchip *pchip, int index)
{
-#if 0
- /*
- * The code below, if active, would attempt to
- * setup the DMA base and size registers of Window 0
- * to emulate the placement of the direct-mapped window
- * on previous chipsets.
+ int i;
+
+ /*
+ * initialize the direct map DMA windows.
*
- * HOWEVER: doing this means that a 64-bit card at device 11
- * would not be able to be setup for DMA.
- *
- * For now, we just trust the SRM console to set things up
- * properly. This works on the xp1000, but may need to be
- * to be revisited for other systems.
- */
-
- printf("initializing pchip%d\n", index);
- pchip->wsba[0].reg = 1L | (1024*1024*1024U & 0xfff00000U);
- pchip->wsm[0].reg = (1024*1024*1024U - 1) & 0xfff00000UL;
- pchip->tba[0].reg = 0;
- /*
- * disable windows 1, 2 and 3
+ * leave window 0 untouched; we'll set that up for S/G DMA for
+ * isa devices later in the boot process
+ *
+ * window 1 goes at 2GB and has a length of 1 GB. It maps
+ * physical address 0 - 1GB. The SRM console typically sets
+ * this window up here.
*/
-
-
- pchip->wsba[1].reg = 0;
- pchip->wsba[2].reg = 0;
- pchip->wsba[3].reg = 0;
-
- alpha_mb();
-#endif
+
+ pchip->wsba[1].reg = (2UL*1024*1024*1024) | WINDOW_ENABLE;
+ pchip->wsm[1].reg = (1UL*1024*1024*1024 - 1) & 0xfff00000UL;
+ pchip->tba[1].reg = 0;
+
+ /*
+ * window 2 goes at 3GB and has a length of 1 GB. It maps
+ * physical address 1GB-2GB.
+ */
+
+ pchip->wsba[2].reg = (3UL*1024*1024*1024) | WINDOW_ENABLE;
+ pchip->wsm[2].reg = (1UL*1024*1024*1024 - 1) & 0xfff00000UL;
+ pchip->tba[2].reg = 1UL*1024*1024*1024;
+
+ /*
+ * window 3 is disabled. The SRM console typically leaves it
+ * disabled
+ */
+
+ pchip->wsba[3].reg = 0;
+ alpha_mb();
+
+ if(bootverbose) {
+ printf("pchip%d:\n", index);
+ for (i = 0; i < 4; i++) {
+ printf("\twsba[%d].reg = 0x%lx\n",
+ i, pchip->wsba[i].reg);
+ printf("\t wsm[%d].reg = 0x%lx\n",
+ i, pchip->wsm[i].reg);
+ printf("\t tba[%d].reg = 0x%lx\n",
+ i, pchip->tba[i].reg);
+ }
+ }
}
#define TSUNAMI_SGMAP_BASE (8*1024*1024)
OpenPOWER on IntegriCloud