diff options
author | Li Feng <li1.feng@intel.com> | 2023-03-02 23:13:53 -0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-04-04 04:18:55 +0000 |
commit | 2058df4dd5acb6b301a4bfd81a90dbb2a7af247e (patch) | |
tree | 1b8efffd8e4f2d0c25b9deeb7247db484a565574 | |
parent | c833b0a0ae4bb4e371d796cf0c01b34926d682cc (diff) | |
download | chrome-ec-2058df4dd5acb6b301a4bfd81a90dbb2a7af247e.tar.gz |
ish: increase HECI response buffer size
HC version v1 response has 132 bytes, but ISH response buffer is
smaller than this. We will get error as below:
localhost ~ # ectool version --name=cros_ish
EC result 14 (RESPONSE_TOO_BIG)
Hence increase ISH response buffer size to 260 bytes.
BUG=b:271502099
BRANCH=none
TEST=on Rex platform with ISH enabled, "ectool version --name=cros_ish"
will print firmware version, no error.
Change-Id: I81cbea19a2b4719b88b232bfea02803b0a244b89
Signed-off-by: Li Feng <li1.feng@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4302834
Reviewed-by: Yuval Peress <peress@google.com>
Reviewed-by: Tanu Malhotra <tanu.malhotra@intel.com>
-rw-r--r-- | chip/ish/host_command_heci.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/chip/ish/host_command_heci.c b/chip/ish/host_command_heci.c index 3981ea5c53..fe82f94bda 100644 --- a/chip/ish/host_command_heci.c +++ b/chip/ish/host_command_heci.c @@ -43,8 +43,20 @@ struct cros_ec_ishtp_msg_hdr { } __ec_align4; #define CROS_EC_ISHTP_MSG_HDR_SIZE sizeof(struct cros_ec_ishtp_msg_hdr) + +/* + * Increase response_buffer size + * some host command response messages use bigger space; so increase + * the buffer size on par with EC, which is 256 bytes in total. + * The size has to meet + * HECI_CROS_EC_RESPONSE_BUF_SIZE >= CROS_EC_ISHTP_MSG_HDR_SIZE + 256. + * Here 260 bytes is chosen. + */ +#define HECI_CROS_EC_RESPONSE_BUF_SIZE 260 #define HECI_CROS_EC_RESPONSE_MAX \ - (HECI_IPC_PAYLOAD_SIZE - CROS_EC_ISHTP_MSG_HDR_SIZE) + (HECI_CROS_EC_RESPONSE_BUF_SIZE - CROS_EC_ISHTP_MSG_HDR_SIZE) +BUILD_ASSERT(HECI_CROS_EC_RESPONSE_BUF_SIZE >= + CROS_EC_ISHTP_MSG_HDR_SIZE + 256); struct cros_ec_ishtp_msg { struct cros_ec_ishtp_msg_hdr hdr; @@ -56,7 +68,7 @@ enum heci_cros_ec_channel { CROS_MKBP_EVENT = 2, /* initiated from EC */ }; -static uint8_t response_buffer[IPC_MAX_PAYLOAD_SIZE] __aligned(4); +static uint8_t response_buffer[HECI_CROS_EC_RESPONSE_BUF_SIZE] __aligned(4); static struct host_packet heci_packet; int heci_send_mkbp_event(uint32_t *timestamp) |