[PATCH 2/2] hw/arm: enable eeproms for quanta-q71l

Yubin Zou posted 2 patches 1 month, 4 weeks ago
Maintainers: "Cédric Le Goater" <clg@kaod.org>, Peter Maydell <peter.maydell@linaro.org>, Steven Lee <steven_lee@aspeedtech.com>, Troy Lee <leetroy@gmail.com>, Jamin Lin <jamin_lin@aspeedtech.com>, Andrew Jeffery <andrew@codeconstruct.com.au>, Joel Stanley <joel@jms.id.au>
[PATCH 2/2] hw/arm: enable eeproms for quanta-q71l
Posted by Yubin Zou 1 month, 4 weeks ago
From: Patrick Venture <venture@google.com>

Tested: Quanta-q71l firmware booted to login and was populated via the
-drives for the corresponding eeproms.
Signed-off-by: Patrick Venture <venture@google.com>
---
 hw/arm/aspeed.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index bae59ae7394882e3fc93863049a37ff5a8737ff8..8cef387a0b431576a873553704920886222cca86 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -562,16 +562,16 @@ static void quanta_q71l_bmc_i2c_init(AspeedMachineState *bmc)
     i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 1), "tmp105", 0x4f);
 
     /* Baseboard FRU */
-    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 1), 0x54, 8192);
+    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 1), 1, 0x54, 8192, 0);
     /* Frontpanel FRU */
-    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 1), 0x57, 8192);
+    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 1), 1, 0x57, 8192, 1);
     /* TODO: Add Memory Riser i2c mux and eeproms. */
 
     i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "pca9546", 0x74);
     i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "pca9548", 0x77);
 
     /* Add BIOS FRU */
-    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 3), 0x56, 8192);
+    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 3), 3, 0x56, 8192, 2);
 
     /* i2c-7 */
     i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 7), "pca9546", 0x70);
@@ -581,9 +581,9 @@ static void quanta_q71l_bmc_i2c_init(AspeedMachineState *bmc)
     /*        - i2c@3: pmbus@59 */
 
     /* PDB FRU */
-    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 7), 0x52, 8192);
+    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 7), 7, 0x52, 8192, 3);
     /* BMC FRU */
-    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 8), 0x50, 8192);
+    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 8), 8, 0x50, 8192, 4);
 }
 
 static void ast2500_evb_i2c_init(AspeedMachineState *bmc)

-- 
2.51.0.384.g4c02a37b29-goog
Re: [PATCH 2/2] hw/arm: enable eeproms for quanta-q71l
Posted by Cédric Le Goater 1 month, 4 weeks ago
Hi,

On 9/16/25 19:50, Yubin Zou wrote:
> From: Patrick Venture <venture@google.com>
> 
> Tested: Quanta-q71l firmware booted to login and was populated via the
> -drives for the corresponding eeproms.
> Signed-off-by: Patrick Venture <venture@google.com>
> ---
>   hw/arm/aspeed.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
> index bae59ae7394882e3fc93863049a37ff5a8737ff8..8cef387a0b431576a873553704920886222cca86 100644
> --- a/hw/arm/aspeed.c
> +++ b/hw/arm/aspeed.c
> @@ -562,16 +562,16 @@ static void quanta_q71l_bmc_i2c_init(AspeedMachineState *bmc)
>       i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 1), "tmp105", 0x4f);
>   
>       /* Baseboard FRU */
> -    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 1), 0x54, 8192);
> +    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 1), 1, 0x54, 8192, 0);

Where is at24c_eeprom_init_one() implementation ?


Thanks,

C.


>       /* Frontpanel FRU */
> -    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 1), 0x57, 8192);
> +    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 1), 1, 0x57, 8192, 1);
>       /* TODO: Add Memory Riser i2c mux and eeproms. */
>   
>       i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "pca9546", 0x74);
>       i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "pca9548", 0x77);
>   
>       /* Add BIOS FRU */
> -    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 3), 0x56, 8192);
> +    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 3), 3, 0x56, 8192, 2);
>   
>       /* i2c-7 */
>       i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 7), "pca9546", 0x70);
> @@ -581,9 +581,9 @@ static void quanta_q71l_bmc_i2c_init(AspeedMachineState *bmc)
>       /*        - i2c@3: pmbus@59 */
>   
>       /* PDB FRU */
> -    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 7), 0x52, 8192);
> +    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 7), 7, 0x52, 8192, 3);
>       /* BMC FRU */
> -    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 8), 0x50, 8192);
> +    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 8), 8, 0x50, 8192, 4);
>   }
>   
>   static void ast2500_evb_i2c_init(AspeedMachineState *bmc)
>
Re: [PATCH 2/2] hw/arm: enable eeproms for quanta-q71l
Posted by Yubin Zou 1 month, 2 weeks ago
Yes, I will include the patch containing the utility function of
at24c_eeprom_init_one.

Yubin

On Tue, Sep 16, 2025 at 11:07 PM Cédric Le Goater <clg@kaod.org> wrote:

