Skip to content

LpcCrOSEC: Add MEC support#46

Merged
namazso merged 2 commits into
namazso:mainfrom
Steve-Tech:crosec_mec
Feb 25, 2026
Merged

LpcCrOSEC: Add MEC support#46
namazso merged 2 commits into
namazso:mainfrom
Steve-Tech:crosec_mec

Conversation

@Steve-Tech

@Steve-Tech Steve-Tech commented Jan 18, 2026

Copy link
Copy Markdown
Contributor

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

@namazso namazso left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@namazso namazso merged commit f491ffd into namazso:main Feb 25, 2026
@Steve-Tech

Copy link
Copy Markdown
Contributor Author

Sorry for being quite late with this

No worries! I've been pretty busy recently too, so this timing worked out perfectly!

I don't like how this reintroduced dynamic arrays

Yeah I tried to avoid them, but I couldn't figure out how to get around error 047: array sizes/definitions do not match, or destination array is too small without them.

Comment thread LpcCrOSEC.p
Comment on lines +109 to +113
if (data_size < 4) {
int3();
return;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh yeah I see, I've it screwed up, I just created #51.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants