diff mbox

[U-Boot,3/5] usb: ehci: Implement V2P mapping

Message ID 56D09D07.7090306@denx.de
State RFC
Delegated to: Marek Vasut
Headers show

Commit Message

Marek Vasut Feb. 26, 2016, 6:44 p.m. UTC
On 02/26/2016 07:16 PM, Stephen Warren wrote:

Hi!

[...]

>> Tom reported this to me too, sorry :-(
>> 
>> Do you have an idea how to fix this too? I am now installing arm64
>>  toolchain.
> 
> I haven't looked at it yet. I've seen similar problems in the bast 
> handled by casting between integer types before casting to pointers 
> e.g. something like the following guess:
> 
> uint32_t pa; void *p = (void *)(uintptr_t)pa;

I just tried this, it should do the trick. Can you give it a spin ?


I am a bit worried about the u32 values all around the place. If the
buffer would be above 4GiB, we might have a problem.

>> Do you know about some nice arm64 board with USB for testing?
> 
> There's always the Jetson TX1; it is the p2371-2180 that I was 
> building above:
> 
> http://www.nvidia.com/object/jetson-tx1-dev-kit.html

If you have one you don't need ... ;-)

Comments

Stephen Warren Feb. 26, 2016, 7:12 p.m. UTC | #1
On 02/26/2016 11:44 AM, Marek Vasut wrote:
> On 02/26/2016 07:16 PM, Stephen Warren wrote:
>
> Hi!
>
> [...]
>
>>> Tom reported this to me too, sorry :-(
>>>
>>> Do you have an idea how to fix this too? I am now installing arm64
>>>   toolchain.
>>
>> I haven't looked at it yet. I've seen similar problems in the bast
>> handled by casting between integer types before casting to pointers
>> e.g. something like the following guess:
>>
>> uint32_t pa; void *p = (void *)(uintptr_t)pa;
>
> I just tried this, it should do the trick. Can you give it a spin ?

That does the trick, thanks.
Marek Vasut Feb. 26, 2016, 7:16 p.m. UTC | #2
On 02/26/2016 08:12 PM, Stephen Warren wrote:
> On 02/26/2016 11:44 AM, Marek Vasut wrote:
>> On 02/26/2016 07:16 PM, Stephen Warren wrote:
>>
>> Hi!
>>
>> [...]
>>
>>>> Tom reported this to me too, sorry :-(
>>>>
>>>> Do you have an idea how to fix this too? I am now installing arm64
>>>>   toolchain.
>>>
>>> I haven't looked at it yet. I've seen similar problems in the bast
>>> handled by casting between integer types before casting to pointers
>>> e.g. something like the following guess:
>>>
>>> uint32_t pa; void *p = (void *)(uintptr_t)pa;
>>
>> I just tried this, it should do the trick. Can you give it a spin ?
> 
> That does the trick, thanks.

Thanks! I'll finish buildman builds (I set it up, finally, yay!) and
submit a proper patch.
diff mbox

Patch

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 8f259be..0113c6c 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -237,7 +237,7 @@  static int ehci_shutdown(struct ehci_ctrl *ctrl)
 static int ehci_td_buffer(struct qTD *td, void *buf, size_t sz)
 {
        uint32_t delta, next;
-       uint32_t addr = (unsigned long)buf;
+       unsigned long addr = (unsigned long)buf;
        int idx;

        if (addr != ALIGN(addr, ARCH_DMA_MINALIGN))