LenovoLegionLinux icon indicating copy to clipboard operation
LenovoLegionLinux copied to clipboard

Support for Lenovo Legion Slim 5 16AHP9

Open mato157 opened this issue 1 year ago • 46 comments

Is your feature request related to a problem? Please describe. I'd like to request support for the Support for Lenovo Legion Slim 5 16AHP9 (2024).

Describe the solution you'd like I have attached data and debug to help support this model.

Distribution: Ubuntu 24.04 Model name: Lenovo Legion Slim 16AHP9 CPU model: AMD Ryzen 7 8845HS GPU model: Nvidia RTX 4070 Keyboard backlight: RGB Light in lid or logo: No Light at IO-Ports at back: No

Output of sudo dmidecode -t system. Please remove Serial Number and UUID for privacy:

 dmidecode 3.5
Getting SMBIOS data from sysfs.
SMBIOS 3.6.0 present.
 SMBIOS implementations newer than version 3.5.0 are not
 fully supported by this version of dmidecode.

Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: LENOVO
	Product Name: 83DH
	Version: Legion Slim 5 16AHP9
	Serial Number:
	UUID:
	Wake-up Type: Power Switch
	SKU Number: LENOVO_MT_83DH_BU_idea_FM_Legion Slim 5 16AHP9
	Family: Legion Slim 5 16AHP9

Handle 0x001B, DMI type 12, 5 bytes
System Configuration Options
	Option 1: String1 for Type12 Equipment Manufacturer
	Option 2: String2 for Type12 Equipment Manufacturer
	Option 3: String3 for Type12 Equipment Manufacturer
	Option 4: String4 for Type12 Equipment Manufacturer

Handle 0x002E, DMI type 32, 20 bytes
System Boot Information
	Status: No errors detected

Output of sudo dmidecode -t bios:

Getting SMBIOS data from sysfs.
SMBIOS 3.6.0 present.
 SMBIOS implementations newer than version 3.5.0 are not
 fully supported by this version of dmidecode.

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
	Vendor: LENOVO
	Version: NRCN16WW
	Release Date: 03/26/2024
	Address: 0xE0000
	Runtime Size: 128 kB
	ROM Size: 32 MB
	Characteristics:
		PCI is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		Boot from CD is supported
		Selectable boot is supported
		EDD is supported
		Japanese floppy for NEC 9800 1.2 MB is supported (int 13h)
		Japanese floppy for Toshiba 1.2 MB is supported (int 13h)
		5.25"/360 kB floppy services are supported (int 13h)
		5.25"/1.2 MB floppy services are supported (int 13h)
		3.5"/720 kB floppy services are supported (int 13h)
		3.5"/2.88 MB floppy services are supported (int 13h)
		8042 keyboard services are supported (int 9h)
		CGA/mono video services are supported (int 10h)
		ACPI is supported
		USB legacy is supported
		BIOS boot specification is supported
		Targeted content distribution is supported
		UEFI is supported
	BIOS Revision: 1.16
	Firmware Revision: 1.16

Handle 0x001C, DMI type 13, 22 bytes
BIOS Language Information
	Language Description Format: Long
	Installable Languages: 4
		en|US|iso8859-1
		fr|FR|iso8859-1
		ja|JP|unicode
		zh|TW|unicode
	Currently Installed Language: en|US|iso8859-1

Output of sudo cat /sys/kernel/debug/legion/fancurve after using sudo make forcereloadmodule:

