Upstream: https://gitlab.com/qemu-project/qemu.git Upstream-Commit: d2e570cc0f97b936902a5b1b86b73c0f5998b475
376 lines
15 KiB
C
376 lines
15 KiB
C
/*
|
|
* Facebook Anacapa
|
|
*
|
|
* Copyright (c) 2026 Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#include "qemu/osdep.h"
|
|
#include "qapi/error.h"
|
|
#include "hw/sensor/adc128d818.h"
|
|
#include "hw/arm/machines-qom.h"
|
|
#include "hw/arm/aspeed.h"
|
|
#include "hw/arm/aspeed_soc.h"
|
|
#include "hw/i2c/i2c_mux_pca954x.h"
|
|
#include "hw/gpio/pca9552.h"
|
|
#include "hw/nvram/eeprom_at24c.h"
|
|
|
|
#define ANACAPA_BMC_HW_STRAP1 0x00002002
|
|
#define ANACAPA_BMC_HW_STRAP2 0x00000000
|
|
#define ANACAPA_BMC_RAM_SIZE ASPEED_RAM_SIZE(2 * GiB)
|
|
|
|
/*
|
|
* "Anacapa HPM (MB)" FRU data. Generated with frugen.
|
|
*
|
|
* {
|
|
* "board": { "mfg": "Inventec", "pname": "Anacapa QEMU MB EVT2",
|
|
* "pn": "00000000000", "serial": "00000000000000" },
|
|
* "product": { "mfg": "Inventec", "pname": "CI-Anacapa",
|
|
* "pn": "10000000001", "ver": "MP",
|
|
* "serial": "10000000000000", "atag": "QEMU" }
|
|
* }
|
|
*/
|
|
static const uint8_t hpm_eeprom[] = {
|
|
0x01, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0xf6, 0x01, 0x07, 0x19, 0xb4,
|
|
0xa4, 0xf2, 0xc8, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x65, 0x63, 0xd4,
|
|
0x41, 0x6e, 0x61, 0x63, 0x61, 0x70, 0x61, 0x20, 0x51, 0x45, 0x4d, 0x55,
|
|
0x20, 0x4d, 0x42, 0x20, 0x45, 0x56, 0x54, 0x32, 0x47, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xc0,
|
|
0xc1, 0x00, 0x00, 0xb8, 0x01, 0x06, 0x19, 0xc8, 0x49, 0x6e, 0x76, 0x65,
|
|
0x6e, 0x74, 0x65, 0x63, 0xca, 0x43, 0x49, 0x2d, 0x41, 0x6e, 0x61, 0x63,
|
|
0x61, 0x70, 0x61, 0x46, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x82, 0x2d,
|
|
0x0c, 0x47, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x71, 0xd9,
|
|
0xd6, 0xc0, 0xc1, 0x0e
|
|
};
|
|
static const size_t hpm_eeprom_len = sizeof(hpm_eeprom);
|
|
|
|
/*
|
|
* "Anacapa R-PDB" FRU data. Generated with frugen.
|
|
*
|
|
* {
|
|
* "board": { "mfg": "Inventec", "pname": "Anacapa QEMU RPDB",
|
|
* "pn": "00000000000", "serial": "00000000000000" },
|
|
* "product": { "mfg": "Inventec", "pname": "CI-Anacapa",
|
|
* "pn": "10000000001", "ver": "MP",
|
|
* "serial": "10000000000000", "atag": "QEMU" }
|
|
* }
|
|
*/
|
|
static const uint8_t rpdb_eeprom[] = {
|
|
0x01, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0xf6, 0x01, 0x07, 0x19, 0x41,
|
|
0x2d, 0xf2, 0xc8, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x65, 0x63, 0xd1,
|
|
0x41, 0x6e, 0x61, 0x63, 0x61, 0x70, 0x61, 0x20, 0x51, 0x45, 0x4d, 0x55,
|
|
0x20, 0x52, 0x50, 0x44, 0x42, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xc0, 0xc1, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x4d, 0x01, 0x06, 0x19, 0xc8, 0x49, 0x6e, 0x76, 0x65,
|
|
0x6e, 0x74, 0x65, 0x63, 0xca, 0x43, 0x49, 0x2d, 0x41, 0x6e, 0x61, 0x63,
|
|
0x61, 0x70, 0x61, 0x46, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x82, 0x2d,
|
|
0x0c, 0x47, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x71, 0xd9,
|
|
0xd6, 0xc0, 0xc1, 0x0e
|
|
};
|
|
static const size_t rpdb_eeprom_len = sizeof(rpdb_eeprom);
|
|
|
|
/*
|
|
* "Anacapa L-PDB" FRU data. Generated with frugen.
|
|
*
|
|
* {
|
|
* "board": { "mfg": "Inventec", "pname": "Anacapa QEMU LPDB",
|
|
* "pn": "00000000000", "serial": "00000000000000" },
|
|
* "product": { "mfg": "Inventec", "pname": "CI-Anacapa",
|
|
* "pn": "10000000001", "ver": "MP",
|
|
* "serial": "10000000000000", "atag": "QEMU" }
|
|
* }
|
|
*/
|
|
static const uint8_t lpdb_eeprom[] = {
|
|
0x01, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0xf6, 0x01, 0x07, 0x19, 0x41,
|
|
0x2d, 0xf2, 0xc8, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x65, 0x63, 0xd1,
|
|
0x41, 0x6e, 0x61, 0x63, 0x61, 0x70, 0x61, 0x20, 0x51, 0x45, 0x4d, 0x55,
|
|
0x20, 0x4c, 0x50, 0x44, 0x42, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xc0, 0xc1, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x53, 0x01, 0x06, 0x19, 0xc8, 0x49, 0x6e, 0x76, 0x65,
|
|
0x6e, 0x74, 0x65, 0x63, 0xca, 0x43, 0x49, 0x2d, 0x41, 0x6e, 0x61, 0x63,
|
|
0x61, 0x70, 0x61, 0x46, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x82, 0x2d,
|
|
0x0c, 0x47, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x71, 0xd9,
|
|
0xd6, 0xc0, 0xc1, 0x0e
|
|
};
|
|
static const size_t lpdb_eeprom_len = sizeof(lpdb_eeprom);
|
|
|
|
/*
|
|
* "Anacapa SCM" FRU data. Generated with frugen.
|
|
*
|
|
* {
|
|
* "board": { "mfg": "Quanta", "pname": "Anacapa SCM",
|
|
* "pn": "00000000000", "serial": "00000000000000" },
|
|
* "product": { "mfg": "Quanta", "pname": "CI-Anacapa",
|
|
* "pn": "10000000001", "ver": "MP",
|
|
* "serial": "10000000000000", "atag": "QEMU" }
|
|
* }
|
|
*/
|
|
static const uint8_t scm_eeprom[] = {
|
|
0x01, 0x00, 0x00, 0x01, 0x07, 0x00, 0x00, 0xf7, 0x01, 0x06, 0x19, 0x41,
|
|
0x2d, 0xf2, 0xc6, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x61, 0xcb, 0x41, 0x6e,
|
|
0x61, 0x63, 0x61, 0x70, 0x61, 0x20, 0x53, 0x43, 0x4d, 0x47, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a,
|
|
0xc0, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc5, 0x01, 0x06, 0x19, 0xc6,
|
|
0x51, 0x75, 0x61, 0x6e, 0x74, 0x61, 0xca, 0x43, 0x49, 0x2d, 0x41, 0x6e,
|
|
0x61, 0x63, 0x61, 0x70, 0x61, 0x46, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1a,
|
|
0x82, 0x2d, 0x0c, 0x47, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83,
|
|
0x71, 0xd9, 0xd6, 0xc0, 0xc1, 0x00, 0x00, 0xe2
|
|
};
|
|
static const size_t scm_eeprom_len = sizeof(scm_eeprom);
|
|
|
|
/*
|
|
* "Anacapa BMC Storage Module" FRU data. Generated with frugen.
|
|
*
|
|
* {
|
|
* "board": { "mfg": "Quanta", "pname": "Anacapa BMC Storage Module",
|
|
* "pn": "00000000000", "serial": "00000000000000" },
|
|
* "product": { "mfg": "Quanta", "pname": "CI-Anacapa",
|
|
* "pn": "10000000001", "ver": "MP",
|
|
* "serial": "10000000000000", "atag": "QEMU" }
|
|
* }
|
|
*/
|
|
static const uint8_t bsm_eeprom[] = {
|
|
0x01, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x00, 0xf4, 0x01, 0x09, 0x00, 0x00,
|
|
0x00, 0x00, 0xc6, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x61, 0xda, 0x41, 0x6e,
|
|
0x61, 0x63, 0x61, 0x70, 0x61, 0x20, 0x42, 0x4d, 0x43, 0x20, 0x53, 0x74,
|
|
0x6f, 0x72, 0x61, 0x67, 0x65, 0x20, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
|
|
0xce, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
|
|
0x30, 0x30, 0x30, 0xcb, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
|
|
0x30, 0x30, 0x30, 0xc0, 0xc1, 0x00, 0x00, 0x10, 0x01, 0x08, 0x00, 0xc6,
|
|
0x51, 0x75, 0x61, 0x6e, 0x74, 0x61, 0xca, 0x43, 0x49, 0x2d, 0x41, 0x6e,
|
|
0x61, 0x63, 0x61, 0x70, 0x61, 0xcb, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30,
|
|
0x30, 0x30, 0x30, 0x30, 0x31, 0xc2, 0x4d, 0x50, 0xce, 0x31, 0x30, 0x30,
|
|
0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xc4,
|
|
0x51, 0x45, 0x4d, 0x55, 0xc0, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77,
|
|
};
|
|
static const size_t bsm_eeprom_len = sizeof(bsm_eeprom);
|
|
|
|
/*
|
|
* "Anacapa R Bridge Board" FRU data. Generated with frugen.
|
|
*
|
|
* {
|
|
* "board": { "mfg": "Inventec", "pname": "Anacapa QEMU RBB EVT2",
|
|
* "pn": "00000000000", "serial": "00000000000000" },
|
|
* "product": { "mfg": "Inventec", "pname": "CI-Anacapa",
|
|
* "pn": "10000000001", "ver": "MP",
|
|
* "serial": "10000000000000", "atag": "QEMU" }
|
|
* }
|
|
*/
|
|
static const uint8_t rbb_eeprom[] = {
|
|
0x01, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0xf6, 0x01, 0x07, 0x19, 0xb4,
|
|
0xa4, 0xf2, 0xc8, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x65, 0x63, 0xd5,
|
|
0x41, 0x6e, 0x61, 0x63, 0x61, 0x70, 0x61, 0x20, 0x51, 0x45, 0x4d, 0x55,
|
|
0x20, 0x52, 0x42, 0x42, 0x20, 0x45, 0x56, 0x54, 0x32, 0x47, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a,
|
|
0xc0, 0xc1, 0x00, 0x70, 0x01, 0x06, 0x19, 0xc8, 0x49, 0x6e, 0x76, 0x65,
|
|
0x6e, 0x74, 0x65, 0x63, 0xca, 0x43, 0x49, 0x2d, 0x41, 0x6e, 0x61, 0x63,
|
|
0x61, 0x70, 0x61, 0x46, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x82, 0x2d,
|
|
0x0c, 0x47, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x71, 0xd9,
|
|
0xd6, 0xc0, 0xc1, 0x0e
|
|
};
|
|
static const size_t rbb_eeprom_len = sizeof(rbb_eeprom);
|
|
|
|
/*
|
|
* "Anacapa L Bridge Board" FRU data. Generated with frugen.
|
|
*
|
|
* {
|
|
* "board": { "mfg": "Inventec", "pname": "Anacapa QEMU LBB EVT2",
|
|
* "pn": "00000000000", "serial": "00000000000000" },
|
|
* "product": { "mfg": "Inventec", "pname": "CI-Anacapa",
|
|
* "pn": "10000000001", "ver": "MP",
|
|
* "serial": "10000000000000", "atag": "QEMU" }
|
|
* }
|
|
*/
|
|
static const uint8_t lbb_eeprom[] = {
|
|
0x01, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0xf6, 0x01, 0x07, 0x19, 0xb4,
|
|
0xa4, 0xf2, 0xc8, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x65, 0x63, 0xd5,
|
|
0x41, 0x6e, 0x61, 0x63, 0x61, 0x70, 0x61, 0x20, 0x51, 0x45, 0x4d, 0x55,
|
|
0x20, 0x4c, 0x42, 0x42, 0x20, 0x45, 0x56, 0x54, 0x32, 0x47, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a,
|
|
0xc0, 0xc1, 0x00, 0x76, 0x01, 0x06, 0x19, 0xc8, 0x49, 0x6e, 0x76, 0x65,
|
|
0x6e, 0x74, 0x65, 0x63, 0xca, 0x43, 0x49, 0x2d, 0x41, 0x6e, 0x61, 0x63,
|
|
0x61, 0x70, 0x61, 0x46, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x82, 0x2d,
|
|
0x0c, 0x47, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x71, 0xd9,
|
|
0xd6, 0xc0, 0xc1, 0x0e
|
|
};
|
|
static const size_t lbb_eeprom_len = sizeof(lbb_eeprom);
|
|
|
|
/*
|
|
* "Anacapa HPM BRD ID" FRU data. Generated with frugen.
|
|
*
|
|
* {
|
|
* "board": { "mfg": "Inventec", "pname": "Anacapa HPM BRD ID",
|
|
* "pn": "00000000000", "serial": "00000000000000" },
|
|
* "product": { "mfg": "Inventec", "pname": "CI-Anacapa",
|
|
* "pn": "10000000001", "ver": "MP",
|
|
* "serial": "10000000000000", "atag": "QEMU" }
|
|
* }
|
|
*/
|
|
static const uint8_t hpm_brd_id_eeprom[] = {
|
|
0x01, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0xf6, 0x01, 0x07, 0x19, 0x41,
|
|
0x2d, 0xf2, 0xc8, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x65, 0x63, 0xd2,
|
|
0x41, 0x6e, 0x61, 0x63, 0x61, 0x70, 0x61, 0x20, 0x48, 0x50, 0x4d, 0x20,
|
|
0x42, 0x52, 0x44, 0x20, 0x49, 0x44, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xc0, 0xc1, 0x00,
|
|
0x00, 0x00, 0x00, 0x42, 0x01, 0x06, 0x19, 0xc8, 0x49, 0x6e, 0x76, 0x65,
|
|
0x6e, 0x74, 0x65, 0x63, 0xca, 0x43, 0x49, 0x2d, 0x41, 0x6e, 0x61, 0x63,
|
|
0x61, 0x70, 0x61, 0x46, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x82, 0x2d,
|
|
0x0c, 0x47, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x71, 0xd9,
|
|
0xd6, 0xc0, 0xc1, 0x0e
|
|
};
|
|
static const size_t hpm_brd_id_eeprom_len = sizeof(hpm_brd_id_eeprom);
|
|
|
|
static void anacapa_add_adc128d818(I2CBus *bus, uint8_t addr,
|
|
const char *description)
|
|
{
|
|
DeviceState *dev = DEVICE(i2c_slave_new(TYPE_ADC128D818, addr));
|
|
g_autofree char *childname = g_strdup_printf("0x%02x", addr);
|
|
|
|
qdev_prop_set_string(dev, "description", description);
|
|
object_property_add_child(OBJECT(bus), childname, OBJECT(dev));
|
|
i2c_slave_realize_and_unref(I2C_SLAVE(dev), bus, &error_fatal);
|
|
}
|
|
|
|
static void anacapa_bmc_i2c_init(AspeedMachineState *bmc)
|
|
{
|
|
/* Reference: aspeed-bmc-facebook-anacapa.dts */
|
|
|
|
AspeedSoCState *soc = bmc->soc;
|
|
I2CBus *i2c[16] = {};
|
|
I2CSlave *i2c_mux;
|
|
|
|
for (int i = 0; i < ARRAY_SIZE(i2c); i++) {
|
|
i2c[i] = aspeed_i2c_get_bus(&soc->i2c, i);
|
|
}
|
|
|
|
/* &i2c0 */
|
|
/* eeprom@50 */
|
|
at24c_eeprom_init(i2c[0], 0x50, 256 * KiB);
|
|
/* i2c-mux@70 */
|
|
i2c_slave_create_simple(i2c[0], TYPE_PCA9546, 0x70);
|
|
|
|
/* &i2c1 */
|
|
/* eeprom@50 */
|
|
at24c_eeprom_init(i2c[1], 0x50, 256 * KiB);
|
|
/* i2c-mux@70 (PCA9546) - 4 channels, empty */
|
|
i2c_slave_create_simple(i2c[1], TYPE_PCA9546, 0x70);
|
|
|
|
/* &i2c4 */
|
|
/* i2c-mux@70 (PCA9548) */
|
|
i2c_slave_create_simple(i2c[4], TYPE_PCA9548, 0x70);
|
|
|
|
/* &i2c6 */
|
|
/* eeprom@50 */
|
|
at24c_eeprom_init_rom(i2c[6], 0x50, 32 * KiB,
|
|
hpm_eeprom, hpm_eeprom_len);
|
|
|
|
/* &i2c8 */
|
|
/* i2c-mux@72 (PCA9546) */
|
|
i2c_mux = i2c_slave_create_simple(i2c[8], TYPE_PCA9546, 0x72);
|
|
|
|
/* i2c8mux ch0 */
|
|
/* adc128d818@1f - R-PDB ADC (mode 1: 8 voltage channels) */
|
|
anacapa_add_adc128d818(pca954x_i2c_get_bus(i2c_mux, 0), 0x1f, "i2c8:0:1f");
|
|
/* pca9555@22 */
|
|
i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 0),
|
|
TYPE_PCA9552, 0x22);
|
|
/* pca9555@24 */
|
|
i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 0),
|
|
TYPE_PCA9552, 0x24);
|
|
/* eeprom@50 */
|
|
at24c_eeprom_init_rom(pca954x_i2c_get_bus(i2c_mux, 0), 0x50, 16 * KiB,
|
|
rpdb_eeprom, rpdb_eeprom_len);
|
|
|
|
/* i2c8mux ch1 */
|
|
/* pca9555@22 */
|
|
i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 1),
|
|
TYPE_PCA9552, 0x22);
|
|
/* pca9555@24 */
|
|
i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 1),
|
|
TYPE_PCA9552, 0x24);
|
|
/* eeprom@50 */
|
|
at24c_eeprom_init_rom(pca954x_i2c_get_bus(i2c_mux, 1), 0x50, 16 * KiB,
|
|
lpdb_eeprom, lpdb_eeprom_len);
|
|
|
|
/* &i2c9 */
|
|
/* eeprom@50 */
|
|
at24c_eeprom_init_rom(i2c[9], 0x50, 16 * KiB,
|
|
scm_eeprom, scm_eeprom_len);
|
|
/* eeprom@56 */
|
|
at24c_eeprom_init_rom(i2c[9], 0x56, 8 * KiB,
|
|
bsm_eeprom, bsm_eeprom_len);
|
|
|
|
/* &i2c10 */
|
|
/* i2c-mux@71 (PCA9548) */
|
|
i2c_mux = i2c_slave_create_simple(i2c[10], TYPE_PCA9548, 0x71);
|
|
|
|
/* i2c10mux ch5 */
|
|
/* pca9555@22*/
|
|
i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 5),
|
|
TYPE_PCA9552, 0x22);
|
|
/* eeprom@52 */
|
|
at24c_eeprom_init_rom(pca954x_i2c_get_bus(i2c_mux, 5), 0x52, 32 * KiB,
|
|
rbb_eeprom, rbb_eeprom_len);
|
|
|
|
/* &i2c11 */
|
|
/* i2c-mux@71 (PCA9548) */
|
|
i2c_mux = i2c_slave_create_simple(i2c[11], TYPE_PCA9548, 0x71);
|
|
|
|
/* i2c11mux ch0-ch4 - empty */
|
|
|
|
/* i2c11mux ch5 */
|
|
/* pca9555@22 */
|
|
i2c_slave_create_simple(pca954x_i2c_get_bus(i2c_mux, 5),
|
|
TYPE_PCA9552, 0x22);
|
|
/* eeprom@52 */
|
|
at24c_eeprom_init_rom(pca954x_i2c_get_bus(i2c_mux, 5), 0x52, 32 * KiB,
|
|
lbb_eeprom, lbb_eeprom_len);
|
|
|
|
/* &i2c13 */
|
|
/* i2c-mux@70 (PCA9548) */
|
|
i2c_mux = i2c_slave_create_simple(i2c[13], TYPE_PCA9548, 0x70);
|
|
|
|
/* i2c13mux ch3 */
|
|
/* adc128d818@1f - MB ADC (mode 1: 8 voltage channels) */
|
|
anacapa_add_adc128d818(pca954x_i2c_get_bus(i2c_mux, 3), 0x1f, "i2c13:3:1f");
|
|
|
|
/* i2c13mux ch4 */
|
|
/* eeprom@51 */
|
|
at24c_eeprom_init_rom(pca954x_i2c_get_bus(i2c_mux, 4), 0x51, 32 * KiB,
|
|
hpm_brd_id_eeprom, hpm_brd_id_eeprom_len);
|
|
|
|
/* i2c13mux ch7 */
|
|
/* nfc@28 - no model */
|
|
}
|
|
|
|
static void aspeed_machine_anacapa_class_init(ObjectClass *oc,
|
|
const void *data)
|
|
{
|
|
MachineClass *mc = MACHINE_CLASS(oc);
|
|
AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
|
|
|
|
mc->desc = "Facebook Anacapa BMC (Cortex-A7)";
|
|
amc->soc_name = "ast2600-a3";
|
|
amc->hw_strap1 = ANACAPA_BMC_HW_STRAP1;
|
|
amc->hw_strap2 = ANACAPA_BMC_HW_STRAP2;
|
|
amc->fmc_model = "mx66l1g45g";
|
|
amc->spi_model = NULL;
|
|
amc->num_cs = 2;
|
|
amc->macs_mask = ASPEED_MAC2_ON;
|
|
amc->i2c_init = anacapa_bmc_i2c_init;
|
|
mc->default_ram_size = ANACAPA_BMC_RAM_SIZE;
|
|
aspeed_machine_class_init_cpus_defaults(mc);
|
|
}
|
|
|
|
static const TypeInfo aspeed_ast2600_anacapa_types[] = {
|
|
{
|
|
.name = MACHINE_TYPE_NAME("anacapa-bmc"),
|
|
.parent = TYPE_ASPEED_MACHINE,
|
|
.class_init = aspeed_machine_anacapa_class_init,
|
|
.interfaces = arm_machine_interfaces,
|
|
}
|
|
};
|
|
|
|
DEFINE_TYPES(aspeed_ast2600_anacapa_types)
|