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

Add guide for address discovery #152

Merged
merged 22 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ Also, and until future enhancements, no DMI data is used to identify your laptop

Check if your device is supported before attempting to install and use the driver. The list of supported devices can be found [here](docs/supported_devices.md).

Can't find your device in the list? Check contribution guides and open new issue.

## Contribute
Eager to support the project? Your help is always welcome to keep the project alive and going!
- Read how to get necessary information about device on Windows and Linux in [this guide](docs/device_support_guide.md)
- Checkout the relevant [wiki article](https://github.com/BeardOverflow/msi-ec/wiki/Contributing).
- If you want to go deeper: [read into this discussion regarding ec firmware naming patterns](https://github.com/BeardOverflow/msi-ec/discussions/98).


## Installation

Expand Down Expand Up @@ -244,8 +252,3 @@ You can use `make load-debug` command to load the module in the debug mode after

Set this parameter to a supported EC firmware version to use its configuration and test if it is compatible with your EC.
**Please verify that the attributes return the correct data before attempting to write into them!**

## Contribute
Eager to support the project? Your help is always welcome to keep the project alive and going!
- Checkout the relevant [wiki article](https://github.com/BeardOverflow/msi-ec/wiki/Contributing).
- If you want to go deeper: [read into this discussion regarding ec firmware naming patterns](https://github.com/BeardOverflow/msi-ec/discussions/98).
108 changes: 108 additions & 0 deletions docs/device_support_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Intro
To get your MSI laptop supported, there are two main methods, one that
requires windows to be installed, and the other works directly on linux.
mutchiko marked this conversation as resolved.
Show resolved Hide resolved

If you have any bios/firmware updates on the official MSI website, and
you haven't updated yet then **DO NOT UPDATE!** follow the guide first:
mutchiko marked this conversation as resolved.
Show resolved Hide resolved

## Windows method(recommended):
mutchiko marked this conversation as resolved.
Show resolved Hide resolved

1. Install Windows 10/11 normally, booting directly from a live usb or
any other trick won't work, however windows activation is not
needed.

2. After a successful installation, make sure to download/install all
Windows updates from the settings
(windows can't update bios/firmware automatically on MSI
laptops but that doesn't mean you have to update them yourself,
instead continue following the guide).

3. Install the MSI app designed for your laptop: MSI dragon center /
MSI creator center / MSI center / MSI center pro (the correct app
can be found on the support page for your laptop).

4. If you fail at step 3, then you most likely need another app. usually
its AMD Adrenalin software / GeForce Experience (nvidia)/ or intel
equivalent.

5. Once the MSI app is installed, you can test the functions it offers,
like user scenario and battery charge limit.

6. If everything works as expected, download RWEverything:
https://rweverything.com/download/ ![download RWEverything](pics/support_guide/dl_rwe.png)

7. Launch it as administrator:
![run as admin](pics/support_guide/run_as_admin.png)

8. Navigate to the EC tab (page):
![open ec tab](pics/support_guide/open_ec_tab.png)

9. Here you should see a table of all the values your Embedded Chip has in its memory.\
The values you see can be changed manually (by writing to them)\
\
DO NOT DO THAT: writing the wrong the values to the wrong address might brick the laptop completely and EC/BIOS RESET CAN'T FIX THAT!<br/>
glpnk marked this conversation as resolved.
Show resolved Hide resolved
![not apply changes](pics/support_guide/not_apply_changes.png)

10. Change the reading speed to 500-600ms,
this makes it easier to see how the
values react to the MSI app settings:
mutchiko marked this conversation as resolved.
Show resolved Hide resolved
![refresh rate button](pics/support_guide/refresh_menu.png)

11. Reading addresses: lets say you are looking for a specific address
0x54 (0xFirstNumberSecondNumber) FirstNumber can be found
on the left side of the table and SecondNumber can be found on
the top side of the table:
glpnk marked this conversation as resolved.
Show resolved Hide resolved
![hex editor how to](pics/support_guide/hex_editor_how_to.png)

Each **Address** contains a **Value**, when you locate an **Address** inside the
table you can write it like this 0x54 = 00 (**Address** = **Value**)
This **Value** can change depending on what it is related to, if you find the
**Address** for CPU temperature; the **Value** will change on its own, if you
find the **Address** for battery charge limit, then the **Value** won't change
until you change the settings in the MSI app.
mutchiko marked this conversation as resolved.
Show resolved Hide resolved

Example: To figure out which **Address** is used by user scenario (`shift
mode`) go to the user scenario page in the MSI app and keep changing it
while looking at the EC table.

Eventually you'll notice a **Value** that changes each time you change the
setting (or maybe two **Values** in two **Addresses** that change at the same
time), once you find the **Address**, you can start writing down the **Value**
for EACH user scenario, so you can report it.
mutchiko marked this conversation as resolved.
Show resolved Hide resolved

### Linux method

***

This method has limited results compared to the Windows method, because most
MSI laptop features are tied to software toggles that can be only found in their apps
installed on windows.
glpnk marked this conversation as resolved.
Show resolved Hide resolved

If you are lucky, your laptop model will have similar addresses to another laptop
that is already supported by the driver, but usually this only happens on some
features like cooler boost and battery charge limit.

To start, You need to load a module called `ec_sys`:

* `sudo modprobe ec_sys`

if you need to write to a specific address (but you really shouldn’t) you can enable
Read/Write mode for this module:

* `sudo modprobe ec_sys write_support=1`

After that you can extract the EC table and print it on the terminal:

* `hexdump -C /sys/kernel/debug/ec/ec0/io`

or you can put it in a .txt file in your home folder directly:

* `cat /sys/kernel/debug/ec/ec0/io > ec.dump`

then you can send us the output, and wish us luck.


P.S: you should repeat the method you used after EACH BIOS/Firmware update, the reason you
shouldn’t update before following the guide is that the values and addresses could change after
updating, and it is important to support all versions of the BIOS/Firmware or the driver might
not work after the update.
mutchiko marked this conversation as resolved.
Show resolved Hide resolved
Binary file added docs/pics/support_guide/dl_rwe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pics/support_guide/hex_editor_how_to.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pics/support_guide/not_apply_changes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pics/support_guide/open_ec_tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pics/support_guide/refresh_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pics/support_guide/run_as_admin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.