qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
To: Liviu Ionescu <ilg@livius.net>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	QEMU Developers <Qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [RFC] generic-gpio-led & stm32-gpio-led
Date: Tue, 16 Jun 2015 17:25:04 -0700	[thread overview]
Message-ID: <CAEgOgz5i1_8LCQZfnzoprTsUqLoibtnhdPg-ZCLk1TgRCdBNgQ@mail.gmail.com> (raw)
In-Reply-To: <BF13B75C-8352-453F-AF12-4884A34B4054@livius.net>

On Tue, Jun 16, 2015 at 3:25 PM, Liviu Ionescu <ilg@livius.net> wrote:
>
>> On 16 Jun 2015, at 19:10, Peter Crosthwaite <peter.crosthwaite@xilinx.com> wrote:
>>
>> ... In my proposal the machine model would do this.
>>
>> qdev_connect_gpio_out_named(mcu, "name", index, qdev_get_gpio_in(gpio_dev, 0));
>>
>> Or something like that.
>
> connecting a gpio_out to a gpio_in seems not possible, gpio_in irqs are parented to the device and parenting them to the gpio_out fail with the parent != 0 assertion.
>

This should work. Can I see the backtrace of that abort?

Regards.
Peter

> however I was able to connect_gpio_out for standalone irqs.
>
> the actual connection sequence is:
>
>         qemu_irq irq = GENERIC_GPIO_LED_STATE(led)->irq;
>         qdev_connect_gpio_out(DEVICE(object_resolve_path("/machine/stm32/gpio[c]", NULL)), 12, irq);
>
> I'm not very happy with it, since it is quite long.
>
> any suggestions how to make it more readable?
>
>> E.g. if the SoC define "bank A" gpios, then a
>> suitable string name would be "bank-A". This should match the SoC
>> level, not the board level so it wouldn't be names like "green-led".
>
> this is still too tricky for me.
>
> since the default names were unusable (like device[7], etc), I created two containers (cortexm and stm32) and placed the peripherals inside, with names like /cortexm/nvic, cortexm/itm, stm32/rcc, stm32/gpio[%c], etc.
>
> I used calls like:
>
>     state->container = container_get(qdev_get_machine(), "/stm32");
>
>     object_property_add_child(state->container, "rcc", OBJECT(state->rcc), NULL);
>
>
> would this be acceptable?
>
>
> regards,
>
> Liviu
>
>
>
>
>

  reply	other threads:[~2015-06-17  0:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16 14:15 [Qemu-devel] [RFC] generic-gpio-led & stm32-gpio-led Liviu Ionescu
2015-06-16 16:10 ` Peter Crosthwaite
2015-06-16 17:16   ` Liviu Ionescu
2015-06-16 18:19     ` Peter Crosthwaite
2015-06-16 19:22       ` Liviu Ionescu
2015-06-16 20:09         ` Peter Crosthwaite
2015-06-16 22:25   ` Liviu Ionescu
2015-06-17  0:25     ` Peter Crosthwaite [this message]
2015-06-17  9:43       ` Liviu Ionescu
2015-06-17 12:55         ` [Qemu-devel] [RFCv2] generic-gpio-led Liviu Ionescu

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=CAEgOgz5i1_8LCQZfnzoprTsUqLoibtnhdPg-ZCLk1TgRCdBNgQ@mail.gmail.com \
    --to=peter.crosthwaite@xilinx.com \
    --cc=Qemu-devel@nongnu.org \
    --cc=ilg@livius.net \
    --cc=peter.maydell@linaro.org \
    /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).