EC Chip ID: 8227
EC Chip Version: 2a4
legion_laptop features: fancurve powermode platformprofile platformprofilenotify minifancurve
legion_laptop ec_readonly: 0
ACPI CFG error: 0
ACPI CFG: 4228186128
temperature access method: 1
CPU temperature error: 0
CPU temperature: 0
CPU temperature EC error: 0
CPU temperature EC: 0
CPU temperature ACPI error: -5
CPU temperature ACPI: 0
CPU temperature WMI error: 0
CPU temperature WMI: 42
CPU temperature WMI2 error: 0
CPU temperature WMI2: 0
CPU temperature WMI3 error: 0
CPU temperature WMI3: 42
GPU temperature error: 0
GPU temperature: 0
GPU temperature EC error: 0
GPU temperature EC: 0
GPU temperature ACPI error: -5
GPU temperature ACPI: 0
GPU temperature WMI error: 0
GPU temperature WMI: 45
GPU temperature WMI2 error: 0
GPU temperature WMI2: 0
GPU temperature WMI3 error: 0
GPU temperature WMI3: 45
fan speed access method: 1
1 fanspeed error: 0
1 fanspeed: 0
1 fanspeed EC error: 0
1 fanspeed EC: 0
1 fanspeed ACPI error: -5
1 fanspeed ACPI: 0
1 fanspeed WMI error: 0
1 fanspeed WMI: 0
1 fanspeed WMI2 error: 0
1 fanspeed WMI2: 0
1 fanspeed WMI3 error: 0
1 fanspeed WMI3: 1900
2 fanspeed error: 0
2 fanspeed: 0
2 fanspeed EC error: 0
2 fanspeed EC: 0
2 fanspeed ACPI error: 0
2 fanspeed ACPI: 1900
2 fanspeed WMI error: 0
2 fanspeed WMI: 0
2 fanspeed WMI2 error: 0
2 fanspeed WMI2: 0
2 fanspeed WMI3 error: 0
2 fanspeed WMI3: 1900
powermode access method: 3
powermode error: 0
powermode: 2
powermode EC error: 0
powermode EC: 90
powermode ACPI error: -5
powermode ACPI: 0
powermode WMI error: 0
powermode WMI: 2
has custom powermode: 1
ACPI rapidcharge error: 0
ACPI rapidcharge: 0
WMI backlight 2 state: 0
WMI backlight 3 state: -14
WMI light IO port: 0
WMI light Y logo/lid: 0
EC minifancurve feature enabled: 1
EC minifancurve on cool: error
EC lockfancontroller error: 0
EC lockfancontroller: true
fanfullspeed error: 0
fanfullspeed: 0
fanfullspeed EC error: -1
fanfullspeed EC: 0
EC fan curve current point id: 10
EC fan curve points size: 10
Current fan curve in hardware:
rpm1|rpm2|acceleration|deceleration|cpu_min_temp|cpu_max_temp|gpu_min_temp|gpu_max_temp|ic_min_temp|ic_max_temp
8000	 0	 0	 0	 0	 0	 0	 0	 0	 255
9000	 0	 0	 0	 0	 0	 0	 0	 0	 255
2900	 0	 0	 0	 0	 0	 0	 0	 0	 255
8000	 0	 0	 0	 0	 0	 0	 0	 0	 255
9400	 0	 0	 0	 0	 0	 0	 0	 0	 255
3500	 0	 0	 0	 0	 0	 0	 0	 0	 255
8200	 0	 0	 0	 0	 0	 0	 0	 0	 255
10500	 0	 0	 0	 0	 0	 0	 0	 0	 255
3500	 0	 0	 0	 0	 0	 0	 0	 0	 255
9400	 0	 0	 0	 0	 0	 0	 0	 0	 255
=====================
Current fan curve in hardware (WMI; might be empty)
rpm1|rpm2|acceleration|deceleration|cpu_min_temp|cpu_max_temp|gpu_min_temp|gpu_max_temp|ic_min_temp|ic_max_temp
=====================

Here are WMI : fwts_log.zip

I see that laptop is not on the list of supported devices.

Thank you

mato157 avatar May 11 '24 22:05 mato157

I will second this request.
Same laptop, will try to get the data to add to see if there is any difference as it is not my laptop.

One issue that occurs using Fedora 40. Laptop powers down if the lid is closed when the laptop has been put to sleep/suspend. Power light on back of laptop that indicates that the power block is plugged in and supplying power turns off. Doesn't do this in Windows.

RWL-69 avatar Aug 03 '24 00:08 RWL-69

Cannot use 7z files which is stupid IMHO.

Installed requested files from fedora copr repo and multiple reboots. Cannot compile any programs at this time or run make.

