summaryrefslogtreecommitdiffstats
path: root/src/soc/intel/apollolake
Commit message (Collapse)AuthorAgeFilesLines
* soc/apollolake: Don't select VBNV_CMOS if VBNV_FLASH is enabledSean Rhodes2022-07-221-2/+2
| | | | | | | | Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: If8af4657508f00feff8525b0135c7f73c1959965 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65948 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* treewide: Remove unused <cpu/x86/msr.h>Elyes Haouas2022-07-201-1/+0
| | | | | | | | Change-Id: I187c2482dd82c6c6d1fe1cbda71710ae1a2f54ad Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64890 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
* soc/apollolake: Add CSE Firmware Status RegistersSean Rhodes2022-07-202-9/+81
| | | | | | | | | | | | | | | | | | | | | | | | Add the CSE, General Status and Miscellaneous registers and print information from them accordingly. All values were taken from Intel document number 571993. Tested on the StarLite Mk III and the correct values are shown: [DEBUG] CSE: Working State : 2 [DEBUG] CSE: Manufacturing Mode : NO [DEBUG] CSE: Operation State : 1 [DEBUG] CSE: FW Init Complete : NO [DEBUG] CSE: Error Code : 3 [DEBUG] CSE: Operation Mode : 0 [DEBUG] CSE: FPF status : unknown Please note, the values shown are in an error state. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I1a5548132dadbb188a33a7ae30a0a1fa144d130f Reviewed-on: https://review.coreboot.org/c/coreboot/+/65981 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* soc/intel/apollolake: Call heci_init in romstageSean Rhodes2022-07-191-0/+4
| | | | | | | | | | Call heci_init to initialise all Heci devices and bring them to d0. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Id2865b649331846fc119da7c4be56cc1fed56b8b Reviewed-on: https://review.coreboot.org/c/coreboot/+/64860 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* soc/intel/apollolake/meminit.c: Remove unuseful commentElyes Haouas2022-07-081-1/+1
| | | | | | | | Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Change-Id: Ia81b4397c92f100abad9b1e974bbebfe49008439 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65700 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
* soc/intel/apollolake: Fix incorrect GPE numberReka Norman2022-07-081-1/+1
| | | | | | | | | | | BUG=None TEST=None Signed-off-by: Reka Norman <rekanorman@chromium.org> Change-Id: I2eb6e94e5d87bb19b11e27461e2b5bdaee9d59bd Reviewed-on: https://review.coreboot.org/c/coreboot/+/65691 Reviewed-by: Subrata Banik <subratabanik@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* soc/intel/apollolake: Add chipset devicetreeSean Rhodes2022-06-283-0/+102
| | | | | | | | Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Ic2b9a22bc6c32030f960d59b2874be5459c3ba28 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65451 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* soc/intel/apollolake: Enable SATA Power OptimisationSean Rhodes2022-06-232-0/+6
| | | | | | | | | | | | Enable PwrOptEnable FSP S UPD and hook it to the inverted value of SataPwrOptimizeDisable to allow it to be disabled from the devicetree. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I056fd7b16dadb213b3326523b0c7943ce35b8dc4 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65043 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* device/resource: Add _kb postfix for resource allocatorsKyösti Mälkki2022-06-221-2/+2
| | | | | | | | | | | | There is a lot of going back-and-forth with the KiB arguments, start the work to migrate away from this. Change-Id: I329864d36137e9a99b5640f4f504c45a02060a40 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64658 Reviewed-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* soc/intel/apollolake: Hook Up SataPortEnable to devicetreeSean Rhodes2022-06-202-1/+7
| | | | | | | | | | | | Hook Up SataPortsEnable to the devicetree. As the default value is 0, set both [0] and [1] in all mainboards so they aren't affected. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Ica8cf9484a6e6fe4362eabb8a9a59fcaf97c1bd3 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64524 Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Werner Zeh <werner.zeh@siemens.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* soc/intel/apollolake: Hook up C1e to enhanced_cstatesSean Rhodes2022-06-202-0/+6
| | | | | | | | | | | | | | | | Hook up C1e FSP S UPD which enables enhanced C-states, to enhanced_cstates. This allows it to be enabled in the devicetree with a value of "1" as the default is disabled. C1e exists on both APL and GLK, and has been there since their initial releases. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Ie803a75ac9fb64a6c21b31baeea7b736e4fbf5fa Reviewed-on: https://review.coreboot.org/c/coreboot/+/64708 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* soc/intel/apollolake: Hook up UfsEnabled to devicetreeSean Rhodes2022-06-202-0/+7
| | | | | | | | | | | | | Hook up FSP S UfsEnabled UPD (1d.0) to devicetree. UFS only exist on GLK, and has been there since its initial releases. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I1976bfd340c728c64aaf36d296ac41dcd47bfc61 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65044 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* soc/intel/apollolake: Allow configuring the LPC IO registersSean Rhodes2022-06-203-0/+20
| | | | | | | | | | | | | | Allow configuring the LPC IO registers in the devicetree with: * gen1_dec * gen2_dec * gen3_dec * gen4_dec Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I2a7ab3faf927cda76640227feff4e19017442897 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64889 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.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/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>
* intel/common/block: move RAPL disabling to common codeUwe Poeche2022-06-031-8/+4
| | | | | | | | | | | | | | | | | | 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/common/cpu: Use SoC overrides to set CPU privilege levelSubrata Banik2022-06-021-0/+9
| | | | | | | | | | | | | | | | 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/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>
* soc/intel/apollolake: Provide FIT pointer in bootblock at build timeWerner Zeh2022-05-242-1/+12
| | | | | | | | | | | | | | | | | | | Before TXE releases the CPU out of reset a pointer to the constructed FIT in SRAM is patched into the loaded bootblock at offset 4G - 64B. Since this patched bootblock gets measured during runtime it will not match the one that is potentially measured from the coreboot image. This patch adds a dedicated fit.c file for Apollo Lake where the FIT pointer is already set to the address TXE will be using at runtime. Test=Compare sha256 sum from coreboot runtime and coreboot.rom of the bootblock and make sure they match. Change-Id: Ia0fd2a19517c70f50ef37e6a2dc2408bae28df10 Signed-off-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64539 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
* soc/intel/apollolake: Measure bootblock from IFWIWerner Zeh2022-05-242-1/+49
| | | | | | | | | | | | | | | | | On Apollo Lake the bootblock is stitched into the IBBL IFWI region at build time. At execution time TXE loads this IBBL into a shared SRAM (which is read-only in this phase) and maps it at 4 GiB - 32 KiB. Then the CPU starts to operate from this shared SRAM as it were flash space. In order to provide a reliable CRTM init, the real executed bootblock code needs to be measured into TPM if VBOOT is selected. This patch adds the needed code to do this. Change-Id: Ifb3f798de638a85029ebfe0d1b65770029297db3 Signed-off-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64493 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
* security/tpm/crtm: Add a function to measure the bootblock on SoC levelWerner Zeh2022-05-242-0/+9
| | | | | | | | | | | | | | | | | On platforms where the bootblock is not included in CBFS anymore (because it is part of another firmware section (IFWI or a different CBFS), the CRTM measurement fails. This patch adds a new function to provide a way at SoC level to measure the bootblock. Following patches will add functionality to retrieve the bootblock from the SoC related location and measure it from there. In this way the really executed code will be measured. Change-Id: I6d0da1e95a9588eb5228f63151bb04bfccfcf04b Signed-off-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64492 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
* soc/intel/apollolake: Enable SSDT for fast SPI controllerWerner Zeh2022-05-231-0/+1
| | | | | | | | | | | | | | Since the fast SPI controller is hidden on Apollo Lake the OS cannot probe it and is therefore unaware of the reserved resources assigned in coreboot. Select 'FAST_SPI_GENERATE_SSDT' to enable SSDT creation to report the reserved resources to the OS. Change-Id: I23e77a0a01141dc4f299988d19509e6df555a654 Signed-off-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64419 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Sean Rhodes <sean@starlabs.systems>
* soc/intel/apollolake: Hook up Sata Hot Plug to device treeSean Rhodes2022-05-212-0/+6
| | | | | | | | Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I37d31598e87e5b625ded3186980e3aba7dcf6440 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64523 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
* soc/intel/apollolake: Hook up Legacy 8254 TimerSean Rhodes2022-05-211-0/+4
| | | | | | | | | | | | Hook Timer8254ClkSetting to `legacy_8254_timer` cmos option. If that isn't set, fallback to the `USE_LEGACY_8254_TIMER` Kconfig option. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I4f91cc2c8f48e9da47399059386092314b631b08 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64522 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* intel/common/block: Provide RAPL and min clock ratio switches in commonUwe Poeche2022-05-183-22/+3
| | | | | | | | | | | | | | | | | | There are two APL specific config switches for RAPL and min. cpu clock (APL_SKIP_SET_POWER_LIMITS, APL_SET_MIN_CLOCK_RATIO). These switches could be used in future in other CPU platforms. Move them to common code instead of having them just for one SOC. Test: Make sure that the clock ratio (MSR 0x198) and the RAPL settings (MSR0x610) do not change with this patch applied on mc_apl{1,4,5} mainboard. Change-Id: I3d63d1b9b6c96586a3c20bf8c1d8001b1d7c4bed Signed-off-by: Uwe Poeche <uwe.poeche@siemens.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63546 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
* soc/intel/*: Use SSDT to pass A4GB and A4GSArthur Heymans2022-05-165-7/+5
| | | | | | | | | | | | | GNVS is more fragile as you need to keep struct elements in sync with ASL code. Change-Id: I2cd5e6b56e4a0dbbb11f4a0ac97e8f84d53b90ec Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64216 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Subrata Banik <subratabanik@google.com>
* soc/intel/apollolake/romstage.c: Remove unused <cpu/x86/pae.h>Elyes Haouas2022-05-161-1/+0
| | | | | | | | | | | Found using: diff <(git grep -l '#include <cpu/x86/pae.h>' -- src/) <(git grep -l 'memset_pae\|MEMSET_PAE_\|MAPPING_ERROR\|map_2M_page\|paging_identity_map_addr\|paging_enable_for_car\|paging_set_default_pat\|paging_set_pat\|PAT_ENCODE\|PAT_UC_MINUS\|PAT_WB\|PAT_WP\|PAT_WT\|PAT_WC\|PAT_UC\|paging_set_nxe\|paging_disable_pae\|paging_enable_pae\|paging_enable_pae_cr3' -- src/) Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Change-Id: If0f69fa8fe4a336b4e4d2a148d1e7a911af3c2c9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63829 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@tutanota.com>
* soc/intel/apl: Drop cbfs bootblockArthur Heymans2022-05-152-1/+14
| | | | | | | | | | | | | | | The bootblock is loaded from IFWI so there is no need to have it in cbfs. Also remove the FIT handling as that is also handled by the IFWI. TESTED: up/squared still boots Change-Id: I8e70e080765dd7306074a8cf71c8795b8fbbb8a2 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63225 Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* soc/intel/apl: Write to cbfs regions using intermediate targetsArthur Heymans2022-05-121-4/+6
| | | | | | | | | | | This also adds messages when adding the files. Change-Id: Ie812084cc243a18cbc2913804ef2190dd9d6ed9b Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63224 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* soc/intel: Decouple HECI disabling interface from HECI disable KconfigSubrata Banik2022-04-291-1/+1
| | | | | | | | | | | | | | | | | This patch decouples HECI disabling interface a.k.a SMM or PCR or PMC IPC etc. from DISABLE_HECI1_AT_PRE_BOOT kconfig as Intel ME BWG recommends to disable the CSE PCI device while CSE is in software temporary disable state. BUG=b:228789015 TEST=Able to build google/redrix. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I66abc04d5e195515165a77b0166d004f17d029e7 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63823 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Kangheui Won <khwon@chromium.org>
* soc/intel: Remove unused <cbmem.h>Elyes HAOUAS2022-04-221-1/+0
| | | | | | | | Change-Id: I529c822c9e952dae6613d3de64f6709e0fd9b385 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/61056 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* tpm: Refactor TPM Kconfig dimensionsJes B. Klinke2022-04-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Break TPM related Kconfig into the following dimensions: TPM transport support: config CRB_TPM config I2C_TPM config SPI_TPM config MEMORY_MAPPED_TPM (new) TPM brand, not defining any of these is valid, and result in "generic" support: config TPM_ATMEL (new) config TPM_GOOGLE (new) config TPM_GOOGLE_CR50 (new, implies TPM_GOOGLE) config TPM_GOOGLE_TI50 (new to be used later, implies TPM_GOOGLE) What protocol the TPM chip supports: config MAINBOARD_HAS_TPM1 config MAINBOARD_HAS_TPM2 What the user chooses to compile (restricted by the above): config NO_TPM config TPM1 config TPM2 The following Kconfigs will be replaced as indicated: config TPM_CR50 -> TPM_GOOGLE config MAINBOARD_HAS_CRB_TPM -> CRB_TPM config MAINBOARD_HAS_I2C_TPM_ATMEL -> I2C_TPM && TPM_ATMEL config MAINBOARD_HAS_I2C_TPM_CR50 -> I2C_TPM && TPM_GOOGLE config MAINBOARD_HAS_I2C_TPM_GENERIC -> I2C_TPM && !TPM_GOOGLE && !TPM_ATMEL config MAINBOARD_HAS_LPC_TPM -> MEMORY_MAPPED_TPM config MAINBOARD_HAS_SPI_TPM -> SPI_TPM && !TPM_GOOGLE && !TPM_ATMEL config MAINBOARD_HAS_SPI_TPM_CR50 -> SPI_TPM && TPM_GOOGLE Signed-off-by: Jes B. Klinke <jbk@chromium.org> Change-Id: I4656b2b90363b8dfd008dc281ad591862fe2cc9e Reviewed-on: https://review.coreboot.org/c/coreboot/+/63424 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* soc/intel/apollolake: Correct enum for PrimaryVideoAdaptor FSP parameterWerner Zeh2022-04-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 1a4496e79f21 (soc/{apl,glk}: Allow to select the primary graphics device) adds code to set the FSP parameter 'PrimaryVideoAdaptor' based on the enum description of the FspmUpd.h for Apollo Lake. Unfortunately, the comment in the header file does not match the implementation in the FSP and hence setting PrimaryVideoAdaptor to 'GPU_PRIMARY_IGD' will be treated as if the selection was 'GPU_PRIMARY_PCI'. This in turn leads to Linux gfx driver issues for earlier driver implementations. This commit corrects the enum values for the FSP parameter to match the implementation. TEST=Boot into Linux on mc_apl1 and verify that graphics works. Change-Id: Iedbc144fa809f6d4587f5223b235ee95579c48f7 Signed-off-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/62889 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Maxim Polyakov <max.senia.poliak@gmail.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Mario Scheithauer <mario.scheithauer@siemens.com> Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
* Kconfig: Select UDK2017Patrick Rudolph2022-03-311-2/+1
| | | | | | | | | | | | | On platforms using UDK2015 select UDK2017 instead. This allows to drop UDK2015 headers. Tested using timeless builds: The produced binaries are identical. Change-Id: Ia6032c6520ec889cd63655db982d9bfa476dc24d Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/62984 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
* soc/intel: Move `pmc_clear_pmcon_sts()` into IA common codeSubrata Banik2022-03-293-17/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves `pmc_clear_pmcon_sts` function into common code and remove SoC specific instances. Accessing PMC GEN_PMCON_A register differs between different Intel chipsets. Typically, there are two possible ways to perform GEN_PMCON_A register programming (like `pmc_clear_pmcon_sts()`) as: 1. Using PCI configuration space when GEN_PMCON_A is a PCI configuration register. 2. Using MMIO access when GEN_PMCON_A is a memory mapped register. SoC users to select `SOC_INTEL_MEM_MAPPED_PM_CONFIGURATION` Kconfig to perform GEN_PMCON_A register programming using PMC MMIO. BUG=b:211954778 TEST=Able to build brya. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I8d15f421c128630f928a1b6a7e2840056d68d7b1 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62064 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jeff Daly <jeffd@silicom-usa.com> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* soc/intel/common: Implement error codes for for heci_send_receive()Sridhar Siricilla2022-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The patch implements below changes: 1. Implements different error codes and use them in appropriate failure scenarios of below functions: a. heci_send() b. recv_one_message() c. heci_receive() 2. As heci_send_receive() is updated to return appropriate error codes in different error scenarios of sending and receiving the HECI commands. As the function is updated to return 0 when success, and non-zero values in the failure scenarios, so all caller function have been updated. BUG=b:220652101 TEST=Verified CSE RX and TX APIs return error codes appropriately in the simulated error scenarios. Signed-off-by: Sridhar Siricilla <sridhar.siricilla@intel.com> Change-Id: Ibedee748ed6d81436c6b125f2eb2722be3f5f8f0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62299 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* soc/apollolake: Hook up VTD to CMOSSean Rhodes2022-03-101-1/+2
| | | | | | | | | | | Hook up vtd_enable to CMOS value of "vtd". Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I16b43f0489f652d650e820c36b2b9bea61cf3c8c Reviewed-on: https://review.coreboot.org/c/coreboot/+/61679 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* soc/apollolake: Correct SMBus interruptSean Rhodes2022-03-101-1/+1
| | | | | | | | | | | | | | This solved the error: i801_smbus 0000:00:1f.1: can't derive routing for PCI INT A i801_smbus 0000:00:1f.1: PCI INT A: not connected i801_smbus 0000:00:1f.1: SPD Write Disable is set i801_smbus 0000:00:1f.1: SMBus using polling Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Idebd581b7ed6d193d83340b7dc94248df43525c5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/61713 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* soc/apollolake: Hook up CnviMode to devicetreeSean Rhodes2022-03-091-0/+4
| | | | | | | | | | | Hook PCH_DEVFN_CNVI (0c.0) to CnviMode. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I8b51e98952a39bd432e9bc63eea57a40dd6cf106 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62127 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Andy Pont <andy.pont@sdcsystems.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* src: Make PCI ID define names shorterFelix Singer2022-03-071-9/+9
| | | | | | | | | | | | | | | | | | Shorten define names containing PCI_{DEVICE,VENDOR}_ID_ with PCI_{DID,VID}_ using the commands below, which also take care of some spacing issues. An additional clean up of pci_ids.h is done in CB:61531. Used commands: * find -type f -exec sed -i 's/PCI_\([DV]\)\(EVICE\|ENDOR\)_ID_\([_0-9A-Za-z]\{2\}\([_0-9A-Za-z]\{8\}\)*[_0-9A-Za-z]\{0,5\}\)\t/PCI_\1ID_\3\t\t/g' * find -type f -exec sed -i 's/PCI_\([DV]\)\(EVICE\|ENDOR\)_ID_\([_0-9A-Za-z]*\)/PCI_\1ID_\3/g' Change-Id: If9027700f53b6d0d3964c26a41a1f9b8f62be178 Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/39331 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
* arch/x86: factor out and commonize HPET_BASE_ADDRESS definitionFelix Held2022-02-251-2/+0
| | | | | | | | | | | | | | | | All x86 chipsets and SoCs have the HPET MMIO base address at 0xfed00000, so define this once in arch/x86 and include this wherever needed. The old AMD AGESA code in vendorcode that has its own definition is left unchanged, but sb/amd/cimx/sb800/cfg.c is changed to use the new common definition. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: Ifc624051cc6c0f125fa154e826cfbeaf41b4de83 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62304 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
* soc/apollolake: Allow configuring individual USB ports on GLKSean Rhodes2022-02-241-0/+18
| | | | | | | | | | Allow configuring the limited fields that FSP-S provides. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I56c37338eaa978fdb2c63807331493e8aecbdf60 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62056 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* soc/intel/apollolake: Create alias for GEN_PMCON1 as GEN_PMCON_ASubrata Banik2022-02-181-0/+1
| | | | | | | | | | | | This patch creates alias for GEN_PMCON_A to maintain parity with other IA SoC PMC register definitions. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: Id9a23c58a325cb544c50cbda432fe3117eea22fe Reviewed-on: https://review.coreboot.org/c/coreboot/+/61984 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
* drivers/fsp/fsp2_0: Rework FSP Notify Phase API configsSubrata Banik2022-02-181-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch renames all FSP Notify Phase API configs to primarily remove "SKIP_" prefix. 1. SKIP_FSP_NOTIFY_PHASE_AFTER_PCI_ENUM -> USE_FSP_NOTIFY_PHASE_POST_PCI_ENUM 2. SKIP_FSP_NOTIFY_PHASE_READY_TO_BOOT -> USE_FSP_NOTIFY_PHASE_READY_TO_BOOT 3. SKIP_FSP_NOTIFY_PHASE_END_OF_FIRMWARE -> USE_FSP_NOTIFY_PHASE_END_OF_FIRMWARE The idea here is to let SoC selects all required FSP configs to execute FSP Notify Phase APIs unless SoC deselects those configs to run native coreboot implementation as part of the `.final` ops. For now all SoC that uses FSP APIs have selected all required configs to let FSP to execute Notify Phase APIs. Note: coreboot native implementation to skip FSP notify phase API (post pci enumeration) is still WIP. Additionally, fixed SoC configs inclusion order alphabetically.  BUG=b:211954778 TEST=Able to build and boot brya. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: Ib95368872acfa3c49dad4eb7d0d73fca04b4a1fb Reviewed-on: https://review.coreboot.org/c/coreboot/+/61792 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
* soc/intel/apollolake: Fix overlapping ACPI resource rangesMatt DeVillier2022-02-151-2/+2
| | | | | | | | | | | | | | | | | | | | The address space allotted to MCRS in the northbridge needs to be exclusive of the address space allotted to the GPIO controllers in the southbridge, otherwise Windows complains of overlapping resource ranges and disables the GPIO controllers. To prevent overlap, use CONFIG_PCR_BASE_ADDRESS to set the upper bound of MCRS rather than MMCONF. Test: boot Windows 10/11 on google/{reef,ampton} and verify that GPIO controllers are indicated as without fault in Device Manager. Change-Id: I2117054edb448e717b7cbe80958c9c4e6c996e2b Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/61908 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: CoolStar Organization <coolstarorganization@gmail.com>
* soc/intel/apollolake: Add function to clear PMCON status bitsSubrata Banik2022-02-152-0/+17
| | | | | | | | | | | | | | This patch adds an SoC function to clear GEN_PMCON_A status bits to align with other IA coreboot implementations. BUG=b:211954778 TEST=None. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I982f669b13f25d1d0e6dfaec2fbf50d3200f74fe Reviewed-on: https://review.coreboot.org/c/coreboot/+/61651 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* soc/apollolake: Make IO decode / enable register configurableSean Rhodes2022-02-152-2/+23
| | | | | | | | | | | | This allows the one 32bit register to be configured in the devicetree in the same way that Skylake can be. i.e. register "lpc_ioe". Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I598baca0f31b5350a4e6fdb7b7356fa6fb2d71ed Reviewed-on: https://review.coreboot.org/c/coreboot/+/61195 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* soc/intel/apl: Use Kconfig to enable CseRbpSean Rhodes2022-02-122-8/+10
| | | | | | | | | | | This patch makes SKIP_CSE_RBP=y default for Apollo Lake if Boot Device is memory mapped and ensures SkipCseRbp UPD is guarded against this config. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Ifd01a25443e2582a90529e55be8d34a88342a103 Reviewed-on: https://review.coreboot.org/c/coreboot/+/61282 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* soc/intel/apollolake: Convert to ASL 2.0Elyes HAOUAS2022-02-077-84/+80
| | | | | | | | Change-Id: Ieb362b5be05421b6ad2b2a3126c2943b7d55d135 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/61243 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Subrata Banik <subratabanik@google.com>
* cpu/x86/lapic: Move LAPIC configuration to MP initKyösti Mälkki2022-02-051-3/+0
| | | | | | | | | | | | | | | | Implementation for setup_lapic() did two things -- call enable_lapic() and virtual_wire_mode_init(). In PARALLEL_MP case enable_lapic() was redundant as it was already executed prior to initialize_cpu() call. For the !PARALLEL_MP case enable_lapic() is added to AP CPUs. Change-Id: I5caf94315776a499e9cf8f007251b61f51292dc5 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/58387 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>