diff mbox series

[v6,3/5] sam460ex: Add RTC device

Message ID 05ab4c16e793ce06710bc9035d9ca8c1fafa7c7f.1530225513.git.balaton@eik.bme.hu
State New
Headers show
Series Misc sam460ex improvements | expand

Commit Message

BALATON Zoltan June 28, 2018, 10:38 p.m. UTC
The Sam460ex has an M41T80 serial RTC chip on I2C bus 0 at address 0x68.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
---
 hw/ppc/sam460ex.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Gibson June 29, 2018, 4:47 a.m. UTC | #1
On Fri, Jun 29, 2018 at 12:38:33AM +0200, BALATON Zoltan wrote:
> The Sam460ex has an M41T80 serial RTC chip on I2C bus 0 at address 0x68.
> 
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> Reviewed-by: Cédric Le Goater <clg@kaod.org>

With Cédric's review, I've applied patches 1..3 to ppc-for-3.0.

> ---
>  hw/ppc/sam460ex.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
> index bdc53d2..dc730cc 100644
> --- a/hw/ppc/sam460ex.c
> +++ b/hw/ppc/sam460ex.c
> @@ -457,6 +457,7 @@ static void sam460ex_init(MachineState *machine)
>      object_property_set_bool(OBJECT(dev), true, "realized", NULL);
>      smbus_eeprom_init(i2c[0]->bus, 8, smbus_eeprom_buf, smbus_eeprom_size);
>      g_free(smbus_eeprom_buf);
> +    i2c_create_slave(i2c[0]->bus, "m41t80", 0x68);
>  
>      dev = sysbus_create_simple(TYPE_PPC4xx_I2C, 0x4ef600800, uic[0][3]);
>      i2c[1] = PPC4xx_I2C(dev);
David Gibson July 2, 2018, 4:04 a.m. UTC | #2
On Fri, Jun 29, 2018 at 02:47:32PM +1000, David Gibson wrote:
> On Fri, Jun 29, 2018 at 12:38:33AM +0200, BALATON Zoltan wrote:
> > The Sam460ex has an M41T80 serial RTC chip on I2C bus 0 at address 0x68.
> > 
> > Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> > Reviewed-by: Cédric Le Goater <clg@kaod.org>
> 
> With Cédric's review, I've applied patches 1..3 to ppc-for-3.0.

So, I discovered after this that 3/3 breaks make check for the
ppcemb-softmmu target, because ppcemb included sam460ex, but not the
i2c bits it now requires.

I've fixed that up by removing sam460ex from the ppcemb build by
adding a new config option.

Please remember to do an all-targets make and make check before
posting, though.

> 
> > ---
> >  hw/ppc/sam460ex.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
> > index bdc53d2..dc730cc 100644
> > --- a/hw/ppc/sam460ex.c
> > +++ b/hw/ppc/sam460ex.c
> > @@ -457,6 +457,7 @@ static void sam460ex_init(MachineState *machine)
> >      object_property_set_bool(OBJECT(dev), true, "realized", NULL);
> >      smbus_eeprom_init(i2c[0]->bus, 8, smbus_eeprom_buf, smbus_eeprom_size);
> >      g_free(smbus_eeprom_buf);
> > +    i2c_create_slave(i2c[0]->bus, "m41t80", 0x68);
> >  
> >      dev = sysbus_create_simple(TYPE_PPC4xx_I2C, 0x4ef600800, uic[0][3]);
> >      i2c[1] = PPC4xx_I2C(dev);
>
diff mbox series

Patch

diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
index bdc53d2..dc730cc 100644
--- a/hw/ppc/sam460ex.c
+++ b/hw/ppc/sam460ex.c
@@ -457,6 +457,7 @@  static void sam460ex_init(MachineState *machine)
     object_property_set_bool(OBJECT(dev), true, "realized", NULL);
     smbus_eeprom_init(i2c[0]->bus, 8, smbus_eeprom_buf, smbus_eeprom_size);
     g_free(smbus_eeprom_buf);
+    i2c_create_slave(i2c[0]->bus, "m41t80", 0x68);
 
     dev = sysbus_create_simple(TYPE_PPC4xx_I2C, 0x4ef600800, uic[0][3]);
     i2c[1] = PPC4xx_I2C(dev);