aboutsummaryrefslogtreecommitdiff
path: root/hw/npu2-opencapi.c
diff options
context:
space:
mode:
authorAndrew Donnellan <andrew.donnellan@au1.ibm.com>2018-09-14 13:46:26 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-09-17 21:39:01 -0500
commit6a728afd121b5cfad75bd302831c7f8bd47ef269 (patch)
tree44a7a5f1ce9346e9b87ec10e83a1cc813c8cb4a3 /hw/npu2-opencapi.c
parentb6cc82cb39c4d891799f4d7a9f8e76fdf8a16125 (diff)
downloadskiboot-6a728afd121b5cfad75bd302831c7f8bd47ef269.zip
skiboot-6a728afd121b5cfad75bd302831c7f8bd47ef269.tar.gz
skiboot-6a728afd121b5cfad75bd302831c7f8bd47ef269.tar.bz2
hw/npu2, platform: Restructure OpenCAPI i2c reset/presence pins
In platform_ocapi, we define i2c_{reset,presence}_odl{0,1} to specify the appropriate reset/presence GPIO pins for devices connected to ODL0 and ODL1 respectively. This is obviously wrong, because a device connected to brick 2 and a device connected to brick 4 are going to be different devices connected to different I2C pins, but rather conveniently we haven't had to deal with systems that can use the full 4 bricks as yet. Now that we're adding OpenCAPI support for Witherspoon, we should change this to specify pins separately for all 4 bricks. Replace i2c_{reset,presence}_odl{0,1} with i2c_{reset,presence}_brick{2,3,4,5} and update the presence detection code, device reset code, and existing platforms accordingly. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Reviewed-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'hw/npu2-opencapi.c')
-rw-r--r--hw/npu2-opencapi.c10
1 files changed, 7 insertions, 3 deletions
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);