Skip to contentSkip to conversation

With the pca954x i2c mux available, enable it on aspeed and nuvoton BMC boards.

PATCH Applied Patrick Venture 3 participants 6 messages Jun 8, 2021 – Jun 15, 2021 Arm/Aspeed machine support

lore
Share & tools
lore
#0 lore raw

v2 cover With the pca954x i2c mux available, enable it on aspeed and nuvoton BMC boards.

v2:
- Dropped sonorapass patch.

Patrick Venture (3):
hw/arm: gsj add i2c comments
hw/arm: gsj add pca9548
hw/arm: quanta-q71l add pca954x muxes

 hw/arm/Kconfig          |  2 ++
 hw/arm/aspeed.c         | 11 ++++++++---
 hw/arm/npcm7xx_boards.c | 14 +++++++++++++-
 3 files changed, 23 insertions(+), 4 deletions(-)
Signature · 1 line
2.32.0.rc1.229.g3e70b5a671-goog
#1 lore raw

PATCH v2 1/3 hw/arm: gsj add i2c comments

Adds comments to the board init to identify missing i2c devices.

---
 hw/arm/npcm7xx_boards.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
hw/arm/npcm7xx_boards.c +15 -1
index d4553e3786..9b7a7cd201 100644
@@ -220,7 +220,21 @@ static void quanta_gsj_i2c_init(NPCM7xxState *soc)
     at24c_eeprom_init(soc, 9, 0x55, 8192);
     at24c_eeprom_init(soc, 10, 0x55, 8192);
 
-    /* TODO: Add additional i2c devices. */
+    /*
+     * i2c-11:
+     * - power-brick@36: delta,dps800
+     * - hotswap@15: ti,lm5066i
+     */
+
+    /*
+     * i2c-12:
+     * - ucd90160@6b
+     */
+
+    /*
+     * i2c-15:
+     * - pca9548@75
+     */
 }
 
 static void quanta_gsj_fan_init(NPCM7xxMachine *machine, NPCM7xxState *soc)
Signature · 1 line
2.32.0.rc1.229.g3e70b5a671-goog
#2 lore raw

PATCH v2 2/3 hw/arm: gsj add pca9548

In reply to Patrick Venture

Tested: Quanta-gsj firmware booted.

i2c /dev entries driver
I2C init bus 1 freq 100000
I2C init bus 2 freq 100000
I2C init bus 3 freq 100000
I2C init bus 4 freq 100000
I2C init bus 8 freq 100000
I2C init bus 9 freq 100000
at24 9-0055: 8192 byte 24c64 EEPROM, writable, 1 bytes/write I2C init bus 10 freq 100000
at24 10-0055: 8192 byte 24c64 EEPROM, writable, 1 bytes/write I2C init bus 12 freq 100000
I2C init bus 15 freq 100000
i2c i2c-15: Added multiplexed i2c bus 16
i2c i2c-15: Added multiplexed i2c bus 17
i2c i2c-15: Added multiplexed i2c bus 18
i2c i2c-15: Added multiplexed i2c bus 19
i2c i2c-15: Added multiplexed i2c bus 20
i2c i2c-15: Added multiplexed i2c bus 21
i2c i2c-15: Added multiplexed i2c bus 22
i2c i2c-15: Added multiplexed i2c bus 23
pca954x 15-0075: registered 8 multiplexed busses for I2C switch pca9548

---
 hw/arm/Kconfig          | 1 +
 hw/arm/npcm7xx_boards.c | 6 ++----
 2 files changed, 3 insertions(+), 4 deletions(-)
hw/arm/Kconfig +1 -0
index b887f6a5b1..9d1c2a6f7b 100644
@@ -377,6 +377,7 @@ config NPCM7XX
     select SERIAL
     select SSI
     select UNIMP
+    select PCA954X
 
 config FSL_IMX25
     bool
hw/arm/npcm7xx_boards.c +2 -4
index 9b7a7cd201..f0a96564e2 100644
@@ -18,6 +18,7 @@
 
 #include "hw/arm/npcm7xx.h"
 #include "hw/core/cpu.h"
+#include "hw/i2c/i2c_mux_pca954x.h"
 #include "hw/i2c/smbus_eeprom.h"
 #include "hw/loader.h"
 #include "hw/qdev-core.h"
@@ -231,10 +232,7 @@ static void quanta_gsj_i2c_init(NPCM7xxState *soc)
      * - ucd90160@6b
      */
 
-    /*
-     * i2c-15:
-     * - pca9548@75
-     */
+    i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 15), "pca9548", 0x75);
 }
 
 static void quanta_gsj_fan_init(NPCM7xxMachine *machine, NPCM7xxState *soc)
Signature · 1 line
2.32.0.rc1.229.g3e70b5a671-goog
#3 lore raw

PATCH v2 3/3 hw/arm: quanta-q71l add pca954x muxes

