aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/platform.c24
-rw-r--r--hw/npu2-common.c10
-rw-r--r--hw/npu2-opencapi.c10
-rw-r--r--include/platform.h12
-rw-r--r--platforms/astbmc/zaius.c22
-rw-r--r--platforms/ibm-fsp/zz.c24
6 files changed, 64 insertions, 38 deletions
diff --git a/core/platform.c b/core/platform.c
index 4b3eaa4..7985ce5 100644
--- a/core/platform.c
+++ b/core/platform.c
@@ -172,21 +172,25 @@ static int generic_start_preload_resource(enum resource_id id, uint32_t subid,
/* These values will work for a ZZ booted using BML */
const struct platform_ocapi generic_ocapi = {
- .i2c_engine = 1,
- .i2c_port = 4,
- .i2c_reset_addr = 0x20,
- .i2c_reset_odl0 = (1 << 1),
- .i2c_reset_odl1 = (1 << 6),
- .i2c_presence_addr = 0x20,
- .i2c_presence_odl0 = (1 << 2), /* bottom connector */
- .i2c_presence_odl1 = (1 << 7), /* top connector */
+ .i2c_engine = 1,
+ .i2c_port = 4,
+ .i2c_reset_addr = 0x20,
+ .i2c_reset_brick2 = (1 << 1),
+ .i2c_reset_brick3 = (1 << 6),
+ .i2c_reset_brick4 = 0, /* unused */
+ .i2c_reset_brick5 = 0, /* unused */
+ .i2c_presence_addr = 0x20,
+ .i2c_presence_brick2 = (1 << 2), /* bottom connector */
+ .i2c_presence_brick3 = (1 << 7), /* top connector */
+ .i2c_presence_brick4 = 0, /* unused */
+ .i2c_presence_brick5 = 0, /* unused */
/*
* The ZZs we typically use for BML/generic platform tend to
* have old planars and presence detection is broken there, so
* force presence.
*/
- .force_presence = true,
- .odl_phy_swap = true,
+ .force_presence = true,
+ .odl_phy_swap = true,
};
static struct bmc_platform generic_bmc = {
diff --git a/hw/npu2-common.c b/hw/npu2-common.c
index 15da3d3..9e392b8 100644
--- a/hw/npu2-common.c
+++ b/hw/npu2-common.c
@@ -115,10 +115,16 @@ static bool _i2c_presence_detect(struct npu2_dev *dev)
switch (dev->link_index) {
case 2:
- data = platform.ocapi->i2c_presence_odl0;
+ data = platform.ocapi->i2c_presence_brick2;
break;
case 3:
- data = platform.ocapi->i2c_presence_odl1;
+ data = platform.ocapi->i2c_presence_brick3;
+ break;
+ case 4:
+ data = platform.ocapi->i2c_presence_brick4;
+ break;
+ case 5:
+ data = platform.ocapi->i2c_presence_brick5;
break;
default:
OCAPIERR(dev, "presence detection on invalid link\n");
diff --git a/hw/npu2-opencapi.c b/hw/npu2-opencapi.c
index 7033d07..8c4f346 100644
--- a/hw/npu2-opencapi.c
+++ b/hw/npu2-opencapi.c
@@ -816,12 +816,16 @@ static void assert_reset(struct npu2_dev *dev)
switch (dev->brick_index) {
case 2:
- case 4:
- pin = platform.ocapi->i2c_reset_odl0;
+ pin = platform.ocapi->i2c_reset_brick2;
break;
case 3:
+ pin = platform.ocapi->i2c_reset_brick3;
+ break;
+ case 4:
+ pin = platform.ocapi->i2c_reset_brick4;
+ break;
case 5:
- pin = platform.ocapi->i2c_reset_odl1;
+ pin = platform.ocapi->i2c_reset_brick5;
break;
default:
assert(false);
diff --git a/include/platform.h b/include/platform.h
index efafbd2..fee5a76 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -50,11 +50,15 @@ struct platform_ocapi {
uint8_t i2c_engine; /* I2C engine number */
uint8_t i2c_port; /* I2C port number */
uint8_t i2c_reset_addr; /* I2C address for reset */
- uint8_t i2c_reset_odl0; /* I2C pin to write to reset ODL0 */
- uint8_t i2c_reset_odl1; /* I2C pin to write to reset ODL1 */
+ uint8_t i2c_reset_brick2; /* I2C pin to write to reset brick 2 */
+ uint8_t i2c_reset_brick3; /* I2C pin to write to reset brick 3 */
+ uint8_t i2c_reset_brick4; /* I2C pin to write to reset brick 4 */
+ uint8_t i2c_reset_brick5; /* I2C pin to write to reset brick 5 */
uint8_t i2c_presence_addr; /* I2C address for presence detection */
- uint8_t i2c_presence_odl0; /* I2C mask for detection on ODL0 */
- uint8_t i2c_presence_odl1; /* I2C mask for detection on ODL1 */
+ uint8_t i2c_presence_brick2; /* I2C pin to read for presence on brick 2 */
+ uint8_t i2c_presence_brick3; /* I2C pin to read for presence on brick 3 */
+ uint8_t i2c_presence_brick4; /* I2C pin to read for presence on brick 4 */
+ uint8_t i2c_presence_brick5; /* I2C pin to read for presence on brick 5 */
bool force_presence; /* don't use i2c detection */
bool odl_phy_swap; /* Swap ODL1 to use brick 2 rather than
* brick 1 lanes */
diff --git a/platforms/astbmc/zaius.c b/platforms/astbmc/zaius.c
index 4d93e61..0ee6dd0 100644
--- a/platforms/astbmc/zaius.c
+++ b/platforms/astbmc/zaius.c
@@ -77,15 +77,19 @@ static void zaius_get_slot_info(struct phb *phb, struct pci_device *pd)
}
const struct platform_ocapi zaius_ocapi = {
- .i2c_engine = 1,
- .i2c_port = 4,
- .i2c_reset_addr = 0x20,
- .i2c_reset_odl0 = (1 << 1),
- .i2c_reset_odl1 = (1 << 6),
- .i2c_presence_addr = 0x20,
- .i2c_presence_odl0 = (1 << 2), /* bottom connector */
- .i2c_presence_odl1 = (1 << 7), /* top connector */
- .odl_phy_swap = true,
+ .i2c_engine = 1,
+ .i2c_port = 4,
+ .i2c_reset_addr = 0x20,
+ .i2c_reset_brick2 = (1 << 1),
+ .i2c_reset_brick3 = (1 << 6),
+ .i2c_reset_brick4 = 0, /* unused */
+ .i2c_reset_brick5 = 0, /* unused */
+ .i2c_presence_addr = 0x20,
+ .i2c_presence_brick2 = (1 << 2), /* bottom connector */
+ .i2c_presence_brick3 = (1 << 7), /* top connector */
+ .i2c_presence_brick4 = 0, /* unused */
+ .i2c_presence_brick5 = 0, /* unused */
+ .odl_phy_swap = true,
};
ST_PLUGGABLE(pe0_slot, "PE0");
diff --git a/platforms/ibm-fsp/zz.c b/platforms/ibm-fsp/zz.c
index 7c717d3..e544726 100644
--- a/platforms/ibm-fsp/zz.c
+++ b/platforms/ibm-fsp/zz.c
@@ -30,20 +30,24 @@
/* We don't yet create NPU device nodes on ZZ, but these values are correct */
const struct platform_ocapi zz_ocapi = {
- .i2c_engine = 1,
- .i2c_port = 4,
- .i2c_reset_addr = 0x20,
- .i2c_reset_odl0 = (1 << 1),
- .i2c_reset_odl1 = (1 << 6),
- .i2c_presence_addr = 0x20,
- .i2c_presence_odl0 = (1 << 2), /* bottom connector */
- .i2c_presence_odl1 = (1 << 7), /* top connector */
+ .i2c_engine = 1,
+ .i2c_port = 4,
+ .i2c_reset_addr = 0x20,
+ .i2c_reset_brick2 = (1 << 1),
+ .i2c_reset_brick3 = (1 << 6),
+ .i2c_reset_brick4 = 0, /* unused */
+ .i2c_reset_brick5 = 0, /* unused */
+ .i2c_presence_addr = 0x20,
+ .i2c_presence_brick2 = (1 << 2), /* bottom connector */
+ .i2c_presence_brick3 = (1 << 7), /* top connector */
+ .i2c_presence_brick4 = 0, /* unused */
+ .i2c_presence_brick5 = 0, /* unused */
/*
* i2c presence detection is broken on ZZ planar < v4 so we
* force the presence until all our systems are upgraded
*/
- .force_presence = true,
- .odl_phy_swap = true,
+ .force_presence = true,
+ .odl_phy_swap = true,
};
static bool zz_probe(void)