qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] [PATCH v2 2/5] bcm2835_aux: add emulation of BCM2835 AUX


From: Peter Maydell
Subject: Re: [Qemu-arm] [PATCH v2 2/5] bcm2835_aux: add emulation of BCM2835 AUX (aka UART1) block
Date: Tue, 8 Mar 2016 11:31:37 +0700

On 4 March 2016 at 01:24, Andrew Baumann <address@hidden> wrote:
> At present only the core UART functions (data path for tx/rx) are
> implemented, which is enough for UEFI to boot. The following
> features/registers are unimplemented:
>   * Line/modem control
>   * Scratch register
>   * Extra control
>   * Baudrate
>   * SPI interfaces

> @@ -131,6 +139,27 @@ static void bcm2835_peripherals_realize(DeviceState 
> *dev, Error **errp)
>          qdev_get_gpio_in_named(DEVICE(&s->ic), BCM2835_IC_GPU_IRQ,
>                                 INTERRUPT_UART));
>
> +    /* AUX / UART1 */
> +    /* XXX: pl011 (uart0) uses qemu_char_get_next_serial(), so at this point 
> it
> +     * should have claimed the first serial device (if one exists) */
> +    chr = serial_hds[1];
> +    if (chr == NULL) {
> +        chr = qemu_chr_new("bcm2835.uart1", "null", NULL);
> +    }
> +    qdev_prop_set_chr(DEVICE(&s->aux), "chardev", chr);

You should use qemu_char_get_next_serial() rather than directly
looking in serial_hds[]. Otherwise
Reviewed-by: Peter Maydell <address@hidden>

(Eventually what should happen is that we fix pl011 to take
a chardev property, and then we can create aliases of those
properties on the bcm2835 SoC object, and wire them up in the
board level code. But that's a cleanup for another day.)

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]