qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
To: Liviu Ionescu <ilg@livius.net>,
	Alistair Francis <alistair.francis@xilinx.com>
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 13:09:01 -0700	[thread overview]
Message-ID: <CAEgOgz6Pj49tuh8My3BDBFxNSdn4AJ1j12Q2=2tgM07hWfkabQ@mail.gmail.com> (raw)
In-Reply-To: <879C3CA6-9C78-4126-8CD0-F7D3CC98773F@livius.net>

On Tue, Jun 16, 2015 at 12:22 PM, Liviu Ionescu <ilg@livius.net> wrote:
>
>> On 16 Jun 2015, at 21:19, Peter Crosthwaite <peter.crosthwaite@xilinx.com> wrote:
>>
>> Your autoformatter does a surprisingly good job of getting close to
>> qemu coding style. Can the rules just be tweaked any maybe QEMU coding
>> style can be added to eclipse?
>
> this is exactly what I did, I took the K&R and tweaked it where possible. unfortunately the closing brace position is not configurable.
>
>> They are not really aliases, they are the GPIO names proper.
>> qdev_[init|get|connect]_gpio_[in|out]_named are direct replacements
>> for the non named variants. The non-human internal names should go
>> away if you use them. The name of the GPIO should match something in
>> the TRM for the device. 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".
>> Your new code handles that information. For your generic LED however,
>> that is a QEMU invention which is why I propose a single unnamed GPIO
>> in that case.
>
> oops... you lost me... I need to dig a bit to understand this.
>
>> I have to wonder though if the printfery is the right approach.
>
> blinking leds with printf() is just the first step, or the backup solution if graphics are not available. the plan was to enable graphics, present a picture of the board, and blink the led by painting a saturated square in the led location. however I don't know yet how much effort this may take, and if it is worth doing it, but it would definitely be a good marketing tool ;-)
>
>> Can
>> eclipse use QEMUs existing GPIO introspection capabilites to get the
>> LED states and do something with them? Then the LED definition is pure
>> GPIO passing and these is no need for new devices at all.
>
> I do not know the QEMU introspection capabilities (hint?) but my Eclipse plug-in can be extended to connect to any reasonable protocol.
>

qtest protocol I think. I would grep qdev_intercept_gpio_out and go from there.

Regards,
Peter

> ---
>
> I'm currently reworking the (generic-)gpio-led to be standalone and accommodate your suggestions, but it'll take me some time to figure out the details of nodes naming.
>
> I also had a small problem with the objects tree. initially my gpio-led object was not derived from SysBusDevice, since I considered it a separate object. it was functional, but made 'info qtree' fail. I changed the node parent to SysBusDevice but I'm not sure what would be the best topology for my object tree.
>

That SysBus parenting will lead to a false topology anyways. The
correct parent for the LED is TYPE_DEVICE. don't worry about the
qtree, Andreas was working on a correct solution for the tree-dump
that uses QOM rather than the legacy qbus tree (qtree).

Regards,
Peter

>
> regards,
>
> Liviu
>
>

  reply	other threads:[~2015-06-16 20:09 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 [this message]
2015-06-16 22:25   ` Liviu Ionescu
2015-06-17  0:25     ` Peter Crosthwaite
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='CAEgOgz6Pj49tuh8My3BDBFxNSdn4AJ1j12Q2=2tgM07hWfkabQ@mail.gmail.com' \
    --to=peter.crosthwaite@xilinx.com \
    --cc=Qemu-devel@nongnu.org \
    --cc=alistair.francis@xilinx.com \
    --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).