Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EC FW Support Request for MSI Modern 14 C12M #151

Open
PrimeLemur opened this issue Aug 12, 2024 · 7 comments
Open

EC FW Support Request for MSI Modern 14 C12M #151

PrimeLemur opened this issue Aug 12, 2024 · 7 comments
Labels
New firmware Request for a new firmware

Comments

@PrimeLemur
Copy link

Laptop model

MSI Modern 14 C12M (SKU MS-14J1)

EC firmware version

14J1IMS1.109

EC memory dump

| _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f
-----+------------------------------------------------
0x0_ | 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1_ | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x2_ | 00 00 00 00 00 00 00 00 0a 05 00 00 08 08 0b 0a
0x3_ | 02 05 00 05 00 00 50 81 f4 0c 88 2c 4b 01 c0 00
0x4_ | 16 0d 25 00 f2 0c 5e fe b3 04 c6 2b af 0b fa 32
0x5_ | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x6_ | 00 00 00 00 00 00 00 00 24 00 36 3c 42 48 4e 5a
0x7_ | 64 00 00 28 3c 41 49 58 64 00 03 03 03 03 03 03
0x8_ | 00 00 28 32 3c 46 50 5a 00 00 28 32 3c 46 50 5a
0x9_ | 64 64 03 03 03 03 03 03 02 00 00 04 00 00 00 00
0xa_ | 31 34 4a 31 49 4d 53 31 2e 31 30 39 30 39 31 35
0xb_ | 32 30 32 32 31 30 3a 33 39 3a 35 34 00 00 00 08
0xc_ | 00 00 06 22 00 00 00 00 00 00 00 00 00 00 00 00
0xd_ | 00 00 c1 80 0d 00 05 d0 00 00 00 00 00 00 00 00
0xe_ | e2 00 00 f2 0c 01 00 00 01 00 00 00 00 84 00 00
0xf_ | 00 00 70 00 1d 50 00 00 3c 32 00 00 00 00 00 00

GPU

iGPU only (Intel)

Is your keyboard RGB?

No (single color)

Additional context

MSI Modern C12M, 12th-gen Intel Core i5-1235U, uses MSI Center Pro under Win.
You're all doing great work here & you've made it pretty painless to get EC control for MSI ECs under Linux. I've been working through all the information you've managed to gather ... so much to wade through! Anyway, MSI support website for my SKU states users with firmware xxxxxxxx.1xx (eg my FW = E14J1IMS.110) must use MSI Center Pro, while FW xxxxxxxx.3xx must use MSI Center. Does anyone know if there's any significant difference between the two Win apps?

@PrimeLemur PrimeLemur added the New firmware Request for a new firmware label Aug 12, 2024
@glpnk
Copy link
Contributor

glpnk commented Aug 12, 2024

Does anyone know if there's any significant difference between the two Win apps?

Just different design, plus some features might be accessible in one app, but absent in others. But apps is "incompatible", until you know how to pass checks, or both apps compatible with your device

Your device is WMI2 based, so if you want to contribute, check other WMI2 devices in the sources

@PrimeLemur
Copy link
Author

Thanks for the info. I'll keep reading into it. Some of the stuff the Hackintosh community has documented on laptop ACPI has helped me. I haven't seen many MSI EC dumps yet & I'm still getting familiar with imhex. I'm sure we'll talk again soon.

@glpnk
Copy link
Contributor

glpnk commented Aug 14, 2024

If you don't need Hackintosh - don't read it's guides, many of them used only to satisfy macOS requirements and might break some crucial functions. But Hackintosh community made great DSDT/SSDT editors, so if you already have mac just google them, if not - try this https://github.com/ic005k/Xiasl

You can play with EC structure mapped to ACPI DSDT with my pattern for ImHex. Some values may vary, but majority should be similar.
https://github.com/glpnk/hexpats

If you have next problems like slow charger detection or random screen brightness changes, mention them in reply

@PrimeLemur
Copy link
Author

Thanks for the advice. Yes, the guides they create are not directly relevant. Sometimes they're virtually incomprehensible. But some of the explanatory comments in code, scripts & disassembled tables I found interesting. Anyway ... fortunately my MSI Modern 14 is fairly well behaved under Linux, but I'd like to be able to (easily) control fan profile etc. I am wondering if there are signposts in any of MSI's naming conventions that identify EC compatibilities between models, eg MSI Modern C12M (my machine) and A12M (another 14" model with 12th gen Intel) or even A12U (16" with 12th gen CPU). And yes, I'll check out your patterns for imhex. I'm still checking whether timschneeb's pattern (for his Modern 15 A11M) is identical to mine.

@glpnk
Copy link
Contributor

glpnk commented Aug 15, 2024

TLDR of #98: WMI is a Windows thing, but here it's describe generations:

  • WMI2 is Intel laptops on 11+ gen, and gaming AMD based from 6-7+ gen
  • WMI1 is intel 10 and older gen and other AMD

So inside these generations, devices looks similar, but have different features, some of them are totally unnecessary. But for this module you only need few of them, like LEDs, backlight, and power/cooler profiles. Basically, you just need to remove things which you don't have

@PrimeLemur
Copy link
Author

Thank you, I'll re-read thread 98 some time today. Also, I notice that the msi-ec module loaded in debug mode has an EC dump formatted for human readability. I had to strip the table formatting and convert it with xxd to load in imhex. Is there an easier way to dump the EC as a binary using msi-ec? Is it worth adding such a feature to msi-ec? Obviously msi-ec isn't the only tool to dump a memory address range, only wondering if its something worth adding.
One other question: MSI Center Pro allows user to change battery charging behaviour with my model. For example, on AC battery will charge to 80% then stop until battery <= 70%. This appears to be a 7-bit field in address 0xd7, and with my EC dump, shows it set to dec 80, which is what I expect. So this can be to an arbitrary value (but with obvious consequences for setting it to stupid things)? Now I wonder whether MSI Center balks at values other than its 3(?) preset values of 100, 80 & (from memory) 70?

@glpnk
Copy link
Contributor

glpnk commented Aug 17, 2024

You need to load a module called ec_sys with or w/o write mode:

sudo modprobe ec_sys write_support=1
sudo modprobe ec_sys

Then you can hexdump it or just write dump to file

hexdump -C /sys/kernel/debug/ec/ec0/io
OR
cat /sys/kernel/debug/ec/ec0/io > ec.dump

Also, you can dump EC directly from system memory, but it's kind of a quest, because IDK is EC address on WMI2 the same as on WMI1. Experimental!!! Reads 256 bytes from memory at address 0xFC000800. It's safe to test, I think, because it may just return an error if the address is not mapped.

sudo dd if=/dev/mem bs=1 skip=4227860480 count=256 | hexdump -C

One other question: MSI Center Pro allows user to change battery charging behaviour

Technically, you can set any target charge level (7 bit), which probably shouldn't exceed 100 (0xE4)

Now I wonder whether MSI Center balks at values other than its 3(?) preset values of 100, 80 & (from memory) 70?

100/80/60, not sure how it matches values, but worst thing which could happen is just app crash. "AI" probably use one of 3 stock presets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New firmware Request for a new firmware
Projects
None yet
Development

No branches or pull requests

2 participants