Andrey Petrov has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs ......................................................................
soc/intel/xeon_sp: Refactor code to allow for additional CPUs
Refactor the code and split it into common and CPU-specific code. Move most Skylake-SP code into skx/ and keep common code in the current folder.
This is a preparation for future work that will enable next generation server CPU.
Also, some minor cosmetic clean-ups like include reordering.
Signed-off-by: Andrey Petrov anpetrov@fb.com Change-Id: I448e6cfd6a85efb83d132ad26565557fe55a265a --- M src/mainboard/ocp/tiogapass/Kconfig M src/mainboard/ocp/tiogapass/devicetree.cb M src/mainboard/ocp/tiogapass/dsdt.asl M src/soc/intel/xeon_sp/Kconfig M src/soc/intel/xeon_sp/Makefile.inc R src/soc/intel/xeon_sp/bootblock.c M src/soc/intel/xeon_sp/include/soc/iomap.h M src/soc/intel/xeon_sp/include/soc/pcr_ids.h M src/soc/intel/xeon_sp/include/soc/romstage.h A src/soc/intel/xeon_sp/include/soc/util.h M src/soc/intel/xeon_sp/romstage.c A src/soc/intel/xeon_sp/skx/Kconfig A src/soc/intel/xeon_sp/skx/Makefile.inc R src/soc/intel/xeon_sp/skx/acpi.c R src/soc/intel/xeon_sp/skx/acpi/globalnvs.asl R src/soc/intel/xeon_sp/skx/acpi/iiostack.asl R src/soc/intel/xeon_sp/skx/acpi/pci_irq.asl R src/soc/intel/xeon_sp/skx/acpi/uncore.asl R src/soc/intel/xeon_sp/skx/acpi/uncore_irq.asl R src/soc/intel/xeon_sp/skx/chip.c R src/soc/intel/xeon_sp/skx/chip.h R src/soc/intel/xeon_sp/skx/cpu.c R src/soc/intel/xeon_sp/skx/hob_display.c R src/soc/intel/xeon_sp/skx/include/soc/acpi.h R src/soc/intel/xeon_sp/skx/include/soc/cpu.h R src/soc/intel/xeon_sp/skx/include/soc/gpio_soc_defs.h R src/soc/intel/xeon_sp/skx/include/soc/irq.h R src/soc/intel/xeon_sp/skx/include/soc/msr.h R src/soc/intel/xeon_sp/skx/include/soc/nvs.h R src/soc/intel/xeon_sp/skx/include/soc/pci_devs.h R src/soc/intel/xeon_sp/skx/include/soc/pm.h R src/soc/intel/xeon_sp/skx/include/soc/pmc.h R src/soc/intel/xeon_sp/skx/include/soc/ramstage.h R src/soc/intel/xeon_sp/skx/include/soc/soc_util.h R src/soc/intel/xeon_sp/skx/lpc.c A src/soc/intel/xeon_sp/skx/romstage.c R src/soc/intel/xeon_sp/skx/soc_util.c R src/soc/intel/xeon_sp/skx/spi.c R src/soc/intel/xeon_sp/skx/upd_display.c M src/soc/intel/xeon_sp/uncore.c A src/soc/intel/xeon_sp/util.c 41 files changed, 344 insertions(+), 222 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/39601/1
diff --git a/src/mainboard/ocp/tiogapass/Kconfig b/src/mainboard/ocp/tiogapass/Kconfig index 87e2760..d6b4459 100644 --- a/src/mainboard/ocp/tiogapass/Kconfig +++ b/src/mainboard/ocp/tiogapass/Kconfig @@ -21,9 +21,8 @@ def_bool y select BOARD_ROMSIZE_KB_32768 select HAVE_ACPI_TABLES - select SOC_INTEL_XEON_SP select MAINBOARD_USES_FSP2_0 - select FSP_CAR + select SOC_INTEL_SKYLAKE_SP
config MAINBOARD_DIR string diff --git a/src/mainboard/ocp/tiogapass/devicetree.cb b/src/mainboard/ocp/tiogapass/devicetree.cb index 46311d9..902ea80 100644 --- a/src/mainboard/ocp/tiogapass/devicetree.cb +++ b/src/mainboard/ocp/tiogapass/devicetree.cb @@ -15,7 +15,7 @@ ## GNU General Public License for more details. ##
-chip soc/intel/xeon_sp +chip soc/intel/xeon_sp/skx
register "pirqa_routing" = "PCH_IRQ11" register "pirqb_routing" = "PCH_IRQ10" diff --git a/src/mainboard/ocp/tiogapass/dsdt.asl b/src/mainboard/ocp/tiogapass/dsdt.asl index aca6c4d..076457e 100644 --- a/src/mainboard/ocp/tiogapass/dsdt.asl +++ b/src/mainboard/ocp/tiogapass/dsdt.asl @@ -30,12 +30,12 @@ #include "acpi/platform.asl"
// global NVS and variables - #include <soc/intel/xeon_sp/acpi/globalnvs.asl> + #include <soc/intel/xeon_sp/skx/acpi/globalnvs.asl>
#include <cpu/intel/common/acpi/cpu.asl>
// Xeon-SP ACPI tables Scope (_SB) { - #include <soc/intel/xeon_sp/acpi/uncore.asl> + #include <soc/intel/xeon_sp/skx/acpi/uncore.asl> } } diff --git a/src/soc/intel/xeon_sp/Kconfig b/src/soc/intel/xeon_sp/Kconfig index 94c0ac4..3dcb302 100644 --- a/src/soc/intel/xeon_sp/Kconfig +++ b/src/soc/intel/xeon_sp/Kconfig @@ -1,28 +1,17 @@ -## -## This file is part of the coreboot project. -## -## Copyright (C) 2019 - 2020 Intel Corporation -## Copyright (C) 2019 - 2020 Facebook Inc -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## +source "src/soc/intel/xeon_sp/skx/Kconfig"
-config SOC_INTEL_XEON_SP +config XEON_SP_COMMON_BASE bool + +config SOC_INTEL_SKYLAKE_SP + bool + select XEON_SP_COMMON_BASE help - Intel Xeon SP support + Intel Skylake-SP support
-if SOC_INTEL_XEON_SP +if XEON_SP_COMMON_BASE
-config CPU_SPECIFIC_OPTIONS +config CPU_SPECIFIC_OPTIONS def_bool y select ARCH_BOOTBLOCK_X86_32 select ARCH_RAMSTAGE_X86_32 @@ -69,11 +58,6 @@ select POSTCAR_CONSOLE select POSTCAR_STAGE
-config FSP_HEADER_PATH - string "Location of FSP headers" - depends on MAINBOARD_USES_FSP2_0 - default "src/vendorcode/intel/fsp/fsp2_0/skylake_sp" - config MAX_SOCKET int default 2 @@ -90,14 +74,6 @@ help This option allows you to select MMIO Base Address of sideband bus.
-config DCACHE_RAM_BASE - hex - default 0xfe800000 - -config DCACHE_RAM_SIZE - hex - default 0x200000 - config DCACHE_BSP_STACK_SIZE hex default 0x10000 @@ -106,14 +82,6 @@ hex default 0x80000000
-config CPU_MICROCODE_CBFS_LOC - hex - default 0xfff0fdc0 - -config CPU_MICROCODE_CBFS_LEN - hex - default 0x7C00 - config C_ENV_BOOTBLOCK_SIZE hex default 0xC000 @@ -122,5 +90,4 @@ hex default 0x80000
- -endif ## SOC_INTEL_XEON_SP +endif diff --git a/src/soc/intel/xeon_sp/Makefile.inc b/src/soc/intel/xeon_sp/Makefile.inc index 9ad3e77..a48a2f3 100644 --- a/src/soc/intel/xeon_sp/Makefile.inc +++ b/src/soc/intel/xeon_sp/Makefile.inc @@ -15,45 +15,15 @@ ## GNU General Public License for more details. ##
-ifeq ($(CONFIG_SOC_INTEL_XEON_SP),y) +ifeq ($(CONFIG_XEON_SP_COMMON_BASE),y)
-subdirs-y += ../../../cpu/intel/microcode -subdirs-y += ../../../cpu/intel/turbo -subdirs-y += ../../../cpu/x86/lapic -subdirs-y += ../../../cpu/x86/mtrr -subdirs-y += ../../../cpu/x86/tsc -subdirs-y += ../../../cpu/x86/cache -subdirs-$(CONFIG_HAVE_SMI_HANDLER) += ../../../cpu/x86/smm +subdirs-$(CONFIG_SOC_INTEL_SKYLAKE_SP) += skx
-bootblock-y += bootblock/bootblock.c -bootblock-y += spi.c - -postcar-y += soc_util.c -postcar-y += spi.c - -romstage-y += soc_util.c -romstage-y += reset.c -romstage-y += romstage.c -romstage-y += soc_util.c -romstage-y += spi.c -romstage-y += hob_display.c -romstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c -romstage-$(CONFIG_DISPLAY_HOBS) += hob_display.c - -ramstage-y += soc_util.c -ramstage-y += uncore.c -ramstage-y += reset.c -ramstage-y += chip.c -ramstage-y += soc_util.c -ramstage-y += lpc.c -ramstage-y += cpu.c -ramstage-y += spi.c -ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c -ramstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c -ramstage-$(CONFIG_DISPLAY_HOBS) += hob_display.c -ramstage-y += hob_display.c +bootblock-y += bootblock.c +romstage-y += romstage.c reset.c util.c +ramstage-y += uncore.c reset.c util.c
CPPFLAGS_common += -I$(src)/soc/intel/xeon_sp/include CPPFLAGS_common += -I$(CONFIG_FSP_HEADER_PATH)
-endif ## CONFIG_SOC_INTEL_XEON_SP +endif ## XEON_SP_COMMON_BASE diff --git a/src/soc/intel/xeon_sp/bootblock/bootblock.c b/src/soc/intel/xeon_sp/bootblock.c similarity index 99% rename from src/soc/intel/xeon_sp/bootblock/bootblock.c rename to src/soc/intel/xeon_sp/bootblock.c index 482f5b5..96f55ac 100644 --- a/src/soc/intel/xeon_sp/bootblock/bootblock.c +++ b/src/soc/intel/xeon_sp/bootblock.c @@ -15,11 +15,11 @@ */
#include <bootblock_common.h> +#include <console/console.h> #include <device/pci.h> #include <FsptUpd.h> #include <intelblocks/fast_spi.h> #include <soc/iomap.h> -#include <console/console.h>
const FSPT_UPD temp_ram_init_params = { .FspUpdHeader = { diff --git a/src/soc/intel/xeon_sp/include/soc/iomap.h b/src/soc/intel/xeon_sp/include/soc/iomap.h index 7c825a4..066a2db 100644 --- a/src/soc/intel/xeon_sp/include/soc/iomap.h +++ b/src/soc/intel/xeon_sp/include/soc/iomap.h @@ -1,8 +1,6 @@ /* * This file is part of the coreboot project. * - * Copyright (C) 2019 - 2020 Intel Corporation. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -30,18 +28,18 @@ #define MAP_ENTRY_LIMIT_32(reg_, mask_bits_, desc_) MAP_ENTRY(reg_, 0, 1, mask_bits_, desc_)
// SPI BAR0 MMIO base address -#define SPI_BASE_ADDRESS 0xfe010000 -#define SPI_BASE_SIZE 0x1000 +#define SPI_BASE_ADDRESS 0xfe010000 +#define SPI_BASE_SIZE 0x1000
-#define ACPI_BASE_ADDRESS 0x500 +#define ACPI_BASE_ADDRESS 0x500
/* Video RAM */ -#define VGA_BASE_ADDRESS 0xa0000 -#define VGA_BASE_SIZE 0x20000 +#define VGA_BASE_ADDRESS 0xa0000 +#define VGA_BASE_SIZE 0x20000
/* High Performance Event Timer */ -#define HPET_BASE_ADDRESS 0xfed00000 +#define HPET_BASE_ADDRESS 0xfed00000
-#define P2SB_BAR CONFIG_PCR_BASE_ADDRESS +#define P2SB_BAR CONFIG_PCR_BASE_ADDRESS
#endif /* _SOC_IOMAP_H_ */ diff --git a/src/soc/intel/xeon_sp/include/soc/pcr_ids.h b/src/soc/intel/xeon_sp/include/soc/pcr_ids.h index c679692..cf3e737 100644 --- a/src/soc/intel/xeon_sp/include/soc/pcr_ids.h +++ b/src/soc/intel/xeon_sp/include/soc/pcr_ids.h @@ -1,8 +1,6 @@ /* * This file is part of the coreboot project. * - * Copyright (C) 2019 - 2020 Intel Corporation. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -17,7 +15,7 @@ #ifndef _PCR_IDS_H_ #define _PCR_IDS_H_
-#define PID_ITSS 0xC4 -#define PID_RTC 0xC3 +#define PID_ITSS 0xc4 +#define PID_RTC 0xc3
#endif /* _PCR_IDS_H_ */ diff --git a/src/soc/intel/xeon_sp/include/soc/romstage.h b/src/soc/intel/xeon_sp/include/soc/romstage.h index 623306f..fa70bcd 100644 --- a/src/soc/intel/xeon_sp/include/soc/romstage.h +++ b/src/soc/intel/xeon_sp/include/soc/romstage.h @@ -1,8 +1,6 @@ /* * This file is part of the coreboot project. * - * Copyright (C) 2019 - 2020 Intel Corporation. - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/soc/intel/xeon_sp/include/soc/util.h b/src/soc/intel/xeon_sp/include/soc/util.h new file mode 100644 index 0000000..dc63140 --- /dev/null +++ b/src/soc/intel/xeon_sp/include/soc/util.h @@ -0,0 +1,49 @@ +/* + * This file is part of the coreboot project. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _XEON_SP_SOC_UTIL_H_ +#define _XEON_SP_SOC_UTIL_H_ + +#include <console/console.h> + +void get_cpubusnos(uint32_t *bus0, uint32_t *bus1, uint32_t *bus2, uint32_t *bus3); +void unlock_pam_regions(void); +void get_stack_busnos(uint32_t *bus); + +#define LOG_MEM_RESOURCE(type, dev, index, base_kb, size_kb) \ + printk(BIOS_SPEW, "%s:%d res: %s, dev: %s, index: 0x%x, base: 0x%llx, " \ + "end: 0x%llx, size_kb: 0x%llx\n", \ + __func__, __LINE__, type, dev_path(dev), index, (base_kb << 10), \ + (base_kb << 10) + (size_kb << 10) - 1, size_kb) + +#define LOG_IO_RESOURCE(type, dev, index, base, size) \ + printk(BIOS_SPEW, "%s:%d res: %s, dev: %s, index: 0x%x, base: 0x%llx, " \ + "end: 0x%llx, size: 0x%llx\n", \ + __func__, __LINE__, type, dev_path(dev), index, base, base + size - 1, size) + +#define DEV_FUNC_ENTER(dev) \ + printk(BIOS_SPEW, "%s:%s:%d: ENTER (dev: %s)\n", \ + __FILE__, __func__, __LINE__, dev_path(dev)) + +#define DEV_FUNC_EXIT(dev) \ + printk(BIOS_SPEW, "%s:%s:%d: EXIT (dev: %s)\n", __FILE__, \ + __func__, __LINE__, dev_path(dev)) + +#define FUNC_ENTER() \ + printk(BIOS_SPEW, "%s:%s:%d: ENTER\n", __FILE__, __func__, __LINE__) + +#define FUNC_EXIT() \ + printk(BIOS_SPEW, "%s:%s:%d: EXIT\n", __FILE__, __func__, __LINE__) + +#endif diff --git a/src/soc/intel/xeon_sp/romstage.c b/src/soc/intel/xeon_sp/romstage.c index dc94dc6..bb86683 100644 --- a/src/soc/intel/xeon_sp/romstage.c +++ b/src/soc/intel/xeon_sp/romstage.c @@ -17,12 +17,11 @@
#include <arch/romstage.h> #include <cbmem.h> -#include <intelblocks/rtc.h> #include <console/console.h> #include <cpu/x86/mtrr.h> +#include <intelblocks/rtc.h> #include <soc/romstage.h> -#include <soc/soc_util.h> -#include "chip.h" +#include <soc/util.h>
asmlinkage void car_stage_entry(void) { @@ -57,27 +56,3 @@
run_postcar_phase(&pcf); } - -static void soc_memory_init_params(FSP_M_CONFIG *m_cfg) -{ -} - -void platform_fsp_memory_init_params_cb(FSPM_UPD *mupd, uint32_t version) -{ - const config_t *config = config_of_soc(); - FSP_M_CONFIG *m_cfg = &mupd->FspmConfig; - - mupd->FspmUpdVersion = FSP_UPD_VERSION; - - // ErrorLevel - 0 (disable) to 8 (verbose) - m_cfg->PcdFspMrcDebugPrintErrorLevel = 0; - m_cfg->PcdFspKtiDebugPrintErrorLevel = 0; - - soc_memory_init_params(m_cfg); - - mainboard_memory_init_params(mupd); - - m_cfg->VTdConfig.VTdSupport = config->vtd_support; - m_cfg->VTdConfig.CoherencySupport = config->coherency_support; - m_cfg->VTdConfig.ATS = config->ats_support; -} diff --git a/src/soc/intel/xeon_sp/skx/Kconfig b/src/soc/intel/xeon_sp/skx/Kconfig new file mode 100644 index 0000000..1ce5ea6 --- /dev/null +++ b/src/soc/intel/xeon_sp/skx/Kconfig @@ -0,0 +1,81 @@ +## +## This file is part of the coreboot project. +## +## Copyright (C) 2019 - 2020 Intel Corporation +## Copyright (C) 2019 - 2020 Facebook Inc +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## + +if SOC_INTEL_SKYLAKE_SP + +config MAINBOARD_USES_FSP2_0 + bool + default y + +config USE_FSP2_0_DRIVER + def_bool y + depends on MAINBOARD_USES_FSP2_0 + select PLATFORM_USES_FSP2_0 + select UDK_2015_BINDING + select POSTCAR_CONSOLE + select POSTCAR_STAGE + +config FSP_HEADER_PATH + string "Location of FSP headers" + depends on MAINBOARD_USES_FSP2_0 + default "src/vendorcode/intel/fsp/fsp2_0/skylake_sp" + +config MAX_SOCKET + int + default 2 + +# For 2S config, the number of cpus could be as high as +# 2 threads * 20 cores * 2 sockets +config MAX_CPUS + int + default 80 + +config PCR_BASE_ADDRESS + hex + default 0xfd000000 + help + This option allows you to select MMIO Base Address of sideband bus. + +config DCACHE_RAM_BASE + hex + default 0xfe800000 + +config DCACHE_RAM_SIZE + hex + default 0x200000 + +config DCACHE_BSP_STACK_SIZE + hex + default 0x10000 + +config CPU_MICROCODE_CBFS_LOC + hex + default 0xfff0fdc0 + +config CPU_MICROCODE_CBFS_LEN + hex + default 0x7C00 + +config C_ENV_BOOTBLOCK_SIZE + hex + default 0xC000 + +config HEAP_SIZE + hex + default 0x80000 + +endif diff --git a/src/soc/intel/xeon_sp/skx/Makefile.inc b/src/soc/intel/xeon_sp/skx/Makefile.inc new file mode 100644 index 0000000..144a5c7 --- /dev/null +++ b/src/soc/intel/xeon_sp/skx/Makefile.inc @@ -0,0 +1,54 @@ +## +## This file is part of the coreboot project. +## +## Copyright (C) 2019 - 2020 Intel Corporation +## Copyright (C) 2019 - 2020 Facebook Inc +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## + +ifeq ($(CONFIG_SOC_INTEL_SKYLAKE_SP),y) + +subdirs-y += ../../../../cpu/intel/microcode +subdirs-y += ../../../../cpu/intel/turbo +subdirs-y += ../../../../cpu/x86/lapic +subdirs-y += ../../../../cpu/x86/mtrr +subdirs-y += ../../../../cpu/x86/tsc +subdirs-y += ../../../../cpu/x86/cache +subdirs-$(CONFIG_HAVE_SMI_HANDLER) += ../../../cpu/x86/smm + +bootblock-y += spi.c + +postcar-y += soc_util.c +postcar-y += spi.c + +romstage-y += soc_util.c +romstage-y += romstage.c +romstage-y += soc_util.c +romstage-y += spi.c +romstage-y += hob_display.c +romstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c +romstage-$(CONFIG_DISPLAY_HOBS) += hob_display.c + +ramstage-y += soc_util.c +ramstage-y += chip.c +ramstage-y += soc_util.c +ramstage-y += lpc.c +ramstage-y += cpu.c +ramstage-y += spi.c +ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c +ramstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c +ramstage-$(CONFIG_DISPLAY_HOBS) += hob_display.c +ramstage-y += hob_display.c + +CPPFLAGS_common += -I$(src)/soc/intel/xeon_sp/skx/include + +endif ## CONFIG_SOC_INTEL_SKYLAKE_SP diff --git a/src/soc/intel/xeon_sp/acpi.c b/src/soc/intel/xeon_sp/skx/acpi.c similarity index 99% rename from src/soc/intel/xeon_sp/acpi.c rename to src/soc/intel/xeon_sp/skx/acpi.c index 37dd420..6f9987f 100644 --- a/src/soc/intel/xeon_sp/acpi.c +++ b/src/soc/intel/xeon_sp/skx/acpi.c @@ -881,7 +881,7 @@ acpi_slit_t *slit; acpi_dmar_t *dmar;
- const struct soc_intel_xeon_sp_config *const config = config_of(device); + const struct soc_intel_xeon_sp_skx_config *const config = config_of(device);
/* SRAT */ current = ALIGN(current, 8); diff --git a/src/soc/intel/xeon_sp/acpi/globalnvs.asl b/src/soc/intel/xeon_sp/skx/acpi/globalnvs.asl similarity index 100% rename from src/soc/intel/xeon_sp/acpi/globalnvs.asl rename to src/soc/intel/xeon_sp/skx/acpi/globalnvs.asl diff --git a/src/soc/intel/xeon_sp/acpi/iiostack.asl b/src/soc/intel/xeon_sp/skx/acpi/iiostack.asl similarity index 100% rename from src/soc/intel/xeon_sp/acpi/iiostack.asl rename to src/soc/intel/xeon_sp/skx/acpi/iiostack.asl diff --git a/src/soc/intel/xeon_sp/acpi/pci_irq.asl b/src/soc/intel/xeon_sp/skx/acpi/pci_irq.asl similarity index 100% rename from src/soc/intel/xeon_sp/acpi/pci_irq.asl rename to src/soc/intel/xeon_sp/skx/acpi/pci_irq.asl diff --git a/src/soc/intel/xeon_sp/acpi/uncore.asl b/src/soc/intel/xeon_sp/skx/acpi/uncore.asl similarity index 100% rename from src/soc/intel/xeon_sp/acpi/uncore.asl rename to src/soc/intel/xeon_sp/skx/acpi/uncore.asl diff --git a/src/soc/intel/xeon_sp/acpi/uncore_irq.asl b/src/soc/intel/xeon_sp/skx/acpi/uncore_irq.asl similarity index 100% rename from src/soc/intel/xeon_sp/acpi/uncore_irq.asl rename to src/soc/intel/xeon_sp/skx/acpi/uncore_irq.asl diff --git a/src/soc/intel/xeon_sp/chip.c b/src/soc/intel/xeon_sp/skx/chip.c similarity index 99% rename from src/soc/intel/xeon_sp/chip.c rename to src/soc/intel/xeon_sp/skx/chip.c index 832f98e..228ec42 100644 --- a/src/soc/intel/xeon_sp/chip.c +++ b/src/soc/intel/xeon_sp/skx/chip.c @@ -591,8 +591,8 @@ mainboard_silicon_init_params(silupd); }
-struct chip_operations soc_intel_xeon_sp_ops = { - CHIP_NAME("Intel Xeon-SP SOC") +struct chip_operations soc_intel_xeon_sp_skx_ops = { + CHIP_NAME("Intel Skylake-SP") .enable_dev = soc_enable_dev, .init = soc_init, .final = soc_final diff --git a/src/soc/intel/xeon_sp/chip.h b/src/soc/intel/xeon_sp/skx/chip.h similarity index 95% rename from src/soc/intel/xeon_sp/chip.h rename to src/soc/intel/xeon_sp/skx/chip.h index 72f2445..de54fc0 100644 --- a/src/soc/intel/xeon_sp/chip.h +++ b/src/soc/intel/xeon_sp/skx/chip.h @@ -23,7 +23,7 @@ #include <intelblocks/cfg.h> #include <soc/irq.h>
-struct soc_intel_xeon_sp_config { +struct soc_intel_xeon_sp_skx_config { /* Common struct containing soc config data required by common code */ struct soc_intel_common_config common_soc_config;
@@ -82,6 +82,6 @@
extern struct chip_operations soc_intel_xeon_sp_ops;
-typedef struct soc_intel_xeon_sp_config config_t; +typedef struct soc_intel_xeon_sp_skx_config config_t;
#endif diff --git a/src/soc/intel/xeon_sp/cpu.c b/src/soc/intel/xeon_sp/skx/cpu.c similarity index 100% rename from src/soc/intel/xeon_sp/cpu.c rename to src/soc/intel/xeon_sp/skx/cpu.c diff --git a/src/soc/intel/xeon_sp/hob_display.c b/src/soc/intel/xeon_sp/skx/hob_display.c similarity index 99% rename from src/soc/intel/xeon_sp/hob_display.c rename to src/soc/intel/xeon_sp/skx/hob_display.c index 1508011..65b54a6 100644 --- a/src/soc/intel/xeon_sp/hob_display.c +++ b/src/soc/intel/xeon_sp/skx/hob_display.c @@ -15,12 +15,12 @@ * GNU General Public License for more details. */
+#include <assert.h> #include <console/console.h> #include <fsp/util.h> -#include <lib.h> -#include <assert.h> #include <hob_iiouds.h> #include <hob_memmap.h> +#include <lib.h>
static const uint8_t fsp_hob_iio_uds_guid[16] = FSP_HOB_IIO_UNIVERSAL_DATA_GUID; static const uint8_t fsp_hob_memmap_guid[16] = FSP_SYSTEM_MEMORYMAP_HOB_GUID; diff --git a/src/soc/intel/xeon_sp/include/soc/acpi.h b/src/soc/intel/xeon_sp/skx/include/soc/acpi.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/acpi.h rename to src/soc/intel/xeon_sp/skx/include/soc/acpi.h diff --git a/src/soc/intel/xeon_sp/include/soc/cpu.h b/src/soc/intel/xeon_sp/skx/include/soc/cpu.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/cpu.h rename to src/soc/intel/xeon_sp/skx/include/soc/cpu.h diff --git a/src/soc/intel/xeon_sp/include/soc/gpio_soc_defs.h b/src/soc/intel/xeon_sp/skx/include/soc/gpio_soc_defs.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/gpio_soc_defs.h rename to src/soc/intel/xeon_sp/skx/include/soc/gpio_soc_defs.h diff --git a/src/soc/intel/xeon_sp/include/soc/irq.h b/src/soc/intel/xeon_sp/skx/include/soc/irq.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/irq.h rename to src/soc/intel/xeon_sp/skx/include/soc/irq.h diff --git a/src/soc/intel/xeon_sp/include/soc/msr.h b/src/soc/intel/xeon_sp/skx/include/soc/msr.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/msr.h rename to src/soc/intel/xeon_sp/skx/include/soc/msr.h diff --git a/src/soc/intel/xeon_sp/include/soc/nvs.h b/src/soc/intel/xeon_sp/skx/include/soc/nvs.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/nvs.h rename to src/soc/intel/xeon_sp/skx/include/soc/nvs.h diff --git a/src/soc/intel/xeon_sp/include/soc/pci_devs.h b/src/soc/intel/xeon_sp/skx/include/soc/pci_devs.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/pci_devs.h rename to src/soc/intel/xeon_sp/skx/include/soc/pci_devs.h diff --git a/src/soc/intel/xeon_sp/include/soc/pm.h b/src/soc/intel/xeon_sp/skx/include/soc/pm.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/pm.h rename to src/soc/intel/xeon_sp/skx/include/soc/pm.h diff --git a/src/soc/intel/xeon_sp/include/soc/pmc.h b/src/soc/intel/xeon_sp/skx/include/soc/pmc.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/pmc.h rename to src/soc/intel/xeon_sp/skx/include/soc/pmc.h diff --git a/src/soc/intel/xeon_sp/include/soc/ramstage.h b/src/soc/intel/xeon_sp/skx/include/soc/ramstage.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/ramstage.h rename to src/soc/intel/xeon_sp/skx/include/soc/ramstage.h diff --git a/src/soc/intel/xeon_sp/include/soc/soc_util.h b/src/soc/intel/xeon_sp/skx/include/soc/soc_util.h similarity index 60% rename from src/soc/intel/xeon_sp/include/soc/soc_util.h rename to src/soc/intel/xeon_sp/skx/include/soc/soc_util.h index 8b5e1a2..735581a 100644 --- a/src/soc/intel/xeon_sp/include/soc/soc_util.h +++ b/src/soc/intel/xeon_sp/skx/include/soc/soc_util.h @@ -21,31 +21,7 @@ #include <hob_iiouds.h> #include <hob_memmap.h> #include <arch/acpi.h> - -#define LOG_MEM_RESOURCE(type, dev, index, base_kb, size_kb) \ - printk(BIOS_SPEW, "%s:%d res: %s, dev: %s, index: 0x%x, base: 0x%llx, " \ - "end: 0x%llx, size_kb: 0x%llx\n", \ - __func__, __LINE__, type, dev_path(dev), index, (base_kb << 10), \ - (base_kb << 10) + (size_kb << 10) - 1, size_kb) - -#define LOG_IO_RESOURCE(type, dev, index, base, size) \ - printk(BIOS_SPEW, "%s:%d res: %s, dev: %s, index: 0x%x, base: 0x%llx, " \ - "end: 0x%llx, size: 0x%llx\n", \ - __func__, __LINE__, type, dev_path(dev), index, base, base + size - 1, size) - -#define DEV_FUNC_ENTER(dev) \ - printk(BIOS_SPEW, "%s:%s:%d: ENTER (dev: %s)\n", \ - __FILE__, __func__, __LINE__, dev_path(dev)) - -#define DEV_FUNC_EXIT(dev) \ - printk(BIOS_SPEW, "%s:%s:%d: EXIT (dev: %s)\n", __FILE__, \ - __func__, __LINE__, dev_path(dev)) - -#define FUNC_ENTER() \ - printk(BIOS_SPEW, "%s:%s:%d: ENTER\n", __FILE__, __func__, __LINE__) - -#define FUNC_EXIT() \ - printk(BIOS_SPEW, "%s:%s:%d: EXIT\n", __FILE__, __func__, __LINE__) +#include <soc/util.h>
struct iiostack_resource { uint8_t no_of_stacks; @@ -59,8 +35,6 @@
uint32_t pci_read_mmio_reg(int bus, uint32_t dev, uint32_t func, int offset);
-void get_stack_busnos(uint32_t *bus); -void get_cpubusnos(uint32_t *bus0, uint32_t *bus1, uint32_t *bus2, uint32_t *bus3); uint32_t get_socket_stack_busno(uint32_t socket, uint32_t stack); void get_iiostack_info(struct iiostack_resource *info);
@@ -72,7 +46,6 @@ void get_cpu_info_from_apicid(uint32_t apicid, uint32_t core_bits, uint32_t thread_bits, uint8_t *package, uint8_t *core, uint8_t *thread);
-void unlock_pam_regions(void); void xeonsp_init_cpu_config(void); void set_bios_init_completion(void); void config_reset_cpl3_csrs(void); diff --git a/src/soc/intel/xeon_sp/lpc.c b/src/soc/intel/xeon_sp/skx/lpc.c similarity index 100% rename from src/soc/intel/xeon_sp/lpc.c rename to src/soc/intel/xeon_sp/skx/lpc.c diff --git a/src/soc/intel/xeon_sp/skx/romstage.c b/src/soc/intel/xeon_sp/skx/romstage.c new file mode 100644 index 0000000..a98fd07 --- /dev/null +++ b/src/soc/intel/xeon_sp/skx/romstage.c @@ -0,0 +1,44 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2019 - 2020 Intel Corporation + * Copyright (C) 2019 - 2020 Facebook Inc + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <arch/romstage.h> +#include <cbmem.h> +#include <console/console.h> +#include <cpu/x86/mtrr.h> +#include <intelblocks/rtc.h> +#include <soc/romstage.h> +#include <soc/soc_util.h> + +#include "chip.h" + +void platform_fsp_memory_init_params_cb(FSPM_UPD *mupd, uint32_t version) +{ + const config_t *config = config_of_soc(); + FSP_M_CONFIG *m_cfg = &mupd->FspmConfig; + + mupd->FspmUpdVersion = FSP_UPD_VERSION; + + // ErrorLevel - 0 (disable) to 8 (verbose) + m_cfg->PcdFspMrcDebugPrintErrorLevel = 0; + m_cfg->PcdFspKtiDebugPrintErrorLevel = 0; + + mainboard_memory_init_params(mupd); + + m_cfg->VTdConfig.VTdSupport = config->vtd_support; + m_cfg->VTdConfig.CoherencySupport = config->coherency_support; + m_cfg->VTdConfig.ATS = config->ats_support; +} diff --git a/src/soc/intel/xeon_sp/soc_util.c b/src/soc/intel/xeon_sp/skx/soc_util.c similarity index 90% rename from src/soc/intel/xeon_sp/soc_util.c rename to src/soc/intel/xeon_sp/skx/soc_util.c index 6310bac..f6b581b 100644 --- a/src/soc/intel/xeon_sp/soc_util.c +++ b/src/soc/intel/xeon_sp/skx/soc_util.c @@ -18,20 +18,17 @@ #include <assert.h> #include <commonlib/sort.h> #include <console/console.h> -#include <cpu/cpu.h> -#include <cpu/x86/msr.h> #include <delay.h> #include <device/pci.h> -#include <hob_iiouds.h> #include <intelblocks/cpulib.h> #include <intelblocks/pcr.h> -#include <soc/iomap.h> #include <soc/cpu.h> +#include <soc/iomap.h> #include <soc/msr.h> #include <soc/pci_devs.h> #include <soc/pcr_ids.h> #include <soc/soc_util.h> -#include <stdlib.h> +#include <soc/util.h> #include <timer.h>
/* @@ -71,24 +68,6 @@ return addr; }
-/* - * Get Socket 0 CPUBUSNO(0), CPUBUSNO(1) PCI bus numbers UBOX (B0:D8:F2:Offset_CCh) - * TODO: D0h - */ -void get_cpubusnos(uint32_t *bus0, uint32_t *bus1, uint32_t *bus2, uint32_t *bus3) -{ - uint32_t bus = pci_io_read_config32(PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV, - UBOX_DECS_FUNC), UBOX_DECS_CPUBUSNO_CSR); - if (bus0) - *bus0 = (bus & 0xff); - if (bus1) - *bus1 = (bus >> 8) & 0xff; - if (bus2) - *bus2 = (bus >> 16) & 0xff; - if (bus3) - *bus3 = (bus >> 24) & 0xff; -} - uint32_t top_of_32bit_ram(void) { uintptr_t mmcfg, tolm; @@ -155,42 +134,6 @@ return hob->PlatformData.CpuQpiInfo[socket].StackBus[stack]; }
-/* bus needs to be of size 6 (MAX_IIO_STACK) */ -void get_stack_busnos(uint32_t *bus) -{ - uint32_t reg1, reg2; - - reg1 = pci_mmio_read_config32(PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV, UBOX_DECS_FUNC), - 0xcc); - reg2 = pci_mmio_read_config32(PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV, UBOX_DECS_FUNC), - 0xd0); - - for (int i = 0; i < 4; ++i) - bus[i] = ((reg1 >> (i * 8)) & 0xff); - for (int i = 0; i < 2; ++i) - bus[4+i] = ((reg2 >> (i * 8)) & 0xff); -} - -void unlock_pam_regions(void) -{ - uint32_t bus1 = 0; - uint32_t pam0123_unlock_dram = 0x33333330; - uint32_t pam456_unlock_dram = 0x00333333; - - get_cpubusnos(NULL, &bus1, NULL, NULL); - pci_io_write_config32(PCI_DEV(bus1, SAD_ALL_DEV, SAD_ALL_FUNC), - SAD_ALL_PAM0123_CSR, pam0123_unlock_dram); - pci_io_write_config32(PCI_DEV(bus1, SAD_ALL_DEV, SAD_ALL_FUNC), - SAD_ALL_PAM456_CSR, pam456_unlock_dram); - - uint32_t reg1 = pci_io_read_config32(PCI_DEV(bus1, SAD_ALL_DEV, - SAD_ALL_FUNC), SAD_ALL_PAM0123_CSR); - uint32_t reg2 = pci_io_read_config32(PCI_DEV(bus1, SAD_ALL_DEV, - SAD_ALL_FUNC), SAD_ALL_PAM456_CSR); - printk(BIOS_DEBUG, "%s:%s pam0123_csr: 0x%x, pam456_csr: 0x%x\n", - __FILE__, __func__, reg1, reg2); -} - /* return 1 if command timed out else 0 */ static uint32_t wait_for_bios_cmd_cpl(pci_devfn_t dev, uint32_t reg, uint32_t mask, uint32_t target) diff --git a/src/soc/intel/xeon_sp/spi.c b/src/soc/intel/xeon_sp/skx/spi.c similarity index 100% rename from src/soc/intel/xeon_sp/spi.c rename to src/soc/intel/xeon_sp/skx/spi.c diff --git a/src/soc/intel/xeon_sp/upd_display.c b/src/soc/intel/xeon_sp/skx/upd_display.c similarity index 100% rename from src/soc/intel/xeon_sp/upd_display.c rename to src/soc/intel/xeon_sp/skx/upd_display.c diff --git a/src/soc/intel/xeon_sp/uncore.c b/src/soc/intel/xeon_sp/uncore.c index adf3e3e..ebdd3d7 100644 --- a/src/soc/intel/xeon_sp/uncore.c +++ b/src/soc/intel/xeon_sp/uncore.c @@ -20,10 +20,13 @@ #include <cpu/x86/lapic.h> #include <device/pci.h> #include <device/pci_ids.h> +#include <fsp/api.h> +#include <fsp/util.h> +#include <memrange.h> #include <soc/iomap.h> #include <soc/pci_devs.h> #include <soc/ramstage.h> -#include <soc/soc_util.h> +#include <soc/util.h>
struct map_entry { uint32_t reg; diff --git a/src/soc/intel/xeon_sp/util.c b/src/soc/intel/xeon_sp/util.c new file mode 100644 index 0000000..6f1e28d --- /dev/null +++ b/src/soc/intel/xeon_sp/util.c @@ -0,0 +1,70 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2019 - 2020 Intel Corporation + * Copyright (C) 2019 - 2020 Facebook Inc + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <console/console.h> +#include <device/pci.h> +#include <soc/pci_devs.h> +#include <soc/util.h> + +void get_stack_busnos(uint32_t *bus) +{ + uint32_t reg1, reg2; + + reg1 = pci_mmio_read_config32(PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV, UBOX_DECS_FUNC), + 0xcc); + reg2 = pci_mmio_read_config32(PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV, UBOX_DECS_FUNC), + 0xd0); + + for (int i = 0; i < 4; ++i) + bus[i] = ((reg1 >> (i * 8)) & 0xff); + for (int i = 0; i < 2; ++i) + bus[4+i] = ((reg2 >> (i * 8)) & 0xff); +} + +void unlock_pam_regions(void) +{ + uint32_t bus1 = 0; + uint32_t pam0123_unlock_dram = 0x33333330; + uint32_t pam456_unlock_dram = 0x00333333; + + get_cpubusnos(NULL, &bus1, NULL, NULL); + pci_io_write_config32(PCI_DEV(bus1, SAD_ALL_DEV, SAD_ALL_FUNC), + SAD_ALL_PAM0123_CSR, pam0123_unlock_dram); + pci_io_write_config32(PCI_DEV(bus1, SAD_ALL_DEV, SAD_ALL_FUNC), + SAD_ALL_PAM456_CSR, pam456_unlock_dram); + + uint32_t reg1 = pci_io_read_config32(PCI_DEV(bus1, SAD_ALL_DEV, + SAD_ALL_FUNC), SAD_ALL_PAM0123_CSR); + uint32_t reg2 = pci_io_read_config32(PCI_DEV(bus1, SAD_ALL_DEV, + SAD_ALL_FUNC), SAD_ALL_PAM456_CSR); + printk(BIOS_DEBUG, "%s:%s pam0123_csr: 0x%x, pam456_csr: 0x%x\n", + __FILE__, __func__, reg1, reg2); +} + +void get_cpubusnos(uint32_t *bus0, uint32_t *bus1, uint32_t *bus2, uint32_t *bus3) +{ + uint32_t bus = pci_io_read_config32(PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV, + UBOX_DECS_FUNC), UBOX_DECS_CPUBUSNO_CSR); + if (bus0) + *bus0 = (bus & 0xff); + if (bus1) + *bus1 = (bus >> 8) & 0xff; + if (bus2) + *bus2 = (bus >> 16) & 0xff; + if (bus3) + *bus3 = (bus >> 24) & 0xff; +}
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs ......................................................................
Patch Set 1: Code-Review-1
(7 comments)
Looks great overall! The nits about pure cosmetic changes can probably be ignored for now. The copyright headers will need to be removed to avoid conflicting with the CB:39605 patch chain.
https://review.coreboot.org/c/coreboot/+/39601/1/src/mainboard/ocp/tiogapass... File src/mainboard/ocp/tiogapass/Kconfig:
https://review.coreboot.org/c/coreboot/+/39601/1/src/mainboard/ocp/tiogapass... PS1, Line 26: select FSP_CAR Does this change belong in this patch?
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/bootb... File src/soc/intel/xeon_sp/bootblock.c:
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/bootb... PS1, Line 22: #include <console/console.h> Cosmetic changes should go in another patch.
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/inclu... File src/soc/intel/xeon_sp/include/soc/iomap.h:
PS1: Thanks for fixing the indentation, but purely cosmetic changes should go in another patch.
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/inclu... File src/soc/intel/xeon_sp/include/soc/pcr_ids.h:
PS1: purely cosmetic changes should go in another patch.
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/skx/M... File src/soc/intel/xeon_sp/skx/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/skx/M... PS1, Line 5: ## Copyright (C) 2019 - 2020 Facebook Inc Get rid of these (as per the CB:39605 patch chain)
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/skx/h... File src/soc/intel/xeon_sp/skx/hob_display.c:
PS1: purely cosmetic changes should go in another patch.
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/skx/r... File src/soc/intel/xeon_sp/skx/romstage.c:
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/skx/r... PS1, Line 5: * Copyright (C) 2019 - 2020 Facebook Inc Get rid of these (as per the CB:39605 patch chain)
Hello build bot (Jenkins), Anjaneya "Reddy" Chagam, Patrick Georgi, Martin Roth, Jonathan Zhang, David Hendricks, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39601
to look at the new patch set (#2).
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs ......................................................................
soc/intel/xeon_sp: Refactor code to allow for additional CPUs
Refactor the code and split it into common and CPU-specific code. Move most Skylake-SP code into skx/ and keep common code in the current folder.
This is a preparation for future work that will enable next generation server CPU.
Also, some minor cosmetic clean-ups like include reordering.
Signed-off-by: Andrey Petrov anpetrov@fb.com Change-Id: I448e6cfd6a85efb83d132ad26565557fe55a265a --- M src/mainboard/ocp/tiogapass/Kconfig M src/mainboard/ocp/tiogapass/devicetree.cb M src/mainboard/ocp/tiogapass/dsdt.asl M src/soc/intel/xeon_sp/Kconfig M src/soc/intel/xeon_sp/Makefile.inc R src/soc/intel/xeon_sp/bootblock.c M src/soc/intel/xeon_sp/include/soc/iomap.h M src/soc/intel/xeon_sp/include/soc/pcr_ids.h M src/soc/intel/xeon_sp/include/soc/romstage.h A src/soc/intel/xeon_sp/include/soc/util.h M src/soc/intel/xeon_sp/romstage.c A src/soc/intel/xeon_sp/skx/Kconfig A src/soc/intel/xeon_sp/skx/Makefile.inc R src/soc/intel/xeon_sp/skx/acpi.c R src/soc/intel/xeon_sp/skx/acpi/globalnvs.asl R src/soc/intel/xeon_sp/skx/acpi/iiostack.asl R src/soc/intel/xeon_sp/skx/acpi/pci_irq.asl R src/soc/intel/xeon_sp/skx/acpi/uncore.asl R src/soc/intel/xeon_sp/skx/acpi/uncore_irq.asl R src/soc/intel/xeon_sp/skx/chip.c R src/soc/intel/xeon_sp/skx/chip.h R src/soc/intel/xeon_sp/skx/cpu.c R src/soc/intel/xeon_sp/skx/hob_display.c R src/soc/intel/xeon_sp/skx/include/soc/acpi.h R src/soc/intel/xeon_sp/skx/include/soc/cpu.h R src/soc/intel/xeon_sp/skx/include/soc/gpio_soc_defs.h R src/soc/intel/xeon_sp/skx/include/soc/irq.h R src/soc/intel/xeon_sp/skx/include/soc/msr.h R src/soc/intel/xeon_sp/skx/include/soc/nvs.h R src/soc/intel/xeon_sp/skx/include/soc/pci_devs.h R src/soc/intel/xeon_sp/skx/include/soc/pm.h R src/soc/intel/xeon_sp/skx/include/soc/pmc.h R src/soc/intel/xeon_sp/skx/include/soc/ramstage.h R src/soc/intel/xeon_sp/skx/include/soc/soc_util.h R src/soc/intel/xeon_sp/skx/lpc.c A src/soc/intel/xeon_sp/skx/romstage.c R src/soc/intel/xeon_sp/skx/soc_util.c R src/soc/intel/xeon_sp/skx/spi.c R src/soc/intel/xeon_sp/skx/upd_display.c M src/soc/intel/xeon_sp/uncore.c A src/soc/intel/xeon_sp/util.c 41 files changed, 345 insertions(+), 222 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/39601/2
Hello build bot (Jenkins), Anjaneya "Reddy" Chagam, Patrick Georgi, Martin Roth, Jonathan Zhang, David Hendricks, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39601
to look at the new patch set (#3).
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs ......................................................................
soc/intel/xeon_sp: Refactor code to allow for additional CPUs
Refactor the code and split it into common and CPU-specific code. Move most Skylake-SP code into skx/ and keep common code in the current folder.
This is a preparation for future work that will enable next generation server CPU.
Signed-off-by: Andrey Petrov anpetrov@fb.com Change-Id: I448e6cfd6a85efb83d132ad26565557fe55a265a --- M src/mainboard/ocp/tiogapass/Kconfig M src/mainboard/ocp/tiogapass/devicetree.cb M src/mainboard/ocp/tiogapass/dsdt.asl M src/soc/intel/xeon_sp/Kconfig M src/soc/intel/xeon_sp/Makefile.inc R src/soc/intel/xeon_sp/bootblock.c R src/soc/intel/xeon_sp/include/soc/util.h M src/soc/intel/xeon_sp/romstage.c A src/soc/intel/xeon_sp/skx/Kconfig A src/soc/intel/xeon_sp/skx/Makefile.inc R src/soc/intel/xeon_sp/skx/acpi.c R src/soc/intel/xeon_sp/skx/acpi/globalnvs.asl R src/soc/intel/xeon_sp/skx/acpi/iiostack.asl R src/soc/intel/xeon_sp/skx/acpi/pci_irq.asl R src/soc/intel/xeon_sp/skx/acpi/uncore.asl R src/soc/intel/xeon_sp/skx/acpi/uncore_irq.asl R src/soc/intel/xeon_sp/skx/chip.c R src/soc/intel/xeon_sp/skx/chip.h R src/soc/intel/xeon_sp/skx/cpu.c R src/soc/intel/xeon_sp/skx/hob_display.c R src/soc/intel/xeon_sp/skx/include/soc/acpi.h R src/soc/intel/xeon_sp/skx/include/soc/cpu.h R src/soc/intel/xeon_sp/skx/include/soc/gpio_soc_defs.h R src/soc/intel/xeon_sp/skx/include/soc/irq.h R src/soc/intel/xeon_sp/skx/include/soc/msr.h R src/soc/intel/xeon_sp/skx/include/soc/nvs.h R src/soc/intel/xeon_sp/skx/include/soc/pci_devs.h R src/soc/intel/xeon_sp/skx/include/soc/pm.h R src/soc/intel/xeon_sp/skx/include/soc/pmc.h R src/soc/intel/xeon_sp/skx/include/soc/ramstage.h A src/soc/intel/xeon_sp/skx/include/soc/soc_util.h R src/soc/intel/xeon_sp/skx/lpc.c A src/soc/intel/xeon_sp/skx/romstage.c R src/soc/intel/xeon_sp/skx/soc_util.c R src/soc/intel/xeon_sp/skx/spi.c R src/soc/intel/xeon_sp/skx/upd_display.c M src/soc/intel/xeon_sp/uncore.c A src/soc/intel/xeon_sp/util.c 38 files changed, 332 insertions(+), 188 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/39601/3
Andrey Petrov has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs ......................................................................
Patch Set 3:
(7 comments)
thanks David. As you see I was already removing copyright notices as I was moving files. So I rebased the patch on top of Patrick's. I think I was able to revert most of the cosmetic changes, and I will submit them separately
https://review.coreboot.org/c/coreboot/+/39601/1/src/mainboard/ocp/tiogapass... File src/mainboard/ocp/tiogapass/Kconfig:
https://review.coreboot.org/c/coreboot/+/39601/1/src/mainboard/ocp/tiogapass... PS1, Line 26: select FSP_CAR
Does this change belong in this patch?
yeah. FSP_CAR should not be in motherboard in the first place
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/bootb... File src/soc/intel/xeon_sp/bootblock.c:
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/bootb... PS1, Line 22: #include <console/console.h>
Cosmetic changes should go in another patch.
Ack
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/inclu... File src/soc/intel/xeon_sp/include/soc/iomap.h:
PS1:
Thanks for fixing the indentation, but purely cosmetic changes should go in another patch.
Ack
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/inclu... File src/soc/intel/xeon_sp/include/soc/pcr_ids.h:
PS1:
purely cosmetic changes should go in another patch.
Ack
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/skx/M... File src/soc/intel/xeon_sp/skx/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/skx/M... PS1, Line 5: ## Copyright (C) 2019 - 2020 Facebook Inc
Get rid of these (as per the CB:39605 patch chain)
Ack
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/skx/h... File src/soc/intel/xeon_sp/skx/hob_display.c:
PS1:
purely cosmetic changes should go in another patch.
Ack
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/skx/r... File src/soc/intel/xeon_sp/skx/romstage.c:
https://review.coreboot.org/c/coreboot/+/39601/1/src/soc/intel/xeon_sp/skx/r... PS1, Line 5: * Copyright (C) 2019 - 2020 Facebook Inc
Get rid of these (as per the CB:39605 patch chain)
Ack
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs ......................................................................
Patch Set 3: Code-Review+2
Thanks for doing this, Andrey!
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs ......................................................................
Patch Set 3: Code-Review+1
needs a bit more testing...
Jonathan Zhang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
Patch Set 6:
(3 comments)
Overall this looks good, thanks for the effort. Before we finish the bring-up of next generation xeon-sp processor based platform, we do not know what are the coreboot differences between skylake-sp and next generation xeon-sp. Most assumptions made in this patch on the differences will be corrected over the course. One approach is to start upstreaming once we know the differences at large. With this approach, we need to be prepared to adjust further along the way.
https://review.coreboot.org/c/coreboot/+/39601/6/src/soc/intel/xeon_sp/bootb... File src/soc/intel/xeon_sp/bootblock.c:
https://review.coreboot.org/c/coreboot/+/39601/6/src/soc/intel/xeon_sp/bootb... PS6, Line 38: , Removing of this is a clean-up, that should go to a separate patch. So this patch can focus on supporting additional CPU type.
https://review.coreboot.org/c/coreboot/+/39601/6/src/soc/intel/xeon_sp/inclu... File src/soc/intel/xeon_sp/include/soc/iomap.h:
https://review.coreboot.org/c/coreboot/+/39601/6/src/soc/intel/xeon_sp/inclu... PS6, Line 48: Addition of this code should go to a dedicated patch, so this patch can stick to its commit message.
https://review.coreboot.org/c/coreboot/+/39601/6/src/soc/intel/xeon_sp/skx/i... File src/soc/intel/xeon_sp/skx/include/soc/pmc.h:
https://review.coreboot.org/c/coreboot/+/39601/6/src/soc/intel/xeon_sp/skx/i... PS6, Line 2: * This file is part of the coreboot project. This file should be a rename from src/soc/intel/xeon_sp/include/soc/pmc.h, instead of a new file.
Hello build bot (Jenkins), Anjaneya "Reddy" Chagam, Patrick Georgi, Martin Roth, Jonathan Zhang, David Hendricks, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39601
to look at the new patch set (#7).
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
soc/intel/xeon_sp: Refactor code to allow for additional CPUs types
Refactor the code and split it into Xeon common and CPU-specific code. Move most Skylake-SP code into skx/ and keep common code in the current folder.
This is a preparation for future work that will enable next generation server CPU.
TEST=Tested on OCP Tioga Pass. There does not seem to be degradation of stability as far as I could tell.
Signed-off-by: Andrey Petrov anpetrov@fb.com Change-Id: I448e6cfd6a85efb83d132ad26565557fe55a265a --- M src/mainboard/ocp/tiogapass/Kconfig M src/mainboard/ocp/tiogapass/devicetree.cb M src/mainboard/ocp/tiogapass/dsdt.asl M src/soc/intel/xeon_sp/Kconfig M src/soc/intel/xeon_sp/Makefile.inc R src/soc/intel/xeon_sp/bootblock.c M src/soc/intel/xeon_sp/include/soc/iomap.h R src/soc/intel/xeon_sp/include/soc/util.h M src/soc/intel/xeon_sp/lpc.c M src/soc/intel/xeon_sp/romstage.c A src/soc/intel/xeon_sp/skx/Kconfig A src/soc/intel/xeon_sp/skx/Makefile.inc R src/soc/intel/xeon_sp/skx/acpi.c R src/soc/intel/xeon_sp/skx/acpi/globalnvs.asl R src/soc/intel/xeon_sp/skx/acpi/iiostack.asl R src/soc/intel/xeon_sp/skx/acpi/pci_irq.asl R src/soc/intel/xeon_sp/skx/acpi/uncore.asl R src/soc/intel/xeon_sp/skx/acpi/uncore_irq.asl R src/soc/intel/xeon_sp/skx/chip.c R src/soc/intel/xeon_sp/skx/chip.h R src/soc/intel/xeon_sp/skx/cpu.c R src/soc/intel/xeon_sp/skx/hob_display.c R src/soc/intel/xeon_sp/skx/include/soc/acpi.h R src/soc/intel/xeon_sp/skx/include/soc/cpu.h R src/soc/intel/xeon_sp/skx/include/soc/gpio_soc_defs.h R src/soc/intel/xeon_sp/skx/include/soc/irq.h R src/soc/intel/xeon_sp/skx/include/soc/msr.h R src/soc/intel/xeon_sp/skx/include/soc/nvs.h R src/soc/intel/xeon_sp/skx/include/soc/pci_devs.h A src/soc/intel/xeon_sp/skx/include/soc/pmc.h R src/soc/intel/xeon_sp/skx/include/soc/ramstage.h A src/soc/intel/xeon_sp/skx/include/soc/soc_util.h A src/soc/intel/xeon_sp/skx/romstage.c R src/soc/intel/xeon_sp/skx/soc_util.c R src/soc/intel/xeon_sp/skx/upd_display.c M src/soc/intel/xeon_sp/uncore.c A src/soc/intel/xeon_sp/util.c 37 files changed, 294 insertions(+), 191 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/39601/7
Hello build bot (Jenkins), Anjaneya "Reddy" Chagam, Patrick Georgi, Martin Roth, Jonathan Zhang, David Hendricks, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39601
to look at the new patch set (#8).
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
soc/intel/xeon_sp: Refactor code to allow for additional CPUs types
Refactor the code and split it into Xeon common and CPU-specific code. Move most Skylake-SP code into skx/ and keep common code in the current folder.
This is a preparation for future work that will enable next generation server CPU.
TEST=Tested on OCP Tioga Pass. There does not seem to be degradation of stability as far as I could tell.
Signed-off-by: Andrey Petrov anpetrov@fb.com Change-Id: I448e6cfd6a85efb83d132ad26565557fe55a265a --- M src/mainboard/ocp/tiogapass/Kconfig M src/mainboard/ocp/tiogapass/devicetree.cb M src/mainboard/ocp/tiogapass/dsdt.asl M src/soc/intel/xeon_sp/Kconfig M src/soc/intel/xeon_sp/Makefile.inc R src/soc/intel/xeon_sp/bootblock.c R src/soc/intel/xeon_sp/include/soc/util.h M src/soc/intel/xeon_sp/lpc.c M src/soc/intel/xeon_sp/romstage.c A src/soc/intel/xeon_sp/skx/Kconfig A src/soc/intel/xeon_sp/skx/Makefile.inc R src/soc/intel/xeon_sp/skx/acpi.c R src/soc/intel/xeon_sp/skx/acpi/globalnvs.asl R src/soc/intel/xeon_sp/skx/acpi/iiostack.asl R src/soc/intel/xeon_sp/skx/acpi/pci_irq.asl R src/soc/intel/xeon_sp/skx/acpi/uncore.asl R src/soc/intel/xeon_sp/skx/acpi/uncore_irq.asl R src/soc/intel/xeon_sp/skx/chip.c R src/soc/intel/xeon_sp/skx/chip.h R src/soc/intel/xeon_sp/skx/cpu.c R src/soc/intel/xeon_sp/skx/hob_display.c R src/soc/intel/xeon_sp/skx/include/soc/acpi.h R src/soc/intel/xeon_sp/skx/include/soc/cpu.h R src/soc/intel/xeon_sp/skx/include/soc/gpio_soc_defs.h R src/soc/intel/xeon_sp/skx/include/soc/irq.h R src/soc/intel/xeon_sp/skx/include/soc/msr.h R src/soc/intel/xeon_sp/skx/include/soc/nvs.h R src/soc/intel/xeon_sp/skx/include/soc/pci_devs.h R src/soc/intel/xeon_sp/skx/include/soc/ramstage.h A src/soc/intel/xeon_sp/skx/include/soc/soc_util.h A src/soc/intel/xeon_sp/skx/romstage.c R src/soc/intel/xeon_sp/skx/soc_util.c R src/soc/intel/xeon_sp/skx/upd_display.c M src/soc/intel/xeon_sp/uncore.c A src/soc/intel/xeon_sp/util.c 35 files changed, 269 insertions(+), 190 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/39601/8
Andrey Petrov has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
Patch Set 8:
(3 comments)
https://review.coreboot.org/c/coreboot/+/39601/6/src/soc/intel/xeon_sp/bootb... File src/soc/intel/xeon_sp/bootblock.c:
https://review.coreboot.org/c/coreboot/+/39601/6/src/soc/intel/xeon_sp/bootb... PS6, Line 38: ,
Removing of this is a clean-up, that should go to a separate patch. […]
Ack
https://review.coreboot.org/c/coreboot/+/39601/6/src/soc/intel/xeon_sp/inclu... File src/soc/intel/xeon_sp/include/soc/iomap.h:
https://review.coreboot.org/c/coreboot/+/39601/6/src/soc/intel/xeon_sp/inclu... PS6, Line 48:
Addition of this code should go to a dedicated patch, so this patch can stick to its commit message.
Ack
https://review.coreboot.org/c/coreboot/+/39601/6/src/soc/intel/xeon_sp/skx/i... File src/soc/intel/xeon_sp/skx/include/soc/pmc.h:
https://review.coreboot.org/c/coreboot/+/39601/6/src/soc/intel/xeon_sp/skx/i... PS6, Line 2: * This file is part of the coreboot project.
This file should be a rename from src/soc/intel/xeon_sp/include/soc/pmc.h, instead of a new file.
Ack
Maxim Polyakov has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
Patch Set 8: Code-Review+2
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
Patch Set 8: Code-Review+2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
Patch Set 8:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39601/8/src/soc/intel/xeon_sp/Kconf... File src/soc/intel/xeon_sp/Kconfig:
https://review.coreboot.org/c/coreboot/+/39601/8/src/soc/intel/xeon_sp/Kconf... PS8, Line 63: select FSP_CAR Where does this come from?
Andrey Petrov has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
Patch Set 8:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39601/8/src/soc/intel/xeon_sp/Kconf... File src/soc/intel/xeon_sp/Kconfig:
https://review.coreboot.org/c/coreboot/+/39601/8/src/soc/intel/xeon_sp/Kconf... PS8, Line 63: select FSP_CAR
Where does this come from?
that was from mainboard. I felt like moving this into soc code is more meaningful. Since we have currently only 1 mb I thought it was cosmetic non-functional change.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
Patch Set 8:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39601/8/src/mainboard/ocp/tiogapass... File src/mainboard/ocp/tiogapass/Kconfig:
https://review.coreboot.org/c/coreboot/+/39601/8/src/mainboard/ocp/tiogapass... PS8, Line 24: FSP_CAR *screaming so as to reach the other comment* Ah, I see!
Hello build bot (Jenkins), Anjaneya "Reddy" Chagam, Patrick Georgi, Martin Roth, Maxim Polyakov, Jonathan Zhang, David Hendricks, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39601
to look at the new patch set (#9).
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
soc/intel/xeon_sp: Refactor code to allow for additional CPUs types
Refactor the code and split it into Xeon common and CPU-specific code. Move most Skylake-SP code into skx/ and keep common code in the current folder.
This is a preparation for future work that will enable next generation server CPU.
TEST=Tested on OCP Tioga Pass. There does not seem to be degradation of stability as far as I could tell.
Signed-off-by: Andrey Petrov anpetrov@fb.com Change-Id: I448e6cfd6a85efb83d132ad26565557fe55a265a --- M src/mainboard/ocp/tiogapass/Kconfig M src/mainboard/ocp/tiogapass/devicetree.cb M src/mainboard/ocp/tiogapass/dsdt.asl M src/soc/intel/xeon_sp/Kconfig M src/soc/intel/xeon_sp/Makefile.inc R src/soc/intel/xeon_sp/bootblock.c R src/soc/intel/xeon_sp/include/soc/util.h M src/soc/intel/xeon_sp/lpc.c M src/soc/intel/xeon_sp/romstage.c A src/soc/intel/xeon_sp/skx/Kconfig A src/soc/intel/xeon_sp/skx/Makefile.inc R src/soc/intel/xeon_sp/skx/acpi.c R src/soc/intel/xeon_sp/skx/acpi/globalnvs.asl R src/soc/intel/xeon_sp/skx/acpi/iiostack.asl R src/soc/intel/xeon_sp/skx/acpi/pci_irq.asl R src/soc/intel/xeon_sp/skx/acpi/uncore.asl R src/soc/intel/xeon_sp/skx/acpi/uncore_irq.asl R src/soc/intel/xeon_sp/skx/chip.c R src/soc/intel/xeon_sp/skx/chip.h R src/soc/intel/xeon_sp/skx/cpu.c R src/soc/intel/xeon_sp/skx/hob_display.c R src/soc/intel/xeon_sp/skx/include/soc/acpi.h R src/soc/intel/xeon_sp/skx/include/soc/cpu.h R src/soc/intel/xeon_sp/skx/include/soc/gpio_soc_defs.h R src/soc/intel/xeon_sp/skx/include/soc/irq.h R src/soc/intel/xeon_sp/skx/include/soc/msr.h R src/soc/intel/xeon_sp/skx/include/soc/nvs.h R src/soc/intel/xeon_sp/skx/include/soc/pci_devs.h R src/soc/intel/xeon_sp/skx/include/soc/ramstage.h A src/soc/intel/xeon_sp/skx/include/soc/soc_util.h A src/soc/intel/xeon_sp/skx/romstage.c R src/soc/intel/xeon_sp/skx/soc_util.c R src/soc/intel/xeon_sp/skx/upd_display.c M src/soc/intel/xeon_sp/uncore.c A src/soc/intel/xeon_sp/util.c 35 files changed, 269 insertions(+), 191 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/39601/9
Andrey Petrov has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
Patch Set 9:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39601/8/src/mainboard/ocp/tiogapass... File src/mainboard/ocp/tiogapass/Kconfig:
https://review.coreboot.org/c/coreboot/+/39601/8/src/mainboard/ocp/tiogapass... PS8, Line 24: FSP_CAR
*screaming so as to reach the other comment* Ah, I see!
Done
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
Patch Set 9: Code-Review+2
Hello build bot (Jenkins), Anjaneya "Reddy" Chagam, Patrick Georgi, Martin Roth, Maxim Polyakov, Jonathan Zhang, David Hendricks, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39601
to look at the new patch set (#10).
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
soc/intel/xeon_sp: Refactor code to allow for additional CPUs types
Refactor the code and split it into Xeon common and CPU-specific code. Move most Skylake-SP code into skx/ and keep common code in the current folder.
This is a preparation for future work that will enable next generation server CPU.
TEST=Tested on OCP Tioga Pass. There does not seem to be degradation of stability as far as I could tell.
Signed-off-by: Andrey Petrov anpetrov@fb.com Change-Id: I448e6cfd6a85efb83d132ad26565557fe55a265a --- M src/mainboard/ocp/tiogapass/Kconfig M src/mainboard/ocp/tiogapass/devicetree.cb M src/mainboard/ocp/tiogapass/dsdt.asl M src/soc/intel/xeon_sp/Kconfig M src/soc/intel/xeon_sp/Makefile.inc R src/soc/intel/xeon_sp/bootblock.c R src/soc/intel/xeon_sp/include/soc/util.h M src/soc/intel/xeon_sp/lpc.c M src/soc/intel/xeon_sp/romstage.c A src/soc/intel/xeon_sp/skx/Kconfig A src/soc/intel/xeon_sp/skx/Makefile.inc R src/soc/intel/xeon_sp/skx/acpi.c R src/soc/intel/xeon_sp/skx/acpi/globalnvs.asl R src/soc/intel/xeon_sp/skx/acpi/iiostack.asl R src/soc/intel/xeon_sp/skx/acpi/pci_irq.asl R src/soc/intel/xeon_sp/skx/acpi/uncore.asl R src/soc/intel/xeon_sp/skx/acpi/uncore_irq.asl R src/soc/intel/xeon_sp/skx/chip.c R src/soc/intel/xeon_sp/skx/chip.h R src/soc/intel/xeon_sp/skx/cpu.c R src/soc/intel/xeon_sp/skx/hob_display.c R src/soc/intel/xeon_sp/skx/include/soc/acpi.h R src/soc/intel/xeon_sp/skx/include/soc/cpu.h R src/soc/intel/xeon_sp/skx/include/soc/gpio_soc_defs.h R src/soc/intel/xeon_sp/skx/include/soc/irq.h R src/soc/intel/xeon_sp/skx/include/soc/msr.h R src/soc/intel/xeon_sp/skx/include/soc/nvs.h R src/soc/intel/xeon_sp/skx/include/soc/pci_devs.h R src/soc/intel/xeon_sp/skx/include/soc/ramstage.h A src/soc/intel/xeon_sp/skx/include/soc/soc_util.h A src/soc/intel/xeon_sp/skx/romstage.c R src/soc/intel/xeon_sp/skx/soc_util.c R src/soc/intel/xeon_sp/skx/upd_display.c M src/soc/intel/xeon_sp/uncore.c A src/soc/intel/xeon_sp/util.c 35 files changed, 269 insertions(+), 191 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/39601/10
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
Patch Set 10: Code-Review+2
Andrey Petrov has submitted this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
soc/intel/xeon_sp: Refactor code to allow for additional CPUs types
Refactor the code and split it into Xeon common and CPU-specific code. Move most Skylake-SP code into skx/ and keep common code in the current folder.
This is a preparation for future work that will enable next generation server CPU.
TEST=Tested on OCP Tioga Pass. There does not seem to be degradation of stability as far as I could tell.
Signed-off-by: Andrey Petrov anpetrov@fb.com Change-Id: I448e6cfd6a85efb83d132ad26565557fe55a265a Reviewed-on: https://review.coreboot.org/c/coreboot/+/39601 Reviewed-by: David Hendricks david.hendricks@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/ocp/tiogapass/Kconfig M src/mainboard/ocp/tiogapass/devicetree.cb M src/mainboard/ocp/tiogapass/dsdt.asl M src/soc/intel/xeon_sp/Kconfig M src/soc/intel/xeon_sp/Makefile.inc R src/soc/intel/xeon_sp/bootblock.c R src/soc/intel/xeon_sp/include/soc/util.h M src/soc/intel/xeon_sp/lpc.c M src/soc/intel/xeon_sp/romstage.c A src/soc/intel/xeon_sp/skx/Kconfig A src/soc/intel/xeon_sp/skx/Makefile.inc R src/soc/intel/xeon_sp/skx/acpi.c R src/soc/intel/xeon_sp/skx/acpi/globalnvs.asl R src/soc/intel/xeon_sp/skx/acpi/iiostack.asl R src/soc/intel/xeon_sp/skx/acpi/pci_irq.asl R src/soc/intel/xeon_sp/skx/acpi/uncore.asl R src/soc/intel/xeon_sp/skx/acpi/uncore_irq.asl R src/soc/intel/xeon_sp/skx/chip.c R src/soc/intel/xeon_sp/skx/chip.h R src/soc/intel/xeon_sp/skx/cpu.c R src/soc/intel/xeon_sp/skx/hob_display.c R src/soc/intel/xeon_sp/skx/include/soc/acpi.h R src/soc/intel/xeon_sp/skx/include/soc/cpu.h R src/soc/intel/xeon_sp/skx/include/soc/gpio_soc_defs.h R src/soc/intel/xeon_sp/skx/include/soc/irq.h R src/soc/intel/xeon_sp/skx/include/soc/msr.h R src/soc/intel/xeon_sp/skx/include/soc/nvs.h R src/soc/intel/xeon_sp/skx/include/soc/pci_devs.h R src/soc/intel/xeon_sp/skx/include/soc/ramstage.h A src/soc/intel/xeon_sp/skx/include/soc/soc_util.h A src/soc/intel/xeon_sp/skx/romstage.c R src/soc/intel/xeon_sp/skx/soc_util.c R src/soc/intel/xeon_sp/skx/upd_display.c M src/soc/intel/xeon_sp/uncore.c A src/soc/intel/xeon_sp/util.c 35 files changed, 269 insertions(+), 191 deletions(-)
Approvals: build bot (Jenkins): Verified David Hendricks: Looks good to me, approved
diff --git a/src/mainboard/ocp/tiogapass/Kconfig b/src/mainboard/ocp/tiogapass/Kconfig index 9dbc066..1d501e6 100644 --- a/src/mainboard/ocp/tiogapass/Kconfig +++ b/src/mainboard/ocp/tiogapass/Kconfig @@ -19,10 +19,9 @@ def_bool y select BOARD_ROMSIZE_KB_32768 select HAVE_ACPI_TABLES - select SOC_INTEL_XEON_SP select MAINBOARD_USES_FSP2_0 - select FSP_CAR select IPMI_KCS + select SOC_INTEL_SKYLAKE_SP
config MAINBOARD_DIR string diff --git a/src/mainboard/ocp/tiogapass/devicetree.cb b/src/mainboard/ocp/tiogapass/devicetree.cb index c2eddf2..51e6a62 100644 --- a/src/mainboard/ocp/tiogapass/devicetree.cb +++ b/src/mainboard/ocp/tiogapass/devicetree.cb @@ -13,7 +13,7 @@ ## GNU General Public License for more details. ##
-chip soc/intel/xeon_sp +chip soc/intel/xeon_sp/skx
register "pirqa_routing" = "PCH_IRQ11" register "pirqb_routing" = "PCH_IRQ10" diff --git a/src/mainboard/ocp/tiogapass/dsdt.asl b/src/mainboard/ocp/tiogapass/dsdt.asl index 41c006b..9d33865 100644 --- a/src/mainboard/ocp/tiogapass/dsdt.asl +++ b/src/mainboard/ocp/tiogapass/dsdt.asl @@ -28,12 +28,12 @@ #include "acpi/platform.asl"
// global NVS and variables - #include <soc/intel/xeon_sp/acpi/globalnvs.asl> + #include <soc/intel/xeon_sp/skx/acpi/globalnvs.asl>
#include <cpu/intel/common/acpi/cpu.asl>
// Xeon-SP ACPI tables Scope (_SB) { - #include <soc/intel/xeon_sp/acpi/uncore.asl> + #include <soc/intel/xeon_sp/skx/acpi/uncore.asl> } } diff --git a/src/soc/intel/xeon_sp/Kconfig b/src/soc/intel/xeon_sp/Kconfig index 1f015b1..223329d 100644 --- a/src/soc/intel/xeon_sp/Kconfig +++ b/src/soc/intel/xeon_sp/Kconfig @@ -13,14 +13,20 @@ ## GNU General Public License for more details. ##
-config SOC_INTEL_XEON_SP +source "src/soc/intel/xeon_sp/skx/Kconfig" + +config XEON_SP_COMMON_BASE bool + +config SOC_INTEL_SKYLAKE_SP + bool + select XEON_SP_COMMON_BASE help - Intel Xeon SP support + Intel Skylake-SP support
-if SOC_INTEL_XEON_SP +if XEON_SP_COMMON_BASE
-config CPU_SPECIFIC_OPTIONS +config CPU_SPECIFIC_OPTIONS def_bool y select ARCH_BOOTBLOCK_X86_32 select ARCH_RAMSTAGE_X86_32 @@ -54,6 +60,7 @@ select SUPPORT_CPU_UCODE_IN_CBFS select MICROCODE_BLOB_NOT_HOOKED_UP select CPU_INTEL_FIRMWARE_INTERFACE_TABLE + select FSP_CAR
config MAINBOARD_USES_FSP2_0 bool @@ -67,11 +74,6 @@ select POSTCAR_CONSOLE select POSTCAR_STAGE
-config FSP_HEADER_PATH - string "Location of FSP headers" - depends on MAINBOARD_USES_FSP2_0 - default "src/vendorcode/intel/fsp/fsp2_0/skylake_sp" - config MAX_SOCKET int default 2 @@ -88,14 +90,6 @@ help This option allows you to select MMIO Base Address of sideband bus.
-config DCACHE_RAM_BASE - hex - default 0xfe800000 - -config DCACHE_RAM_SIZE - hex - default 0x200000 - config DCACHE_BSP_STACK_SIZE hex default 0x10000 @@ -104,14 +98,6 @@ hex default 0x80000000
-config CPU_MICROCODE_CBFS_LOC - hex - default 0xfff0fdc0 - -config CPU_MICROCODE_CBFS_LEN - hex - default 0x7C00 - config C_ENV_BOOTBLOCK_SIZE hex default 0xC000 @@ -120,5 +106,4 @@ hex default 0x80000
- endif ## SOC_INTEL_XEON_SP diff --git a/src/soc/intel/xeon_sp/Makefile.inc b/src/soc/intel/xeon_sp/Makefile.inc index 59350bf..e05fea2 100644 --- a/src/soc/intel/xeon_sp/Makefile.inc +++ b/src/soc/intel/xeon_sp/Makefile.inc @@ -13,46 +13,16 @@ ## GNU General Public License for more details. ##
-ifeq ($(CONFIG_SOC_INTEL_XEON_SP),y) +ifeq ($(CONFIG_XEON_SP_COMMON_BASE),y)
-subdirs-y += ../../../cpu/intel/microcode -subdirs-y += ../../../cpu/intel/turbo -subdirs-y += ../../../cpu/x86/lapic -subdirs-y += ../../../cpu/x86/mtrr -subdirs-y += ../../../cpu/x86/tsc -subdirs-y += ../../../cpu/x86/cache -subdirs-$(CONFIG_HAVE_SMI_HANDLER) += ../../../cpu/x86/smm +subdirs-$(CONFIG_SOC_INTEL_SKYLAKE_SP) += skx
-bootblock-y += bootblock/bootblock.c -bootblock-y += lpc.c -bootblock-y += spi.c - -postcar-y += soc_util.c +bootblock-y += bootblock.c spi.c lpc.c +romstage-y += romstage.c reset.c util.c spi.c +ramstage-y += uncore.c reset.c util.c lpc.c spi.c postcar-y += spi.c
-romstage-y += soc_util.c -romstage-y += reset.c -romstage-y += romstage.c -romstage-y += soc_util.c -romstage-y += spi.c -romstage-y += hob_display.c -romstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c -romstage-$(CONFIG_DISPLAY_HOBS) += hob_display.c - -ramstage-y += soc_util.c -ramstage-y += uncore.c -ramstage-y += reset.c -ramstage-y += chip.c -ramstage-y += soc_util.c -ramstage-y += lpc.c -ramstage-y += cpu.c -ramstage-y += spi.c -ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c -ramstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c -ramstage-$(CONFIG_DISPLAY_HOBS) += hob_display.c -ramstage-y += hob_display.c - CPPFLAGS_common += -I$(src)/soc/intel/xeon_sp/include CPPFLAGS_common += -I$(CONFIG_FSP_HEADER_PATH)
-endif ## CONFIG_SOC_INTEL_XEON_SP +endif ## XEON_SP_COMMON_BASE diff --git a/src/soc/intel/xeon_sp/bootblock/bootblock.c b/src/soc/intel/xeon_sp/bootblock.c similarity index 100% rename from src/soc/intel/xeon_sp/bootblock/bootblock.c rename to src/soc/intel/xeon_sp/bootblock.c diff --git a/src/soc/intel/xeon_sp/include/soc/soc_util.h b/src/soc/intel/xeon_sp/include/soc/util.h similarity index 60% rename from src/soc/intel/xeon_sp/include/soc/soc_util.h rename to src/soc/intel/xeon_sp/include/soc/util.h index 47e5be3..6f907f6 100644 --- a/src/soc/intel/xeon_sp/include/soc/soc_util.h +++ b/src/soc/intel/xeon_sp/include/soc/util.h @@ -13,13 +13,14 @@ * GNU General Public License for more details. */
+#ifndef _XEON_SP_SOC_UTIL_H_ +#define _XEON_SP_SOC_UTIL_H_
-#ifndef _SOC_UTIL_H_ -#define _SOC_UTIL_H_ +#include <console/console.h>
-#include <hob_iiouds.h> -#include <hob_memmap.h> -#include <arch/acpi.h> +void get_cpubusnos(uint32_t *bus0, uint32_t *bus1, uint32_t *bus2, uint32_t *bus3); +void unlock_pam_regions(void); +void get_stack_busnos(uint32_t *bus);
#define LOG_MEM_RESOURCE(type, dev, index, base_kb, size_kb) \ printk(BIOS_SPEW, "%s:%d res: %s, dev: %s, index: 0x%x, base: 0x%llx, " \ @@ -46,34 +47,4 @@ #define FUNC_EXIT() \ printk(BIOS_SPEW, "%s:%s:%d: EXIT\n", __FILE__, __func__, __LINE__)
-struct iiostack_resource { - uint8_t no_of_stacks; - STACK_RES res[CONFIG_MAX_SOCKET * MAX_IIO_STACK]; -}; - -uintptr_t get_tolm(uint32_t bus); -void get_tseg_base_lim(uint32_t bus, uint32_t *base, uint32_t *limit); -uintptr_t get_cha_mmcfg_base(uint32_t bus); -uint32_t top_of_32bit_ram(void); // Top of 32bit usable memory - -uint32_t pci_read_mmio_reg(int bus, uint32_t dev, uint32_t func, int offset); - -void get_stack_busnos(uint32_t *bus); -void get_cpubusnos(uint32_t *bus0, uint32_t *bus1, uint32_t *bus2, uint32_t *bus3); -uint32_t get_socket_stack_busno(uint32_t socket, uint32_t stack); -void get_iiostack_info(struct iiostack_resource *info); - -int get_threads_per_package(void); -int get_platform_thread_count(void); -void get_core_thread_bits(uint32_t *core_bits, uint32_t *thread_bits); - -unsigned int get_srat_memory_entries(acpi_srat_mem_t *srat_mem); -void get_cpu_info_from_apicid(uint32_t apicid, uint32_t core_bits, - uint32_t thread_bits, uint8_t *package, uint8_t *core, uint8_t *thread); - -void unlock_pam_regions(void); -void xeonsp_init_cpu_config(void); -void set_bios_init_completion(void); -void config_reset_cpl3_csrs(void); - -#endif /* _SOC_UTIL_H_ */ +#endif diff --git a/src/soc/intel/xeon_sp/lpc.c b/src/soc/intel/xeon_sp/lpc.c index 6dc2c41..c2f1f89 100644 --- a/src/soc/intel/xeon_sp/lpc.c +++ b/src/soc/intel/xeon_sp/lpc.c @@ -17,11 +17,10 @@ #include <arch/ioapic.h> #include <intelblocks/lpc_lib.h> #include <intelblocks/pcr.h> -#include <soc/soc_util.h> #include <soc/iomap.h> #include <soc/pcr_ids.h>
-#include "chip.h" +#include <chip.h>
static const struct lpc_mmio_range xeon_lpc_fixed_mmio_ranges[] = { { 0, 0 } diff --git a/src/soc/intel/xeon_sp/romstage.c b/src/soc/intel/xeon_sp/romstage.c index a519663..9d3665c 100644 --- a/src/soc/intel/xeon_sp/romstage.c +++ b/src/soc/intel/xeon_sp/romstage.c @@ -18,9 +18,9 @@ #include <intelblocks/rtc.h> #include <console/console.h> #include <cpu/x86/mtrr.h> +#include <fsp/util.h> #include <soc/romstage.h> -#include <soc/soc_util.h> -#include "chip.h" +#include <soc/util.h>
asmlinkage void car_stage_entry(void) { @@ -55,27 +55,3 @@
run_postcar_phase(&pcf); } - -static void soc_memory_init_params(FSP_M_CONFIG *m_cfg) -{ -} - -void platform_fsp_memory_init_params_cb(FSPM_UPD *mupd, uint32_t version) -{ - const config_t *config = config_of_soc(); - FSP_M_CONFIG *m_cfg = &mupd->FspmConfig; - - mupd->FspmUpdVersion = FSP_UPD_VERSION; - - // ErrorLevel - 0 (disable) to 8 (verbose) - m_cfg->PcdFspMrcDebugPrintErrorLevel = 0; - m_cfg->PcdFspKtiDebugPrintErrorLevel = 0; - - soc_memory_init_params(m_cfg); - - mainboard_memory_init_params(mupd); - - m_cfg->VTdConfig.VTdSupport = config->vtd_support; - m_cfg->VTdConfig.CoherencySupport = config->coherency_support; - m_cfg->VTdConfig.ATS = config->ats_support; -} diff --git a/src/soc/intel/xeon_sp/skx/Kconfig b/src/soc/intel/xeon_sp/skx/Kconfig new file mode 100644 index 0000000..e9c3c6b --- /dev/null +++ b/src/soc/intel/xeon_sp/skx/Kconfig @@ -0,0 +1,69 @@ +## +## SPDX-License-Identifier: GPL-2.0-only +## This file is part of the coreboot project. +## + +if SOC_INTEL_SKYLAKE_SP + +config MAINBOARD_USES_FSP2_0 + bool + default y + +config USE_FSP2_0_DRIVER + def_bool y + depends on MAINBOARD_USES_FSP2_0 + select PLATFORM_USES_FSP2_0 + select UDK_2015_BINDING + select POSTCAR_CONSOLE + select POSTCAR_STAGE + +config FSP_HEADER_PATH + string "Location of FSP headers" + depends on MAINBOARD_USES_FSP2_0 + default "src/vendorcode/intel/fsp/fsp2_0/skylake_sp" + +config MAX_SOCKET + int + default 2 + +# For 2S config, the number of cpus could be as high as +# 2 threads * 20 cores * 2 sockets +config MAX_CPUS + int + default 80 + +config PCR_BASE_ADDRESS + hex + default 0xfd000000 + help + This option allows you to select MMIO Base Address of sideband bus. + +config DCACHE_RAM_BASE + hex + default 0xfe800000 + +config DCACHE_RAM_SIZE + hex + default 0x200000 + +config DCACHE_BSP_STACK_SIZE + hex + default 0x10000 + +config CPU_MICROCODE_CBFS_LOC + hex + default 0xfff0fdc0 + +config CPU_MICROCODE_CBFS_LEN + hex + default 0x7C00 + +config C_ENV_BOOTBLOCK_SIZE + hex + default 0xC000 + +config HEAP_SIZE + hex + default 0x80000 + +endif diff --git a/src/soc/intel/xeon_sp/skx/Makefile.inc b/src/soc/intel/xeon_sp/skx/Makefile.inc new file mode 100644 index 0000000..ee7ecc4 --- /dev/null +++ b/src/soc/intel/xeon_sp/skx/Makefile.inc @@ -0,0 +1,36 @@ +## +## SPDX-License-Identifier: GPL-2.0-only +## This file is part of the coreboot project. +## + +ifeq ($(CONFIG_SOC_INTEL_SKYLAKE_SP),y) + +subdirs-y += ../../../../cpu/intel/microcode +subdirs-y += ../../../../cpu/intel/turbo +subdirs-y += ../../../../cpu/x86/lapic +subdirs-y += ../../../../cpu/x86/mtrr +subdirs-y += ../../../../cpu/x86/tsc +subdirs-y += ../../../../cpu/x86/cache +subdirs-$(CONFIG_HAVE_SMI_HANDLER) += ../../../cpu/x86/smm + +postcar-y += soc_util.c + +romstage-y += soc_util.c +romstage-y += romstage.c +romstage-y += soc_util.c +romstage-y += hob_display.c +romstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c +romstage-$(CONFIG_DISPLAY_HOBS) += hob_display.c + +ramstage-y += soc_util.c +ramstage-y += chip.c +ramstage-y += soc_util.c +ramstage-y += cpu.c +ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c +ramstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c +ramstage-$(CONFIG_DISPLAY_HOBS) += hob_display.c +ramstage-y += hob_display.c + +CPPFLAGS_common += -I$(src)/soc/intel/xeon_sp/skx/include -I$(src)/soc/intel/xeon_sp/skx + +endif ## CONFIG_SOC_INTEL_SKYLAKE_SP diff --git a/src/soc/intel/xeon_sp/acpi.c b/src/soc/intel/xeon_sp/skx/acpi.c similarity index 99% rename from src/soc/intel/xeon_sp/acpi.c rename to src/soc/intel/xeon_sp/skx/acpi.c index 4ca406d..2abdf91 100644 --- a/src/soc/intel/xeon_sp/acpi.c +++ b/src/soc/intel/xeon_sp/skx/acpi.c @@ -880,7 +880,7 @@ acpi_slit_t *slit; acpi_dmar_t *dmar;
- const struct soc_intel_xeon_sp_config *const config = config_of(device); + const struct soc_intel_xeon_sp_skx_config *const config = config_of(device);
/* SRAT */ current = ALIGN(current, 8); diff --git a/src/soc/intel/xeon_sp/acpi/globalnvs.asl b/src/soc/intel/xeon_sp/skx/acpi/globalnvs.asl similarity index 100% rename from src/soc/intel/xeon_sp/acpi/globalnvs.asl rename to src/soc/intel/xeon_sp/skx/acpi/globalnvs.asl diff --git a/src/soc/intel/xeon_sp/acpi/iiostack.asl b/src/soc/intel/xeon_sp/skx/acpi/iiostack.asl similarity index 100% rename from src/soc/intel/xeon_sp/acpi/iiostack.asl rename to src/soc/intel/xeon_sp/skx/acpi/iiostack.asl diff --git a/src/soc/intel/xeon_sp/acpi/pci_irq.asl b/src/soc/intel/xeon_sp/skx/acpi/pci_irq.asl similarity index 100% rename from src/soc/intel/xeon_sp/acpi/pci_irq.asl rename to src/soc/intel/xeon_sp/skx/acpi/pci_irq.asl diff --git a/src/soc/intel/xeon_sp/acpi/uncore.asl b/src/soc/intel/xeon_sp/skx/acpi/uncore.asl similarity index 100% rename from src/soc/intel/xeon_sp/acpi/uncore.asl rename to src/soc/intel/xeon_sp/skx/acpi/uncore.asl diff --git a/src/soc/intel/xeon_sp/acpi/uncore_irq.asl b/src/soc/intel/xeon_sp/skx/acpi/uncore_irq.asl similarity index 100% rename from src/soc/intel/xeon_sp/acpi/uncore_irq.asl rename to src/soc/intel/xeon_sp/skx/acpi/uncore_irq.asl diff --git a/src/soc/intel/xeon_sp/chip.c b/src/soc/intel/xeon_sp/skx/chip.c similarity index 99% rename from src/soc/intel/xeon_sp/chip.c rename to src/soc/intel/xeon_sp/skx/chip.c index 0aa6120..7a737ac 100644 --- a/src/soc/intel/xeon_sp/chip.c +++ b/src/soc/intel/xeon_sp/skx/chip.c @@ -589,8 +589,8 @@ mainboard_silicon_init_params(silupd); }
-struct chip_operations soc_intel_xeon_sp_ops = { - CHIP_NAME("Intel Xeon-SP SOC") +struct chip_operations soc_intel_xeon_sp_skx_ops = { + CHIP_NAME("Intel Skylake-SP") .enable_dev = soc_enable_dev, .init = soc_init, .final = soc_final diff --git a/src/soc/intel/xeon_sp/chip.h b/src/soc/intel/xeon_sp/skx/chip.h similarity index 95% rename from src/soc/intel/xeon_sp/chip.h rename to src/soc/intel/xeon_sp/skx/chip.h index 94726f3..7565d6c 100644 --- a/src/soc/intel/xeon_sp/chip.h +++ b/src/soc/intel/xeon_sp/skx/chip.h @@ -21,7 +21,7 @@ #include <intelblocks/cfg.h> #include <soc/irq.h>
-struct soc_intel_xeon_sp_config { +struct soc_intel_xeon_sp_skx_config { /* Common struct containing soc config data required by common code */ struct soc_intel_common_config common_soc_config;
@@ -86,6 +86,6 @@
extern struct chip_operations soc_intel_xeon_sp_ops;
-typedef struct soc_intel_xeon_sp_config config_t; +typedef struct soc_intel_xeon_sp_skx_config config_t;
#endif diff --git a/src/soc/intel/xeon_sp/cpu.c b/src/soc/intel/xeon_sp/skx/cpu.c similarity index 100% rename from src/soc/intel/xeon_sp/cpu.c rename to src/soc/intel/xeon_sp/skx/cpu.c diff --git a/src/soc/intel/xeon_sp/hob_display.c b/src/soc/intel/xeon_sp/skx/hob_display.c similarity index 100% rename from src/soc/intel/xeon_sp/hob_display.c rename to src/soc/intel/xeon_sp/skx/hob_display.c diff --git a/src/soc/intel/xeon_sp/include/soc/acpi.h b/src/soc/intel/xeon_sp/skx/include/soc/acpi.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/acpi.h rename to src/soc/intel/xeon_sp/skx/include/soc/acpi.h diff --git a/src/soc/intel/xeon_sp/include/soc/cpu.h b/src/soc/intel/xeon_sp/skx/include/soc/cpu.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/cpu.h rename to src/soc/intel/xeon_sp/skx/include/soc/cpu.h diff --git a/src/soc/intel/xeon_sp/include/soc/gpio_soc_defs.h b/src/soc/intel/xeon_sp/skx/include/soc/gpio_soc_defs.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/gpio_soc_defs.h rename to src/soc/intel/xeon_sp/skx/include/soc/gpio_soc_defs.h diff --git a/src/soc/intel/xeon_sp/include/soc/irq.h b/src/soc/intel/xeon_sp/skx/include/soc/irq.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/irq.h rename to src/soc/intel/xeon_sp/skx/include/soc/irq.h diff --git a/src/soc/intel/xeon_sp/include/soc/msr.h b/src/soc/intel/xeon_sp/skx/include/soc/msr.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/msr.h rename to src/soc/intel/xeon_sp/skx/include/soc/msr.h diff --git a/src/soc/intel/xeon_sp/include/soc/nvs.h b/src/soc/intel/xeon_sp/skx/include/soc/nvs.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/nvs.h rename to src/soc/intel/xeon_sp/skx/include/soc/nvs.h diff --git a/src/soc/intel/xeon_sp/include/soc/pci_devs.h b/src/soc/intel/xeon_sp/skx/include/soc/pci_devs.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/pci_devs.h rename to src/soc/intel/xeon_sp/skx/include/soc/pci_devs.h diff --git a/src/soc/intel/xeon_sp/include/soc/ramstage.h b/src/soc/intel/xeon_sp/skx/include/soc/ramstage.h similarity index 100% rename from src/soc/intel/xeon_sp/include/soc/ramstage.h rename to src/soc/intel/xeon_sp/skx/include/soc/ramstage.h diff --git a/src/soc/intel/xeon_sp/skx/include/soc/soc_util.h b/src/soc/intel/xeon_sp/skx/include/soc/soc_util.h new file mode 100644 index 0000000..8ba4b29 --- /dev/null +++ b/src/soc/intel/xeon_sp/skx/include/soc/soc_util.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* This file is part of the coreboot project. */ + +#ifndef _SOC_UTIL_H_ +#define _SOC_UTIL_H_ + +#include <hob_iiouds.h> +#include <hob_memmap.h> +#include <arch/acpi.h> +#include <soc/util.h> + +struct iiostack_resource { + uint8_t no_of_stacks; + STACK_RES res[CONFIG_MAX_SOCKET * MAX_IIO_STACK]; +}; + +uintptr_t get_tolm(uint32_t bus); +void get_tseg_base_lim(uint32_t bus, uint32_t *base, uint32_t *limit); +uintptr_t get_cha_mmcfg_base(uint32_t bus); +uint32_t top_of_32bit_ram(void); // Top of 32bit usable memory + +uint32_t pci_read_mmio_reg(int bus, uint32_t dev, uint32_t func, int offset); + +uint32_t get_socket_stack_busno(uint32_t socket, uint32_t stack); +void get_iiostack_info(struct iiostack_resource *info); + +int get_threads_per_package(void); +int get_platform_thread_count(void); +void get_core_thread_bits(uint32_t *core_bits, uint32_t *thread_bits); + +unsigned int get_srat_memory_entries(acpi_srat_mem_t *srat_mem); +void get_cpu_info_from_apicid(uint32_t apicid, uint32_t core_bits, + uint32_t thread_bits, uint8_t *package, uint8_t *core, uint8_t *thread); + +void xeonsp_init_cpu_config(void); +void set_bios_init_completion(void); +void config_reset_cpl3_csrs(void); + +#endif /* _SOC_UTIL_H_ */ diff --git a/src/soc/intel/xeon_sp/skx/romstage.c b/src/soc/intel/xeon_sp/skx/romstage.c new file mode 100644 index 0000000..947930f --- /dev/null +++ b/src/soc/intel/xeon_sp/skx/romstage.c @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* This file is part of the coreboot project. */ + +#include <arch/romstage.h> +#include <cbmem.h> +#include <console/console.h> +#include <cpu/x86/mtrr.h> +#include <intelblocks/rtc.h> +#include <soc/romstage.h> +#include <soc/soc_util.h> + +#include "chip.h" + +void platform_fsp_memory_init_params_cb(FSPM_UPD *mupd, uint32_t version) +{ + const config_t *config = config_of_soc(); + FSP_M_CONFIG *m_cfg = &mupd->FspmConfig; + + mupd->FspmUpdVersion = FSP_UPD_VERSION; + + // ErrorLevel - 0 (disable) to 8 (verbose) + m_cfg->PcdFspMrcDebugPrintErrorLevel = 0; + m_cfg->PcdFspKtiDebugPrintErrorLevel = 0; + + mainboard_memory_init_params(mupd); + + m_cfg->VTdConfig.VTdSupport = config->vtd_support; + m_cfg->VTdConfig.CoherencySupport = config->coherency_support; + m_cfg->VTdConfig.ATS = config->ats_support; +} diff --git a/src/soc/intel/xeon_sp/soc_util.c b/src/soc/intel/xeon_sp/skx/soc_util.c similarity index 90% rename from src/soc/intel/xeon_sp/soc_util.c rename to src/soc/intel/xeon_sp/skx/soc_util.c index 6ba9f8e..edacafd 100644 --- a/src/soc/intel/xeon_sp/soc_util.c +++ b/src/soc/intel/xeon_sp/skx/soc_util.c @@ -30,6 +30,7 @@ #include <soc/pcr_ids.h> #include <soc/soc_util.h> #include <stdlib.h> +#include <soc/util.h> #include <timer.h>
/* @@ -69,24 +70,6 @@ return addr; }
-/* - * Get Socket 0 CPUBUSNO(0), CPUBUSNO(1) PCI bus numbers UBOX (B0:D8:F2:Offset_CCh) - * TODO: D0h - */ -void get_cpubusnos(uint32_t *bus0, uint32_t *bus1, uint32_t *bus2, uint32_t *bus3) -{ - uint32_t bus = pci_io_read_config32(PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV, - UBOX_DECS_FUNC), UBOX_DECS_CPUBUSNO_CSR); - if (bus0) - *bus0 = (bus & 0xff); - if (bus1) - *bus1 = (bus >> 8) & 0xff; - if (bus2) - *bus2 = (bus >> 16) & 0xff; - if (bus3) - *bus3 = (bus >> 24) & 0xff; -} - uint32_t top_of_32bit_ram(void) { uintptr_t mmcfg, tolm; @@ -153,42 +136,6 @@ return hob->PlatformData.CpuQpiInfo[socket].StackBus[stack]; }
-/* bus needs to be of size 6 (MAX_IIO_STACK) */ -void get_stack_busnos(uint32_t *bus) -{ - uint32_t reg1, reg2; - - reg1 = pci_mmio_read_config32(PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV, UBOX_DECS_FUNC), - 0xcc); - reg2 = pci_mmio_read_config32(PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV, UBOX_DECS_FUNC), - 0xd0); - - for (int i = 0; i < 4; ++i) - bus[i] = ((reg1 >> (i * 8)) & 0xff); - for (int i = 0; i < 2; ++i) - bus[4+i] = ((reg2 >> (i * 8)) & 0xff); -} - -void unlock_pam_regions(void) -{ - uint32_t bus1 = 0; - uint32_t pam0123_unlock_dram = 0x33333330; - uint32_t pam456_unlock_dram = 0x00333333; - - get_cpubusnos(NULL, &bus1, NULL, NULL); - pci_io_write_config32(PCI_DEV(bus1, SAD_ALL_DEV, SAD_ALL_FUNC), - SAD_ALL_PAM0123_CSR, pam0123_unlock_dram); - pci_io_write_config32(PCI_DEV(bus1, SAD_ALL_DEV, SAD_ALL_FUNC), - SAD_ALL_PAM456_CSR, pam456_unlock_dram); - - uint32_t reg1 = pci_io_read_config32(PCI_DEV(bus1, SAD_ALL_DEV, - SAD_ALL_FUNC), SAD_ALL_PAM0123_CSR); - uint32_t reg2 = pci_io_read_config32(PCI_DEV(bus1, SAD_ALL_DEV, - SAD_ALL_FUNC), SAD_ALL_PAM456_CSR); - printk(BIOS_DEBUG, "%s:%s pam0123_csr: 0x%x, pam456_csr: 0x%x\n", - __FILE__, __func__, reg1, reg2); -} - /* return 1 if command timed out else 0 */ static uint32_t wait_for_bios_cmd_cpl(pci_devfn_t dev, uint32_t reg, uint32_t mask, uint32_t target) diff --git a/src/soc/intel/xeon_sp/upd_display.c b/src/soc/intel/xeon_sp/skx/upd_display.c similarity index 100% rename from src/soc/intel/xeon_sp/upd_display.c rename to src/soc/intel/xeon_sp/skx/upd_display.c diff --git a/src/soc/intel/xeon_sp/uncore.c b/src/soc/intel/xeon_sp/uncore.c index 34f00d8..c72c6c3 100644 --- a/src/soc/intel/xeon_sp/uncore.c +++ b/src/soc/intel/xeon_sp/uncore.c @@ -21,7 +21,8 @@ #include <soc/iomap.h> #include <soc/pci_devs.h> #include <soc/ramstage.h> -#include <soc/soc_util.h> +#include <soc/util.h> +#include <fsp/util.h>
struct map_entry { uint32_t reg; diff --git a/src/soc/intel/xeon_sp/util.c b/src/soc/intel/xeon_sp/util.c new file mode 100644 index 0000000..cbac1ad --- /dev/null +++ b/src/soc/intel/xeon_sp/util.c @@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* This file is part of the coreboot project. */ + +#include <console/console.h> +#include <device/pci.h> +#include <soc/pci_devs.h> +#include <soc/util.h> + +void get_stack_busnos(uint32_t *bus) +{ + uint32_t reg1, reg2; + + reg1 = pci_mmio_read_config32(PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV, UBOX_DECS_FUNC), + 0xcc); + reg2 = pci_mmio_read_config32(PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV, UBOX_DECS_FUNC), + 0xd0); + + for (int i = 0; i < 4; ++i) + bus[i] = ((reg1 >> (i * 8)) & 0xff); + for (int i = 0; i < 2; ++i) + bus[4+i] = ((reg2 >> (i * 8)) & 0xff); +} + +void unlock_pam_regions(void) +{ + uint32_t bus1 = 0; + uint32_t pam0123_unlock_dram = 0x33333330; + uint32_t pam456_unlock_dram = 0x00333333; + + get_cpubusnos(NULL, &bus1, NULL, NULL); + pci_io_write_config32(PCI_DEV(bus1, SAD_ALL_DEV, SAD_ALL_FUNC), + SAD_ALL_PAM0123_CSR, pam0123_unlock_dram); + pci_io_write_config32(PCI_DEV(bus1, SAD_ALL_DEV, SAD_ALL_FUNC), + SAD_ALL_PAM456_CSR, pam456_unlock_dram); + + uint32_t reg1 = pci_io_read_config32(PCI_DEV(bus1, SAD_ALL_DEV, + SAD_ALL_FUNC), SAD_ALL_PAM0123_CSR); + uint32_t reg2 = pci_io_read_config32(PCI_DEV(bus1, SAD_ALL_DEV, + SAD_ALL_FUNC), SAD_ALL_PAM456_CSR); + printk(BIOS_DEBUG, "%s:%s pam0123_csr: 0x%x, pam456_csr: 0x%x\n", + __FILE__, __func__, reg1, reg2); +} + +void get_cpubusnos(uint32_t *bus0, uint32_t *bus1, uint32_t *bus2, uint32_t *bus3) +{ + uint32_t bus = pci_io_read_config32(PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV, + UBOX_DECS_FUNC), UBOX_DECS_CPUBUSNO_CSR); + if (bus0) + *bus0 = (bus & 0xff); + if (bus1) + *bus1 = (bus >> 8) & 0xff; + if (bus2) + *bus2 = (bus >> 16) & 0xff; + if (bus3) + *bus3 = (bus >> 24) & 0xff; +}
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
Patch Set 11:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39601/6/src/soc/intel/xeon_sp/util.... File src/soc/intel/xeon_sp/util.c:
https://review.coreboot.org/c/coreboot/+/39601/6/src/soc/intel/xeon_sp/util.... PS6, Line 60: uint32_t bus = pci_io_read_config32(PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV, Is there a reason to use PCI IO cfg (0xcf8/0xcfc) here? Same question for function above.
Andrey Petrov has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39601 )
Change subject: soc/intel/xeon_sp: Refactor code to allow for additional CPUs types ......................................................................
Patch Set 11:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39601/6/src/soc/intel/xeon_sp/util.... File src/soc/intel/xeon_sp/util.c:
https://review.coreboot.org/c/coreboot/+/39601/6/src/soc/intel/xeon_sp/util.... PS6, Line 60: uint32_t bus = pci_io_read_config32(PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV,
Is there a reason to use PCI IO cfg (0xcf8/0xcfc) here? Same question for function above.
I think the code tries to be careful because MMIO may be not set up properly yet (this is not the case here because it is done in FSP-T). However, certain UBOX registers are meant to only be used through CF8 during 'early bios init', because they are used to set up MMIO mapping. So it is catch-22