* [PATCH] hw/arm/aspeed: Add i2c devices for AST2600 EVB
@ 2022-05-25 10:00 Howard Chiu
2022-05-25 14:19 ` Cédric Le Goater
0 siblings, 1 reply; 2+ messages in thread
From: Howard Chiu @ 2022-05-25 10:00 UTC (permalink / raw)
To: clg, peter.maydell, Andrew Jeffery, Joel Stanley, qemu-arm, qemu-devel
Cc: Troy Lee, Steven Lee, Jamin Lin
Add EEPROM and LM75 temperature sensor according to hardware schematic
Signed-off-by: Howard Chiu <howard_chiu@aspeedtech.com>
---
hw/arm/aspeed.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index a74c13ab0f..df74d3e955 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -526,8 +526,15 @@ static void ast2500_evb_i2c_init(AspeedMachineState *bmc)
static void ast2600_evb_i2c_init(AspeedMachineState *bmc)
{
- /* Start with some devices on our I2C busses */
- ast2500_evb_i2c_init(bmc);
+ AspeedSoCState *soc = &bmc->soc;
+ uint8_t *eeprom_buf = g_malloc0(8 * 1024);
+
+ smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 7), 0x50,
+ eeprom_buf);
+
+ /* LM75 is compatible with TMP105 driver */
+ i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 8),
+ TYPE_TMP105, 0x4d);
}
static void romulus_bmc_i2c_init(AspeedMachineState *bmc)
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hw/arm/aspeed: Add i2c devices for AST2600 EVB
2022-05-25 10:00 [PATCH] hw/arm/aspeed: Add i2c devices for AST2600 EVB Howard Chiu
@ 2022-05-25 14:19 ` Cédric Le Goater
0 siblings, 0 replies; 2+ messages in thread
From: Cédric Le Goater @ 2022-05-25 14:19 UTC (permalink / raw)
To: Howard Chiu, peter.maydell, Andrew Jeffery, Joel Stanley,
qemu-arm, qemu-devel
Cc: Troy Lee, Steven Lee, Jamin Lin
On 5/25/22 12:00, Howard Chiu wrote:
> Add EEPROM and LM75 temperature sensor according to hardware schematic
>
> Signed-off-by: Howard Chiu <howard_chiu@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Thanks,
C.
> ---
> hw/arm/aspeed.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
> index a74c13ab0f..df74d3e955 100644
> --- a/hw/arm/aspeed.c
> +++ b/hw/arm/aspeed.c
> @@ -526,8 +526,15 @@ static void ast2500_evb_i2c_init(AspeedMachineState *bmc)
>
> static void ast2600_evb_i2c_init(AspeedMachineState *bmc)
> {
> - /* Start with some devices on our I2C busses */
> - ast2500_evb_i2c_init(bmc);
> + AspeedSoCState *soc = &bmc->soc;
> + uint8_t *eeprom_buf = g_malloc0(8 * 1024);
> +
> + smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 7), 0x50,
> + eeprom_buf);
> +
> + /* LM75 is compatible with TMP105 driver */
> + i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 8),
> + TYPE_TMP105, 0x4d);
> }
>
> static void romulus_bmc_i2c_init(AspeedMachineState *bmc)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-25 14:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25 10:00 [PATCH] hw/arm/aspeed: Add i2c devices for AST2600 EVB Howard Chiu
2022-05-25 14:19 ` Cédric Le Goater
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).