All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v4 2/9] usb: xhci: Use only 32-bit accesses in xhci_writeq/xhci_readq
Date: Thu, 28 May 2020 08:59:07 +0800	[thread overview]
Message-ID: <CAEUhbmWpM9xxk8jWG0Gse-SJ1KJA0F61yVe9Mjv52ZSdjut0rg@mail.gmail.com> (raw)
In-Reply-To: <4e6801b3-5d26-ba4c-31ab-542e208c05f1@suse.com>

Hi Matthias,

On Wed, May 27, 2020 at 8:20 PM Matthias Brugger <mbrugger@suse.com> wrote:
>
>
>
> On 26/05/2020 10:07, Bin Meng wrote:
> > Hi Simon,
> >
> > On Tue, May 26, 2020 at 5:41 AM Simon Glass <sjg@chromium.org> wrote:
> >>
> >> Hi Sylwester,
> >>
> >> On Mon, 25 May 2020 at 11:42, Sylwester Nawrocki <s.nawrocki@samsung.com> wrote:
> >>>
> >>> Hi Simon,
> >>>
> >>> On 25.05.2020 19:04, Simon Glass wrote:
> >>>> On Mon, 25 May 2020 at 10:57, Sylwester Nawrocki <s.nawrocki@samsung.com> wrote:
> >>>>> On 25.05.2020 16:57, Simon Glass wrote:
> >>>>>> On Mon, 25 May 2020 at 05:40, Sylwester Nawrocki <s.nawrocki@samsung.com> wrote:
> >>>>>>>
> >>>>>>> There might be hardware configurations where 64-bit data accesses
> >>>>>>> to XHCI registers are not supported properly.  This patch removes
> >>>>>>> the readq/writeq so always two 32-bit accesses are used to read/write
> >>>>>>> 64-bit XHCI registers, similarly as it is done in Linux kernel.
> >>>>>>>
> >>>>>>> This patch fixes operation of the XHCI controller on RPI4 Broadcom
> >>>>>>> BCM2711 SoC based board, where the VL805 USB XHCI controller is
> >>>>>>> connected to the PCIe Root Complex, which is attached to the system
> >>>>>>> through the SCB bridge.
> >>>>>>>
> >>>>>>> Even though the architecture is 64-bit the PCIe BAR is 32-bit and likely
> >>>>>>> the 64-bit wide register accesses initiated by the CPU are not properly
> >>>>>>> translated to a sequence of 32-bit PCIe accesses.
> >>>>>>> xhci_readq(), for example, always returns same value in upper and lower
> >>>>>>> 32-bits, e.g. 0xabcd1234abcd1234 instead of 0x00000000abcd1234.
> >>>>>
> >>>>>> Then I think this should be done with a quirk flag, enabled for this
> >>>>>> particular device via the compatible string. It should not be an #if,
> >>>>>> but an if().
> >>>>>
> >>>>> Thanks for your comments. I will check and see how this could be done.
> >>>>> It might not be so straightforward since the XHCI controller is a PCI
> >>>>> device matched by the pci_device_id so we would need to be looking
> >>>>> at the compatible string of the PCI controller to set the quirk in
> >>>>> the xhci layer. It's the PCI bridge that introduces the limitation,
> >>>>> not the VL805 XHCI controller chip.
> >>>>
> >>>> OK then it should be modelled as such.
> >>>>
> >>>> How is this done in Linux?
> >>>
> >>> In Linux simply always two 32-bit accesses are used for 64-bit registers
> >>> read/write.
> >
> > This was discussed during review of the previous version of this
> > patch, and I think aligning to what Linux does is fine. Previously we
> > discussed adding an Kconfig option to control this, but I feel that's
> > not good. Having a quirk flag to detect this is a dynamic approach,
> > compared to the static Kconfig option, but overall I don't see a need
> > not to align with Linux xHCI driver.
> >
>
> My understanding is, that we will keep the approach of 32-bit accesses. My plan
> was to take the whole series through my treen.
>
> Bin is that fine with you?

No problem. Thanks!

