From 93b01904db607ef8169047e68e376dcda1bd7fbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Wed, 16 Jun 2021 15:13:54 +0200 Subject: Add Tiger Lake U Premium support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tiger Lake has very low ICCRIBA (TGL=0x11, CNL=0x34 and CML=0x34) and detects as unknown chipset compatible with 300 series chipset. Add a new enum CHIPSET_500_SERIES_TIGER_POINT and treat it identically to CHIPSET_400_SERIES_COMET_POINT. There are some exceptions though, ICCRIBA is no longer present n descriptor content so a new union has been defined for new fields and used in descriptor guessing. freq_read field is not present on Tiger Lake, moreover in CannonPoint and Comet Point this field is used as eSPI/EC frequency, so a new function to print read frequency has ben added. Finally Tiger lake boot straps include eSPI, so a new bus has been added for the new straps. TEST=Flash BIOS region on Intel i5-1135G7 Signed-off-by: Michał Żygowski Change-Id: I28f3b6fe9f8ce9e976a6808683f46b6f4ec72bdd Reviewed-on: https://review.coreboot.org/c/flashrom/+/55578 Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) --- chipset_enable.c | 14 ++++++ ich_descriptors.c | 63 +++++++++++++++++++++--- ich_descriptors.h | 7 +++ ichspi.c | 11 ++++- programmer.h | 1 + util/ich_descriptors_tool/ich_descriptors_tool.c | 4 ++ 6 files changed, 92 insertions(+), 8 deletions(-) diff --git a/chipset_enable.c b/chipset_enable.c index cb0fbf11..26db472a 100644 --- a/chipset_enable.c +++ b/chipset_enable.c @@ -600,6 +600,7 @@ static enum chipbustype enable_flash_ich_report_gcs( case CHIPSET_C620_SERIES_LEWISBURG: case CHIPSET_300_SERIES_CANNON_POINT: case CHIPSET_400_SERIES_COMET_POINT: + case CHIPSET_500_SERIES_TIGER_POINT: case CHIPSET_APOLLO_LAKE: case CHIPSET_GEMINI_LAKE: reg_name = "BIOS_SPI_BC"; @@ -653,6 +654,9 @@ static enum chipbustype enable_flash_ich_report_gcs( static const struct boot_straps boot_straps_pch8_lp[] = { { "SPI", BUS_SPI }, { "LPC", BUS_LPC | BUS_FWH } }; + static const struct boot_straps boot_straps_pch500[] = + { { "SPI", BUS_SPI }, + { "eSPI", BUS_NONE } }; static const struct boot_straps boot_straps_apl[] = { { "SPI", BUS_SPI }, { "reserved", BUS_NONE } }; @@ -699,6 +703,9 @@ static enum chipbustype enable_flash_ich_report_gcs( case CHIPSET_400_SERIES_COMET_POINT: boot_straps = boot_straps_pch8_lp; break; + case CHIPSET_500_SERIES_TIGER_POINT: + boot_straps = boot_straps_pch500; + break; case CHIPSET_APOLLO_LAKE: case CHIPSET_GEMINI_LAKE: boot_straps = boot_straps_apl; @@ -727,6 +734,7 @@ static enum chipbustype enable_flash_ich_report_gcs( case CHIPSET_C620_SERIES_LEWISBURG: case CHIPSET_300_SERIES_CANNON_POINT: case CHIPSET_400_SERIES_COMET_POINT: + case CHIPSET_500_SERIES_TIGER_POINT: case CHIPSET_APOLLO_LAKE: case CHIPSET_GEMINI_LAKE: bbs = (gcs >> 6) & 0x1; @@ -974,6 +982,11 @@ static int enable_flash_pch400(struct pci_dev *const dev, const char *const name return enable_flash_pch100_or_c620(dev, name, 0x1f, 5, CHIPSET_400_SERIES_COMET_POINT); } +static int enable_flash_pch500(struct pci_dev *const dev, const char *const name) +{ + return enable_flash_pch100_or_c620(dev, name, 0x1f, 5, CHIPSET_500_SERIES_TIGER_POINT); +} + static int enable_flash_apl(struct pci_dev *const dev, const char *const name) { return enable_flash_pch100_or_c620(dev, name, 0x0d, 2, CHIPSET_APOLLO_LAKE); @@ -2029,6 +2042,7 @@ const struct penable chipset_enables[] = { {0x8086, 0x9d84, B_S, DEP, "Intel", "Cannon Lake U Premium", enable_flash_pch300}, {0x8086, 0x0284, B_S, DEP, "Intel", "Comet Lake U Premium", enable_flash_pch400}, {0x8086, 0x0285, B_S, DEP, "Intel", "Comet Lake U Base", enable_flash_pch400}, + {0x8086, 0xa082, B_S, DEP, "Intel", "Tiger Lake U Premium", enable_flash_pch500}, {0x8086, 0xa141, B_S, NT, "Intel", "Sunrise Point Desktop Sample", enable_flash_pch100}, {0x8086, 0xa142, B_S, NT, "Intel", "Sunrise Point Unknown Sample", enable_flash_pch100}, {0x8086, 0xa143, B_S, DEP, "Intel", "H110", enable_flash_pch100}, diff --git a/ich_descriptors.c b/ich_descriptors.c index 5edaaf4b..56a3c67d 100644 --- a/ich_descriptors.c +++ b/ich_descriptors.c @@ -45,6 +45,7 @@ ssize_t ich_number_of_regions(const enum ich_chipset cs, const struct ich_desc_c case CHIPSET_C620_SERIES_LEWISBURG: case CHIPSET_300_SERIES_CANNON_POINT: case CHIPSET_400_SERIES_COMET_POINT: + case CHIPSET_500_SERIES_TIGER_POINT: return 16; case CHIPSET_100_SERIES_SUNRISE_POINT: return 10; @@ -108,7 +109,7 @@ void prettyprint_ich_chipset(enum ich_chipset cs) "8 series Lynx Point", "Baytrail", "8 series Lynx Point LP", "8 series Wellsburg", "9 series Wildcat Point", "9 series Wildcat Point LP", "100 series Sunrise Point", "C620 series Lewisburg", "300 series Cannon Point", "400 series Comet Point", - "Apollo Lake", "Gemini Lake", + "500 series Tiger Point", "Apollo Lake", "Gemini Lake", }; if (cs < CHIPSET_ICH8 || cs - CHIPSET_ICH8 + 1 >= ARRAY_SIZE(chipset_names)) cs = 0; @@ -202,6 +203,7 @@ static const char *pprint_density(enum ich_chipset cs, const struct ich_descript case CHIPSET_C620_SERIES_LEWISBURG: case CHIPSET_300_SERIES_CANNON_POINT: case CHIPSET_400_SERIES_COMET_POINT: + case CHIPSET_500_SERIES_TIGER_POINT: case CHIPSET_APOLLO_LAKE: case CHIPSET_GEMINI_LAKE: { uint8_t size_enc; @@ -222,7 +224,7 @@ static const char *pprint_density(enum ich_chipset cs, const struct ich_descript static const char *pprint_freq(enum ich_chipset cs, uint8_t value) { - static const char *const freq_str[3][8] = { { + static const char *const freq_str[4][8] = { { "20 MHz", "33 MHz", "reserved", @@ -249,7 +251,16 @@ static const char *pprint_freq(enum ich_chipset cs, uint8_t value) "reserved", "14 MHz / 17 MHz", "reserved" - } }; + }, { + "100 MHz", + "50 MHz", + "reserved", + "33 MHz", + "25 MHz", + "reserved", + "14 MHz", + "reserved" + }}; switch (cs) { case CHIPSET_ICH8: @@ -276,12 +287,41 @@ static const char *pprint_freq(enum ich_chipset cs, uint8_t value) case CHIPSET_APOLLO_LAKE: case CHIPSET_GEMINI_LAKE: return freq_str[2][value]; + case CHIPSET_500_SERIES_TIGER_POINT: + return freq_str[3][value]; case CHIPSET_ICH_UNKNOWN: default: return "unknown"; } } +static void pprint_read_freq(enum ich_chipset cs, uint8_t value) +{ + static const char *const freq_str[1][8] = { { + "20 MHz", + "24 MHz", + "30 MHz", + "48 MHz", + "60 MHz", + "reserved", + "reserved", + "reserved" + }}; + + switch (cs) { + case CHIPSET_300_SERIES_CANNON_POINT: + case CHIPSET_400_SERIES_COMET_POINT: + msg_pdbg2("eSPI/EC Bus Clock Frequency: %s\n", freq_str[0][value]); + return; + case CHIPSET_500_SERIES_TIGER_POINT: + msg_pdbg2("Read Clock Frequency: %s\n", "reserved"); + return; + default: + msg_pdbg2("Read Clock Frequency: %s\n", pprint_freq(cs, value)); + return; + } +} + void prettyprint_ich_descriptor_component(enum ich_chipset cs, const struct ich_descriptors *desc) { bool has_flill1; @@ -291,6 +331,7 @@ void prettyprint_ich_descriptor_component(enum ich_chipset cs, const struct ich_ case CHIPSET_C620_SERIES_LEWISBURG: case CHIPSET_300_SERIES_CANNON_POINT: case CHIPSET_400_SERIES_COMET_POINT: + case CHIPSET_500_SERIES_TIGER_POINT: case CHIPSET_APOLLO_LAKE: case CHIPSET_GEMINI_LAKE: has_flill1 = true; @@ -313,7 +354,9 @@ void prettyprint_ich_descriptor_component(enum ich_chipset cs, const struct ich_ msg_pdbg2("Component 2 density: %s\n", pprint_density(cs, desc, 1)); else msg_pdbg2("Component 2 is not used.\n"); - msg_pdbg2("Read Clock Frequency: %s\n", pprint_freq(cs, desc->component.modes.freq_read)); + + pprint_read_freq(cs, desc->component.modes.freq_read); + msg_pdbg2("Read ID and Status Clock Freq.: %s\n", pprint_freq(cs, desc->component.modes.freq_read_id)); msg_pdbg2("Write and Erase Clock Freq.: %s\n", pprint_freq(cs, desc->component.modes.freq_write)); msg_pdbg2("Fast Read is %ssupported.\n", desc->component.modes.fastread ? "" : "not "); @@ -411,7 +454,8 @@ void prettyprint_ich_descriptor_master(const enum ich_chipset cs, const struct i msg_pdbg2("--- Details ---\n"); if (cs == CHIPSET_100_SERIES_SUNRISE_POINT || cs == CHIPSET_300_SERIES_CANNON_POINT || - cs == CHIPSET_400_SERIES_COMET_POINT) { + cs == CHIPSET_400_SERIES_COMET_POINT || + cs == CHIPSET_500_SERIES_TIGER_POINT) { const char *const master_names[] = { "BIOS", "ME", "GbE", "unknown", "EC", }; @@ -970,8 +1014,10 @@ static enum ich_chipset guess_ich_chipset_from_content(const struct ich_desc_con } else { if (content->ICCRIBA == 0x34) return CHIPSET_300_SERIES_CANNON_POINT; - msg_pwarn("Unknown flash descriptor, assuming 300 series compatibility.\n"); - return CHIPSET_300_SERIES_CANNON_POINT; + if (content->CSSL == 0x11) + return CHIPSET_500_SERIES_TIGER_POINT; + msg_pwarn("Unknown flash descriptor, assuming 500 series compatibility.\n"); + return CHIPSET_500_SERIES_TIGER_POINT; } } @@ -990,6 +1036,7 @@ static enum ich_chipset guess_ich_chipset(const struct ich_desc_content *const c switch (guess) { case CHIPSET_300_SERIES_CANNON_POINT: case CHIPSET_400_SERIES_COMET_POINT: + case CHIPSET_500_SERIES_TIGER_POINT: case CHIPSET_GEMINI_LAKE: /* `freq_read` was repurposed, so can't check on it any more. */ break; @@ -1144,6 +1191,7 @@ int getFCBA_component_density(enum ich_chipset cs, const struct ich_descriptors case CHIPSET_C620_SERIES_LEWISBURG: case CHIPSET_300_SERIES_CANNON_POINT: case CHIPSET_400_SERIES_COMET_POINT: + case CHIPSET_500_SERIES_TIGER_POINT: case CHIPSET_APOLLO_LAKE: case CHIPSET_GEMINI_LAKE: if (idx == 0) { @@ -1181,6 +1229,7 @@ static uint32_t read_descriptor_reg(enum ich_chipset cs, uint8_t section, uint16 case CHIPSET_C620_SERIES_LEWISBURG: case CHIPSET_300_SERIES_CANNON_POINT: case CHIPSET_400_SERIES_COMET_POINT: + case CHIPSET_500_SERIES_TIGER_POINT: case CHIPSET_APOLLO_LAKE: case CHIPSET_GEMINI_LAKE: mmio_le_writel(control, spibar + PCH100_REG_FDOC); diff --git a/ich_descriptors.h b/ich_descriptors.h index d00af63f..cd5a45cb 100644 --- a/ich_descriptors.h +++ b/ich_descriptors.h @@ -95,6 +95,13 @@ struct ich_desc_content { ICCRIBA :8, /* ICC Reg. Init Base Addr. (new since Sandy Bridge) */ RIL :8; /* Register Init Length (new since Hawell) */ }; + struct { /* new since Tiger Point */ + uint32_t :2, + CSSO :10, /* CPU Soft Strap Offset from PMC Base */ + :4, + CSSL :8, /* CPU Soft Strap Length */ + :8; + }; }; }; diff --git a/ichspi.c b/ichspi.c index d345af2c..290deaab 100644 --- a/ichspi.c +++ b/ichspi.c @@ -426,6 +426,7 @@ static void prettyprint_ich9_reg_hsfs(uint16_t reg_val, enum ich_chipset ich_gen case CHIPSET_C620_SERIES_LEWISBURG: case CHIPSET_300_SERIES_CANNON_POINT: case CHIPSET_400_SERIES_COMET_POINT: + case CHIPSET_500_SERIES_TIGER_POINT: break; default: pprint_reg(HSFS, BERASE, reg_val, ", "); @@ -437,6 +438,7 @@ static void prettyprint_ich9_reg_hsfs(uint16_t reg_val, enum ich_chipset ich_gen case CHIPSET_C620_SERIES_LEWISBURG: case CHIPSET_300_SERIES_CANNON_POINT: case CHIPSET_400_SERIES_COMET_POINT: + case CHIPSET_500_SERIES_TIGER_POINT: pprint_reg(HSFS, PRR34_LOCKDN, reg_val, ", "); pprint_reg(HSFS, WRSDIS, reg_val, ", "); break; @@ -457,6 +459,7 @@ static void prettyprint_ich9_reg_hsfc(uint16_t reg_val, enum ich_chipset ich_gen case CHIPSET_C620_SERIES_LEWISBURG: case CHIPSET_300_SERIES_CANNON_POINT: case CHIPSET_400_SERIES_COMET_POINT: + case CHIPSET_500_SERIES_TIGER_POINT: _pprint_reg(HSFC, PCH100_HSFC_FCYCLE, PCH100_HSFC_FCYCLE_OFF, reg_val, ", "); pprint_reg(HSFC, WET, reg_val, ", "); break; @@ -1735,6 +1738,7 @@ int ich_init_spi(void *spibar, enum ich_chipset ich_gen) case CHIPSET_C620_SERIES_LEWISBURG: case CHIPSET_300_SERIES_CANNON_POINT: case CHIPSET_400_SERIES_COMET_POINT: + case CHIPSET_500_SERIES_TIGER_POINT: case CHIPSET_APOLLO_LAKE: case CHIPSET_GEMINI_LAKE: num_pr = 6; /* Includes GPR0 */ @@ -1768,6 +1772,7 @@ int ich_init_spi(void *spibar, enum ich_chipset ich_gen) break; case CHIPSET_300_SERIES_CANNON_POINT: case CHIPSET_400_SERIES_COMET_POINT: + case CHIPSET_500_SERIES_TIGER_POINT: case CHIPSET_APOLLO_LAKE: case CHIPSET_GEMINI_LAKE: num_freg = 16; @@ -1865,6 +1870,7 @@ int ich_init_spi(void *spibar, enum ich_chipset ich_gen) case CHIPSET_C620_SERIES_LEWISBURG: case CHIPSET_300_SERIES_CANNON_POINT: case CHIPSET_400_SERIES_COMET_POINT: + case CHIPSET_500_SERIES_TIGER_POINT: case CHIPSET_APOLLO_LAKE: case CHIPSET_GEMINI_LAKE: tmp = mmio_readl(spibar + PCH100_REG_DLOCK); @@ -1941,6 +1947,7 @@ int ich_init_spi(void *spibar, enum ich_chipset ich_gen) case CHIPSET_C620_SERIES_LEWISBURG: case CHIPSET_300_SERIES_CANNON_POINT: case CHIPSET_400_SERIES_COMET_POINT: + case CHIPSET_500_SERIES_TIGER_POINT: case CHIPSET_APOLLO_LAKE: case CHIPSET_GEMINI_LAKE: case CHIPSET_BAYTRAIL: @@ -1975,6 +1982,7 @@ int ich_init_spi(void *spibar, enum ich_chipset ich_gen) case CHIPSET_C620_SERIES_LEWISBURG: case CHIPSET_300_SERIES_CANNON_POINT: case CHIPSET_400_SERIES_COMET_POINT: + case CHIPSET_500_SERIES_TIGER_POINT: case CHIPSET_APOLLO_LAKE: case CHIPSET_GEMINI_LAKE: break; @@ -2008,7 +2016,8 @@ int ich_init_spi(void *spibar, enum ich_chipset ich_gen) if (ich_spi_mode == ich_auto && (ich_gen == CHIPSET_100_SERIES_SUNRISE_POINT || ich_gen == CHIPSET_300_SERIES_CANNON_POINT || - ich_gen == CHIPSET_400_SERIES_COMET_POINT)) { + ich_gen == CHIPSET_400_SERIES_COMET_POINT || + ich_gen == CHIPSET_500_SERIES_TIGER_POINT)) { msg_pdbg("Enabling hardware sequencing by default for 100+ series PCH.\n"); ich_spi_mode = ich_hwseq; } diff --git a/programmer.h b/programmer.h index ec9503cd..b4f04e7a 100644 --- a/programmer.h +++ b/programmer.h @@ -359,6 +359,7 @@ enum ich_chipset { CHIPSET_C620_SERIES_LEWISBURG, CHIPSET_300_SERIES_CANNON_POINT, CHIPSET_400_SERIES_COMET_POINT, + CHIPSET_500_SERIES_TIGER_POINT, CHIPSET_APOLLO_LAKE, CHIPSET_GEMINI_LAKE, }; diff --git a/util/ich_descriptors_tool/ich_descriptors_tool.c b/util/ich_descriptors_tool/ich_descriptors_tool.c index 0807f5e3..a1e353ba 100644 --- a/util/ich_descriptors_tool/ich_descriptors_tool.c +++ b/util/ich_descriptors_tool/ich_descriptors_tool.c @@ -136,6 +136,7 @@ static void usage(char *argv[], const char *error) "\t- \"100\" or \"sunrise\" for Intel's 100 series chipsets.\n" "\t- \"300\" or \"cannon\" for Intel's 300 series chipsets.\n" "\t- \"400\" or \"comet\" for Intel's 400 series chipsets.\n" +"\t- \"500\" or \"tiger\" for Intel's 500 series chipsets.\n" "If '-d' is specified some regions such as the BIOS image as seen by the CPU or\n" "the GbE blob that is required to initialize the GbE are also dumped to files.\n", argv[0], argv[0]); @@ -230,6 +231,9 @@ int main(int argc, char *argv[]) else if ((strcmp(csn, "400") == 0) || (strcmp(csn, "comet") == 0)) cs = CHIPSET_400_SERIES_COMET_POINT; + else if ((strcmp(csn, "500") == 0) || + (strcmp(csn, "tiger") == 0)) + cs = CHIPSET_500_SERIES_TIGER_POINT; else if (strcmp(csn, "apollo") == 0) cs = CHIPSET_APOLLO_LAKE; else if (strcmp(csn, "gemini") == 0) -- cgit v1.2.3