public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] dwc: ep0: Allocate and flush dwc->ep0_trb in a cache aligned manner
Date: Tue, 10 Oct 2017 11:18:53 +0530	[thread overview]
Message-ID: <97aac252-e555-a24a-e236-96fa68540bea@ti.com> (raw)
In-Reply-To: <0ded15f3-cb75-3fac-b830-36a176509004@ti.com>

Hi,

On Tuesday 10 October 2017 11:07 AM, Faiz Abbas wrote:
> +Kishon
> 
> On Friday 06 October 2017 05:03 PM, Faiz Abbas wrote:
>> Hi,
>>
>> On Thursday 05 October 2017 04:57 PM, Marek Vasut wrote:
>>> On 10/04/2017 03:11 PM, Faiz Abbas wrote:
>>>> Hi,
>>>>
>>>> On Wednesday 04 October 2017 06:01 PM, Marek Vasut wrote:
>>>>> On 10/04/2017 12:51 PM, Faiz Abbas wrote:
>>>>>> Hi,
>>>>>> On Tuesday 03 October 2017 06:48 PM, Marek Vasut wrote:
>>>>>>> On 10/03/2017 03:17 PM, Faiz Abbas wrote:
>>>>>>>> Hi,
>>>>>>>> On Tuesday 03 October 2017 05:34 PM, Marek Vasut wrote:
>>>>>>>>> On 09/19/2017 01:15 PM, Faiz Abbas wrote:
>>>>>>>>>>  
>>>>>>>>>> -	dwc3_flush_cache((uintptr_t)trb, sizeof(*trb));
>>>>>>>>>> +	dwc3_flush_cache((uintptr_t)dwc->ep0_trb_addr, sizeof(*trb) * 2);
>>>>>>>>>
>>>>>>>>> Why *2 ?
>>>>>>>>
>>>>>>>> Because its allocated as sizeof(*dwc->ep0_trb) * 2 below. This is not
>>>>>>>> strictly required as dwc3_flush_cache() rounds up the size to
>>>>>>>> CACHELINE_SIZE but from a caller POV, flush everything we allocated.
>>>>>>>
>>>>>>> Can the other TRB be in use ? Maybe aligning the TRBs to cacheline size
>>>>>>> would be better ?
>>>>>>>
>>>>>> A single trb is 16 bytes in size and two of them are allocated
>>>>>> contiguously.
>>>>>
>>>>> Why are two allocated continuously ? (I am not dwc3 expert)

The TRB's should be allocated contiguously for dwc3 and only the base of the
entire TRB table is programmed in the HW.
 ________________ <------------------ TRB table base address
|     TRB0       |
|________________|
|     TRB1       |
|________________|
|     TRB2       |
|________________|
|     TRBn       |
|________________|


>>>>
>>>> Neither am I. I did try to pad to the dwc_trb structure such that each
>>>> trb is 64 bytes in size but this leads to failures when testing. I
>>>> didn't get a chance to debug this though. I suspect its because the code
>>>> expects the trbs to be contiguous and/or 16 bytes in size.

It's not the code but it's the HW.

Thanks
Kishon

  reply	other threads:[~2017-10-10  5:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-19 11:15 [U-Boot] [PATCH] dwc: ep0: Allocate and flush dwc->ep0_trb in a cache aligned manner Faiz Abbas
2017-10-03  7:35 ` Faiz Abbas
2017-10-03  9:08   ` Andy Shevchenko
2017-10-03  9:43     ` Marek Vasut
2017-10-03  9:58 ` Faiz Abbas
2017-10-03 12:04 ` Marek Vasut
2017-10-03 12:18   ` Dr. Philipp Tomsich
2017-10-03 12:52     ` Marek Vasut
2017-10-03 13:17   ` Faiz Abbas
2017-10-03 13:18     ` Marek Vasut
2017-10-04 10:51       ` Faiz Abbas
2017-10-04 12:31         ` Marek Vasut
2017-10-04 13:11           ` Faiz Abbas
2017-10-05 11:27             ` Marek Vasut
2017-10-06 11:33               ` Faiz Abbas
2017-10-10  5:37                 ` Faiz Abbas
2017-10-10  5:48                   ` Kishon Vijay Abraham I [this message]
2017-10-10  8:00                     ` Marek Vasut
2017-10-10 10:45                       ` Faiz Abbas
2017-10-10 13:49                         ` Marek Vasut
2017-10-11  8:23                           ` Faiz Abbas
2017-10-11  8:58                             ` Kishon Vijay Abraham I
2017-10-11 13:23                               ` Faiz Abbas
2017-10-03 13:01 ` Marek Vasut

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=97aac252-e555-a24a-e236-96fa68540bea@ti.com \
    --to=kishon@ti.com \
    --cc=u-boot@lists.denx.de \
    /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