linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Cox <adrian@humboldt.co.uk>
To: linuxppc-dev@lists.linuxppc.org
Subject: ISA DMA take 2
Date: Tue, 08 Jan 2002 15:33:54 +0000	[thread overview]
Message-ID: <3C3B1162.4000405@humboldt.co.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 330 bytes --]

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/

[-- Attachment #2: dma.patch --]
[-- Type: text/plain, Size: 1318 bytes --]

diff --minimal -Nru a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
--- a/arch/ppc/mm/init.c	Tue Jan  8 14:59:58 2002
+++ b/arch/ppc/mm/init.c	Tue Jan  8 14:59:58 2002
@@ -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
diff --minimal -Nru a/include/asm-ppc/dma.h b/include/asm-ppc/dma.h
--- a/include/asm-ppc/dma.h	Tue Jan  8 14:59:58 2002
+++ b/include/asm-ppc/dma.h	Tue Jan  8 14:59:58 2002
@@ -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;

             reply	other threads:[~2002-01-08 15:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-08 15:33 Adrian Cox [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-01-09 17:21 ISA DMA take 2 Michael Sokolov
2002-01-09 17:40 ` Adrian Cox
2002-01-09 17:53 Michael Sokolov
2002-01-09 18:27 ` Adrian Cox
2002-01-09 20:18 Michael Sokolov
2002-01-09 20:43 ` Adrian Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C3B1162.4000405@humboldt.co.uk \
    --to=adrian@humboldt.co.uk \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).