All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH v1 2/4] usb: xhci: xhci_mem_init: Use cpu_to_le64() and not xhci_writeq()
Date: Fri, 17 Jul 2020 12:11:45 +0200	[thread overview]
Message-ID: <c2d0067a-2192-e785-a9ac-8a053e117135@denx.de> (raw)
In-Reply-To: <CAEUhbmWA2G6_PxUJSu-pB5Ze9Q8adjbi6oOqQq0THQBwiBtwKQ@mail.gmail.com>

Hi Bin,

On 17.07.20 12:09, Bin Meng wrote:
> Hi Stefan,
> 
> On Fri, Jul 17, 2020 at 6:04 PM Stefan Roese <sr@denx.de> wrote:
>>
>> On 17.07.20 07:24, Bin Meng wrote:
>>> Hi Stefan,
>>>
>>> On Thu, Jul 2, 2020 at 4:47 PM Stefan Roese <sr@denx.de> wrote:
>>>>
>>>> xhci_writeq() makes the CPU->LE swapping only when addressing registers
>>>> in the xHCI controller address range and not in the local memory (RAM).
>>>
>>> Is the above behavior exposed by the MIPS platform's writel()?
>>
>> Not sure what you mean with this. Without this patch, xhci_writeq()
>> will not swap on Octeon MIPS, as the destination address is located
>> in local memory (DDR).
> 
> I wonder why xhci_writeq() does not swap? Is this due to the writel()
> implementation on Octeon MIPS?

Ah, okay. Please see my comment below for this. Here again:

BTW: The Octeon MIPS writel will swap to little-endian, when the
location is in the xHCI controller address space (and PCI etc). This
support for selective swapping is not pushed into mainline yet. I
will send it in some follow up patches.

So to answer your question: writel will not swap when addressing
local memory.

>> Using the xhci_read/write accessor functions
>> should be restricted to accessing the controller registers.
> 
> Yes, this is the supposed usage that xhci_read/write should be called
> to operate on xHCI registers. However my question was why
> xhci_read/write does not swap even it is called on memory space, hence
> the writel() question.
> 
>>
>> BTW: The Octeon MIPS writel will swap to little-endian, when the
>> location is in the xHCI controller address space (and PCI etc). This
>> support for selective swapping is not pushed into mainline yet. I
>> will send it in some follow up patches.
>>
> 
> Regards,
> Bin
> 

Thanks,
Stefan

  reply	other threads:[~2020-07-17 10:11 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02  8:47 [PATCH v1 0/4] Stefan Roese
2020-07-02  8:47 ` [PATCH v1 1/4] usb: xhci: Add missing endian conversions (cpu_to_leXX / leXX_to_cpu) Stefan Roese
2020-07-16  9:24   ` Stefan Roese
2020-07-16  9:39     ` Bin Meng
2020-07-17  5:15   ` Bin Meng
2020-07-17  9:57     ` Stefan Roese
2020-07-17 11:18   ` Bin Meng
2020-07-17 11:34     ` Stefan Roese
2020-07-17 13:46       ` Bin Meng
2020-07-17 14:04         ` [PATCH v2 " Stefan Roese
2020-07-17 14:14           ` Bin Meng
2020-07-17 18:22             ` Stefan Roese
2020-07-20  1:48               ` Bin Meng
2020-07-21  8:39                 ` Stefan Roese
2020-07-02  8:47 ` [PATCH v1 2/4] usb: xhci: xhci_mem_init: Use cpu_to_le64() and not xhci_writeq() Stefan Roese
2020-07-17  5:24   ` Bin Meng
2020-07-17 10:04     ` Stefan Roese
2020-07-17 10:09       ` Bin Meng
2020-07-17 10:11         ` Stefan Roese [this message]
2020-07-17 10:13           ` Bin Meng
2020-07-17 11:19   ` Bin Meng
2020-07-02  8:47 ` [PATCH v1 3/4] usb: usb-uclass.c: Drop le16_to_cpu() as values are already swapped Stefan Roese
2020-07-17  5:33   ` Bin Meng
2020-07-17 10:08     ` Stefan Roese
2020-07-17 10:11       ` Bin Meng
2020-07-17 11:19   ` Bin Meng
2020-07-02  8:47 ` [PATCH v1 4/4] usb: xhci: Add virt_to_phys() to support mapped platforms Stefan Roese
2020-07-17  5:57   ` Bin Meng
2020-07-17 10:17     ` Stefan Roese
2020-07-17 10:23       ` Bin Meng
2020-07-17 10:28         ` Stefan Roese
2020-07-17 10:29           ` Bin Meng
2020-07-17 10:31             ` Stefan Roese
2020-07-17 11:19   ` Bin Meng

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=c2d0067a-2192-e785-a9ac-8a053e117135@denx.de \
    --to=sr@denx.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.