aboutsummaryrefslogtreecommitdiff
path: root/core/i2c.c
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2016-12-02 13:20:18 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-12-02 14:25:25 +1100
commit157468aeb16e9f50551ac9bc7d46887cba0e011f (patch)
tree292d58ae45cd1f417a7ed4e30c6e6d94483b7743 /core/i2c.c
parentcf6ec98fe79c59fd5de5c5a77917913af8d2cede (diff)
downloadskiboot-157468aeb16e9f50551ac9bc7d46887cba0e011f.zip
skiboot-157468aeb16e9f50551ac9bc7d46887cba0e011f.tar.gz
skiboot-157468aeb16e9f50551ac9bc7d46887cba0e011f.tar.bz2
i2c: Add nuvoton quirk, disallowing i2cdetect as it locks TPM
In TPM 2.0 Firmware 1.3.0.1 and 1.3.1.0 (at least) there exists a bug where if you send the wrong thing to the TPM it may lock the bus, with no way of recovery except powering the TPM off/on. On our current systems, the only way to power the TPM off/on is to pull the power on the system (*NOT* just power off/on to host from BMC). So, this patch adds the ability to do things to the i2c request really early on, well before it hits any hardware, such as quickly drop it. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/i2c.c')
-rw-r--r--core/i2c.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/i2c.c b/core/i2c.c
index de74681..c164624 100644
--- a/core/i2c.c
+++ b/core/i2c.c
@@ -118,6 +118,11 @@ static int opal_i2c_request(uint64_t async_token, uint32_t bus_id,
req->user_data = (void *)(unsigned long)async_token;
req->bus = bus;
+ if (i2c_check_quirk(req, &rc)) {
+ i2c_free_req(req);
+ return rc;
+ }
+
/* Finally, queue the OPAL i2c request and return */
rc = i2c_queue_req(req);
if (rc) {