Regards,
Bin

  reply	other threads:[~2020-05-28  0:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200525114005eucas1p1aa7efc1c0e27e0eb3e5b48690f96e68d@eucas1p1.samsung.com>
2020-05-25 11:39 ` [PATCH v4 0/9] USB host support for Raspberry Pi 4 board (64-bit) Sylwester Nawrocki
     [not found]   ` <CGME20200525114010eucas1p138f9b8607f616720fd3b482dcb820dcb@eucas1p1.samsung.com>
2020-05-25 11:39     ` [PATCH v4 1/9] usb: xhci: Add missing cache flush in the scratchpad array initialization Sylwester Nawrocki
     [not found]   ` <CGME20200525114012eucas1p2fe3523a8d33e6670f8c2877bd4799aca@eucas1p2.samsung.com>
2020-05-25 11:39     ` [PATCH v4 2/9] usb: xhci: Use only 32-bit accesses in xhci_writeq/xhci_readq Sylwester Nawrocki
2020-05-25 14:57       ` Simon Glass
2020-05-25 16:57         ` Sylwester Nawrocki
2020-05-25 17:04           ` Simon Glass
2020-05-25 17:42             ` Sylwester Nawrocki
2020-05-25 21:40               ` Simon Glass
2020-05-26  7:49                 ` Marek Szyprowski
2020-05-26 11:06                   ` Sylwester Nawrocki
2020-05-26  8:07                 ` Bin Meng
2020-05-27 12:20                   ` Matthias Brugger
2020-05-28  0:59                     ` Bin Meng [this message]
     [not found]   ` <CGME20200525114013eucas1p1fd8be56fad4c2331a3b2b4bed48f7a02@eucas1p1.samsung.com>
2020-05-25 11:39     ` [PATCH v4 3/9] pci: Move some PCIe register offset definitions to a common header Sylwester Nawrocki
     [not found]   ` <CGME20200525114015eucas1p14cf7c56b8d52740f00df0ba9111b9d95@eucas1p1.samsung.com>
2020-05-25 11:39     ` [PATCH v4 4/9] rpi4: shorten a mapping for the DRAM Sylwester Nawrocki
     [not found]   ` <CGME20200525114016eucas1p1d9166ae099e725d3284d27241a79b805@eucas1p1.samsung.com>
2020-05-25 11:39     ` [PATCH v4 5/9] rpi4: add a mapping for the PCIe XHCI controller MMIO registers (ARM 64bit) Sylwester Nawrocki
     [not found]   ` <CGME20200525114017eucas1p2c9fa0e56eeb828d05891b8bf4545ad9c@eucas1p2.samsung.com>
2020-05-25 11:39     ` [PATCH v4 6/9] linux/bitfield.h: Add primitives for manipulating bitfields both in host- and fixed-endian Sylwester Nawrocki
2020-07-09 15:35       ` Matthias Brugger
2020-07-09 15:37         ` Matthias Brugger
2020-07-09 17:41           ` [PATCH] include/bitfield.h: include byteorder.h Nicolas Saenz Julienne
2020-07-10  8:24             ` Matthias Brugger
     [not found]   ` <CGME20200525114018eucas1p2fe145f25bc488ebffeb49221e7cb18af@eucas1p2.samsung.com>
2020-05-25 11:39     ` [PATCH v4 7/9] pci: Add some PCI Express capability register offset definitions Sylwester Nawrocki
     [not found]   ` <CGME20200525114019eucas1p104eb5b1054ba4e3538ad84b8df4945a3@eucas1p1.samsung.com>
2020-05-25 11:39     ` [PATCH v4 8/9] pci: Add driver for Broadcom BCM2711 SoC PCIe controller Sylwester Nawrocki
     [not found]   ` <CGME20200525114021eucas1p1c6f97a5b78b63f1cb7aac9f892cd9d24@eucas1p1.samsung.com>
2020-05-25 11:39     ` [PATCH v4 9/9] configs: Enable support for the XHCI controller on RPI4 board (ARM 64-bit) Sylwester Nawrocki
2020-06-11  8:38   ` [PATCH v4 0/9] USB host support for Raspberry Pi 4 board (64-bit) Matthias Brugger
2020-07-08 15:07   ` Matthias Brugger

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=CAEUhbmWpM9xxk8jWG0Gse-SJ1KJA0F61yVe9Mjv52ZSdjut0rg@mail.gmail.com \
    --to=bmeng.cn@gmail.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 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.