Tim Wawrzynczak has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36206 )
Change subject: ec/google/chromeec: Add crosec_get_buffer support to LPC driver ......................................................................
ec/google/chromeec: Add crosec_get_buffer support to LPC driver
Previously, only the I2C and SPI drivers had support for this function, so add it to the LPC driver too.
Change-Id: I4185ea369f7872797269411a7ddb92f11c9343e1 Signed-off-by: Tim Wawrzynczak twawrzynczak@chromium.org --- M src/ec/google/chromeec/ec_lpc.c 1 file changed, 19 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/36206/1
diff --git a/src/ec/google/chromeec/ec_lpc.c b/src/ec/google/chromeec/ec_lpc.c index 1d7e7ee..c00b3d0 100644 --- a/src/ec/google/chromeec/ec_lpc.c +++ b/src/ec/google/chromeec/ec_lpc.c @@ -26,6 +26,25 @@ #include "ec.h" #include "ec_commands.h"
+#define PROTO3_MAX_PACKET_SIZE 268 + +static uint8_t req_buf[PROTO3_MAX_PACKET_SIZE]; +static uint8_t resp_buf[PROTO3_MAX_PACKET_SIZE]; + +void *crosec_get_buffer(size_t size, int req) +{ + if (size > PROTO3_MAX_PACKET_SIZE) { + printk(BIOS_DEBUG, "Proto v3 buffer request too large: %zu!\n", + size); + return NULL; + } + + if (req) + return req_buf; + else + return resp_buf; +} + /* * Read bytes from a given LPC-mapped address. *
Hello Aaron Durbin, Karthik Ramasubramanian, Julius Werner, Duncan Laurie, Shelley Chen, build bot (Jenkins), Joel Kitching, Furquan Shaikh, Patrick Georgi,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/36206
to look at the new patch set (#2).
Change subject: ec/google/chromeec: Add crosec_get_buffer support to LPC driver ......................................................................
ec/google/chromeec: Add crosec_get_buffer support to LPC driver
Previously, only the I2C and SPI drivers had support for this function, so add it to the LPC driver too.
Change-Id: I4185ea369f7872797269411a7ddb92f11c9343e1 Signed-off-by: Tim Wawrzynczak twawrzynczak@chromium.org --- M src/ec/google/chromeec/ec_lpc.c 1 file changed, 19 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/36206/2
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36206 )
Change subject: ec/google/chromeec: Add crosec_get_buffer support to LPC driver ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36206/2/src/ec/google/chromeec/ec_l... File src/ec/google/chromeec/ec_lpc.c:
https://review.coreboot.org/c/coreboot/+/36206/2/src/ec/google/chromeec/ec_l... PS2, Line 29: #define PROTO3_MAX_PACKET_SIZE 268 I don't think you should add this... we should try to eliminate the whole need for copy buffers instead. See my comment on other CL.
Tim Wawrzynczak has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/36206 )
Change subject: ec/google/chromeec: Add crosec_get_buffer support to LPC driver ......................................................................
Abandoned
different approach for buffer management