FreeBSD/armv6z/clang on Raspberry Pi 512MB (with U-Boot + ubldr)

Daisuke Aoyama aoyama at peach.ne.jp
Fri Mar 1 08:57:20 UTC 2013


> I'd like to thank you again for your outstanding work.
> I've just committed three patches based on your code:
> 
> - Platform DMA support for SDHCI
> - DMA engine driver
> - DMA support for BCM2835 SDHCI driver

Thank you. I checked the code and found some bug.
I don't check why bus_dma and bus_space is slow.
But using generic code is good.

----------------------------------------------------------------------
o INFO_WAIT_RESP is cleared when reset.
o dreq is overwritten by next call.
o should reset DMA when error.

quick fix is like this:


--- bcm2835_dma.c       (revision 247518)
+++ bcm2835_dma.c       (working copy)
@@ -199,6 +199,7 @@
        /* Reset control block */
        cb = sc->sc_dma_ch[ch].cb;
        bzero(cb, sizeof(cb));
+       cb->info = INFO_WAIT_RESP; /* XXX */
 }

 static int
@@ -409,8 +410,10 @@
                return (-1);

        info = sc->sc_dma_ch[ch].cb->info;
-       info &= ~INFO_PERMAP_MASK;
-       info |= (dreq << INFO_PERMAP_SHIFT) & INFO_PERMAP_MASK;
+       if (dreq) {
+               info &= ~INFO_PERMAP_MASK;
+               info |= (dreq << INFO_PERMAP_SHIFT) & INFO_PERMAP_MASK;
+       }

        if (dreq)
                info |= INFO_S_DREQ;
@@ -459,8 +462,10 @@
                return (-1);

        info = sc->sc_dma_ch[ch].cb->info;
-       info &= ~INFO_PERMAP_MASK;
-       info |= (dreq << INFO_PERMAP_SHIFT) & INFO_PERMAP_MASK;
+       if (dreq) {
+               info &= ~INFO_PERMAP_MASK;
+               info |= (dreq << INFO_PERMAP_SHIFT) & INFO_PERMAP_MASK;
+       }

        if (dreq)
                info |= INFO_D_DREQ;
@@ -615,6 +693,7 @@
                        debug & DEBUG_ERROR_MASK, ch->ch);
                bus_write_4(sc->sc_mem, BCM_DMA_DEBUG(ch->ch),
                    debug & DEBUG_ERROR_MASK);
+               bcm_dma_reset(sc->sc_dev, ch->ch);
        }

        if (cs & CS_INT) {
----------------------------------------------------------------------
-- 
Daisuke Aoyama
 


More information about the freebsd-arm mailing list