qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "Thomas Huth" <thuth@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>,
	"Edgar E . Iglesias" <edgar.iglesias@xilinx.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Fam Zheng" <famz@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	qemu-devel@nongnu.org, qemu-arm@nongnu.org,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Alistair Francis" <alistair.francis@xilinx.com>
Subject: Re: [Qemu-devel] [RFC PATCH 4/6] arm/xlnx-zynq: use FDT names for the Cadence UART
Date: Mon, 8 Jan 2018 15:01:43 +0100	[thread overview]
Message-ID: <20180108150143.30b5e38b@redhat.com> (raw)
In-Reply-To: <aaab7bfd-d3ed-aa50-f09e-89d6ccf556ff@amsat.org>

On Mon, 8 Jan 2018 10:51:38 -0300
Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:

> On 01/08/2018 10:17 AM, Thomas Huth wrote:
> > On 08.01.2018 13:54, Igor Mammedov wrote:  
> >> On Thu,  4 Jan 2018 11:40:44 -0300
> >> Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> >>  
> >>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> >>> ---
> >>>  hw/arm/xilinx_zynq.c | 1 +
> >>>  hw/arm/xlnx-zynqmp.c | 2 +-
> >>>  2 files changed, 2 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
> >>> index 1836a4ed45..c45c364583 100644
> >>> --- a/hw/arm/xilinx_zynq.c
> >>> +++ b/hw/arm/xilinx_zynq.c
> >>> @@ -236,6 +236,7 @@ static void zynq_init(MachineState *machine)
> >>>      sysbus_create_simple("xlnx,ps7-usb", 0xE0002000, pic[53-IRQ_OFFSET]);
> >>>      sysbus_create_simple("xlnx,ps7-usb", 0xE0003000, pic[76-IRQ_OFFSET]);
> >>>  
> >>> +    /* "xlnx,xuartps" */
> >>>      cadence_uart_create(0xE0000000, pic[59 - IRQ_OFFSET], serial_hds[0]);
> >>>      cadence_uart_create(0xE0001000, pic[82 - IRQ_OFFSET], serial_hds[1]);
> >>>  
> >>> diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
> >>> index 325642058b..38f038786c 100644
> >>> --- a/hw/arm/xlnx-zynqmp.c
> >>> +++ b/hw/arm/xlnx-zynqmp.c
> >>> @@ -155,7 +155,7 @@ static void xlnx_zynqmp_init(Object *obj)
> >>>      }
> >>>  
> >>>      for (i = 0; i < XLNX_ZYNQMP_NUM_UARTS; i++) {
> >>> -        object_initialize(&s->uart[i], sizeof(s->uart[i]), TYPE_CADENCE_UART);
> >>> +        object_initialize(&s->uart[i], sizeof(s->uart[i]), "xlnx,zynqmp-uart");  
> >>
> >> I don't think that commas are valid symbol in type names
> >> (if I recall correctly it should be letters, numbers and '-')  
> > 
> > At least commas are a real PITA when you try to use such devices with
> > the "-device" CLI parameter. We should try to avoid this if possible, I
> > think.  
> 
> Ok, good to know.
> 
> I was following Linux Device Tree names [1] to avoid handling some
> fdt_qemu_to_linux[] & fdt_linux_to_qemu conversion arrays.
> 
> What about keeping using the QEMU default name for -device CLI param and
> allow aliases for FDT parsing?
> With this series the cadence_uart_info is now:
> 
> static const TypeInfo cadence_uart_info = {
>     .name          = TYPE_CADENCE_UART,
>     .aliases       = (const char * []) {
>                         "cdns,uart-r1p8",
>                         "xlnx,xuartps",
>                         "cdns,uart-r1p12",
>                         "xlnx,zynqmp-uart",
>                         NULL
>                      },
No need to pollute Object for this,
It might be better if you make it interface and type will implement it.
But honestly putting desired name in place at the place FDT binding is created
is much simpler and one can adapt it to a specific board as needed.


> 
> [1]:
> https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/serial/cdns,uart.txt
> 

  reply	other threads:[~2018-01-08 14:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04 14:40 [Qemu-devel] [RFC PATCH 0/6] qom: introduce TypeInfo name aliases Philippe Mathieu-Daudé
2018-01-04 14:40 ` [Qemu-devel] [RFC PATCH 1/6] " Philippe Mathieu-Daudé
2018-01-04 14:40 ` [Qemu-devel] [RFC PATCH 2/6] hw/net/e1000: real device name is 'e1000-82540em', 'e1000' is an alias Philippe Mathieu-Daudé
2018-01-04 16:24   ` Dr. David Alan Gilbert
2018-01-04 16:34     ` Philippe Mathieu-Daudé
2018-01-04 16:41       ` Dr. David Alan Gilbert
2018-01-04 14:40 ` [Qemu-devel] [RFC PATCH 3/6] hw/char/cadence_uart: add FDT aliases Philippe Mathieu-Daudé
2018-01-06  2:19   ` Alistair Francis
2018-01-04 14:40 ` [Qemu-devel] [RFC PATCH 4/6] arm/xlnx-zynq: use FDT names for the Cadence UART Philippe Mathieu-Daudé
2018-01-06  2:20   ` Alistair Francis
2018-01-08 12:54   ` Igor Mammedov
2018-01-08 13:17     ` Thomas Huth
2018-01-08 13:51       ` Philippe Mathieu-Daudé
2018-01-08 14:01         ` Igor Mammedov [this message]
2018-01-04 14:40 ` [Qemu-devel] [RFC PATCH 5/6] hw/net/cadence_gem: add FDT names as alias Philippe Mathieu-Daudé
2018-01-06  2:20   ` Alistair Francis
2018-01-04 14:40 ` [Qemu-devel] [RFC PATCH 6/6] hw/arm/xlnx-zynq: use FDT names for the Cadence GEM Philippe Mathieu-Daudé
2018-01-06  2:20   ` Alistair Francis
2018-01-04 19:22 ` [Qemu-devel] [RFC PATCH 0/6] qom: introduce TypeInfo name aliases Eduardo Habkost
2018-01-08 12:51   ` Igor Mammedov
2018-01-08 14:10     ` Philippe Mathieu-Daudé
2018-01-12 14:11       ` Eduardo Habkost
2018-01-08 16:12     ` Eduardo Habkost

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=20180108150143.30b5e38b@redhat.com \
    --to=imammedo@redhat.com \
    --cc=afaerber@suse.de \
    --cc=alistair.francis@xilinx.com \
    --cc=armbru@redhat.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=famz@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).