public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Stefan Wahren <wahrenst@gmx.net>
To: Florian Fainelli <florian.fainelli@broadcom.com>,
	Justin Chen <justin.chen@broadcom.com>,
	Phil Elwell <phil@raspberrypi.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Mathias Nyman <mathias.nyman@intel.com>,
	bcm-kernel-feedback-list@broadcom.com,
	Cyril Brulebois <kibi@debian.org>,
	linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 0/3] ARM: dts: bcm2711-rpi-cm4-io: Enable xHCI host
Date: Mon, 27 Nov 2023 20:22:45 +0100	[thread overview]
Message-ID: <10383aa9-942b-415d-b70e-ade3a7aae6fa@gmx.net> (raw)
In-Reply-To: <91ceed68-fe3a-408c-a858-095d5749b4d2@broadcom.com>

Hi,

Am 27.11.23 um 19:41 schrieb Florian Fainelli:
> On 11/27/23 09:44, Justin Chen wrote:
>>
>>
>> On 11/27/23 8:28 AM, Phil Elwell wrote:
>>> On Mon, 27 Nov 2023 at 12:39, Stefan Wahren <wahrenst@gmx.net> wrote:
>>>>
>>>> Hi Phil,
>>>>
>>>>>>>> Hi Justin,
>>>>>>>>
>>>>>>>> [add Phil]
>>>>>>>>
>>>>>>>> Am 27.11.23 um 07:02 schrieb Justin Chen:
>>>>>>>>> On 11/25/23 6:56 PM, Stefan Wahren wrote:
>>>>>>>>>> In contrast to the Raspberry Pi 4, the Compute Module 4 or
>>>>>>>>>> the IO board
>>>>>>>>>> does not have a VL805 USB 3.0 host controller, which is
>>>>>>>>>> connected via
>>>>>>>>>> PCIe. Instead, the BCM2711 on the Compute Module provides the
>>>>>>>>>> built-in
>>>>>>>>>> xHCI.
>>>>>>>>>>
>>>>>>>>> Does this work? I maintain this built-in xHCI controller
>>>>>>>>> internally. I
>>>>>>>>> wasn't aware the Compute Module uses this block.
>>>>>>>> i successful tested this with a CM4 (arm 32 bit,
>>>>>>>> multi_v7_lpae_defconfig) with eMMC. Before this series the USB
>>>>>>>> devices
>>>>>>>> (mouse, keyboard) connected to the host interface didn't work.
>>>>>>>> After
>>>>>>>> comparing vendor DTS with mainline i noticed the missing xHCI
>>>>>>>> block [1].
>>>>>>>> Unfortunately i wasn't able to get further information from the
>>>>>>>> public
>>>>>>>> datasheets. I don't know if the VideoCore does some magic
>>>>>>>> tricks on the
>>>>>>>> xHCI or i missed some downstream xHCI changes.
>>>>>>>>
>>>>>>>>> This block is held in reset and needs a bit toggled to get things
>>>>>>>>> going. Florian, just to confirm, this is our
>>>>>>>>> "brcm,xhci-brcm-v2" block
>>>>>>>>> correct?
>>>>>>>>>
>>>>>>>>> Justin
>>>>>>>> [1]  -
>>>>>>>> https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/bcm2711-rpi-ds.dtsi#L119
>>>>>>>>
>>>>>>> What's the question here? Does the XHCI block present in the
>>>>>>> raspberrypi/linux dtsi file really exist? Yes it does.
>>>>>> since i don't have any documentation about the xHCI block, i
>>>>>> assumed the
>>>>>> compatible generic-xhci is correct. But Justin seems to suggest
>>>>>> that the
>>>>>> xHCI block needs some special treatment and we need a specific
>>>>>> compatible.
>>>>>>
>>>>>> Did i missed some xHCI driver changes?
>>>>>> Does the VC firmware something to the xHCI especially on CM4?
>>>>> The firmware switches the on-board USB pins from DWC-OTG to XHCI if
>>>>> otg_mode=1 is set in config.txt, or if booting over USB MSD.
>>>> is this pinctrl/pinmux available from ARM via 0x7e200000 or a
>>>> different
>>>> IO address?
>>>
>>> It's in a different, undocumented block.
>>>
>>> Phil
>>
>> Well if it works, then maybe I am misunderstanding something here.
>> Maybe its time for me to pick up a CM4 board.
> There is one on my desk that you are welcome to use, or remote into if
> you prefer.
>
> To answer your earlier question, yes this is the same block as the one
> present in 72112 for which we use the "brcm,xhci-brcm-v2" compatible
> string, it would be preferable to have it backed by that compatible
> string in case we happen to support suspend/resume on the Pi 4B one
> day, if nothing else.
>
> I did confirm that after applying Stefan's patches plus changing my
> config.txt to have otg_mode=1, USB continues to be fully functional.
> This is the case with using both "generic-xhci" or "brcm,xhci-brcm-v2"
> so with the minor request to update the compatible to
> "brcm,xhci-brcm-v2", this is:
>
> Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
>
> Stefan, I am getting a deadlock on boot if I leave your changes in and
> uncomment dwc_otg=1 in config.txt, is there an alias or something that
> the boot loader should be patching?

