Hi Cédric

> Subject: Re: [PATCH v1 09/10] hw/arm/aspeed_ast1040_evb: Introduce
> onboard I2C device
> 
> On 5/29/26 08:42, Jamin Lin wrote:
> > Introduce onboard I2C device initialization for the AST1040 EVB model.
> >
> > This change adds the initial onboard I2C device setup flow and
> > instantiates a 24C08 SMBus EEPROM device connected to I2C bus 0,
> > matching the current AST1040 EVB hardware design.
> >
> > Signed-off-by: Jamin Lin <[email protected]>
> > ---
> >   hw/arm/aspeed_ast1040_evb.c | 18 ++++++++++++++++++
> >   1 file changed, 18 insertions(+)
> >
> > diff --git a/hw/arm/aspeed_ast1040_evb.c b/hw/arm/aspeed_ast1040_evb.c
> > index 1d9b55247f..392b0d5159 100644
> > --- a/hw/arm/aspeed_ast1040_evb.c
> > +++ b/hw/arm/aspeed_ast1040_evb.c
> > @@ -14,6 +14,7 @@
> >   #include "hw/arm/aspeed_soc.h"
> >   #include "hw/core/qdev-clock.h"
> >   #include "system/system.h"
> > +#include "hw/i2c/smbus_eeprom.h"
> >
> >   #define AST1040_INTERNAL_FLASH_SIZE (4 * MiB)
> >   /* Main SYSCLK frequency in Hz (400MHz) */ @@ -38,12 +39,28 @@
> > static void aspeed_bic_machine_init(MachineState *machine)
> >       aspeed_connect_serial_hds_to_uarts(bmc);
> >       qdev_realize(DEVICE(bmc->soc), NULL, &error_abort);
> >
> > +    if (amc->i2c_init) {
> > +        amc->i2c_init(bmc);
> > +    }
> > +
> >       armv7m_load_kernel(ARM_CPU(first_cpu),
> >                          machine->kernel_filename,
> >                          0,
> >                          AST1040_INTERNAL_FLASH_SIZE);
> >   }
> >
> > +static void ast1040_evb_i2c_init(AspeedMachineState *bmc) {
> > +    AspeedSoCState *soc = bmc->soc;
> > +
> > +    /* U10 24C08 connects to SDA/SCL Group 1 by default */
> > +    uint8_t *eeprom_buf = g_malloc0(32 * 1024);
> 
> 32 * KiB
> 

Thanks for the review and suggestion.
Will do.

Jamin

> Thanks,
> 
> C.
> 
> 
> > +    smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 0), 0x50,
> > + eeprom_buf);
> > +
> > +    /* U11 LM75 connects to SDA/SCL Group 2 by default */
> > +    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 1),
> > +"tmp105", 0x4d); }
> > +
> >   static void aspeed_machine_ast1040_evb_class_init(ObjectClass *oc,
> >                                                     const void
> *data)
> >   {
> > @@ -55,6 +72,7 @@ static void
> aspeed_machine_ast1040_evb_class_init(ObjectClass *oc,
> >       amc->hw_strap1 = 0;
> >       amc->hw_strap2 = 0;
> >       mc->init = aspeed_bic_machine_init;
> > +    amc->i2c_init = ast1040_evb_i2c_init;
> >       mc->default_ram_size = 0;
> >       amc->macs_mask = 0;
> >       amc->uart_default = ASPEED_DEV_UART12;

Reply via email to