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

Oleksandr Tymoshenko gonzo at bluezbox.com
Tue Mar 5 20:01:44 UTC 2013


On 3/1/2013 12:57 AM, Daisuke Aoyama wrote:
>> 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 */
> }

Fixed

>
> 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;
> +       }

These are not really required. With current code if dreq is zero it will
overwrite info bits properly while when patched - bits will be left 
untouched
from previous setup call.

>
>        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);
>        }
>

Fixed

>        if (cs & CS_INT) {
> ----------------------------------------------------------------------



More information about the freebsd-arm mailing list