linux-mips
[Top] [All Lists]

RE: Alchemy DMA and GFP_DMA

To: linux-mips@linux-mips.org
Subject: RE: Alchemy DMA and GFP_DMA
From: "bo y" <byu1000@gmail.com>
Date: Fri, 17 Aug 2007 10:29:07 -0500
Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=WE5NHnnY4aO8Uc30P8Fx0y/dTXB71jplkfMYzG82j7kDzvPpe8mu52GrbHqh0xLFRpY6zplb1k1yANGxV3iPQic7ywYmjc7yav8xNwllNs051Gfikrn6sw5pZVUpFulmcgxDE0kSdeo0Nfbs2BTQnOhWgRVOpJ3mwT43w/aXrRo=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Kb72I8LmzfWWmLgdf24U1c0jxQ4MdwQkYsbIp6ochPOiP8S8YehuHrvcuV2uQfK8oZMM9eZmjPnXNOG+dV0UjW8mUxtd+dlYEKHlJphngi/RUHfM1wbAx05Pg1e8ExHlXCVIOcweMf9AQQ86DhlDHkEVGjPlFWTSKCZ6ntWDh94=
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
>arch/mips/au1000/common/dbdma.c uses GFP_DMA in two places and I think
>both instances are uncessary.  Could some alchmist confirm that both are
>unnecessary?
>
>Thanks,
>
>  Ralf

I tested it without GFP_DMA on Au1550 board. It worked.

The more serious problem in dbdma.c is how DMA descriptor cmd1
register is used. In multiple places, it just do

-       dp->dscr_cmd1 = nbytes;

Au1550/1200 supports 0x3fffff bytes of buffer. So the following is
better I think.

+       if(nbytes > DSCR_CMD1_BC_MASK) {
+               return 0;
+       }
+       dp->dscr_cmd1 = (dp->dscr_cmd1 & ~DSCR_CMD1_BC_MASK) + nbytes;

Also, there is no way to do memory-to-PCI dma. I added a few lines in
au1xxx_dbdma_ring_alloc().

+         if(DSCR_CUSTOM2DEV_ID(destid) == DSCR_CMD0_PCI_WRITE) {
+                cmd1 |= 0x04000000;
+         }
+         if(DSCR_CUSTOM2DEV_ID(srcid) == DSCR_CMD0_PCI_WRITE) {
+                cmd1 |= 0x40000000;
+         }

Last, a few places like:

-       nbytes = dscr->dscr_cmd1;

+       nbytes = (DSCR_CMD1_BC_MASK & dscr->dscr_cmd1);


Thanks.

Bo

<Prev in Thread] Current Thread [Next in Thread>