summaryrefslogtreecommitdiff
path: root/drivers/platform/chrome/cros_ec_lpc.c
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dawidn@google.com>2024-12-06 12:15:13 +0300
committerTzung-Bi Shih <tzungbi@kernel.org>2024-12-30 04:31:05 +0300
commit5ffa0dbfdc9fc05acae02d5b0dc766ec778569ac (patch)
treef4a9dd2dd6cade8831e9964fa466c42653973300 /drivers/platform/chrome/cros_ec_lpc.c
parentcfa842c80c99966db06f5ee7ec03e7d513965247 (diff)
downloadlinux-5ffa0dbfdc9fc05acae02d5b0dc766ec778569ac.tar.xz
platform/chrome: cros_ec: jump to RW before probing
There are EC devices, like FPMCU, that use RWSIG as a method of authenticating RW section. After the authentication succeeds, EC device waits some time before jumping to RW. EC can be probed before the jump, which means there is a time window after jump to RW in which EC won't respond, because it is not initialized. It can cause a communication errors after probing. To avoid such problems, send the RWSIG continue command first, which skips waiting for the jump to RW. Send the command more times, to make sure EC is ready in RW before the start of the actual probing process. If a EC device doesn't support the RWSIG, it will respond with invalid command error code and probing will continue as usual. Signed-off-by: Dawid Niedzwiecki <dawidn@google.com> Link: https://lore.kernel.org/r/20241206091514.2538350-2-dawidn@google.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Diffstat (limited to 'drivers/platform/chrome/cros_ec_lpc.c')
-rw-r--r--drivers/platform/chrome/cros_ec_lpc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
index 8470b7f2b135..17c2578bbc58 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -573,7 +573,7 @@ static int cros_ec_lpc_probe(struct platform_device *pdev)
ec_dev->cmd_readmem = cros_ec_lpc_readmem;
ec_dev->din_size = sizeof(struct ec_host_response) +
sizeof(struct ec_response_get_protocol_info);
- ec_dev->dout_size = sizeof(struct ec_host_request);
+ ec_dev->dout_size = sizeof(struct ec_host_request) + sizeof(struct ec_params_rwsig_action);
ec_dev->priv = ec_lpc;
/*