Comment 3 for bug 1000536

Revision history for this message
Peter Maydell (pmaydell) wrote : Re: [Bug 1000536] Re: Can't seem to hook up omap3 uarts

On 18 May 2012 00:58, Peter Chubb <email address hidden> wrote:
>>>>>> "Peter" == Peter Maydell <email address hidden> writes:
>
> Peter> You can't use '-device' to try to change the properties for an
> Peter> existing device on the board. '-device' always creates a new
> Peter> device, so it only really makes sense for pluggable buses like
> Peter> USB/PCI. You might try playing with the '-global' option which
> Peter> lets you set properties on existing devices.
>
> Hmmm.  According to docs/qdev-device-use.txt the old, relatively
> simple,
>
>   -serial tcp:127.0.0.1:4444,server
>
> (which works for uart3, but not for any of the other uarts) should be
> replaced with the more clumsy-to-type:
>
>  -chardev socket,host=127.0.0.1,port=4444,server,id=sock3
>  -device omap_uart,id=uart3,chardev=sock3
>
> If this is wrong, then it should be updated.

The qdev documentation tends to assume pluggable devices,
like isa-serial. Trying to fiddle with the builtin devices
is not so well tested and documented, I'm afraid.

> I can't see how to use -global to achieve this.  It adds global
> properties, not per-instance properties.

In that case I'm out of ideas; I suggest you find an equivalent
case that uses one of the standard models in qemu upstream as
an example, and ask on qemu-devel...

> You could patch beagle.c which would at least enable multiple -serial
> options.
>
> diff --git a/hw/beagle.c b/hw/beagle.c
> index 01d665a..b0d2cd6 100644
> --- a/hw/beagle.c
> +++ b/hw/beagle.c
> @@ -71,7 +71,7 @@ static void beagle_common_init(ram_addr_t ram_size,
>  #error MAX_SERIAL_PORTS must be at least 1!
>  #endif
>     s->cpu = omap3_mpu_init(sysmem, cpu_model, ram_size,
> -                            NULL, NULL, serial_hds[0], NULL);
> +                            serial_hds[2], serial_hds[1], serial_hds[0], NULL);
>
>     s->nand = nand_init(dmtd ? dmtd->bdrv : NULL, NAND_MFR_MICRON, 0xba);
>     nand_setpins(s->nand, 0, 0, 0, 1, 0); /* no write-protect */

Does a beagle actually physically have more than one serial port?