hw/arm/aspeed: Add i2c devices for AST2600 EVB
authorHoward Chiu <howard_chiu@aspeedtech.com>
Wed, 25 May 2022 10:00:01 +0000 (10:00 +0000)
committerCédric Le Goater <clg@kaod.org>
Wed, 25 May 2022 14:22:37 +0000 (16:22 +0200)
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>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
hw/arm/aspeed.c

index 725c169488dcf352ac5a9b276e5de8d3e347f654..98dc185acd9ae928a6ce512b565981c62e974a56 100644 (file)
@@ -527,8 +527,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)