sorry but i'm unable reproduce those deadlocks, neither in arm or arm64,
with eMMC or without eMMC, xhci builtin or module. If i uncomment this
in config.txt, USB host is just disabled.

I'm using the following firmware:

raspberrypi-firmware soc:firmware: Attached to firmware from
2023-03-17T10:50:39

Is this DTS difference a problem?

upstream   -> xhci: usb@7e9c0000
downstream -> xhci: xhci@7e9c0000

  reply	other threads:[~2023-11-27 19:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-26  2:56 [PATCH 0/3] ARM: dts: bcm2711-rpi-cm4-io: Enable xHCI host Stefan Wahren
2023-11-26  2:56 ` [PATCH 1/3] dt-bindings: usb: xhci: Add optional power-domains Stefan Wahren
2023-11-26 11:14   ` Conor Dooley
2023-11-26  2:56 ` [PATCH 2/3] ARM: dts: bcm2711: Add generic xHCI Stefan Wahren
2023-11-26  2:56 ` [PATCH 3/3] ARM: dts: bcm2711-rpi-cm4-io: Enable xHCI host Stefan Wahren
2023-11-27  0:34 ` [PATCH 0/3] " Cyril Brulebois
2023-11-27 10:57   ` Stefan Wahren
2023-11-27 11:55     ` Cyril Brulebois
2023-11-27 12:38       ` Stefan Wahren
2023-11-27 13:02         ` Cyril Brulebois
2023-11-27 15:16           ` Stefan Wahren
2023-11-27 15:59             ` Cyril Brulebois
2023-11-27 16:56           ` Stefan Wahren
2023-11-27 18:21             ` Cyril Brulebois
2023-11-27 18:52           ` Stefan Wahren
2023-11-27  6:02 ` Justin Chen
2023-11-27 11:08   ` Stefan Wahren
2023-11-27 11:22     ` Phil Elwell
2023-11-27 11:38       ` Stefan Wahren
2023-11-27 11:58         ` Phil Elwell
2023-11-27 12:33           ` Stefan Wahren
2023-11-27 16:28             ` Phil Elwell
2023-11-27 17:44               ` Justin Chen
2023-11-27 18:41                 ` Florian Fainelli
2023-11-27 19:22                   ` Stefan Wahren [this message]
2023-11-27 21:49                     ` Florian Fainelli
2023-11-28  6:44                       ` Stefan Wahren
2023-11-28 14:46                         ` Phil Elwell

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=10383aa9-942b-415d-b70e-ade3a7aae6fa@gmx.net \
    --to=wahrenst@gmx.net \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=justin.chen@broadcom.com \
    --cc=kibi@debian.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=phil@raspberrypi.com \
    --cc=robh+dt@kernel.org \
    /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