diff options
author | Frederic Barrat <fbarrat@linux.vnet.ibm.com> | 2018-05-23 19:25:41 +0200 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-06-01 02:07:26 -0500 |
commit | b5c863a86427db83cdb398f227e82745dbe255d0 (patch) | |
tree | 23ab249af5867ddfa77ac2ac82f15dca24fda3ad /platforms | |
parent | 67bdd1668e6a033eb5520105946ebb651f3adff2 (diff) | |
download | skiboot-b5c863a86427db83cdb398f227e82745dbe255d0.zip skiboot-b5c863a86427db83cdb398f227e82745dbe255d0.tar.gz skiboot-b5c863a86427db83cdb398f227e82745dbe255d0.tar.bz2 |
npu2-opencapi: Use presence detection
Presence detection is not part of the opencapi specification. So each
platform may choose to implement it the way it wants.
All current platforms implement it through an i2c device where we can
query a pin to know if a device is connected or not. ZZ and Zaius have
a similar design and even use the same i2c information and pin
numbers.
However, presence detection on older ZZ planar (older than v4) doesn't
work, so we don't activate it for now, until our lab systems are
upgraded and it's better tested.
Presence detection on witherspoon is still being worked on. It's
shaping up to be quite different, so we may have to revisit the topic
in a later patch.
Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'platforms')
-rw-r--r-- | platforms/astbmc/zaius.c | 6 | ||||
-rw-r--r-- | platforms/ibm-fsp/zz.c | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/platforms/astbmc/zaius.c b/platforms/astbmc/zaius.c index 313c41e..fe5bb44 100644 --- a/platforms/astbmc/zaius.c +++ b/platforms/astbmc/zaius.c @@ -24,13 +24,17 @@ #include "astbmc.h" + const struct platform_ocapi zaius_ocapi = { .i2c_engine = 1, .i2c_port = 4, .i2c_offset = { 0x3, 0x1, 0x1 }, .i2c_odl0_data = { 0xFD, 0xFD, 0xFF }, .i2c_odl1_data = { 0xBF, 0xBF, 0xFF }, - .odl_phy_swap = true, + .i2c_presence_addr = 0x20, + .i2c_presence_odl0 = (1 << 2), /* bottom connector */ + .i2c_presence_odl1 = (1 << 7), /* top connector */ + .odl_phy_swap = true, }; #define NPU_BASE 0x5011000 diff --git a/platforms/ibm-fsp/zz.c b/platforms/ibm-fsp/zz.c index 9a84929..6c8411e 100644 --- a/platforms/ibm-fsp/zz.c +++ b/platforms/ibm-fsp/zz.c @@ -34,7 +34,15 @@ const struct platform_ocapi zz_ocapi = { .i2c_offset = { 0x3, 0x1, 0x1 }, .i2c_odl0_data = { 0xFD, 0xFD, 0xFF }, .i2c_odl1_data = { 0xBF, 0xBF, 0xFF }, - .odl_phy_swap = true, + .i2c_presence_addr = 0x20, + .i2c_presence_odl0 = (1 << 2), /* bottom connector */ + .i2c_presence_odl1 = (1 << 7), /* top connector */ + /* + * 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, }; static bool zz_probe(void) |