> Hi,
>
> On 9/16/25 19:50, Yubin Zou wrote:
> > From: Patrick Venture <venture@google.com>
> >
> > Tested: Quanta-q71l firmware booted to login and was populated via the
> > -drives for the corresponding eeproms.
> > Signed-off-by: Patrick Venture <venture@google.com>
> > ---
> >   hw/arm/aspeed.c | 10 +++++-----
> >   1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
> > index
> bae59ae7394882e3fc93863049a37ff5a8737ff8..8cef387a0b431576a873553704920886222cca86
> 100644
> > --- a/hw/arm/aspeed.c
> > +++ b/hw/arm/aspeed.c
> > @@ -562,16 +562,16 @@ static void
> quanta_q71l_bmc_i2c_init(AspeedMachineState *bmc)
> >       i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 1),
> "tmp105", 0x4f);
> >
> >       /* Baseboard FRU */
> > -    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 1), 0x54, 8192);
> > +    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 1), 1, 0x54,
> 8192, 0);
>
> Where is at24c_eeprom_init_one() implementation ?
>
>
> Thanks,
>
> C.
>
>
> >       /* Frontpanel FRU */
> > -    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 1), 0x57, 8192);
> > +    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 1), 1, 0x57,
> 8192, 1);
> >       /* TODO: Add Memory Riser i2c mux and eeproms. */
> >
> >       i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2),
> "pca9546", 0x74);
> >       i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2),
> "pca9548", 0x77);
> >
> >       /* Add BIOS FRU */
> > -    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 3), 0x56, 8192);
> > +    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 3), 3, 0x56,
> 8192, 2);
> >
> >       /* i2c-7 */
> >       i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 7),
> "pca9546", 0x70);
> > @@ -581,9 +581,9 @@ static void
> quanta_q71l_bmc_i2c_init(AspeedMachineState *bmc)
> >       /*        - i2c@3: pmbus@59 */
> >
> >       /* PDB FRU */
> > -    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 7), 0x52, 8192);
> > +    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 7), 7, 0x52,
> 8192, 3);
> >       /* BMC FRU */
> > -    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 8), 0x50, 8192);
> > +    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 8), 8, 0x50,
> 8192, 4);
> >   }
> >
> >   static void ast2500_evb_i2c_init(AspeedMachineState *bmc)
> >
>
>
Re: [PATCH 2/2] hw/arm: enable eeproms for quanta-q71l
Posted by Cédric Le Goater 3 days, 6 hours ago
Hi,

On 10/1/25 00:17, Yubin Zou wrote:
> Yes, I will include the patch containing the utility function of at24c_eeprom_init_one.

Will you send an update or have you given up on the idea ?


Thanks,

C.


> 
> Yubin
> 
> On Tue, Sep 16, 2025 at 11:07 PM Cédric Le Goater <clg@kaod.org <mailto:clg@kaod.org>> wrote:
> 
>     Hi,
> 
>     On 9/16/25 19:50, Yubin Zou wrote:
>      > From: Patrick Venture <venture@google.com <mailto:venture@google.com>>
>      >
>      > Tested: Quanta-q71l firmware booted to login and was populated via the
>      > -drives for the corresponding eeproms.
>      > Signed-off-by: Patrick Venture <venture@google.com <mailto:venture@google.com>>
>      > ---
>      >   hw/arm/aspeed.c | 10 +++++-----
>      >   1 file changed, 5 insertions(+), 5 deletions(-)
>      >
>      > diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
>      > index bae59ae7394882e3fc93863049a37ff5a8737ff8..8cef387a0b431576a873553704920886222cca86 100644
>      > --- a/hw/arm/aspeed.c
>      > +++ b/hw/arm/aspeed.c
>      > @@ -562,16 +562,16 @@ static void quanta_q71l_bmc_i2c_init(AspeedMachineState *bmc)
>      >       i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 1), "tmp105", 0x4f);
>      >
>      >       /* Baseboard FRU */
>      > -    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 1), 0x54, 8192);
>      > +    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 1), 1, 0x54, 8192, 0);
> 
>     Where is at24c_eeprom_init_one() implementation ?
> 
> 
>     Thanks,
> 
>     C.
> 
> 
>      >       /* Frontpanel FRU */
>      > -    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 1), 0x57, 8192);
>      > +    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 1), 1, 0x57, 8192, 1);
>      >       /* TODO: Add Memory Riser i2c mux and eeproms. */
>      >
>      >       i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "pca9546", 0x74);
>      >       i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "pca9548", 0x77);
>      >
>      >       /* Add BIOS FRU */
>      > -    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 3), 0x56, 8192);
>      > +    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 3), 3, 0x56, 8192, 2);
>      >
>      >       /* i2c-7 */
>      >       i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 7), "pca9546", 0x70);
>      > @@ -581,9 +581,9 @@ static void quanta_q71l_bmc_i2c_init(AspeedMachineState *bmc)
>      >       /*        - i2c@3: pmbus@59 */
>      >
>      >       /* PDB FRU */
>      > -    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 7), 0x52, 8192);
>      > +    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 7), 7, 0x52, 8192, 3);
>      >       /* BMC FRU */
>      > -    at24c_eeprom_init(aspeed_i2c_get_bus(&soc->i2c, 8), 0x50, 8192);
>      > +    at24c_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 8), 8, 0x50, 8192, 4);
>      >   }
>      >
>      >   static void ast2500_evb_i2c_init(AspeedMachineState *bmc)
>      >
>