public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/5] usb: ehci: Implement V2P mapping
Date: Fri, 26 Feb 2016 11:16:23 -0700	[thread overview]
Message-ID: <56D09677.5090408@wwwdotorg.org> (raw)
In-Reply-To: <56D08370.60808@denx.de>

On 02/26/2016 09:55 AM, Marek Vasut wrote:
> On 02/26/2016 05:48 PM, Stephen Warren wrote:
>> On 01/26/2016 07:14 PM, Marek Vasut wrote:
>>> Certain processor architectures, like MIPS, require that the USB
>>> structures and transfer buffers are passed with their PA to the
>>> USB controller. If VA is passed, the USB will not work. Add the
>>> necessary virt_to_phys() calls into the USB EHCI code to make it
>>> work.
>>
>> FYI, this causes some cast size warnings, e.g.:
>>
>>> +make
>>> O=/home/swarren/shared/git_wa/tegra-uboot-flasher/u-boot/build-p2371-2180
>>> -s p2371-2180_defconfig
>>> +make
>>> O=/home/swarren/shared/git_wa/tegra-uboot-flasher/u-boot/build-p2371-2180
>>> -s -j8
>>> In file included from ../arch/arm/include/asm/byteorder.h:29:0,
>>>                   from ../include/compiler.h:125,
>>>                   from ../include/image.h:19,
>>>                   from ../include/common.h:88,
>>>                   from ../drivers/usb/host/ehci-hcd.c:10:
>>> ../drivers/usb/host/ehci-hcd.c: In function ?ehci_td_buffer?:
>>> ../drivers/usb/host/ehci-hcd.c:248:49: warning: cast to pointer from
>>> integer of different size [-Wint-to-pointer-cast]
>>>     td->qt_buffer[idx] = cpu_to_hc32(virt_to_phys((void *)addr));
>>>                                                   ^
>>> ../include/linux/byteorder/little_endian.h:34:51: note: in definition
>>> of macro ?__cpu_to_le32?
>>>   #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
>>>                                                     ^
>>> ../drivers/usb/host/ehci-hcd.c:248:24: note: in expansion of macro
>>> ?cpu_to_hc32?
>>>     td->qt_buffer[idx] = cpu_to_hc32(virt_to_phys((void *)addr));
>>>                          ^
>>
>> (This is a 64-bit ARM platform, so I had CROSS_COMPILE=aarch64-linux-gnu-)
>
> 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;

> 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

  reply	other threads:[~2016-02-26 18:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27  2:13 [U-Boot] [PATCH 1/5] mips: cache: Bulletproof the code against cornercases Marek Vasut
2016-01-27  2:14 ` [U-Boot] [PATCH 2/5] usb: ehci: Use map_physmem in ehci-generic Marek Vasut
2016-01-27 14:21   ` Alexey Brodkin
2016-01-27 16:14     ` Marek Vasut
2016-01-27  2:14 ` [U-Boot] [PATCH 3/5] usb: ehci: Implement V2P mapping Marek Vasut
2016-02-26 16:48   ` Stephen Warren
2016-02-26 16:55     ` Marek Vasut
2016-02-26 18:16       ` Stephen Warren [this message]
2016-02-26 18:44         ` Marek Vasut
2016-02-26 19:12           ` Stephen Warren
2016-02-26 19:16             ` Marek Vasut
2016-01-27  2:14 ` [U-Boot] [PATCH 4/5] usb: ehci: Clear USBMODE_BE on LE MMIO Marek Vasut
2016-01-27  2:14 ` [U-Boot] [PATCH 5/5] usb: ehci: Be explicit about the BE IO accessors Marek Vasut
2016-01-27 14:56 ` [U-Boot] [PATCH 1/5] mips: cache: Bulletproof the code against cornercases Daniel Schwierzeck
2016-01-27 16:15   ` Marek Vasut
2016-02-01 21:29 ` Daniel Schwierzeck
2016-02-01 21:31   ` Marek Vasut
2016-02-01 21:40     ` Daniel Schwierzeck
2016-02-01 21:45       ` 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=56D09677.5090408@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --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