From c2c35e9b9dfa5aef5ea4a9b5d8728fbfc49ece99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Tue, 5 Dec 2023 17:08:18 +0100 Subject: [PATCH 1/4] intelblocks/cse: Implement ME spec 11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Żygowski --- src/include/device/pci_ids.h | 2 + src/soc/intel/common/block/cse/Kconfig | 8 ++ src/soc/intel/common/block/cse/cse.c | 3 + src/soc/intel/common/block/cse/cse_spec.c | 6 ++ .../common/block/include/intelblocks/me.h | 4 +- .../common/block/include/intelblocks/me_11.h | 84 +++++++++++++++++++ src/soc/intel/skylake/Kconfig | 1 + src/soc/intel/skylake/include/soc/me.h | 78 +---------------- src/soc/intel/skylake/me.c | 2 +- 9 files changed, 110 insertions(+), 78 deletions(-) create mode 100644 src/soc/intel/common/block/include/intelblocks/me_11.h diff --git a/src/include/device/pci_ids.h b/src/include/device/pci_ids.h index 797ad91ec72..cfd2c4edc55 100644 --- a/src/include/device/pci_ids.h +++ b/src/include/device/pci_ids.h @@ -4377,6 +4377,8 @@ #define PCI_DID_INTEL_GLK_CSE0 0x319a #define PCI_DID_INTEL_CNL_CSE0 0x9de0 #define PCI_DID_INTEL_SKL_CSE0 0x9d3a +#define PCI_DID_INTEL_SKL_H_CSE0 0xa13a +#define PCI_DID_INTEL_KBL_H_CSE0 0xa2ba #define PCI_DID_INTEL_LWB_CSE0 0xa1ba #define PCI_DID_INTEL_LWB_CSE1 0xa1bb #define PCI_DID_INTEL_LWB_CSE2 0xa1be diff --git a/src/soc/intel/common/block/cse/Kconfig b/src/soc/intel/common/block/cse/Kconfig index f373bd9c8c8..cedb02853ce 100644 --- a/src/soc/intel/common/block/cse/Kconfig +++ b/src/soc/intel/common/block/cse/Kconfig @@ -297,6 +297,13 @@ config SOC_INTEL_CSE_HAVE_SPEC_SUPPORT common code. Enabling this option will use those CSE defined ME specification for the SoC. User should select pertinent ME spec version along with this option. +config SOC_INTEL_COMMON_BLOCK_ME_SPEC_11 + bool + select SOC_INTEL_CSE_HAVE_SPEC_SUPPORT + help + This config will enable 'ME specification version 11'. It will ensure ME specific + declaration and uses of required data structures for Host firmware status registers. + config SOC_INTEL_COMMON_BLOCK_ME_SPEC_12 bool select SOC_INTEL_CSE_HAVE_SPEC_SUPPORT @@ -336,6 +343,7 @@ if SOC_INTEL_CSE_HAVE_SPEC_SUPPORT config ME_SPEC int + default 11 if SOC_INTEL_COMMON_BLOCK_ME_SPEC_11 default 12 if SOC_INTEL_COMMON_BLOCK_ME_SPEC_12 default 13 if SOC_INTEL_COMMON_BLOCK_ME_SPEC_13 default 15 if SOC_INTEL_COMMON_BLOCK_ME_SPEC_15 diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c index 684619b61f5..fecb3afee47 100644 --- a/src/soc/intel/common/block/cse/cse.c +++ b/src/soc/intel/common/block/cse/cse.c @@ -1595,6 +1595,9 @@ static const unsigned short pci_device_ids[] = { PCI_DID_INTEL_CNL_CSE0, PCI_DID_INTEL_LWB_CSE0, PCI_DID_INTEL_LWB_CSE0_SUPER, + PCI_DID_INTEL_SKL_CSE0, + PCI_DID_INTEL_SKL_H_CSE0, + PCI_DID_INTEL_KBL_H_CSE0, PCI_DID_INTEL_CNP_H_CSE0, PCI_DID_INTEL_CMP_CSE0, PCI_DID_INTEL_CMP_H_CSE0, diff --git a/src/soc/intel/common/block/cse/cse_spec.c b/src/soc/intel/common/block/cse/cse_spec.c index 74155cd1501..c6129e0b53a 100644 --- a/src/soc/intel/common/block/cse/cse_spec.c +++ b/src/soc/intel/common/block/cse/cse_spec.c @@ -88,6 +88,10 @@ static void dump_me_status(void *unused) hfsts1.fields.operation_mode); printk(BIOS_DEBUG, "ME: Error Code : %u\n", hfsts1.fields.error_code); +#if CONFIG_ME_SPEC == 11 + printk(BIOS_DEBUG, "ME: FPFs Committed : %s\n", + hfsts6.fields.fpf_nvars & 1 ? "YES" : "NO"); +#endif #if CONFIG_ME_SPEC >= 15 printk(BIOS_DEBUG, "ME: FPFs Committed : %s\n", hfsts6.fields.fpf_soc_lock ? "YES" : "NO"); @@ -98,8 +102,10 @@ static void dump_me_status(void *unused) #if CONFIG_ME_SPEC <= 16 printk(BIOS_DEBUG, "ME: CPU Debug Disabled : %s\n", hfsts6.fields.cpu_debug_disable ? "YES" : "NO"); +#if CONFIG_ME_SPEC >= 12 printk(BIOS_DEBUG, "ME: TXT Support : %s\n", hfsts6.fields.txt_support ? "YES" : "NO"); +#endif #else printk(BIOS_DEBUG, "ME: CPU Debug Disabled : %s\n", hfsts5.fields.cpu_debug_disabled ? "YES" : "NO"); diff --git a/src/soc/intel/common/block/include/intelblocks/me.h b/src/soc/intel/common/block/include/intelblocks/me.h index c55d147f13a..8266ae3e3e9 100644 --- a/src/soc/intel/common/block/include/intelblocks/me.h +++ b/src/soc/intel/common/block/include/intelblocks/me.h @@ -6,7 +6,9 @@ #include #if CONFIG(SOC_INTEL_CSE_HAVE_SPEC_SUPPORT) -#if CONFIG_ME_SPEC == 12 +#if CONFIG_ME_SPEC == 11 +#include "me_11.h" +#elif CONFIG_ME_SPEC == 12 #include "me_12.h" #elif CONFIG_ME_SPEC == 13 #include "me_13.h" diff --git a/src/soc/intel/common/block/include/intelblocks/me_11.h b/src/soc/intel/common/block/include/intelblocks/me_11.h new file mode 100644 index 00000000000..6b007c293b6 --- /dev/null +++ b/src/soc/intel/common/block/include/intelblocks/me_11.h @@ -0,0 +1,84 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef _SOC_INTEL_COMMON_ME_SPEC_11_H_ +#define _SOC_INTEL_COMMON_ME_SPEC_11_H_ + +/* ME Host Firmware Status register 1 */ +union me_hfsts1 { + uint32_t data; + struct { + uint32_t working_state : 4; + uint32_t mfg_mode : 1; + uint32_t fpt_bad : 1; + uint32_t operation_state : 3; + uint32_t fw_init_complete : 1; + uint32_t ft_bup_ld_flr : 1; + uint32_t update_in_progress : 1; + uint32_t error_code : 4; + uint32_t operation_mode : 4; + uint32_t reserved_0 : 4; + uint32_t boot_options_present : 1; + uint32_t reserved_1 : 5; + uint32_t d3_support_valid : 1; + uint32_t d0i3_support_valid : 1; + } __packed fields; +}; + +/* ME Host Firmware Status register 2 */ +union me_hfsts2 { + uint32_t data; + struct { + uint32_t reserved_0 : 4; + uint32_t cpu_replaced : 1; + uint32_t reserved_1 : 3; + uint32_t cpu_replaced_valid : 1; + uint32_t low_power_state : 1; + uint32_t reserved_2 : 6; + uint32_t current_state : 8; + uint32_t current_pmevent : 4; + uint32_t progress_code : 4; + } __packed fields; +}; + +/* ME Host Firmware Status register 3 */ +union me_hfsts3 { + uint32_t data; + struct { + uint32_t reserved_0 : 4; + uint32_t fw_sku : 3; + uint32_t encrypt_key_check : 1; + uint32_t pch_config_change : 1; + uint32_t reserved_1 : 21; + uint32_t encrypt_key_override : 1; + uint32_t power_down_mitigation : 1; + } __packed fields; +}; + +/* ME Host Firmware Status register 4 */ +union me_hfsts4 { + uint32_t data; + struct { + uint32_t reserved_0; + } __packed fields; +}; + +/* ME Host Firmware Status register 5 */ +union me_hfsts5 { + uint32_t data; + struct { + uint32_t reserved_0; + } __packed fields; +}; + +/* ME Host Firmware Status register 6 */ +union me_hfsts6 { + uint32_t data; + struct { + uint32_t reserved_0 : 1; + uint32_t cpu_debug_disable : 1; + uint32_t reserved_1 : 29; + uint32_t fpf_nvars : 2; + } __packed fields; +}; + +#endif /* _SOC_INTEL_COMMON_ME_SPEC_11_H_ */ diff --git a/src/soc/intel/skylake/Kconfig b/src/soc/intel/skylake/Kconfig index d6a11363ee2..e422eaece65 100644 --- a/src/soc/intel/skylake/Kconfig +++ b/src/soc/intel/skylake/Kconfig @@ -61,6 +61,7 @@ config SOC_INTEL_COMMON_SKYLAKE_BASE select SOC_INTEL_COMMON_RESET select SOC_INTEL_COMMON_BLOCK_POWER_LIMIT select SOC_INTEL_CONFIGURE_DDI_A_4_LANES + select SOC_INTEL_COMMON_BLOCK_ME_SPEC_11 select SSE2 select SUPPORT_CPU_UCODE_IN_CBFS select TSC_MONOTONIC_TIMER diff --git a/src/soc/intel/skylake/include/soc/me.h b/src/soc/intel/skylake/include/soc/me.h index ffeb2f055ae..4d713ec112e 100644 --- a/src/soc/intel/skylake/include/soc/me.h +++ b/src/soc/intel/skylake/include/soc/me.h @@ -3,6 +3,8 @@ #ifndef _SKYLAKE_ME_H_ #define _SKYLAKE_ME_H_ +#include + /* * Management Engine PCI registers */ @@ -112,82 +114,6 @@ #define ME_HFS6_FPF_NOT_COMMITTED 0x0 #define ME_HFS6_FPF_ERROR 0x2 -/* ME Host Firmware Status register 1 */ -union me_hfsts1 { - uint32_t data; - struct { - uint32_t working_state : 4; - uint32_t mfg_mode : 1; - uint32_t fpt_bad : 1; - uint32_t operation_state : 3; - uint32_t fw_init_complete : 1; - uint32_t ft_bup_ld_flr : 1; - uint32_t update_in_progress : 1; - uint32_t error_code : 4; - uint32_t operation_mode : 4; - uint32_t reserved_0 : 4; - uint32_t boot_options_present : 1; - uint32_t reserved_1 : 5; - uint32_t d3_support_valid : 1; - uint32_t d0i3_support_valid : 1; - } __packed fields; -}; - -/* ME Host Firmware Status register 2 */ -union me_hfsts2 { - uint32_t data; - struct { - uint32_t reserved_0 : 4; - uint32_t cpu_replaced_sts : 1; - uint32_t reserved_1 : 3; - uint32_t cpu_replaced_valid : 1; - uint32_t low_power_state : 1; - uint32_t reserved_2 : 6; - uint32_t current_state : 8; - uint32_t current_pmevent : 4; - uint32_t progress_code : 4; - } __packed fields; -}; - -/* ME Host Firmware Status register 3 */ -union me_hfsts3 { - uint32_t data; - struct { - uint32_t reserved_0 : 4; - uint32_t fw_sku : 3; - uint32_t encrypt_key_check : 1; - uint32_t pch_config_change : 1; - uint32_t reserved_1 : 21; - uint32_t encrypt_key_override : 1; - uint32_t power_down_mitigation : 1; - } __packed fields; -}; - -/* ME Host Firmware Status register 4 */ -union me_hfsts4 { - uint32_t data; - struct { - uint32_t reserved_0; - } __packed fields; -}; - -/* ME Host Firmware Status register 5 */ -union me_hfsts5 { - uint32_t data; - struct { - uint32_t reserved_0; - } __packed fields; -}; - -/* ME Host Firmware Status register 6 */ -union me_hfsts6 { - uint32_t data; - struct { - uint32_t reserved1 : 30; - uint32_t fpf_nvars : 2; - } __packed fields; -}; - void intel_me_status(void); int send_global_reset(void); diff --git a/src/soc/intel/skylake/me.c b/src/soc/intel/skylake/me.c index 89491f89c37..9b58a7ce39c 100644 --- a/src/soc/intel/skylake/me.c +++ b/src/soc/intel/skylake/me.c @@ -228,7 +228,7 @@ void intel_me_status(void) printk(BIOS_DEBUG, "ME: Low Power State Enabled : %s\n", hfs2.fields.low_power_state ? "YES" : "NO"); printk(BIOS_DEBUG, "ME: CPU Replaced : %s\n", - hfs2.fields.cpu_replaced_sts ? "YES" : "NO"); + hfs2.fields.cpu_replaced ? "YES" : "NO"); printk(BIOS_DEBUG, "ME: CPU Replacement Valid : %s\n", hfs2.fields.cpu_replaced_valid ? "YES" : "NO"); printk(BIOS_DEBUG, "ME: Current Working State : %s\n", From c2e0a3f15b311263536e05b60dbd31a165b0bbe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Tue, 5 Dec 2023 17:10:35 +0100 Subject: [PATCH 2/4] mb/protectli/vault_kbl: Add board support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Żygowski --- configs/config.protectli_fw6 | 46 ++++++ src/mainboard/protectli/vault_kbl/Kconfig | 34 +++-- .../protectli/vault_kbl/Makefile.inc | 7 +- src/mainboard/protectli/vault_kbl/acpi/ec.asl | 4 +- .../protectli/vault_kbl/acpi/superio.asl | 8 +- src/mainboard/protectli/vault_kbl/board.fmd | 14 ++ .../protectli/vault_kbl/board_info.txt | 2 +- src/mainboard/protectli/vault_kbl/bootblock.c | 26 +++- src/mainboard/protectli/vault_kbl/data.vbt | Bin 4608 -> 4608 bytes .../protectli/vault_kbl/devicetree.cb | 133 ++++++------------ src/mainboard/protectli/vault_kbl/die.c | 42 ++++++ src/mainboard/protectli/vault_kbl/dsdt.asl | 6 +- src/mainboard/protectli/vault_kbl/gpio.h | 9 +- src/mainboard/protectli/vault_kbl/hda_verb.c | 33 +++++ .../vault_kbl/{ramstage.c => mainboard.c} | 18 ++- src/mainboard/protectli/vault_kbl/romstage.c | 25 ---- 16 files changed, 261 insertions(+), 146 deletions(-) create mode 100644 configs/config.protectli_fw6 create mode 100644 src/mainboard/protectli/vault_kbl/board.fmd create mode 100644 src/mainboard/protectli/vault_kbl/die.c create mode 100644 src/mainboard/protectli/vault_kbl/hda_verb.c rename src/mainboard/protectli/vault_kbl/{ramstage.c => mainboard.c} (58%) diff --git a/configs/config.protectli_fw6 b/configs/config.protectli_fw6 new file mode 100644 index 00000000000..40f4e49eeaa --- /dev/null +++ b/configs/config.protectli_fw6 @@ -0,0 +1,46 @@ +CONFIG_LOCALVERSION="v1.1.0" +CONFIG_OPTION_BACKEND_NONE=y +CONFIG_VENDOR_PROTECTLI=y +CONFIG_ONBOARD_VGA_IS_PRIMARY=y +CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x100000 +CONFIG_EDK2_BOOT_TIMEOUT=6 +CONFIG_USE_LEGACY_8254_TIMER=y +CONFIG_HAVE_IFD_BIN=y +CONFIG_BOARD_PROTECTLI_FW6=y +CONFIG_EDK2_BOOTSPLASH_FILE="$(top)/3rdparty/blobs/mainboard/$(MAINBOARDDIR)/bootsplash.bmp" +CONFIG_TPM_MEASURED_BOOT=y +CONFIG_SOC_INTEL_COMMON_BLOCK_PRMRR_SIZE_MAX=y +CONFIG_HAVE_ME_BIN=y +CONFIG_RUN_FSP_GOP=y +CONFIG_DRIVERS_EFI_VARIABLE_STORE=y +CONFIG_DRIVERS_GENERIC_CBFS_SERIAL=y +CONFIG_DRIVERS_GENERIC_CBFS_UUID=y +CONFIG_DEFAULT_CONSOLE_LOGLEVEL_0=y +# CONFIG_CONSOLE_USE_LOGLEVEL_PREFIX is not set +# CONFIG_CONSOLE_USE_ANSI_ESCAPES is not set +CONFIG_POST_DEVICE_LPC=y +CONFIG_PAYLOAD_EDK2=y +CONFIG_EDK2_REPOSITORY="https://github.com/Dasharo/edk2" +CONFIG_EDK2_TAG_OR_REV="1174634037dc986a2221176657407ea3447cf6a6" +CONFIG_EDK2_USE_EDK2_PLATFORMS=y +CONFIG_EDK2_PLATFORMS_REPOSITORY="https://github.com/Dasharo/edk2-platforms" +CONFIG_EDK2_PLATFORMS_TAG_OR_REV="3323ed481d35096fb6a7eae7b49f35eff00f86cf" +CONFIG_EDK2_CBMEM_LOGGING=y +CONFIG_EDK2_FOLLOW_BGRT_SPEC=y +# CONFIG_EDK2_PS2_SUPPORT is not set +CONFIG_EDK2_SERIAL_SUPPORT=y +CONFIG_EDK2_ENABLE_IPXE=y +CONFIG_EDK2_IPXE_OPTION_NAME="Network Boot and Utilities" +CONFIG_EDK2_SECURE_BOOT=y +# CONFIG_EDK2_SECURE_BOOT_DEFAULT_ENABLE is not set +CONFIG_EDK2_DASHARO_SYSTEM_FEATURES=y +CONFIG_EDK2_INTEL_ME_DISABLED_HECI=y +CONFIG_EDK2_DASHARO_USB_CONFIG=y +CONFIG_EDK2_DASHARO_NETWORK_BOOT_DEFAULT_ENABLE=y +CONFIG_EDK2_DASHARO_SERIAL_REDIRECTION_DEFAULT_ENABLE=y +CONFIG_EDK2_BOOT_MENU_KEY=0x0015 +CONFIG_EDK2_SETUP_MENU_KEY=0x0008 +CONFIG_EDK2_DISABLE_OPTION_ROMS=y +CONFIG_PXE_ADD_SCRIPT=y +CONFIG_PXE_SCRIPT="3rdparty/dasharo-blobs/dasharo/protectli.ipxe" +CONFIG_PXE_CUSTOM_BUILD_ID="0123456789" diff --git a/src/mainboard/protectli/vault_kbl/Kconfig b/src/mainboard/protectli/vault_kbl/Kconfig index 310a744a651..bd85f17e2a2 100644 --- a/src/mainboard/protectli/vault_kbl/Kconfig +++ b/src/mainboard/protectli/vault_kbl/Kconfig @@ -9,8 +9,9 @@ config BOARD_SPECIFIC_OPTIONS select MAINBOARD_HAS_LIBGFXINIT select SEABIOS_ADD_SERCON_PORT_FILE if PAYLOAD_SEABIOS select SOC_INTEL_KABYLAKE + select SOC_INTEL_COMMON_BLOCK_HDA_VERB select SPI_FLASH_MACRONIX - select SUPERIO_ITE_IT8772F + select SUPERIO_ITE_IT8613E select CRB_TPM select HAVE_INTEL_PTT select MAINBOARD_HAS_TPM2 @@ -19,7 +20,10 @@ config MAINBOARD_DIR default "protectli/vault_kbl" config MAINBOARD_PART_NUMBER - default "FW6" + default "FW6" + +config MAINBOARD_FAMILY + default "Vault" config DIMM_MAX default 2 @@ -28,21 +32,33 @@ config DIMM_SPD_SIZE default 512 config MAX_CPUS - int - default 4 + default 8 + +config DEVICETREE + default "devicetree.cb" config VGA_BIOS_ID - string - default "8086,5916" # 8086,5906 for FW6A + default "8086,5916" # FW6A/B/C + +config VGA_BIOS_SECOND_ID + default "8086,5917" # FW6D/E config PXE_ROM_ID - string default "8086,150c" config CBFS_SIZE default 0x600000 -config USE_PM_ACPI_TIMER - default n +config FMDFILE + default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/board.fmd" + +config BEEP_ON_BOOT + bool "Beep on successful boot" + default y + help + Make the platform beep using the PC speaker in final coreboot phase. + May serve as a useful indicator in headless mode that platform is + properly booting. + endif diff --git a/src/mainboard/protectli/vault_kbl/Makefile.inc b/src/mainboard/protectli/vault_kbl/Makefile.inc index 4cd7aaca852..be6bc46effd 100644 --- a/src/mainboard/protectli/vault_kbl/Makefile.inc +++ b/src/mainboard/protectli/vault_kbl/Makefile.inc @@ -2,6 +2,9 @@ bootblock-y += bootblock.c -ramstage-y += ramstage.c - ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads + +bootblock-y += die.c +romstage-y += die.c +ramstage-y += die.c +smm-y += die.c diff --git a/src/mainboard/protectli/vault_kbl/acpi/ec.asl b/src/mainboard/protectli/vault_kbl/acpi/ec.asl index 16990d45f42..73fa78ef14e 100644 --- a/src/mainboard/protectli/vault_kbl/acpi/ec.asl +++ b/src/mainboard/protectli/vault_kbl/acpi/ec.asl @@ -1,3 +1 @@ -/* SPDX-License-Identifier: CC-PDDC */ - -/* Please update the license if adding licensable material. */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ diff --git a/src/mainboard/protectli/vault_kbl/acpi/superio.asl b/src/mainboard/protectli/vault_kbl/acpi/superio.asl index 16990d45f42..555422b3374 100644 --- a/src/mainboard/protectli/vault_kbl/acpi/superio.asl +++ b/src/mainboard/protectli/vault_kbl/acpi/superio.asl @@ -1,3 +1,7 @@ -/* SPDX-License-Identifier: CC-PDDC */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* Please update the license if adding licensable material. */ +#define SUPERIO_DEV SIO0 +#define SUPERIO_PNP_BASE 0x2e +#define IT8786E_SHOW_UARTA + +#include diff --git a/src/mainboard/protectli/vault_kbl/board.fmd b/src/mainboard/protectli/vault_kbl/board.fmd new file mode 100644 index 00000000000..f5db010bd9a --- /dev/null +++ b/src/mainboard/protectli/vault_kbl/board.fmd @@ -0,0 +1,14 @@ +FLASH@0xff800000 8M { + SI_ALL 2M { + SI_DESC 4K + SI_ME + } + + SMMSTORE(PRESERVE) 256K + RW_MRC_CACHE 64K + BOOTSPLASH(CBFS) 512K + WP_RO { + FMAP 0x800 + COREBOOT(CBFS) + } +} diff --git a/src/mainboard/protectli/vault_kbl/board_info.txt b/src/mainboard/protectli/vault_kbl/board_info.txt index 70bd1746e29..111ad3099e0 100644 --- a/src/mainboard/protectli/vault_kbl/board_info.txt +++ b/src/mainboard/protectli/vault_kbl/board_info.txt @@ -1,5 +1,5 @@ Vendor name: Protectli -Board name: FW6A/FW6B/FW6C +Board name: FW6A/FW6B/FW6C/FW6D/FW6E Category: sbc ROM protocol: SPI ROM socketed: n diff --git a/src/mainboard/protectli/vault_kbl/bootblock.c b/src/mainboard/protectli/vault_kbl/bootblock.c index a11b5fdc3bb..ca81185d319 100644 --- a/src/mainboard/protectli/vault_kbl/bootblock.c +++ b/src/mainboard/protectli/vault_kbl/bootblock.c @@ -1,15 +1,33 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ #include -#include +#include #include +#include -#define GPIO_DEV PNP_DEV(0x2e, IT8772F_GPIO) -#define UART_DEV PNP_DEV(0x2e, IT8772F_SP1) +#define GPIO_DEV PNP_DEV(0x2e, IT8613E_GPIO) +#define UART_DEV PNP_DEV(0x2e, IT8613E_SP1) + +/* Return an id of the installed chip. */ +static uint16_t ite_read_id(void) +{ + pnp_enter_conf_state(GPIO_DEV); + uint16_t id = (pnp_read_config(GPIO_DEV, 0x20) << 8) + | pnp_read_config(GPIO_DEV, 0x21); + pnp_exit_conf_state(GPIO_DEV); + return id; +} void bootblock_mainboard_early_init(void) { - ite_conf_clkin(GPIO_DEV, ITE_UART_CLK_PREDIVIDE_24); + if (ite_read_id() == 0x8613){ + ite_reg_write(GPIO_DEV, 0x23, 0x49); /* CLK Select Ext CLKIN, 24MHz */ + ite_reg_write(GPIO_DEV, 0x2c, 0x41); /* Disable k8 power seq */ + ite_reg_write(GPIO_DEV, 0x2d, 0x02); /* PCICLK 25MHz */ + ite_reg_write(GPIO_DEV, 0x71, 0x08); /* Ext CLKIN PCICLK */ + } else { + ite_conf_clkin(GPIO_DEV, ITE_UART_CLK_PREDIVIDE_24); + } ite_enable_3vsbsw(GPIO_DEV); ite_kill_watchdog(GPIO_DEV); ite_enable_serial(UART_DEV, CONFIG_TTYS0_BASE); diff --git a/src/mainboard/protectli/vault_kbl/data.vbt b/src/mainboard/protectli/vault_kbl/data.vbt index 4379ed1a6e87de263d0796ce55c8cfd368dbacb4..2046d3109fc4ff57fed8dc573c26fed93ff2667d 100644 GIT binary patch delta 808 zcmc(dL1+^}6o%jI?rgGe-fT7_MAM}*wxNdFYNUtsB6blXr3WjbPFfTE&$U!N)SlPx>yO`qvY&Em2uL>T#ISf&h{+@GZG*xZgSYTKY_^3I$YcRX{)>7G6oY=(Vq5ze>{TyTe>-+KX3 zpkXM8pkkS@yyXZhmd}jB~D6xRw^U$rqoZRdMEK?EHw|+#t^rJ zdT*#ELOc@6e#L9fCuSD0$1GsX$lS-o=5MXMQzRbE@-Fk3dd+nacZv@pc4@>nkEmd} z$?8MgtYN`SQS7mKzkT91H5)Edvtgr^6WMNFHcJvY0oQJ8^cNX(s-=d#Ry7#f3ew=4 zC)8t(hs`cYrt3;(@J+ZqcFg(!Kw?}OU&Gg2L7hH{u3JiX>}Vz JfqCuU{S6&pi!T5G delta 693 zcmYk3OK4L;6o${-o14d(nVXxD7QM0M*v6<-n_ztvK^qE@B7#9g!G#7zbfXkqD542! zSEX1Pb*;E4>ZTH0NohAeK#E2X1sCE%@PR84HHqh+Gf=MJ>C^8MTv6NA-BB6Lz_4;jHVxC3hQi z#hyblMbMK9UE0#57|>#_Cj(GI<~31?0d|{LVf}JN_X2183hmQjO@0DWmbfC zO6KjIMOWfHFQZvfB{v+8+i97z_f*ym>j^7V&VEz8;I?