Model Name: Legion Slim 5 16AHP9 CPU model: AMD Ryzen 7 8845HS w/ Radeon 780M GPU model: NVIDIA RTX 4060 Keyboard Backlight: 4-zone RGB

output of dmidecode -t system:

Getting SMBIOS data from sysfs.
SMBIOS 3.6.0 present.

`Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: LENOVO
        Product Name: 83DH
        Version: Legion Slim 5 16AHP9
        Serial Number:
        UUID:
        Wake-up Type: Power Switch
        SKU Number: LENOVO_MT_83DH_BU_idea_FM_Legion Slim 5 16AHP9
        Family: Legion Slim 5 16AHP9

Handle 0x001B, DMI type 12, 5 bytes
System Configuration Options`
        Option 1: String1 for Type12 Equipment Manufacturer
        Option 2: String2 for Type12 Equipment Manufacturer
        Option 3: String3 for Type12 Equipment Manufacturer
        Option 4: String4 for Type12 Equipment Manufacturer

Handle 0x002E, DMI type 32, 20 bytes
System Boot Information
       Status: No errors detected

Output of dmidecode -t bios

Getting SMBIOS data from sysfs.
SMBIOS 3.6.0 present.

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
        Vendor: LENOVO
        Version: NRCN17WW
        Release Date: 04/11/2024
        Address: 0xE0000
        Runtime Size: 128 kB
        ROM Size: 32 MB
        Characteristics:
                PCI is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                Boot from CD is supported
                Selectable boot is supported
                EDD is supported
                Japanese floppy for NEC 9800 1.2 MB is supported (int 13h)
                Japanese floppy for Toshiba 1.2 MB is supported (int 13h)
                5.25"/360 kB floppy services are supported (int 13h)
                5.25"/1.2 MB floppy services are supported (int 13h)
                3.5"/720 kB floppy services are supported (int 13h)
                3.5"/2.88 MB floppy services are supported (int 13h)
                8042 keyboard services are supported (int 9h)
                CGA/mono video services are supported (int 10h)
                ACPI is supported
                USB legacy is supported
                BIOS boot specification is supported
                Targeted content distribution is supported
                UEFI is supported
        BIOS Revision: 1.17
        Firmware Revision: 1.17

Handle 0x001C, DMI type 13, 22 bytes
BIOS Language Information
        Language Description Format: Long
        Installable Languages: 4
                en|US|iso8859-1
                fr|FR|iso8859-1
                ja|JP|unicode
                zh|TW|unicode
        Currently Installed Language: en|US|iso8859-1

do not have file /sys/kernel/debug/legion/fancurve

Was not created by anything from the COPR repository unless there is a different command that will create it without compiling.

Output of iasl -e SSDT* -d DSDT Attempted to generate DSDT.dsl, output file was empty. Copied terminal output to this file instead:

ACPI_Table_Data.zip

Linux WMI log file

FWTS_WMI.zip

Windows WMI log file

Windows_WMI.zip

If there is more information needed, please comment and I will strive to get it ASAP.

RWL-69 avatar Aug 03 '24 04:08 RWL-69

I have a Legion Slim 5 16APH8, so I'm similarly interested in support for 2024 devices.

ryanabx avatar Aug 22 '24 23:08 ryanabx

Hello. On on the same boat as @ryanabx, @RWL-69 and @mato157. I builded the module on Ubuntu 24.04 and I'm getting the same results/output as others, sadly :-( If I could help debugging somehow, tag me, pls.

petyy avatar Aug 27 '24 12:08 petyy

if possible please add support for 16APH8 too

Greatz08 avatar Sep 09 '24 15:09 Greatz08

Using this issue to ask if you guys have the same issue as I do, the DisableWhileTyping Xorg conf doesn't work for the touchpad. While xinput list-props id shows that it's indeed disabled, it definitely isn't. Another thing, were any of you able to toggle the keyboard backlight (I've the default white one) in any other way than Fn+Space Bar? and of course +1 for any patch that could make the driver work on 16AHP9.

Model Name: Legion Slim 5 16AHP9 CPU model: AMD Ryzen 7 8845HS w/ Radeon 780M GPU model: NVIDIA RTX 4070 Keyboard Backlight: White OS: EndeavourOS

