BeardOverflow / msi-ec

GNU General Public License v2.0
149 stars 45 forks source link

Firmware request for MSI Raider GE68HX #156

Open AnonCoder3 opened 2 months ago

AnonCoder3 commented 2 months ago

Laptop model

MSI Raider GE68HX 13VG

EC firmware version

15M2IMS1.113

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 00 00 3b 5b
0x3_ | 03 03 00 0d 01 00 50 81 6a 18 60 3b 71 02 80 00
0x4_ | 35 0c 3f 00 b1 16 78 0b 2e 0e 8c 40 fa 0b f8 43
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 33 00 28 37 40 46 51 5b
0x7_ | 64 2d 00 1e 2d 3c 55 6e 96 00 0a 08 08 08 08 08
0x8_ | 2a 00 28 2d 32 3c 46 50 64 1e 00 1e 2d 3d 55 6e
0x9_ | 96 5f 07 07 07 07 07 07 02 00 00 02 00 00 00 00
0xa_ | 31 35 4d 32 49 4d 53 31 2e 31 31 33 31 31 32 37
0xb_ | 32 30 32 33 31 36 3a 32 30 3a 32 38 00 00 00 08
0xc_ | 00 00 06 31 00 00 00 00 00 b5 01 0a 00 00 00 00
0xd_ | 00 00 c1 00 8d 00 04 d0 00 00 00 00 00 04 00 00
0xe_ | e2 00 00 b1 16 00 00 c1 01 00 00 00 00 c1 00 00
0xf_ | 10 00 70 00 2c 3c 32 00 3c 32 00 00 00 00 00 00

GPU

Nvidia

Is your keyboard RGB?

Yes (multi color RGB)

Additional context

Started this project because the fan speed was capping out at 75% rpm even if set to 100%, which caused overheating and emergency shut down. Turns out the "Balanced" shift mode enforces the cap. Performance mode allows 100% rpms. (edit) Fan speed may or not be the issue, but was the first suspect

Findings:

Webcam 2E off=39 on=3b

Webcam Block N/A

Fn-Win swap E8 Win-Fn=0? Fn-Win=1?

Cooler Boost 0x98, bit 7 off=02 on=82

Shift Mode D2 Performance=c4 Balanced=c1 Super Battery=c2 Silent (c1) AI (c1)

Super Battery EB off=00 on=0f

Fan Mode D4 auto=0d silent=1d adv=8d

Battery thresholds (Charge Control) D7 Balanced(70-80)=d0 Mobility(100)=e4 Battery(50-60)=bc

USB Share BF off=08 on=28

Mic LED 2C off=00 on=02

Mute LED 2D off=00 on=02 Enable with: echo 'Master Playback Switch' | sudo tee /sys/class/sound/ctl-led/speaker/card1/attach

CPU Temp 0x68

CPU (Fan 1) Speed (current rpm) 480000 / value at combined: c8..c9

CPU (Fan 1) Address / Min / Max speed=0x71 min=0% max=150%

GPU Temp 0x80

GPU (Fan 2) Speed (current rpm) 480000 / value at combined: ca..cb

GPU (Fan 2) Address / Min / Max speed=0x89 min=0% max=150%

Keyboard Backlight / Levels This keyboard has individual key rgb Settings are configured in the SteelSeries app 5 dim levels from keyboard button full on, 3 dim levels, off Button affects the other RGB features too Doesn't seem to be reflected in EC dump

glpnk commented 2 months ago

Hi, thank you for research! Seems like you found all addresses, would you open PR or I can do it?

Started this project because the fan speed was capping out at 75% rpm even if set to 100%, which caused overheating and emergency shut down. Turns out the "Balanced" shift mode enforces the cap. Performance mode allows 100% rpms.

Interesting fact, thanks.

Does pressing the keyboard backlight button on Linux changes something?

About overheating: does your device overheating when run Windows? Did someone replace stock thermal paste? Maybe it's caused by famous Intel fuckup with 13 and 14 generation? What's exactly overheating? Did you update bios?

