diff --git a/system/cpuinfo.c b/system/cpuinfo.c index 97a3b82..cba579c 100644 --- a/system/cpuinfo.c +++ b/system/cpuinfo.c @@ -493,6 +493,9 @@ static void determine_imc(void) case 0x9: imc_type = IMC_KBL; // Core 7/8/9th Gen (Kaby/Coffee/Comet Lake) break; + case 0xB: + imc_type = IMC_ADL_N; // Core 12th Gen (Alder Lake-N - Gracemont E-Cores only) + break; default: break; } diff --git a/system/cpuinfo.h b/system/cpuinfo.h index 7e2f97b..5975b0e 100644 --- a/system/cpuinfo.h +++ b/system/cpuinfo.h @@ -8,7 +8,7 @@ * *//* * Copyright (C) 2020-2022 Martin Whitaker. - * Copyright (C) 2004-2022 Sam Demeulemeester. + * Copyright (C) 2004-2023 Sam Demeulemeester. */ #include @@ -47,6 +47,7 @@ #define IMC_KBL_UY 0x3030 // Core 7/8/9th Gen (Kaby/Coffee/Comet/Amber Lake-U/Y) #define IMC_ICL 0x3040 // Core 10th Gen (IceLake-Y) #define IMC_TGL 0x3050 // Core 11th Gen (Tiger Lake-U) +#define IMC_ADL_N 0x3061 // Core 12th Gen (Alder Lake-N - Gracemont E-Cores only) #define IMC_BYT 0x4010 // Atom Bay Trail #define IMC_CDT 0x4020 // Atom Cedar Trail diff --git a/system/hwquirks.c b/system/hwquirks.c index f1fd0ed..e5e9359 100644 --- a/system/hwquirks.c +++ b/system/hwquirks.c @@ -99,6 +99,15 @@ static void amd_k8_revfg_temp(void) cpu_temp_offset = 21.0f; } +static void adl_unlock_smbus(void) +{ + uint16_t x = pci_config_read16(0, 31, 4, 0x04); + + if (!(x & 1)) { + pci_config_write16(0, 31, 4, 0x04, x | 1); + } +} + // --------------------- // -- Public function -- // --------------------- @@ -199,4 +208,13 @@ void quirks_init(void) } } } + + // -------------------------------------------------- + // -- SMBus unlock for ADL-N (and probably others) -- + // -------------------------------------------------- + if (imc_type == IMC_ADL_N && pci_config_read16(0, 31, 4, 0x2) == 0x54A3) { // ADL-N + quirk.id = QUIRK_ADL_SMB_UNLOCK; + quirk.type |= QUIRK_TYPE_SMBUS; + quirk.process = adl_unlock_smbus; + } } diff --git a/system/hwquirks.h b/system/hwquirks.h index daf22b8..152877f 100644 --- a/system/hwquirks.h +++ b/system/hwquirks.h @@ -28,7 +28,8 @@ typedef enum { QUIRK_X10SDV_NOSMP, QUIRK_K8_BSTEP_NOTEMP, QUIRK_K8_REVFG_TEMP, - QUIRK_AMD_ERRATA_319 + QUIRK_AMD_ERRATA_319, + QUIRK_ADL_SMB_UNLOCK } quirk_id_t; typedef struct {