Commit Graph

2893 Commits

Author SHA1 Message Date
Jay Patel b7da7d5263 arch/x86/smbios: Add socket type for Meteor Lake
Add socket type for Meteor Lake as PROCESSOR_UPGRADE_OTHER.

BUG=None
TEST=processor upgrade is equal to "Other" for "dmidecode -t 4"

Signed-off-by: Jay Patel <jay2.patel@intel.com>
Change-Id: If891990436a0679697e292b460eaec63c09e7bf8
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73708
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Bora Guvendik <bora.guvendik@intel.com>
Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
2023-03-29 13:19:32 +00:00
Yuchen He 7f5a52cc63 x86/include/registers.h: macros should not use a trailing semicolon
Macros should not use a trailing semicolons. Remove those from
'LONG_DOWNTO8' aswell as 'LONG_DOWNTO16' and add them at places where
the macros are used.

Signed-off-by: Yuchen He <yuchenhe126@gmail.com>
Change-Id: I5ba01bc09f9a2d9ecd54014e27ec0a24c7297412
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73864
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2023-03-22 23:53:42 +00:00
Yuchen He 452c41b601 arch/arm64/include/armv8/arch/barrier.h: Add spaces around colons
The linter requests spaces around colons. Add them.

Signed-off-by: Yuchen He <yuchenhe126@gmail.com>
Change-Id: I46d11666126dd8585ef7d4bab68a5b4b01fb7c29
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73748
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-03-21 21:35:00 +00:00
Jay Patel c7728521d6 arch/x86/ioapic: Print IOAPIC ID for GSI #0
Print IOAPIC ID for GSI #0 in logs, as part of IOAPIC initialization.

BUG=None
TEST=Confirmed "IOAPIC: ID = 0x00" printed in logs.

Signed-off-by: Jay Patel <jay2.patel@intel.com>
Change-Id: I8d8e94fe623795d059ec2abbb3319b60fd80f5ca
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73707
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Wonkyu Kim <wonkyu.kim@intel.com>
Reviewed-by: Bora Guvendik <bora.guvendik@intel.com>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2023-03-16 15:19:10 +00:00
Fabian Groffen 9b9d267f5a arch/x86/include/arch/mmio.h: Provide __always_inline definition for musl
fix compilation on musl-libc systems by providing an implementation
for __always_inline

Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Change-Id: I01a7eb9ed28e79523623ab362510ec2d93f4a8b7
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73667
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-03-13 14:01:47 +00:00
Arthur Heymans 3134a81525 cpu/x86/cache: CLFLUSH programs to memory before running
When cbmem is initialized in romstage and postcar placed in the stage
cache + cbmem where it is run, the assumption is made that these are
all in UC memory such that calling INVD in postcar is OK.

For performance reasons (e.g. postcar decompression) it is desirable
to cache cbmem and the stage cache during romstage.

Another reason is that AGESA sets up MTRR during romstage to cache all
dram, which is currently worked around by using additional MTRR's to
make that UC.

TESTED on asus/p5ql-em, up/squared on both regular and S3 resume
       bootpath. Sometimes there are minimal performance improvements
       when cbmem is cached (few ms).

Change-Id: I7ff2a57aee620908b71829457ea0f5a0c410ec5b
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37196
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-03-13 13:42:32 +00:00
Felix Held 73e9ac66ad arch/x86/smbios: use cpu_cpuid_extended_level instead of open coding it
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ice15f0ce591104a2ace186f9049748219c2bc097
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73141
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
2023-02-21 20:14:43 +00:00
Felix Held 1e78165cdc arch/x86/include/cpu: introduce CPU_TABLE_END CPU table terminator
Instead of having a magic entry in the CPU device ID table list to tell
find_cpu_driver that it has reached the end of the list, introduce and
use CPU_TABLE_END. Since the vendor entry in the CPU device ID struct is
compared against X86_VENDOR_INVALID which is 0, use X86_VENDOR_INVALID
instead of the 0 in the CPU_TABLE_END definition.

TEST=Timeless build for Mandolin results in identical image.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Suggested-by: Angel Pons <th3fanbus@gmail.com>
Change-Id: I0cae6d65b2265cf5ebf90fe1a9d885d0c489eb92
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72888
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
2023-02-09 16:54:11 +00:00
Elyes Haouas 3b3bb7cd62 treewide: Remove repeated words
Found by linter

Change-Id: I7a49cce0b56cf83d0e4490733f9190284a314c4a
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72896
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2023-02-09 10:04:04 +00:00
Felix Held b6969db5c2 soc/amd/picasso/soc_util: use cpuid_match
Now that there is a cpuid_match function, we can use it instead of doing
basically the same thing manually. In the functions is_fam17_1x and
is_fam17_2x both the stepping number and the lower nibble of the model
number are masked out. To avoid having magic constants in the code,
introduce the CPUID_ALL_STEPPINGS_AND_BASE_MODELS_MASK definition.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I758f9564c08c62c747cc4f93a8d6b540a1834a62
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72860
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-02-08 15:49:48 +00:00
Felix Held e1a84db3e0 arch/x86/cpu: move cpuid_match to corresponding header file
Since the functionality of cpuid_match is also useful outside of
arch/x86/cpu.c and it's a relatively simple function, move its
definition as inline function to the header file.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ic96746b33b01781543f60cf91904af35418e572d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72859
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-02-08 15:48:44 +00:00
Felix Held 180e414a80 arch/x86/include/cpu: introduce CPUID_FROM_FMS macro
Introduce a macro to get the raw CPUID leaf 1 EAX value from a given set
of CPU family, model and stepping. The processor type in bits 12 and 13
is assumed to be always be zero; at least this is the case for all
CPUIDs that are currently in the coreboot tree. This can be used to
make the device values in the CPU device ID tables easier to read.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Idab77453712b14983b1d02ca365f7924239fc2bf
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72856
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-02-08 15:12:13 +00:00
Felix Held 6a6ac1e0b9 arch/x86/cpu: introduce and use device_match_mask
Instead of always doing exact matches between the CPUID read in
identify_cpu and the device entries of the CPU device ID table,
offer the possibility to use a bit mask in the CPUID matching. This
allows covering all steppings of a CPU family/model with one entry and
avoids that case of a missing new stepping causing the CPUs not being
properly initialized.

Some of the CPU device ID tables can now be deduplicated using the
CPUID_ALL_STEPPINGS_MASK define, but that's outside of the scope of this
patch.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I0540b514ca42591c0d3468307a82b5612585f614
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72847
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2023-02-08 15:07:45 +00:00
Felix Held 2fe5d3e5a5 arch/x86/include/cpu: retype device field in cpu_device_id
Use a more specific type in preparation for using bit masks on this
field in the next patch. Since uint32_t is a typedef of unsigned int,
this won't change behavior.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ic54f73dcd3496a5ad85291b9b9586bc740b734d5
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72846
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2023-02-08 15:07:32 +00:00
Yuchen He 5e7dc21c91 arch/arm64/armv8/mmu.c: Add a space before the ternary operator
Coding style requires a space before the question mark in ternary
operators. Fix that.

Found by the linter.

Signed-off-by: Yuchen He <yuchenhe126@gmail.com>
Change-Id: I894d6efd5673e9ad5f166ae59967a8d4bb42fb06
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72484
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-02-08 02:03:11 +00:00
Alexander Goncharov 893c3ae892 tree: Drop repeated words
Found-by: linter
Change-Id: I7c6d0887a45fdb4b6de294770a7fdd5545a9479b
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72795
Reviewed-by: Nicholas Chin <nic.c3.14@gmail.com>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Erik van den Bogaert <ebogaert@eltan.com>
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-02-07 04:37:31 +00:00
Elyes Haouas 7cba1c486b treewide: Remove duplicated include <device/pci.h>
<device/pci.h> chain-includes <device/pci_def.h> & <device/pci_type.h>.

Change-Id: I4e5999443e81ee1c4b1fd69942050b47f21f42f8
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72626
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-02-01 03:03:34 +00:00
Christian Walter 55129b3d97 arch/x86/smbios.c: Add socket type for Intel SPR-SP
Intel SPR-SP processor has socket type as
PROCESSOR_UPGRADE_SOCKET_LGA4677 which is different
from the socket type of CPX-SP and SKX-SP.

Change-Id: Id2279cc0c1fa3f007d7c081af6f78e5aa98d2f3d
Signed-off-by: Christian Walter <christian.walter@9elements.com>
Signed-off-by: David Hendricks <ddaveh@amazon.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71947
Reviewed-by: Jonathan Zhang <jonzhang@fb.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-01-30 01:44:51 +00:00
David Hendricks 6041699ab3 arch/x86/smbios.c: Update Xeon-SP socket types
Now that we support >1 Xeon-SP, XEON_SP_COMMON_BASE no longer
reflects the socket type. This uses SOC_INTEL_* Kconfig variables and
returns the correct socket type for Cooper Lake-SP.

Signed-off-by: David Hendricks <ddaveh@amazon.com>

Change-Id: I142de5f040f3b76e352f27c00fe9e50787df5712
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72498
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jonathan Zhang <jonzhang@fb.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2023-01-29 22:04:56 +00:00
Elyes Haouas 48fa6dd8f9 arch/x86/Kconfig: Remove unused NUM_IPI_STARTS
Change-Id: I3b781c42ef6c23a5dcd31215c14fb9d7104822f2
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72144
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2023-01-21 09:13:28 +00:00
Elyes Haouas 91a48367a4 arch/x86/include: Remove unused <stddef.h>
Change-Id: I2a4b00d06c92eea1b83002c69d93037f84592393
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72111
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-01-21 09:12:36 +00:00
Sergii Dmytruk 2710df765b treewide: stop calling custom TPM log "TCPA"
TCPA usually refers to log described by TPM 1.2 specification.

Change-Id: I896bd94f18b34d6c4b280f58b011d704df3d4022
Ticket: https://ticket.coreboot.org/issues/423
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69444
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2023-01-11 16:00:55 +00:00
Jeremy Compostella 765e5df0dd drivers/intel/gma: Hook up libgfxinit in romstage
A mainboard port needs to:

- select `CONFIG_MAINBOARD_HAS_EARLY_LIBGFXINIT'

- implement the Ada package `GMA.Mainboard' with a single function
  `ports' that returns a list of ports to be probed for displays.

- set the desired `GFX_GMA_DEFAULT_MMIO' IO memory address to use
  in romstage (and ramstage) for the graphic device.

BUG=b:252792591
BRANCH=firmware-brya-14505.B
TEST=libgfxinit compiles in romstage.
     libgfxinit successfully executes in romstage and ramstage using
     the requested MMIO setting on skolas.

Change-Id: I3c2101de10dc5df54fe873e43bbe0f1c4dccff44
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70276
Reviewed-by: Tarun Tuli <taruntuli@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-01-11 13:59:54 +00:00
Li, Jincheng aa990125b8 arch/x86/smbios: Replace SMBIOS type4 processor upgrade fields
values by macros

Macro definitions are from DMTF System Management BIOS (SMBIOS)
Reference Specification (DSP0134) Chapter 7.5.5.

Change-Id: Ifed1d773b0b349f878648b8172fd770a397e9686
Signed-off-by: Li, Jincheng <jincheng.li@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71633
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Marc Jones <marc@marcjonesconsulting.com>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2023-01-08 01:27:14 +00:00
Felix Singer 7b8ac0030c {acpi,arch,soc}/acpi: Replace constant "One" with actual number
Change-Id: I3dfd7dd1de3bd27c35c195bd43c4a5b8c5a2dc53
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71522
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-27 09:05:15 +00:00
Elyes Haouas 2179c7fdb7 arch/riscv: Use 'enum cb_err'
Change-Id: I5a589a43b1e92cca6b531ca161174eefb5592569
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68371
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-12-25 15:09:48 +00:00
Elyes Haouas 9523e3b790 arch/x86: Use 'enum cb_err'
Change-Id: I38e4b8c6adfaaa45377b2fbe0644285d21841cd1
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68369
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-12-25 15:09:16 +00:00
Arthur Heymans 4d75dbd1c1 cpu/x86: Set up a separate stack for APs
APs use a lot less stack, so set up a separate stack for those in .bss.

Now that CPU_INFO_V2 is the only code path that is used, there is no
need to align stacks in c_start.S.

Change-Id: I7a681a2e3003da0400843daa5d6d6180d952abf5
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69123
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2022-12-23 14:29:01 +00:00
Elyes Haouas a012136fc8 treewide: Remove duplicated includes
<types.h> provides <commonlib/bsd/cb_err.h>, <stdint.h> and <stddef.h>.

Change-Id: I966303336e604b1b945df77e5d4c3cccbf045c56
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71149
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tarun Tuli <taruntuli@google.com>
Reviewed-by: Sridhar Siricilla <sridhar.siricilla@intel.com>
2022-12-21 21:33:40 +00:00
Jeremy Compostella 50139d00bd lib: Hook up libhwbase in romstage
It's hidden behind the configuration option `CONFIG_ROMSTAGE_LIBHWBASE'.

This also adds some glue code to use the coreboot console for debug
output and our monotonic timer framework as timer backend.

Running Ada code in romstage and more particular libhwbase brings a few
challenges as global initialized variables are not supported in
Cache-As-Ram mode.

