RE: [Uclinux-dist-devel] [PATCH 04/11] USB: musb: gadget: fix MUSB_TXMAXP and MUSB_RXMAXP configuration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




>-----Original Message-----
>From: uclinux-dist-devel-bounces@xxxxxxxxxxxxxxxxxxxx
>[mailto:uclinux-dist-devel-bounces@xxxxxxxxxxxxxxxxxxxx] On
>Behalf Of Bob Liu
>Sent: Wednesday, November 10, 2010 12:34 PM
>To: Ming Lei
>Cc: Cai, Cliff; David Brownell; Mike Frysinger; Sergei
>Shtylyov; Greg KH; Linux USB Mailing List; Felipe Balbi;
>eballetbo@xxxxxxxxx; notasas@xxxxxxxxx;
>uclinux-dist-devel@xxxxxxxxxxxxxxxxxxxx; stable@xxxxxxxxxx;
>Anand Gadiyar
>Subject: Re: [Uclinux-dist-devel] [PATCH 04/11] USB: musb:
>gadget: fix MUSB_TXMAXP and MUSB_RXMAXP configuration
>
>On Wed, Nov 10, 2010 at 12:22 PM, Bob Liu <lliubbo@xxxxxxxxx> wrote:
>> On Tue, Nov 9, 2010 at 10:07 PM, Ming Lei
><tom.leiming@xxxxxxxxx> wrote:
>>> 2010/11/9 Bob Liu <lliubbo@xxxxxxxxx>:
>>>> Hi, Ming
>>>>
>>>> I found out the cause of this problem on our platform.
>>>>
>>>> According to our hardware reference manuel, big changes are needed
>>>> to support double buffer(eg. it depends on SOF interrupt and rxcsr
>>>> fifofull bit etc). We need more time to work on these.
>>>
>>> Could you give which page or which section about the description?
>>> Seems bfin otg TRM is open.
>>>
>>> If not, could you describe the problem in more detail?
>>>
>>
>> Our spec said when double buffering enabled "
>> Set up an ISR, sensitive to the SOF_B interrupt, that reads the
>> FIFO_FULL_R bit, reads the USB_RXCOUNT status register, and finally
>> removes one or two packets (equaling from the USB_RXCOUNT number of
>> bytes) from the FIFO and clears RXPKTRDY.
>>
>> Set SOF_B=1 in USB_INTRUSBE to generate an interrupt on each
>start of
>> frame.
>> "
>>
>
>Some addition, the full spec said is
>"
>Peripheral Mode, ISO OUT, Small MaxPktSize The programming
>value for the maximum individual packet size (MaxPkt-
>Size) in bytes is <128 bytes, and double buffering is assumed
>as enabled for this process:
>1. Load MaxPktSize into USB_RX_MAX_PACKET 2. Set ISO_R=1 in
>USB_RXCSR 3. Set up an ISR, sensitive to the SOF_B interrupt,
>that reads the FIFO_FULL_R bit, reads the USB_RXCOUNT status
>register, and finally removes one or two packets (equaling
>from the USB_RXCOUNT number of bytes) from the FIFO and clears
>RXPKTRDY.
>4. Set SOF_B=1 in USB_INTRUSBE to generate an interrupt on
>each start of frame.
>5. Step 4 is repeated for each ISO packet.
>"
>It only said double buffer mod on ISO mode,I need to confirm
>if it works the same in bulk transfer.
>
>And after added this patch, the detail problem on our platform is:
>g_zero test case 5 will receive corrupted data, but after added
>udelay(50) on rx interrupt it works fine.
>So I can't give  any log, because added printk, it also works well.
>

It seems in double buffer mode the Blackfin MUSB controller needs about 50us delay between the packet RX interrupt and RX buffer reading operation. Otherwise, wrong data is read out of the MUSB RX buffer. Single buffer mode has no such problem. So, we are looking for a way to set up single buffer mode under MUSB framework if the original patch against 1.9 and less MUSB version doesn't work for others.



Sonic

>>>>
>>>> So Felipe,
>>>> is patch like this can be accepted ?
>>>> ============
>>>> -               if (musb->hwvers < MUSB_HWVERS_2000)
>>>>               if (musb->hwvers < MUSB_HWVERS_2000 &&
>>>> !musb->dyn_fifo)
>>>>                       musb_writew(regs, MUSB_TXMAXP,
>>>> hw_ep->max_packet_sz_tx);
>>>>               else
>>>>                       musb_writew(regs, MUSB_TXMAXP,
>>>> musb_ep->packet_sz | (musb_ep->hb_mult << 11));
>>>>
>>>> or
>>>>
>>>> -               if (musb->hwvers < MUSB_HWVERS_2000)
>>>>               if (musb->hwvers < MUSB_HWVERS_2000 &&
>>>> musb->config->gpio_vrsel)
>>>>                       musb_writew(regs, MUSB_TXMAXP,
>>>> hw_ep->max_packet_sz_tx);
>>>>               else
>>>>                       musb_writew(regs, MUSB_TXMAXP,
>>>> musb_ep->packet_sz | (musb_ep->hb_mult << 11));
>>>>
>>>
>>> I don't think either one can be accepted.
>>>
>>> This two still can make g_ether or full speed test broken in bfin,
>>> can't this?
>>>
>>
>> We didn't see g_ether problem on our platform without this
>patch, it works fine.
>> Could you give detail step how to reproduce the g_ether problem?
>>
>>
>>>> If not, are there any suggestions how to deal with this problem.
>>>> How to support no dyn_fifo and only support single buffer
>platform ?
>>>
>>> What is the problem? See above.
>>>
>>
>> After added this patch, double buffer will always auto
>enabled on our
>> platform which will cause problem as our spec said on double buffer
>> mode it use SOF_B interrupt and FIFO_FULL_R bit etc.
>>
>> So we want a way to keep this route on our platform but
>nomore on yours.
>>
>> --
>> Thanks,
>> --Bob
>>
>_______________________________________________
>Uclinux-dist-devel mailing list
>Uclinux-dist-devel@xxxxxxxxxxxxxxxxxxxx
>https://blackfin.uclinux.org/mailman/listinfo/uclinux-dist-devel
>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux