LpcCrOSEC: Add MEC support#46
Conversation
namazso
left a comment
There was a problem hiding this comment.
Sorry for being quite late with this, I was fairly busy with other things as well as the 2.1.0 release.
I don't like how this reintroduced dynamic arrays, but I guess it may be hard to avoid here.
No worries! I've been pretty busy recently too, so this timing worked out perfectly!
Yeah I tried to avoid them, but I couldn't figure out how to get around |
| if (data_size < 4) { | ||
| int3(); | ||
| return; | ||
| } | ||
|
|
There was a problem hiding this comment.
Hi sorry, I don't see how this prevents an overflow. mec_transfer can handle less than 4 byte transfers, so this check just breaks that.
There was a problem hiding this comment.
That’s unfortunate. I assumed it must be at least 4 bytes since the following code may write up to 3 bytes even if the passed size parameter is less than that.
There was a problem hiding this comment.
Ahh yeah I see, I've it screwed up, I just created #51.
Hi, I've added MEC EC support to LpcCrOSEC, these are found on Framework's Intel 11th, 12th & 13th gen Laptops and some Chromebooks.
Microchip ECs require data to flow through their EMI interface rather than directly over LPC, but are otherwise just a normal CrOS EC.
This code is based on the datasheet for the MEC172x, Framework's ectool, and the Linux kernel.
Tested on a Framework 13 Intel 1240p and a Framework 13 AMD 7840u.
Thanks,
Steve