public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ppc64: Add iommu=on for enabling DART on small-mem machines
@ 2004-02-27 21:51 olof
       [not found] ` <Pine.A41.4.44.0402271524190.43108-100000@forte.austin.ibm.com.suse.lists.linux.kernel>
  0 siblings, 1 reply; 5+ messages in thread
From: olof @ 2004-02-27 21:51 UTC (permalink / raw)
  To: torvalds; +Cc: benh, linux-kernel, linuxppc64-dev

Linus,

Below patch makes it possible for people like me with a small-mem G5 to
enable the DART. I see two reasons for wanting to do so:

1. To debug/test DART/iommu code itself (small audience, including
   myself).
2. To debug drivers on small-mem machines, since bad pci_map*() usage will
   be punished (possibly larger audience).


Thanks,

-Olof


===== arch/ppc64/kernel/prom.c 1.56 vs edited =====
--- 1.56/arch/ppc64/kernel/prom.c	Fri Feb 27 16:44:57 2004
+++ edited/arch/ppc64/kernel/prom.c	Fri Feb 27 15:48:10 2004
@@ -516,6 +516,9 @@
 	return mem;
 }

+#ifdef CONFIG_PMAC_DART
+static int dart_force_on;
+#endif

 static unsigned long __init
 prom_initialize_lmb(unsigned long mem)
@@ -539,10 +542,12 @@
 		prom_print(opt);
 		prom_print(RELOC("\n"));
 		opt += 6;
-		while(*opt && *opt == ' ')
+		while (*opt && *opt == ' ')
 			opt++;
 		if (!strncmp(opt, RELOC("off"), 3))
 			nodart = 1;
+		else if (!strncmp(opt, RELOC("on"), 2))
+			RELOC(dart_force_on) = 1;
 	}
 #else
 	nodart = 1;
@@ -763,8 +768,10 @@
 	extern unsigned long dart_tablebase;
 	extern unsigned long dart_tablesize;

-	/* Only reserve DART space if machine has more than 2Gb of RAM */
-	if (lmb_end_of_DRAM() <= 0x80000000ull)
+	/* Only reserve DART space if machine has more than 2GB of RAM
+	 * or if requested with iommu=on on cmdline.
+	 */
+	if (lmb_end_of_DRAM() <= 0x80000000ull && !RELOC(dart_force_on))
 		return;

 	/* 512 pages is max DART tablesize. */




Olof Johansson                                        Office: 4E002/905
Linux on Power Development                            IBM Systems Group
Email: olof@austin.ibm.com                          Phone: 512-838-9858
All opinions are my own and not those of IBM



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-02-29  6:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-27 21:51 [PATCH] ppc64: Add iommu=on for enabling DART on small-mem machines olof
     [not found] ` <Pine.A41.4.44.0402271524190.43108-100000@forte.austin.ibm.com.suse.lists.linux.kernel>
2004-02-28 12:52   ` Andi Kleen
2004-02-28 14:19     ` Olof Johansson
2004-02-29  5:53       ` Mike Fedyk
2004-02-29  6:26         ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox