summaryrefslogtreecommitdiffstats
path: root/src/soc/intel
Commit message (Collapse)AuthorAgeFilesLines
...
* soc/intel/alderlake: Unselect USB4 and TCSS options for ADL-SMichał Żygowski2022-06-162-5/+10
| | | | | | | | | | | Alder Lake-S CPUs do not have TCSS and USB4 devices. Unselect them. Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com> Change-Id: Ifc643d440107754dfe1a0844964f70de670cb1f1 Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63500 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* soc/intel/alderlake/fsp_params.c: Add VccIn Aux Imon IccMax for ADL-SMichał Żygowski2022-06-161-1/+7
| | | | | | | | | | Based on DOC #619501. Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com> Change-Id: Ia95404e717787edbdb67c9e584e749526b973427 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63839 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* soc/intel/adl: Add missing claimed memory regionsEran Mitrani2022-06-152-2/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Alder Lake chipset has several more reserved memory regions that are unavailable to the resource allocator than are currently marked as such in the system agent code. This CL adds the following regions (documented in Intel docs #626540, #619503): 1. TSEG 2. GSM 3. DSM 4. PCH_RESERVED 5. CRAB_ABORT 6. APIC 7. TPM 8. LT_SECURITY Claimed regions before this change: ======================================================== base 0 size a0000 // 0 - > 0xa0000 base a0000 size 20000 // legacy VGA base c0000 size 40000 // RAM base c0000 size 76f40000 // 0xc0000 -> top_of_ram base 77000000 size 9400000 // top_of_ram -> TOLUD base c0000000 size 10000000 // PCIEXBAR base f8000000 size 2000000 // MMSPI base fb000000 size 1000 // REGBAR base fed80000 size 4000 // EDRAMBAR base fed84000 size 1000 // TBT0BAR base fed85000 size 1000 // TBT1BAR base fed86000 size 1000 // TBT2BAR base fed87000 size 1000 // TBT3BAR base fed90000 size 1000 // GFXVTBAR base fed91000 size 1000 // VTVC0BAR base fed92000 size 1000 // IPUVTBAR base feda0000 size 1000 // DMIBAR base feda1000 size 1000 // EPBAR base fedc0000 size 20000 // MCHBAR base 100000000 size 17fc00000 // 4GiB -> TOUUD Claimed regions with this change: ======================================================== base 0 size a0000 // 0 - > 0xa0000 base a0000 size 20000 // legacy VGA base c0000 size 40000 // RAM base c0000 size 76f40000 // 0xc0000 -> top_of_ram base 77000000 size 9400000 // top_of_ram -> TOLUD base 7b800000 size 800000 // TSEG base 7c000000 size 800000 // GSM base 7c800000 size 3c00000 // DSM base c0000000 size 10000000 // PCIEXBAR base f8000000 size 2000000 // MMSPI base fb000000 size 1000 // REGBAR base fc800000 size 2000000 // PCH_RESERVED base feb00000 size 80000 // CRAB_ABORT base fec00000 size 100000 // APIC base fed40000 size 10000 // TPM base fed50000 size 20000 // LT_SECURITY base fed80000 size 4000 // EDRAMBAR base fed84000 size 1000 // TBT0BAR base fed85000 size 1000 // TBT1BAR base fed86000 size 1000 // TBT2BAR base fed87000 size 1000 // TBT3BAR base fed90000 size 1000 // GFXVTBAR base fed91000 size 1000 // VTVC0BAR base fed92000 size 1000 // IPUVTBAR base feda0000 size 1000 // DMIBAR base feda1000 size 1000 // EPBAR base fedc0000 size 20000 // MCHBAR base 100000000 size 17fc00000 // 4GiB -> TOUUD BUG=b:149830546 BRANCH=firmware-brya-14505.B TEST='emerge-brya coreboot chromeos-bootimage' builds correctly. Tested on an Anahera device which successfully boots to ChromeOS with kernel version 5.10.109-15688-g857e654d1705. Also ran dmseg, and saw the added regions in e820 prints. Signed-off-by: Eran Mitrani <mitrani@google.com> Change-Id: I058a5c1cc59703e35ceddb8a7e26fb22a6a2b75e Signed-off-by: Eran Mitrani <mitrani@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/65072 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* soc/intel/common: support for configurable memory regions claimed by SAEran Mitrani2022-06-153-11/+39
| | | | | | | | | | | | | | | | | see https://review.coreboot.org/c/coreboot/+/65072/8 BUG=b:149830546 BRANCH=firmware-brya-14505.B TEST='emerge-brya coreboot chromeos-bootimage' builds correctly. Tested on an Anahera device which successfully boots to ChromeOS with kernel version 5.10.109-15688-g857e654d1705. Change-Id: I80df95f9146934d6a2d23e525c22be3a9a7e2b9f Signed-off-by: Eran Mitrani <mitrani@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64677 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Nick Vaccaro <nvaccaro@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* soc/intel/alderlake: remove unnecessary test conditionJeremy Compostella2022-06-151-6/+2
| | | | | | | | | | | | | | mch_id is set to zero and then unnecessarily tested. TEST=build and boot image on ADL RVP board Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Change-Id: I20734e1638714027b976043b3a0457cbf3cd8442 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65121 Reviewed-by: Bora Guvendik <bora.guvendik@intel.com> Reviewed-by: Sridhar Siricilla <sridhar.siricilla@intel.com> Reviewed-by: Cliff Huang <cliff.huang@intel.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* soc/intel/alderlake: remove unnecessary MSR definitionJeremy Compostella2022-06-151-1/+0
| | | | | | | | | | | | MSR_VR_MISC_CONFIG2 is not used by AlderLake code. TEST=compilation check Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Change-Id: I313acf01c534d0d32620a9dedba7cf3b304ed2ed Reviewed-on: https://review.coreboot.org/c/coreboot/+/65120 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Bora Guvendik <bora.guvendik@intel.com>
* soc/intel/alderlake/Kconfig: Unselect IPU for ADL-SMichał Żygowski2022-06-151-1/+1
| | | | | | | | | | Alder Lake S CPUs do not have IPU device. Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com> Change-Id: I79b084273f407119d903ed6f0cadf0084e8dda6a Reviewed-on: https://review.coreboot.org/c/coreboot/+/63502 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* soc/intel/common/acpi: Fix warning in ASLVarshit B Pandya2022-06-151-31/+31
| | | | | | | | | | | | | | | | | | | Warnings are treated as errors in build. UBAR is declared inside APRT method which throws warning as follows "Static OperationRegion should be declared outside control method" Move UBAR outside APRT method to fix warning. TEST=build brya with following changes without any warnings 1. Select ACPI_CONSOLE 2. Include <soc/intel/common/acpi/acpi_debug.asl> 3. Add APRT function in any asl file. Signed-off-by: Varshit B Pandya <varshit.b.pandya@intel.com> Change-Id: I40c676fd0bbd529bcbded18dd248b918f47324d9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62367 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: Maulik V Vaghela <maulik.v.vaghela@intel.com>
* soc/intel/cmn/cpu: API to initialize core PRMRRSubrata Banik2022-06-143-0/+32
| | | | | | | | | | | | | | | | | This patch implements API to sync between core PRMRR(Processor Reserved Memory Range Registers). Read PRMRR base and limit value from BSP and apply it on the rest of the cores. BUG=b:233199592 TEST=Build and boot google/taeko to ChromeOS. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I720669139429afc3d8c8d15c0ce15f1524f22e4c Reviewed-on: https://review.coreboot.org/c/coreboot/+/64976 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tarun Tuli <taruntuli@google.com>
* soc/intel/common: Remove use of CPUID_EXTENDED_CPU_TOPOLOGY_V2Ronak Kanabar2022-06-141-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In x86 processor as per Software Developer's manual there are 2 ways to get CPU topology by querying the processor. BIOS can use CPUID instruction using CPUID_EXTENDED_CPU_TOPOLOGY (0x0B) as input or CPUID_EXTENDED_CPU_TOPOLOGY_V2 (0x1F) as an input. Both will return valid CPU topology data. While CPUID_EXTENDED_CPU_TOPOLOGY (0x0B) returns data related to number of threads, core and package, CPUID_EXTENDED_CPU_TOPOLOGY_V2 (0x1F) provides more granular information regarding Die, package etc. coreboot uses V2 to in order to query and return CPU topology data as of now since that's the highest instruction of CPUID which is supported, there is a mismatch in the way FSP processes the data. FSP queries coreboot MP services to get CPU topology data which uses structure which is either compatible with CPUID_EXTENDED_CPU_TOPOLOGY or CPUID_EXTENDED_CPU_TOPOLOGY_V2. Since coreboot returns V2 data in structure which is expecting data for CPUID_EXTENDED_CPU_TOPOLOGY, there is hang observed on ADL_N CPUs. To solve this problem coreboot should assign CPUID_EXTENDED_CPU_TOPOLOGY data to processor_info_buffer->Location structure so remove use of CPUID_EXTENDED_CPU_TOPOLOGY_V2 Ref EDK2 code: https://github.com/tianocore/edk2/tree/edk2-stable202202 Files: MdePkg/Include/Protocol/MpService.h#L182 UefiCpuPkg/Library/MpInitLib/MpLib.c#L2127 UefiCpuPkg/Library/MpInitLib/MpLib.c#L2120 Ref doc: Software Developer’s Manual volume 3 CH 8.9 BUG=b:220652104 TEST=Build and boot ADL-N RVP with debug FSP and verify CPU topology value and observe system boots (no hang). Change-Id: I1e6832fb03fcc59d33df0ba1664019727185d10a Signed-off-by: Ronak Kanabar <ronak.kanabar@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/62323 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Subrata Banik <subratabanik@google.com>
* soc/intel/lpc: Set up default LPC decode rangesArthur Heymans2022-06-122-0/+82
| | | | | | | | | | | | Intel LPC devices have generic and fix IO decode ranges. This CL is smarter about using generic ones, by using the fixed ones first. Change-Id: Ifd98bcc639ee08d068956a33b0e12cc70211ca2d Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/65097 Reviewed-by: Marvin Drees <marvin.drees@9elements.com> Reviewed-by: Christian Walter <christian.walter@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* soc/intel/alderlake: Add Kconfig for Raptor LakeBora Guvendik2022-06-101-0/+7
| | | | | | | | | | | | | | | | | | | Until FSP for RPL and ADL align, mainboards using RPL should select SOC_INTEL_RAPTORLAKE and SOC_INTEL_ALDERLAKE_PCH_* together. Currently, ADL FSP headers and RPL FSP headers differ. Use RPL FSP header with Raptor Lake silicon. This code can be removed once ADL and RPL start using the same FSP. BUG=b:229134437 BRANCH=firmware-brya-14505.B TEST=build adlrvp_rpl_ext_ec Signed-off-by: Bora Guvendik <bora.guvendik@intel.com> Change-Id: Iaf95352b9cafb81f23522bcf63753d199c0420eb Reviewed-on: https://review.coreboot.org/c/coreboot/+/65051 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
* soc/intel/apollolake: Let coreboot set the VendorID and Subsystem IDSean Rhodes2022-06-101-0/+9
| | | | | | | | | | | | | | | | | Set all FSP S UPDs that set IDs to 0, which allows them to be set by coreboot. Tested on StarLite Mk IV and LPC now has the correct device ID of 0x31e8, where previously it had 0x7270. The UPDs differ APL and GLK, but the ones configured in this patch have been there since their initial releases. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I034c9dc9d81c4d775dfff0994c9a6be823689b1c Reviewed-on: https://review.coreboot.org/c/coreboot/+/65021 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* soc/intel/alderlake: Drop enable_bios_reset_cpl() functionSubrata Banik2022-06-091-5/+0
| | | | | | | | | | | | | | | | This patch drops enable_bios_reset_cpl() as FSP sets the BIOS Reset CPL before performing Graphics PM init (as part of FSP-S), hence, enable_bios_reset_cpl() function getting called inside systemagent.c is meaningless. Also, drop 1ms delay after setting the BIOS reset CPL. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I87beb444d3910f212a5a627cb449031db6cae38d Reviewed-on: https://review.coreboot.org/c/coreboot/+/64837 Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Reviewed-by: Tarun Tuli <taruntuli@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* soc/intel/cmn/mp_init: Reload microcode patch before post_cpus_init()Subrata Banik2022-06-091-0/+3
| | | | | | | | | | | | | | | This patch provides an option for CPU programming where coreboot expected to load second microcode patch after BIOS Done bit is set and before setting the BIOS Reset CPL bit. BUG=b:233199592 TEST=Build and boot google/taeko to ChromeOS. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I426b38cb1200e60398bc89515838e49ce0a98f06 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64836 Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* soc/intel/alderlake: Add config option for S3 ACPISean Rhodes2022-06-095-1/+61
| | | | | | | | | | | | | Add Kconfig option `SOC_INTEL_ALDERLAKE_S3` which will adjust the ACPI to not offer D3Cold when using S3. This patch is the Alder Lake equivalent of CB:59024. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I04df8e106f9d53337b9eb5d2b9041b44a0e36684 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64560 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* soc/intel/apollolake: Correct the maximum number of Heci devicesSean Rhodes2022-06-091-1/+1
| | | | | | | | | | Both APL and GLK have 3 Heci devices. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I7dc7afb4d2906838a478083b466b36aa78ec49a8 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64859 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Subrata Banik <subratabanik@google.com>
* soc/intel/alderlake: add support for external source clockCliff Huang2022-06-091-1/+7
| | | | | | | | | | | | | | | Support up to 10 PCIe source clock out, including source clock out 7, 8, 9. This allows boards to use source clock 7, 8, 9. BUG=b:233252409 BRANCH=firmware-brya-14505.B Signed-off-by: Cliff Huang <cliff.huang@intel.corp-partner.google.com> Change-Id: I0296974fb8557de1edea7f9ca2d96db0afd8a743 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63943 Reviewed-by: Bora Guvendik <bora.guvendik@intel.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
* soc/intel/alderlake: Add support for PCIe slot & device detect timeoutCliff Huang2022-06-092-0/+8
| | | | | | | | | | | | | | | | | | | 1. add timeout for root port detection and pass to FSP. 2. add 'slot implemented' flag and pass to FSP. 3. PcieRpSlotImplemented needs to be set when the root port is set to hotplug. There is an assertion in FSP checking this. 4. PcieRpSlotImplemented is updated only when it is built-in as it is default to slot implemented in FSP. BRANCH=firmware-brya-14505.B Signed-off-by: Cliff Huang <cliff.huang@intel.com> Change-Id: I13feb1d2d67eaba634a3e700685132fba39e1525 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63942 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Anil Kumar K <anil.kumar.k@intel.com> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
* soc/intel/cannonlake/acpi: Replace LLessEqual(a,b) with ASL 2.0 syntaxFelix Singer2022-06-092-9/+9
| | | | | | | | | | Replace `LLessEqual(a, b)` with `a <= b`. Change-Id: Ib00f363b48295ed1c000a839f54d5ea5dc2b88e2 Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/60706 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems>
* soc/intel/cannonlake/acpi: Replace LNotEqual(a,b) with ASL 2.0 syntaxFelix Singer2022-06-092-2/+2
| | | | | | | | | | Replace `LNotEqual(a, b)` with `a != b`. Change-Id: I12c855437a581beade2d218b8f710cf1b32cb841 Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/60703 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems>
* soc/intel/cannonlake/acpi: Replace LGreaterEqual(a,b) with ASL 2.0 syntaxFelix Singer2022-06-093-11/+11
| | | | | | | | | | Replace `LGreaterEqual(a, b)` with `a >= b`. Change-Id: Ic9836acb4d32f2ce30c3c6d488bc22ddc64bf365 Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/60688 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems>
* soc/intel/cannonlake/acpi: Replace LEqual(a,b) with ASL 2.0 syntaxFelix Singer2022-06-092-12/+12
| | | | | | | | | | Replace `LEqual(a, b)` with `a == b`. Change-Id: I844d5d2fdf0a84171385054cf7c7ca222d73c0fc Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/60664 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems>
* soc/intel/cmn/mp_init: Create helper function to load microcodeSubrata Banik2022-06-071-4/+8
| | | | | | | | | | | | | | | This patch creates a helper function named `initialize_microcode()` to load microcode and ease for all function to peform loading microcode using this helper function. BUG=b:233199592 TEST=Build and boot google/taeko to ChromeOS. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I7155fc2da7383629930ce147a90ac582782fa5ae Reviewed-on: https://review.coreboot.org/c/coreboot/+/64835 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* soc/intel/cmn/block/cpu: Set BIOS_DONE on all CPUsSubrata Banik2022-06-072-0/+18
| | | | | | | | | | | | | | | | | | | | | | As per Intel Processor EDS, BIOS_DONE bit needs to be set on all CPUs via MSR. Also, implement a function to perform any SoC recommended CPU programming prior to post CPUs init. At present calling `cpu_soc_bios_done()` for all CPUs from `before_post_cpus_init()`. Note: It is expected that `before_post_cpus_init()` will be extended with other CPU programming recommendations in follow up patches, for example: reload microcode patch etc. BUG=b:233199592 TEST=Build and boot google/taeko to ChromeOS. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I8066cd724c9f15d259aeb23f3aa71a2d224d5340 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64834 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* soc/intel/cmn/cse: Implement heci_init() to initialize HECI devicesSubrata Banik2022-06-072-14/+47
| | | | | | | | | | | | | | | | This patch implements heci_init() API that perform initialization of all HECI devices as per MAX_HECI_DEVICES config. BUG=none TEST=Able to build and boot google/taeko with this change. No CSE error observed with `heci_init()` called from romstage. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: Ia25e18a20cc749fc7eee39b0b591d41540fc14c9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64855 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
* soc/intel/meteorlake: Refactor bootblock SoC programming codeSubrata Banik2022-06-062-16/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch ensures the IP initialization being done as part of MTL bootblock code is able to complete the bootblock phase without any visible hang. The re-ordering in the MTL bootblock SoC programming is required to ensure the SA early initialization is taking place prior to performing any PCI Read/Write operation (like P2SB bar enabling for IOE die etc.). Additionally, Fast SPI init takes place prior to enabling ROM caching etc. BUG=b:224325352 TEST= Able to build and start booting the MTL simics. Without this change, the code execution is stuck as below: [NOTE ]  coreboot-4.16-1236-g856464f162-dirty Sun May 29 15:32:20 UTC 2022 bootblock starting (log level: 8) [DEBUG]  CPU: Intel(R) Core(TM) i7 CPU (server)     @ 2.00GHz [DEBUG]  CPU: ID a06a0, MeteorLake A0, ucode: 80000018 [DEBUG]  CPU: AES supported, TXT supported, VT supported [DEBUG]  MCH: device id 7d02 (rev 00) is MeteorLake P [DEBUG]  PCH: device id 7e01 (rev 00) is MeteorLake SOC [DEBUG]  IGD: device id ffff (rev ff) is Unknown [INFO ]  PMC: Using default GPE route. [INFO ]  VBNV: CMOS invalid, restoring from flash [ERROR]  init_vbnv: failed to locate NVRAM [EMERG]  Cannot locate primary CBFS Able to detect the Flash and reading the SPI flash layout in proper with this change as below: [NOTE ]  coreboot-4.16-1236-g856464f162-dirty Sun May 29 15:32:20 UTC 2022 bootblock starting (log level: 8) [DEBUG]  CPU: Intel(R) Core(TM) i7 CPU (server)     @ 2.00GHz [DEBUG]  CPU: ID a06a0, MeteorLake A0, ucode: 80000018 [DEBUG]  CPU: AES supported, TXT supported, VT supported [DEBUG]  MCH: device id 7d02 (rev 00) is MeteorLake P [DEBUG]  PCH: device id 7e01 (rev 00) is MeteorLake SOC␛␛[DEBUG]  IGD: device id ffff (rev ff) is Unknown [INFO ]  PMC: Using default GPE route. [INFO ]  VBNV: CMOS invalid, restoring from flash [DEBUG]  FMAP: Found "FLASH" version 1.1 at 0x1804000. [DEBUG]  FMAP: base = 0x0 size = 0x2000000 #areas = 33 [DEBUG]  FMAP: area RW_NVRAM found @ 112b000 (24576 bytes) [INFO ]  SF: Detected 00 0000 with sector size 0x1000, total 0x2000000 Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I8485b195f77225d8870589ff2e4d3dbdc8931f0a Reviewed-on: https://review.coreboot.org/c/coreboot/+/64793 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tarun Tuli <taruntuli@google.com>
* soc/intel/meteorlake: Increase PRERAM_CBMEM_CONSOLE_SIZE to 8KBSubrata Banik2022-06-061-1/+1
| | | | | | | | | | | | | | | | This patch increases PRERAM_CBMEM_CONSOLE_SIZE from 5KB to 8KB to fix cbmem buffer overflow issue. Test=Boot MTL simics and check cbmem -c | grep 'CBFS: Found' lists all stages. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I5dc5d5b99003b59b2262bd1e4eb5ccb11d721195 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64791 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Tarun Tuli <taruntuli@google.com>
* soc/intel/mtl: Do initial Meteor Lake SoC commit till bootblockRavi Sarawadi2022-06-0614-0/+1028
| | | | | | | | | | | | | | | | | | | | Base code is based of Intel Alder Lake SOC code. List of changes: 1. Add required Meteor Lake SoC programming till bootblock 2. Include only required headers into include/soc 3. Include MTL-P related DID, BDF 4. Ref: Processor EDS documents vol1 #621483, vol2 #640858 TEST= Build 'util/abuild/abuild -p none -t google/rex -a -c max'. Signed-off-by: Ravi Sarawadi <ravishankar.sarawadi@intel.com> Change-Id: I26479fcc3a3f9c6f8ebf5f198ab0809f0b4a2cc4 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62772 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* soc/intel/elkhartlake: Remove board related vboot kconfigs from socLean Sheng Tan2022-06-051-2/+0
| | | | | | | | | | | | | | Since the non-volatile storage as it handles VBNV storage in either flash or CMOS, is chosen based on board design, removing VBOOT_VBNV_CMOS & VBOOT_VBNV_CMOS_BACKUP_TO_FLASH from EHL soc kconfig. Will add the option to EHL CRB mainboard kconfig later. Signed-off-by: Lean Sheng Tan <sheng.tan@9elements.com> Change-Id: I97fb7017bff7751d64571d1a8ee7c8b9e2771731 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64473 Reviewed-by: Praveen HP <praveen.hodagatta.pranesh@intel.com> Reviewed-by: Werner Zeh <werner.zeh@siemens.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* soc/intel/cmn/cse: Fix return type for `devfn`Subrata Banik2022-06-041-1/+1
| | | | | | | | | | | | | | | | This patch fixes the return type for `devfn` variable inside heci_set_to_d0i3(). `PCI_DEVFN` macro returns `unsigned int` instead of `pci_devfn_t`. TEST=Able to build and boot to ChromeOS without any failure. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: Ib3a575aa7d71cbe6932e823917b57c5558387433 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64877 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Reviewed-by: Sean Rhodes <sean@starlabs.systems>
* soc/intel: Rename heci_init to cse_initSubrata Banik2022-06-049-11/+15
| | | | | | | | | | | | | | | | | This patch renames heci_init() to cse_init() as HECI initialization should have a bigger scope than just initializing the CSE (a.k.a HECI1 alone). BUG=none TEST=Able to build and boot google/taeko. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: Ic7edd55ccdcd70b244615fa06f81803a0ae6ce80 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64854 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Reviewed-by: Sean Rhodes <sean@starlabs.systems>
* drivers/wifi: Move MTL Magnetar CNVi DIDs from SoC to generic driverSubrata Banik2022-06-031-4/+0
| | | | | | | | | | | | | | | | | | | | | This patch removes the MTL CNVi DIDs macros from IA common code and is added into the generic wifi driver. As per Intel Connectivity Platform BIOS Guide, Connectivity Controller IP for MTL-P is `Magnetar` and supported CRF is `Typhoon Peak 2`. Previously Garfield Peak DIDs for Alder Lake SoC also added similarly to generic wifi drivers. BUG=b:224325352 TEST=Able to build and boot on MTL emulator. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: Ib98762749c71f63df3e8d03be910539469359c68 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64592 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tarun Tuli <taruntuli@google.com> Reviewed-by: Wonkyu Kim <wonkyu.kim@intel.com>
* intelblocks/gpio.c: Handle NULL return values from child functionsMaulik V Vaghela2022-06-031-1/+13
| | | | | | | | | | | | | | | | | | | | gpio_configure_pad function gets called for most of the GPIO configuration for all the boards. This function is not handling NULL pointers properly which can cause exception in CPU. This patch fixes the handling and function is able to return early in case the NULL pointer is passed or any subsequent child function calls return NULL. BUG=None BRANCH=None TEST=Compilation works fine for all Alder Lake boards. Change-Id: I97fad72cdd92f70c7c5e6fdd23fbecf535a6e388 Signed-off-by: Maulik V Vaghela <maulik.v.vaghela@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64857 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
* soc/intel/elkhartlake: Select SOC_INTEL_RAPL_DISABLE_VIA_MCHBARUwe Poeche2022-06-031-0/+1
| | | | | | | | | | | | | | | | Since of moving RAPL disabling to common code a config switch is available to select that RAPL disabling has to be done via MCHBAR. This patch selects the switch for EHL. Test: Boot mc_ehl1 and ensure that relevant bits in MCHBAR are the same as before the patch. Change-Id: I1d0b7f650aa3ccf89c5c35d9b60a83a1ce48c74f Signed-off-by: Uwe Poeche <uwe.poeche@siemens.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64661 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
* intel/common/block: move RAPL disabling to common codeUwe Poeche2022-06-034-21/+32
| | | | | | | | | | | | | | | | | | This patch brings the feature of disabling RAPL to common code. It replaces the current solution for APL and EHL. For special case if RAPL disabling is only working via changes in MCHBAR a new config switch was introduced. Test: Boot mc_apl4/5 with this patch and ensure that the relevant bits in MSR 0x610 are the same as before the patch. Change-Id: I2098ddcd2f19e3ebd87ef00c544e1427674f5e84 Signed-off-by: Uwe Poeche <uwe.poeche@siemens.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64596 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* soc/intel/alderlake: add power limits for Alder Lake-N SKUsVidya Gopalakrishnan2022-06-022-0/+26
| | | | | | | | | | | | | | | | This patch adds support for the ADL-N SKUs based on the PCH ID. Document reference: 645548 (ADL-N EDS Volume 1). BUG=None BRANCH=None TEST=Build FW and test on adln_rvp board Change-Id: I24c18a27a4a2c68c78bc3dc728c45ba04f57205d Signed-off-by: Vidya Gopalakrishnan <vidya.gopalakrishnan@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64472 Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com>
* soc/intel/common/cpu: Use SoC overrides to set CPU privilege levelSubrata Banik2022-06-0212-0/+101
| | | | | | | | | | | | | | | | This patch implements a SoC overrides to set CPU privilege level as the MSR is not consistent across platforms. For example: On APL/GLK/DNV, it's MSR 0x120 and CNL onwards it's MSR 0x151. BUG=b:233199592 TEST=Build and boot google/taeko to ChromeOS. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I4584516102560e6bb2a4ae8c0d036be40ed96990 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64806 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* soc/intel/fast_spi: Use smarter mtrr code in ramstageArthur Heymans2022-06-011-0/+5
| | | | | | | | | | | | | | mtrr_use_temp_range is a lot smarter than the plain set_var_mtrr. It will compute a new optimal solution with the temp ranges included while also taking care of the cleanup before loading the payload/s3 resume. Change-Id: I283ba07fc12c410be39dfdc828657598237247c1 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63550 Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* soc/intel/common: Use coreboot error codesSridhar Siricilla2022-05-282-4/+4
| | | | | | | | | | | | | The patch uses coreboot error codes instead of uint8_t data type in the pre_mem_debug_init function. TEST=build code for Gimble Signed-off-by: Sridhar Siricilla <sridhar.siricilla@intel.com> Change-Id: I957ff764900cb789bf2aacf0472dcb281f48af07 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64301 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Maulik V Vaghela <maulik.v.vaghela@intel.com>
* soc/intel/tgl: Add PEG devices to PCI constraintsTim Crawford2022-05-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | Based on the constraints for CML. Fixes the following warnings in Linux on system76/oryp8 and system76/gaze16, which have an NVIDIA GPU on the bridge. pcieport 0000:00:01.0: can't derive routing for PCI INT A pcieport 0000:00:01.0: can't derive routing for PCI INT B This, in turn, resolves an IRQ conflict with the PCH HDA device that would cause a stack trace on every boot and on S3 suspend. irq 10: nobody cared (try booting with the "irqpoll" option) <snip> [<00000000fb84c354>] azx_interrupt [snd_hda_codec] Disabling IRQ #10 Change-Id: Ibc968aaa7bf0259879097ff69d2543dcfa2e5e4b Signed-off-by: Tim Crawford <tcrawford@system76.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64671 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* soc/intel/alderlake: Hook up FSP hyper-threading setting to option APIFelix Singer2022-05-262-2/+3
| | | | | | | | | | | | | | | | Select `HAVE_HYPERTHREADING` and hook up the hyper-threading setting from the FSP to the option API so that related mainboards don't have to do that. Unless otherwise configured (e.g. the CMOS setting or overriden by the mainboard code), the value from the Kconfig setting `FSP_HYPERTHREADING` is used. Change-Id: I520a936b4c3a8997ba2c6bea0126b3bbcc5d68ce Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/60547 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Subrata Banik <subratabanik@google.com>
* soc/intel/tigerlake: Hook up FSP hyper-threading setting to option APIFelix Singer2022-05-262-0/+4
| | | | | | | | | | | | | | | | | Select `HAVE_HYPERTHREADING` and hook up the hyper-threading setting from the FSP to the option API so that related mainboards don't have to do that. Unless otherwise configured (e.g. the CMOS setting or overriden by the mainboard code), the value from the Kconfig setting `FSP_HYPERTHREADING` is used. Also, remove related code from the mainboard starlabs/laptop/tgl, since it is obsolete now. Change-Id: I49bbd4a776b4e6c55cb373bbf88a3ca076342e3e Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/60545 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems>
* soc/intel/cannonlake: Hook up FSP hyper-threading setting to option APIFelix Singer2022-05-262-0/+4
| | | | | | | | | | | | | | | | | | | | | Select `HAVE_HYPERTHREADING` and hook up the hyper-threading setting from the FSP to the option API so that related mainboards don't have to do that. Unless otherwise configured (e.g. the CMOS setting or overriden by the mainboard code), the value from the Kconfig setting `FSP_HYPERTHREADING` is used. Also, remove related code from the following mainboards, since it is obsolete now. * siemens/chili * starlabs/laptop/cml Change-Id: I173b87da5ce76549672c50ba30204cd77be8b82f Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/60544 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems> Reviewed-by: Nico Huber <nico.h@gmx.de>
* soc/intel/skylake: Move FSP_HYPERTHREADING to common Intel KconfigFelix Singer2022-05-262-4/+9
| | | | | | | | | | | | | | | Move the Kconfig option `FSP_HYPERTHREADING` to common Intel Kconfig so that it can be reused by other SoCs. Since not all SoCs support hyperthreading, make it conditional on `HAVE_HYPERTHREADING`. SoCs supporting hyperthreading need to select it so that `FSP_HYPERTHREADING` is available. Change-Id: I892d48b488cbf828057f0e9be9edc4352c58bbe7 Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/60543 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
* soc/intel/common: Skip sending DISCONNECT IPC commandSridhar Siricilla2022-05-251-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | The patch skips sending DISCONNECT IPC command to PMC if system resumes from S3. coreboot notice DISCONNECT IPC command getting timedout during S3 resume if system has AC connected behind Type-C hub. This impacts system resume time. Please refer TA# 730910 for more information. coreboot need not send the DISCONNECT IPC command when system resumes from S3 state. TEST=Verified system boots to OS and verfied below tests on Gimble 1. coreboot doesn't send the DISCONNECT during S3 resume 2. After S3 resume, system detects the pen drive with Superspeed 3. After system resumes from S3, hot-plug the pen drive, system detects the pen drive 3. System sends IPC commands when system boots from S0 or S5. Signed-off-by: Sridhar Siricilla <sridhar.siricilla@intel.com> Change-Id: I6ad006ae8677919c7dfeca8eec0af11454a2e89d Reviewed-on: https://review.coreboot.org/c/coreboot/+/63932 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Subrata Banik <subratabanik@google.com>
* soc/intel/alderlake: Add chip config for DPA PreWakeleo.chou2022-05-252-0/+8
| | | | | | | | | | | | | | | | The FSP includes a UPD to set the DPA (Dynamic Periodicity Alteration) PreWake value, which can be used to set the maximum pre-wake randomization time in "micro-ticks". This patch adds support for configuring that value. BUG=b:228410327 TEST=build FW and checked DPA value by fsp log. Signed-off-by: leo.chou <leo.chou@lcfc.corp-partner.google.com> Change-Id: I08897c590a88aba058cb9e364185ea0794e1e7c3 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64316 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* soc/intel/tigerlake: Drop unused `PCH_DEV_SLOT_LPC` macroSubrata Banik2022-05-251-1/+0
| | | | | | | | | | | | | | | This patch drops the unused `PCH_DEV_SLOT_LPC` macro from the Tiger Lake SoC PCI device list. BUG=none TEST=Able to build and boot volteer, google board. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I27a2f31aa706c4d76e9f0db202422bc129368959 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64588 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* arch/x86/acpi_bert_storage.c: Use a common implementationArthur Heymans2022-05-252-11/+8
| | | | | | | | | | | | | | | | All targets now use cbmem for the BERT region, so the implementation can be common. This also drops the obsolete comment about the need to have bert in a reserved region (cbmem gets fixed to be in a reserved region). Change-Id: I6f33d9e05a02492a1c91fb7af94aadaa9acd2931 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64602 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
* soc/intel/apollolake: Compare patched FIT pointer with the pre-definedWerner Zeh2022-05-242-1/+10
| | | | | | | | | | | | | | Since the FIT pointer is patched at runtime there is no guarantee that the pre-defined one will match the patched one. Add a check and print a warning at runtime if both addresses (pre-defined and patched) do not match as in this case an offline computed hash for the bootblock will differ from the runtime one. Change-Id: Ib1b02ec43af183caa9f5b08b3c485879b423c40f Signed-off-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64598 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>