mirror of
https://github.com/memtest86plus/memtest86plus
synced 2025-03-12 08:53:02 +03:00
hwquirks: Detect cache on VIA VP3/MVP3 (#356)
Add quirk to detect motherboard cache on VIA VP3/MVP3. Co-authored-by: Sam Demeulemeester <38105886+x86fr@users.noreply.github.com>
This commit is contained in:
parent
d2ecbac5fd
commit
51b78487f5
@ -50,6 +50,16 @@ static void asus_tusl2_configure_mux(void)
|
||||
outb(0xAA, 0x2E);
|
||||
}
|
||||
|
||||
static int *get_motherboard_cache(void)
|
||||
{
|
||||
if (l2_cache == 0) {
|
||||
return &l2_cache;
|
||||
} else if (l3_cache == 0) {
|
||||
return &l3_cache;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void get_m1541_l2_cache_size(void)
|
||||
{
|
||||
if (l2_cache != 0) {
|
||||
@ -69,6 +79,24 @@ static void get_m1541_l2_cache_size(void)
|
||||
if (reg == 0b10) { l2_cache = 1024; }
|
||||
}
|
||||
|
||||
static void get_vt82c597_mb_cache_size(void)
|
||||
{
|
||||
int *const mb_cache = get_motherboard_cache();
|
||||
if (!mb_cache) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if cache is enabled with CC1 Register[7:6]
|
||||
if ((pci_config_read8(0, 0, 0, 0x50) & 0xc0) != 0x80) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get cache size with CC2 Register[1:0]
|
||||
const uint8_t reg = pci_config_read8(0, 0, 0, 0x51) & 0x03;
|
||||
|
||||
*mb_cache = 256 << reg;
|
||||
}
|
||||
|
||||
static void disable_temp_reporting(void)
|
||||
{
|
||||
enable_temperature = false;
|
||||
@ -140,6 +168,16 @@ void quirks_init(void)
|
||||
quirk.process = get_m1541_l2_cache_size;
|
||||
}
|
||||
|
||||
// -----------------------------------------------
|
||||
// -- VIA VP3 (VT82C597), MVP3 (VT82C598) Quirk --
|
||||
// -----------------------------------------------
|
||||
// Motherboard cache detection
|
||||
else if (quirk.root_vid == PCI_VID_VIA && (quirk.root_did == 0x0597 || quirk.root_did == 0x0598)) { // VIA VT82C597/8
|
||||
quirk.id = QUIRK_VIA_VP3;
|
||||
quirk.type |= QUIRK_TYPE_MEM_SIZE;
|
||||
quirk.process = get_vt82c597_mb_cache_size;
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// -- ASUS TUSL2-C Quirk --
|
||||
// ------------------------
|
||||
|
@ -29,6 +29,7 @@ typedef enum {
|
||||
QUIRK_K8_BSTEP_NOTEMP,
|
||||
QUIRK_K8_REVFG_TEMP,
|
||||
QUIRK_AMD_ERRATA_319,
|
||||
QUIRK_VIA_VP3,
|
||||
QUIRK_LOONGSON7A00_EHCI_WORKARD
|
||||
} quirk_id_t;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user