sudo dmidecode -t system:

# dmidecode 3.6
Getting SMBIOS data from sysfs.
SMBIOS 3.6.0 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: LENOVO
	Product Name: 83DH
	Version: Legion Slim 5 16AHP9
	Serial Number: xxxxxx
	UUID: xxxxxxx
	Wake-up Type: Power Switch
	SKU Number: LENOVO_MT_83DH_BU_idea_FM_Legion Slim 5 16AHP9
	Family: Legion Slim 5 16AHP9

Handle 0x001B, DMI type 12, 5 bytes
System Configuration Options
	Option 1: String1 for Type12 Equipment Manufacturer
	Option 2: String2 for Type12 Equipment Manufacturer
	Option 3: String3 for Type12 Equipment Manufacturer
	Option 4: String4 for Type12 Equipment Manufacturer

Handle 0x002E, DMI type 32, 20 bytes
System Boot Information
	Status: No errors detected

sudo dmidecode -t bios:

# dmidecode 3.6
Getting SMBIOS data from sysfs.
SMBIOS 3.6.0 present.

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
	Vendor: LENOVO
	Version: NRCN17WW
	Release Date: 04/11/2024
	Address: 0xE0000
	Runtime Size: 128 kB
	ROM Size: 32 MB
	Characteristics:
		PCI is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		Boot from CD is supported
		Selectable boot is supported
		EDD is supported
		Japanese floppy for NEC 9800 1.2 MB is supported (int 13h)
		Japanese floppy for Toshiba 1.2 MB is supported (int 13h)
		5.25"/360 kB floppy services are supported (int 13h)
		5.25"/1.2 MB floppy services are supported (int 13h)
		3.5"/720 kB floppy services are supported (int 13h)
		3.5"/2.88 MB floppy services are supported (int 13h)
		8042 keyboard services are supported (int 9h)
		CGA/mono video services are supported (int 10h)
		ACPI is supported
		USB legacy is supported
		BIOS boot specification is supported
		Targeted content distribution is supported
		UEFI is supported
	BIOS Revision: 1.17
	Firmware Revision: 1.17

Handle 0x001C, DMI type 13, 22 bytes
BIOS Language Information
	Language Description Format: Long
	Installable Languages: 4
		en|US|iso8859-1
		fr|FR|iso8859-1
		ja|JP|unicode
		zh|TW|unicode
	Currently Installed Language: en|US|iso8859-1

sudo make reloadmodule:

rmmod legion-laptop.ko || true
rmmod: ERROR: Module legion_laptop is not currently loaded
insmod legion-laptop.ko
insmod: ERROR: could not insert module legion-laptop.ko: Unknown symbol in module
make: *** [Makefile:43: reloadmodule] Error 1

awsms avatar Sep 17 '24 13:09 awsms

+1

thursdaybw avatar Sep 19 '24 00:09 thursdaybw

This would be great!

Evthestrike avatar Sep 28 '24 20:09 Evthestrike

Too bad CONTRIBUTING.md is empty. Many reverse engineered infos (something as trivial as ECHIPID1) are not documented. I'm basically bruteforcing values untill stuff works. So far:

static const struct model_config model_nrcn = {
	.registers = &ec_register_offsets_v0,
	.check_embedded_controller_id = true,
	.embedded_controller_id = 0x8227,
	.memoryio_physical_ec_start = 0xC400,
	.memoryio_size = 0x300,
	.has_minifancurve = false,
	.has_custom_powermode = true,
	.access_method_powermode = ACCESS_METHOD_EC,
	.access_method_keyboard = ACCESS_METHOD_WMI,
	.access_method_fanspeed = ACCESS_METHOD_EC,
	.access_method_temperature = ACCESS_METHOD_EC,
	.access_method_fancurve = ACCESS_METHOD_EC,
	.access_method_fanfullspeed = ACCESS_METHOD_EC,
	.acpi_check_dev = false,
	.ramio_physical_start = 0xFE0B0400,
	.ramio_size = 0x600
};

Will also need a new ec_register_offsets for the 2023/2024 models

awsms avatar Oct 08 '24 04:10 awsms