1. The libhwbase dynamic mmio driver implementation makes the Gnat
   compiler generate some global initialized variables.

   For this reason, when compiled for romstage or for romstage and
   ramstage the static mmio driver is enforced (`HWBASE_STATIC_MMIO').

2. The Gnat compiler generates elaboration functions to initialize
   program data at runtime. These elaboration functions are called by
   the romstage_adainit() function.

   The data references symbols suffixed by `_E'. Even though these
   symbols, at compilation time, do not contain any data and are
   filled with zeros, the Gnat compiler installs them in the .data
   section.

   Since these symbols are actually filled with zeros, it is safe to
   install them in the .bss section.

   cf. https://docs.adacore.com/gnat_ugn-docs/html/gnat_ugn/gnat_ugn/elaboration_order_handling_in_gnat.html#elaboration-code

This patch requires the libhwbase
https://review.coreboot.org/c/libhwbase/+/69854 CL.

BUG=b:252792591
BRANCH=firmware-brya-14505.B
TEST=libhwbae compiles for romstage and loads successfully

Change-Id: I670249d33506e886a683e55d1589cb2bf9b16aa3
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70275
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: Tarun Tuli <taruntuli@google.com>
Reviewed-by: Zhixing Ma <zhixing.ma@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-17 20:51:38 +00:00
Arthur Heymans f45c7671d9 Set x86_64 as supported architecture for clang
This boots on both qemu and real hardware now.

Change-Id: Ibd320059cff575847bbf1844b5bb100312f77916
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69235
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-12-16 17:21:17 +00:00
Arthur Heymans 6e23da2983 cpu/cpu.h: Change the function signature
There is no need to pass the CPU index around.

Change-Id: Iad8e3cb318e6520ac5877118dbf43597dedb75b9
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69504
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
2022-12-10 17:54:53 +00:00
Arthur Heymans f1e78a1349 arch/x86/ioapic.c: Move macros to compilation unit
Some of these macros are too generic like "NONE" and create conflicts in
other compilation units.

Change-Id: I6131a576f115df20df4d3df712d4c3f59c6dceb7
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70429
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-07 23:01:51 +00:00
Angel Pons 2b48258865 arch/x86/smbios.c: Allow creating entries for empty DIMM slots
Properly handle meminfo DIMMs with `dimm_size` of 0, which represent
empty slots. This allows platform code to create dummy meminfo DIMMs
so that SMBIOS tables have type 17 entries for empty DIMM slots.

Change-Id: I17ae83edf94483bd2eeef5524ff82721c196b8ba
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64035
Reviewed-by: Jonathan Zhang <jonzhang@fb.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-06 21:27:27 +00:00
Arthur Heymans 4403c56ea2 arch/x86: Buildtest clang targets with VBOOT_STARTS_BEFORE_BOOTBLOCK
TESTED: google/vilboz boots with clang build.

Change-Id: Ie115c27b4cb0b8f83d7647bdd27ffcbac9376399
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69746
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-11-30 16:52:23 +00:00
Arthur Heymans b24f48db7d arch/arm/armv7: Disable generating neon FPU code
By default clang generates code with neon instructions. These are not
supported on all arm targets so default to fpu=none.

Change-Id: I48fc505107d131466be39f466151df62b2d2bd0b
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69745
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-11-30 16:37:30 +00:00
Arthur Heymans fa2feae3d6 arch/arm/eabi_compat.c: Add eabi_clrX and eabi_memcyX
Clang generated code uses this for zero initialized variables.

Change-Id: I460a0096918141c1cf8826bdf1853a3aa3aecff8
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69743
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2022-11-30 16:37:05 +00:00
Arthur Heymans c83a17841c arm/armv7/Makefile.inc: Fix processing ld files with clang
When processing linker scripts clang needs to be set for the proper
target or it gets confused by other options.

Change-Id: I040aa14a06c728269ca1026e0002392e5ac8fef8
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69744
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-11-30 16:36:29 +00:00
Elyes Haouas 8b8ada6fdb /: Remove extra space after comma
Change-Id: Ic64625bdaf8c4e9f8a5c1c22cece7f4070012da7
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69903
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-11-30 03:07:23 +00:00
Arthur Heymans cc22607dbf Revert "src/arch/x86: Use core apic id to get cpu_index()"
This reverts commit 095c931cf1.

Previously cpu_info() was implemented with a struct on top of an
aligned stack. As FSP changed the stack value cpu_info() could not be
used in FSP context (which PPI is). Now cpu_info() uses GDT segments,
which FSP does not touch so it can be used.

This also exports cpu_infos from cpu.c as it's a convenient way to get
the struct device * for a certain index.

TESTED on aldrvp: FSP-S works and is able to run code on APs.

Change-Id: I3a40156ba275b572d7d1913d8c17c24b4c8f6d78
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69509
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-11-29 19:58:13 +00:00
Arthur Heymans 5e3798ca48 arch/arm: Use unified assembly syntax
Taken from Linux which also updated these files.

Clang only works with this syntax, so this fixes builds for arm.

TESTED on qemu vexpress-a9 and verstage on google/vilboz with
BUILD_TIMELESS=1, binaries remain the same.

Change-Id: Ia320dc2c460c99d934b8f17dee7748a9def4e750
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63058
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-11-24 15:15:41 +00:00
Elyes Haouas 2ba796eb23 src/arch: Remove unnecessary space after casts
Change-Id: I00551dfd963d47a58284bc31f21b0fa12130fe78
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69816
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-11-22 13:46:47 +00:00
Jonathan Zhang d57b82111a arch/x86/smbios: Add SMBIOS Type 39
Read FRU product info of PSU to get Type 39 required information.
Further development needed if multi-record info of PSU FRU is required.
For now, the read_fru_areas() only read product chassis and board info.

Signed-off-by: lichenchen.carl <lichenchen.carl@bytedance.com>
Signed-off-by: ziang <ziang.wang@intel.com>
Signed-off-by: Jonathan Zhang <jonzhang@meta.com>
Change-Id: I18d056cba1a79b0775c8a42b3a879e819887adca
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68443
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Shuming Chu (Shuming) <s1218944@gmail.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Christian Walter <christian.walter@9elements.com>
2022-11-17 21:17:49 +00:00
Elyes Haouas 51c311827e arch/{arm64,riscv}: Remove "CRIT: " from log messages
It is no longer necessary to explicitly add "CRIT: " in front of
BIOS_CRIT message.

Change-Id: I506c1d278960c91d1283e9b1936c9c1678a10e17
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69497
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
2022-11-17 13:28:48 +00:00
Martin Roth 2d4c2b9850 arch/x86: Disable clang build if using verstage_before_bootblock
Clang isn't working so well with the ARM code yet.  This is still
breaking builders after fixing the compiler warnings.

Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: I2653edae0b89f75ef7d06a1be523585ff66a3b89
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69701
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
2022-11-16 15:22:15 +00:00
Martin Roth 6cf181a49b arch/arm/armv7: Don't set gcc specific options for clang builds
Clang doesn't understand the -Wa,-mno-warn-deprecated option.
Remove it for now.

Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: I9f91d6ec2db247e901ba9bc41bc4b888bbe43236
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69672
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
2022-11-16 15:16:42 +00:00
Arthur Heymans 6e85740236 arch/x86/Kconfig: Move AMD stages arch to common code
Use VBOOT_STARTS_BEFORE_BOOTBLOCK to determine whether the VERSTAGE
needs to be build as x86 stage.

Change-Id: I126801a1f6f523435935bb300f3e2807db347f63
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69505
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2022-11-14 15:54:02 +00:00
Kyösti Mälkki 987f46c276 arch/x86/mpspec.c: Drop weak write_smp_table()
Creating MP table is not useful when it does not include
the interrupt routing entries.

Change-Id: I1f38fb32a9436de64dfaf82e426cbd64b220ffa7
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69489
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-11-13 18:49:26 +00:00
Kyösti Mälkki ca5a793ec3 drivers/generic/ioapic: Drop poor implementation
This disables MP table generation for the affected boards
since interrupt routing entries would now be completely missing.

The mechanism itself is flawed and redundant. The mapping
of integrated PCI devices' INTx pins to IOAPIC pins is
dependent of configuration registers and needs not appear
in the devicetree.cb files at all.

The write_smp_table implementation would skip writing
any entry delivering to destination IOAPIC ID 0. This
does not follow MP table specification.

There were duplicate calls to register_new_ioapic_gsi0(),
with another present under southbridge LPC device.

Change-Id: I383d55ba2bc0800423617215e0bfdfad5136e9ac
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69488
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-11-13 18:48:52 +00:00
Arthur Heymans 9df0fee8fa arch/x86/memmove: Add 64bit version
The 64bit handles 64bit input variables properly.

TESTED: Both qemu and real hardware can use LZ4 properly which use this
code.

Change-Id: Ib43ec19df97194d6b1c18bfacb5fe8211ba0ffe5
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69231
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-11-12 23:22:17 +00:00