Skip to contentSkip to conversation

ISA DMA take 2

PATCH Adrian Cox 1 participant 1 message Jan 8, 2002

lore
Share & tools
lore

Adrian Cox

author
#0 lore raw

Attached is an update to my ISA DMA patch. The main change from the previous patch is that it works, because it now changes MAX_DMA_ADDRESS. I've tested it on my platform (Via 686 southbridge, ISA DMA for floppy), and it shouldn't break any others.

Can somebody please apply this one?

--
Adrian Cox http://www.humboldt.co.uk/

arch/ppc/mm/init.c +12 -5
diff --minimal -Nru a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
@@ -440,11 +440,18 @@
 	kmap_prot = PAGE_KERNEL;
 #endif /* CONFIG_HIGHMEM */
 
-	/*
-	 * All pages are DMA-able so we put them all in the DMA zone.
-	 */
-	zones_size[ZONE_DMA] = total_lowmem >> PAGE_SHIFT;
-	for (i = 1; i < MAX_NR_ZONES; i++)
+    	if (ISA_DMA_THRESHOLD && ISA_DMA_THRESHOLD < total_lowmem - 1)
+	{
+		zones_size[ZONE_DMA] = (ISA_DMA_THRESHOLD + 1) >> PAGE_SHIFT;
+		zones_size[ZONE_NORMAL] =
+			(total_lowmem - ISA_DMA_THRESHOLD - 1) >> PAGE_SHIFT;
+	}
+	else
+	{
+	    	zones_size[ZONE_DMA] = total_lowmem >> PAGE_SHIFT;
+	    	zones_size[ZONE_NORMAL] = 0;
+	}
+	for (i = 2; i < MAX_NR_ZONES; i++)
 		zones_size[i] = 0;
 
 #ifdef CONFIG_HIGHMEM
include/asm-ppc/dma.h +1 -2
diff --minimal -Nru a/include/asm-ppc/dma.h b/include/asm-ppc/dma.h
@@ -37,8 +37,7 @@
 #endif
 
 /* The maximum address that we can perform a DMA transfer to on this platform */
-/* Doesn't really apply... */
-#define MAX_DMA_ADDRESS		0xFFFFFFFF
+#define MAX_DMA_ADDRESS		ISA_DMA_THRESHOLD
 
 /* in arch/ppc/kernel/setup.c -- Cort */
 extern unsigned long DMA_MODE_WRITE, DMA_MODE_READ;