AnonCoder3 commented 2 months ago

Would you open PR or I can do it?

You can do the PR. This type of coding is outside my area of expertise. Below is what I've been running.

Does pressing the keyboard backlight button on Linux changes something?

Yes, it changes the dim levels just like in Windows.

NOTE: Research into the thermals is ongoing. I'm having trouble reproducing the issue ATM, which I guess is a good thing. I revised my original statement about the cause.

does your device overheating when run Windows?

No, it does not.

Did someone replace stock thermal paste?

No. It's the factory-installed paste

13 and 14 generation?

I would expect it to cause issues in Windows and performance mode as well if it were this. I've been able max things out for hours in Windows. From the new readings, it shouldn't be an issue in Linux now either.

What's exactly overheating?

The ACPI interface and CPU

Did you update bios?

Yes. Latest version

static const char *ALLOWED_FW_28[] __initconst = {
    "15M2IMS1.113", // Raider GE68HX 13VG
    NULL
};

static struct msi_ec_conf CONF28 __initdata = {
    .allowed_fw = ALLOWED_FW_28, // WMI2 based
    .charge_control = {
        .address      = 0xd7,
        .offset_start = 0x8a,
        .offset_end   = 0x80,
        .range_min    = 0x8a,
        .range_max    = 0xe4,
    },
    // .usb_share = {
    //      .address      = 0xbf, // states: 0x08 || 0x28
    //      .bit          = 5,
    // },
    .webcam = {
        .address       = 0x2e,
        .block_address = MSI_EC_ADDR_UNSUPP, // not in MSI app
        .bit           = 1,
    },
    .fn_win_swap = {
        .address = 0xe8,
        .bit     = 4,
        .invert  = true,
    },
    .cooler_boost = {
        .address = 0x98,
        .bit     = 7,
    },
    .shift_mode = {
        .address = 0xd2,
        .modes = {
            { SM_COMFORT_NAME, 0xc1 }, // Silent / Balanced / AI
            { SM_ECO_NAME,     0xc2 }, // Super Battery
            { SM_TURBO_NAME,   0xc4 }, // Performance
            MSI_EC_MODE_NULL
        },
    },
    .super_battery = {
        .address = 0xeb,
        .mask    = 0x0f,
    },
    .fan_mode = {
        .address = 0xd4,
        .modes = {
            { FM_AUTO_NAME,     0x0d },
            { FM_SILENT_NAME,   0x1d },
            { FM_ADVANCED_NAME, 0x8d },
            MSI_EC_MODE_NULL
        },
    },
    .cpu = {
        .rt_temp_address       = 0x68,
        .rt_fan_speed_address  = 0x71,
        .rt_fan_speed_base_min = 0x00,
        .rt_fan_speed_base_max = 0x96,
        .bs_fan_speed_address  = MSI_EC_ADDR_UNKNOWN,
        .bs_fan_speed_base_min = 0x00,
        .bs_fan_speed_base_max = 0x0f,
        // Fan rpm is 480000 / value at combined: c8..c9
    },
    .gpu = {
        .rt_temp_address      = 0x80,
        .rt_fan_speed_address = 0x89,
        // Fan rpm is 480000 / value at combined: ca..cb
    },
    .leds = {
        .micmute_led_address = 0x2c,
        .mute_led_address    = 0x2d,
        .bit                 = 1,
    },
    .kbd_bl = {
        .bl_mode_address  = MSI_EC_ADDR_UNSUPP,
        .bl_modes         = { 0x00, 0x08 },
        .max_mode         = 1,
        .bl_state_address = MSI_EC_ADDR_UNSUPP,
        .state_base_value = 0x80,
        .max_state        = 3,
    },
};
glpnk commented 2 months ago

Okay, you said it was CPU. You can reduce max CPU clock to reduce unnecessary turbo boosting (if you really don't need it for work/gaming).

You also can check which CPU frequency driver is used. It should be intel-pstate for you

Thanks for sharing your config.

If you have a kernel version newer than 6.10 you probably have lm-sensors kernel module which allow you to get RPM