All of lore.kernel.org
 help / color / mirror / Atom feed
* ensuring a machine's buses have unique names
@ 2021-08-12 11:05 Peter Maydell
  2021-08-26 13:00 ` Peter Maydell
  2021-08-26 14:08 ` Markus Armbruster
  0 siblings, 2 replies; 13+ messages in thread
From: Peter Maydell @ 2021-08-12 11:05 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Markus Armbruster, Philippe Mathieu-Daudé

What's the right way to ensure that when a machine has multiple
buses of the same type (eg multiple i2c controllers, multiple
sd card controllers) they all get assigned unique names so that
the user can use '-device ...,bus=some-name' to put a device on a
specific bus?

For instance in hw/arm/xlnx-zynqmp.c, the SoC object creates
a set of alias properties on the SoC for the sd-bus buses that
its 4 SD card controllers create. The alias properties are named
"sd-bus%d" so they are unique. This works, but it's kind of error-prone
because you need each machine model to remember to create these
aliases when necessary.

mps3-an524 is an example of a machine that fails to do this
for its i2c buses, and therefore the user can't usefully
tell QEMU which bus to plug a command-line created i2c bus into.

Ideally we should make buses get unique names by default
and also assert() at startup that there aren't any duplicated
names, I think.

Side note: is there a way to mark a bus as "do not consider
this when plugging devices where the user did not specify
the bus themselves" ? Some of the i2c buses on that machine
are purely internal to the board (eg there's one that has
the touchscreen controller hanging off it and nothing else),
and some are "this i2c bus is connected to the expansion port",
so ideally if no bus is specified we would want to prefer
the expansion-port i2c bus, not the ones that are internal-only.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-09-22 13:12 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12 11:05 ensuring a machine's buses have unique names Peter Maydell
2021-08-26 13:00 ` Peter Maydell
2021-08-26 14:08 ` Markus Armbruster
2021-09-14 15:25   ` Peter Maydell
2021-09-15  4:28     ` Markus Armbruster
2021-09-21 13:20       ` Peter Maydell
2021-09-21 15:48         ` BALATON Zoltan
2021-09-22  4:37           ` Markus Armbruster
2021-09-22  9:58             ` BALATON Zoltan
2021-09-22 13:07               ` Markus Armbruster
2021-09-22  7:02         ` Markus Armbruster
2021-09-22  8:14           ` Cédric Le Goater
2021-09-22  4:46     ` Markus Armbruster

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.