In reply to Patrick Venture

Adds the pca954x muxes expected.

Tested: Booted quanta-q71l image to userspace.

---
 hw/arm/Kconfig  |  1 +
 hw/arm/aspeed.c | 11 ++++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)
hw/arm/Kconfig +1 -0
index 9d1c2a6f7b..4a033e81ef 100644
@@ -413,6 +413,7 @@ config ASPEED_SOC
     select PCA9552
     select SERIAL
     select SMBUS_EEPROM
+    select PCA954X
     select SSI
     select SSI_M25P80
     select TMP105
hw/arm/aspeed.c +8 -3
index 3fe6c55744..35a28b0e8b 100644
@@ -14,6 +14,7 @@
 #include "hw/arm/boot.h"
 #include "hw/arm/aspeed.h"
 #include "hw/arm/aspeed_soc.h"
+#include "hw/i2c/i2c_mux_pca954x.h"
 #include "hw/i2c/smbus_eeprom.h"
 #include "hw/misc/pca9552.h"
 #include "hw/misc/tmp105.h"
@@ -461,14 +462,18 @@ static void quanta_q71l_bmc_i2c_init(AspeedMachineState *bmc)
     /* TODO: i2c-1: Add Frontpanel FRU eeprom@57 24c64 */
     /* TODO: Add Memory Riser i2c mux and eeproms. */
 
-    /* TODO: i2c-2: pca9546@74 */
-    /* TODO: i2c-2: pca9548@77 */
+    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);
+
     /* TODO: i2c-3: Add BIOS FRU eeprom@56 24c64 */
-    /* TODO: i2c-7: Add pca9546@70 */
+
+    /* i2c-7 */
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 7), "pca9546", 0x70);
     /*        - i2c@0: pmbus@59 */
     /*        - i2c@1: pmbus@58 */
     /*        - i2c@2: pmbus@58 */
     /*        - i2c@3: pmbus@59 */
+
     /* TODO: i2c-7: Add PDB FRU eeprom@52 */
     /* TODO: i2c-8: Add BMC FRU eeprom@50 */
 }
Signature · 1 line
2.32.0.rc1.229.g3e70b5a671-goog
Reviewed-by on v2 3/3
#4 lore raw

Re: [PATCH v2 3/3] hw/arm: quanta-q71l add pca954x muxes

Quoted 6 lines · Patrick Venture

Adds the pca954x muxes expected.

Tested: Booted quanta-q71l image to userspace.

I guess this patchset can go through the arm tree directly.

Thanks,

C.

Quoted 52 lines
---
 hw/arm/Kconfig  |  1 +
 hw/arm/aspeed.c | 11 ++++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)
hw/arm/Kconfig +1 -0
index 9d1c2a6f7b..4a033e81ef 100644
@@ -413,6 +413,7 @@ config ASPEED_SOC
     select PCA9552
     select SERIAL
     select SMBUS_EEPROM
+    select PCA954X
     select SSI
     select SSI_M25P80
     select TMP105
hw/arm/aspeed.c +8 -3
index 3fe6c55744..35a28b0e8b 100644
@@ -14,6 +14,7 @@
 #include "hw/arm/boot.h"
 #include "hw/arm/aspeed.h"
 #include "hw/arm/aspeed_soc.h"
+#include "hw/i2c/i2c_mux_pca954x.h"
 #include "hw/i2c/smbus_eeprom.h"
 #include "hw/misc/pca9552.h"
 #include "hw/misc/tmp105.h"
@@ -461,14 +462,18 @@ static void quanta_q71l_bmc_i2c_init(AspeedMachineState *bmc)
     /* TODO: i2c-1: Add Frontpanel FRU eeprom@57 24c64 */
     /* TODO: Add Memory Riser i2c mux and eeproms. */
 
-    /* TODO: i2c-2: pca9546@74 */
-    /* TODO: i2c-2: pca9548@77 */
+    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);
+
     /* TODO: i2c-3: Add BIOS FRU eeprom@56 24c64 */
-    /* TODO: i2c-7: Add pca9546@70 */
+
+    /* i2c-7 */
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 7), "pca9546", 0x70);
     /*        - i2c@0: pmbus@59 */
     /*        - i2c@1: pmbus@58 */
     /*        - i2c@2: pmbus@58 */
     /*        - i2c@3: pmbus@59 */
+
     /* TODO: i2c-7: Add PDB FRU eeprom@52 */
     /* TODO: i2c-8: Add BMC FRU eeprom@50 */
 }
#5 lore raw
In reply to Patrick Venture
Quoted 8 lines · Patrick Venture

v2:
- Dropped sonorapass patch.

Patrick Venture (3):
hw/arm: gsj add i2c comments
hw/arm: gsj add pca9548
hw/arm: quanta-q71l add pca954x muxes

Applied to target-arm.next, thanks.

-- PMM