qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Peter Maydell" <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Beniamino Galvani <b.galvani@gmail.com>,
	Strahinja Jankovic <strahinja.p.jankovic@gmail.com>,
	qemu-devel@nongnu.org, qemu-arm@nongnu.org,
	Alexander Graf <agraf@csgraf.de>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Thomas Huth <thuth@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Subject: Re: [PATCH 1/3] hw/arm: Add EHCI/OHCI controllers to Allwinner R40 and Bananapi board
Date: Mon, 15 Jan 2024 08:12:29 -0800	[thread overview]
Message-ID: <56fde49f-7dc6-4f8e-9bbf-0336a20a9ebf@roeck-us.net> (raw)
In-Reply-To: <56f692d8-41b1-4126-96b9-80d274624984@linaro.org>

On 1/15/24 03:02, Philippe Mathieu-Daudé wrote:
> Hi,
> 
> On 13/1/24 20:16, Guenter Roeck wrote:
>> Allwinner R40 supports two USB host ports shared between a USB 2.0 EHCI
>> host controller and a USB 1.1 OHCI host controller. Add support for both
>> of them.
>>
>> If machine USB support is not enabled, create unimplemented devices
>> for the USB memory ranges to avoid crashes when booting Linux.
> 
> I never really understood the reason for machine_usb() and had on my
> TODO to do some archeology research to figure it out since quite some
> time. Having to map an UnimpDevice due to CLI options seems like an
> anti-pattern when the device is indeed implemented in the repository.
> 

Me not either. I copied the code from aw_a10_init(), trying to use the
same pattern. I am perfectly fine with making it unconditional, but then
I would argue that it should be unconditional for Allwinner A10 as well
(not that I really care much, just for consistency).

The "-usb" option says "enable on-board USB host controller (if not
enabled by default)". Unfortunately, that doesn't tell me much,
and most specifically it doesn't tell me how to enable it by default.
One option I can think of would be to enable it on the machine level,
i.e., from bananapi_m2u.c, but then, again, I don't see if/how
that is done for other boards. Any suggestions ?

Of course, I could discuss this with the person who implemented this
code for A10, but it turns out that was me, for no good reason than
that I tried to follow the pattern I had seen elsewhere without really
understanding what I was doing.

So should I drop the conditional from H40 and send a separate patch
to drop it from the A10 code as well, following your line of argument ?
Or drop it and leave A10 alone ?

Thanks,
Guenter



  reply	other threads:[~2024-01-15 16:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-13 19:16 [PATCH 0/3] hw/arm: Add support for USB, SATA, and watchdog to Allwinner R40 Guenter Roeck
2024-01-13 19:16 ` [PATCH 1/3] hw/arm: Add EHCI/OHCI controllers to Allwinner R40 and Bananapi board Guenter Roeck
2024-01-15 11:02   ` Philippe Mathieu-Daudé
2024-01-15 16:12     ` Guenter Roeck [this message]
2024-01-15 16:30       ` Philippe Mathieu-Daudé
2024-01-15 17:17         ` Guenter Roeck
2024-01-16 10:13       ` Gerd Hoffmann
2024-01-17 11:05         ` Bernhard Beschow
2024-01-17 14:51           ` Gerd Hoffmann
2024-01-13 19:16 ` [PATCH 2/3] hw/arm: Add AHCI/SATA controller " Guenter Roeck
2024-01-15 11:04   ` Philippe Mathieu-Daudé
2024-01-13 19:16 ` [PATCH 3/3] hw/arm: Add watchdog timer to Allwinner H40 " Guenter Roeck

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=56fde49f-7dc6-4f8e-9bbf-0336a20a9ebf@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=agraf@csgraf.de \
    --cc=b.galvani@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=strahinja.p.jankovic@gmail.com \
    --cc=thuth@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).