From: Paolo Bonzini <pbonzini@redhat.com>
To: xiaoqiang zhao <zxq_yx_007@163.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, antonynpavlov@gmail.com,
robh@kernel.org, qemu-arm@nongnu.org, edgar.iglesias@gmail.com,
alistair.francis@xilinx.com, crosthwaite.peter@gmail.com
Subject: Re: [Qemu-devel] [PATCH 1/6] hw/char: QOM'ify pl011 model
Date: Wed, 25 May 2016 15:01:34 +0200 [thread overview]
Message-ID: <e012c6b0-f847-57f8-d323-c2bc85ceccb5@redhat.com> (raw)
In-Reply-To: <1464173896-4088-2-git-send-email-zxq_yx_007@163.com>
On 25/05/2016 12:58, xiaoqiang zhao wrote:
> #define BCM2835_VC_PERI_BASE 0x7e000000
> @@ -106,7 +107,6 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
> MemoryRegion *ram;
> Error *err = NULL;
> uint32_t ram_size, vcram_size;
> - CharDriverState *chr;
> int n;
>
> obj = object_property_get_link(OBJECT(dev), "ram", &err);
> @@ -147,6 +147,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
> sysbus_pass_irq(SYS_BUS_DEVICE(s), SYS_BUS_DEVICE(&s->ic));
>
> /* UART0 */
> + qdev_prop_set_chr(DEVICE(&s->uart0), "chardev", serial_hds[0]);
> object_property_set_bool(OBJECT(s->uart0), true, "realized", &err);
> if (err) {
> error_propagate(errp, err);
> @@ -158,17 +159,8 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
> sysbus_connect_irq(s->uart0, 0,
> qdev_get_gpio_in_named(DEVICE(&s->ic), BCM2835_IC_GPU_IRQ,
> INTERRUPT_UART));
> -
> /* AUX / UART1 */
> - /* TODO: don't call qemu_char_get_next_serial() here, instead set
> - * chardev properties for each uart at the board level, once pl011
> - * (uart0) has been updated to avoid qemu_char_get_next_serial()
> - */
> - chr = qemu_char_get_next_serial();
> - if (chr == NULL) {
> - chr = qemu_chr_new("bcm2835.uart1", "null", NULL);
> - }
> - qdev_prop_set_chr(DEVICE(&s->aux), "chardev", chr);
> + qdev_prop_set_chr(DEVICE(&s->aux), "chardev", serial_hds[1]);
>
> object_property_set_bool(OBJECT(&s->aux), true, "realized", &err);
> if (err) {
> @@ -292,8 +284,6 @@ static void bcm2835_peripherals_class_init(ObjectClass *oc, void *data)
> DeviceClass *dc = DEVICE_CLASS(oc);
>
> dc->realize = bcm2835_peripherals_realize;
> - /* Reason: realize() method uses qemu_char_get_next_serial() */
> - dc->cannot_instantiate_with_device_add_yet = true;
This must remain, though the reason is now "realize() method uses
serial_hds[]".
Otherwise, looks good.
Thanks,
Paolo
> }
next prev parent reply other threads:[~2016-05-25 13:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 10:58 [Qemu-devel] [PATCH 0/6] Drop the qemu_char_get_next_serial function xiaoqiang zhao
2016-05-25 10:58 ` [Qemu-devel] [PATCH 1/6] hw/char: QOM'ify pl011 model xiaoqiang zhao
2016-05-25 13:01 ` Paolo Bonzini [this message]
2016-05-25 13:08 ` Peter Maydell
2016-05-25 13:15 ` Paolo Bonzini
2016-05-27 2:13 ` xiaoqiang zhao
2016-05-27 9:40 ` Paolo Bonzini
2016-05-27 2:06 ` xiaoqiang zhao
2016-05-27 9:01 ` Peter Maydell
2016-05-27 9:42 ` Paolo Bonzini
2016-05-27 11:36 ` xiaoqiang zhao
2016-05-30 11:35 ` Markus Armbruster
2016-05-25 10:58 ` [Qemu-devel] [PATCH 2/6] hw/char: QOM'ify cadence_uart model xiaoqiang zhao
2016-05-25 10:58 ` [Qemu-devel] [PATCH 3/6] hw/char: QOM'ify digic-uart model xiaoqiang zhao
2016-05-25 10:58 ` [Qemu-devel] [PATCH 4/6] hw/char: QOM'ify stm32f2xx_usart model xiaoqiang zhao
2016-05-25 10:58 ` [Qemu-devel] [PATCH 5/6] hw/char: QOM'ify xilinx_uartlite model xiaoqiang zhao
2016-05-25 10:58 ` [Qemu-devel] [PATCH 6/6] char: get rid of qemu_char_get_next_serial xiaoqiang zhao
2016-05-25 13:03 ` Paolo Bonzini
2016-05-25 13:03 ` [Qemu-devel] [PATCH 0/6] Drop the qemu_char_get_next_serial function Paolo Bonzini
2016-06-03 18:24 ` Peter Maydell
2016-06-04 7:13 ` xiaoqiang zhao
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=e012c6b0-f847-57f8-d323-c2bc85ceccb5@redhat.com \
--to=pbonzini@redhat.com \
--cc=alistair.francis@xilinx.com \
--cc=antonynpavlov@gmail.com \
--cc=crosthwaite.peter@gmail.com \
--cc=edgar.iglesias@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=robh@kernel.org \
--cc=zxq_yx_007@163.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).