From: "Alastair D'Silva" <alastair@au1.ibm.com>
To: "Cédric Le Goater" <clg@kaod.org>, qemu-arm@nongnu.org
Cc: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
Andrew Jeffery <andrew@aj.id.au>, Joel Stanley <joel@jms.id.au>
Subject: Re: [Qemu-devel] [PATCH v2 1/6] arm: Uniquely name imx25 I2C buses.
Date: Fri, 02 Dec 2016 09:45:06 +1100 [thread overview]
Message-ID: <1480632306.16973.1.camel@au1.ibm.com> (raw)
In-Reply-To: <bc1eab8e-4cc2-1b4f-134f-650716a3796b@kaod.org>
On Thu, 2016-12-01 at 13:31 +0100, Cédric Le Goater wrote:
> On 12/01/2016 01:42 AM, Alastair D'Silva wrote:
> > On Wed, 2016-11-30 at 09:18 +0100, Cédric Le Goater wrote:
> > > On 11/30/2016 06:36 AM, Alastair D'Silva wrote:
<snip>
> > > > diff --git a/hw/i2c/imx_i2c.c b/hw/i2c/imx_i2c.c
> > > > index 37e5a62..7be10fb 100644
> > > > --- a/hw/i2c/imx_i2c.c
> > > > +++ b/hw/i2c/imx_i2c.c
> > > > @@ -305,12 +305,16 @@ static const VMStateDescription
> > > > imx_i2c_vmstate = {
> > > > static void imx_i2c_realize(DeviceState *dev, Error **errp)
> > > > {
> > > > IMXI2CState *s = IMX_I2C(dev);
> > > > + static int bus_count;
> > >
> > > hmm, the static is ugly :/
> > >
> > > Isn't there other ways to achieve this naming ?
> > >
> > > Thanks,
> > >
> > > C.
> > >
> >
> > I'm not seeing an obvious way around it. The busses are realized
> > independently (so I can't implement what we do with the aspeed i2c
> > busses), and it is named before fsl-imx25:fsl_imx25_realize() can
> > apply
> > specific properties to the bus.
> >
> > If you have any suggestions, I'm all ears.
>
> What about that ?
>
> @@ -310,7 +310,7 @@ static void imx_i2c_realize(DeviceState
> IMX_I2C_MEM_SIZE);
> sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
> sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq);
> - s->bus = i2c_init_bus(DEVICE(dev), "i2c");
> + s->bus = i2c_init_bus(DEVICE(dev), NULL);
> }
>
> static void imx_i2c_class_init(ObjectClass *klass, void *data)
>
> Which should name automatically the I2C objects :
>
> (qemu) info qom-tree
> /machine (imx25-pdk-machine)
> /peripheral (container)
> /soc (fsl,imx25)
> /peripheral-anon (container)
> /unattached (container)
> /device[0] (arm926-arm-cpu)
> /unnamed-gpio-in[1] (irq)
> /unnamed-gpio-in[3] (irq)
> /unnamed-gpio-in[2] (irq)
> /unnamed-gpio-in[0] (irq)
>
> /device[15] (imx.i2c)
> /imx.i2c[0] (qemu:memory-region)
> /i2c-bus.0 (i2c-bus)
> /device[17] (imx.i2c)
> /imx.i2c[0] (qemu:memory-region)
> /i2c-bus.2 (i2c-bus)
> /device[16] (imx.i2c)
> /imx.i2c[0] (qemu:memory-region)
> /i2c-bus.1 (i2c-bus)
> ....
>
>
> Cheers,
>
> C.
Oh, great, that looks like a much better solution, thanks :)
--
Alastair D'Silva mob: 0423 762 819
skype:
alastair_dsilva
Twitter: @EvilDeece
blog: http://alastair.d-silva.org
next prev parent reply other threads:[~2016-12-01 22:45 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-30 5:36 [Qemu-devel] [PATCH v2 0/6] Add support for the Epson RX8900 RTC to the aspeed board Alastair D'Silva
2016-11-30 5:36 ` [Qemu-devel] [PATCH v2 1/6] arm: Uniquely name imx25 I2C buses Alastair D'Silva
2016-11-30 8:18 ` Cédric Le Goater
2016-12-01 0:42 ` Alastair D'Silva
2016-12-01 3:10 ` Alexey Kardashevskiy
2016-12-01 12:31 ` Cédric Le Goater
2016-12-01 22:45 ` Alastair D'Silva [this message]
2016-12-01 23:34 ` Alexey Kardashevskiy
2016-12-02 7:55 ` Cédric Le Goater
2016-12-03 7:16 ` Alexey Kardashevskiy
2016-12-03 7:48 ` Cédric Le Goater
2016-11-30 5:36 ` [Qemu-devel] [PATCH v2 2/6] hw/i2c: Add a NULL check for i2c slave init callbacks Alastair D'Silva
2016-11-30 8:02 ` Cédric Le Goater
2016-12-01 3:13 ` Alexey Kardashevskiy
2016-11-30 5:36 ` [Qemu-devel] [PATCH v2 3/6] qtest: Support named interrupts Alastair D'Silva
2016-11-30 5:36 ` [Qemu-devel] [PATCH v2 4/6] hw/timer: Add Epson RX8900 RTC support Alastair D'Silva
2016-11-30 8:03 ` Cédric Le Goater
2016-12-01 5:53 ` Alexey Kardashevskiy
2016-12-02 0:19 ` Alastair D'Silva
2016-12-02 2:48 ` Alexey Kardashevskiy
2016-12-02 3:30 ` Alastair D'Silva
2016-12-02 4:07 ` Alexey Kardashevskiy
2016-12-02 4:48 ` Alastair D'Silva
2016-11-30 5:36 ` [Qemu-devel] [PATCH v2 5/6] tests: Test all implemented RX8900 functionality Alastair D'Silva
2016-11-30 5:36 ` [Qemu-devel] [PATCH v2 6/6] arm: Add an RX8900 RTC to the ASpeed board Alastair D'Silva
2016-11-30 8:16 ` Cédric Le Goater
2016-11-30 5:50 ` [Qemu-devel] [PATCH v2 0/6] Add support for the Epson RX8900 RTC to the aspeed board Alastair D'Silva
2016-11-30 6:55 ` no-reply
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=1480632306.16973.1.camel@au1.ibm.com \
--to=alastair@au1.ibm.com \
--cc=andrew@aj.id.au \
--cc=clg@kaod.org \
--cc=joel@jms.id.au \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.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).