[PATCH 0/3] Add QEMU support for the Epson rx8900 RTC

Andrew Jeffery andrew at aj.id.au
Mon Oct 31 11:22:29 AEDT 2016


On Thu, 2016-10-27 at 15:33 +1100, Alastair D'Silva wrote:
> On Thu, 2016-10-27 at 14:52 +1030, Joel Stanley wrote:
> > 
> > Hi Alastair,
> > 
> > On Thu, Oct 27, 2016 at 12:57 PM,  <alastair at au1.ibm.com> wrote:
> > > 
> > > 
> > > From: Alastair D'Silva <alastair at d-silva.org>
> > > 
> > > This series adds preliminary support for the Epson rx8900 RTC.
> > > 
> > > Setting and retrieving time is supported, and the chip temperature
> > > is hardcoded.
> > I commented in the patch about setting the temperature with a
> > property
> > so we can adjust it at runtime with the monitor.
> That sounds like a good idea.
> 
> > 
> > > 
> > > 
> > > Other features (in particular, those that require the interrupt
> > > line)
> > > are not implmented.
> > Do you intend to implement these features?
> Only if necessary. I need to understand how to wire the virtual non-i2c 
> interrupt line from the RTC to the SOC before these could be
> implemented.

There are two parts: One is to add a qemu_irq member to your device's
state struct, and initialise it in your realize() with
sysbus_init_irq().

The second part is to wire up the interrupt at the machine level: This
time in the machine's realize(), invoke:

    qemu_irq irq = qdev_get_gpio_in(DEVICE(&s->vic), irq_nr)

to grab a qemu_irq, and connect it with

    sysbus_connect_irq(SYS_BUS_DEVICE(&s->timerctrl), 0, irq)

In this case, your magic irq_nr value is 22. The interrupt controller's
default configuration matches the requirements for irq 22, so there
shouldn't be anything further.

Hope that helps,

Andrew

> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20161031/f0545390/attachment-0001.sig>


More information about the openbmc mailing list