From: "Cédric Le Goater" <clg@kaod.org>
To: Alastair D'Silva <alastair@au1.ibm.com>, 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>,
Alastair D'Silva <alastair@d-silva.org>
Subject: Re: [Qemu-devel] [PATCH v2 6/6] arm: Add an RX8900 RTC to the ASpeed board
Date: Wed, 30 Nov 2016 09:16:31 +0100 [thread overview]
Message-ID: <31f8bcf5-825f-3ea5-8457-f96eb08a75cd@kaod.org> (raw)
In-Reply-To: <20161130053629.23340-7-alastair@au1.ibm.com>
On 11/30/2016 06:36 AM, Alastair D'Silva wrote:
> From: Alastair D'Silva <alastair@d-silva.org>
>
> Connect an RX8900 RTC to i2c12 of the AST2500 SOC at address 0x32
>
> Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
> ---
> hw/arm/aspeed.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
> index c7206fd..8de95f2 100644
> --- a/hw/arm/aspeed.c
> +++ b/hw/arm/aspeed.c
> @@ -166,7 +166,19 @@ static const TypeInfo palmetto_bmc_type = {
>
> static void ast2500_evb_init(MachineState *machine)
> {
> + AspeedSoCState *soc;
> + I2CBus *i2c12;
> + DeviceState *rx8900;
> +
> aspeed_board_init(machine, &aspeed_boards[AST2500_EVB]);
> +
> + soc = ASPEED_SOC(object_resolve_path_component(OBJECT(machine), "soc"));
> +
> + i2c12 = aspeed_i2c_get_bus((DeviceState *)&soc->i2c, 11);
> + rx8900 = i2c_create_slave(i2c12, "rx8900", 0x32);
> +
> + qdev_connect_gpio_out_named(rx8900, "rx8900-interrupt-out", 0,
> + qdev_get_gpio_in(DEVICE(&soc->vic), 22));
> }
>
> static void ast2500_evb_class_init(ObjectClass *oc, void *data)
>
I think it would be nicer to define a handler under AspeedBoardConfig,
something like :
int (*i2c_init)(AspeedBoardState *bmc);
when a board needs I2C devices. The handler would be called
from aspeed_board_init() directly. This is similar to what
we do for the flash modules but we didn't have to add a
specific handler for the flash.
Thoughts ?
C.
next prev parent reply other threads:[~2016-11-30 8:16 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
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 [this message]
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=31f8bcf5-825f-3ea5-8457-f96eb08a75cd@kaod.org \
--to=clg@kaod.org \
--cc=alastair@au1.ibm.com \
--cc=alastair@d-silva.org \
--cc=andrew@aj.id.au \
--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).