diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000..eb44fcd7e4
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,11 @@
+# EditorConfig: https://EditorConfig.org
+
+root = true
+
+[*]
+indent_style = tab
+tab_width = 8
+charset = utf-8
+insert_final_newline = true
+end_of_line = lf
+trim_trailing_whitespace = true
diff --git a/.gitmodules b/.gitmodules
index a656998655..77c74777f6 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -34,3 +34,6 @@
url = https://github.com/coreboot/intel-microcode.git
update = none
ignore = dirty
+[submodule "3rdparty/ffs"]
+ path = 3rdparty/ffs
+ url = https://github.com/coreboot/ffs.git
diff --git a/3rdparty/arm-trusted-firmware b/3rdparty/arm-trusted-firmware
index 693e278e30..42cdeb9308 160000
--- a/3rdparty/arm-trusted-firmware
+++ b/3rdparty/arm-trusted-firmware
@@ -1 +1 @@
-Subproject commit 693e278e308441d716f7f5116c43aa150955da31
+Subproject commit 42cdeb93080f2b54a75be14e4f5ee776872f3f0f
diff --git a/3rdparty/chromeec b/3rdparty/chromeec
index 11bd4c0f4d..860fe2962d 160000
--- a/3rdparty/chromeec
+++ b/3rdparty/chromeec
@@ -1 +1 @@
-Subproject commit 11bd4c0f4d11357ab830982d7dec164813c886dd
+Subproject commit 860fe2962d40ee901369d1dc67f4aa7a7a42ba4d
diff --git a/3rdparty/ffs b/3rdparty/ffs
new file mode 160000
index 0000000000..3ec70fbc45
--- /dev/null
+++ b/3rdparty/ffs
@@ -0,0 +1 @@
+Subproject commit 3ec70fbc458e32eef0d0b1de79688b4dc48cbd57
diff --git a/3rdparty/vboot b/3rdparty/vboot
index 9c90611097..e6700f4c70 160000
--- a/3rdparty/vboot
+++ b/3rdparty/vboot
@@ -1 +1 @@
-Subproject commit 9c906110972f538ee5753845916ebd1f826f54b6
+Subproject commit e6700f4c70fe72850ae4f3f5df19c9281ebcefc8
diff --git a/AUTHORS b/AUTHORS
index c5fec189ab..72521a1043 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -2,13 +2,100 @@
#
# This does not necessarily list everyone who has contributed code, since in
# some cases, their employer may be the copyright holder. To see the full list
-# of contributors, see the revision history in source control.
-# git log --pretty=format:%an | sort | uniq
-#
+# of contributors, and their email addresses, see the revision history in source
+# control.
+# Run the below commands in the coreboot repo for additional information.
+# To see a list of contributors: git log --pretty=format:%an | sort | uniq
+# For patches adding or removing a name: git log -i -S "NAME" --source --all
+9elements Agency GmbH
+Advanced Micro Devices, Inc.
+Alex Züpke
Alexander Couzens
+Alexandru Gagniuc
+Andy Fleming
+ARM Limited and Contributors
+Arthur Heymans
+Carl-Daniel Hailfinger
+coresystems GmbH
+Damien Zammit
+David Hendricks
+David Mosberger-Tang
+Denis Dowling
+DENX Software Engineering
+DMP Electronics Inc.
+Drew Eckhardt
+Egbert Eich
+Eric Biederman
+Eswar Nallusamy
+Facebook, Inc.
+Felix Held
+Frederic Potter
+Free Software Foundation, Inc.
+Freescale Semiconductor, Inc.
+Gary Jennejohn
+Gerd Hoffmann
+Google LLC
+Greg Watson
+Imagination Technologies
+Intel Corporation
+Jason Zhao
+Jordan Crouse
+Joseph Smith
+Keith Hui
+Kshitij
+Kyösti Mälkki
+Lei Wen
+Li-Ta Lo
+Libra Li
+Linus Torvalds
+Linux Networx, Inc.
+Marc Jones
+Marek Vasut
+Marius Gröger
+Martin Mares
+Marvell Semiconductor Inc.
+MediaTek Inc.
+MontaVista Software, Inc.
+Myles Watson
+Nicholas Sielicki
+Nick Barker
+Nico Huber
+Patrick Georgi
+Patrick Rudolph
+PC Engines GmbH
+Per Odlund
+Peter Stuge
+Raptor Engineering, LLC
+Richard Woodruff
+Ronald G. Minnich
+Rudolf Marek
+Russell King
+Sage Electronic Engineering, LLC
+SciTech Software, Inc.
+secunet Security Networks AG
+Siemens AG
+Silicon Integrated System Corporation
+Stefan Reinauer
+Steve Magnani
+SUSE LINUX AG
+Sven Schnelle
+Syed Mohammed Khasim
+Texas Instruments
+The Linux Foundation
+Timothy Pearson
+Tyan Computer Corp.
+Uwe Hermann
+VIA Technologies, Inc
+Wolfgang Denk
+Yinghai Lu
# Directories transferred
src/acpi
+src/arch
+src/commonlib
+src/console
+src/cpu
+src/device
diff --git a/Documentation/acpi/devicetree.md b/Documentation/acpi/devicetree.md
new file mode 100644
index 0000000000..556c9668f6
--- /dev/null
+++ b/Documentation/acpi/devicetree.md
@@ -0,0 +1,234 @@
+# Adding new devices to a device tree
+
+## Introduction
+
+ACPI exposes a platform-independent interface for operating systems to perform
+power management and other platform-level functions. Some operating systems
+also use ACPI to enumerate devices that are not immediately discoverable, such
+as those behind I2C or SPI busses (in contrast to PCI). This document discusses
+the way that coreboot uses the concept of a "device tree" to generate ACPI
+tables for usage by the operating system.
+
+## Devicetree and overridetree (if applicable)
+
+For mainboards that are organized around a "reference board" or "baseboard"
+model (see ``src/mainboard/google/octopus`` or ``hatch`` for examples), there is
+typically a devicetree.cb file that all boards share, and any differences for a
+specific board ("variant") are captured in the overridetree.cb file. Any
+settings changed in the overridetree take precedence over those in the main
+devicetree. Note, not all mainboards will have the devicetree/overridetree
+distinction, and may only have a devicetree.cb file. Or you can always just
+write the ASL (ACPI Source Language) code yourself.
+
+## Device drivers
+
+Let's take a look at an example entry from
+``src/mainboard/google/hatch/variant/hatch/overridetree.cb``:
+
+```
+device pci 15.0 on
+ chip drivers/i2c/generic
+ register "hid" = ""ELAN0000""
+ register "desc" = ""ELAN Touchpad""
+ register "irq" = "ACPI_IRQ_WAKE_EDGE_LOW(GPP_A21_IRQ)"
+ register "wake" = "GPE0_DW0_21"
+ device i2c 15 on end
+ end
+end # I2C #0
+```
+
+When this entry is processed during ramstage, it will create a device in the
+ACPI SSDT table (all devices in devicetrees end up in the SSDT table). The ACPI
+generation routines in coreboot actually generate the raw bytecode that
+represents the device's structure, but looking at ASL code is easier to
+understand; see below for what the disassembled bytecode looks like:
+
+```
+Scope (\_SB.PCI0.I2C0)
+{
+ Device (D015)
+ {
+ Name (_HID, "ELAN0000") // _HID: Hardware ID
+ Name (_UID, Zero) // _UID: Unique ID
+ Name (_DDN, "ELAN Touchpad") // _DDN: DOS Device Name
+ Method (_STA, 0, NotSerialized) // _STA: Status
+ {
+ Return (0x0F)
+ }
+ Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
+ {
+ I2cSerialBusV2 (0x0015, ControllerInitiated, 400000,
+ AddressingMode7Bit, "\\_SB.PCI0.I2C0",
+ 0x00, ResourceConsumer, , Exclusive, )
+ Interrupt (ResourceConsumer, Edge, ActiveLow, ExclusiveAndWake, ,, )
+ {
+ 0x0000002D,
+ }
+ })
+ Name (_S0W, 0x04) // _S0W: S0 Device Wake State
+ Name (_PRW, Package (0x02) // _PRW: Power Resources for Wake
+ {
+ 0x15, // GPE #21
+ 0x03 // Sleep state S3
+ })
+ }
+}
+```
+
+You can see it generates _HID, _UID, _DDN, _STA, _CRS, _S0W, and _PRW
+names/methods in the Device's scope.
+
+## Utilizing a device driver
+
+The device driver must be enabled for your build. There will be a CONFIG option
+in the Kconfig file in the directory that the driver is in (e.g.,
+``src/drivers/i2c/generic`` contains a Kconfig file; the option here is named
+CONFIG_DRIVERS_I2C_GENERIC). The config option will need to be added to your
+mainboard's Kconfig file (e.g., ``src/mainboard/google/hatch/Kconfig``) in order
+to be compiled into your build.
+
+## Diving into the above example:
+
+Let's take a look at how the devicetree language corresponds to the generated
+ASL.
+
+First, note this:
+
+```
+ chip drivers/i2c/generic
+```
+
+This means that the device driver we're using has a corresponding structure,
+located at ``src/drivers/i2c/generic/chip.h``, named **struct
+drivers_i2c_generic_config** and it contains many properties you can specify to
+be included in the ACPI table.
+
+### hid
+
+```
+ register "hid" = ""ELAN0000""
+```
+
+This corresponds to **const char *hid** in the struct. In the ACPI ASL, it
+translates to:
+
+```
+ Name (_HID, "ELAN0000") // _HID: Hardware ID
+```
+
+under the device. **This property is used to match the device to its driver
+during enumeration in the OS.**
+
+### desc
+
+```
+ register "desc" = ""ELAN Touchpad""
+```
+
+corresponds to **const char *desc** and in ASL:
+
+```
+ Name (_DDN, "ELAN Touchpad") // _DDN: DOS Device Name
+```
+
+### irq
+
+It also adds the interrupt,
+
+```
+ Interrupt (ResourceConsumer, Edge, ActiveLow, ExclusiveAndWake, ,, )
+ {
+ 0x0000002D,
+ }
+```
+
+which comes from:
+
+```
+ register "irq" = "ACPI_IRQ_WAKE_EDGE_LOW(GPP_A21_IRQ)"
+```
+
+The GPIO pin IRQ settings control the "Edge", "ActiveLow", and
+"ExclusiveAndWake" settings seen above (edge means it is an edge-triggered
+interrupt as opposed to level-triggered; active low means the interrupt is
+triggered on a falling edge).
+
+Note that the ACPI_IRQ_WAKE_EDGE_LOW macro informs the platform that the GPIO
+will be routed through SCI (ACPI's System Control Interrupt) for use as a wake
+source. Also note that the IRQ names are SoC-specific, and you will need to
+find the names in your SoC's header file. The ACPI_* macros are defined in
+``src/arch/x86/include/arch/acpi_device.h``.
+
+Using a GPIO as an IRQ requires that it is configured in coreboot correctly.
+This is often done in a mainboard-specific file named ``gpio.c``.
+
+### wake
+
+The last register is:
+
+```
+ register "wake" = "GPE0_DW0_21"
+```
+
+which indicates that the method of waking the system using the touchpad will be
+through a GPE, #21 associated with DW0, which is set up in devicetree.cb from
+this example. The "21" indicates GPP_X21, where GPP_X is mapped onto DW0
+elsewhere in the devicetree.
+
+The last bit of the definition of that device includes:
+
+```
+ device i2c 15 on end
+```
+
+which means it's an I2C device, with 7-bit address 0x15, and the device is "on",
+meaning it will be exposed in the ACPI table. The PCI device that the
+controller is located in determines which I2C bus the device is expected to be
+found on. In this example, this is I2C bus 0. This also determines the ACPI
+"Scope" that the device names and methods will live under, in this case
+"\_SB.PCI0.I2C0".
+
+## Other auto-generated names
+
+(see [ACPI specification
+6.3](https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf)
+for more details on ACPI methods)
+
+### _S0W (S0 Device Wake State)
+_S0W indicates the deepest S0 sleep state this device can wake itself from,
+which in this case is 4, representing _D3cold_.
+
+### _PRW (Power Resources for Wake)
+_PRW indicates the power resources and events required for wake. There are no
+dependent power resources, but the GPE (GPE0_DW0_21) is mentioned here (0x15),
+as well as the deepest sleep state supporting waking the system (3), which is
+S3.
+
+### _STA (Status)
+The _STA method is generated automatically, and its values, 0xF, indicates the
+following:
+
+ Bit [0] – Set if the device is present.
+ Bit [1] – Set if the device is enabled and decoding its resources.
+ Bit [2] – Set if the device should be shown in the UI.
+ Bit [3] – Set if the device is functioning properly (cleared if device failed its diagnostics).
+
+### _CRS (Current resource settings)
+The _CRS method is generated automatically, as the driver knows it is an I2C
+controller, and so specifies how to configure the controller for proper
+operation with the touchpad.
+
+```
+Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
+{
+ I2cSerialBusV2 (0x0015, ControllerInitiated, 400000,
+ AddressingMode7Bit, "\\_SB.PCI0.I2C0",
+ 0x00, ResourceConsumer, , Exclusive, )
+```
+
+## Notes
+
+ - **All fields that are left unspecified in the devicetree are initialized to
+ zero.**
+ - **All devices in devicetrees end up in the SSDT table, and are generated in
+ coreboot's ramstage**
diff --git a/Documentation/coding_style.md b/Documentation/coding_style.md
index 048b8e673e..ac0de4ea9d 100644
--- a/Documentation/coding_style.md
+++ b/Documentation/coding_style.md
@@ -80,11 +80,11 @@ Get a decent editor and don't leave whitespace at the end of lines.
Coding style is all about readability and maintainability using commonly
available tools.
-The limit on the length of lines is 80 columns and this is a strongly
+The limit on the length of lines is 96 columns and this is a strongly
preferred limit.
-Statements longer than 80 columns will be broken into sensible chunks,
-unless exceeding 80 columns significantly increases readability and does
+Statements longer than 96 columns will be broken into sensible chunks,
+unless exceeding 96 columns significantly increases readability and does
not hide information. Descendants are always substantially shorter than
the parent and are placed substantially to the right. The same applies
to function headers with a long argument list. However, never break
diff --git a/Documentation/getting_started/gerrit_guidelines.md b/Documentation/getting_started/gerrit_guidelines.md
index 34104d8e55..735ba3ba3d 100644
--- a/Documentation/getting_started/gerrit_guidelines.md
+++ b/Documentation/getting_started/gerrit_guidelines.md
@@ -46,11 +46,11 @@ clarification, see the Developer's Certificate of Origin in the coreboot
* Let non-trivial patches sit in a review state for at least 24 hours
before submission. Remember that there are coreboot developers in timezones
all over the world, and everyone should have a chance to contribute.
-Trivial patches would be things like whitespace changes or spelling fixes.
-In general, small changes that don’t impact the final binary output. The
+Trivial patches would be things like whitespace changes or spelling fixes,
+in general those that don’t impact the final binary output. The
24-hour period would start at submission, and would be restarted at any
update which significantly changes any part of the patch. Patches can be
-'Fast-tracked' and submitted in under this 24 hour with the agreement of at
+'Fast-tracked' and submitted in under 24 hours with the agreement of at
least 3 +2 votes.
* Do not +2 patches that you authored or own, even for something as trivial
diff --git a/Documentation/getting_started/kconfig.md b/Documentation/getting_started/kconfig.md
index 852ca08bf9..ecdfe62d4a 100644
--- a/Documentation/getting_started/kconfig.md
+++ b/Documentation/getting_started/kconfig.md
@@ -73,9 +73,6 @@ These variables are typically set in the makefiles or on the make command line.
These variables were added to Kconfig specifically for coreboot and are not
included in the Linux version.
-- COREBOOT_BUILD_DIR=path for temporary files. This is used by coreboot’s
- abuild tool.
-
- KCONFIG_STRICT=value. Define to enable warnings as errors. This is enabled
in coreboot, and should not be changed.
diff --git a/Documentation/index.md b/Documentation/index.md
index a2c2878ddb..b880c1c4d5 100644
--- a/Documentation/index.md
+++ b/Documentation/index.md
@@ -161,7 +161,7 @@ for example OpenBSD, is probably the closest cousin of our approach.
Contents:
* [Getting Started](getting_started/index.md)
-* [Rookie Guide](lessons/index.md)
+* [Tutorial](tutorial/index.md)
* [Coding Style](coding_style.md)
* [Project Ideas](contributing/project_ideas.md)
* [Code of Conduct](community/code_of_conduct.md)
@@ -172,6 +172,7 @@ Contents:
* [Intel IFD Binary Extraction](Binary_Extraction.md)
* [Dealing with Untrusted Input in SMM](technotes/2017-02-dealing-with-untrusted-input-in-smm.md)
* [GPIO toggling in ACPI AML](acpi/gpio.md)
+* [Adding devices to a device tree](acpi/devicetree.md)
* [Native Graphics Initialization with libgfxinit](gfx/libgfxinit.md)
* [Display panel-specific documentation](gfx/display-panel.md)
* [Architecture-specific documentation](arch/index.md)
diff --git a/Documentation/lessons/index.md b/Documentation/lessons/index.md
deleted file mode 100644
index 6540e8c4fa..0000000000
--- a/Documentation/lessons/index.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# Rookie Guide
-
-* [Lesson 1: Starting from scratch](lesson1.md)
-* [Lesson 2: Submitting a patch to coreboot.org](lesson2.md)
diff --git a/Documentation/mainboard/emulation/qemu-aarch64.md b/Documentation/mainboard/emulation/qemu-aarch64.md
index ee4c9e7a3b..4df36a9944 100644
--- a/Documentation/mainboard/emulation/qemu-aarch64.md
+++ b/Documentation/mainboard/emulation/qemu-aarch64.md
@@ -7,7 +7,7 @@ as a payload for QEMU/AArch64.
```bash
qemu-system-aarch64 -bios ./build/coreboot.rom \
-M virt,secure=on,virtualization=on -cpu cortex-a53 \
- -nographic -m 8912M
+ -nographic -m 8192M
```
- The default CPU in QEMU for AArch64 is a cortex-a15 which is 32-bit
@@ -17,6 +17,7 @@ have the right to access EL3/EL2 registers. You need to enable EL3/EL2
via `-machine secure=on,virtualization=on`.
- You need to specify the size of memory more than 544 MiB because 512
MiB is reserved for the kernel.
+- The maximum size of memory is 255GiB (-m 261120).
## Building coreboot with an arbitrary FIT payload
There are 3 steps to make coreboot.rom for QEMU/AArch64. If you select
@@ -30,7 +31,7 @@ You can get the DTB from QEMU with the following command.
```
$ qemu-system-aarch64 \
-M virt,dumpdtb=virt.dtb,secure=on,virtualization=on \
- -cpu cortex-a53 -nographic -m 2048M
+ -cpu cortex-a53 -nographic -m 8192M
```
### 2. Build a FIT image with a DTB
diff --git a/Documentation/mainboard/index.md b/Documentation/mainboard/index.md
index 0f3105f85b..ea476eb59f 100644
--- a/Documentation/mainboard/index.md
+++ b/Documentation/mainboard/index.md
@@ -2,6 +2,11 @@
This section contains documentation about coreboot on specific mainboards.
+## ASRock
+
+- [H81M-HDS](asrock/h81m-hds.md)
+- [H110M-DVS](asrock/h110m-dvs.md)
+
## ASUS
- [F2A85-M](asus/f2a85-m.md)
@@ -9,11 +14,6 @@ This section contains documentation about coreboot on specific mainboards.
- [P8H61-M Pro](asus/p8h61-m_pro.md)
- [P8Z77-M Pro](asus/p8z77-m_pro.md)
-## ASRock
-
-- [H81M-HDS](asrock/h81m-hds.md)
-- [H110M-DVS](asrock/h110m-dvs.md)
-
## Cavium
- [CN81XX EVB SFF](cavium/cn8100_sff_evb.md)
@@ -26,12 +26,6 @@ The boards in this section are not real mainboards, but emulators.
- [Qemu RISC-V emulator](emulation/qemu-riscv.md)
- [Qemu AArch64 emulator](emulation/qemu-aarch64.md)
-## Intel
-
-- [DG43GT](intel/dg43gt.md)
-- [IceLake RVP](intel/icelake_rvp.md)
-- [KBLRVP11](intel/kblrvp11.md)
-
## Facebook
- [FBG-1701](facebook/fbg1701.md)
@@ -48,11 +42,6 @@ The boards in this section are not real mainboards, but emulators.
- [Dragonegg](google/dragonegg.md)
-## Open Cellular
-
-- [Elgon](opencellular/elgon.md)
-- [Rotundu](opencellular/rotundu.md)
-
## HP
- [Compaq 8200 Elite SFF](hp/compaq_8200_sff.md)
@@ -63,6 +52,12 @@ The boards in this section are not real mainboards, but emulators.
- [EliteBook common](hp/elitebook_series.md)
- [EliteBook 8760w](hp/8760w.md)
+## Intel
+
+- [DG43GT](intel/dg43gt.md)
+- [IceLake RVP](intel/icelake_rvp.md)
+- [KBLRVP11](intel/kblrvp11.md)
+
## Lenovo
- [Mainboard codenames](lenovo/codenames.md)
@@ -70,10 +65,6 @@ The boards in this section are not real mainboards, but emulators.
- [T4xx common](lenovo/t4xx_series.md)
- [X2xx common](lenovo/x2xx_series.md)
-## Portwell
-
-- [PQ7-M107](portwell/pq7-m107.md)
-
### Sandy Bridge series
- [T420](lenovo/t420.md)
@@ -92,17 +83,23 @@ The boards in this section are not real mainboards, but emulators.
- [MS-7707](msi/ms7707/ms7707.md)
-## PC Engines
+## Open Cellular
-- [APU2](pcengines/apu2.md)
-
-## Roda
-
-- [RK9 Flash Header](roda/rk9/flash_header.md)
+- [Elgon](opencellular/elgon.md)
+- [Rotundu](opencellular/rotundu.md)
## PC Engines
- [APU1](pcengines/apu1.md)
+- [APU2](pcengines/apu2.md)
+
+## Portwell
+
+- [PQ7-M107](portwell/pq7-m107.md)
+
+## Roda
+
+- [RK9 Flash Header](roda/rk9/flash_header.md)
## SiFive
@@ -111,6 +108,7 @@ The boards in this section are not real mainboards, but emulators.
## Supermicro
- [X10SLM+-F](supermicro/x10slm-f.md)
+- [X11 LGA1151 series](supermicro/x11-lga1151-series/index.md)
## UP
diff --git a/Documentation/mainboard/supermicro/x10slm-f.md b/Documentation/mainboard/supermicro/x10slm-f.md
index 2c2e6a84cd..7fae61fc5f 100644
--- a/Documentation/mainboard/supermicro/x10slm-f.md
+++ b/Documentation/mainboard/supermicro/x10slm-f.md
@@ -12,7 +12,7 @@ Please see :doc:`../../northbridge/intel/haswell/mrc.bin`.
```eval_rst
If you haven't already, build the coreboot toolchain as described in
-:doc:`../../lessons/lesson1`.
+:doc:`../../tutorial/part1`.
```
A fully working image should be possible so long as you have the
@@ -135,7 +135,7 @@ for caveats.
can't be used for temperature readings.
- There is no automatic, OS-independent fan control. This is because
- the super I/O hardware monitor can only obtain valid CPU temperature
+ the Super I/O hardware monitor can only obtain valid CPU temperature
readings from the PECI agent, but the required driver doesn't exist
in coreboot. The `coretemp` driver can still be used for accurate CPU
temperature readings from an OS, and hence the OS can do fan control.
diff --git a/Documentation/mainboard/supermicro/x11-lga1151-series/index.md b/Documentation/mainboard/supermicro/x11-lga1151-series/index.md
new file mode 100644
index 0000000000..79d2571009
--- /dev/null
+++ b/Documentation/mainboard/supermicro/x11-lga1151-series/index.md
@@ -0,0 +1,7 @@
+# X11 LGA1151 series
+
+The supermicros X11 series with socket LGA1151 are mostly the same boards with some minor
+differences in internal and external interfaces like available PCIe slots, 1 GbE, 10 GbE,
+IPMI etc. This is why those boards are grouped as "X11 LGA1151 series".
+
+- [X11SSH-TF](x11ssh-tf/x11ssh-tf.md)
diff --git a/Documentation/mainboard/supermicro/x11-lga1151-series/x11ssh-tf/x11ssh-tf.md b/Documentation/mainboard/supermicro/x11-lga1151-series/x11ssh-tf/x11ssh-tf.md
new file mode 100644
index 0000000000..79e7f3e5eb
--- /dev/null
+++ b/Documentation/mainboard/supermicro/x11-lga1151-series/x11ssh-tf/x11ssh-tf.md
@@ -0,0 +1,73 @@
+# Supermicro X11SSH-TF
+
+This section details how to run coreboot on the [Supermicro X11SSH-TF].
+
+## Required proprietary blobs
+
+* [Intel FSP2.0]
+* Intel ME
+
+## Flashing coreboot
+
+The board can be flashed externally using *some* programmers.
+The CH341 was found working, while Dediprog won't detect the chip.
+
+For more details have a look at the [flashing tutorial].
+
+The flash IC can be found between the two PCIe slots near the southbridge:
+
+
+## BMC (IPMI)
+
+This board has an ASPEED [AST2400], which has BMC functionality. The
+BMC firmware resides in a 32 MiB SOIC-16 chip in the corner of the
+mainboard near the [AST2400]. This chip is an [MX25L25635F].
+
+## Known issues
+
+- Intel SGX causes secondary APs to crash (disabled for now).
+- Tianocore doesn't work with Aspeed NGI, as it's text mode only.
+- SMBus / I2C does not work (interrupt timeout)
+
+## Tested and working
+
+- USB ports
+- M.2 2280 NVMe slot
+- 2x 10GB Ethernet
+- SATA
+- RS232
+- VGA on Aspeed
+- Super I/O initialisation
+- ECC DRAM detection
+- PCIe slots
+- TPM on TPM expansion header
+- BMC (IPMI)
+
+## Technology
+
+```eval_rst
++------------------+--------------------------------------------------+
+| CPU | Intel Kaby Lake |
++------------------+--------------------------------------------------+
+| PCH | Intel C236 |
++------------------+--------------------------------------------------+
+| Super I/O | ASPEED AST2400 |
++------------------+--------------------------------------------------+
+| Coprocessor | Intel SPS (server version of the ME) |
++------------------+--------------------------------------------------+
+| Coprocessor | ASPEED AST2400 |
++------------------+--------------------------------------------------+
+```
+
+## Extra links
+
+- [Board manual]
+
+[AST2400]: https://www.aspeedtech.com/products.php?fPath=20&rId=376
+[Board manual]: https://www.supermicro.com/manuals/motherboard/C236/MNL-1783.pdf
+[flashrom]: https://flashrom.org/Flashrom
+[MX25L25635F]: https://media.digikey.com/pdf/Data%20Sheets/Macronix/MX25L25635F.pdf
+[N25Q128A]: https://www.micron.com/~/media/Documents/Products/Data%20Sheet/NOR%20Flash/Serial%20NOR/N25Q/n25q_128mb_3v_65nm.pdf
+[flashing tutorial]: ../../../../flash_tutorial/ext_power.md
+[Intel FSP2.0]: ../../../../soc/intel/fsp/index.md
+[Supermicro X11SSH-TF]: https://www.supermicro.com/en/products/motherboard/X11SSH-TF
diff --git a/Documentation/mainboard/supermicro/x11-lga1151-series/x11ssh-tf/x11ssh-tf_flash.jpg b/Documentation/mainboard/supermicro/x11-lga1151-series/x11ssh-tf/x11ssh-tf_flash.jpg
new file mode 100644
index 0000000000..8ab07f23c7
Binary files /dev/null and b/Documentation/mainboard/supermicro/x11-lga1151-series/x11ssh-tf/x11ssh-tf_flash.jpg differ
diff --git a/Documentation/security/intel/txt.md b/Documentation/security/intel/txt.md
index f67b63942e..f80a731e81 100644
--- a/Documentation/security/intel/txt.md
+++ b/Documentation/security/intel/txt.md
@@ -90,11 +90,11 @@ correct state. If it's not the SINIT ACM will reset the platform.
## For developers
### Configuring Intel TXT in Kconfig
-Enable ``TEE_INTEL_TXT`` and set the following:
+Enable ``INTEL_TXT`` and set the following:
-``TEE_INTEL_TXT_BIOSACM_FILE`` to the path of the BIOS ACM provided by Intel
+``INTEL_TXT_BIOSACM_FILE`` to the path of the BIOS ACM provided by Intel
-``TEE_INTEL_TXT_SINITACM_FILE`` to the path of the SINIT ACM provided by Intel
+``INTEL_TXT_SINITACM_FILE`` to the path of the SINIT ACM provided by Intel
### Print TXT status as early as possible
Add platform code to print the TXT status as early as possible, as the register
is cleared on cold reset.
diff --git a/Documentation/soc/intel/fsp/index.md b/Documentation/soc/intel/fsp/index.md
index 6269445ff3..cd7fe0b302 100644
--- a/Documentation/soc/intel/fsp/index.md
+++ b/Documentation/soc/intel/fsp/index.md
@@ -45,6 +45,8 @@ those are fixed. If possible a workaround is described here as well.
* [FSP Specification 2.0](https://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/fsp-architecture-spec-v2.pdf)
+* [FSP Specification 2.1](https://cdrdv2.intel.com/v1/dl/getContent/611786)
+
## Additional Features in FSP 2.1 specification
- [PPI](ppi/ppi.md)
diff --git a/Documentation/superio/common/ssdt.md b/Documentation/superio/common/ssdt.md
new file mode 100644
index 0000000000..4353cde3aa
--- /dev/null
+++ b/Documentation/superio/common/ssdt.md
@@ -0,0 +1,56 @@
+# SuperIO SSTD generator
+
+This page describes the common SSDT ACPI generator for SuperIO chips that can
+be found in coreboot.
+
+## Functional description
+
+In order to automatically generate ACPI functions you need to add
+a new `chip superio/common` and `device pnp xx.0 on` to your devicetree.
+
+The xx denotes the hexadecimal address of the SuperIO.
+
+Place the regular LDN pnp devices behind those two entries.
+
+The code will automatically guess the function based on the decoded
+I/O range and ISA IRQ number.
+
+## Example devicetree.cb
+
+This example is based on AST2400.
+
+```code
+# Add a "container" for proper ACPI code generation
+chip superio/common
+ device pnp 2e.0 on # just for the base device, not for the LDNs
+ chip superio/aspeed/ast2400
+ device pnp 2e.0 off end
+ device pnp 2e.2 on # SUART1
+ io 0x60 = 0x3f8
+ irq 0x70 = 4
+ end
+ device pnp 2e.3 on # SUART2
+ io 0x60 = 0x2f8
+ irq 0x70 = 3
+ end
+ device pnp 2e.4 on # SWC
+ io 0x60 = 0xa00
+ io 0x62 = 0xa10
+ io 0x64 = 0xa20
+ io 0x66 = 0xa30
+ irq 0x70 = 0
+ end
+ end
+ end
+end
+```
+
+## TODO
+
+1) Add ACPI HIDs to every SuperIO driver
+2) Don't guess ACPI HID of LDNs if it's known
+3) Add "enter config" and "exit config" bytes
+4) Generate support methods that allow
+ * Setting resource settings at runtime
+ * Getting resource settings at runtime
+ * Disabling LDNs at runtime
diff --git a/Documentation/superio/index.md b/Documentation/superio/index.md
index eef4d579ef..39965fde07 100644
--- a/Documentation/superio/index.md
+++ b/Documentation/superio/index.md
@@ -5,3 +5,6 @@ This section contains documentation about coreboot on specific SuperIOs.
## Nuvoton
- [NPCD378](nuvoton/npcd378.md)
+
+## Common
+- [SSDT generator for generic SuperIOs](common/ssdt.md)
diff --git a/Documentation/tutorial/index.md b/Documentation/tutorial/index.md
new file mode 100644
index 0000000000..48dfbe5da6
--- /dev/null
+++ b/Documentation/tutorial/index.md
@@ -0,0 +1,4 @@
+# Tutorial
+
+* [Part 1: Starting from scratch](part1.md)
+* [Part 2: Submitting a patch to coreboot.org](part2.md)
diff --git a/Documentation/lessons/lesson1.md b/Documentation/tutorial/part1.md
similarity index 98%
rename from Documentation/lessons/lesson1.md
rename to Documentation/tutorial/part1.md
index bbb3eb5582..75a9ba375f 100644
--- a/Documentation/lessons/lesson1.md
+++ b/Documentation/tutorial/part1.md
@@ -1,5 +1,5 @@
-coreboot Lesson 1: Starting from scratch
-========================================
+Tutorial, part 1: Starting from scratch
+===========================================
From a fresh Ubuntu 16.04 or 18.04 install, here are all the steps required for
a very basic build:
diff --git a/Documentation/lessons/lesson2.md b/Documentation/tutorial/part2.md
similarity index 99%
rename from Documentation/lessons/lesson2.md
rename to Documentation/tutorial/part2.md
index ae70c70cbc..e5322186f9 100644
--- a/Documentation/lessons/lesson2.md
+++ b/Documentation/tutorial/part2.md
@@ -1,4 +1,4 @@
-# coreboot Lesson 2: Submitting a patch to coreboot.org
+# Tutorial, part 2: Submitting a patch to coreboot.org
## Part 1: Setting up an account at coreboot.org
diff --git a/Documentation/vendorcode/index.md b/Documentation/vendorcode/index.md
index 3374eafc67..ffa5ed5041 100644
--- a/Documentation/vendorcode/index.md
+++ b/Documentation/vendorcode/index.md
@@ -5,3 +5,4 @@ This section contains documentation about coreboot on specific vendorcode.
## Vendor
- [Cavium](cavium/index.md)
+- [Eltan](eltan/index.md)
diff --git a/Makefile b/Makefile
index 317a8eb1cf..35a4b32c2a 100644
--- a/Makefile
+++ b/Makefile
@@ -30,6 +30,9 @@
## SUCH DAMAGE.
##
+ifneq ($(words $(CURDIR)),1)
+ $(error Error: Path to the main directory cannot contain spaces)
+endif
top := $(CURDIR)
src := src
srck := $(top)/util/kconfig
@@ -42,6 +45,12 @@ absobj := $(abspath $(obj))
COREBOOT_EXPORTS := COREBOOT_EXPORTS
COREBOOT_EXPORTS += top src srck obj objutil objk
+# reproducible builds
+LANG:=C
+LC_ALL:=C
+TZ:=UTC0
+COREBOOT_EXPORTS += LANG LC_ALL TZ
+
DOTCONFIG ?= $(top)/.config
KCONFIG_CONFIG = $(DOTCONFIG)
KCONFIG_AUTOADS := $(obj)/cb-config.ads
@@ -129,6 +138,12 @@ NOMKDIR:=1
endif
endif
+.xcompile: util/xcompile/xcompile
+ rm -f $@
+ $< $(XGCCPATH) > $@.tmp
+ \mv -f $@.tmp $@ 2> /dev/null
+ rm -f $@.tmp
+
-include $(TOPLEVEL)/site-local/Makefile.inc
ifeq ($(NOCOMPILE),1)
@@ -148,12 +163,6 @@ include $(DOTCONFIG)
# to silence stupid warnings about a file that would be generated anyway.
$(if $(wildcard .xcompile)$(NOCOMPILE),,$(eval $(shell util/xcompile/xcompile $(XGCCPATH) > .xcompile || rm -f .xcompile)))
-.xcompile: util/xcompile/xcompile
- rm -f $@
- $< $(XGCCPATH) > $@.tmp
- \mv -f $@.tmp $@ 2> /dev/null
- rm -f $@.tmp
-
-include .xcompile
ifneq ($(XCOMPILE_COMPLETE),1)
diff --git a/Makefile.inc b/Makefile.inc
index c275d1efa5..86764045a6 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -402,7 +402,7 @@ endif
CFLAGS_common += -pipe -g -nostdinc -std=gnu11
CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs -Wimplicit-fallthrough
-CFLAGS_common += -Wstrict-aliasing -Wshadow -Wdate-time -Wtype-limits
+CFLAGS_common += -Wstrict-aliasing -Wshadow -Wdate-time -Wtype-limits -Wvla
CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer
CFLAGS_common += -ffunction-sections -fdata-sections -fno-pie
ifeq ($(CONFIG_COMPILER_GCC),y)
@@ -497,14 +497,14 @@ build_h_exports := BUILD_TIMELESS KERNELVERSION COREBOOT_EXTRA_VERSION
# Report new `build.ht` as dependency if `build.h` differs.
build_h_check := \
export $(foreach exp,$(build_h_exports),$(exp)="$($(exp))"); \
- util/genbuild_h/genbuild_h.sh >$(build_h)t 2>/dev/null; \
+ util/genbuild_h/genbuild_h.sh .xcompile >$(build_h)t 2>/dev/null; \
cmp -s $(build_h)t $(build_h) >/dev/null 2>&1 || echo $(build_h)t
$(build_h): $$(shell $$(build_h_check))
@printf " GEN build.h\n"
mv $< $@
-build-dirs:
+build-dirs $(objcbfs) $(objgenerated):
mkdir -p $(objcbfs) $(objgenerated)
#######################################################################
@@ -646,7 +646,7 @@ install-git-commit-clangfmt:
include util/crossgcc/Makefile.inc
.PHONY: tools
-tools: $(objutil)/kconfig/conf $(CBFSTOOL) $(objutil)/cbfstool/cbfs-compression-tool $(FMAPTOOL) $(RMODTOOL) $(IFWITOOL) $(objutil)/nvramtool/nvramtool $(ROMCC_BIN) $(objutil)/sconfig/sconfig $(IFDTOOL) $(CBOOTIMAGE) $(AMDFWTOOL) $(AMDCOMPRESS) $(FUTILITY) $(BINCFG) $(IFITTOOL)
+tools: $(objutil)/kconfig/conf $(objutil)/kconfig/toada $(CBFSTOOL) $(objutil)/cbfstool/cbfs-compression-tool $(FMAPTOOL) $(RMODTOOL) $(IFWITOOL) $(objutil)/nvramtool/nvramtool $(ROMCC_BIN) $(objutil)/sconfig/sconfig $(IFDTOOL) $(CBOOTIMAGE) $(AMDFWTOOL) $(AMDCOMPRESS) $(FUTILITY) $(BINCFG) $(IFITTOOL)
###########################################################################
# Common recipes for all stages
@@ -706,7 +706,7 @@ $(objcbfs)/bootblock.raw.bin: $(objcbfs)/bootblock.raw.elf
$(OBJCOPY_bootblock) -O binary $< $@
ifneq ($(CONFIG_HAVE_BOOTBLOCK),y)
-$(objcbfs)/bootblock.bin:
+$(objcbfs)/bootblock.bin: $(objcbfs)
dd if=/dev/zero of=$@ bs=64 count=1
endif
diff --git a/configs/config.intel_galileo_gen2.debug b/configs/config.intel_galileo_gen2.debug
index ceea7d0af7..f4fdb2d7eb 100644
--- a/configs/config.intel_galileo_gen2.debug
+++ b/configs/config.intel_galileo_gen2.debug
@@ -3,7 +3,6 @@ CONFIG_VENDOR_INTEL=y
CONFIG_BOARD_INTEL_GALILEO=y
# CONFIG_FSP_DEBUG_ALL is not set
CONFIG_DISPLAY_MTRRS=y
-CONFIG_DISPLAY_SMM_MEMORY_MAP=y
CONFIG_DISPLAY_ESRAM_LAYOUT=y
CONFIG_BOOTBLOCK_NORMAL=y
CONFIG_ON_DEVICE_ROM_LOAD=y
diff --git a/payloads/coreinfo/Makefile b/payloads/coreinfo/Makefile
index 1e9eb80d20..34c45d9855 100644
--- a/payloads/coreinfo/Makefile
+++ b/payloads/coreinfo/Makefile
@@ -83,7 +83,7 @@ OBJCOPY := $(OBJCOPY_$(ARCH-y))
LPCC := CC="$(CC)" $(LIBPAYLOAD_OBJ)/bin/lpgcc
LPAS := AS="$(AS)" $(LIBPAYLOAD_OBJ)/bin/lpas
-CFLAGS += -Wall -Wextra -Wmissing-prototypes -Werror
+CFLAGS += -Wall -Wextra -Wmissing-prototypes -Wvla -Werror
CFLAGS += -Os -fno-builtin $(CFLAGS_$(ARCH-y)) $(INCLUDES)
ifneq ($(strip $(HAVE_DOTCONFIG)),)
diff --git a/payloads/external/LinuxBoot/targets/linux.mk b/payloads/external/LinuxBoot/targets/linux.mk
index e32ad1e21b..8be0926eb0 100644
--- a/payloads/external/LinuxBoot/targets/linux.mk
+++ b/payloads/external/LinuxBoot/targets/linux.mk
@@ -29,11 +29,13 @@ tarball_dir:=$(project_dir)/tarball
decompress_flag=.done
OBJCOPY:=$(LINUXBOOT_CROSS_COMPILE)objcopy
+KERNEL_MAKE_FLAGS = \
+ ARCH=$(ARCH-y)
ifeq ($(CONFIG_LINUXBOOT_KERNEL_CUSTOM),y)
kernel_version:=$(CONFIG_LINUXBOOT_KERNEL_CUSTOM_VERSION)
else
- kernel_version:=$(shell curl -s -k https://www.kernel.org/feeds/kdist.xml | \
+ kernel_version:=$(shell curl -sS -k https://www.kernel.org/feeds/kdist.xml | \
sed -n -e 's@.*\(.*\).*@\1@p' | \
awk -F ',' '/$(TAG-y)/{ print $$3 }' | \
head -n 1)
@@ -67,7 +69,7 @@ ifneq ($(shell [[ -d "$(kernel_dir)" && -f "$(kernel_dir)/$(decompress_flag)" ]]
if [[ ! -f $(tarball_dir)/$(kernel_tarball).xz && ! -f $(tarball_dir)/$(kernel_tarball).xz ]]; then \
echo " WWW $(kernel_tarball).xz"; \
cd $(tarball_dir); \
- curl -OLs "$(kernel_mirror_path)/$(kernel_tarball).xz"; \
+ curl -OLSs "$(kernel_mirror_path)/$(kernel_tarball).xz"; \
cd $(pwd); \
fi
endif
@@ -90,15 +92,15 @@ ifeq ($(CONFIG_LINUXBOOT_KERNEL_CUSTOM_CONFIG),y)
else
cp $(ARCH-y)/defconfig $(kernel_dir)/.config
endif
- $(MAKE) -C $(kernel_dir) olddefconfig ARCH=$(ARCH-y)
+ $(MAKE) -C $(kernel_dir) $(KERNEL_MAKE_FLAGS) olddefconfig
build: $(kernel_dir)/.config
@echo " MAKE Linux $(kernel_version)"
ifeq ($(CONFIG_LINUXBOOT_KERNEL_BZIMAGE),y)
- $(MAKE) -C $(kernel_dir) CROSS_COMPILE=$(LINUXBOOT_CROSS_COMPILE) ARCH=$(ARCH-y) bzImage
+ $(MAKE) -C $(kernel_dir) $(KERNEL_MAKE_FLAGS) CROSS_COMPILE=$(LINUXBOOT_CROSS_COMPILE) bzImage
else
ifeq ($(CONFIG_LINUXBOOT_KERNEL_UIMAGE),y)
- $(MAKE) -C $(kernel_dir) CROSS_COMPILE=$(LINUXBOOT_CROSS_COMPILE) ARCH=$(ARCH-y) vmlinux
+ $(MAKE) -C $(kernel_dir) $(KERNEL_MAKE_FLAGS) CROSS_COMPILE=$(LINUXBOOT_CROSS_COMPILE) vmlinux
endif
endif
diff --git a/payloads/external/Makefile.inc b/payloads/external/Makefile.inc
index df168f2bee..f6417fd946 100644
--- a/payloads/external/Makefile.inc
+++ b/payloads/external/Makefile.inc
@@ -29,6 +29,11 @@ endif
ifeq ($(CONFIG_PAYLOAD_DEPTHCHARGE),y)
PAYLOAD_CONFIG=payloads/external/depthcharge/depthcharge/.config
$(PAYLOAD_CONFIG): payloads/external/depthcharge/depthcharge/build/depthcharge.elf
+ifneq ($(CONFIG_MAINBOARD_DEPTHCHARGE),)
+ BOARD=$(CONFIG_MAINBOARD_DEPTHCHARGE)
+else
+ BOARD=$(call ws_to_under,$(call strip_quotes,$(call tolower,$(CONFIG_MAINBOARD_PART_NUMBER))))
+endif
#TODO: Figure out version
endif
@@ -114,7 +119,7 @@ endif
payloads/external/depthcharge/depthcharge/build/depthcharge.elf depthcharge: $(DOTCONFIG) $(CBFSTOOL)
$(MAKE) -C payloads/external/depthcharge \
- BOARD=$(call ws_to_under,$(call strip_quotes,$(call tolower,$(CONFIG_MAINBOARD_PART_NUMBER)))) \
+ BOARD=$(BOARD) \
MFLAGS= MAKEFLAGS= \
DEPTHCHARGE_MASTER=$(CONFIG_DEPTHCHARGE_MASTER) \
DEPTHCHARGE_STABLE=$(CONFIG_DEPTHCHARGE_STABLE) \
@@ -128,14 +133,14 @@ payloads/external/tianocore/tianocore/Build/UEFIPAYLOAD.fd tianocore: $(DOTCONFI
$(MAKE) -C payloads/external/tianocore all \
HOSTCC="$(HOSTCC)" \
CC="$(HOSTCC)" \
- CONFIG_TIANOCORE_MASTER=$(CONFIG_TIANOCORE_MASTER) \
- CONFIG_TIANOCORE_STABLE=$(CONFIG_TIANOCORE_STABLE) \
- CONFIG_TIANOCORE_REVISION=$(CONFIG_TIANOCORE_REVISION) \
CONFIG_TIANOCORE_REVISION_ID=$(CONFIG_TIANOCORE_REVISION_ID) \
CONFIG_TIANOCORE_DEBUG=$(CONFIG_TIANOCORE_DEBUG) \
CONFIG_TIANOCORE_TARGET_IA32=$(CONFIG_TIANOCORE_TARGET_IA32) \
CONFIG_TIANOCORE_USE_8254_TIMER=$(CONFIG_TIANOCORE_USE_8254_TIMER) \
CONFIG_TIANOCORE_BOOTSPLASH_FILE=$(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \
+ CONFIG_TIANOCORE_UEFIPAYLOAD=$(CONFIG_TIANOCORE_UEFIPAYLOAD) \
+ CONFIG_TIANOCORE_COREBOOTPAYLOAD=$(CONFIG_TIANOCORE_COREBOOTPAYLOAD) \
+ CONFIG_MMCONF_BASE_ADDRESS=$(CONFIG_MMCONF_BASE_ADDRESS) \
GCC_CC_x86_32=$(GCC_CC_x86_32) \
GCC_CC_x86_64=$(GCC_CC_x86_64) \
GCC_CC_arm=$(GCC_CC_arm) \
diff --git a/payloads/external/depthcharge/Kconfig b/payloads/external/depthcharge/Kconfig
index 9fd1268b91..89c81ef70e 100644
--- a/payloads/external/depthcharge/Kconfig
+++ b/payloads/external/depthcharge/Kconfig
@@ -35,6 +35,11 @@ config PAYLOAD_FILE
string
default "payloads/external/depthcharge/depthcharge/build/depthcharge.elf"
+config MAINBOARD_DEPTHCHARGE
+ string ""
+ help
+ Override BOARD setting for depthcharge
+
config LP_DEFCONFIG_OVERRIDE
bool "Use default libpayload config"
help
diff --git a/payloads/external/tianocore/Kconfig b/payloads/external/tianocore/Kconfig
index d8b7d9251d..7717917f94 100644
--- a/payloads/external/tianocore/Kconfig
+++ b/payloads/external/tianocore/Kconfig
@@ -7,38 +7,32 @@ config PAYLOAD_FILE
The result of a corebootPkg build
choice
- prompt "Tianocore version"
- default TIANOCORE_STABLE
+ prompt "Tianocore payload"
+ default TIANOCORE_COREBOOTPAYLOAD
help
- Select which version of Tianocore to build (default is to build stable)
- stable: MrChromebox's customized version of Tianocore which works on most
+ Select which type of payload Tianocore will build (default is CorebootPayload)
+ CorebootPayload: MrChromebox's customized version of Tianocore which works on most
(all?) x86_64 devices
- revision: use specific commit or branch to build Tianocore (specified by user)
+ UEFIPayload: Use upstream Tianocore payload from https://github.com/tianocore/edk2
-config TIANOCORE_STABLE
- bool "stable"
+config TIANOCORE_COREBOOTPAYLOAD
+ bool "CorebootPayload"
help
Select this option to build using MrChromebox's custom Tianocore tree
i.e. a version of Tianocore that builds without any errors and just works.
-config TIANOCORE_REVISION
- bool "git revision"
+config TIANOCORE_UEFIPAYLOAD
+ bool "UEFIPayload"
help
- Select this option if you have a specific commit or branch
- that you want to use from either MrChromebox's tree or upstream
- EDK2 from which to build Tianocore.
-
- You will be able to specify the name of a branch or a commit id
- later.
+ Select this option if you want to use upstream EDK2 to build Tianocore.
endchoice
config TIANOCORE_REVISION_ID
string "Insert a commit's SHA-1 or a branch name"
- depends on TIANOCORE_REVISION
- default "upstream/master"
help
- The commit's SHA-1 or branch name of the revision to use.
+ The commit's SHA-1 or branch name of the revision to use. Choose "upstream/master"
+ for master branch of Tianocore release on github.
choice
prompt "Target architecture"
@@ -89,7 +83,7 @@ config TIANOCORE_USE_8254_TIMER
config TIANOCORE_BOOTSPLASH_IMAGE
bool "Use a custom bootsplash image"
- depends on TIANOCORE_STABLE
+ depends on TIANOCORE_COREBOOTPAYLOAD
help
Select this option if you have a bootsplash image that you would
like to be used. If this option is not selected, the default
@@ -98,6 +92,7 @@ config TIANOCORE_BOOTSPLASH_IMAGE
config TIANOCORE_BOOTSPLASH_FILE
string "Tianocore Bootsplash path and filename"
depends on TIANOCORE_BOOTSPLASH_IMAGE
+ depends on TIANOCORE_COREBOOTPAYLOAD
default "bootsplash.bmp"
help
The path and filename of the file to use as graphical bootsplash
diff --git a/payloads/external/tianocore/Kconfig.name b/payloads/external/tianocore/Kconfig.name
index a56d248bab..7b0b300351 100644
--- a/payloads/external/tianocore/Kconfig.name
+++ b/payloads/external/tianocore/Kconfig.name
@@ -1,5 +1,5 @@
config PAYLOAD_TIANOCORE
- bool "Tianocore coreboot payload package"
+ bool "Tianocore payload"
depends on ARCH_X86
help
Select this option if you want to build a coreboot image
diff --git a/payloads/external/tianocore/Makefile b/payloads/external/tianocore/Makefile
index f208e5952f..7adb700a6e 100644
--- a/payloads/external/tianocore/Makefile
+++ b/payloads/external/tianocore/Makefile
@@ -22,9 +22,19 @@ project_git_repo=https://github.com/mrchromebox/edk2
project_git_branch=coreboot_fb
upstream_git_repo=https://github.com/tianocore/edk2
+ifeq ($(CONFIG_TIANOCORE_UEFIPAYLOAD),y)
+bootloader=UefiPayloadPkg
+build_flavor=-D BOOTLOADER=COREBOOT -D PCIE_BASE=$(CONFIG_MMCONF_BASE_ADDRESS)
+TAG=upstream/master
+else
+bootloader=CorebootPayloadPkg
# STABLE revision is MrChromebox's coreboot framebuffer (coreboot_fb) branch
-TAG-$(CONFIG_TIANOCORE_STABLE)=origin/$(project_git_branch)
-TAG-$(CONFIG_TIANOCORE_REVISION)=$(CONFIG_TIANOCORE_REVISION_ID)
+TAG=origin/$(project_git_branch)
+endif
+
+ifneq ($(CONFIG_TIANOCORE_REVISION_ID),)
+TAG=$(CONFIG_TIANOCORE_REVISION_ID)
+endif
export EDK_TOOLS_PATH=$(project_dir)/BaseTools
@@ -39,9 +49,9 @@ TIMER=-DUSE_HPET_TIMER
endif
ifeq ($(CONFIG_TIANOCORE_TARGET_IA32), y)
- BUILD_STR=-a IA32 -t COREBOOT -p CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc -b $(BUILD_TYPE) $(TIMER)
+ BUILD_STR=-a IA32 -t COREBOOT -p $(bootloader)/$(bootloader)Ia32.dsc -b $(BUILD_TYPE) $(TIMER) $(build_flavor)
else
- BUILD_STR=-a IA32 -a X64 -t COREBOOT -p CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc -b $(BUILD_TYPE) $(TIMER)
+ BUILD_STR=-a IA32 -a X64 -t COREBOOT -p $(bootloader)/$(bootloader)Ia32X64.dsc -b $(BUILD_TYPE) $(TIMER) $(build_flavor)
endif
all: clean build
@@ -56,13 +66,13 @@ update: $(project_dir)
cd $(project_dir); \
echo " Fetching new commits from the $(project_name) repo"; \
git fetch --multiple origin upstream 2>/dev/null; \
- if ! git rev-parse --verify -q $(TAG-y) >/dev/null; then \
- echo " $(TAG-y) is not a valid git reference"; \
+ if ! git rev-parse --verify -q $(TAG) >/dev/null; then \
+ echo " $(TAG) is not a valid git reference"; \
exit 1; \
fi; \
if git describe --all --dirty | grep -qv dirty; then \
- echo " Checking out $(project_name) revision $(TAG-y)"; \
- git checkout --detach $(TAG-y); \
+ echo " Checking out $(project_name) revision $(TAG)"; \
+ git checkout --detach $(TAG); \
else \
echo " Working directory not clean; will not overwrite"; \
fi
@@ -80,7 +90,7 @@ checktools:
build: update checktools
unset CC; $(MAKE) -C $(project_dir)/BaseTools
- echo " build $(project_name) $(TAG-y)"
+ echo " build $(project_name) $(TAG)"
if [ -n $(CONFIG_TIANOCORE_BOOTSPLASH_FILE) ]; then \
echo " Copying custom bootsplash image"; \
case "$(CONFIG_TIANOCORE_BOOTSPLASH_FILE)" in \
@@ -99,7 +109,7 @@ build: update checktools
cat ../tools_def.txt >> $(project_dir)/Conf/tools_def.txt; \
fi; \
build $(BUILD_STR); \
- mv $(project_dir)/Build/CorebootPayloadPkg*/*/FV/UEFIPAYLOAD.fd $(project_dir)/Build/UEFIPAYLOAD.fd; \
+ mv $(project_dir)/Build/$(bootloader)*/*/FV/UEFIPAYLOAD.fd $(project_dir)/Build/UEFIPAYLOAD.fd; \
git checkout CorebootPayloadPkg/Logo/Logo.bmp > /dev/null 2>&1 || true
clean:
diff --git a/payloads/libpayload/Makefile.inc b/payloads/libpayload/Makefile.inc
index f0aaa2727f..4863d3f1da 100644
--- a/payloads/libpayload/Makefile.inc
+++ b/payloads/libpayload/Makefile.inc
@@ -62,7 +62,7 @@ INCLUDES := -Iinclude -Iinclude/$(ARCHDIR-y) -I$(obj) -include include/kconfig.h
CFLAGS += $(EXTRA_CFLAGS) $(INCLUDES) -Os -pipe -nostdinc -ggdb3
CFLAGS += -nostdlib -fno-builtin -ffreestanding -fomit-frame-pointer
CFLAGS += -ffunction-sections -fdata-sections
-CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
+CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wvla
CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs -Wimplicit-fallthrough
CFLAGS += -Wstrict-aliasing -Wshadow -Werror
diff --git a/payloads/libpayload/drivers/usb/usb.c b/payloads/libpayload/drivers/usb/usb.c
index 9c9854da76..4004def9d9 100644
--- a/payloads/libpayload/drivers/usb/usb.c
+++ b/payloads/libpayload/drivers/usb/usb.c
@@ -265,6 +265,8 @@ usb_decode_mps0(usb_speed speed, u8 bMaxPacketSize0)
}
return bMaxPacketSize0;
case SUPER_SPEED:
+ /* Intentional fallthrough */
+ case SUPER_SPEED_PLUS:
if (bMaxPacketSize0 != 9) {
usb_debug("Invalid MPS0: 0x%02x\n", bMaxPacketSize0);
bMaxPacketSize0 = 9;
@@ -284,6 +286,8 @@ int speed_to_default_mps(usb_speed speed)
case HIGH_SPEED:
return 64;
case SUPER_SPEED:
+ /* Intentional fallthrough */
+ case SUPER_SPEED_PLUS:
default:
return 512;
}
@@ -319,6 +323,8 @@ usb_decode_interval(usb_speed speed, const endpoint_type type, const unsigned ch
return LOG2(bInterval);
}
case SUPER_SPEED:
+ /* Intentional fallthrough */
+ case SUPER_SPEED_PLUS:
switch (type) {
case ISOCHRONOUS: case INTERRUPT:
return bInterval - 1;
@@ -657,7 +663,7 @@ usb_detach_device(hci_t *controller, int devno)
int
usb_attach_device(hci_t *controller, int hubaddress, int port, usb_speed speed)
{
- static const char* speeds[] = { "full", "low", "high", "super" };
+ static const char *speeds[] = { "full", "low", "high", "super", "ultra" };
usb_debug ("%sspeed device\n", (speed < sizeof(speeds) / sizeof(char*))
? speeds[speed] : "invalid value - no");
int newdev = set_address (controller, speed, port, hubaddress);
@@ -692,6 +698,14 @@ usb_generic_init (usbdev_t *dev)
}
}
+/*
+ * returns the speed is above SUPER_SPEED or not
+ */
+_Bool is_usb_speed_ss(usb_speed speed)
+{
+ return (speed == SUPER_SPEED || speed == SUPER_SPEED_PLUS);
+}
+
/*
* returns the address of the closest USB2.0 hub, which is responsible for
* split transactions, along with the number of the used downstream port
diff --git a/payloads/libpayload/drivers/usb/usbhub.c b/payloads/libpayload/drivers/usb/usbhub.c
index 340e47ae3d..87c58169c5 100644
--- a/payloads/libpayload/drivers/usb/usbhub.c
+++ b/payloads/libpayload/drivers/usb/usbhub.c
@@ -35,15 +35,39 @@
/* assume that host_to_device is overwritten if necessary */
#define DR_PORT gen_bmRequestType(host_to_device, class_type, other_recp)
/* status (and status change) bits */
-#define PORT_CONNECTION 0x1
-#define PORT_ENABLE 0x2
-#define PORT_RESET 0x10
+#define PORT_CONNECTION 0x01
+#define PORT_ENABLE 0x02
+#define PORT_SUSPEND 0x04
+#define PORT_OVER_CURRENT 0x08
+#define PORT_RESET 0x10
+#define BH_PORT_RESET 0x20
+#define PORT_LINK_STATE 0x40
+#define PORT_CONFIG_ERROR 0x80
/* feature selectors (for setting / clearing features) */
-#define SEL_PORT_RESET 0x4
-#define SEL_PORT_POWER 0x8
-#define SEL_C_PORT_CONNECTION 0x10
+#define SEL_PORT_RESET 0x04
+#define SEL_PORT_POWER 0x08
+#define SEL_C_PORT_CONNECTION 0x10
+#define SEL_C_PORT_ENABLE 0x11
+#define SEL_C_PORT_SUSPEND 0x12
+#define SEL_C_PORT_OVER_CURRENT 0x13
+#define SEL_C_PORT_RESET 0x14
+#define SEL_C_PORT_LINK_STATE 0x19
+#define SEL_C_PORT_CONFIG_ERROR 0x1a
+#define SEL_C_BH_PORT_RESET 0x1d
/* request type (USB 3.0 hubs only) */
-#define SET_HUB_DEPTH 12
+#define SET_HUB_DEPTH 12
+
+static endpoint_t *
+usb_hub_interrupt_ep(usbdev_t *const dev)
+{
+ int i;
+ for (i = 0; i < dev->num_endp; ++i) {
+ if (dev->endpoints[i].type == INTERRUPT &&
+ dev->endpoints[i].direction == IN)
+ return &dev->endpoints[i];
+ }
+ return NULL;
+}
static int
usb_hub_port_status_changed(usbdev_t *const dev, const int port)
@@ -96,8 +120,8 @@ usb_hub_port_speed(usbdev_t *const dev, const int port)
int ret = get_status (dev, port, DR_PORT, sizeof(buf), buf);
if (ret >= 0 && (buf[0] & PORT_ENABLE)) {
/* SuperSpeed hubs can only have SuperSpeed devices. */
- if (dev->speed == SUPER_SPEED)
- return SUPER_SPEED;
+ if (is_usb_speed_ss(dev->speed))
+ return dev->speed;
/*[bit] 10 9 (USB 2.0 port status word)
* 0 0 full speed
@@ -169,14 +193,100 @@ usb_hub_port_initialize(usbdev_t *const dev, const int port)
return;
if (buf[1] & PORT_CONNECTION)
clear_feature(dev, port, SEL_C_PORT_CONNECTION, DR_PORT);
- if (buf[0] & PORT_CONNECTION)
+ if (buf[0] & PORT_CONNECTION) {
+ usb_debug("usbhub: Port coldplug at %d\n", port);
generic_hub_scanport(dev, port);
+ }
+}
+
+static int
+usb_hub_handle_port_change(usbdev_t *const dev, const int port)
+{
+ static const struct {
+ unsigned short change_bit;
+ unsigned short clear_sel;
+ } change_bits[] = {
+ { PORT_CONNECTION, SEL_C_PORT_CONNECTION },
+ { PORT_ENABLE, SEL_C_PORT_ENABLE },
+ { PORT_SUSPEND, SEL_C_PORT_SUSPEND },
+ { PORT_OVER_CURRENT, SEL_C_PORT_OVER_CURRENT },
+ { PORT_RESET, SEL_C_PORT_RESET },
+ { BH_PORT_RESET, SEL_C_BH_PORT_RESET },
+ { PORT_LINK_STATE, SEL_C_PORT_LINK_STATE },
+ { PORT_CONFIG_ERROR, SEL_C_PORT_CONFIG_ERROR },
+ };
+ int ret = 0;
+ unsigned int i;
+ unsigned short checked_bits = 0;
+ unsigned short buf[2] = { 0, 0 };
+
+ ret = get_status(dev, port, DR_PORT, sizeof(buf), buf);
+ if (ret < 0)
+ return ret;
+
+ /*
+ * Second word holds the change bits. The interrupt transfer shows
+ * a logical or of these bits, so we have to clear them all.
+ */
+ for (i = 0; i < ARRAY_SIZE(change_bits); ++i) {
+ if (buf[1] & change_bits[i].change_bit)
+ clear_feature(dev, port, change_bits[i].clear_sel, DR_PORT);
+ checked_bits |= change_bits[i].change_bit;
+ }
+ if (buf[1] & ~checked_bits)
+ usb_debug("usbhub: Spurious change bit at port %d\n", port);
+
+ /* Now, handle connection changes. */
+ if (buf[1] & PORT_CONNECTION) {
+ usb_debug("usbhub: Port change at %d\n", port);
+ ret = generic_hub_scanport(dev, port);
+ }
+ return ret;
+}
+
+static void
+usb_hub_poll(usbdev_t *const dev)
+{
+ unsigned int port, i;
+ u8 buf[32] = { 0 };
+ const u8 *ibuf;
+
+ /* First, gather all change bits from finished interrupt transfers. */
+ const size_t port_bytes = MIN(ARRAY_SIZE(buf),
+ div_round_up(GEN_HUB(dev)->num_ports + 1, 8));
+ while ((ibuf = dev->controller->poll_intr_queue(GEN_HUB(dev)->data))) {
+ for (i = 0; i < port_bytes; ++i)
+ buf[i] |= ibuf[i];
+ }
+
+ for (port = 1; port <= GEN_HUB(dev)->num_ports; ++port) {
+ /* ports start at bit1; bit0 is hub status change */
+ if (buf[port / 8] & (1 << (port % 8))) {
+ if (usb_hub_handle_port_change(dev, port) < 0)
+ return;
+ }
+ }
+}
+
+static void
+usb_hub_destroy(usbdev_t *const dev)
+{
+ endpoint_t *const intr_ep = usb_hub_interrupt_ep(dev);
+ dev->controller->destroy_intr_queue(intr_ep, GEN_HUB(dev)->data);
+ generic_hub_destroy(dev);
}
void
usb_hub_init(usbdev_t *const dev)
{
- int type = dev->speed == SUPER_SPEED ? 0x2a : 0x29; /* similar enough */
+ endpoint_t *const intr_ep = usb_hub_interrupt_ep(dev);
+ if (!intr_ep) {
+ usb_debug("usbhub: ERROR: No interrupt-in endpoint found\n");
+ return;
+ }
+
+ /* Get number of ports from hub decriptor */
+ int type = is_usb_speed_ss(dev->speed) ? 0x2a : 0x29; /* similar enough */
hub_descriptor_t desc; /* won't fit the whole thing, we don't care */
if (get_descriptor(dev, gen_bmRequestType(device_to_host, class_type,
dev_recp), type, 0, &desc, sizeof(desc)) != sizeof(desc)) {
@@ -185,12 +295,40 @@ usb_hub_init(usbdev_t *const dev)
return;
}
- if (dev->speed == SUPER_SPEED)
+ if (is_usb_speed_ss(dev->speed))
usb_hub_set_hub_depth(dev);
- if (generic_hub_init(dev, desc.bNbrPorts, &usb_hub_ops) < 0)
+
+ /*
+ * Register interrupt transfer:
+ * one bit per port + one bit for the hub,
+ * 20 transfers in the queue, like our HID driver,
+ * one transfer per 256ms
+ */
+ void *const intrq = dev->controller->create_intr_queue(
+ intr_ep, intr_ep->maxpacketsize, 20, 256);
+ if (!intrq) {
+ usb_detach_device(dev->controller, dev->address);
return;
+ }
+
+ /*
+ * Limit the number of ports by the max packet size of
+ * the interrupt endpoint. This shouldn't be necessary
+ * but prevents a potential overflow in usb_hub_poll().
+ */
+ const unsigned int num_ports =
+ MIN(desc.bNbrPorts, intr_ep->maxpacketsize * 8 - 1);
+ if (generic_hub_init(dev, num_ports, &usb_hub_ops)) {
+ dev->controller->destroy_intr_queue(intr_ep, intrq);
+ usb_detach_device(dev->controller, dev->address);
+ return;
+ }
int port;
- for (port = 1; port <= GEN_HUB(dev)->num_ports; ++port)
+ for (port = 1; port <= num_ports; ++port)
usb_hub_port_initialize(dev, port);
+
+ GEN_HUB(dev)->data = intrq;
+ dev->poll = usb_hub_poll;
+ dev->destroy = usb_hub_destroy;
}
diff --git a/payloads/libpayload/drivers/usb/usbmsc.c b/payloads/libpayload/drivers/usb/usbmsc.c
index 2c7cbe5ef2..2412e99af3 100644
--- a/payloads/libpayload/drivers/usb/usbmsc.c
+++ b/payloads/libpayload/drivers/usb/usbmsc.c
@@ -157,6 +157,9 @@ reset_transport (usbdev_t *dev)
dr.wIndex = 0;
dr.wLength = 0;
+ if (MSC_INST (dev)->quirks & USB_MSC_QUIRK_NO_RESET)
+ return MSC_COMMAND_FAIL;
+
/* if any of these fails, detach device, as we are lost */
if (dev->controller->control (dev, OUT, sizeof (dr), &dr, 0, 0) < 0 ||
clear_stall (MSC_INST (dev)->bulk_in) ||
@@ -185,7 +188,8 @@ initialize_luns (usbdev_t *dev)
dr.wValue = 0;
dr.wIndex = 0;
dr.wLength = 1;
- if (dev->controller->control (dev, IN, sizeof (dr), &dr,
+ if (MSC_INST (dev)->quirks & USB_MSC_QUIRK_NO_LUNS ||
+ dev->controller->control (dev, IN, sizeof (dr), &dr,
sizeof (msc->num_luns), &msc->num_luns) < 0)
msc->num_luns = 0; /* assume only 1 lun if req fails */
msc->num_luns++; /* Get Max LUN returns number of last LUN */
@@ -218,14 +222,23 @@ wrap_cbw (cbw_t *cbw, int datalen, cbw_direction dir, const u8 *cmd,
static int
get_csw (endpoint_t *ep, csw_t *csw)
{
- if (ep->dev->controller->bulk (ep, sizeof (csw_t), (u8 *) csw, 1) < 0) {
+ hci_t *ctrlr = ep->dev->controller;
+ int ret = ctrlr->bulk (ep, sizeof (csw_t), (u8 *) csw, 1);
+
+ /* Some broken sticks send a zero-length packet at the end of their data
+ transfer which would show up here. Skip it to get the actual CSW. */
+ if (ret == 0)
+ ret = ctrlr->bulk (ep, sizeof (csw_t), (u8 *) csw, 1);
+
+ if (ret < 0) {
clear_stall (ep);
- if (ep->dev->controller->bulk
- (ep, sizeof (csw_t), (u8 *) csw, 1) < 0) {
+ if (ctrlr->bulk (ep, sizeof (csw_t), (u8 *) csw, 1) < 0) {
return reset_transport (ep->dev);
}
}
- if (csw->dCSWTag != tag) {
+ if (ret != sizeof(csw_t) || csw->dCSWTag != tag ||
+ csw->dCSWSignature != csw_signature) {
+ usb_debug ("MSC: received malformed CSW\n");
return reset_transport (ep->dev);
}
return MSC_COMMAND_OK;
@@ -591,14 +604,6 @@ usb_msc_test_unit_ready (usbdev_t *dev)
void
usb_msc_init (usbdev_t *dev)
{
- int i;
-
- /* init .data before setting .destroy */
- dev->data = NULL;
-
- dev->destroy = usb_msc_destroy;
- dev->poll = usb_msc_poll;
-
configuration_descriptor_t *cd =
(configuration_descriptor_t *) dev->configuration;
interface_descriptor_t *interface =
@@ -625,6 +630,19 @@ usb_msc_init (usbdev_t *dev)
return;
}
+ usb_msc_force_init (dev, 0);
+}
+
+void usb_msc_force_init (usbdev_t *dev, u32 quirks)
+{
+ int i;
+
+ /* init .data before setting .destroy */
+ dev->data = NULL;
+
+ dev->destroy = usb_msc_destroy;
+ dev->poll = usb_msc_poll;
+
dev->data = malloc (sizeof (usbmsc_inst_t));
if (!dev->data)
fatal("Not enough memory for USB MSC device.\n");
@@ -632,6 +650,7 @@ usb_msc_init (usbdev_t *dev)
MSC_INST (dev)->bulk_in = 0;
MSC_INST (dev)->bulk_out = 0;
MSC_INST (dev)->usbdisk_created = 0;
+ MSC_INST (dev)->quirks = quirks;
for (i = 1; i <= dev->num_endp; i++) {
if (dev->endpoints[i].endpoint == 0)
diff --git a/payloads/libpayload/drivers/usb/xhci_devconf.c b/payloads/libpayload/drivers/usb/xhci_devconf.c
index 99e3037304..3f50caa512 100644
--- a/payloads/libpayload/drivers/usb/xhci_devconf.c
+++ b/payloads/libpayload/drivers/usb/xhci_devconf.c
@@ -267,7 +267,7 @@ _free_ic_return:
static int
xhci_finish_hub_config(usbdev_t *const dev, inputctx_t *const ic)
{
- int type = dev->speed == SUPER_SPEED ? 0x2a : 0x29; /* similar enough */
+ int type = is_usb_speed_ss(dev->speed) ? 0x2a : 0x29; /* similar enough */
hub_descriptor_t desc;
if (get_descriptor(dev, gen_bmRequestType(device_to_host, class_type,
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h
index 57a3afc6b1..80bfaae6bf 100644
--- a/payloads/libpayload/include/libpayload.h
+++ b/payloads/libpayload/include/libpayload.h
@@ -445,6 +445,25 @@ static inline int __ffs(u32 x) { return log2(x & (u32)(-(s32)x)); }
/** @} */
+/**
+ * @defgroup mmio MMIO helper functions
+ * @{
+ */
+#if !CONFIG(LP_ARCH_MIPS)
+void buffer_from_fifo32(void *buffer, size_t size, void *fifo,
+ int fifo_stride, int fifo_width);
+void buffer_to_fifo32_prefix(void *buffer, u32 prefix, int prefsz, size_t size,
+ void *fifo, int fifo_stride, int fifo_width);
+static inline void buffer_to_fifo32(void *buffer, size_t size, void *fifo,
+ int fifo_stride, int fifo_width)
+{
+ buffer_to_fifo32_prefix(buffer, size, 0, 0, fifo,
+ fifo_stride, fifo_width);
+}
+#endif
+/** @} */
+
+
/**
* @defgroup hash Hashing functions
* @{
diff --git a/payloads/libpayload/include/usb/usb.h b/payloads/libpayload/include/usb/usb.h
index db7ec57d57..8505c4f60b 100644
--- a/payloads/libpayload/include/usb/usb.h
+++ b/payloads/libpayload/include/usb/usb.h
@@ -210,6 +210,7 @@ typedef enum {
LOW_SPEED = 1,
HIGH_SPEED = 2,
SUPER_SPEED = 3,
+ SUPER_SPEED_PLUS = 4,
} usb_speed;
struct usbdev {
@@ -293,6 +294,7 @@ int get_descriptor (usbdev_t *dev, int rtype, int descType, int descIdx,
int set_configuration (usbdev_t *dev);
int clear_feature (usbdev_t *dev, int endp, int feature, int rtype);
int clear_stall (endpoint_t *ep);
+_Bool is_usb_speed_ss(usb_speed speed);
void usb_nop_init (usbdev_t *dev);
void usb_hub_init (usbdev_t *dev);
diff --git a/payloads/libpayload/include/usb/usbmsc.h b/payloads/libpayload/include/usb/usbmsc.h
index f4562a56d5..8786586e51 100644
--- a/payloads/libpayload/include/usb/usbmsc.h
+++ b/payloads/libpayload/include/usb/usbmsc.h
@@ -34,13 +34,24 @@ typedef struct {
unsigned int numblocks;
endpoint_t *bulk_in;
endpoint_t *bulk_out;
- u8 usbdisk_created;
+ u8 quirks : 7;
+ u8 usbdisk_created : 1;
s8 ready;
u8 lun;
u8 num_luns;
void *data; /* For use by consumers of libpayload. */
} usbmsc_inst_t;
+/* Possible values for quirks field. */
+enum {
+ /* Don't check for LUNs (force assumption that there's only one LUN). */
+ USB_MSC_QUIRK_NO_LUNS = 1 << 0,
+ /* Never do a BULK_ONLY reset, just continue. This means that the device
+ cannot recover from phase errors and won't detach automatically for
+ unrecoverable errors. Do not use unless you have to. */
+ USB_MSC_QUIRK_NO_RESET = 1 << 1,
+};
+
/* Possible values for ready field. */
enum {
USB_MSC_DETACHED = -1, /* Disk detached or out to lunch. */
@@ -56,4 +67,8 @@ typedef enum { cbw_direction_data_in = 0x80, cbw_direction_data_out = 0
int readwrite_blocks_512 (usbdev_t *dev, int start, int n, cbw_direction dir, u8 *buf);
int readwrite_blocks (usbdev_t *dev, int start, int n, cbw_direction dir, u8 *buf);
+/* Force a device to enumerate as MSC, without checking class/protocol types.
+ It must still have a bulk endpoint pair and respond to MSC commands. */
+void usb_msc_force_init (usbdev_t *dev, u32 quirks);
+
#endif
diff --git a/payloads/libpayload/libc/lib.c b/payloads/libpayload/libc/lib.c
index bead1f801b..081d7dd0e2 100644
--- a/payloads/libpayload/libc/lib.c
+++ b/payloads/libpayload/libc/lib.c
@@ -27,6 +27,7 @@
* SUCH DAMAGE.
*/
+#include
#include
/*
@@ -125,3 +126,54 @@ char *getenv(const char *name)
{
return NULL;
}
+
+#if !CONFIG(LP_ARCH_MIPS)
+/*
+ * Reads a transfer buffer from 32-bit FIFO registers. fifo_stride is the
+ * distance in bytes between registers (e.g. pass 4 for a normal array of 32-bit
+ * registers or 0 to read everything from the same register). fifo_width is
+ * the amount of bytes read per register (can be 1 through 4).
+ */
+void buffer_from_fifo32(void *buffer, size_t size, void *fifo,
+ int fifo_stride, int fifo_width)
+{
+ u8 *p = buffer;
+ int i, j;
+
+ assert(fifo_width > 0 && fifo_width <= sizeof(u32) &&
+ fifo_stride % sizeof(u32) == 0);
+
+ for (i = 0; i < size; i += fifo_width, fifo += fifo_stride) {
+ u32 val = read32(fifo);
+ for (j = 0; j < MIN(size - i, fifo_width); j++)
+ *p++ = (u8)(val >> (j * 8));
+ }
+}
+
+/*
+ * Version of buffer_to_fifo32() that can prepend a prefix of up to fifo_width
+ * size to the transfer. This is often useful for protocols where a command word
+ * precedes the actual payload data. The prefix must be packed in the low-order
+ * bytes of the 'prefix' u32 parameter and any high-order bytes exceeding prefsz
+ * must be 0. Note that 'size' counts total bytes written, including 'prefsz'.
+ */
+void buffer_to_fifo32_prefix(void *buffer, u32 prefix, int prefsz, size_t size,
+ void *fifo, int fifo_stride, int fifo_width)
+{
+ u8 *p = buffer;
+ int i, j = prefsz;
+
+ assert(fifo_width > 0 && fifo_width <= sizeof(u32) &&
+ fifo_stride % sizeof(u32) == 0 && prefsz <= fifo_width);
+
+ uint32_t val = prefix;
+ for (i = 0; i < size; i += fifo_width, fifo += fifo_stride) {
+ for (; j < MIN(size - i, fifo_width); j++)
+ val |= *p++ << (j * 8);
+ write32(fifo, val);
+ val = 0;
+ j = 0;
+ }
+
+}
+#endif
diff --git a/payloads/linuxcheck/Makefile b/payloads/linuxcheck/Makefile
index b967369e1a..838c90df0c 100644
--- a/payloads/linuxcheck/Makefile
+++ b/payloads/linuxcheck/Makefile
@@ -3,7 +3,7 @@ XCOMPILE=$(LIBPAYLOAD_DIR)/libpayload.xcompile
# build libpayload and put .config file in $(CURDIR) instead of ../libpayload
# to avoid pollute the libpayload source directory and possible conflicts
LPOPTS=obj="$(CURDIR)/build" DESTDIR="$(CURDIR)" DOTCONFIG="$(CURDIR)/.config"
-CFLAGS += -Wall -Werror -Os -ffreestanding -nostdinc -nostdlib
+CFLAGS += -Wall -Wvla -Werror -Os -ffreestanding -nostdinc -nostdlib
ifeq ($(CONFIG_ARCH_X86),y)
TARGETARCH = i386
endif
diff --git a/payloads/nvramcui/Makefile b/payloads/nvramcui/Makefile
index c6a9cd0cf4..bf7053b9a6 100644
--- a/payloads/nvramcui/Makefile
+++ b/payloads/nvramcui/Makefile
@@ -3,7 +3,7 @@ XCOMPILE=$(LIBPAYLOAD_DIR)/libpayload.xcompile
# build libpayload and put .config file in $(CURDIR) instead of ../libpayload
# to avoid pollute the libpayload source directory and possible conflicts
LPOPTS=obj="$(CURDIR)/build" DESTDIR="$(CURDIR)" DOTCONFIG="$(CURDIR)/.config"
-CFLAGS += -Wall -Werror -Os -ffreestanding -nostdinc -nostdlib
+CFLAGS += -Wall -Wvla -Werror -Os -ffreestanding -nostdinc -nostdlib
all: nvramcui.elf
diff --git a/src/Kconfig b/src/Kconfig
index 6288d0bc74..a1c016e30f 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -484,12 +484,7 @@ source "src/console/Kconfig"
config HAVE_ACPI_RESUME
bool
default n
-
-config ACPI_HUGE_LOWMEM_BACKUP
- bool
- default n
- help
- On S3 resume path, backup low memory from RAMBASE..RAMTOP in CBMEM.
+ depends on RELOCATABLE_RAMSTAGE
config RESUME_PATH_SAME_AS_BOOT
bool
@@ -991,7 +986,7 @@ config X86EMU_DEBUG_IO
config X86EMU_DEBUG_TIMINGS
bool "Output timing information"
default n
- depends on X86EMU_DEBUG && UDELAY_LAPIC && HAVE_MONOTONIC_TIMER
+ depends on X86EMU_DEBUG && HAVE_MONOTONIC_TIMER
help
Print timing information needed by i915tool.
diff --git a/src/arch/arm/Kconfig b/src/arch/arm/Kconfig
index 6d9cc7820a..47c333bf6a 100644
--- a/src/arch/arm/Kconfig
+++ b/src/arch/arm/Kconfig
@@ -1,24 +1,22 @@
config ARCH_ARM
bool
- default n
config ARCH_BOOTBLOCK_ARM
bool
- default n
select ARCH_ARM
select C_ENVIRONMENT_BOOTBLOCK
config ARCH_VERSTAGE_ARM
bool
- default n
+ select ARCH_ARM
config ARCH_ROMSTAGE_ARM
bool
- default n
+ select ARCH_ARM
config ARCH_RAMSTAGE_ARM
bool
- default n
+ select ARCH_ARM
source src/arch/arm/armv4/Kconfig
source src/arch/arm/armv7/Kconfig
diff --git a/src/arch/arm/Makefile.inc b/src/arch/arm/Makefile.inc
index 06adfe454a..508b0a80f8 100644
--- a/src/arch/arm/Makefile.inc
+++ b/src/arch/arm/Makefile.inc
@@ -2,11 +2,6 @@
##
## This file is part of the coreboot project.
##
-## Copyright (C) 2012-2013 The ChromiumOS Authors
-## Copyright (C) 2012 Alexandru Gagniuc
-## Copyright (C) 2009-2010 coresystems GmbH
-## Copyright (C) 2009 Ronald G. Minnich
-##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm/armv4/Kconfig b/src/arch/arm/armv4/Kconfig
index aa5fab9bcd..0b501657a4 100644
--- a/src/arch/arm/armv4/Kconfig
+++ b/src/arch/arm/armv4/Kconfig
@@ -1,15 +1,15 @@
config ARCH_BOOTBLOCK_ARMV4
- def_bool n
+ bool
select ARCH_BOOTBLOCK_ARM
config ARCH_VERSTAGE_ARMV4
- def_bool n
+ bool
select ARCH_VERSTAGE_ARM
config ARCH_ROMSTAGE_ARMV4
- def_bool n
+ bool
select ARCH_ROMSTAGE_ARM
config ARCH_RAMSTAGE_ARMV4
- def_bool n
+ bool
select ARCH_RAMSTAGE_ARM
diff --git a/src/arch/arm/armv4/Makefile.inc b/src/arch/arm/armv4/Makefile.inc
index e8e49a60a8..2cc5ebba8c 100644
--- a/src/arch/arm/armv4/Makefile.inc
+++ b/src/arch/arm/armv4/Makefile.inc
@@ -2,8 +2,6 @@
##
## This file is part of the coreboot project.
##
-## Copyright (C) 2013 The ChromiumOS Authors
-##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm/armv4/bootblock.S b/src/arch/arm/armv4/bootblock.S
index 0391ebf1ac..cf37647e27 100644
--- a/src/arch/arm/armv4/bootblock.S
+++ b/src/arch/arm/armv4/bootblock.S
@@ -1,17 +1,5 @@
/*
- * Early initialization code for ARM architecture.
- *
- * This file is based off of the OMAP3530/ARM Cortex start.S file from Das
- * U-Boot, which itself got the file from armboot.
- *
- * Copyright (c) 2004 Texas Instruments
- * Copyright (c) 2001 Marius Gröger
- * Copyright (c) 2002 Alex Züpke
- * Copyright (c) 2002 Gary Jennejohn
- * Copyright (c) 2003 Richard Woodruff
- * Copyright (c) 2003 Kshitij
- * Copyright (c) 2006-2008 Syed Mohammed Khasim
- * Copyright (c) 2013 The Chromium OS Authors
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -22,6 +10,11 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Early initialization code for ARM architecture.
+ *
+ * This file is based off of the OMAP3530/ARM Cortex start.S file from Das
+ * U-Boot, which itself got the file from armboot.
*/
#include
diff --git a/src/arch/arm/armv7/Kconfig b/src/arch/arm/armv7/Kconfig
index 3734426c0f..6d5fb9ee71 100644
--- a/src/arch/arm/armv7/Kconfig
+++ b/src/arch/arm/armv7/Kconfig
@@ -1,37 +1,39 @@
config ARCH_BOOTBLOCK_ARMV7
- def_bool n
+ bool
select ARCH_BOOTBLOCK_ARM
config ARCH_VERSTAGE_ARMV7
- def_bool n
+ bool
select ARCH_VERSTAGE_ARM
config ARCH_ROMSTAGE_ARMV7
- def_bool n
+ bool
select ARCH_ROMSTAGE_ARM
config ARCH_RAMSTAGE_ARMV7
- def_bool n
+ bool
select ARCH_RAMSTAGE_ARM
+
config ARCH_BOOTBLOCK_ARMV7_M
- def_bool n
+ bool
select ARCH_BOOTBLOCK_ARM
+
config ARCH_VERSTAGE_ARMV7_M
- def_bool n
+ bool
select ARCH_VERSTAGE_ARM
config ARCH_BOOTBLOCK_ARMV7_R
- def_bool n
+ bool
select ARCH_BOOTBLOCK_ARM
config ARCH_VERSTAGE_ARMV7_R
- def_bool n
+ bool
select ARCH_VERSTAGE_ARM
config ARCH_ROMSTAGE_ARMV7_R
- def_bool n
+ bool
select ARCH_ROMSTAGE_ARM
config ARCH_RAMSTAGE_ARMV7_R
- def_bool n
+ bool
select ARCH_RAMSTAGE_ARM
diff --git a/src/arch/arm/armv7/Makefile.inc b/src/arch/arm/armv7/Makefile.inc
index 1d3ae52f54..58592a0818 100644
--- a/src/arch/arm/armv7/Makefile.inc
+++ b/src/arch/arm/armv7/Makefile.inc
@@ -2,8 +2,6 @@
##
## This file is part of the coreboot project.
##
-## Copyright (C) 2013 The ChromiumOS Authors
-##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm/armv7/bootblock.S b/src/arch/arm/armv7/bootblock.S
index e2d76a1463..da2671c519 100644
--- a/src/arch/arm/armv7/bootblock.S
+++ b/src/arch/arm/armv7/bootblock.S
@@ -1,17 +1,5 @@
/*
- * Early initialization code for ARMv7 architecture.
- *
- * This file is based off of the OMAP3530/ARM Cortex start.S file from Das
- * U-Boot, which itself got the file from armboot.
- *
- * Copyright (c) 2004 Texas Instruments
- * Copyright (c) 2001 Marius Gröger
- * Copyright (c) 2002 Alex Züpke
- * Copyright (c) 2002 Gary Jennejohn
- * Copyright (c) 2003 Richard Woodruff
- * Copyright (c) 2003 Kshitij
- * Copyright (c) 2006-2008 Syed Mohammed Khasim
- * Copyright (c) 2013 The Chromium OS Authors
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -22,6 +10,11 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Early initialization code for ARMv7 architecture.
+ *
+ * This file is based off of the OMAP3530/ARM Cortex start.S file from Das
+ * U-Boot, which itself got the file from armboot.
*/
#include
diff --git a/src/arch/arm/armv7/cpu.S b/src/arch/arm/armv7/cpu.S
index 1f6cd5bc25..3f90c0b611 100644
--- a/src/arch/arm/armv7/cpu.S
+++ b/src/arch/arm/armv7/cpu.S
@@ -1,7 +1,5 @@
/*
- * Optimized assembly for low-level CPU operations on ARMv7 processors.
- *
- * Cache flushing code based off sys/arch/arm/arm/cpufunc_asm_armv7.S in NetBSD
+ * This file is part of the coreboot project.
*
* Copyright (c) 2010 Per Odlund
* Copyright (c) 2014 Google Inc.
@@ -28,6 +26,10 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * Optimized assembly for low-level CPU operations on ARMv7 processors.
+ *
+ * Cache flushing code based off sys/arch/arm/arm/cpufunc_asm_armv7.S in NetBSD
*/
#include
diff --git a/src/arch/arm/armv7/exception.c b/src/arch/arm/armv7/exception.c
index 4fac0bcd3c..d6891b0b8d 100644
--- a/src/arch/arm/armv7/exception.c
+++ b/src/arch/arm/armv7/exception.c
@@ -1,5 +1,5 @@
/*
- * This file is part of the libpayload project.
+ * This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
diff --git a/src/arch/arm/armv7/exception_asm.S b/src/arch/arm/armv7/exception_asm.S
index f54cd85f9f..6aa4188abc 100644
--- a/src/arch/arm/armv7/exception_asm.S
+++ b/src/arch/arm/armv7/exception_asm.S
@@ -1,5 +1,5 @@
/*
- * This file is part of the libpayload project.
+ * This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
diff --git a/src/arch/arm/armv7/exception_mr.c b/src/arch/arm/armv7/exception_mr.c
index d76cc6a739..01e834ea47 100644
--- a/src/arch/arm/armv7/exception_mr.c
+++ b/src/arch/arm/armv7/exception_mr.c
@@ -1,5 +1,5 @@
/*
- * This file is part of the libpayload project.
+ * This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
diff --git a/src/arch/arm/armv7/thread.c b/src/arch/arm/armv7/thread.c
index bcf692320c..4e82be708c 100644
--- a/src/arch/arm/armv7/thread.c
+++ b/src/arch/arm/armv7/thread.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2013 Google, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm/asmlib.h b/src/arch/arm/asmlib.h
index 0d515517cf..cae4081efd 100644
--- a/src/arch/arm/asmlib.h
+++ b/src/arch/arm/asmlib.h
@@ -1,9 +1,5 @@
/*
- * arch/arm/asmlib.h
- *
- * Adapted from Linux arch/arm/include/assembler.h
- *
- * Copyright (C) 1996-2000 Russell King
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -17,6 +13,8 @@
* This file contains arm architecture specific defines
* for the different processors.
*
+ * Adapted from Linux arch/arm/include/assembler.h
+ *
* Do not include any C declarations in this file - it is included by
* assembler source.
*/
diff --git a/src/arch/arm/boot.c b/src/arch/arm/boot.c
index 1767fe04c2..9d1e4cde5f 100644
--- a/src/arch/arm/boot.c
+++ b/src/arch/arm/boot.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2013 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm/div0.c b/src/arch/arm/div0.c
index e474f73d6e..fa3bf7f090 100644
--- a/src/arch/arm/div0.c
+++ b/src/arch/arm/div0.c
@@ -1,6 +1,5 @@
/*
- * (C) Copyright 2002
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/src/arch/arm/eabi_compat.c b/src/arch/arm/eabi_compat.c
index 15f7d36667..45f4651a03 100644
--- a/src/arch/arm/eabi_compat.c
+++ b/src/arch/arm/eabi_compat.c
@@ -1,7 +1,5 @@
/*
- * Utility functions needed for (some) EABI conformant tool chains.
- *
- * (C) Copyright 2009 Wolfgang Denk
+ * This file is part of the coreboot project.
*
* This program is Free Software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -12,6 +10,8 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Utility functions needed for (some) EABI conformant tool chains.
*/
#include
diff --git a/src/arch/arm/include/arch/asm.h b/src/arch/arm/include/arch/asm.h
index b148d12b80..b9591b6b86 100644
--- a/src/arch/arm/include/arch/asm.h
+++ b/src/arch/arm/include/arch/asm.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2013 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm/include/arch/cbconfig.h b/src/arch/arm/include/arch/cbconfig.h
index 9467f52646..35c1387895 100644
--- a/src/arch/arm/include/arch/cbconfig.h
+++ b/src/arch/arm/include/arch/cbconfig.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2016 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm/include/arch/clock.h b/src/arch/arm/include/arch/clock.h
index 77d09d8ef0..248da0607a 100644
--- a/src/arch/arm/include/arch/clock.h
+++ b/src/arch/arm/include/arch/clock.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm/include/arch/early_variables.h b/src/arch/arm/include/arch/early_variables.h
index c469446e86..7002a8805e 100644
--- a/src/arch/arm/include/arch/early_variables.h
+++ b/src/arch/arm/include/arch/early_variables.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -20,7 +18,9 @@
static inline void *car_get_var_ptr(void *var) { return var; }
#define car_get_var(var) (var)
-#define car_sync_var(var) (var)
#define car_set_var(var, val) do { (var) = (val); } while (0)
+#define car_get_ptr car_get_var
+#define car_set_ptr car_set_var
+
#endif
diff --git a/src/arch/arm/include/arch/header.ld b/src/arch/arm/include/arch/header.ld
index 89473109f0..5d93673579 100644
--- a/src/arch/arm/include/arch/header.ld
+++ b/src/arch/arm/include/arch/header.ld
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm/include/arch/memlayout.h b/src/arch/arm/include/arch/memlayout.h
index 4ba2bf8cf2..26b8ef4708 100644
--- a/src/arch/arm/include/arch/memlayout.h
+++ b/src/arch/arm/include/arch/memlayout.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm/include/arch/pci_ops.h b/src/arch/arm/include/arch/pci_ops.h
index 75bb20e05f..4cb05e7c88 100644
--- a/src/arch/arm/include/arch/pci_ops.h
+++ b/src/arch/arm/include/arch/pci_ops.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2013 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm/include/arch/stages.h b/src/arch/arm/include/arch/stages.h
index 68a3bd116d..3841265341 100644
--- a/src/arch/arm/include/arch/stages.h
+++ b/src/arch/arm/include/arch/stages.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2013 The ChromiumOS Authors
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm/include/armv4/arch/cpu.h b/src/arch/arm/include/armv4/arch/cpu.h
index d32bf58c2a..3a27743cbf 100644
--- a/src/arch/arm/include/armv4/arch/cpu.h
+++ b/src/arch/arm/include/armv4/arch/cpu.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2012 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm/include/armv4/arch/mmio.h b/src/arch/arm/include/armv4/arch/mmio.h
index ad89ef5d12..2c43789abf 100644
--- a/src/arch/arm/include/armv4/arch/mmio.h
+++ b/src/arch/arm/include/armv4/arch/mmio.h
@@ -1,9 +1,5 @@
/*
- * Originally imported from linux/include/asm-arm/io.h. This file has changed
- * substantially since then.
- *
- * Copyright 2013 Google Inc.
- * Copyright (C) 1996-2000 Russell King
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -14,16 +10,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * Modifications:
- * 08-Apr-2013 G Replaced several macros with inlines for type safety.
- * 16-Sep-1996 RMK Inlined the inx/outx functions & optimised for both
- * constant addresses and variable addresses.
- * 04-Dec-1997 RMK Moved a lot of this stuff to the new architecture
- * specific IO header files.
- * 27-Mar-1999 PJB Second parameter of memcpy_toio is const..
- * 04-Apr-1999 PJB Added check_signature.
- * 12-Dec-1999 RMK More cleanups
- * 18-Jun-2000 RMK Removed virt_to_* and friends definitions
+ * Originally imported from linux/include/asm-arm/io.h. This file has changed
+ * substantially since then.
*/
#ifndef __ARCH_MMIO_H__
diff --git a/src/arch/arm/include/armv7.h b/src/arch/arm/include/armv7.h
index bec7fd7033..626e6083f3 100644
--- a/src/arch/arm/include/armv7.h
+++ b/src/arch/arm/include/armv7.h
@@ -1,7 +1,5 @@
/*
- * (C) Copyright 2010
- * Texas Instruments,
- * Aneesh V
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/src/arch/arm/include/armv7/arch/cpu.h b/src/arch/arm/include/armv7/arch/cpu.h
index 22b3fb443d..0377e2a5c9 100644
--- a/src/arch/arm/include/armv7/arch/cpu.h
+++ b/src/arch/arm/include/armv7/arch/cpu.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2012 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -17,12 +15,10 @@
#define __ARCH_CPU_H__
#include
+#include
#define asmlinkage
-#if !defined(__PRE_RAM__)
-#include
-
struct cpu_driver {
struct device_operations *ops;
const struct cpu_device_id *id_table;
@@ -34,8 +30,6 @@ struct cpuinfo_arm {
uint8_t arm_model;
};
-#endif
-
/* Primitives for CPU and MP cores. */
/* read Main Id register (MIDR) */
diff --git a/src/arch/arm/include/armv7/arch/exception.h b/src/arch/arm/include/armv7/arch/exception.h
index 57076bd57b..df3930977b 100644
--- a/src/arch/arm/include/armv7/arch/exception.h
+++ b/src/arch/arm/include/armv7/arch/exception.h
@@ -1,5 +1,5 @@
/*
- * This file is part of the libpayload project.
+ * This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
diff --git a/src/arch/arm/include/armv7/arch/mmio.h b/src/arch/arm/include/armv7/arch/mmio.h
index b245b264fd..87f68715e8 100644
--- a/src/arch/arm/include/armv7/arch/mmio.h
+++ b/src/arch/arm/include/armv7/arch/mmio.h
@@ -1,9 +1,5 @@
/*
- * Originally imported from linux/include/asm-arm/io.h. This file has changed
- * substantially since then.
- *
- * Copyright 2013 Google Inc.
- * Copyright (C) 1996-2000 Russell King
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -14,16 +10,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * Modifications:
- * 08-Apr-2013 G Replaced several macros with inlines for type safety.
- * 16-Sep-1996 RMK Inlined the inx/outx functions & optimised for both
- * constant addresses and variable addresses.
- * 04-Dec-1997 RMK Moved a lot of this stuff to the new architecture
- * specific IO header files.
- * 27-Mar-1999 PJB Second parameter of memcpy_toio is const..
- * 04-Apr-1999 PJB Added check_signature.
- * 12-Dec-1999 RMK More cleanups
- * 18-Jun-2000 RMK Removed virt_to_* and friends definitions
+ * Originally imported from linux/include/asm-arm/io.h. This file has changed
+ * substantially since then.
*/
#ifndef __ARCH_MMIO_H__
diff --git a/src/arch/arm/include/clocks.h b/src/arch/arm/include/clocks.h
index 60afb447f7..4904b6e96a 100644
--- a/src/arch/arm/include/clocks.h
+++ b/src/arch/arm/include/clocks.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 The Chromium OS Authors.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/src/arch/arm/libgcc/Makefile.inc b/src/arch/arm/libgcc/Makefile.inc
index 9a8d4fca53..2d0f6a81da 100644
--- a/src/arch/arm/libgcc/Makefile.inc
+++ b/src/arch/arm/libgcc/Makefile.inc
@@ -2,8 +2,6 @@
##
## This file is part of the coreboot project.
##
-## Copyright (C) 2013 The ChromiumOS Authors
-##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm/libgcc/ashldi3.S b/src/arch/arm/libgcc/ashldi3.S
index 1e3aefa209..473e15f3f3 100644
--- a/src/arch/arm/libgcc/ashldi3.S
+++ b/src/arch/arm/libgcc/ashldi3.S
@@ -1,5 +1,5 @@
-/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
- Free Software Foundation, Inc.
+/*
+This file is part of the coreboot project.
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
diff --git a/src/arch/arm/libgcc/lib1funcs.S b/src/arch/arm/libgcc/lib1funcs.S
index a64218572d..5c2a6ade17 100644
--- a/src/arch/arm/libgcc/lib1funcs.S
+++ b/src/arch/arm/libgcc/lib1funcs.S
@@ -1,12 +1,5 @@
/*
- * linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines
- *
- * Author: Nicolas Pitre
- * - contributed to gcc-3.4 on Sep 30, 2003
- * - adapted for the Linux kernel on Oct 2, 2003
- */
-
-/* Copyright 1995, 1996, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
+This file is part of the coreboot project.
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -28,6 +21,10 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
*/
+/*
+ * linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines
+ */
+
#if defined __GNUC__
diff --git a/src/arch/arm/libgcc/lshrdi3.S b/src/arch/arm/libgcc/lshrdi3.S
index 119ec45af9..5e67690010 100644
--- a/src/arch/arm/libgcc/lshrdi3.S
+++ b/src/arch/arm/libgcc/lshrdi3.S
@@ -1,5 +1,5 @@
-/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
- Free Software Foundation, Inc.
+/*
+This file is part of the coreboot project.
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
diff --git a/src/arch/arm/libgcc/muldi3.S b/src/arch/arm/libgcc/muldi3.S
index 1d783ec87c..c7584745b9 100644
--- a/src/arch/arm/libgcc/muldi3.S
+++ b/src/arch/arm/libgcc/muldi3.S
@@ -1,18 +1,16 @@
/*
- * linux/arch/arm/lib/muldi3.S
+ * This file is part of the coreboot project.
*
- * Author: Nicolas Pitre
- * Created: Oct 19, 2005
- * Copyright: Monta Vista Software, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Based on linux/arch/arm/lib/muldi3.S
*/
#if defined __GNUC__
diff --git a/src/arch/arm/libgcc/ucmpdi2.S b/src/arch/arm/libgcc/ucmpdi2.S
index 8b21043158..771e93b502 100644
--- a/src/arch/arm/libgcc/ucmpdi2.S
+++ b/src/arch/arm/libgcc/ucmpdi2.S
@@ -1,18 +1,16 @@
/*
- * linux/arch/arm/lib/ucmpdi2.S
+ * This file is part of the coreboot project.
*
- * Author: Nicolas Pitre
- * Created: Oct 19, 2005
- * Copyright: Monta Vista Software, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Based on linux/arch/arm/lib/ucmpdi2.S
*/
#if defined __GNUC__
diff --git a/src/arch/arm/libgcc/uldivmod.S b/src/arch/arm/libgcc/uldivmod.S
index 521a5d1e33..ecbeccfe4b 100644
--- a/src/arch/arm/libgcc/uldivmod.S
+++ b/src/arch/arm/libgcc/uldivmod.S
@@ -1,4 +1,6 @@
/*
+ * This file is part of the coreboot project.
+ *
* Copyright 2010, Google Inc.
* All rights reserved.
*
diff --git a/src/arch/arm/memcpy.S b/src/arch/arm/memcpy.S
index fe4f40076f..19592dbfaf 100644
--- a/src/arch/arm/memcpy.S
+++ b/src/arch/arm/memcpy.S
@@ -1,18 +1,16 @@
/*
- * linux/arch/arm/lib/memcpy.S
+ * This file is part of the coreboot project.
*
- * Author: Nicolas Pitre
- * Created: Sep 28, 2005
- * Copyright: MontaVista Software, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Based on linux/arch/arm/lib/memcpy.S
*/
#include
diff --git a/src/arch/arm/memmove.S b/src/arch/arm/memmove.S
index f4da9e8f19..3b5681ced2 100644
--- a/src/arch/arm/memmove.S
+++ b/src/arch/arm/memmove.S
@@ -1,18 +1,16 @@
/*
- * linux/arch/arm/lib/memmove.S
+ * This file is part of the coreboot project.
*
- * Author: Nicolas Pitre
- * Created: Sep 28, 2005
- * Copyright: (C) MontaVista Software Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Based on linux/arch/arm/lib/memmove.S
*/
#include
diff --git a/src/arch/arm/memset.S b/src/arch/arm/memset.S
index 9a3bc72399..7d71a88bc3 100644
--- a/src/arch/arm/memset.S
+++ b/src/arch/arm/memset.S
@@ -1,7 +1,5 @@
/*
- * linux/arch/arm/lib/memset.S
- *
- * Copyright (C) 1995-2000 Russell King
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -12,7 +10,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * ASM optimised string functions
+ * Based on linux/arch/arm/lib/memset.S
+ *
+ * ASM optimised string functions
*/
#include
diff --git a/src/arch/arm/stages.c b/src/arch/arm/stages.c
index 22ade638ae..c9f5744f75 100644
--- a/src/arch/arm/stages.c
+++ b/src/arch/arm/stages.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2012 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm/tables.c b/src/arch/arm/tables.c
index 682715f8c1..ab2b579f0a 100644
--- a/src/arch/arm/tables.c
+++ b/src/arch/arm/tables.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2003 Eric Biederman
- * Copyright (C) 2005 Steve Magnani
- * Copyright (C) 2008-2009 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm64/Kconfig b/src/arch/arm64/Kconfig
index 71c9f042f5..3d1d1843e0 100644
--- a/src/arch/arm64/Kconfig
+++ b/src/arch/arm64/Kconfig
@@ -1,27 +1,27 @@
config ARCH_ARM64
bool
- default n
config ARCH_BOOTBLOCK_ARM64
bool
- default n
select ARCH_ARM64
select C_ENVIRONMENT_BOOTBLOCK
config ARCH_VERSTAGE_ARM64
bool
- default n
+ select ARCH_ARM64
config ARCH_ROMSTAGE_ARM64
bool
- default n
+ select ARCH_ARM64
config ARCH_RAMSTAGE_ARM64
bool
- default n
+ select ARCH_ARM64
source src/arch/arm64/armv8/Kconfig
+if ARCH_ARM64
+
config ARM64_USE_ARCH_TIMER
bool
default n
@@ -58,3 +58,5 @@ config ARM64_A53_ERRATUM_843419
incorrect address calculations in rare cases. This option enables a
linker workaround to avoid those cases if your toolchain supports it.
Should be selected automatically by SoCs that are affected.
+
+endif # if ARCH_ARM64
diff --git a/src/arch/arm64/Makefile.inc b/src/arch/arm64/Makefile.inc
index 6bb7196805..1aee6b83f7 100644
--- a/src/arch/arm64/Makefile.inc
+++ b/src/arch/arm64/Makefile.inc
@@ -2,12 +2,6 @@
##
## This file is part of the coreboot project.
##
-## Copyright (C) 2014 Google Inc.
-## Copyright (C) 2012-2013 The ChromiumOS Authors
-## Copyright (C) 2012 Alexandru Gagniuc
-## Copyright (C) 2009-2010 coresystems GmbH
-## Copyright (C) 2009 Ronald G. Minnich
-##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; version 2 of the License.
@@ -107,6 +101,7 @@ romstage-$(CONFIG_ARM64_USE_ARCH_TIMER) += arch_timer.c
romstage-y += memset.S
romstage-y += memcpy.S
romstage-y += memmove.S
+romstage-y += ramdetect.c
romstage-y += romstage.c
romstage-y += transition.c transition_asm.S
@@ -131,11 +126,12 @@ ramstage-y += div0.c
ramstage-y += eabi_compat.c
ramstage-y += boot.c
ramstage-y += tables.c
+ramstage-y += ramdetect.c
ramstage-$(CONFIG_ARM64_USE_ARCH_TIMER) += arch_timer.c
ramstage-y += memset.S
ramstage-y += memcpy.S
ramstage-y += memmove.S
-ramstage-$(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE) += arm_tf.c
+ramstage-$(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE) += bl31.c
ramstage-y += transition.c transition_asm.S
ramstage-$(CONFIG_PAYLOAD_FIT_SUPPORT) += fit_payload.c
diff --git a/src/arch/arm64/arch_timer.c b/src/arch/arm64/arch_timer.c
index e7f3732b0e..2db235a5da 100644
--- a/src/arch/arm64/arch_timer.c
+++ b/src/arch/arm64/arch_timer.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2018, The Linux Foundation. All rights reserved.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
diff --git a/src/arch/arm64/arm_tf.c b/src/arch/arm64/arm_tf.c
deleted file mode 100644
index 291e4eef3e..0000000000
--- a/src/arch/arm64/arm_tf.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright 2015 Google Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/*
- * TODO: Many of these structures are currently unused. Better not fill them out
- * to make future changes fail fast, rather than try to come up with content
- * that might turn out to not make sense. Implement later as required.
- *
-static image_info_t bl31_image_info;
-static image_info_t bl32_image_info;
-static image_info_t bl33_image_info;
- */
-static entry_point_info_t bl32_ep_info;
-static entry_point_info_t bl33_ep_info;
-static bl31_params_t bl31_params;
-
-void __weak *soc_get_bl31_plat_params(bl31_params_t *params)
-{
- /* Default weak implementation. */
- return NULL;
-}
-
-void arm_tf_run_bl31(u64 payload_entry, u64 payload_arg0, u64 payload_spsr)
-{
- struct prog bl31 = PROG_INIT(PROG_BL31, CONFIG_CBFS_PREFIX"/bl31");
- void (*bl31_entry)(bl31_params_t *params, void *plat_params) = NULL;
-
- if (prog_locate(&bl31))
- die("BL31 not found");
-
- if (!selfload_check(&bl31, BM_MEM_BL31))
- die("BL31 load failed");
- bl31_entry = prog_entry(&bl31);
-
- SET_PARAM_HEAD(&bl31_params, PARAM_BL31, VERSION_1, 0);
-
- if (CONFIG(ARM64_USE_SECURE_OS)) {
- struct prog bl32 = PROG_INIT(PROG_BL32,
- CONFIG_CBFS_PREFIX"/secure_os");
-
- if (prog_locate(&bl32))
- die("BL32 not found");
-
- if (cbfs_prog_stage_load(&bl32))
- die("BL32 load failed");
-
- SET_PARAM_HEAD(&bl32_ep_info, PARAM_EP, VERSION_1,
- PARAM_EP_SECURE);
- bl32_ep_info.pc = (uintptr_t)prog_entry(&bl32);
- bl32_ep_info.spsr = SPSR_EXCEPTION_MASK |
- get_eret_el(EL1, SPSR_USE_L);
- bl31_params.bl32_ep_info = &bl32_ep_info;
- }
-
- bl31_params.bl33_ep_info = &bl33_ep_info;
-
- SET_PARAM_HEAD(&bl33_ep_info, PARAM_EP, VERSION_1, PARAM_EP_NON_SECURE);
- bl33_ep_info.pc = payload_entry;
- bl33_ep_info.spsr = payload_spsr;
- bl33_ep_info.args.arg0 = payload_arg0;
-
- /* May update bl31_params if necessary. */
- void *bl31_plat_params = soc_get_bl31_plat_params(&bl31_params);
-
- /* MMU disable will flush cache, so passed params land in memory. */
- raw_write_daif(SPSR_EXCEPTION_MASK);
- mmu_disable();
- bl31_entry(&bl31_params, bl31_plat_params);
- die("BL31 returned!");
-}
diff --git a/src/arch/arm64/armv8/Kconfig b/src/arch/arm64/armv8/Kconfig
index 2070bea197..f70b529972 100644
--- a/src/arch/arm64/armv8/Kconfig
+++ b/src/arch/arm64/armv8/Kconfig
@@ -1,17 +1,17 @@
config ARCH_BOOTBLOCK_ARMV8_64
- def_bool n
+ bool
select ARCH_BOOTBLOCK_ARM64
config ARCH_VERSTAGE_ARMV8_64
- def_bool n
+ bool
select ARCH_VERSTAGE_ARM64
config ARCH_ROMSTAGE_ARMV8_64
- def_bool n
+ bool
select ARCH_ROMSTAGE_ARM64
config ARCH_RAMSTAGE_ARMV8_64
- def_bool n
+ bool
select ARCH_RAMSTAGE_ARM64
config ARCH_ARMV8_EXTENSION
diff --git a/src/arch/arm64/armv8/Makefile.inc b/src/arch/arm64/armv8/Makefile.inc
index 44ebdef815..127c5f114b 100644
--- a/src/arch/arm64/armv8/Makefile.inc
+++ b/src/arch/arm64/armv8/Makefile.inc
@@ -2,8 +2,6 @@
##
## This file is part of the coreboot project.
##
-## Copyright (C) 2014 The ChromiumOS Authors
-##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm64/armv8/bootblock.S b/src/arch/arm64/armv8/bootblock.S
index 3950f5530d..64d2405895 100644
--- a/src/arch/arm64/armv8/bootblock.S
+++ b/src/arch/arm64/armv8/bootblock.S
@@ -1,7 +1,5 @@
/*
- * Early initialization code for aarch64 (a.k.a. armv8)
- *
- * Copyright 2015 Google Inc.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -12,6 +10,8 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Early initialization code for aarch64 (a.k.a. armv8)
*/
#include
diff --git a/src/arch/arm64/armv8/cpu.S b/src/arch/arm64/armv8/cpu.S
index 935f1fe7bd..2bc4defde8 100644
--- a/src/arch/arm64/armv8/cpu.S
+++ b/src/arch/arm64/armv8/cpu.S
@@ -1,8 +1,5 @@
/*
- * Optimized assembly for low-level CPU operations on ARM64 processors.
- *
- * Copyright (c) 2010 Per Odlund
- * Copyright (c) 2014 Google Inc.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -12,6 +9,8 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Optimized assembly for low-level CPU operations on ARM64 processors.
*/
#include
diff --git a/src/arch/arm64/armv8/exception.c b/src/arch/arm64/armv8/exception.c
index 58a35238f6..579e1040b4 100644
--- a/src/arch/arm64/armv8/exception.c
+++ b/src/arch/arm64/armv8/exception.c
@@ -1,5 +1,5 @@
/*
- * This file is part of the libpayload project.
+ * This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
diff --git a/src/arch/arm64/bl31.c b/src/arch/arm64/bl31.c
new file mode 100644
index 0000000000..c94b1d101e
--- /dev/null
+++ b/src/arch/arm64/bl31.c
@@ -0,0 +1,125 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+static entry_point_info_t bl32_ep_info = {
+ .h = {
+ .type = PARAM_EP,
+ .version = PARAM_VERSION_1,
+ .size = sizeof(bl32_ep_info),
+ .attr = EP_SECURE,
+ },
+};
+static entry_point_info_t bl33_ep_info = {
+ .h = {
+ .type = PARAM_EP,
+ .version = PARAM_VERSION_1,
+ .size = sizeof(bl33_ep_info),
+ .attr = EP_NON_SECURE,
+ },
+};
+
+static bl_params_node_t bl32_params_node = {
+ .image_id = BL32_IMAGE_ID,
+ .ep_info = &bl32_ep_info,
+};
+static bl_params_node_t bl33_params_node = {
+ .image_id = BL33_IMAGE_ID,
+ .ep_info = &bl33_ep_info,
+};
+
+static bl_params_t bl_params = {
+ .h = {
+ .type = PARAM_BL_PARAMS,
+ .version = PARAM_VERSION_2,
+ .size = sizeof(bl_params),
+ .attr = 0,
+ },
+ .head = &bl33_params_node,
+};
+
+static struct bl_aux_param_header *bl_aux_params;
+
+/* Only works when using the default soc_get_bl31_plat_params() below. */
+void register_bl31_aux_param(struct bl_aux_param_header *param)
+{
+ param->next = (uintptr_t)bl_aux_params;
+ bl_aux_params = param;
+}
+
+/* Default implementation. All newly added SoCs should use this if possible! */
+__weak void *soc_get_bl31_plat_params(void)
+{
+ static struct bl_aux_param_uint64 cbtable_param = {
+ .h = { .type = BL_AUX_PARAM_COREBOOT_TABLE, },
+ };
+ if (!cbtable_param.value) {
+ cbtable_param.value = (uint64_t)cbmem_find(CBMEM_ID_CBTABLE);
+ if (cbtable_param.value)
+ register_bl31_aux_param(&cbtable_param.h);
+ }
+ return bl_aux_params;
+}
+
+void run_bl31(u64 payload_entry, u64 payload_arg0, u64 payload_spsr)
+{
+ struct prog bl31 = PROG_INIT(PROG_BL31, CONFIG_CBFS_PREFIX"/bl31");
+ void (*bl31_entry)(bl_params_t *params, void *plat_params) = NULL;
+
+ if (prog_locate(&bl31))
+ die("BL31 not found");
+
+ if (!selfload_check(&bl31, BM_MEM_BL31))
+ die("BL31 load failed");
+ bl31_entry = prog_entry(&bl31);
+
+ if (CONFIG(ARM64_USE_SECURE_OS)) {
+ struct prog bl32 = PROG_INIT(PROG_BL32,
+ CONFIG_CBFS_PREFIX"/secure_os");
+
+ if (prog_locate(&bl32))
+ die("BL32 not found");
+
+ if (cbfs_prog_stage_load(&bl32))
+ die("BL32 load failed");
+
+ bl32_ep_info.pc = (uintptr_t)prog_entry(&bl32);
+ bl32_ep_info.spsr = SPSR_EXCEPTION_MASK |
+ get_eret_el(EL1, SPSR_USE_L);
+ bl33_params_node.next_params_info = &bl32_params_node;
+ }
+
+ bl33_ep_info.pc = payload_entry;
+ bl33_ep_info.spsr = payload_spsr;
+ bl33_ep_info.args.arg0 = payload_arg0;
+
+ void *bl31_plat_params = soc_get_bl31_plat_params();
+
+ /* MMU disable will flush cache, so passed params land in memory. */
+ raw_write_daif(SPSR_EXCEPTION_MASK);
+ mmu_disable();
+ bl31_entry(&bl_params, bl31_plat_params);
+ die("BL31 returned!");
+}
diff --git a/src/arch/arm64/boot.c b/src/arch/arm64/boot.c
index 7fbc525a18..c6df0ee02e 100644
--- a/src/arch/arm64/boot.c
+++ b/src/arch/arm64/boot.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2013 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -17,7 +15,7 @@
#include
#include
#include
-#include
+#include
#include
static void run_payload(struct prog *prog)
@@ -30,7 +28,7 @@ static void run_payload(struct prog *prog)
u64 payload_spsr = get_eret_el(EL2, SPSR_USE_L);
if (CONFIG(ARM64_USE_ARM_TRUSTED_FIRMWARE))
- arm_tf_run_bl31((u64)doit, (u64)arg, payload_spsr);
+ run_bl31((u64)doit, (u64)arg, payload_spsr);
else
transition_to_el2(doit, arg, payload_spsr);
}
diff --git a/src/arch/arm64/div0.c b/src/arch/arm64/div0.c
index afd9dad1f3..daf1d920b0 100644
--- a/src/arch/arm64/div0.c
+++ b/src/arch/arm64/div0.c
@@ -1,6 +1,5 @@
/*
- * (C) Copyright 2002
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/src/arch/arm64/eabi_compat.c b/src/arch/arm64/eabi_compat.c
index a6f40a4ea3..79b201758a 100644
--- a/src/arch/arm64/eabi_compat.c
+++ b/src/arch/arm64/eabi_compat.c
@@ -1,7 +1,5 @@
/*
- * Utility functions needed for (some) EABI conformant tool chains.
- *
- * (C) Copyright 2009 Wolfgang Denk
+ * This file is part of the coreboot project.
*
* This program is Free Software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -12,6 +10,8 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Utility functions needed for (some) EABI conformant tool chains.
*/
int raise (int signum) __attribute__((used));
diff --git a/src/arch/arm64/fit_payload.c b/src/arch/arm64/fit_payload.c
index 46bea23053..4ade1c719d 100644
--- a/src/arch/arm64/fit_payload.c
+++ b/src/arch/arm64/fit_payload.c
@@ -1,6 +1,5 @@
/*
- * Copyright 2013 Google Inc.
- * Copyright 2018 Facebook, Inc.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/src/arch/arm64/include/arch/acpi.h b/src/arch/arm64/include/arch/acpi.h
index 6e16482580..4015d18021 100644
--- a/src/arch/arm64/include/arch/acpi.h
+++ b/src/arch/arm64/include/arch/acpi.h
@@ -1,15 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2004 SUSE LINUX AG
- * Copyright (C) 2004 Nick Barker
- * Copyright (C) 2008-2009 coresystems GmbH
- * Copyright (C) 2015 Timothy Pearson ,
- * Raptor Engineering
- * Copyright (C) 2016 Siemens AG
- * (Written by Stefan Reinauer )
- * Copyright 2018-present Facebook, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm64/include/arch/asm.h b/src/arch/arm64/include/arch/asm.h
index b52724faa8..7d3ad7e6b3 100644
--- a/src/arch/arm64/include/arch/asm.h
+++ b/src/arch/arm64/include/arch/asm.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2013 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm64/include/arch/cbconfig.h b/src/arch/arm64/include/arch/cbconfig.h
index 9467f52646..35c1387895 100644
--- a/src/arch/arm64/include/arch/cbconfig.h
+++ b/src/arch/arm64/include/arch/cbconfig.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2016 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm64/include/arch/early_variables.h b/src/arch/arm64/include/arch/early_variables.h
index c469446e86..7002a8805e 100644
--- a/src/arch/arm64/include/arch/early_variables.h
+++ b/src/arch/arm64/include/arch/early_variables.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -20,7 +18,9 @@
static inline void *car_get_var_ptr(void *var) { return var; }
#define car_get_var(var) (var)
-#define car_sync_var(var) (var)
#define car_set_var(var, val) do { (var) = (val); } while (0)
+#define car_get_ptr car_get_var
+#define car_set_ptr car_set_var
+
#endif
diff --git a/src/arch/arm64/include/arch/header.ld b/src/arch/arm64/include/arch/header.ld
index 9d8764ea58..dcba068f9a 100644
--- a/src/arch/arm64/include/arch/header.ld
+++ b/src/arch/arm64/include/arch/header.ld
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm64/include/arch/memlayout.h b/src/arch/arm64/include/arch/memlayout.h
index a3fdd66e4f..984a09b86e 100644
--- a/src/arch/arm64/include/arch/memlayout.h
+++ b/src/arch/arm64/include/arch/memlayout.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm64/include/arch/mpidr.h b/src/arch/arm64/include/arch/mpidr.h
index 8d7651edc1..cc43309e4b 100644
--- a/src/arch/arm64/include/arch/mpidr.h
+++ b/src/arch/arm64/include/arch/mpidr.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm64/include/arch/pci_ops.h b/src/arch/arm64/include/arch/pci_ops.h
index 7a62d4aa10..65dd059529 100644
--- a/src/arch/arm64/include/arch/pci_ops.h
+++ b/src/arch/arm64/include/arch/pci_ops.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2013 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm64/include/arch/stages.h b/src/arch/arm64/include/arch/stages.h
index 2d6d583fce..d86172b2d0 100644
--- a/src/arch/arm64/include/arch/stages.h
+++ b/src/arch/arm64/include/arch/stages.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2013 The ChromiumOS Authors
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm64/include/arch/transition.h b/src/arch/arm64/include/arch/transition.h
index 290265edb0..8a49eed8de 100644
--- a/src/arch/arm64/include/arch/transition.h
+++ b/src/arch/arm64/include/arch/transition.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm64/include/arm_tf.h b/src/arch/arm64/include/arm_tf.h
deleted file mode 100644
index ea5a0f4d6d..0000000000
--- a/src/arch/arm64/include/arm_tf.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright 2015 Google Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#ifndef __ARM_TF_H__
-#define __ARM_TF_H__
-
-#include
-
-/* TODO: Pull in directly from ARM TF once its headers have been reorganized. */
-#include
-
-/* Load and enter BL31, set it up to exit to payload according to arguments. */
-void arm_tf_run_bl31(u64 payload_entry, u64 payload_arg0, u64 payload_spsr);
-
-/* Return platform-specific bl31_plat_params. May update bl31_params. */
-void *soc_get_bl31_plat_params(bl31_params_t *bl31_params);
-
-#endif /* __ARM_TF_H__ */
diff --git a/src/arch/arm64/include/arm_tf_temp.h b/src/arch/arm64/include/arm_tf_temp.h
deleted file mode 100644
index 8db5dcb49c..0000000000
--- a/src/arch/arm64/include/arm_tf_temp.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * Neither the name of ARM nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __ARM_TF_TEMP_H__
-#define __ARM_TF_TEMP_H__
-
-#include
-
-/*
- * Code temporarily copied from arm-trusted-firmware/include/common/bl_common.h,
- * since it tries to pull in a few too many standard C headers and needs to be
- * cleaned up a bit before we can include it directly.
- */
-
-#define PARAM_EP_SECURE 0x0
-#define PARAM_EP_NON_SECURE 0x1
-#define PARAM_EP_SECURITY_MASK 0x1
-
-#define PARAM_EP_EE_MASK 0x2
-#define PARAM_EP_EE_LITTLE 0x0
-#define PARAM_EP_EE_BIG 0x2
-
-#define PARAM_EP_ST_MASK 0x4
-#define PARAM_EP_ST_DISABLE 0x0
-#define PARAM_EP_ST_ENABLE 0x4
-
-#define PARAM_EP 0x01
-#define PARAM_IMAGE_BINARY 0x02
-#define PARAM_BL31 0x03
-
-#define VERSION_1 0x01
-
-#define SET_PARAM_HEAD(_p, _type, _ver, _attr) do { \
- (_p)->h.type = (uint8_t)(_type); \
- (_p)->h.version = (uint8_t)(_ver); \
- (_p)->h.size = (uint16_t)sizeof(*_p); \
- (_p)->h.attr = (uint32_t)(_attr) ; \
- } while (0)
-
-typedef struct aapcs64_params {
- unsigned long arg0;
- unsigned long arg1;
- unsigned long arg2;
- unsigned long arg3;
- unsigned long arg4;
- unsigned long arg5;
- unsigned long arg6;
- unsigned long arg7;
-} aapcs64_params_t;
-
-typedef struct param_header {
- uint8_t type; /* type of the structure */
- uint8_t version; /* version of this structure */
- uint16_t size; /* size of this structure in bytes */
- uint32_t attr; /* attributes: unused bits SBZ */
-} param_header_t;
-
-typedef struct entry_point_info {
- param_header_t h;
- uintptr_t pc;
- uint32_t spsr;
- aapcs64_params_t args;
-} entry_point_info_t;
-
-typedef struct image_info {
- param_header_t h;
- uintptr_t image_base; /* physical address of base of image */
- uint32_t image_size; /* bytes read from image file */
-} image_info_t;
-
-typedef struct bl31_params {
- param_header_t h;
- image_info_t *bl31_image_info;
- entry_point_info_t *bl32_ep_info;
- image_info_t *bl32_image_info;
- entry_point_info_t *bl33_ep_info;
- image_info_t *bl33_image_info;
-} bl31_params_t;
-
-#endif /* __ARM_TF_TEMP_H__ */
diff --git a/src/arch/arm64/include/armv8/arch/barrier.h b/src/arch/arm64/include/armv8/arch/barrier.h
index 3c3feb68d7..8da2cc29c8 100644
--- a/src/arch/arm64/include/armv8/arch/barrier.h
+++ b/src/arch/arm64/include/armv8/arch/barrier.h
@@ -1,7 +1,5 @@
/*
- * Based on arch/arm/include/asm/barrier.h
- *
- * Copyright (C) 2012 ARM Ltd.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -11,6 +9,8 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Based on arch/arm/include/asm/barrier.h
*/
#ifndef __ASM_ARM_BARRIER_H
#define __ASM_ARM_BARRIER_H
diff --git a/src/arch/arm64/include/armv8/arch/cpu.h b/src/arch/arm64/include/armv8/arch/cpu.h
index 6e096cc8e6..9b08bb4f7e 100644
--- a/src/arch/arm64/include/armv8/arch/cpu.h
+++ b/src/arch/arm64/include/armv8/arch/cpu.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -20,9 +18,6 @@
static inline unsigned int smp_processor_id(void) { return 0; }
-
-#if !defined(__PRE_RAM__)
struct cpu_driver { };
-#endif
#endif /* __ARCH_CPU_H__ */
diff --git a/src/arch/arm64/include/armv8/arch/exception.h b/src/arch/arm64/include/armv8/arch/exception.h
index f897fefe18..155060f954 100644
--- a/src/arch/arm64/include/armv8/arch/exception.h
+++ b/src/arch/arm64/include/armv8/arch/exception.h
@@ -1,5 +1,5 @@
/*
- * This file is part of the libpayload project.
+ * This file is part of the coreboot project.
*
* Copyright 2013 Google Inc.
*
diff --git a/src/arch/arm64/include/armv8/arch/lib_helpers.h b/src/arch/arm64/include/armv8/arch/lib_helpers.h
index b6d067ce65..0afbf82a23 100644
--- a/src/arch/arm64/include/armv8/arch/lib_helpers.h
+++ b/src/arch/arm64/include/armv8/arch/lib_helpers.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Google Inc
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/arch/arm64/include/armv8/arch/mmio.h b/src/arch/arm64/include/armv8/arch/mmio.h
index aabfa87fc9..4342fc60e5 100644
--- a/src/arch/arm64/include/armv8/arch/mmio.h
+++ b/src/arch/arm64/include/armv8/arch/mmio.h
@@ -1,9 +1,5 @@
/*
- * Originally imported from linux/include/asm-arm/io.h. This file has changed
- * substantially since then.
- *
- * Copyright 2014 Google Inc.
- * Copyright (C) 1996-2000 Russell King
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -14,16 +10,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * Modifications:
- * 08-Apr-2013 G Replaced several macros with inlines for type safety.
- * 16-Sep-1996 RMK Inlined the inx/outx functions & optimised for both
- * constant addresses and variable addresses.
- * 04-Dec-1997 RMK Moved a lot of this stuff to the new architecture
- * specific IO header files.
- * 27-Mar-1999 PJB Second parameter of memcpy_toio is const..
- * 04-Apr-1999 PJB Added check_signature.
- * 12-Dec-1999 RMK More cleanups
- * 18-Jun-2000 RMK Removed virt_to_* and friends definitions
+ * Originally imported from linux/include/asm-arm/io.h. This file has changed
+ * substantially since then.
*/
#ifndef __ARCH_MMIO_H__
diff --git a/src/arch/arm64/include/armv8/arch/mmu.h b/src/arch/arm64/include/armv8/arch/mmu.h
index 6c83749e95..4b6d78792a 100644
--- a/src/arch/arm64/include/armv8/arch/mmu.h
+++ b/src/arch/arm64/include/armv8/arch/mmu.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm64/include/bl31.h b/src/arch/arm64/include/bl31.h
new file mode 100644
index 0000000000..0f90e774b3
--- /dev/null
+++ b/src/arch/arm64/include/bl31.h
@@ -0,0 +1,32 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __BL31_H__
+#define __BL31_H__
+
+#include
+
+#include
+
+/* Load and enter BL31, set it up to exit to payload according to arguments. */
+void run_bl31(u64 payload_entry, u64 payload_arg0, u64 payload_spsr);
+
+/* Return platform-specific bl31_plat_params. SoCs should avoid overriding this
+ and stick with the default BL aux parameter framework if possible. */
+void *soc_get_bl31_plat_params(void);
+
+/* Add a BL aux parameter to the list to be passed to BL31. Only works for SoCs
+ that use the default soc_get_bl31_plat_params() implementation. */
+void register_bl31_aux_param(struct bl_aux_param_header *param);
+
+#endif /* __BL31_H__ */
diff --git a/src/arch/arm64/include/clocks.h b/src/arch/arm64/include/clocks.h
index 60afb447f7..4904b6e96a 100644
--- a/src/arch/arm64/include/clocks.h
+++ b/src/arch/arm64/include/clocks.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 The Chromium OS Authors.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/src/arch/arm64/include/cpu/cortex_a57.h b/src/arch/arm64/include/cpu/cortex_a57.h
index 1a1becd30a..3259934232 100644
--- a/src/arch/arm64/include/cpu/cortex_a57.h
+++ b/src/arch/arm64/include/cpu/cortex_a57.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm64/memcpy.S b/src/arch/arm64/memcpy.S
index 9cfbbb33d2..ef37ea5dc9 100644
--- a/src/arch/arm64/memcpy.S
+++ b/src/arch/arm64/memcpy.S
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 ARM Ltd.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
diff --git a/src/arch/arm64/memmove.S b/src/arch/arm64/memmove.S
index fc704f7ed5..ac2865054e 100644
--- a/src/arch/arm64/memmove.S
+++ b/src/arch/arm64/memmove.S
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 ARM Ltd.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
diff --git a/src/arch/arm64/memset.S b/src/arch/arm64/memset.S
index a6e98b77ae..5b61b31053 100644
--- a/src/arch/arm64/memset.S
+++ b/src/arch/arm64/memset.S
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 ARM Ltd.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
diff --git a/src/arch/arm64/ramdetect.c b/src/arch/arm64/ramdetect.c
new file mode 100644
index 0000000000..bc034c311b
--- /dev/null
+++ b/src/arch/arm64/ramdetect.c
@@ -0,0 +1,41 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include
+#include
+#include
+#include
+#include
+
+static enum {
+ ABORT_CHECKER_NOT_TRIGGERED,
+ ABORT_CHECKER_TRIGGERED,
+} abort_state = ABORT_CHECKER_NOT_TRIGGERED;
+
+static int abort_checker(struct exc_state *state, uint64_t vector_id)
+{
+ if (raw_read_esr_el3() >> 26 != 0x25)
+ return EXC_RET_IGNORED; /* Not a data abort. */
+
+ abort_state = ABORT_CHECKER_TRIGGERED;
+ state->elx.elr += sizeof(uint32_t); /* Jump over faulting instruction. */
+ raw_write_elr_el3(state->elx.elr);
+ return EXC_RET_HANDLED;
+}
+
+static struct exception_handler sync_el0 = {.handler = &abort_checker};
+
+int probe_mb(const uintptr_t dram_start, const uintptr_t size)
+{
+ uintptr_t addr = dram_start + (size * MiB) - sizeof(uint32_t);
+ void *ptr = (void *)addr;
+
+ abort_state = ABORT_CHECKER_NOT_TRIGGERED;
+ exception_handler_register(EXC_VID_CUR_SP_EL0_SYNC, &sync_el0);
+ read32(ptr);
+ exception_handler_unregister(EXC_VID_CUR_SP_EL0_SYNC, &sync_el0);
+ return abort_state == ABORT_CHECKER_NOT_TRIGGERED;
+}
diff --git a/src/arch/arm64/romstage.c b/src/arch/arm64/romstage.c
index 8cdb16baef..58c47e78f3 100644
--- a/src/arch/arm64/romstage.c
+++ b/src/arch/arm64/romstage.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2018 Google Inc.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/arch/arm64/tables.c b/src/arch/arm64/tables.c
index 492eadd764..62334a725f 100644
--- a/src/arch/arm64/tables.c
+++ b/src/arch/arm64/tables.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2003 Eric Biederman
- * Copyright (C) 2005 Steve Magnani
- * Copyright (C) 2008-2009 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm64/transition.c b/src/arch/arm64/transition.c
index b1ab2fcf0b..3e8d7f0762 100644
--- a/src/arch/arm64/transition.c
+++ b/src/arch/arm64/transition.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/arm64/transition_asm.S b/src/arch/arm64/transition_asm.S
index 73821c85dd..718832b421 100644
--- a/src/arch/arm64/transition_asm.S
+++ b/src/arch/arm64/transition_asm.S
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/Kconfig b/src/arch/mips/Kconfig
index b8570c1c5d..9df514b21b 100644
--- a/src/arch/mips/Kconfig
+++ b/src/arch/mips/Kconfig
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2014 Imagination Technologies
-#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; version 2 of
diff --git a/src/arch/mips/Makefile.inc b/src/arch/mips/Makefile.inc
index cd474eeb48..7130abaaa0 100644
--- a/src/arch/mips/Makefile.inc
+++ b/src/arch/mips/Makefile.inc
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2014 Imagination Technologies
-#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; version 2 of
diff --git a/src/arch/mips/ashldi3.c b/src/arch/mips/ashldi3.c
index f68d78ed60..e3282f55ea 100644
--- a/src/arch/mips/ashldi3.c
+++ b/src/arch/mips/ashldi3.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Google, Inc.
- *
- * Based on linux arch/mips/lib/ashldi3.c
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -13,6 +9,8 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Based on linux arch/mips/lib/ashldi3.c
*/
#ifndef __ORDER_LITTLE_ENDIAN__
diff --git a/src/arch/mips/boot.c b/src/arch/mips/boot.c
index 5ab36ec390..a8518cd094 100644
--- a/src/arch/mips/boot.c
+++ b/src/arch/mips/boot.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Imagination Technologies
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/bootblock.S b/src/arch/mips/bootblock.S
index f8049c96d4..8ae1cfd7fa 100644
--- a/src/arch/mips/bootblock.S
+++ b/src/arch/mips/bootblock.S
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Imagination Technologies
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/bootblock_simple.c b/src/arch/mips/bootblock_simple.c
index e195b6ac85..be0b176b90 100644
--- a/src/arch/mips/bootblock_simple.c
+++ b/src/arch/mips/bootblock_simple.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Imagination Technologies
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/arch/mips/cache.c b/src/arch/mips/cache.c
index 62c20f34a3..2b56174898 100644
--- a/src/arch/mips/cache.c
+++ b/src/arch/mips/cache.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Imagination Technologies
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/include/arch/bootblock_common.h b/src/arch/mips/include/arch/bootblock_common.h
index f5c11ba9c5..b930b5c4e7 100644
--- a/src/arch/mips/include/arch/bootblock_common.h
+++ b/src/arch/mips/include/arch/bootblock_common.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Imagination Technologies
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/include/arch/byteorder.h b/src/arch/mips/include/arch/byteorder.h
index 35d444bbef..7c0ce47176 100644
--- a/src/arch/mips/include/arch/byteorder.h
+++ b/src/arch/mips/include/arch/byteorder.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Imagination Technologies
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/include/arch/cache.h b/src/arch/mips/include/arch/cache.h
index 61a3e7c854..c610c991cf 100644
--- a/src/arch/mips/include/arch/cache.h
+++ b/src/arch/mips/include/arch/cache.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Imagination Technologies
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/include/arch/cbconfig.h b/src/arch/mips/include/arch/cbconfig.h
index 9467f52646..35c1387895 100644
--- a/src/arch/mips/include/arch/cbconfig.h
+++ b/src/arch/mips/include/arch/cbconfig.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2016 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/include/arch/cpu.h b/src/arch/mips/include/arch/cpu.h
index 8e35908e4c..61eb0828cf 100644
--- a/src/arch/mips/include/arch/cpu.h
+++ b/src/arch/mips/include/arch/cpu.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Imagination Technologies
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -16,12 +14,10 @@
#ifndef __MIPS_ARCH_CPU_H
#define __MIPS_ARCH_CPU_H
-#define asmlinkage
-
-#ifndef __PRE_RAM__
-
#include
+#define asmlinkage
+
struct cpu_driver {
struct device_operations *ops;
const struct cpu_device_id *id_table;
@@ -34,7 +30,6 @@ struct cpu_info {
unsigned long index;
};
-#endif /* !__PRE_RAM__ */
/***************************************************************************
* The following section was copied from arch/mips/include/asm/mipsregs.h in
diff --git a/src/arch/mips/include/arch/early_variables.h b/src/arch/mips/include/arch/early_variables.h
index 61f4653640..6ad82606c4 100644
--- a/src/arch/mips/include/arch/early_variables.h
+++ b/src/arch/mips/include/arch/early_variables.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Imagination Technologies
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -21,7 +19,9 @@
static inline void *car_get_var_ptr(void *var) { return var; }
#define car_get_var(var) (var)
-#define car_sync_var(var) (var)
#define car_set_var(var, val) { (var) = (val); }
+#define car_get_ptr car_get_var
+#define car_set_ptr car_set_var
+
#endif /* __MIPS_ARCH_EARLY_VARIABLES_H */
diff --git a/src/arch/mips/include/arch/exception.h b/src/arch/mips/include/arch/exception.h
index e70d3963ad..a0ab9ecebd 100644
--- a/src/arch/mips/include/arch/exception.h
+++ b/src/arch/mips/include/arch/exception.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Imagination Technologies
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/include/arch/header.ld b/src/arch/mips/include/arch/header.ld
index 1d84a4e42b..7f832eb51c 100644
--- a/src/arch/mips/include/arch/header.ld
+++ b/src/arch/mips/include/arch/header.ld
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -21,7 +19,7 @@ PHDRS
to_load PT_LOAD;
}
-#ifdef __BOOTBLOCK__
+#if ENV_BOOTBLOCK
ENTRY(_start)
#else
ENTRY(stage_entry)
diff --git a/src/arch/mips/include/arch/hlt.h b/src/arch/mips/include/arch/hlt.h
index 703773ba20..5feafe2b85 100644
--- a/src/arch/mips/include/arch/hlt.h
+++ b/src/arch/mips/include/arch/hlt.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Imagination Technologies
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/include/arch/memlayout.h b/src/arch/mips/include/arch/memlayout.h
index fe05bd8ae5..bf862a30ea 100644
--- a/src/arch/mips/include/arch/memlayout.h
+++ b/src/arch/mips/include/arch/memlayout.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/include/arch/mmio.h b/src/arch/mips/include/arch/mmio.h
index c491b51bcb..2564e3b60d 100644
--- a/src/arch/mips/include/arch/mmio.h
+++ b/src/arch/mips/include/arch/mmio.h
@@ -1,12 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Imagination Technologies
- *
- * Based on arch/armv7/include/arch/io.h:
- * Copyright 2013 Google Inc.
- * Copyright (C) 1996-2000 Russell King
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/include/arch/mmu.h b/src/arch/mips/include/arch/mmu.h
index 8997e27f44..f7377bb88c 100644
--- a/src/arch/mips/include/arch/mmu.h
+++ b/src/arch/mips/include/arch/mmu.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2015 Google, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/include/arch/pci_ops.h b/src/arch/mips/include/arch/pci_ops.h
index 7bfcbdd8f9..5be52aa3fb 100644
--- a/src/arch/mips/include/arch/pci_ops.h
+++ b/src/arch/mips/include/arch/pci_ops.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2013 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/include/arch/stages.h b/src/arch/mips/include/arch/stages.h
index 802199f532..63306bd783 100644
--- a/src/arch/mips/include/arch/stages.h
+++ b/src/arch/mips/include/arch/stages.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Imagination Technologies
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/include/arch/types.h b/src/arch/mips/include/arch/types.h
index 31a2f9fd00..fa14b6a684 100644
--- a/src/arch/mips/include/arch/types.h
+++ b/src/arch/mips/include/arch/types.h
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Imagination Technologies
- *
- * Based on src/arch/armv7/include/arch/types.h
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/mmu.c b/src/arch/mips/mmu.c
index b144fd3573..5ef276d273 100644
--- a/src/arch/mips/mmu.c
+++ b/src/arch/mips/mmu.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2015 Google, Inc.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/arch/mips/stages.c b/src/arch/mips/stages.c
index e940faa6cb..0971e98905 100644
--- a/src/arch/mips/stages.c
+++ b/src/arch/mips/stages.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Imagination Technologies
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/mips/tables.c b/src/arch/mips/tables.c
index 50d2a55650..e9de4bfd71 100644
--- a/src/arch/mips/tables.c
+++ b/src/arch/mips/tables.c
@@ -1,11 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Based on src/arch/armv7/tables.c:
- * Copyright (C) 2003 Eric Biederman
- * Copyright (C) 2005 Steve Magnani
- * Copyright (C) 2008-2009 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/ppc64/Makefile.inc b/src/arch/ppc64/Makefile.inc
index 99d86345ac..fae4c926b7 100644
--- a/src/arch/ppc64/Makefile.inc
+++ b/src/arch/ppc64/Makefile.inc
@@ -2,9 +2,6 @@
##
## This file is part of the coreboot project.
##
-## Copyright (C) 2016 Raptor Engineering, LLC
-## Copyright (C) 2014 The ChromiumOS Authors
-##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; version 2 of the License.
@@ -80,7 +77,6 @@ ifeq ($(CONFIG_ARCH_RAMSTAGE_PPC64),y)
ramstage-y += rom_media.c
ramstage-y += stages.c
-ramstage-y += misc.c
ramstage-y += boot.c
ramstage-y += tables.c
ramstage-y += \
diff --git a/src/arch/ppc64/boot.c b/src/arch/ppc64/boot.c
index 4da60b4e6c..6c13761538 100644
--- a/src/arch/ppc64/boot.c
+++ b/src/arch/ppc64/boot.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2013 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/ppc64/bootblock.S b/src/arch/ppc64/bootblock.S
index 77289a1246..2628e0dabe 100644
--- a/src/arch/ppc64/bootblock.S
+++ b/src/arch/ppc64/bootblock.S
@@ -1,8 +1,5 @@
/*
- * Early initialization code for POWER8.
- *
- * Copyright 2016 Raptor Engineering, LLC
- * Copyright 2013 Google Inc.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -13,6 +10,8 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
+ *
+ * Early initialization code for POWER8.
*/
.section ".text._start", "ax", %progbits
diff --git a/src/arch/ppc64/include/arch/cbconfig.h b/src/arch/ppc64/include/arch/cbconfig.h
index 9467f52646..35c1387895 100644
--- a/src/arch/ppc64/include/arch/cbconfig.h
+++ b/src/arch/ppc64/include/arch/cbconfig.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2016 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/ppc64/include/arch/cpu.h b/src/arch/ppc64/include/arch/cpu.h
index 1e13528037..89816903c8 100644
--- a/src/arch/ppc64/include/arch/cpu.h
+++ b/src/arch/ppc64/include/arch/cpu.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2012 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -16,11 +14,10 @@
#ifndef __ARCH_CPU_H__
#define __ARCH_CPU_H__
-#define asmlinkage
-
-#if !defined(__PRE_RAM__)
#include
+#define asmlinkage
+
struct cpu_driver {
struct device_operations *ops;
const struct cpu_device_id *id_table;
@@ -42,7 +39,6 @@ struct cpuinfo_ppc64 {
uint8_t ppc64_model;
};
-#endif
-
struct cpu_info *cpu_info(void);
+
#endif /* __ARCH_CPU_H__ */
diff --git a/src/arch/ppc64/include/arch/early_variables.h b/src/arch/ppc64/include/arch/early_variables.h
index 99fc06bb18..05b8bc7e48 100644
--- a/src/arch/ppc64/include/arch/early_variables.h
+++ b/src/arch/ppc64/include/arch/early_variables.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -21,8 +19,9 @@
#define CAR_MIGRATE(migrate_fn_)
static inline void *car_get_var_ptr(void *var) { return var; }
#define car_get_var(var) (var)
-#define car_sync_var(var) (var)
-
#define car_set_var(var, val) do { (var) = (val); } while (0)
+#define car_get_ptr car_get_var
+#define car_set_ptr car_set_var
+
#endif
diff --git a/src/arch/ppc64/include/arch/header.ld b/src/arch/ppc64/include/arch/header.ld
index 7fdc155586..badeefdf49 100644
--- a/src/arch/ppc64/include/arch/header.ld
+++ b/src/arch/ppc64/include/arch/header.ld
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -21,7 +19,7 @@ PHDRS
to_load PT_LOAD;
}
-#ifdef __BOOTBLOCK__
+#if ENV_BOOTBLOCK
ENTRY(_start)
#else
ENTRY(stage_entry)
diff --git a/src/arch/ppc64/include/arch/memlayout.h b/src/arch/ppc64/include/arch/memlayout.h
index 4d2af5953d..09e87c9574 100644
--- a/src/arch/ppc64/include/arch/memlayout.h
+++ b/src/arch/ppc64/include/arch/memlayout.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/ppc64/include/arch/stages.h b/src/arch/ppc64/include/arch/stages.h
index 90bd60b9a6..a4939b1758 100644
--- a/src/arch/ppc64/include/arch/stages.h
+++ b/src/arch/ppc64/include/arch/stages.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2013 The ChromiumOS Authors
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/ppc64/prologue.inc b/src/arch/ppc64/prologue.inc
index a349cf97b3..9e22eb3d49 100644
--- a/src/arch/ppc64/prologue.inc
+++ b/src/arch/ppc64/prologue.inc
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2002 Eric Biederman
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/ppc64/rom_media.c b/src/arch/ppc64/rom_media.c
index c1713074f9..0fc8be26e0 100644
--- a/src/arch/ppc64/rom_media.c
+++ b/src/arch/ppc64/rom_media.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/arch/ppc64/stages.c b/src/arch/ppc64/stages.c
index 053fd7634c..3cc9371ffe 100644
--- a/src/arch/ppc64/stages.c
+++ b/src/arch/ppc64/stages.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/ppc64/tables.c b/src/arch/ppc64/tables.c
index eef6bf2ffd..e9de4bfd71 100644
--- a/src/arch/ppc64/tables.c
+++ b/src/arch/ppc64/tables.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2003 Eric Biederman
- * Copyright (C) 2005 Steve Magnani
- * Copyright (C) 2008-2009 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/riscv/include/arch/cpu.h b/src/arch/riscv/include/arch/cpu.h
index 547cb76a04..c62199e3f0 100644
--- a/src/arch/riscv/include/arch/cpu.h
+++ b/src/arch/riscv/include/arch/cpu.h
@@ -17,12 +17,10 @@
#define __ARCH_CPU_H__
#include
+#include
#define asmlinkage
-#if !defined(__PRE_RAM__)
-#include
-
struct cpu_driver {
struct device_operations *ops;
const struct cpu_device_id *id_table;
@@ -44,8 +42,6 @@ struct cpuinfo_riscv {
uint8_t riscv_model;
};
-#endif
-
static inline int supports_extension(char ext)
{
return read_csr(misa) & (1 << (ext - 'A'));
diff --git a/src/arch/riscv/include/arch/early_variables.h b/src/arch/riscv/include/arch/early_variables.h
index acc5ac3c6b..a2da5f86ee 100644
--- a/src/arch/riscv/include/arch/early_variables.h
+++ b/src/arch/riscv/include/arch/early_variables.h
@@ -21,7 +21,9 @@
#define CAR_MIGRATE(migrate_fn_)
static inline void *car_get_var_ptr(void *var) { return var; }
#define car_get_var(var) (var)
-#define car_sync_var(var) (var)
#define car_set_var(var, val) do { (var) = (val); } while (0)
+#define car_get_ptr car_get_var
+#define car_set_ptr car_set_var
+
#endif
diff --git a/src/arch/riscv/include/arch/memlayout.h b/src/arch/riscv/include/arch/memlayout.h
index 7baab76479..ac707d0978 100644
--- a/src/arch/riscv/include/arch/memlayout.h
+++ b/src/arch/riscv/include/arch/memlayout.h
@@ -20,7 +20,7 @@
#define STACK(addr, size) REGION(stack, addr, size, 4096)
-#if defined(__PRE_RAM__)
+#if ENV_ROMSTAGE_OR_BEFORE
#define CAR_STACK(addr, size) \
REGION(car_stack, addr, size, 4K) \
ALIAS_REGION(car_stack, stack)
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index 631d981e45..502e7747f4 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -1,8 +1,6 @@
##
## This file is part of the coreboot project.
##
-## Copyright (C) 2009-2010 coresystems GmbH
-##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; version 2 of the License.
@@ -81,6 +79,13 @@ config AP_IN_SIPI_WAIT
default n
depends on ARCH_X86 && SMP
+config RESET_VECTOR_IN_RAM
+ bool
+ depends on ARCH_X86
+ help
+ Select this option if the x86 soc implements custom code to handle the
+ reset vector in RAM instead of the traditional 0xfffffff0 location.
+
# Aligns 16bit entry code in bootblock so that hyper-threading CPUs
# can boot AP CPUs to enable their shared caches.
config SIPI_VECTOR_IN_ROM
@@ -222,8 +227,9 @@ config VERSTAGE_ADDR
# Use the post CAR infrastructure for tearing down cache-as-ram
# from a program loaded in RAM and subsequently loading ramstage.
config POSTCAR_STAGE
- def_bool n
- select NO_CAR_GLOBAL_MIGRATION
+ def_bool y
+ depends on ARCH_X86
+ depends on !CAR_GLOBAL_MIGRATION
config VERSTAGE_DEBUG_SPINLOOP
bool
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index 32e0173804..554107f2fe 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -1,11 +1,6 @@
-################################################################################
##
## This file is part of the coreboot project.
##
-## Copyright (C) 2012 Alexandru Gagniuc
-## Copyright (C) 2009-2010 coresystems GmbH
-## Copyright (C) 2009 Ronald G. Minnich
-##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c
index fdcbcd3fb5..b48640901c 100644
--- a/src/arch/x86/acpi.c
+++ b/src/arch/x86/acpi.c
@@ -1,22 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * coreboot ACPI Table support
- * written by Stefan Reinauer
- *
- * Copyright (C) 2004 SUSE LINUX AG
- * Copyright (C) 2005-2009 coresystems GmbH
- * Copyright (C) 2015 Timothy Pearson ,
- * Raptor Engineering
- * Copyright (C) 2016-2019 Siemens AG
- *
- * ACPI FADT, FACS, and DSDT table support added by
- * Nick Barker , and those portions
- * Copyright (C) 2004 Nick Barker
- *
- * Copyright (C) 2005 ADVANCED MICRO DEVICES, INC. All Rights Reserved.
- * 2005.9 yhlu add SRAT table generation
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -25,6 +9,8 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * coreboot ACPI Table support
*/
/*
diff --git a/src/arch/x86/acpi/debug.asl b/src/arch/x86/acpi/debug.asl
index 04a6026d7e..36afac6211 100644
--- a/src/arch/x86/acpi/debug.asl
+++ b/src/arch/x86/acpi/debug.asl
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2008 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/acpi/globutil.asl b/src/arch/x86/acpi/globutil.asl
index 7a00291106..e9b428ad36 100644
--- a/src/arch/x86/acpi/globutil.asl
+++ b/src/arch/x86/acpi/globutil.asl
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2008 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/acpi/statdef.asl b/src/arch/x86/acpi/statdef.asl
index f8c4b32001..99194f428c 100644
--- a/src/arch/x86/acpi/statdef.asl
+++ b/src/arch/x86/acpi/statdef.asl
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2008 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/acpi_bert_storage.c b/src/arch/x86/acpi_bert_storage.c
index 961faa6118..130f97a678 100644
--- a/src/arch/x86/acpi_bert_storage.c
+++ b/src/arch/x86/acpi_bert_storage.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2018 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/acpi_device.c b/src/arch/x86/acpi_device.c
index 47bcc52c1e..d367108457 100644
--- a/src/arch/x86/acpi_device.c
+++ b/src/arch/x86/acpi_device.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2016 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -81,6 +79,24 @@ const char *acpi_device_name(const struct device *dev)
return NULL;
}
+/* Locate and return the ACPI _HID (Hardware ID) for this device */
+const char *acpi_device_hid(const struct device *dev)
+{
+ if (!dev)
+ return NULL;
+
+ /* Check for device specific handler */
+ if (dev->ops->acpi_hid)
+ return dev->ops->acpi_hid(dev);
+
+ /*
+ * Don't walk up the tree to find any parent that can identify this device, as
+ * PNP devices are hard to identify.
+ */
+
+ return NULL;
+}
+
/* Recursive function to find the root device and print a path from there */
static ssize_t acpi_device_path_fill(const struct device *dev, char *buf,
size_t buf_len, size_t cur)
diff --git a/src/arch/x86/acpi_pld.c b/src/arch/x86/acpi_pld.c
index 904e9f777f..6fbbfe74e3 100644
--- a/src/arch/x86/acpi_pld.c
+++ b/src/arch/x86/acpi_pld.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2018 Google LLC
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/acpi_s3.c b/src/arch/x86/acpi_s3.c
index 049fb12e75..52f8a201f7 100644
--- a/src/arch/x86/acpi_s3.c
+++ b/src/arch/x86/acpi_s3.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2005-2009 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -24,6 +22,7 @@
#include
#include
#include
+#include
#if ENV_RAMSTAGE || ENV_POSTCAR
@@ -61,154 +60,22 @@ int acpi_is_wakeup_s4(void)
acpi_handoff_wakeup();
return (acpi_slp_type == ACPI_S4);
}
-
-void acpi_fail_wakeup(void)
-{
- if (acpi_slp_type == ACPI_S3 || acpi_slp_type == ACPI_S2)
- acpi_slp_type = ACPI_S0;
-}
#endif /* ENV_RAMSTAGE */
-struct resume_backup {
- uint64_t cbmem;
- uint64_t lowmem;
- uint64_t size;
- uint8_t valid;
-};
-
-#define BACKUP_PAGE_SZ 4096
-
-static int backup_create_or_update(struct resume_backup *backup_mem,
- uintptr_t base, size_t size)
-{
- uintptr_t top;
-
- if (CONFIG(ACPI_HUGE_LOWMEM_BACKUP)) {
- base = CONFIG_RAMBASE;
- size = HIGH_MEMORY_SAVE;
- }
-
- /* Align backup region to complete pages. */
- top = ALIGN_UP(base + size, BACKUP_PAGE_SZ);
- base = ALIGN_DOWN(base, BACKUP_PAGE_SZ);
- size = top - base;
-
- /* Cannot extend existing region, should not happen. */
- if (backup_mem && (backup_mem->size < size))
- return -1;
-
- /* Allocate backup with room for header. */
- if (!backup_mem) {
- size_t header_sz = ALIGN_UP(sizeof(*backup_mem),
- BACKUP_PAGE_SZ);
- backup_mem = cbmem_add(CBMEM_ID_RESUME, header_sz + size);
- if (!backup_mem)
- return -1;
-
- /* Container starts from boundary after header. */
- backup_mem->cbmem = (uintptr_t)backup_mem + header_sz;
- }
-
- backup_mem->valid = 0;
- backup_mem->lowmem = base;
- backup_mem->size = size;
- return 0;
-}
-
-void *acpi_backup_container(uintptr_t base, size_t size)
-{
- struct resume_backup *backup_mem = cbmem_find(CBMEM_ID_RESUME);
- if (!backup_mem)
- return NULL;
-
- if (!IS_ALIGNED(base, BACKUP_PAGE_SZ) || !IS_ALIGNED(size,
- BACKUP_PAGE_SZ))
- return NULL;
-
- if (backup_create_or_update(backup_mem, base, size) < 0)
- return NULL;
-
- backup_mem->valid = 1;
- return (void *)(uintptr_t)backup_mem->cbmem;
-}
-
-void backup_ramstage_section(uintptr_t base, size_t size)
-{
- struct resume_backup *backup_mem = cbmem_find(CBMEM_ID_RESUME);
-
- /* For first boot we exit here as CBMEM_ID_RESUME is only
- * created late in ramstage with acpi_prepare_resume_backup().
- */
- if (!backup_mem)
- return;
-
- /* Check that the backup is not done twice. */
- if (backup_mem->valid)
- return;
-
- /* When we are called from ramstage loader, update header with
- * properties of the ramstage we will load.
- */
- if (backup_create_or_update(backup_mem, base, size) < 0)
- return;
-
- /* Back up the OS-controlled memory where ramstage will be loaded. */
- memcpy((void *)(uintptr_t)backup_mem->cbmem,
- (void *)(uintptr_t)backup_mem->lowmem,
- (size_t)backup_mem->size);
- backup_mem->valid = 1;
-}
-
-/* Let's prepare the ACPI S3 Resume area now already, so we can rely on
- * it being there during reboot time. If this fails, ACPI resume will
- * be disabled. We assume that ramstage does not change while in suspend,
- * so base and size of the currently running ramstage are used
- * for allocation.
- */
-void acpi_prepare_resume_backup(void)
-{
- if (!acpi_s3_resume_allowed())
- return;
-
- if (CONFIG(RELOCATABLE_RAMSTAGE))
- return;
-
- backup_create_or_update(NULL, (uintptr_t)_program,
- REGION_SIZE(program));
-}
-
#define WAKEUP_BASE 0x600
-asmlinkage void (*acpi_do_wakeup)(uintptr_t vector, u32 backup_source,
- u32 backup_target, u32 backup_size) = (void *)WAKEUP_BASE;
+asmlinkage void (*acpi_do_wakeup)(uintptr_t vector) = (void *)WAKEUP_BASE;
extern unsigned char __wakeup;
extern unsigned int __wakeup_size;
static void acpi_jump_to_wakeup(void *vector)
{
- uintptr_t source = 0, target = 0;
- size_t size = 0;
-
if (!acpi_s3_resume_allowed()) {
printk(BIOS_WARNING, "ACPI: S3 resume not allowed.\n");
return;
}
- if (!CONFIG(RELOCATABLE_RAMSTAGE)) {
- struct resume_backup *backup_mem = cbmem_find(CBMEM_ID_RESUME);
- if (backup_mem && backup_mem->valid) {
- backup_mem->valid = 0;
- target = backup_mem->lowmem;
- source = backup_mem->cbmem;
- size = backup_mem->size;
- } else {
- printk(BIOS_WARNING, "ACPI: Backup memory missing. "
- "No S3 resume.\n");
- return;
- }
- }
-
/* Copy wakeup trampoline in place. */
memcpy((void *)WAKEUP_BASE, &__wakeup, __wakeup_size);
@@ -216,7 +83,7 @@ static void acpi_jump_to_wakeup(void *vector)
timestamp_add_now(TS_ACPI_WAKE_JUMP);
- acpi_do_wakeup((uintptr_t)vector, source, target, size);
+ acpi_do_wakeup((uintptr_t)vector);
}
void __weak mainboard_suspend_resume(void)
diff --git a/src/arch/x86/acpigen.c b/src/arch/x86/acpigen.c
index f9af10229e..1d75889018 100644
--- a/src/arch/x86/acpigen.c
+++ b/src/arch/x86/acpigen.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2015 Timothy Pearson ,
- * Raptor Engineering
- * Copyright (C) 2009 Rudolf Marek
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/acpigen_dsm.c b/src/arch/x86/acpigen_dsm.c
index 1aab90b714..64cdd7228e 100644
--- a/src/arch/x86/acpigen_dsm.c
+++ b/src/arch/x86/acpigen_dsm.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2016 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/assembly_entry.S b/src/arch/x86/assembly_entry.S
index 4ead9ea769..c36dc1cb10 100644
--- a/src/arch/x86/assembly_entry.S
+++ b/src/arch/x86/assembly_entry.S
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2016 Google Inc.
- * Copyright (C) 2016 Intel Corp.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -35,12 +32,13 @@ _start:
/* reset stack pointer to CAR stack */
mov $_car_stack_end, %esp
- /* clear CAR_GLOBAL area as it is not shared */
+ /* clear .bss section as it is not shared */
cld
xor %eax, %eax
- movl $(_car_global_end), %ecx
- movl $(_car_global_start), %edi
+ movl $(_ebss), %ecx
+ movl $(_bss), %edi
sub %edi, %ecx
+ shrl $2, %ecx
rep stosl
#if ((ENV_VERSTAGE && CONFIG(VERSTAGE_DEBUG_SPINLOOP)) \
@@ -60,9 +58,7 @@ debug_spinloop:
#endif
call car_stage_entry
-/* This is here for linking purposes. */
-.weak car_stage_entry
-car_stage_entry:
+ /* Expect to never return. */
1:
jmp 1b
diff --git a/src/arch/x86/bootblock.ld b/src/arch/x86/bootblock.ld
index 8ccd3e4629..10cd700322 100644
--- a/src/arch/x86/bootblock.ld
+++ b/src/arch/x86/bootblock.ld
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/bootblock_crt0.S b/src/arch/x86/bootblock_crt0.S
index ea55096abd..3cb57e058c 100644
--- a/src/arch/x86/bootblock_crt0.S
+++ b/src/arch/x86/bootblock_crt0.S
@@ -1,15 +1,6 @@
/*
- * This is the modern bootblock. It is used by platforms which select
- * C_ENVIRONMENT_BOOTBLOCK, and it prepares the system for C environment runtime
- * setup. The actual setup is done by hardware-specific code.
- *
- * It provides a bootflow similar to other architectures, and thus is considered
- * to be the modern approach.
- *
* This file is part of the coreboot project.
*
- * Copyright (C) 2015 Alexandru Gagniuc
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -19,6 +10,14 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * This is the modern bootblock. It is used by platforms which select
+ * C_ENVIRONMENT_BOOTBLOCK, and it prepares the system for C environment runtime
+ * setup. The actual setup is done by hardware-specific code.
+ *
+ * It provides a bootflow similar to other architectures, and thus is considered
+ * to be the modern approach.
+ *
*/
#include
@@ -48,11 +47,10 @@ bootblock_protected_mode_entry:
/* MMX registers required here */
/* BIST result in eax */
- movl %eax, %ebx
+ movd %eax, %mm0
/* Get an early timestamp */
rdtsc
- movd %ebx, %mm0
movd %eax, %mm1
movd %edx, %mm2
#endif
diff --git a/src/arch/x86/bootblock_romcc.S b/src/arch/x86/bootblock_romcc.S
index 02603e91e3..05b34c6c5a 100644
--- a/src/arch/x86/bootblock_romcc.S
+++ b/src/arch/x86/bootblock_romcc.S
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/car.ld b/src/arch/x86/car.ld
index 5802b02896..6ccbd8c236 100644
--- a/src/arch/x86/car.ld
+++ b/src/arch/x86/car.ld
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2006 Advanced Micro Devices, Inc.
- * Copyright (C) 2008-2010 coresystems GmbH
- * Copyright 2015 Google Inc
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -60,36 +56,35 @@
. += 32;
_epdpt = .;
#endif
- _car_relocatable_data_start = .;
- /* The timestamp implementation relies on this storage to be around
- * after migration. One of the fields indicates not to use it as the
- * backing store once cbmem comes online. Therefore, this data needs
- * to reside in the migrated area (between _car_relocatable_data_start
- * and _car_relocatable_data_end). */
+
TIMESTAMP(., 0x200)
+
_car_ehci_dbg_info_start = .;
/* Reserve sizeof(struct ehci_dbg_info). */
. += 80;
_car_ehci_dbg_info_end = .;
- /* _car_global_start and _car_global_end provide symbols to per-stage
+
+ /* _bss and _ebss provide symbols to per-stage
* variables that are not shared like the timestamp and the pre-ram
* cbmem console. This is useful for clearing this area on a per-stage
* basis when more than one stage uses cache-as-ram for CAR_GLOBALs. */
- _car_global_start = .;
-#if CONFIG(NO_CAR_GLOBAL_MIGRATION)
- /* Allow global unitialized variables when CAR_GLOBALs are not used. */
+
+ . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
+ _bss = .;
+#if ENV_STAGE_HAS_BSS_SECTION
+ /* Allow global uninitialized variables for stages without CAR teardown. */
*(.bss)
*(.bss.*)
*(.sbss)
*(.sbss.*)
#else
- /* .car.global_data objects only around when
- * !CONFIG_NO_CAR_GLOBAL_MIGRATION is employed. */
+ _car_global_start = .;
*(.car.global_data);
+ _car_global_end = .;
#endif
. = ALIGN(ARCH_POINTER_ALIGN_SIZE);
- _car_global_end = .;
- _car_relocatable_data_end = .;
+ _ebss = .;
+ _car_unallocated_start = .;
#if !CONFIG(C_ENVIRONMENT_BOOTBLOCK)
_car_stack_start = .;
@@ -107,7 +102,7 @@
.illegal_globals . : {
*(EXCLUDE_FILE ("*/libagesa.*.a:" "*/romstage*/buildOpts.o" "*/romstage*/agesawrapper.o" "*/vendorcode/amd/agesa/*" "*/vendorcode/amd/cimx/*") .data)
*(EXCLUDE_FILE ("*/libagesa.*.a:" "*/romstage*/buildOpts.o" "*/romstage*/agesawrapper.o" "*/vendorcode/amd/agesa/*" "*/vendorcode/amd/cimx/*") .data.*)
-#if !CONFIG(NO_CAR_GLOBAL_MIGRATION)
+#if CONFIG(CAR_GLOBAL_MIGRATION)
*(.bss)
*(.bss.*)
*(.sbss)
diff --git a/src/arch/x86/cbfs_and_run.c b/src/arch/x86/cbfs_and_run.c
index f25052b1ed..5ca2c896e5 100644
--- a/src/arch/x86/cbfs_and_run.c
+++ b/src/arch/x86/cbfs_and_run.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2008-2009 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/cbmem.c b/src/arch/x86/cbmem.c
index 648633f070..16c35b5dea 100644
--- a/src/arch/x86/cbmem.c
+++ b/src/arch/x86/cbmem.c
@@ -13,7 +13,6 @@
#include
#include
-#include
#if CONFIG(CBMEM_TOP_BACKUP)
@@ -35,13 +34,3 @@ void *cbmem_top(void)
}
#endif /* CBMEM_TOP_BACKUP */
-
-/* Something went wrong, our high memory area got wiped */
-void cbmem_fail_resume(void)
-{
-#if !defined(__PRE_RAM__) && CONFIG(HAVE_ACPI_RESUME)
- /* ACPI resume needs to be cleared in the fail-to-recover case, but that
- * condition is only handled during ramstage. */
- acpi_fail_wakeup();
-#endif
-}
diff --git a/src/arch/x86/cf9_reset.c b/src/arch/x86/cf9_reset.c
index d1e5704ceb..ccfaa7d9f8 100644
--- a/src/arch/x86/cf9_reset.c
+++ b/src/arch/x86/cf9_reset.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2017 Google, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/ebda.c b/src/arch/x86/ebda.c
index 810312c105..d1212f9d32 100644
--- a/src/arch/x86/ebda.c
+++ b/src/arch/x86/ebda.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2012 The Chromium OS Authors. All rights reserved.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/arch/x86/exit_car.S b/src/arch/x86/exit_car.S
index 769a758b9d..679e335eb3 100644
--- a/src/arch/x86/exit_car.S
+++ b/src/arch/x86/exit_car.S
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2016 Google Inc.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/arch/x86/failover.ld b/src/arch/x86/failover.ld
index a9a5942a2f..334145a742 100644
--- a/src/arch/x86/failover.ld
+++ b/src/arch/x86/failover.ld
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2006 Advanced Micro Devices, Inc.
- * Copyright (C) 2008-2010 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/gdt.c b/src/arch/x86/gdt.c
index 81756ff568..27e4af3d47 100644
--- a/src/arch/x86/gdt.c
+++ b/src/arch/x86/gdt.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2008-2009 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index 259efcd2d5..6cd4e9fae8 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -1,14 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2004 SUSE LINUX AG
- * Copyright (C) 2004 Nick Barker
- * Copyright (C) 2008-2009 coresystems GmbH
- * Copyright (C) 2015 Timothy Pearson ,
- * Raptor Engineering
- * Copyright (C) 2016 Siemens AG
- * (Written by Stefan Reinauer )
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -26,8 +18,6 @@
#ifndef __ASM_ACPI_H
#define __ASM_ACPI_H
-#define HIGH_MEMORY_SAVE (CONFIG_RAMTOP - CONFIG_RAMBASE)
-
/*
* The type and enable fields are common in ACPI, but the
* values themselves are hardware implementation defined.
@@ -131,6 +121,14 @@ typedef struct acpi_gen_regaddr {
#define ACPI_ACCESS_SIZE_DWORD_ACCESS 3
#define ACPI_ACCESS_SIZE_QWORD_ACCESS 4
+/* Common ACPI HIDs */
+#define ACPI_HID_FDC "PNP0700"
+#define ACPI_HID_KEYBOARD "PNP0303"
+#define ACPI_HID_MOUSE "PNP0F03"
+#define ACPI_HID_COM "PNP0501"
+#define ACPI_HID_LPT "PNP0400"
+#define ACPI_HID_PNP "PNP0C02"
+
/* Generic ACPI header, provided by (almost) all tables */
typedef struct acpi_table_header {
char signature[4]; /* ACPI signature (4 ASCII characters) */
@@ -934,9 +932,7 @@ unsigned long acpi_create_hest_error_source(acpi_hest_t *hest,
acpi_hest_esd_t *esd, u16 type, void *data, u16 len);
/* For ACPI S3 support. */
-void acpi_fail_wakeup(void);
void acpi_resume(void *wake_vec);
-void acpi_prepare_resume_backup(void);
void mainboard_suspend_resume(void);
void *acpi_find_wakeup_vector(void);
@@ -976,16 +972,9 @@ static inline int acpi_s3_resume_allowed(void)
return CONFIG(HAVE_ACPI_RESUME);
}
-/* Return address in reserved memory where to backup low memory
- * while platform resumes from S3 suspend. Caller is responsible of
- * making a complete copy of the region base..base+size, with
- * parameteres base and size that meet page alignment requirement.
- */
-void *acpi_backup_container(uintptr_t base, size_t size);
-
#if CONFIG(HAVE_ACPI_RESUME)
-#ifdef __PRE_RAM__
+#if ENV_ROMSTAGE_OR_BEFORE
static inline int acpi_is_wakeup_s3(void)
{
return (acpi_get_sleep_type() == ACPI_S3);
diff --git a/src/arch/x86/include/arch/acpi_device.h b/src/arch/x86/include/arch/acpi_device.h
index d74af9da74..382ef1546b 100644
--- a/src/arch/x86/include/arch/acpi_device.h
+++ b/src/arch/x86/include/arch/acpi_device.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2016 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -63,6 +61,7 @@ struct acpi_dp {
struct device;
const char *acpi_device_name(const struct device *dev);
+const char *acpi_device_hid(const struct device *dev);
const char *acpi_device_path(const struct device *dev);
const char *acpi_device_scope(const struct device *dev);
const char *acpi_device_path_join(const struct device *dev, const char *name);
diff --git a/src/arch/x86/include/arch/acpi_ivrs.h b/src/arch/x86/include/arch/acpi_ivrs.h
index 5d69141d21..784b5a39a2 100644
--- a/src/arch/x86/include/arch/acpi_ivrs.h
+++ b/src/arch/x86/include/arch/acpi_ivrs.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2016 Google, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/include/arch/acpi_pld.h b/src/arch/x86/include/arch/acpi_pld.h
index 1b4417d2da..f23aacd539 100644
--- a/src/arch/x86/include/arch/acpi_pld.h
+++ b/src/arch/x86/include/arch/acpi_pld.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2018 Google LLC
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/include/arch/acpigen.h b/src/arch/x86/include/arch/acpigen.h
index db003fe113..0f11226eb0 100644
--- a/src/arch/x86/include/arch/acpigen.h
+++ b/src/arch/x86/include/arch/acpigen.h
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2009 Rudolf Marek
- * Copyright (C) 2015 Timothy Pearson ,
- * Raptor Engineering
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/include/arch/acpigen_dsm.h b/src/arch/x86/include/arch/acpigen_dsm.h
index 2d8bb4877a..49ed6db632 100644
--- a/src/arch/x86/include/arch/acpigen_dsm.h
+++ b/src/arch/x86/include/arch/acpigen_dsm.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2016 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/include/arch/bert_storage.h b/src/arch/x86/include/arch/bert_storage.h
index 5c87aed8b0..644f24e50c 100644
--- a/src/arch/x86/include/arch/bert_storage.h
+++ b/src/arch/x86/include/arch/bert_storage.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2018 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/include/arch/cbconfig.h b/src/arch/x86/include/arch/cbconfig.h
index 78a5940c6a..b222ef3603 100644
--- a/src/arch/x86/include/arch/cbconfig.h
+++ b/src/arch/x86/include/arch/cbconfig.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2016 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/include/arch/cbfs.h b/src/arch/x86/include/arch/cbfs.h
index 54f0fa97e1..ec367ed1de 100644
--- a/src/arch/x86/include/arch/cbfs.h
+++ b/src/arch/x86/include/arch/cbfs.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2012 The ChromiumOS Authors. All rights reserved.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h
index 293ca02158..263b734529 100644
--- a/src/arch/x86/include/arch/cpu.h
+++ b/src/arch/x86/include/arch/cpu.h
@@ -203,12 +203,6 @@ static inline unsigned int cpuid_edx(unsigned int op)
unsigned int cpu_cpuid_extended_level(void);
int cpu_have_cpuid(void);
-/* Only with !PARALLEL_MP. */
-void smm_init(void);
-void smm_init_completion(void);
-
-void smm_setup_structures(void *gnvs, void *tcg, void *smi1);
-
static inline bool cpu_is_amd(void)
{
return CONFIG(CPU_AMD_AGESA) || CONFIG(CPU_AMD_PI)
@@ -285,11 +279,10 @@ static inline void get_fms(struct cpuinfo_x86 *c, uint32_t tfms)
c->x86_model += ((tfms >> 16) & 0xF) << 4;
}
-#endif
+/* romcc does not understand regparm. */
#define asmlinkage __attribute__((regparm(0)))
-#ifndef __ROMCC__
/*
* When using CONFIG_C_ENVIRONMENT_BOOTBLOCK the car_stage_entry()
* is the symbol jumped to for each stage after bootblock using
@@ -297,60 +290,6 @@ static inline void get_fms(struct cpuinfo_x86 *c, uint32_t tfms)
*/
asmlinkage void car_stage_entry(void);
-/*
- * Support setting up a stack frame consisting of MTRR information
- * for use in bootstrapping the caching attributes after cache-as-ram
- * is torn down.
- */
-
-struct postcar_frame {
- uintptr_t stack;
- uint32_t upper_mask;
- int max_var_mtrrs;
- int num_var_mtrrs;
-};
-
-/*
- * Initialize postcar_frame object allocating stack from cbmem,
- * with stack_size == 0, default 4 KiB is allocated.
- * Returns 0 on success, < 0 on error.
- */
-int postcar_frame_init(struct postcar_frame *pcf, size_t stack_size);
-
-/*
- * Add variable MTRR covering the provided range with MTRR type.
- */
-void postcar_frame_add_mtrr(struct postcar_frame *pcf,
- uintptr_t addr, size_t size, int type);
-
-/*
- * Add variable MTRR covering the memory-mapped ROM with given MTRR type.
- */
-void postcar_frame_add_romcache(struct postcar_frame *pcf, int type);
-
-/*
- * Push used MTRR and Max MTRRs on to the stack
- * and return pointer to stack top.
- */
-void *postcar_commit_mtrrs(struct postcar_frame *pcf);
-
-/*
- * Load and run a program that takes control of execution that
- * tears down CAR and loads ramstage. The postcar_frame object
- * indicates how to set up the frame. If caching is enabled at
- * the time of the call it is up to the platform code to handle
- * coherency with dirty lines in the cache using some mechansim
- * such as platform_prog_run() because run_postcar_phase()
- * utilizes prog_run() internally.
- */
-void run_postcar_phase(struct postcar_frame *pcf);
-
-/*
- * Systems without a native coreboot cache-as-ram teardown may implement
- * this to use an alternate method.
- */
-void late_car_teardown(void);
-
#endif
/*
diff --git a/src/arch/x86/include/arch/early_variables.h b/src/arch/x86/include/arch/early_variables.h
index a69c230596..b88495c85b 100644
--- a/src/arch/x86/include/arch/early_variables.h
+++ b/src/arch/x86/include/arch/early_variables.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -20,7 +18,17 @@
#include
#include
-#if ENV_CACHE_AS_RAM && !CONFIG(NO_CAR_GLOBAL_MIGRATION)
+#if ENV_ROMSTAGE && CONFIG(CAR_GLOBAL_MIGRATION)
+
+/*
+ * The _car_global_[start|end]symbols cover CAR data which is relocatable
+ * once memory comes online. Variables with CAR_GLOBAL decoration
+ * reside within this region.
+ */
+extern char _car_global_start[];
+extern char _car_global_end[];
+#define _car_global_size (_car_global_end - _car_global_start)
+
asm(".section .car.global_data,\"w\",@nobits");
asm(".previous");
#ifdef __clang__
@@ -29,78 +37,62 @@ asm(".previous");
#define CAR_GLOBAL __attribute__((used, section(".car.global_data#")))
#endif /* __clang__ */
-/*
- * In stages that use CAR (verstage, C bootblock) all CAR_GLOBAL variables are
- * accessed unconditionally because cbmem is never initialized until romstage
- * when dram comes up.
- */
-#if !ENV_ROMSTAGE
-static inline void *car_get_var_ptr(void *var)
+/* Get the correct pointer for the CAR global variable. */
+void *car_get_var_ptr(void *var);
+
+/* Return 1 when currently running with globals in Cache-as-RAM, 0 otherwise. */
+int car_active(void);
+
+/* Get and set a primitive type global variable. */
+#define car_get_var(var) \
+ (*(typeof(var) *)car_get_var_ptr(&(var)))
+#define car_set_var(var, val) car_get_var(var) = (val)
+
+/* Get and set a CAR_GLOBAL pointing elsewhere inside CAR. */
+#if !CONFIG(PLATFORM_USES_FSP1_0)
+#define car_get_ptr car_get_var
+#define car_set_ptr car_set_var
+#else
+void *car_get_reloc_ptr(void *var);
+void car_set_reloc_ptr(void *var, void *val);
+#define car_get_ptr(var) car_get_reloc_ptr(&(var))
+#define car_set_ptr(var, val) car_set_reloc_ptr(&(var), (val))
+#endif
+
+static inline size_t car_data_size(void)
{
- return var;
+ size_t car_size = _car_global_size;
+ return ALIGN(car_size, 64);
}
-static inline void *car_sync_var_ptr(void *var)
+static inline size_t car_object_offset(void *ptr)
+{
+ return (char *)ptr - &_car_global_start[0];
+}
+
+#else
+
+/*
+ * For all stages other than romstage, all CAR_GLOBAL variables are accessed
+ * unconditionally as there is no migration of symbols.
+ */
+
+#define CAR_GLOBAL
+#define car_get_var(var) (var)
+#define car_set_var(var, val) (var) = (val)
+#define car_get_ptr car_get_var
+#define car_set_ptr car_set_var
+
+static inline void *car_get_var_ptr(void *var)
{
return var;
}
static inline int car_active(void)
{
- return 1;
-}
-#else
-/* Get the correct pointer for the CAR global variable. */
-void *car_get_var_ptr(void *var);
-
-/* Get and update a CAR_GLOBAL pointing elsewhere in car.global_data*/
-void *car_sync_var_ptr(void *var);
-
-/* Return 1 when currently running with globals in Cache-as-RAM, 0 otherwise. */
-int car_active(void);
-#endif /* !ENV_ROMSTAGE */
-
-/* Get and set a primitive type global variable. */
-#define car_get_var(var) \
- (*(typeof(var) *)car_get_var_ptr(&(var)))
-#define car_sync_var(var) \
- (*(typeof(var) *)car_sync_var_ptr(&(var)))
-#define car_set_var(var, val) car_get_var(var) = (val)
-
-static inline size_t car_data_size(void)
-{
- size_t car_size = _car_relocatable_data_size;
- return ALIGN_UP(car_size, 64);
+ return ENV_CACHE_AS_RAM;
}
-static inline size_t car_object_offset(void *ptr)
-{
- return (char *)ptr - &_car_relocatable_data_start[0];
-}
-
-#else
-
-/*
- * We might end up here if:
- * 1. ENV_CACHE_AS_RAM is not set for the stage or
- * 2. ENV_CACHE_AS_RAM is set for the stage but CONFIG_NO_CAR_GLOBAL_MIGRATION
- * is also set. In this case, there is no need to migrate CAR global
- * variables. But, since we might still be running out of CAR, car_active needs
- * to return 1 if ENV_CACHE_AS_RAM is set.
- */
-
-#define CAR_GLOBAL
-static inline void *car_get_var_ptr(void *var) { return var; }
-
-#if ENV_CACHE_AS_RAM
-static inline int car_active(void) { return 1; }
-#else
-static inline int car_active(void) { return 0; }
-#endif /* ENV_CACHE_AS_RAM */
-
-#define car_get_var(var) (var)
-#define car_sync_var(var) (var)
-#define car_set_var(var, val) (var) = (val)
-#endif /* ENV_CACHE_AS_RAM && !CONFIG(NO_CAR_GLOBAL_MIGRATION) */
+#endif
#endif /* ARCH_EARLY_VARIABLES_H */
diff --git a/src/arch/x86/include/arch/ebda.h b/src/arch/x86/include/arch/ebda.h
index 2347ea5318..534fb3d590 100644
--- a/src/arch/x86/include/arch/ebda.h
+++ b/src/arch/x86/include/arch/ebda.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2012 The Chromium OS Authors. All rights reserved.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/arch/x86/include/arch/exception.h b/src/arch/x86/include/arch/exception.h
index d71d5a51f4..df6f9e5ee7 100644
--- a/src/arch/x86/include/arch/exception.h
+++ b/src/arch/x86/include/arch/exception.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2013 Google Inc.
- *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
diff --git a/src/arch/x86/include/arch/header.ld b/src/arch/x86/include/arch/header.ld
index 77eb187222..69f6d7d671 100644
--- a/src/arch/x86/include/arch/header.ld
+++ b/src/arch/x86/include/arch/header.ld
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/include/arch/intel-family.h b/src/arch/x86/include/arch/intel-family.h
deleted file mode 100644
index 43eb0e6b34..0000000000
--- a/src/arch/x86/include/arch/intel-family.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#ifndef ARCH_INTEL_FAMILY_H
-#define ARCH_INTEL_FAMILY_H
-
-#define CPU_MODEL_INTEL_CORE_YONAH 0x0E
-
-#define CPU_MODEL_INTEL_CORE2_MEROM 0x0F
-#define CPU_MODEL_INTEL_CORE2_MEROM_L 0x16
-#define CPU_MODEL_INTEL_CORE2_PENRYN 0x17
-#define CPU_MODEL_INTEL_CORE2_DUNNINGTON 0x1D
-
-#define CPU_MODEL_INTEL_NEHALEM 0x1E
-/* Auburndale / Havendale */
-#define CPU_MODEL_INTEL_NEHALEM_G 0x1F
-#define CPU_MODEL_INTEL_NEHALEM_EP 0x1A
-#define CPU_MODEL_INTEL_NEHALEM_EX 0x2E
-
-#define CPU_MODEL_INTEL_WESTMERE 0x25
-#define CPU_MODEL_INTEL_WESTMERE_EP 0x2C
-#define CPU_MODEL_INTEL_WESTMERE_EX 0x2F
-
-#define CPU_MODEL_INTEL_SANDYBRIDGE 0x2A
-#define CPU_MODEL_INTEL_SANDYBRIDGE_X 0x2D
-#define CPU_MODEL_INTEL_IVYBRIDGE 0x3A
-#define CPU_MODEL_INTEL_IVYBRIDGE_X 0x3E
-
-#define CPU_MODEL_INTEL_HASWELL_CORE 0x3C
-#define CPU_MODEL_INTEL_HASWELL_X 0x3F
-#define CPU_MODEL_INTEL_HASWELL_ULT 0x45
-#define CPU_MODEL_INTEL_HASWELL_GT3E 0x46
-
-#define CPU_MODEL_INTEL_BROADWELL_CORE 0x3D
-#define CPU_MODEL_INTEL_BROADWELL_GT3E 0x47
-#define CPU_MODEL_INTEL_BROADWELL_X 0x4F
-#define CPU_MODEL_INTEL_BROADWELL_XEON_D 0x56
-
-#define CPU_MODEL_INTEL_SKYLAKE_MOBILE 0x4E
-#define CPU_MODEL_INTEL_SKYLAKE_DESKTOP 0x5E
-#define CPU_MODEL_INTEL_SKYLAKE_X 0x55
-#define CPU_MODEL_INTEL_KABYLAKE_MOBILE 0x8E
-#define CPU_MODEL_INTEL_KABYLAKE_DESKTOP 0x9E
-#define CPU_MODEL_INTEL_CANNONLAKE_MOBILE 0x66
-#define CPU_MODEL_INTEL_ICELAKE_MOBILE 0x7E
-
-/* "Small Core" Processors (Atom) */
-
-#define CPU_MODEL_INTEL_ATOM_PINEVIEW 0x1C
-#define CPU_MODEL_INTEL_ATOM_LINCROFT 0x26
-#define CPU_MODEL_INTEL_ATOM_PENWELL 0x27
-#define CPU_MODEL_INTEL_ATOM_CLOVERVIEW 0x35
-#define CPU_MODEL_INTEL_ATOM_CEDARVIEW 0x36
-/* BayTrail/BYT / Valleyview */
-#define CPU_MODEL_INTEL_ATOM_SILVERMONT1 0x37
-/* Avaton/Rangely */
-#define CPU_MODEL_INTEL_ATOM_SILVERMONT2 0x4D
-/* CherryTrail / Braswell */
-#define CPU_MODEL_INTEL_ATOM_AIRMONT 0x4C
-/* Tangier */
-#define CPU_MODEL_INTEL_ATOM_MERRIFIELD 0x4A
-/* Anniedale */
-#define CPU_MODEL_INTEL_ATOM_MOOREFIELD 0x5A
-#define CPU_MODEL_INTEL_ATOM_GOLDMONT 0x5C
-/* Goldmont Microserver */
-#define CPU_MODEL_INTEL_ATOM_DENVERTON 0x5F
-#define CPU_MODEL_INTEL_ATOM_GEMINI_LAKE 0x7A
-
-/* Xeon Phi */
-
-/* Knights Landing */
-#define CPU_MODEL_INTEL_XEON_PHI_KNL 0x57
-/* Knights Mill */
-#define CPU_MODEL_INTEL_XEON_PHI_KNM 0x85
-
-#endif /* ARCH_INTEL_FAMILY_H */
diff --git a/src/arch/x86/include/arch/interrupt.h b/src/arch/x86/include/arch/interrupt.h
index 086e5bc8f2..baf6b7829a 100644
--- a/src/arch/x86/include/arch/interrupt.h
+++ b/src/arch/x86/include/arch/interrupt.h
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2009 coresystems GmbH
- * Copyright (C) 2009 Libra Li
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/arch/x86/include/arch/ioapic.h b/src/arch/x86/include/arch/ioapic.h
index bc229d9952..5938cdc51d 100644
--- a/src/arch/x86/include/arch/ioapic.h
+++ b/src/arch/x86/include/arch/ioapic.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2010 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/include/arch/memlayout.h b/src/arch/x86/include/arch/memlayout.h
index de80f42a0d..11da892af0 100644
--- a/src/arch/x86/include/arch/memlayout.h
+++ b/src/arch/x86/include/arch/memlayout.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -16,13 +14,6 @@
#ifndef __ARCH_MEMLAYOUT_H
#define __ARCH_MEMLAYOUT_H
-
-#if ENV_BOOTBLOCK || ENV_ROMSTAGE || ENV_VERSTAGE
-/* No .data or .bss sections. Cache as RAM is handled separately. */
-#define ARCH_STAGE_HAS_DATA_SECTION 0
-#define ARCH_STAGE_HAS_BSS_SECTION 0
-#endif
-
#if (CONFIG_RAMTOP == 0)
# error "CONFIG_RAMTOP not configured"
#endif
diff --git a/src/arch/x86/include/arch/memory_clear.h b/src/arch/x86/include/arch/memory_clear.h
index 87ad7ada85..2b887b848f 100644
--- a/src/arch/x86/include/arch/memory_clear.h
+++ b/src/arch/x86/include/arch/memory_clear.h
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2019 9elements Agency GmbH
- * Copyright (C) 2019 Facebook Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/include/arch/pci_mmio_cfg_romcc.h b/src/arch/x86/include/arch/pci_mmio_cfg_romcc.h
index 00e8e41088..36a88f1e4d 100644
--- a/src/arch/x86/include/arch/pci_mmio_cfg_romcc.h
+++ b/src/arch/x86/include/arch/pci_mmio_cfg_romcc.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2007-2009 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/include/arch/pirq_routing.h b/src/arch/x86/include/arch/pirq_routing.h
index b416ec1422..60495a1d46 100644
--- a/src/arch/x86/include/arch/pirq_routing.h
+++ b/src/arch/x86/include/arch/pirq_routing.h
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2012 Alexandru Gagniuc
- * Copyright (C) 2012 Patrick Georgi
- * Copyright (C) 2010 Stefan Reinauer
- *
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
diff --git a/src/arch/x86/include/arch/registers.h b/src/arch/x86/include/arch/registers.h
index 41275a8dc2..8cf0d48486 100644
--- a/src/arch/x86/include/arch/registers.h
+++ b/src/arch/x86/include/arch/registers.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2009 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/include/arch/romstage.h b/src/arch/x86/include/arch/romstage.h
new file mode 100644
index 0000000000..15c93f24bd
--- /dev/null
+++ b/src/arch/x86/include/arch/romstage.h
@@ -0,0 +1,100 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ARCH_ROMSTAGE_H__
+#define __ARCH_ROMSTAGE_H__
+
+#include
+#include
+#include
+
+void mainboard_romstage_entry(void);
+
+/*
+ * Support setting up a stack frame consisting of MTRR information
+ * for use in bootstrapping the caching attributes after cache-as-ram
+ * is torn down.
+ */
+
+struct postcar_frame {
+ uintptr_t stack;
+ uint32_t upper_mask;
+ int max_var_mtrrs;
+ int num_var_mtrrs;
+ int skip_common_mtrr;
+};
+
+/*
+ * Initialize postcar_frame object allocating stack from cbmem,
+ * with stack_size == 0, default 4 KiB is allocated.
+ * Returns 0 on success, < 0 on error.
+ */
+int postcar_frame_init(struct postcar_frame *pcf, size_t stack_size);
+
+/*
+ * Add variable MTRR covering the provided range with MTRR type.
+ */
+void postcar_frame_add_mtrr(struct postcar_frame *pcf,
+ uintptr_t addr, size_t size, int type);
+
+/*
+ * Add variable MTRR covering the memory-mapped ROM with given MTRR type.
+ */
+void postcar_frame_add_romcache(struct postcar_frame *pcf, int type);
+
+/*
+ * Add a common MTRR setup most platforms will have as a subset.
+ */
+void postcar_frame_common_mtrrs(struct postcar_frame *pcf);
+
+/*
+ * fill_postcar_frame() is called after raminit completes and right before
+ * calling run_postcar_phase(). Implementation should call postcar_frame_add_mtrr()
+ * to tag memory ranges as cacheable to speed up execution of postcar and
+ * early ramstage.
+ */
+void fill_postcar_frame(struct postcar_frame *pcf);
+
+/*
+ * prepare_and_run_postcar() determines the stack to use after
+ * cache-as-ram is torn down as well as the MTRR settings to use.
+ */
+void prepare_and_run_postcar(struct postcar_frame *pcf);
+
+/*
+ * Load and run a program that takes control of execution that
+ * tears down CAR and loads ramstage. The postcar_frame object
+ * indicates how to set up the frame. If caching is enabled at
+ * the time of the call it is up to the platform code to handle
+ * coherency with dirty lines in the cache using some mechansim
+ * such as platform_prog_run() because run_postcar_phase()
+ * utilizes prog_run() internally.
+ */
+void run_postcar_phase(struct postcar_frame *pcf);
+
+/*
+ * Systems without a native coreboot cache-as-ram teardown may implement
+ * this to use an alternate method.
+ */
+void late_car_teardown(void);
+
+/*
+ * Cache the TSEG region at the top of ram. This region is
+ * not restricted to SMM mode until SMM has been relocated.
+ * By setting the region to cacheable it provides faster access
+ * when relocating the SMM handler as well as using the TSEG
+ * region for other purposes.
+ */
+void postcar_enable_tseg_cache(struct postcar_frame *pcf);
+
+#endif /* __ARCH_ROMSTAGE_H__ */
diff --git a/src/arch/x86/include/arch/smp/mpspec.h b/src/arch/x86/include/arch/smp/mpspec.h
index 1e7300fea6..7500945c42 100644
--- a/src/arch/x86/include/arch/smp/mpspec.h
+++ b/src/arch/x86/include/arch/smp/mpspec.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Sage Electronic Engineering, LLC.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/include/arch/stages.h b/src/arch/x86/include/arch/stages.h
index 5716030274..3ef3cae148 100644
--- a/src/arch/x86/include/arch/stages.h
+++ b/src/arch/x86/include/arch/stages.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2010 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/include/arch/symbols.h b/src/arch/x86/include/arch/symbols.h
index 97a07c0746..f715e0a6d1 100644
--- a/src/arch/x86/include/arch/symbols.h
+++ b/src/arch/x86/include/arch/symbols.h
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2016 Intel Corp.
- * Copyright 2016 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -27,31 +24,18 @@ extern char _car_region_end[];
#define _car_region_size (_car_region_end - _car_region_start)
/*
- * This is the stack used under CONFIG_C_ENVIRONMENT_BOOTBLOCK for
- * all stages that execute when cache-as-ram is up.
+ * This is the stack area used for all stages that execute when cache-as-ram
+ * is up. Area is not cleared in between stages.
*/
extern char _car_stack_start[];
extern char _car_stack_end[];
#define _car_stack_size (_car_stack_end - _car_stack_start)
+extern char _car_unallocated_start[];
+
extern char _car_ehci_dbg_info_start[];
extern char _car_ehci_dbg_info_end[];
#define _car_ehci_dbg_info_size \
(_car_ehci_dbg_info_end - _car_ehci_dbg_info_start)
-/*
- * The _car_relocatable_data_[start|end] symbols cover CAR data which is
- * relocatable once memory comes online. Variables with CAR_GLOBAL decoration
- * reside within this region. The _car_global_[start|end] is a subset of the
- * relocatable region which excludes the timestamp region because of
- * intricacies in the timestamp code.
- */
-extern char _car_relocatable_data_start[];
-extern char _car_relocatable_data_end[];
-#define _car_relocatable_data_size \
- (_car_relocatable_data_end - _car_relocatable_data_start)
-extern char _car_global_start[];
-extern char _car_global_end[];
-#define _car_global_size (_car_global_end - _car_global_start)
-
#endif
diff --git a/src/arch/x86/include/cf9_reset.h b/src/arch/x86/include/cf9_reset.h
index 7b44e0f2a6..e05c2e1c34 100644
--- a/src/arch/x86/include/cf9_reset.h
+++ b/src/arch/x86/include/cf9_reset.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2017 Intel Corp.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/include/smm.h b/src/arch/x86/include/smm.h
index d66e8906d6..320bac61aa 100644
--- a/src/arch/x86/include/smm.h
+++ b/src/arch/x86/include/smm.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2018 Google LLC
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/ioapic.c b/src/arch/x86/ioapic.c
index 34ab202f71..bf2ba6b255 100644
--- a/src/arch/x86/ioapic.c
+++ b/src/arch/x86/ioapic.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2010 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/memlayout.ld b/src/arch/x86/memlayout.ld
index cc72552254..9fd9889911 100644
--- a/src/arch/x86/memlayout.ld
+++ b/src/arch/x86/memlayout.ld
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -16,6 +14,15 @@
#include
#include
+/* Pull in the either CAR or early DRAM rules. */
+#if ENV_ROMSTAGE_OR_BEFORE
+#if ENV_CACHE_AS_RAM
+#define EARLY_MEMLAYOUT "car.ld"
+#else
+#error "Early DRAM environment for x86 is work-in-progress. */
+#endif
+#endif
+
SECTIONS
{
/*
@@ -34,23 +41,20 @@ SECTIONS
* Link at 32MiB address and rely on cbfstool to relocate to XIP. */
ROMSTAGE(CONFIG_ROMSTAGE_ADDR, 1M)
- /* Pull in the cache-as-ram rules. */
- #include "car.ld"
+ #include EARLY_MEMLAYOUT
#elif ENV_VERSTAGE
/* The 1M size is not allocated. It's just for basic size checking.
* Link at 32MiB address and rely on cbfstool to relocate to XIP. */
VERSTAGE(CONFIG_VERSTAGE_ADDR, 1M)
- /* Pull in the cache-as-ram rules. */
- #include "car.ld"
+ #include EARLY_MEMLAYOUT
#elif ENV_BOOTBLOCK
/* This is for C_ENVIRONMENT_BOOTBLOCK. arch/x86/bootblock.ld contains
* the logic for the romcc linking. */
BOOTBLOCK(0xffffffff - CONFIG_C_ENV_BOOTBLOCK_SIZE + 1,
CONFIG_C_ENV_BOOTBLOCK_SIZE)
- /* Pull in the cache-as-ram rules. */
- #include "car.ld"
+ #include EARLY_MEMLAYOUT
#elif ENV_POSTCAR
POSTCAR(32M, 1M)
diff --git a/src/arch/x86/memset.c b/src/arch/x86/memset.c
index b536e68227..0767683d12 100644
--- a/src/arch/x86/memset.c
+++ b/src/arch/x86/memset.c
@@ -1,6 +1,4 @@
/*
- * Copyright (C) 1991,1992,1993,1997,1998,2003, 2005 Free Software Foundation,
- * Inc.
* This file is part of the GNU C Library.
*
* This program is free software; you can redistribute it and/or
diff --git a/src/arch/x86/mmap_boot.c b/src/arch/x86/mmap_boot.c
index abfa024a54..762193090b 100644
--- a/src/arch/x86/mmap_boot.c
+++ b/src/arch/x86/mmap_boot.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/mpspec.c b/src/arch/x86/mpspec.c
index 28a9080e2e..eeca81606e 100644
--- a/src/arch/x86/mpspec.c
+++ b/src/arch/x86/mpspec.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Sage Electronic Engineering, LLC.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/pirq_routing.c b/src/arch/x86/pirq_routing.c
index 9d1f5910e9..ab3793c3a7 100644
--- a/src/arch/x86/pirq_routing.c
+++ b/src/arch/x86/pirq_routing.c
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2012 Alexandru Gagniuc
- * Copyright (C) 2010 Stefan Reinauer
- *
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
diff --git a/src/arch/x86/postcar.c b/src/arch/x86/postcar.c
index b4efc949b4..add72c2cda 100644
--- a/src/arch/x86/postcar.c
+++ b/src/arch/x86/postcar.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2016 Google, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -13,7 +11,7 @@
* GNU General Public License for more details.
*/
-#include
+#include
#include
#include
#include
@@ -33,7 +31,10 @@ void main(void)
console_init();
- /* Recover cbmem so infrastruture using it is functional. */
+ /*
+ * CBMEM needs to be recovered because timestamps rely on
+ * the cbmem infrastructure being around. Explicitly recover it.
+ */
cbmem_initialize();
timestamp_add_now(TS_START_POSTCAR);
diff --git a/src/arch/x86/postcar_loader.c b/src/arch/x86/postcar_loader.c
index 35e139fe1c..c6149ab26a 100644
--- a/src/arch/x86/postcar_loader.c
+++ b/src/arch/x86/postcar_loader.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2016 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -13,12 +11,13 @@
* GNU General Public License for more details.
*/
-#include
+#include
#include
#include
#include
#include
#include
+#include
#include
#include
#include
@@ -120,7 +119,31 @@ void postcar_frame_add_romcache(struct postcar_frame *pcf, int type)
postcar_frame_add_mtrr(pcf, CACHE_ROM_BASE, CACHE_ROM_SIZE, type);
}
-void *postcar_commit_mtrrs(struct postcar_frame *pcf)
+void postcar_frame_common_mtrrs(struct postcar_frame *pcf)
+{
+ if (pcf->skip_common_mtrr)
+ return;
+
+ /* Cache the ROM as WP just below 4GiB. */
+ postcar_frame_add_romcache(pcf, MTRR_TYPE_WRPROT);
+}
+
+/* prepare_and_run_postcar() determines the stack to use after
+ * cache-as-ram is torn down as well as the MTRR settings to use. */
+void prepare_and_run_postcar(struct postcar_frame *pcf)
+{
+ if (postcar_frame_init(pcf, 0))
+ die("Unable to initialize postcar frame.\n");
+
+ fill_postcar_frame(pcf);
+
+ postcar_frame_common_mtrrs(pcf);
+
+ run_postcar_phase(pcf);
+ /* We do not return here. */
+}
+
+static void postcar_commit_mtrrs(struct postcar_frame *pcf)
{
/*
* Place the number of used variable MTRRs on stack then max number
@@ -128,7 +151,6 @@ void *postcar_commit_mtrrs(struct postcar_frame *pcf)
*/
stack_push(pcf, pcf->num_var_mtrrs);
stack_push(pcf, pcf->max_var_mtrrs);
- return (void *) pcf->stack;
}
static void finalize_load(uintptr_t *stack_top_ptr, uintptr_t stack_top)
@@ -166,6 +188,23 @@ static void load_postcar_cbfs(struct prog *prog, struct postcar_frame *pcf)
stage_cache_add(STAGE_POSTCAR, prog);
}
+/*
+ * Cache the TSEG region at the top of ram. This region is
+ * not restricted to SMM mode until SMM has been relocated.
+ * By setting the region to cacheable it provides faster access
+ * when relocating the SMM handler as well as using the TSEG
+ * region for other purposes.
+ */
+void postcar_enable_tseg_cache(struct postcar_frame *pcf)
+{
+ uintptr_t smm_base;
+ size_t smm_size;
+
+ smm_region(&smm_base, &smm_size);
+ postcar_frame_add_mtrr(pcf, smm_base, smm_size,
+ MTRR_TYPE_WRBACK);
+}
+
void run_postcar_phase(struct postcar_frame *pcf)
{
struct prog prog =
diff --git a/src/arch/x86/prologue.inc b/src/arch/x86/prologue.inc
index 209a0042ac..4036ff9862 100644
--- a/src/arch/x86/prologue.inc
+++ b/src/arch/x86/prologue.inc
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2002 Eric Biederman
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/rdrand.c b/src/arch/x86/rdrand.c
index c9090df1fd..bf9e687ae1 100644
--- a/src/arch/x86/rdrand.c
+++ b/src/arch/x86/rdrand.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2017 Intel Corporation.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c
index 346e874217..4eb8726137 100644
--- a/src/arch/x86/smbios.c
+++ b/src/arch/x86/smbios.c
@@ -1,11 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2015 Timothy Pearson ,
- * Raptor Engineering
- * Copyright (C) 2011 Sven Schnelle
- * Copyright (C) 2018 Patrick Rudolph
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
@@ -275,20 +270,18 @@ static void trim_trailing_whitespace(char *buffer, size_t buffer_size)
static void smbios_fill_dimm_part_number(const char *part_number,
struct smbios_type17 *t)
{
- const size_t trimmed_buffer_size = DIMM_INFO_PART_NUMBER_SIZE;
-
int invalid;
size_t i, len;
- char trimmed_part_number[trimmed_buffer_size];
+ char trimmed_part_number[DIMM_INFO_PART_NUMBER_SIZE];
- strncpy(trimmed_part_number, part_number, trimmed_buffer_size);
- trimmed_part_number[trimmed_buffer_size - 1] = '\0';
+ strncpy(trimmed_part_number, part_number, sizeof(trimmed_part_number));
+ trimmed_part_number[sizeof(trimmed_part_number) - 1] = '\0';
/*
* SPD mandates that unused characters be represented with a ' '.
* We don't want to publish the whitespace in the SMBIOS tables.
*/
- trim_trailing_whitespace(trimmed_part_number, trimmed_buffer_size);
+ trim_trailing_whitespace(trimmed_part_number, sizeof(trimmed_part_number));
len = strlen(trimmed_part_number);
@@ -304,8 +297,7 @@ static void smbios_fill_dimm_part_number(const char *part_number,
/* Null String in Part Number will have "None" instead. */
t->part_number = smbios_add_string(t->eos, "None");
} else if (invalid) {
- char string_buffer[trimmed_buffer_size +
- 10 /* strlen("Invalid ()") */];
+ char string_buffer[sizeof(trimmed_part_number) + 10];
snprintf(string_buffer, sizeof(string_buffer), "Invalid (%s)",
trimmed_part_number);
diff --git a/src/arch/x86/tables.c b/src/arch/x86/tables.c
index 0baa58eb2b..ddb0710c8a 100644
--- a/src/arch/x86/tables.c
+++ b/src/arch/x86/tables.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2003 Eric Biederman
- * Copyright (C) 2005 Steve Magnani
- * Copyright (C) 2008-2009 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/thread.c b/src/arch/x86/thread.c
index b1cd99fe99..d92d8fdeca 100644
--- a/src/arch/x86/thread.c
+++ b/src/arch/x86/thread.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2013 Google, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/thread_switch.S b/src/arch/x86/thread_switch.S
index 169b7ebde7..1c1dedef1b 100644
--- a/src/arch/x86/thread_switch.S
+++ b/src/arch/x86/thread_switch.S
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2013 Google, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/timestamp.c b/src/arch/x86/timestamp.c
index 5b48c23be2..92d9590af4 100644
--- a/src/arch/x86/timestamp.c
+++ b/src/arch/x86/timestamp.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2013 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/verstage.c b/src/arch/x86/verstage.c
index d24866bcab..ad13e60f0c 100644
--- a/src/arch/x86/verstage.c
+++ b/src/arch/x86/verstage.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2016 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/arch/x86/wakeup.S b/src/arch/x86/wakeup.S
index ba502fefa5..187b96cab9 100644
--- a/src/arch/x86/wakeup.S
+++ b/src/arch/x86/wakeup.S
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2009 Rudolf Marek
- * Copyright (C) 2009 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -64,14 +61,6 @@ __wakeup:
shr $4, %eax
movw %ax, (__wakeup_segment)
- /* Then overwrite coreboot with our backed up memory */
- cld
- movl 8(%esp), %esi
- movl 12(%esp), %edi
- movl 16(%esp), %ecx
- shrl $2, %ecx
- rep movsl
-
/* Activate the right segment descriptor real mode. */
ljmp $0x28, $RELOCATED(1f)
1:
diff --git a/src/commonlib/cbfs.c b/src/commonlib/cbfs.c
index a509bc9f61..5c9aacba20 100644
--- a/src/commonlib/cbfs.c
+++ b/src/commonlib/cbfs.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/fsp_relocate.c b/src/commonlib/fsp_relocate.c
index 32e6b6da64..85deda2470 100644
--- a/src/commonlib/fsp_relocate.c
+++ b/src/commonlib/fsp_relocate.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/include/commonlib/cbfs.h b/src/commonlib/include/commonlib/cbfs.h
index c31df51263..cadc8c92cc 100644
--- a/src/commonlib/include/commonlib/cbfs.h
+++ b/src/commonlib/include/commonlib/cbfs.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/include/commonlib/cbmem_id.h b/src/commonlib/include/commonlib/cbmem_id.h
index ec702ecfdf..30bf88ada8 100644
--- a/src/commonlib/include/commonlib/cbmem_id.h
+++ b/src/commonlib/include/commonlib/cbmem_id.h
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2009 coresystems GmbH
- * Copyright (C) 2013 Google, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -79,6 +76,7 @@
#define CBMEM_ID_ROM1 0x524f4d31
#define CBMEM_ID_ROM2 0x524f4d32
#define CBMEM_ID_ROM3 0x524f4d33
+#define CBMEM_ID_FMAP 0x464d4150
#define CBMEM_ID_TO_NAME_TABLE \
{ CBMEM_ID_ACPI, "ACPI " }, \
@@ -137,5 +135,6 @@
{ CBMEM_ID_ROM0, "VGA ROM #0 "}, \
{ CBMEM_ID_ROM1, "VGA ROM #1 "}, \
{ CBMEM_ID_ROM2, "VGA ROM #2 "}, \
- { CBMEM_ID_ROM3, "VGA ROM #3 "},
+ { CBMEM_ID_ROM3, "VGA ROM #3 "}, \
+ { CBMEM_ID_FMAP, "FMAP "},
#endif /* _CBMEM_ID_H_ */
diff --git a/src/commonlib/include/commonlib/compiler.h b/src/commonlib/include/commonlib/compiler.h
index 5078759360..972a2293a2 100644
--- a/src/commonlib/include/commonlib/compiler.h
+++ b/src/commonlib/include/commonlib/compiler.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2017 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/include/commonlib/compression.h b/src/commonlib/include/commonlib/compression.h
index 428ee42e65..3988ef8ade 100644
--- a/src/commonlib/include/commonlib/compression.h
+++ b/src/commonlib/include/commonlib/compression.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2016 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/include/commonlib/coreboot_tables.h b/src/commonlib/include/commonlib/coreboot_tables.h
index 7bded2a3a3..68166701b0 100644
--- a/src/commonlib/include/commonlib/coreboot_tables.h
+++ b/src/commonlib/include/commonlib/coreboot_tables.h
@@ -89,6 +89,7 @@ enum {
LB_TAG_VBOOT_WORKBUF = 0x0034,
LB_TAG_MMC_INFO = 0x0035,
LB_TAG_TCPA_LOG = 0x0036,
+ LB_TAG_FMAP = 0x0037,
LB_TAG_CMOS_OPTION_TABLE = 0x00c8,
LB_TAG_OPTION = 0x00c9,
LB_TAG_OPTION_ENUM = 0x00ca,
diff --git a/src/commonlib/include/commonlib/endian.h b/src/commonlib/include/commonlib/endian.h
index 7b08eee7af..3d7ccb112b 100644
--- a/src/commonlib/include/commonlib/endian.h
+++ b/src/commonlib/include/commonlib/endian.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/include/commonlib/fsp.h b/src/commonlib/include/commonlib/fsp.h
index a2a2faebe8..2ae7949c8e 100644
--- a/src/commonlib/include/commonlib/fsp.h
+++ b/src/commonlib/include/commonlib/fsp.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2016 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/include/commonlib/iobuf.h b/src/commonlib/include/commonlib/iobuf.h
index c5a0f4c6fb..f114ef8fe5 100644
--- a/src/commonlib/include/commonlib/iobuf.h
+++ b/src/commonlib/include/commonlib/iobuf.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2017 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/include/commonlib/loglevel.h b/src/commonlib/include/commonlib/loglevel.h
index 4247532c89..7a1654179d 100644
--- a/src/commonlib/include/commonlib/loglevel.h
+++ b/src/commonlib/include/commonlib/loglevel.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2015 Nicholas Sielicki
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/commonlib/include/commonlib/mem_pool.h b/src/commonlib/include/commonlib/mem_pool.h
index c21fa0e8aa..ed473ebdf2 100644
--- a/src/commonlib/include/commonlib/mem_pool.h
+++ b/src/commonlib/include/commonlib/mem_pool.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/include/commonlib/region.h b/src/commonlib/include/commonlib/region.h
index 45484dddd6..dca12dc741 100644
--- a/src/commonlib/include/commonlib/region.h
+++ b/src/commonlib/include/commonlib/region.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/include/commonlib/rmodule-defs.h b/src/commonlib/include/commonlib/rmodule-defs.h
index 564fcd26af..de06941fa2 100644
--- a/src/commonlib/include/commonlib/rmodule-defs.h
+++ b/src/commonlib/include/commonlib/rmodule-defs.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Google Inc
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/include/commonlib/sd_mmc_ctrlr.h b/src/commonlib/include/commonlib/sd_mmc_ctrlr.h
index 247c0a513a..d4a7d54ff5 100644
--- a/src/commonlib/include/commonlib/sd_mmc_ctrlr.h
+++ b/src/commonlib/include/commonlib/sd_mmc_ctrlr.h
@@ -1,10 +1,5 @@
/*
- * Copyright 2011, Marvell Semiconductor Inc.
- * Lei Wen
- *
- * Copyright 2017 Intel Corporation
- *
- * Controller independent definitions
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -15,6 +10,8 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Controller independent definitions
*/
#ifndef __COMMONLIB_SD_MMC_CTRLR_H__
#define __COMMONLIB_SD_MMC_CTRLR_H__
diff --git a/src/commonlib/include/commonlib/sdhci.h b/src/commonlib/include/commonlib/sdhci.h
index ffeb6625d9..015fd0c6f9 100644
--- a/src/commonlib/include/commonlib/sdhci.h
+++ b/src/commonlib/include/commonlib/sdhci.h
@@ -1,10 +1,5 @@
/*
- * Copyright 2011, Marvell Semiconductor Inc.
- * Lei Wen
- *
- * Copyright 2017 Intel Corporation
- *
- * SD host controller specific definitions
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -15,6 +10,8 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * SD host controller specific definitions
*/
#ifndef __COMMONLIB_SDHCI_H__
#define __COMMONLIB_SDHCI_H__
diff --git a/src/commonlib/include/commonlib/sort.h b/src/commonlib/include/commonlib/sort.h
index 3d94d25d40..3d91cd8ec8 100644
--- a/src/commonlib/include/commonlib/sort.h
+++ b/src/commonlib/include/commonlib/sort.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2019 Siemens AG
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/include/commonlib/storage.h b/src/commonlib/include/commonlib/storage.h
index 6ad53dcf8e..47a2bb6543 100644
--- a/src/commonlib/include/commonlib/storage.h
+++ b/src/commonlib/include/commonlib/storage.h
@@ -1,9 +1,5 @@
/*
- * Copyright 2008,2010 Freescale Semiconductor, Inc
- * Andy Fleming
- *
- * Copyright 2013 Google Inc. All rights reserved.
- * Copyright 2017 Intel Corporation
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/src/commonlib/include/commonlib/tcpa_log_serialized.h b/src/commonlib/include/commonlib/tcpa_log_serialized.h
index 434ff34c46..020eb04eee 100644
--- a/src/commonlib/include/commonlib/tcpa_log_serialized.h
+++ b/src/commonlib/include/commonlib/tcpa_log_serialized.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2018 Facebook Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/include/commonlib/timestamp_serialized.h b/src/commonlib/include/commonlib/timestamp_serialized.h
index bb0dcfc7f4..7b1a7301c7 100644
--- a/src/commonlib/include/commonlib/timestamp_serialized.h
+++ b/src/commonlib/include/commonlib/timestamp_serialized.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/iobuf.c b/src/commonlib/iobuf.c
index b73ee1929e..fc0b2ed809 100644
--- a/src/commonlib/iobuf.c
+++ b/src/commonlib/iobuf.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2017 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/mem_pool.c b/src/commonlib/mem_pool.c
index cb3e726f25..0aa821b24f 100644
--- a/src/commonlib/mem_pool.c
+++ b/src/commonlib/mem_pool.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/region.c b/src/commonlib/region.c
index 541a125ad4..ca7b6efe4b 100644
--- a/src/commonlib/region.c
+++ b/src/commonlib/region.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -27,10 +25,10 @@ int region_is_subregion(const struct region *p, const struct region *c)
if (region_offset(c) < region_offset(p))
return 0;
- if (region_sz(c) > region_sz(p))
+ if (region_end(c) > region_end(p))
return 0;
- if (region_end(c) > region_end(p))
+ if (region_end(c) < region_offset(c))
return 0;
return 1;
diff --git a/src/commonlib/sort.c b/src/commonlib/sort.c
index 350138ec02..98d2db264f 100644
--- a/src/commonlib/sort.c
+++ b/src/commonlib/sort.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2019 Siemens AG
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/storage/Kconfig b/src/commonlib/storage/Kconfig
index c7bb70d399..88b8204472 100644
--- a/src/commonlib/storage/Kconfig
+++ b/src/commonlib/storage/Kconfig
@@ -1,8 +1,6 @@
##
## This file is part of the coreboot project.
##
-## Copyright (C) 2017 Intel Corp.
-##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/storage/Makefile.inc b/src/commonlib/storage/Makefile.inc
index af5137e287..75b4548a57 100644
--- a/src/commonlib/storage/Makefile.inc
+++ b/src/commonlib/storage/Makefile.inc
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2017 Intel Corporation.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/src/commonlib/storage/bouncebuf.c b/src/commonlib/storage/bouncebuf.c
index 5d98c74489..99287b6270 100644
--- a/src/commonlib/storage/bouncebuf.c
+++ b/src/commonlib/storage/bouncebuf.c
@@ -1,8 +1,5 @@
/*
- * Generic bounce buffer implementation
- *
- * Copyright (C) 2012 Marek Vasut
- * Copyright 2013 Google Inc. All rights reserved.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -13,6 +10,8 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Generic bounce buffer implementation
*/
#include
diff --git a/src/commonlib/storage/bouncebuf.h b/src/commonlib/storage/bouncebuf.h
index 0d81be1faa..3e702fad29 100644
--- a/src/commonlib/storage/bouncebuf.h
+++ b/src/commonlib/storage/bouncebuf.h
@@ -1,8 +1,5 @@
/*
- * Generic bounce buffer implementation
- *
- * Copyright (C) 2012 Marek Vasut
- * Copyright 2013 Google Inc. All rights reserved.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -13,6 +10,8 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Generic bounce buffer implementation
*/
#ifndef __COMMONLIB_STORAGE_BOUNCEBUF_H__
diff --git a/src/commonlib/storage/mmc.c b/src/commonlib/storage/mmc.c
index 3c82f51a4f..0b682adc89 100644
--- a/src/commonlib/storage/mmc.c
+++ b/src/commonlib/storage/mmc.c
@@ -1,12 +1,5 @@
/*
- * Copyright 2008, Freescale Semiconductor, Inc
- * Andy Fleming
- *
- * Copyright 2013 Google Inc. All rights reserved.
- * Copyright 2017 Intel Corporation
- *
- * MultiMediaCard (MMC) and eMMC specific support code
- * This code is controller independent
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -17,6 +10,9 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * MultiMediaCard (MMC) and eMMC specific support code
+ * This code is controller independent
*/
#include
diff --git a/src/commonlib/storage/mmc.h b/src/commonlib/storage/mmc.h
index 87d16353c8..2441d5d7e8 100644
--- a/src/commonlib/storage/mmc.h
+++ b/src/commonlib/storage/mmc.h
@@ -1,9 +1,5 @@
/*
- * Copyright 2008,2010 Freescale Semiconductor, Inc
- * Andy Fleming
- *
- * Copyright 2013 Google Inc. All rights reserved.
- * Copyright 2017 Intel Corporation
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/src/commonlib/storage/pci_sdhci.c b/src/commonlib/storage/pci_sdhci.c
index 1798c2cac7..de248b7720 100644
--- a/src/commonlib/storage/pci_sdhci.c
+++ b/src/commonlib/storage/pci_sdhci.c
@@ -1,6 +1,5 @@
/*
- * Copyright 2013 Google Inc.
- * Copyright 2017 Intel Corporation
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/src/commonlib/storage/sd.c b/src/commonlib/storage/sd.c
index 06f0156c82..bdb0baa2e4 100644
--- a/src/commonlib/storage/sd.c
+++ b/src/commonlib/storage/sd.c
@@ -1,12 +1,5 @@
/*
- * Copyright 2008, Freescale Semiconductor, Inc
- * Andy Fleming
- *
- * Copyright 2013 Google Inc. All rights reserved.
- * Copyright 2017 Intel Corporation
- *
- * Secure Digital (SD) card specific support code
- * This code is controller independent
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -17,6 +10,9 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Secure Digital (SD) card specific support code
+ * This code is controller independent
*/
#include
diff --git a/src/commonlib/storage/sd_mmc.c b/src/commonlib/storage/sd_mmc.c
index 348d3fe17d..ae15656189 100644
--- a/src/commonlib/storage/sd_mmc.c
+++ b/src/commonlib/storage/sd_mmc.c
@@ -1,13 +1,5 @@
/*
- * Copyright 2008, Freescale Semiconductor, Inc
- * Andy Fleming
- *
- * Copyright 2013 Google Inc. All rights reserved.
- * Copyright 2017 Intel Corporation
- *
- * MultiMediaCard (MMC), eMMC and Secure Digital (SD) common initialization
- * code which brings the card into the standby state. This code is controller
- * independent.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -18,6 +10,10 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * MultiMediaCard (MMC), eMMC and Secure Digital (SD) common initialization
+ * code which brings the card into the standby state. This code is controller
+ * independent.
*/
#include
diff --git a/src/commonlib/storage/sd_mmc.h b/src/commonlib/storage/sd_mmc.h
index f3a6e8adbd..b1ae0f3f06 100644
--- a/src/commonlib/storage/sd_mmc.h
+++ b/src/commonlib/storage/sd_mmc.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 Intel Corporation
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/src/commonlib/storage/sdhci.c b/src/commonlib/storage/sdhci.c
index 19daa2ee7e..25c0d6f1eb 100644
--- a/src/commonlib/storage/sdhci.c
+++ b/src/commonlib/storage/sdhci.c
@@ -1,10 +1,5 @@
/*
- * Copyright 2011, Marvell Semiconductor Inc.
- * Lei Wen
- *
- * Copyright 2017 Intel Corporation
- *
- * Secure Digital (SD) Host Controller interface specific code
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -15,6 +10,8 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Secure Digital (SD) Host Controller interface specific code
*/
#include "bouncebuf.h"
diff --git a/src/commonlib/storage/sdhci.h b/src/commonlib/storage/sdhci.h
index ed8984ae6f..c745b8cc09 100644
--- a/src/commonlib/storage/sdhci.h
+++ b/src/commonlib/storage/sdhci.h
@@ -1,8 +1,5 @@
/*
- * Copyright 2011, Marvell Semiconductor Inc.
- * Lei Wen
- *
- * Copyright 2017 Intel Corporation
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/src/commonlib/storage/sdhci_adma.c b/src/commonlib/storage/sdhci_adma.c
index e3209734ba..2806bdeaee 100644
--- a/src/commonlib/storage/sdhci_adma.c
+++ b/src/commonlib/storage/sdhci_adma.c
@@ -1,10 +1,5 @@
/*
- * Copyright 2011, Marvell Semiconductor Inc.
- * Lei Wen
- *
- * Copyright 2017 Intel Corporation
- *
- * Secure Digital (SD) Host Controller interface DMA support code
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -15,6 +10,8 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Secure Digital (SD) Host Controller interface DMA support code
*/
#include
diff --git a/src/commonlib/storage/sdhci_display.c b/src/commonlib/storage/sdhci_display.c
index 6545424e07..1bb0bcf8d8 100644
--- a/src/commonlib/storage/sdhci_display.c
+++ b/src/commonlib/storage/sdhci_display.c
@@ -1,10 +1,5 @@
/*
- * Copyright 2011, Marvell Semiconductor Inc.
- * Lei Wen
- *
- * Copyright 2017 Intel Corporation
- *
- * Secure Digital (SD) Host Controller interface specific code
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -15,6 +10,8 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * Secure Digital (SD) Host Controller interface specific code
*/
#include
diff --git a/src/commonlib/storage/storage.c b/src/commonlib/storage/storage.c
index f434a6c0b6..df040cae21 100644
--- a/src/commonlib/storage/storage.c
+++ b/src/commonlib/storage/storage.c
@@ -1,14 +1,5 @@
/*
- * Copyright 2008, Freescale Semiconductor, Inc
- * Andy Fleming
- *
- * Copyright 2013 Google Inc. All rights reserved.
- * Copyright 2017 Intel Corporation
- *
- * MultiMediaCard (MMC), eMMC and Secure Digital (SD) common code which
- * transitions the card from the standby state to the transfer state. The
- * common code supports read operations, erase and write operations are in
- * a separate modules. This code is controller independent.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -19,6 +10,11 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * MultiMediaCard (MMC), eMMC and Secure Digital (SD) common code which
+ * transitions the card from the standby state to the transfer state. The
+ * common code supports read operations, erase and write operations are in
+ * a separate modules. This code is controller independent.
*/
#include
diff --git a/src/commonlib/storage/storage.h b/src/commonlib/storage/storage.h
index c71510dd19..f03ed554fc 100644
--- a/src/commonlib/storage/storage.h
+++ b/src/commonlib/storage/storage.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 Intel Corporation
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/src/commonlib/storage/storage_erase.c b/src/commonlib/storage/storage_erase.c
index 8e97755238..a8da366438 100644
--- a/src/commonlib/storage/storage_erase.c
+++ b/src/commonlib/storage/storage_erase.c
@@ -1,12 +1,5 @@
/*
- * Copyright 2008, Freescale Semiconductor, Inc
- * Andy Fleming
- *
- * Copyright 2013 Google Inc. All rights reserved.
- * Copyright 2017 Intel Corporation
- *
- * MultiMediaCard (MMC), eMMC and Secure Digital (SD) erase support code.
- * This code is controller independent.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -17,6 +10,9 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * MultiMediaCard (MMC), eMMC and Secure Digital (SD) erase support code.
+ * This code is controller independent.
*/
#include "sd_mmc.h"
diff --git a/src/commonlib/storage/storage_write.c b/src/commonlib/storage/storage_write.c
index d21cc293db..ec19dd2182 100644
--- a/src/commonlib/storage/storage_write.c
+++ b/src/commonlib/storage/storage_write.c
@@ -1,12 +1,5 @@
/*
- * Copyright 2008, Freescale Semiconductor, Inc
- * Andy Fleming
- *
- * Copyright 2013 Google Inc. All rights reserved.
- * Copyright 2017 Intel Corporation
- *
- * MultiMediaCard (MMC), eMMC and Secure Digital (SD) write support code.
- * This code is controller independent.
+ * This file is part of the coreboot project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -17,6 +10,9 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
+ *
+ * MultiMediaCard (MMC), eMMC and Secure Digital (SD) write support code.
+ * This code is controller independent.
*/
#include
diff --git a/src/console/Kconfig b/src/console/Kconfig
index 4cb407e785..5d505d2d21 100644
--- a/src/console/Kconfig
+++ b/src/console/Kconfig
@@ -13,7 +13,7 @@ config BOOTBLOCK_CONSOLE
config POSTCAR_CONSOLE
bool "Enable console output during postcar."
depends on POSTCAR_STAGE
- default n
+ default y
help
Use console during the postcar if supported
diff --git a/src/console/console.c b/src/console/console.c
index 50ee5c30e5..a36cb96ed1 100644
--- a/src/console/console.c
+++ b/src/console/console.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2003 Eric Biederman
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/console/die.c b/src/console/die.c
index 3a17126264..76c456d1fb 100644
--- a/src/console/die.c
+++ b/src/console/die.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2003 Eric Biederman
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/console/hw-debug_sink.adb b/src/console/hw-debug_sink.adb
index 4331b87549..78359cd50b 100644
--- a/src/console/hw-debug_sink.adb
+++ b/src/console/hw-debug_sink.adb
@@ -1,8 +1,6 @@
--
-- This file is part of the coreboot project.
--
--- Copyright (C) 2015 secunet Security Networks AG
---
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; version 2 of the License.
diff --git a/src/console/hw-debug_sink.ads b/src/console/hw-debug_sink.ads
index 322249e1cb..8598966f0c 100644
--- a/src/console/hw-debug_sink.ads
+++ b/src/console/hw-debug_sink.ads
@@ -1,8 +1,6 @@
--
-- This file is part of the coreboot project.
--
--- Copyright (C) 2015 secunet Security Networks AG
---
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; version 2 of the License.
diff --git a/src/console/init.c b/src/console/init.c
index 43b499d816..d4818580e4 100644
--- a/src/console/init.c
+++ b/src/console/init.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2003 Eric Biederman
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
@@ -24,11 +22,7 @@
#include
/* Mutable console log level only allowed when RAM comes online. */
-#if defined(__PRE_RAM__)
-#define CONSOLE_LEVEL_CONST 1
-#else
-#define CONSOLE_LEVEL_CONST 0
-#endif
+#define CONSOLE_LEVEL_CONST !ENV_STAGE_HAS_DATA_SECTION
static int console_inited CAR_GLOBAL;
static int console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
diff --git a/src/console/post.c b/src/console/post.c
index 0719e5e7df..64aa2a5513 100644
--- a/src/console/post.c
+++ b/src/console/post.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2003 Eric Biederman
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/console/printk.c b/src/console/printk.c
index 8606bbb5c9..15c599dce0 100644
--- a/src/console/printk.c
+++ b/src/console/printk.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 1991, 1992 Linus Torvalds
- * Copyright (C) 2015 Timothy Pearson ,
- * Raptor Engineering
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -49,8 +45,7 @@ int do_vprintk(int msg_level, const char *fmt, va_list args)
{
int i, log_this;
- if (CONFIG(SQUELCH_EARLY_SMP) && ENV_CACHE_AS_RAM &&
- !boot_cpu())
+ if (CONFIG(SQUELCH_EARLY_SMP) && ENV_ROMSTAGE_OR_BEFORE && !boot_cpu())
return 0;
log_this = console_log_level(msg_level);
diff --git a/src/console/vsprintf.c b/src/console/vsprintf.c
index 4892fdd1ff..78bc09f5a7 100644
--- a/src/console/vsprintf.c
+++ b/src/console/vsprintf.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2009 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/console/vtxprintf.c b/src/console/vtxprintf.c
index f34c91bb5f..1efe55a332 100644
--- a/src/console/vtxprintf.c
+++ b/src/console/vtxprintf.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 1991, 1992 Linus Torvalds
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/Kconfig b/src/cpu/Kconfig
index 6078022397..3c0bf89afd 100644
--- a/src/cpu/Kconfig
+++ b/src/cpu/Kconfig
@@ -6,16 +6,11 @@ source "src/cpu/*/Kconfig"
if ARCH_X86
-config CACHE_AS_RAM
- bool
- default y
-
-config NO_CAR_GLOBAL_MIGRATION
+config CAR_GLOBAL_MIGRATION
bool
default n
- depends on CACHE_AS_RAM
help
- This option is selected if there is no need to migrate CAR globals.
+ This option is selected if there is need to migrate CAR globals.
All stages which use CAR globals can directly access the variables
from their linked addresses.
@@ -28,12 +23,6 @@ config DCACHE_RAM_SIZE
config DCACHE_BSP_STACK_SIZE
hex
-config DCACHE_BSP_STACK_SLUSH
- hex
-
-config DCACHE_AP_STACK_SIZE
- hex
-
config SMP
bool
default y if MAX_CPUS != 1
diff --git a/src/cpu/amd/agesa/Kconfig b/src/cpu/amd/agesa/Kconfig
index 4c5463cc8a..f21bf5467f 100644
--- a/src/cpu/amd/agesa/Kconfig
+++ b/src/cpu/amd/agesa/Kconfig
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2011 - 2012 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
@@ -29,7 +27,6 @@ config CPU_AMD_AGESA
select UDELAY_LAPIC
select LAPIC_MONOTONIC_TIMER
select SPI_FLASH if HAVE_ACPI_RESUME
- select POSTCAR_STAGE
select SMM_ASEG
if CPU_AMD_AGESA
diff --git a/src/cpu/amd/agesa/Makefile.inc b/src/cpu/amd/agesa/Makefile.inc
index daa3d50601..d99f2b051f 100644
--- a/src/cpu/amd/agesa/Makefile.inc
+++ b/src/cpu/amd/agesa/Makefile.inc
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2011 - 2012 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family12/Kconfig b/src/cpu/amd/agesa/family12/Kconfig
index 921ec90df8..4fc2ba076c 100644
--- a/src/cpu/amd/agesa/family12/Kconfig
+++ b/src/cpu/amd/agesa/family12/Kconfig
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2011 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family12/chip_name.c b/src/cpu/amd/agesa/family12/chip_name.c
index 95975c5ddc..ca3c39e0ab 100644
--- a/src/cpu/amd/agesa/family12/chip_name.c
+++ b/src/cpu/amd/agesa/family12/chip_name.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family12/fixme.c b/src/cpu/amd/agesa/family12/fixme.c
index f3ea89989c..c1d4c7d1a6 100644
--- a/src/cpu/amd/agesa/family12/fixme.c
+++ b/src/cpu/amd/agesa/family12/fixme.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 - 2012 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family12/model_12_init.c b/src/cpu/amd/agesa/family12/model_12_init.c
index 406d300b21..c0669a857d 100644
--- a/src/cpu/amd/agesa/family12/model_12_init.c
+++ b/src/cpu/amd/agesa/family12/model_12_init.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family12/romstage.c b/src/cpu/amd/agesa/family12/romstage.c
index 9d617efe4b..bca2baf483 100644
--- a/src/cpu/amd/agesa/family12/romstage.c
+++ b/src/cpu/amd/agesa/family12/romstage.c
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 Advanced Micro Devices, Inc.
- * Copyright (C) 2017 Kyösti Mälkki
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family14/Kconfig b/src/cpu/amd/agesa/family14/Kconfig
index 0ee7eb0c4f..adbe7fdb76 100644
--- a/src/cpu/amd/agesa/family14/Kconfig
+++ b/src/cpu/amd/agesa/family14/Kconfig
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2011 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family14/Makefile.inc b/src/cpu/amd/agesa/family14/Makefile.inc
index 3da8dd599b..7db1fe4ac9 100644
--- a/src/cpu/amd/agesa/family14/Makefile.inc
+++ b/src/cpu/amd/agesa/family14/Makefile.inc
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2011 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family14/acpi/cpu.asl b/src/cpu/amd/agesa/family14/acpi/cpu.asl
index f521b0a432..81b5a3550a 100644
--- a/src/cpu/amd/agesa/family14/acpi/cpu.asl
+++ b/src/cpu/amd/agesa/family14/acpi/cpu.asl
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family14/chip_name.c b/src/cpu/amd/agesa/family14/chip_name.c
index e5952876f2..4b40ec2a16 100644
--- a/src/cpu/amd/agesa/family14/chip_name.c
+++ b/src/cpu/amd/agesa/family14/chip_name.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family14/fixme.c b/src/cpu/amd/agesa/family14/fixme.c
index 2368bea2b8..c2e859e229 100644
--- a/src/cpu/amd/agesa/family14/fixme.c
+++ b/src/cpu/amd/agesa/family14/fixme.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 - 2012 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family14/model_14_init.c b/src/cpu/amd/agesa/family14/model_14_init.c
index 7f05cd15b6..04e6f44df4 100644
--- a/src/cpu/amd/agesa/family14/model_14_init.c
+++ b/src/cpu/amd/agesa/family14/model_14_init.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family14/romstage.c b/src/cpu/amd/agesa/family14/romstage.c
index 7fd522fb1e..54069cc30d 100644
--- a/src/cpu/amd/agesa/family14/romstage.c
+++ b/src/cpu/amd/agesa/family14/romstage.c
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 Advanced Micro Devices, Inc.
- * Copyright (C) 2017 Kyösti Mälkki
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family15tn/Kconfig b/src/cpu/amd/agesa/family15tn/Kconfig
index 7514590bb8..fde1adf118 100644
--- a/src/cpu/amd/agesa/family15tn/Kconfig
+++ b/src/cpu/amd/agesa/family15tn/Kconfig
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2012 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family15tn/Makefile.inc b/src/cpu/amd/agesa/family15tn/Makefile.inc
index 46ae346282..8522eb2618 100644
--- a/src/cpu/amd/agesa/family15tn/Makefile.inc
+++ b/src/cpu/amd/agesa/family15tn/Makefile.inc
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2012 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family15tn/acpi/cpu.asl b/src/cpu/amd/agesa/family15tn/acpi/cpu.asl
index 88d611e9ac..82168508c4 100644
--- a/src/cpu/amd/agesa/family15tn/acpi/cpu.asl
+++ b/src/cpu/amd/agesa/family15tn/acpi/cpu.asl
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2013 Sage Electronic Engineering, LLC
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family15tn/chip_name.c b/src/cpu/amd/agesa/family15tn/chip_name.c
index a4285d96cd..876ef3a274 100644
--- a/src/cpu/amd/agesa/family15tn/chip_name.c
+++ b/src/cpu/amd/agesa/family15tn/chip_name.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2012 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family15tn/fixme.c b/src/cpu/amd/agesa/family15tn/fixme.c
index a3767674d8..e92aa9a9bf 100644
--- a/src/cpu/amd/agesa/family15tn/fixme.c
+++ b/src/cpu/amd/agesa/family15tn/fixme.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 - 2012 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family15tn/model_15_init.c b/src/cpu/amd/agesa/family15tn/model_15_init.c
index b614eedf56..be3d58bb1b 100644
--- a/src/cpu/amd/agesa/family15tn/model_15_init.c
+++ b/src/cpu/amd/agesa/family15tn/model_15_init.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2012 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family15tn/udelay.c b/src/cpu/amd/agesa/family15tn/udelay.c
index 7ff4c5c7a8..898f6c1fef 100644
--- a/src/cpu/amd/agesa/family15tn/udelay.c
+++ b/src/cpu/amd/agesa/family15tn/udelay.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Alexandru Gagniuc
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/cpu/amd/agesa/family16kb/Kconfig b/src/cpu/amd/agesa/family16kb/Kconfig
index 5138745537..9fef94d327 100644
--- a/src/cpu/amd/agesa/family16kb/Kconfig
+++ b/src/cpu/amd/agesa/family16kb/Kconfig
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2012 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family16kb/Makefile.inc b/src/cpu/amd/agesa/family16kb/Makefile.inc
index 9367b458a3..2ce827d951 100644
--- a/src/cpu/amd/agesa/family16kb/Makefile.inc
+++ b/src/cpu/amd/agesa/family16kb/Makefile.inc
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2012 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family16kb/acpi/cpu.asl b/src/cpu/amd/agesa/family16kb/acpi/cpu.asl
index aae3287ba6..bc52b681e5 100644
--- a/src/cpu/amd/agesa/family16kb/acpi/cpu.asl
+++ b/src/cpu/amd/agesa/family16kb/acpi/cpu.asl
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2013 Sage Electronic Engineering, LLC
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family16kb/chip_name.c b/src/cpu/amd/agesa/family16kb/chip_name.c
index 0ed0e61e5e..caf2c1b2c1 100644
--- a/src/cpu/amd/agesa/family16kb/chip_name.c
+++ b/src/cpu/amd/agesa/family16kb/chip_name.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2012 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family16kb/fixme.c b/src/cpu/amd/agesa/family16kb/fixme.c
index 70e9b585f6..73d09956cd 100644
--- a/src/cpu/amd/agesa/family16kb/fixme.c
+++ b/src/cpu/amd/agesa/family16kb/fixme.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 - 2012 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/agesa/family16kb/model_16_init.c b/src/cpu/amd/agesa/family16kb/model_16_init.c
index 6c1309eea4..3d53b5192b 100644
--- a/src/cpu/amd/agesa/family16kb/model_16_init.c
+++ b/src/cpu/amd/agesa/family16kb/model_16_init.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2012 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/car/cache_as_ram.inc b/src/cpu/amd/car/cache_as_ram.inc
index f923a47db4..2054ea3438 100644
--- a/src/cpu/amd/car/cache_as_ram.inc
+++ b/src/cpu/amd/car/cache_as_ram.inc
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2005-2007 Advanced Micro Devices, Inc.
- * Copyright (C) 2008 Carl-Daniel Hailfinger
- * Copyright (C) 2015 Timothy Pearson , Raptor Engineering
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -22,8 +18,8 @@
#define CacheSize CONFIG_DCACHE_RAM_SIZE
#define CacheBase CONFIG_DCACHE_RAM_BASE
-#define CacheSizeBSPStack CONFIG_DCACHE_BSP_STACK_SIZE
-#define CacheSizeBSPSlush CONFIG_DCACHE_BSP_STACK_SLUSH
+#define CacheSizeBSPStack CONFIG_DCACHE_BSP_TOP_STACK_SIZE
+#define CacheSizeBSPSlush CONFIG_DCACHE_BSP_TOP_STACK_SLUSH
/* For CAR with Fam10h. */
#define CacheSizeAPStack CONFIG_DCACHE_AP_STACK_SIZE
diff --git a/src/cpu/amd/car/disable_cache_as_ram.c b/src/cpu/amd/car/disable_cache_as_ram.c
index 199a453501..fb632bb644 100644
--- a/src/cpu/amd/car/disable_cache_as_ram.c
+++ b/src/cpu/amd/car/disable_cache_as_ram.c
@@ -1,12 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * original idea yhlu 6.2005 (assembler code)
- *
- * Copyright (C) 2010 Rudolf Marek
- * Copyright (C) 2015 Timothy Pearson ,
- * Raptor Engineering
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/car/post_cache_as_ram.c b/src/cpu/amd/car/post_cache_as_ram.c
index 50ed657f42..78e417fc13 100644
--- a/src/cpu/amd/car/post_cache_as_ram.c
+++ b/src/cpu/amd/car/post_cache_as_ram.c
@@ -1,12 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2015 Timothy Pearson ,
- * Raptor Engineering
- * Copyright (C) 2012 Google LLC
- * 2005.6 by yhlu
- * 2006.3 yhlu add copy data from CAR to ram
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -27,6 +21,7 @@
#include
#include
#include
+#include
#include
#include "cpu/amd/car/disable_cache_as_ram.c"
@@ -44,12 +39,6 @@
#define print_car_debug(format, arg...)
#endif
-static size_t backup_size(void)
-{
- size_t car_size = car_data_size();
- return ALIGN_UP(car_size + 1024, 1024);
-}
-
static void memcpy_(void *d, const void *s, size_t len)
{
print_car_debug(" Copy [%08x-%08x] to [%08x - %08x] ...",
@@ -58,13 +47,6 @@ static void memcpy_(void *d, const void *s, size_t len)
memcpy(d, s, len);
}
-static void memset_(void *d, int val, size_t len)
-{
- print_car_debug(" Fill [%08x-%08x] ...",
- (uint32_t) d, (uint32_t) (d + len - 1));
- memset(d, val, len);
-}
-
static int memcmp_(void *d, const void *s, size_t len)
{
print_car_debug(" Compare [%08x-%08x] with [%08x - %08x] ...",
@@ -73,41 +55,6 @@ static int memcmp_(void *d, const void *s, size_t len)
return memcmp(d, s, len);
}
-static void prepare_romstage_ramstack(int s3resume)
-{
- size_t backup_top = backup_size();
- print_car_debug("Prepare CAR migration and stack regions...");
-
- if (s3resume) {
- void *resume_backup_memory =
- acpi_backup_container(CONFIG_RAMBASE, HIGH_MEMORY_SAVE);
- if (resume_backup_memory)
- memcpy_(resume_backup_memory
- + HIGH_MEMORY_SAVE - backup_top,
- (void *)(CONFIG_RAMTOP - backup_top),
- backup_top);
- }
- memset_((void *)(CONFIG_RAMTOP - backup_top), 0, backup_top);
-
- print_car_debug(" Done\n");
-}
-
-static void prepare_ramstage_region(int s3resume)
-{
- size_t backup_top = backup_size();
- print_car_debug("Prepare ramstage memory region...");
-
- if (s3resume) {
- void *resume_backup_memory =
- acpi_backup_container(CONFIG_RAMBASE, HIGH_MEMORY_SAVE);
- if (resume_backup_memory)
- memcpy_(resume_backup_memory, (void *) CONFIG_RAMBASE,
- HIGH_MEMORY_SAVE - backup_top);
- }
-
- print_car_debug(" Done\n");
-}
-
/* Disable Erratum 343 Workaround, see RevGuide for Fam10h, Pub#41322 Rev 3.33
* and RevGuide for Fam12h, Pub#44739 Rev 3.10
*/
@@ -131,15 +78,16 @@ asmlinkage void *post_cache_as_ram(void)
* boundary during romstage execution
*/
volatile uint32_t *lower_stack_boundary;
- lower_stack_boundary =
- (void *)((CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE)
- - CONFIG_DCACHE_BSP_STACK_SIZE);
+ lower_stack_boundary = (void *)((CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE) -
+ CONFIG_DCACHE_BSP_TOP_STACK_SIZE);
+
if ((*lower_stack_boundary) != 0xdeadbeef)
printk(BIOS_WARNING, "BSP overran lower stack boundary. Undefined behaviour may result!\n");
- s3resume = acpi_is_wakeup_s3();
- prepare_romstage_ramstack(s3resume);
+ /* ACPI S3 is not supported without RELOCATABLE_RAMSTAGE and
+ * this will always return 0. */
+ s3resume = acpi_is_wakeup_s3();
romstage_handoff_init(s3resume);
@@ -153,11 +101,11 @@ asmlinkage void *post_cache_as_ram(void)
void *migrated_car = (void *)(CONFIG_RAMTOP - car_size);
print_car_debug("Copying data from cache to RAM...");
- memcpy_(migrated_car, _car_relocatable_data_start, car_size);
+ memcpy_(migrated_car, _car_global_start, car_size);
print_car_debug(" Done\n");
print_car_debug("Verifying data integrity in RAM...");
- if (memcmp_(migrated_car, _car_relocatable_data_start, car_size) == 0)
+ if (memcmp_(migrated_car, _car_global_start, car_size) == 0)
print_car_debug(" Done\n");
else
print_car_debug(" FAILED\n");
@@ -177,8 +125,6 @@ asmlinkage void cache_as_ram_new_stack(void)
set_var_mtrr(0, 0x00000000, CACHE_TMP_RAMTOP, MTRR_TYPE_WRBACK);
enable_cache();
- prepare_ramstage_region(acpi_is_wakeup_s3());
-
set_sysinfo_in_ram(1); // So other core0 could start to train mem
/*copy and execute ramstage */
diff --git a/src/cpu/amd/family_10h-family_15h/Kconfig b/src/cpu/amd/family_10h-family_15h/Kconfig
index df6549987e..ad4f5f4ba6 100644
--- a/src/cpu/amd/family_10h-family_15h/Kconfig
+++ b/src/cpu/amd/family_10h-family_15h/Kconfig
@@ -9,7 +9,7 @@ config CPU_AMD_MODEL_10XXX
select UDELAY_LAPIC
select SUPPORT_CPU_UCODE_IN_CBFS
select CPU_MICROCODE_MULTIPLE_FILES
- select ACPI_HUGE_LOWMEM_BACKUP
+ select CAR_GLOBAL_MIGRATION
if CPU_AMD_MODEL_10XXX
@@ -36,11 +36,11 @@ config DCACHE_RAM_SIZE
hex
default 0x0c000
-config DCACHE_BSP_STACK_SIZE
+config DCACHE_BSP_TOP_STACK_SIZE
hex
default 0x4000
-config DCACHE_BSP_STACK_SLUSH
+config DCACHE_BSP_TOP_STACK_SLUSH
hex
default 0x4000 if USE_LARGE_DCACHE
default 0x1000
diff --git a/src/cpu/amd/family_10h-family_15h/defaults.h b/src/cpu/amd/family_10h-family_15h/defaults.h
index edf69f773d..6b9cd19b0f 100644
--- a/src/cpu/amd/family_10h-family_15h/defaults.h
+++ b/src/cpu/amd/family_10h-family_15h/defaults.h
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2008 Advanced Micro Devices, Inc.
- * Copyright (C) 2015 Timothy Pearson , Raptor Engineering
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/family_10h-family_15h/fidvid.c b/src/cpu/amd/family_10h-family_15h/fidvid.c
index c5d523a74c..1c2b214dce 100644
--- a/src/cpu/amd/family_10h-family_15h/fidvid.c
+++ b/src/cpu/amd/family_10h-family_15h/fidvid.c
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2007 Advanced Micro Devices, Inc.
- * Copyright (C) 2015 Timothy Pearson , Raptor Engineering
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -92,7 +89,7 @@ b.- prep_fid_change(...)
#include
#include
#include
-#include
+#include
#include
static inline void print_debug_fv(const char *str, u32 val)
diff --git a/src/cpu/amd/family_10h-family_15h/init_cpus.c b/src/cpu/amd/family_10h-family_15h/init_cpus.c
index f416d9ccdb..452f7ce3fd 100644
--- a/src/cpu/amd/family_10h-family_15h/init_cpus.c
+++ b/src/cpu/amd/family_10h-family_15h/init_cpus.c
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2007-2008 Advanced Micro Devices, Inc.
- * Copyright (C) 2015 Timothy Pearson , Raptor Engineering
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -379,12 +376,19 @@ u32 init_cpus(u32 cpu_init_detectedx, struct sys_info *sysinfo)
uint8_t fam15_bsp_core1_apicid;
struct node_core_id id;
- /* Please refer to the calculations and explaination in cache_as_ram.inc before modifying these values */
+ /* Please refer to the calculations and explaination in cache_as_ram.inc
+ * before modifying these values */
uint32_t max_ap_stack_region_size = CONFIG_MAX_CPUS * CONFIG_DCACHE_AP_STACK_SIZE;
- uint32_t max_bsp_stack_region_size = CONFIG_DCACHE_BSP_STACK_SIZE + CONFIG_DCACHE_BSP_STACK_SLUSH;
- uint32_t bsp_stack_region_upper_boundary = CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE;
- uint32_t bsp_stack_region_lower_boundary = bsp_stack_region_upper_boundary - max_bsp_stack_region_size;
- void *lower_stack_region_boundary = (void *)(bsp_stack_region_lower_boundary - max_ap_stack_region_size);
+ uint32_t max_bsp_stack_region_size = CONFIG_DCACHE_BSP_TOP_STACK_SIZE +
+ CONFIG_DCACHE_BSP_TOP_STACK_SLUSH;
+ uint32_t bsp_stack_region_upper_boundary = CONFIG_DCACHE_RAM_BASE +
+ CONFIG_DCACHE_RAM_SIZE;
+ uint32_t bsp_stack_region_lower_boundary = bsp_stack_region_upper_boundary -
+ max_bsp_stack_region_size;
+
+ void *lower_stack_region_boundary = (void *)(bsp_stack_region_lower_boundary -
+ max_ap_stack_region_size);
+
if (((void*)(sysinfo + 1)) > lower_stack_region_boundary)
printk(BIOS_WARNING,
"sysinfo extends into stack region (sysinfo range: [%p,%p] lower stack region boundary: %p)\n",
diff --git a/src/cpu/amd/family_10h-family_15h/init_cpus.h b/src/cpu/amd/family_10h-family_15h/init_cpus.h
index cca00496ea..07d7dbf8a9 100644
--- a/src/cpu/amd/family_10h-family_15h/init_cpus.h
+++ b/src/cpu/amd/family_10h-family_15h/init_cpus.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2016 Damien Zammit
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/family_10h-family_15h/model_10xxx_init.c b/src/cpu/amd/family_10h-family_15h/model_10xxx_init.c
index ff9c7de1d3..9c040eb983 100644
--- a/src/cpu/amd/family_10h-family_15h/model_10xxx_init.c
+++ b/src/cpu/amd/family_10h-family_15h/model_10xxx_init.c
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2007 Advanced Micro Devices, Inc.
- * Copyright (C) 2015 Timothy Pearson , Raptor Engineering
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/family_10h-family_15h/monotonic_timer.c b/src/cpu/amd/family_10h-family_15h/monotonic_timer.c
index fe01345e24..51244b83ae 100644
--- a/src/cpu/amd/family_10h-family_15h/monotonic_timer.c
+++ b/src/cpu/amd/family_10h-family_15h/monotonic_timer.c
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2015 Timothy Pearson , Raptor Engineering
- * Copyright (C) 2013 Google, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/family_10h-family_15h/powernow_acpi.c b/src/cpu/amd/family_10h-family_15h/powernow_acpi.c
index be936f66e3..4029f723df 100644
--- a/src/cpu/amd/family_10h-family_15h/powernow_acpi.c
+++ b/src/cpu/amd/family_10h-family_15h/powernow_acpi.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2007-2008 Advanced Micro Devices, Inc.
- * Copyright (C) 2009 Rudolf Marek
- * Copyright (C) 2015 Timothy Pearson , Raptor Engineering
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/family_10h-family_15h/processor_name.c b/src/cpu/amd/family_10h-family_15h/processor_name.c
index 5672efdc13..fbd2bb5a33 100644
--- a/src/cpu/amd/family_10h-family_15h/processor_name.c
+++ b/src/cpu/amd/family_10h-family_15h/processor_name.c
@@ -1,11 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2007 Advanced Micro Devices, Inc.
- * Copyright (C) 2008 Peter Stuge
- * Copyright (C) 2010 Marc Jones
- * Copyright (C) 2015 Timothy Pearson , Raptor Engineering
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/family_10h-family_15h/ram_calc.c b/src/cpu/amd/family_10h-family_15h/ram_calc.c
index 1433e0753f..5b97232cb4 100644
--- a/src/cpu/amd/family_10h-family_15h/ram_calc.c
+++ b/src/cpu/amd/family_10h-family_15h/ram_calc.c
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2015 Timothy Pearson , Raptor Engineering
- * Copyright (C) 2007 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -68,7 +65,7 @@ uint64_t get_cc6_memory_size()
if (is_fam15h()) {
enable_cc6 = 0;
-#ifdef __PRE_RAM__
+#ifdef __SIMPLE_DEVICE__
if (pci_read_config32(PCI_DEV(0, 0x18, 2), 0x118) & (0x1 << 18))
enable_cc6 = 1;
#else
diff --git a/src/cpu/amd/family_10h-family_15h/ram_calc.h b/src/cpu/amd/family_10h-family_15h/ram_calc.h
index 0bb4cacc3e..2b541d053e 100644
--- a/src/cpu/amd/family_10h-family_15h/ram_calc.h
+++ b/src/cpu/amd/family_10h-family_15h/ram_calc.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2015 Timothy Pearson , Raptor Engineering
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/family_10h-family_15h/tsc_freq.c b/src/cpu/amd/family_10h-family_15h/tsc_freq.c
index 63b4ac0e8a..793cc1bfad 100644
--- a/src/cpu/amd/family_10h-family_15h/tsc_freq.c
+++ b/src/cpu/amd/family_10h-family_15h/tsc_freq.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2016 Raptor Engineering
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/family_10h-family_15h/update_microcode.c b/src/cpu/amd/family_10h-family_15h/update_microcode.c
index a12091a0c5..4a2db4e4d4 100644
--- a/src/cpu/amd/family_10h-family_15h/update_microcode.c
+++ b/src/cpu/amd/family_10h-family_15h/update_microcode.c
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2015 Timothy Pearson , Raptor Engineering
- * Copyright (C) 2007 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/microcode/microcode.c b/src/cpu/amd/microcode/microcode.c
index 584041e923..06939b0524 100644
--- a/src/cpu/amd/microcode/microcode.c
+++ b/src/cpu/amd/microcode/microcode.c
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2007 Advanced Micro Devices, Inc.
- * Copyright (C) 2015 Raptor Engineering
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00630F01/Kconfig b/src/cpu/amd/pi/00630F01/Kconfig
index 75a8441e45..e5e27b55b4 100644
--- a/src/cpu/amd/pi/00630F01/Kconfig
+++ b/src/cpu/amd/pi/00630F01/Kconfig
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2012 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00630F01/Makefile.inc b/src/cpu/amd/pi/00630F01/Makefile.inc
index 46ae346282..8522eb2618 100644
--- a/src/cpu/amd/pi/00630F01/Makefile.inc
+++ b/src/cpu/amd/pi/00630F01/Makefile.inc
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2012 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00630F01/acpi/cpu.asl b/src/cpu/amd/pi/00630F01/acpi/cpu.asl
index ffef539710..ef71a0fd5b 100644
--- a/src/cpu/amd/pi/00630F01/acpi/cpu.asl
+++ b/src/cpu/amd/pi/00630F01/acpi/cpu.asl
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2013 Sage Electronic Engineering, LLC
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00630F01/chip_name.c b/src/cpu/amd/pi/00630F01/chip_name.c
index 65fe55e832..68a7cfe62d 100644
--- a/src/cpu/amd/pi/00630F01/chip_name.c
+++ b/src/cpu/amd/pi/00630F01/chip_name.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2012 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00630F01/fixme.c b/src/cpu/amd/pi/00630F01/fixme.c
index 10fd9f568c..12f8062dfa 100644
--- a/src/cpu/amd/pi/00630F01/fixme.c
+++ b/src/cpu/amd/pi/00630F01/fixme.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 - 2012 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00630F01/model_15_init.c b/src/cpu/amd/pi/00630F01/model_15_init.c
index 550f116567..f1dd58ee5d 100644
--- a/src/cpu/amd/pi/00630F01/model_15_init.c
+++ b/src/cpu/amd/pi/00630F01/model_15_init.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2012 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00630F01/udelay.c b/src/cpu/amd/pi/00630F01/udelay.c
index 2cb53e9c20..d4bf45f7d2 100644
--- a/src/cpu/amd/pi/00630F01/udelay.c
+++ b/src/cpu/amd/pi/00630F01/udelay.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Alexandru Gagniuc
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License or (at your option)
diff --git a/src/cpu/amd/pi/00660F01/Kconfig b/src/cpu/amd/pi/00660F01/Kconfig
index a6eca07f44..647044843a 100644
--- a/src/cpu/amd/pi/00660F01/Kconfig
+++ b/src/cpu/amd/pi/00660F01/Kconfig
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2015 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00660F01/Makefile.inc b/src/cpu/amd/pi/00660F01/Makefile.inc
index 6c6a2b8ac8..fbd683c320 100644
--- a/src/cpu/amd/pi/00660F01/Makefile.inc
+++ b/src/cpu/amd/pi/00660F01/Makefile.inc
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2015 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00660F01/acpi/cpu.asl b/src/cpu/amd/pi/00660F01/acpi/cpu.asl
index aae3287ba6..bc52b681e5 100644
--- a/src/cpu/amd/pi/00660F01/acpi/cpu.asl
+++ b/src/cpu/amd/pi/00660F01/acpi/cpu.asl
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2013 Sage Electronic Engineering, LLC
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00660F01/chip_name.c b/src/cpu/amd/pi/00660F01/chip_name.c
index 397bad7132..f3f2bb52a6 100644
--- a/src/cpu/amd/pi/00660F01/chip_name.c
+++ b/src/cpu/amd/pi/00660F01/chip_name.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2015 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00660F01/fixme.c b/src/cpu/amd/pi/00660F01/fixme.c
index 2cbeab8316..237d52b2c1 100644
--- a/src/cpu/amd/pi/00660F01/fixme.c
+++ b/src/cpu/amd/pi/00660F01/fixme.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 - 2012 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00660F01/model_15_init.c b/src/cpu/amd/pi/00660F01/model_15_init.c
index 54446f7d96..78f3ce00ff 100644
--- a/src/cpu/amd/pi/00660F01/model_15_init.c
+++ b/src/cpu/amd/pi/00660F01/model_15_init.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2015 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00730F01/Kconfig b/src/cpu/amd/pi/00730F01/Kconfig
index f3f488d2dd..43abc80aba 100644
--- a/src/cpu/amd/pi/00730F01/Kconfig
+++ b/src/cpu/amd/pi/00730F01/Kconfig
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2012 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00730F01/Makefile.inc b/src/cpu/amd/pi/00730F01/Makefile.inc
index 99b6ef33a9..c4a92cf65d 100644
--- a/src/cpu/amd/pi/00730F01/Makefile.inc
+++ b/src/cpu/amd/pi/00730F01/Makefile.inc
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2012 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
@@ -14,8 +12,6 @@
#
romstage-y += fixme.c
-romstage-y += update_microcode.c
-romstage-y += microcode_fam16h.c
ramstage-y += fixme.c
ramstage-y += chip_name.c
diff --git a/src/cpu/amd/pi/00730F01/acpi/cpu.asl b/src/cpu/amd/pi/00730F01/acpi/cpu.asl
index 88d611e9ac..82168508c4 100644
--- a/src/cpu/amd/pi/00730F01/acpi/cpu.asl
+++ b/src/cpu/amd/pi/00730F01/acpi/cpu.asl
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2013 Sage Electronic Engineering, LLC
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00730F01/chip_name.c b/src/cpu/amd/pi/00730F01/chip_name.c
index 4da24b73a4..3ce3d0cf48 100644
--- a/src/cpu/amd/pi/00730F01/chip_name.c
+++ b/src/cpu/amd/pi/00730F01/chip_name.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2012 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00730F01/fixme.c b/src/cpu/amd/pi/00730F01/fixme.c
index 3769319866..a0621cbb7f 100644
--- a/src/cpu/amd/pi/00730F01/fixme.c
+++ b/src/cpu/amd/pi/00730F01/fixme.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 - 2012 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00730F01/microcode_fam16h.c b/src/cpu/amd/pi/00730F01/microcode_fam16h.c
index ad951242a7..1f1dbd90d1 100644
--- a/src/cpu/amd/pi/00730F01/microcode_fam16h.c
+++ b/src/cpu/amd/pi/00730F01/microcode_fam16h.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2007 Advanced Micro Devices, Inc.
- * Copyright (C) 2015 Raptor Engineering
- * Copyright (C) 2019 PC Engines GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -20,8 +16,6 @@
#include
#include
#include
-#include
-#include
/*
* Values and header structure from:
@@ -126,22 +120,12 @@ void amd_update_microcode_from_cbfs(uint32_t equivalent_processor_rev_id)
"Skipping microcode patch!\n");
return;
}
-#ifdef __PRE_RAM__
-#if CONFIG(HAVE_ROMSTAGE_MICROCODE_CBFS_SPINLOCK)
- spin_lock(romstage_microcode_cbfs_lock());
-#endif
-#endif
ucode = cbfs_boot_map_with_leak("cpu_microcode_blob.bin",
CBFS_TYPE_MICROCODE,
&ucode_len);
if (!ucode) {
printk(BIOS_DEBUG, "cpu_microcode_blob.bin not found. "
"Skipping updates.\n");
-#ifdef __PRE_RAM__
-#if CONFIG(HAVE_ROMSTAGE_MICROCODE_CBFS_SPINLOCK)
- spin_unlock(romstage_microcode_cbfs_lock());
-#endif
-#endif
return;
}
@@ -149,21 +133,8 @@ void amd_update_microcode_from_cbfs(uint32_t equivalent_processor_rev_id)
ucode_len < F16H_MPB_DATA_OFFSET) {
printk(BIOS_DEBUG, "microcode file invalid. Skipping "
"updates.\n");
-#ifdef __PRE_RAM__
-#if CONFIG(HAVE_ROMSTAGE_MICROCODE_CBFS_SPINLOCK)
- spin_unlock(romstage_microcode_cbfs_lock());
-#endif
-#endif
return;
}
- amd_update_microcode(ucode, ucode_len,
- equivalent_processor_rev_id);
-
-#ifdef __PRE_RAM__
-#if CONFIG(HAVE_ROMSTAGE_MICROCODE_CBFS_SPINLOCK)
- spin_unlock(romstage_microcode_cbfs_lock());
-#endif
-#endif
-
+ amd_update_microcode(ucode, ucode_len, equivalent_processor_rev_id);
}
diff --git a/src/cpu/amd/pi/00730F01/model_16_init.c b/src/cpu/amd/pi/00730F01/model_16_init.c
index b0449a73b2..8edf0d9348 100644
--- a/src/cpu/amd/pi/00730F01/model_16_init.c
+++ b/src/cpu/amd/pi/00730F01/model_16_init.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2012 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/00730F01/update_microcode.c b/src/cpu/amd/pi/00730F01/update_microcode.c
index 6acf13a6ef..92af1af2a5 100644
--- a/src/cpu/amd/pi/00730F01/update_microcode.c
+++ b/src/cpu/amd/pi/00730F01/update_microcode.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2015 Timothy Pearson , Raptor Engineering
- * Copyright (C) 2007 Advanced Micro Devices, Inc.
- * Copyright (C) 2019 PC Engines GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/Kconfig b/src/cpu/amd/pi/Kconfig
index a902089099..973a086e9f 100644
--- a/src/cpu/amd/pi/Kconfig
+++ b/src/cpu/amd/pi/Kconfig
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2011 - 2016 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
@@ -28,7 +26,7 @@ config CPU_AMD_PI
select UDELAY_LAPIC
select LAPIC_MONOTONIC_TIMER
select SPI_FLASH if HAVE_ACPI_RESUME
- select POSTCAR_STAGE if !BINARYPI_LEGACY_WRAPPER
+ select CAR_GLOBAL_MIGRATION if BINARYPI_LEGACY_WRAPPER
select SMM_ASEG
if CPU_AMD_PI
diff --git a/src/cpu/amd/pi/Makefile.inc b/src/cpu/amd/pi/Makefile.inc
index d25215beef..0a9b0649a9 100644
--- a/src/cpu/amd/pi/Makefile.inc
+++ b/src/cpu/amd/pi/Makefile.inc
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyright (C) 2011 - 2016 Advanced Micro Devices, Inc.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/pi/amd_late_init.c b/src/cpu/amd/pi/amd_late_init.c
index 8c0da9d48f..46144c6fbb 100644
--- a/src/cpu/amd/pi/amd_late_init.c
+++ b/src/cpu/amd/pi/amd_late_init.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2012 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -17,7 +15,6 @@
#include
#include
#include
-#include
#include
#include
diff --git a/src/cpu/amd/pi/romstage.c b/src/cpu/amd/pi/romstage.c
index cfd41648ba..cac5664697 100644
--- a/src/cpu/amd/pi/romstage.c
+++ b/src/cpu/amd/pi/romstage.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2017 Kyösti Mälkki
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/quadcore/amd_sibling.c b/src/cpu/amd/quadcore/amd_sibling.c
index f9aba5181c..ac637ff817 100644
--- a/src/cpu/amd/quadcore/amd_sibling.c
+++ b/src/cpu/amd/quadcore/amd_sibling.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2007 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/quadcore/quadcore.c b/src/cpu/amd/quadcore/quadcore.c
index 125876badf..8125fb474f 100644
--- a/src/cpu/amd/quadcore/quadcore.c
+++ b/src/cpu/amd/quadcore/quadcore.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2007 Advanced Micro Devices, Inc.
- * Copyright (C) 2015 Timothy Pearson ,
- * Raptor Engineering
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/amd/quadcore/quadcore_id.c b/src/cpu/amd/quadcore/quadcore_id.c
index 5afb051ace..2c4d60dd05 100644
--- a/src/cpu/amd/quadcore/quadcore_id.c
+++ b/src/cpu/amd/quadcore/quadcore_id.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2015 Timothy Pearson ,
- * Raptor Engineering
- * Copyright (C) 2007 Advanced Micro Devices, Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -17,11 +13,9 @@
#include
+#include
#include
#include
-#ifdef __PRE_RAM__
-#include
-#endif
//called by bus_cpu_scan too
u32 read_nb_cfg_54(void)
@@ -48,7 +42,7 @@ struct node_core_id get_node_core_id(u32 nb_cfg_54)
uint32_t family;
uint32_t model;
-#ifdef __PRE_RAM__
+#ifdef __SIMPLE_DEVICE__
f3xe8 = pci_read_config32(NODE_PCI(0, 3), 0xe8);
#else
f3xe8 = pci_read_config32(get_node_pci(0, 3), 0xe8);
@@ -115,7 +109,7 @@ struct node_core_id get_node_core_id(u32 nb_cfg_54)
uint32_t f5x84;
uint8_t core_count;
-#ifdef __PRE_RAM__
+#ifdef __SIMPLE_DEVICE__
f5x84 = pci_read_config32(NODE_PCI(0, 5), 0x84);
#else
f5x84 = pci_read_config32(get_node_pci(0, 5), 0x84);
diff --git a/src/cpu/amd/smm/smm_init.c b/src/cpu/amd/smm/smm_init.c
index 60e506c4e5..8f859f31e3 100644
--- a/src/cpu/amd/smm/smm_init.c
+++ b/src/cpu/amd/smm/smm_init.c
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2010 coresystems GmbH
- * Copyright (C) 2010 Rudolf Marek
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -21,6 +18,7 @@
#include
#include
#include
+#include
#include
void smm_init(void)
diff --git a/src/cpu/amd/socket_G34/socket_G34.c b/src/cpu/amd/socket_G34/socket_G34.c
index 6042a3deb8..1cac37c671 100644
--- a/src/cpu/amd/socket_G34/socket_G34.c
+++ b/src/cpu/amd/socket_G34/socket_G34.c
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2010 Advanced Micro Devices, Inc.
- * Copyright (C) 2015 Timothy Pearson , Raptor Engineering
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/intel/car/bootblock.c b/src/cpu/intel/car/bootblock.c
index d751d86272..664c2b5074 100644
--- a/src/cpu/intel/car/bootblock.c
+++ b/src/cpu/intel/car/bootblock.c
@@ -21,7 +21,7 @@ asmlinkage void bootblock_c_entry_bist(uint64_t base_timestamp, uint32_t bist)
{
saved_bist = bist;
/* Call lib/bootblock.c main */
- bootblock_main_with_timestamp(base_timestamp, NULL, 0);
+ bootblock_main_with_basetime(base_timestamp);
}
void __weak bootblock_early_northbridge_init(void) { }
diff --git a/src/cpu/intel/car/core2/cache_as_ram.S b/src/cpu/intel/car/core2/cache_as_ram.S
index 5dc2bbd295..f8fa806125 100644
--- a/src/cpu/intel/car/core2/cache_as_ram.S
+++ b/src/cpu/intel/car/core2/cache_as_ram.S
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2000,2007 Ronald G. Minnich
- * Copyright (C) 2007-2008 coresystems GmbH
- * Copyright (C) 2012 Kyösti Mälkki
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/intel/car/non-evict/cache_as_ram.S b/src/cpu/intel/car/non-evict/cache_as_ram.S
index 251714cb8f..08ad195964 100644
--- a/src/cpu/intel/car/non-evict/cache_as_ram.S
+++ b/src/cpu/intel/car/non-evict/cache_as_ram.S
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2000,2007 Ronald G. Minnich
- * Copyright (C) 2007-2008 coresystems GmbH
- * Copyright (C) 2012 Kyösti Mälkki
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/intel/car/non-evict/exit_car.S b/src/cpu/intel/car/non-evict/exit_car.S
index 8adc5f6a00..5400ae51ce 100644
--- a/src/cpu/intel/car/non-evict/exit_car.S
+++ b/src/cpu/intel/car/non-evict/exit_car.S
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2000,2007 Ronald G. Minnich
- * Copyright (C) 2007-2008 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/intel/car/p3/cache_as_ram.S b/src/cpu/intel/car/p3/cache_as_ram.S
index 2a9259c30c..9a7dc5f256 100644
--- a/src/cpu/intel/car/p3/cache_as_ram.S
+++ b/src/cpu/intel/car/p3/cache_as_ram.S
@@ -1,11 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2000,2007 Ronald G. Minnich
- * Copyright (C) 2005 Tyan (written by Yinghai Lu for Tyan)
- * Copyright (C) 2007-2008 coresystems GmbH
- * Copyright (C) 2012 Kyösti Mälkki
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/intel/car/p4-netburst/cache_as_ram.S b/src/cpu/intel/car/p4-netburst/cache_as_ram.S
index 4beac0b94c..b7eb37b6a6 100644
--- a/src/cpu/intel/car/p4-netburst/cache_as_ram.S
+++ b/src/cpu/intel/car/p4-netburst/cache_as_ram.S
@@ -1,11 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2000,2007 Ronald G. Minnich
- * Copyright (C) 2005 Tyan (written by Yinghai Lu for Tyan)
- * Copyright (C) 2007-2008 coresystems GmbH
- * Copyright (C) 2012 Kyösti Mälkki
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/intel/car/p4-netburst/exit_car.S b/src/cpu/intel/car/p4-netburst/exit_car.S
index 3b991288ff..2d7fdaf8af 100644
--- a/src/cpu/intel/car/p4-netburst/exit_car.S
+++ b/src/cpu/intel/car/p4-netburst/exit_car.S
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2000,2007 Ronald G. Minnich
- * Copyright (C) 2007-2008 coresystems GmbH
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/intel/car/romstage.c b/src/cpu/intel/car/romstage.c
index 89052d6be6..547b1211df 100644
--- a/src/cpu/intel/car/romstage.c
+++ b/src/cpu/intel/car/romstage.c
@@ -11,30 +11,38 @@
* GNU General Public License for more details.
*/
+#include
+#include
#include
#include
-#include
#include
+#include
#include
#include
#include
#include
+/* If we do not have a constrained _car_stack region size, use the
+ following as a guideline for acceptable stack usage. */
#define DCACHE_RAM_ROMSTAGE_STACK_SIZE 0x2000
+static struct postcar_frame early_mtrrs;
+
static void romstage_main(unsigned long bist)
{
int i;
- const int num_guards = 4;
+ const int num_guards = 64;
const u32 stack_guard = 0xdeadbeef;
u32 *stack_base;
u32 size;
+ const size_t stack_size = MAX(CONFIG_DCACHE_BSP_STACK_SIZE,
+ DCACHE_RAM_ROMSTAGE_STACK_SIZE);
/* Size of unallocated CAR. */
size = ALIGN_DOWN(_car_stack_size, 16);
- size = MIN(size, DCACHE_RAM_ROMSTAGE_STACK_SIZE);
- if (size < DCACHE_RAM_ROMSTAGE_STACK_SIZE)
+ size = MIN(size, stack_size);
+ if (size < stack_size)
printk(BIOS_DEBUG, "Romstage stack size limited to 0x%x!\n",
size);
@@ -43,7 +51,7 @@ static void romstage_main(unsigned long bist)
for (i = 0; i < num_guards; i++)
stack_base[i] = stack_guard;
- mainboard_romstage_entry(bist);
+ mainboard_romstage_entry();
/* Check the stack. */
for (i = 0; i < num_guards; i++) {
@@ -52,7 +60,11 @@ static void romstage_main(unsigned long bist)
printk(BIOS_DEBUG, "Smashed stack detected in romstage!\n");
}
- platform_enter_postcar();
+ if (CONFIG(SMM_TSEG))
+ smm_list_regions();
+
+ prepare_and_run_postcar(&early_mtrrs);
+ /* We do not return here. */
}
#if !CONFIG(C_ENVIRONMENT_BOOTBLOCK)
@@ -75,6 +87,8 @@ asmlinkage void bootblock_c_entry_bist(uint64_t base_timestamp, uint32_t bist)
asmlinkage void car_stage_entry(void)
{
+ timestamp_add_now(TS_START_ROMSTAGE);
+
/* Assumes the hardware was set up during the bootblock */
console_init();
diff --git a/src/cpu/intel/common/Kconfig b/src/cpu/intel/common/Kconfig
index 56bed22a1a..4074d8cc66 100644
--- a/src/cpu/intel/common/Kconfig
+++ b/src/cpu/intel/common/Kconfig
@@ -19,4 +19,7 @@ config SET_IA32_FC_LOCK_BIT
However, leaving the lock bit unset will break Windows' detection of
VMX support and built-in virtualization features like Hyper-V.
+config CPU_INTEL_COMMON_TIMEBASE
+ bool
+
endif
diff --git a/src/cpu/intel/common/Makefile.inc b/src/cpu/intel/common/Makefile.inc
index 2fc6da908b..c38e81c380 100644
--- a/src/cpu/intel/common/Makefile.inc
+++ b/src/cpu/intel/common/Makefile.inc
@@ -1,5 +1,10 @@
ramstage-y += common_init.c
-romstage-$(CONFIG_UDELAY_LAPIC) += fsb.c
-ramstage-$(CONFIG_UDELAY_LAPIC) += fsb.c
-postcar-$(CONFIG_UDELAY_LAPIC) += fsb.c
+
+ifeq ($(CONFIG_CPU_INTEL_COMMON_TIMEBASE),y)
+bootblock-y += fsb.c
+verstage-y += fsb.c
+romstage-y += fsb.c
+postcar-y += fsb.c
+ramstage-y += fsb.c
smm-y += fsb.c
+endif
diff --git a/src/cpu/intel/common/acpi/cpu.asl b/src/cpu/intel/common/acpi/cpu.asl
index 6fad17f74e..14ade7d6ec 100644
--- a/src/cpu/intel/common/acpi/cpu.asl
+++ b/src/cpu/intel/common/acpi/cpu.asl
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/cpu/intel/common/common_init.c b/src/cpu/intel/common/common_init.c
index a2ff65cecc..2fff90c690 100644
--- a/src/cpu/intel/common/common_init.c
+++ b/src/cpu/intel/common/common_init.c
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2007-2009 coresystems GmbH
- * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/cpu/intel/common/fsb.c b/src/cpu/intel/common/fsb.c
index d66e87a396..c32bc235c2 100644
--- a/src/cpu/intel/common/fsb.c
+++ b/src/cpu/intel/common/fsb.c
@@ -11,21 +11,29 @@
* GNU General Public License for more details.
*/
+#include
#include
#include
+#include
#include
#include
#include
#include
+#include
-static int get_fsb(void)
+static u32 g_timer_fsb CAR_GLOBAL;
+static u32 g_timer_tsc CAR_GLOBAL;
+
+/* This is not an architectural MSR. */
+#define MSR_PLATFORM_INFO 0xce
+
+static int get_fsb_tsc(int *fsb, int *ratio)
{
struct cpuinfo_x86 c;
static const short core_fsb[8] = { -1, 133, -1, 166, -1, 100, -1, -1 };
static const short core2_fsb[8] = { 266, 133, 200, 166, 333, 100, 400, -1 };
static const short f2x_fsb[8] = { 100, 133, 200, 166, 333, -1, -1, -1 };
msr_t msr;
- int ret = -2;
get_fms(&c, cpuid_eax(1));
switch (c.x86) {
@@ -33,50 +41,99 @@ static int get_fsb(void)
switch (c.x86_model) {
case 0xe: /* Core Solo/Duo */
case 0x1c: /* Atom */
- ret = core_fsb[rdmsr(MSR_FSB_FREQ).lo & 7];
+ *fsb = core_fsb[rdmsr(MSR_FSB_FREQ).lo & 7];
+ *ratio = (rdmsr(IA32_PERF_STATUS).hi >> 8) & 0x1f;
break;
case 0xf: /* Core 2 or Xeon */
case 0x17: /* Enhanced Core */
- ret = core2_fsb[rdmsr(MSR_FSB_FREQ).lo & 7];
+ *fsb = core2_fsb[rdmsr(MSR_FSB_FREQ).lo & 7];
+ *ratio = (rdmsr(IA32_PERF_STATUS).hi >> 8) & 0x1f;
break;
case 0x25: /* Nehalem BCLK fixed at 133MHz */
- ret = 133;
+ *fsb = 133;
+ *ratio = (rdmsr(MSR_PLATFORM_INFO).lo >> 8) & 0xff;
break;
case 0x2a: /* SandyBridge BCLK fixed at 100MHz */
case 0x3a: /* IvyBridge BCLK fixed at 100MHz */
case 0x3c: /* Haswell BCLK fixed at 100MHz */
case 0x45: /* Haswell-ULT BCLK fixed at 100MHz */
case 0x4d: /* Rangeley BCLK fixed at 100MHz */
- ret = 100;
+ *fsb = 100;
+ *ratio = (rdmsr(MSR_PLATFORM_INFO).lo >> 8) & 0xff;
break;
+ default:
+ return -2;
}
break;
case 0xf: /* Netburst */
msr = rdmsr(MSR_EBC_FREQUENCY_ID);
+ *ratio = msr.lo >> 24;
switch (c.x86_model) {
case 0x2:
- ret = f2x_fsb[(msr.lo >> 16) & 7];
+ *fsb = f2x_fsb[(msr.lo >> 16) & 7];
break;
case 0x3:
case 0x4:
case 0x6:
- ret = core2_fsb[(msr.lo >> 16) & 7];
+ *fsb = core2_fsb[(msr.lo >> 16) & 7];
break;
+ default:
+ return -2;
}
+ break;
+ default:
+ return -2;
}
- return ret;
+ if (*fsb > 0)
+ return 0;
+ return -1;
}
-int get_ia32_fsb(void)
+static void resolve_timebase(void)
{
- int ret;
+ int ret, fsb, ratio;
+
+ ret = get_fsb_tsc(&fsb, &ratio);
+ if (ret == 0) {
+ u32 tsc = 100 * DIV_ROUND_CLOSEST(ratio * fsb, 100);
+ car_set_var(g_timer_fsb, fsb);
+ car_set_var(g_timer_tsc, tsc);
+ return;
+ }
- ret = get_fsb();
if (ret == -1)
printk(BIOS_ERR, "FSB not found\n");
if (ret == -2)
printk(BIOS_ERR, "CPU not supported\n");
- return ret;
+
+ /* Set some semi-ridiculous defaults. */
+ car_set_var(g_timer_fsb, 500);
+ car_set_var(g_timer_tsc, 5000);
+ return;
+}
+
+u32 get_timer_fsb(void)
+{
+ u32 fsb;
+
+ fsb = car_get_var(g_timer_fsb);
+ if (fsb > 0)
+ return fsb;
+
+ resolve_timebase();
+ return car_get_var(g_timer_fsb);
+}
+
+unsigned long tsc_freq_mhz(void)
+{
+ u32 tsc;
+
+ tsc = car_get_var(g_timer_tsc);
+ if (tsc > 0)
+ return tsc;
+
+ resolve_timebase();
+ return car_get_var(g_timer_tsc);
}
/**
@@ -87,7 +144,7 @@ int get_ia32_fsb(void)
*/
int get_ia32_fsb_x3(void)
{
- const int fsb = get_ia32_fsb();
+ const int fsb = get_timer_fsb();
if (fsb > 0)
return 100 * DIV_ROUND_CLOSEST(3 * fsb, 100);
diff --git a/src/cpu/intel/fit/Kconfig b/src/cpu/intel/fit/Kconfig
index e48dca9f70..fa10802926 100644
--- a/src/cpu/intel/fit/Kconfig
+++ b/src/cpu/intel/fit/Kconfig
@@ -5,6 +5,7 @@ config CPU_INTEL_FIRMWARE_INTERFACE_TABLE
config CPU_INTEL_NUM_FIT_ENTRIES
int
+ default 16 if INTEL_TXT
default 4
depends on CPU_INTEL_FIRMWARE_INTERFACE_TABLE
help
diff --git a/src/cpu/intel/fsp_model_406dx/Kconfig b/src/cpu/intel/fsp_model_406dx/Kconfig
index 6bf8dc7eec..77ba0bdb98 100644
--- a/src/cpu/intel/fsp_model_406dx/Kconfig
+++ b/src/cpu/intel/fsp_model_406dx/Kconfig
@@ -1,8 +1,6 @@
##
## This file is part of the coreboot project.
##
-## Copyright (C) 2013-2014 Sage Electronic Engineering, LLC.
-##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; version 2 of the License.
@@ -28,13 +26,15 @@ config CPU_SPECIFIC_OPTIONS
select SMP
select MMX
select SSE2
- select UDELAY_LAPIC
+ select UDELAY_TSC
select SUPPORT_CPU_UCODE_IN_CBFS
select MICROCODE_BLOB_NOT_IN_BLOB_REPO
select PARALLEL_CPU_INIT
select TSC_SYNC_MFENCE
- select LAPIC_MONOTONIC_TIMER
+ select TSC_MONOTONIC_TIMER
+ select TSC_CONSTANT_RATE
select CPU_INTEL_COMMON
+ select CPU_INTEL_COMMON_TIMEBASE
select NO_SMM
# Microcode header files are delivered in FSP package
diff --git a/src/cpu/intel/fsp_model_406dx/Makefile.inc b/src/cpu/intel/fsp_model_406dx/Makefile.inc
index 97bb981a66..d7fb4a886c 100644
--- a/src/cpu/intel/fsp_model_406dx/Makefile.inc
+++ b/src/cpu/intel/fsp_model_406dx/Makefile.inc
@@ -1,8 +1,6 @@
#
# This file is part of the coreboot project.
#
-# Copyrignt (C) 2014 Sage Electronic Engineering, LLC.
-#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/intel/fsp_model_406dx/acpi.c b/src/cpu/intel/fsp_model_406dx/acpi.c
index f30567e037..6672eab3d1 100644
--- a/src/cpu/intel/fsp_model_406dx/acpi.c
+++ b/src/cpu/intel/fsp_model_406dx/acpi.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2009 coresystems GmbH
- * Copyright (C) 2011 The Chromium OS Authors. All rights reserved.
- * Copyright (C) 2013 Sage Electronic Engineering, LLC.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/cpu/intel/fsp_model_406dx/bootblock.c b/src/cpu/intel/fsp_model_406dx/bootblock.c
index 14cfad9de1..045b0f628c 100644
--- a/src/cpu/intel/fsp_model_406dx/bootblock.c
+++ b/src/cpu/intel/fsp_model_406dx/bootblock.c
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 Google Inc.
- * Copyright (C) 2013-2014 Sage Electronic Engineering LLC.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/intel/fsp_model_406dx/chip.h b/src/cpu/intel/fsp_model_406dx/chip.h
index bf547769c2..aaaed160ad 100644
--- a/src/cpu/intel/fsp_model_406dx/chip.h
+++ b/src/cpu/intel/fsp_model_406dx/chip.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 The Chromium OS Authors. All rights reserved.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
diff --git a/src/cpu/intel/fsp_model_406dx/model_406dx.h b/src/cpu/intel/fsp_model_406dx/model_406dx.h
index 6c5cc313b4..53a77a98a3 100644
--- a/src/cpu/intel/fsp_model_406dx/model_406dx.h
+++ b/src/cpu/intel/fsp_model_406dx/model_406dx.h
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
- * Copyright (C) 2013 Sage Electronic Engineering, LLC.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/cpu/intel/fsp_model_406dx/model_406dx_init.c b/src/cpu/intel/fsp_model_406dx/model_406dx_init.c
index efa86935f5..94925106f8 100644
--- a/src/cpu/intel/fsp_model_406dx/model_406dx_init.c
+++ b/src/cpu/intel/fsp_model_406dx/model_406dx_init.c
@@ -1,10 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2007-2009 coresystems GmbH
- * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
- * Copyright (C) 2014 Sage Electronic Engineering, LLC.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/cpu/intel/haswell/Kconfig b/src/cpu/intel/haswell/Kconfig
index 8f91b60953..db119a05cc 100644
--- a/src/cpu/intel/haswell/Kconfig
+++ b/src/cpu/intel/haswell/Kconfig
@@ -22,6 +22,7 @@ config CPU_SPECIFIC_OPTIONS
select CPU_INTEL_FIRMWARE_INTERFACE_TABLE
select PARALLEL_MP
select CPU_INTEL_COMMON
+ select CPU_INTEL_COMMON_TIMEBASE
select NO_FIXED_XIP_ROM_SIZE
config SMM_TSEG_SIZE
diff --git a/src/cpu/intel/haswell/Makefile.inc b/src/cpu/intel/haswell/Makefile.inc
index d46a422e4a..7661a4e2d8 100644
--- a/src/cpu/intel/haswell/Makefile.inc
+++ b/src/cpu/intel/haswell/Makefile.inc
@@ -1,27 +1,19 @@
ramstage-y += haswell_init.c
-ramstage-y += tsc_freq.c
romstage-y += romstage.c
-romstage-y += tsc_freq.c
romstage-y += ../car/romstage.c
-postcar-y += tsc_freq.c
-
ramstage-y += acpi.c
ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smmrelocate.c
smm-y += finalize.c
-smm-y += tsc_freq.c
bootblock-y += ../car/non-evict/cache_as_ram.S
bootblock-y += ../car/bootblock.c
bootblock-y += ../../x86/early_reset.S
bootblock-y += bootblock.c
-bootblock-y += tsc_freq.c
postcar-y += ../car/non-evict/exit_car.S
-verstage-y += tsc_freq.c
-
subdirs-y += ../../x86/tsc
subdirs-y += ../../x86/mtrr
subdirs-y += ../../x86/lapic
diff --git a/src/cpu/intel/haswell/acpi.c b/src/cpu/intel/haswell/acpi.c
index 9dcd8ece1e..282dd962cc 100644
--- a/src/cpu/intel/haswell/acpi.c
+++ b/src/cpu/intel/haswell/acpi.c
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2009 coresystems GmbH
- * Copyright (C) 2011 The Chromium OS Authors. All rights reserved.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/cpu/intel/haswell/bootblock.c b/src/cpu/intel/haswell/bootblock.c
index 7baa2a81ec..94e5d36e18 100644
--- a/src/cpu/intel/haswell/bootblock.c
+++ b/src/cpu/intel/haswell/bootblock.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -20,7 +18,6 @@
#include
#include
-#include
#include "haswell.h"
#include
diff --git a/src/cpu/intel/haswell/chip.h b/src/cpu/intel/haswell/chip.h
index cd9ec5d51b..f3b97572da 100644
--- a/src/cpu/intel/haswell/chip.h
+++ b/src/cpu/intel/haswell/chip.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 The Chromium OS Authors. All rights reserved.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -13,8 +11,6 @@
* GNU General Public License for more details.
*/
-extern struct chip_operations cpu_intel_haswell_ops;
-
/* Magic value used to locate this chip in the device tree */
#define SPEEDSTEP_APIC_MAGIC 0xACAC
diff --git a/src/cpu/intel/haswell/finalize.c b/src/cpu/intel/haswell/finalize.c
index 16e54d746a..b75d145ffd 100644
--- a/src/cpu/intel/haswell/finalize.c
+++ b/src/cpu/intel/haswell/finalize.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2012 The Chromium OS Authors. All rights reserved.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
diff --git a/src/cpu/intel/haswell/haswell.h b/src/cpu/intel/haswell/haswell.h
index cfd9d45690..4c67ba82ab 100644
--- a/src/cpu/intel/haswell/haswell.h
+++ b/src/cpu/intel/haswell/haswell.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
@@ -132,40 +130,22 @@
# error "CONFIG_IED_REGION_SIZE is not a power of 2"
#endif
-#if !defined(__ROMCC__) // FIXME romcc should handle below constructs
-
-#if defined(__PRE_RAM__)
struct pei_data;
struct rcba_config_instruction;
struct romstage_params {
struct pei_data *pei_data;
const void *gpio_map;
const struct rcba_config_instruction *rcba_config;
- unsigned long bist;
void (*copy_spd)(struct pei_data *);
};
void romstage_common(const struct romstage_params *params);
-#endif
-#ifdef __SMM__
/* Lock MSRs */
void intel_cpu_haswell_finalize_smm(void);
-#else
+
/* Configure power limits for turbo mode */
void set_power_limits(u8 power_limit_1_time);
int cpu_config_tdp_levels(void);
-void smm_relocation_handler(int cpu, uintptr_t curr_smbase,
- uintptr_t staggered_smbase);
-void smm_info(uintptr_t *perm_smbase, size_t *perm_smsize,
- size_t *smm_save_state_size);
-void smm_initialize(void);
-void smm_relocate(void);
-void smm_lock(void);
-struct bus;
-void bsp_init_and_start_aps(struct bus *cpu_bus);
-/* Determine if HyperThreading is disabled. The variable is not valid until
- * setup_ap_init() has been called. */
-#endif
/* CPU identification */
int haswell_family_model(void);
@@ -173,5 +153,3 @@ int haswell_stepping(void);
int haswell_is_ult(void);
#endif
-
-#endif
diff --git a/src/cpu/intel/haswell/haswell_init.c b/src/cpu/intel/haswell/haswell_init.c
index 95d719c2f1..66dca28dc5 100644
--- a/src/cpu/intel/haswell/haswell_init.c
+++ b/src/cpu/intel/haswell/haswell_init.c
@@ -1,9 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2007-2009 coresystems GmbH
- * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
@@ -24,6 +21,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -761,7 +759,7 @@ static void post_mp_init(void)
{
/* Now that all APs have been relocated as well as the BSP let SMIs
* start flowing. */
- southbridge_smm_enable_smi();
+ smm_southbridge_enable_smi();
/* Lock down the SMRAM space. */
smm_lock();
@@ -778,7 +776,7 @@ static const struct mp_ops mp_ops = {
.post_mp_init = post_mp_init,
};
-void bsp_init_and_start_aps(struct bus *cpu_bus)
+void mp_init_cpus(struct bus *cpu_bus)
{
if (mp_init_with_smm(cpu_bus, &mp_ops))
printk(BIOS_ERR, "MP initialization failure.\n");
diff --git a/src/cpu/intel/haswell/romstage.c b/src/cpu/intel/haswell/romstage.c
index 47b9976786..34fd7b0458 100644
--- a/src/cpu/intel/haswell/romstage.c
+++ b/src/cpu/intel/haswell/romstage.c
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2012 Google LLC
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -15,69 +13,28 @@
#include
#include
-#include
#include
#include
-#include
-#include
#include