Use ipmitool/frugen tool to generate a Cable Cart image based on a
sanitized set of data from a real device EEPROM.  The EEPROM
bus/address did not match device tree for one of the EEPROMs so move
it from bus 13 / 55 to bus 12 / 54.

Signed-off-by: Patrick Williams <[email protected]>
---
 hw/arm/aspeed_ast2600_catalina.c | 46 +++++++++++++++++++++++++++++++++++++---
 1 file changed, 43 insertions(+), 3 deletions(-)

diff --git a/hw/arm/aspeed_ast2600_catalina.c b/hw/arm/aspeed_ast2600_catalina.c
index 5044441f38..4edb30bb16 100644
--- a/hw/arm/aspeed_ast2600_catalina.c
+++ b/hw/arm/aspeed_ast2600_catalina.c
@@ -419,6 +419,44 @@ static const uint8_t nic_eeprom[] = {
 };
 static const size_t nic_eeprom_len = sizeof(nic_eeprom);
 
+/*
+ * Cable Cartridge FRU data. Generated with frugen.
+ *
+ *    {
+ *        "board": {
+ *            "mfg": "Nvidia",
+ *            "pname": "18x1RU CBL Cartridge (QEMU)",
+ *            "pn": "000-0000-000",
+ *            "serial": "0000000000000",
+ *            "date": "01/12/2025 00:00"
+ *        },
+ *        "product": {
+ *            "mfg": "Nvidia",
+ *            "pname": "18x1RU CBL Cartridge",
+ *            "pn": "100-00000-0000-001",
+ *            "ver": "E.4",
+ *            "serial": "1000000000001",
+ *            "atag": "QEMU"
+ *        }
+ *    }
+ */
+static const uint8_t cable_eeprom[] = {
+    0x01, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x00, 0xf4, 0x01, 0x09, 0x19, 0x8c,
+    0x19, 0xf0, 0xc6, 0x4e, 0x76, 0x69, 0x64, 0x69, 0x61, 0xdb, 0x31, 0x38,
+    0x78, 0x31, 0x52, 0x55, 0x20, 0x43, 0x42, 0x4c, 0x20, 0x43, 0x61, 0x72,
+    0x74, 0x72, 0x69, 0x64, 0x67, 0x65, 0x20, 0x28, 0x51, 0x45, 0x4d, 0x55,
+    0x29, 0x8a, 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x10,
+    0x89, 0x10, 0x04, 0x35, 0x10, 0x04, 0x41, 0x0d, 0x04, 0x41, 0xc0, 0xc1,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb1, 0x01, 0x09, 0x19, 0xc6,
+    0x4e, 0x76, 0x69, 0x64, 0x69, 0x61, 0xd4, 0x31, 0x38, 0x78, 0x31, 0x52,
+    0x55, 0x20, 0x43, 0x42, 0x4c, 0x20, 0x43, 0x61, 0x72, 0x74, 0x72, 0x69,
+    0x64, 0x67, 0x65, 0x8e, 0x11, 0x04, 0x35, 0x10, 0x04, 0x41, 0x50, 0x03,
+    0x41, 0x10, 0xd4, 0x40, 0x50, 0x04, 0x83, 0xa5, 0x43, 0x01, 0x8a, 0x11,
+    0x04, 0x41, 0x10, 0x04, 0x41, 0x10, 0x04, 0x41, 0x11, 0x83, 0x71, 0xd9,
+    0xd6, 0xc0, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x25
+};
+static const size_t cable_eeprom_len = sizeof(cable_eeprom);
+
 static void catalina_bmc_i2c_init(AspeedMachineState *bmc)
 {
     /* Reference from v6.16-rc2 aspeed-bmc-facebook-catalina.dts */
@@ -561,15 +599,17 @@ static void catalina_bmc_i2c_init(AspeedMachineState *bmc)
     /* eeprom@50 */
     at24c_eeprom_init_rom(i2c[12], 0x50, 8 * KiB,
                           gb200_eeprom, gb200_eeprom_len);
+    /* eeprom@54 */
+    at24c_eeprom_init_rom(i2c[12], 0x54, 256,
+                          cable_eeprom, cable_eeprom_len);
 
     /* &i2c13 */
     /* eeprom@50 */
     at24c_eeprom_init_rom(i2c[13], 0x50, 8 * KiB,
                           gb200_eeprom, gb200_eeprom_len);
     /* eeprom@54 */
-    at24c_eeprom_init(i2c[13], 0x54, 256);
-    /* eeprom@55 */
-    at24c_eeprom_init(i2c[13], 0x55, 256);
+    at24c_eeprom_init_rom(i2c[13], 0x54, 256,
+                          cable_eeprom, cable_eeprom_len);
     /* eeprom@57 */
     at24c_eeprom_init_rom(i2c[13], 0x57, 256, hmc_eeprom, hmc_eeprom_len);
 

-- 
2.51.2


Reply via email to