Skip to contentSkip to conversation

hw/arm: Add more devices to kudo-bmc

PATCH Applied Patrick Venture 3 participants 9 messages Jan 2, 2022 – Jan 7, 2022

lore
Share & tools
lore
#0 lore raw

cover hw/arm: Add more devices to kudo-bmc

This series of patches adds various devices that are defined in the device-tree for this board.

Chris Rauer (1):
hw/arm: Add kudo i2c eeproms.

Patrick Venture (2):
hw/arm: add i2c muxes to kudo-bmc
hw/arm: kudo add lm75s on bus 13

Shengtan Mao (1):
hw/arm: attach MMC to kudo-bmc

 hw/arm/npcm7xx_boards.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
Signature · 1 line
2.34.1.448.ga2b2bfdf31-goog
#1 lore raw

PATCH 1/4 hw/arm: Add kudo i2c eeproms.

From: Chris Rauer <[email protected]>

---
 hw/arm/npcm7xx_boards.c | 8 ++++++++
 1 file changed, 8 insertions(+)
hw/arm/npcm7xx_boards.c +8 -0
index 0866d2f4f0..37de9fef43 100644
@@ -328,6 +328,13 @@ static void quanta_gbs_i2c_init(NPCM7xxState *soc)
      */
 }
 
+static void kudo_bmc_i2c_init(NPCM7xxState *soc)
+{
+    at24c_eeprom_init(soc, 4, 0x50, 8192); /* mbfru */
+    at24c_eeprom_init(soc, 14, 0x55, 8192); /* bmcfru */
+    /* TODO: Add remaining i2c devices. */
+}
+
 static void npcm750_evb_init(MachineState *machine)
 {
     NPCM7xxState *soc;
@@ -391,6 +398,7 @@ static void kudo_bmc_init(MachineState *machine)
     npcm7xx_connect_flash(&soc->fiu[1], 0, "mx66u51235f",
                           drive_get(IF_MTD, 3, 0));
 
+    kudo_bmc_i2c_init(soc);
     npcm7xx_load_kernel(machine, soc);
 }
 
Signature · 1 line
2.34.1.448.ga2b2bfdf31-goog
#3 lore raw

PATCH 2/4 hw/arm: attach MMC to kudo-bmc

In reply to Patrick Venture

From: Shengtan Mao <[email protected]>

---
 hw/arm/npcm7xx_boards.c | 1 +
 1 file changed, 1 insertion(+)
hw/arm/npcm7xx_boards.c +1 -0
index 37de9fef43..257bf638fd 100644
@@ -399,6 +399,7 @@ static void kudo_bmc_init(MachineState *machine)
                           drive_get(IF_MTD, 3, 0));
 
     kudo_bmc_i2c_init(soc);
+    sdhci_attach_drive(&soc->mmc.sdhci, 0);
     npcm7xx_load_kernel(machine, soc);
 }
 
Signature · 1 line
2.34.1.448.ga2b2bfdf31-goog
#4 lore raw

PATCH 3/4 hw/arm: add i2c muxes to kudo-bmc

In reply to Patrick Venture
---
 hw/arm/npcm7xx_boards.c | 9 +++++++++
 1 file changed, 9 insertions(+)
hw/arm/npcm7xx_boards.c +9 -0
index 257bf638fd..4cd58972c5 100644
@@ -330,8 +330,17 @@ static void quanta_gbs_i2c_init(NPCM7xxState *soc)
 
 static void kudo_bmc_i2c_init(NPCM7xxState *soc)
 {
+    i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 1), TYPE_PCA9548, 0x75);
+    i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 1), TYPE_PCA9548, 0x77);
+
+    i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 4), TYPE_PCA9548, 0x77);
+
     at24c_eeprom_init(soc, 4, 0x50, 8192); /* mbfru */
+
+    i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 13), TYPE_PCA9548, 0x77);
+
     at24c_eeprom_init(soc, 14, 0x55, 8192); /* bmcfru */
+
     /* TODO: Add remaining i2c devices. */
 }
 
Signature · 1 line
2.34.1.448.ga2b2bfdf31-goog
#6 lore raw

PATCH 4/4 hw/arm: kudo add lm75s on bus 13

In reply to Patrick Venture

Add the four lm75s behind the mux on bus 13.

Tested by booting the firmware:
lm75 42-0048: hwmon0: sensor 'lm75'
lm75 43-0049: supply vs not found, using dummy regulator lm75 43-0049: hwmon1: sensor 'lm75'
lm75 44-0048: supply vs not found, using dummy regulator lm75 44-0048: hwmon2: sensor 'lm75'
lm75 45-0049: supply vs not found, using dummy regulator lm75 45-0049: hwmon3: sensor 'lm75'

---
 hw/arm/npcm7xx_boards.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
hw/arm/npcm7xx_boards.c +10 -1
index 4cd58972c5..7d0f3148be 100644
@@ -330,6 +330,8 @@ static void quanta_gbs_i2c_init(NPCM7xxState *soc)
 
 static void kudo_bmc_i2c_init(NPCM7xxState *soc)
 {
+    I2CSlave *i2c_mux;
+
     i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 1), TYPE_PCA9548, 0x75);
     i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 1), TYPE_PCA9548, 0x77);
 
@@ -337,7 +339,14 @@ static void kudo_bmc_i2c_init(NPCM7xxState *soc)
 
     at24c_eeprom_init(soc, 4, 0x50, 8192); /* mbfru */
 
-    i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 13), TYPE_PCA9548, 0x77);
+    i2c_mux = i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 13),
+                                      TYPE_PCA9548, 0x77);
+
+    /* tmp105 is compatible with the lm75 */
+    i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 2), "tmp105", 0x48);
+    i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 3), "tmp105", 0x49);
+    i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 4), "tmp105", 0x48);
+    i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 5), "tmp105", 0x49);
 
     at24c_eeprom_init(soc, 14, 0x55, 8192); /* bmcfru */
 
Signature · 1 line
2.34.1.448.ga2b2bfdf31-goog
Reviewed-by on v1 4/4
#7 lore raw

Re: [PATCH 4/4] hw/arm: kudo add lm75s on bus 13

Quoted 11 lines · Patrick Venture

Add the four lm75s behind the mux on bus 13.

Tested by booting the firmware:
lm75 42-0048: hwmon0: sensor 'lm75'
lm75 43-0049: supply vs not found, using dummy regulator lm75 43-0049: hwmon1: sensor 'lm75'
lm75 44-0048: supply vs not found, using dummy regulator lm75 44-0048: hwmon2: sensor 'lm75'
lm75 45-0049: supply vs not found, using dummy regulator lm75 45-0049: hwmon3: sensor 'lm75'

Quoted 5 lines
---
  hw/arm/npcm7xx_boards.c | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
#8 lore raw
In reply to Patrick Venture
Quoted 10 lines · Patrick Venture

This series of patches adds various devices that are defined in the device-tree for this board.

Chris Rauer (1):
hw/arm: Add kudo i2c eeproms.

Patrick Venture (2):
hw/arm: add i2c muxes to kudo-bmc
hw/arm: kudo add lm75s on bus 13

Quoted 5 lines

Shengtan Mao (1):
hw/arm: attach MMC to kudo-bmc

 hw/arm/npcm7xx_boards.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

Applied to target-arm.next, thanks.

-- PMM