diff --git a/.gitignore b/.gitignore
index 0cc6ae2d3a..ed667765fb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -54,11 +54,13 @@ util/crossgcc/xgcc
site-local
*.\#
+*.a
*.bin
*.debug
!Kconfig.debug
*.elf
*.o
+*.o.d
*.out
*.pyc
*.sw[po]
@@ -115,11 +117,9 @@ util/nvramtool/.dependencies
util/nvramtool/nvramtool
util/optionlist/Options.wiki
util/pmh7tool/pmh7tool
-util/romcc/build
util/runfw/googlesnow
util/superiotool/superiotool
util/vgabios/testbios
-util/viatool/viatool
util/autoport/autoport
util/kbc1126/kbc1126_ec_dump
util/kbc1126/kbc1126_ec_insert
diff --git a/3rdparty/intel-microcode b/3rdparty/intel-microcode
index 1dd14da6d1..33b7b2f381 160000
--- a/3rdparty/intel-microcode
+++ b/3rdparty/intel-microcode
@@ -1 +1 @@
-Subproject commit 1dd14da6d1ea5cfbd95923653f31c04aac3aa655
+Subproject commit 33b7b2f3817e362111cd91910026ab8907f21710
diff --git a/3rdparty/libgfxinit b/3rdparty/libgfxinit
index fe7985f2a0..cdbfce2757 160000
--- a/3rdparty/libgfxinit
+++ b/3rdparty/libgfxinit
@@ -1 +1 @@
-Subproject commit fe7985f2a0692bc773d470a92ec54d22d3c12e4b
+Subproject commit cdbfce275777f2fd142e3a3c73469807a4c40207
diff --git a/3rdparty/vboot b/3rdparty/vboot
index 0e97e25e85..3aab301473 160000
--- a/3rdparty/vboot
+++ b/3rdparty/vboot
@@ -1 +1 @@
-Subproject commit 0e97e25e85f0499e23b09a31a2c7116759f191d5
+Subproject commit 3aab301473ec0b95f109a245efeadc20c3b7d57d
diff --git a/AUTHORS b/AUTHORS
index d41c9583b5..4bc62a7b63 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -8,78 +8,141 @@
# 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
+3mdeb Embedded Systems Consulting
9elements Agency GmbH
+Abhinav Hardikar
+Advanced Computing Lab, LANL
Advanced Micro Devices, Inc.
+AdaCore
AG Electronics Ltd.
+Alex Thiessen
Alex Züpke
Alexander Couzens
Alexandru Gagniuc
Analog Devices Inc.
+Analogix Semiconductor
+Andre Heider
+Andriy Gapon
Andy Fleming
+Angel Pons
+Anton Kochkov
ARM Limited and Contributors
Arthur Heymans
+Asami Doi
ASPEED Technology Inc.
Atheros Corporation
Atmel Corporation
BAP - Bruhnspace Advanced Projects
+Bill Xie
+Bitland Tech Inc.
+Boris Barbulovski
Carl-Daniel Hailfinger
+Cavium Inc.
Christoph Grenz
+Code Aurora Forum
coresystems GmbH
Corey Osgood
+Curt Brune
+Custom Ideas
Damien Zammit
+Dave Airlie
David Brownell
+David Greenman
David Hendricks
David Mosberger-Tang
+David Mueller
+Denis 'GNUtoo' Carikli
Denis Dowling
DENX Software Engineering
+Derek Waldner
Digital Design Corporation
DMP Electronics Inc.
+Donghwa Lee
Drew Eckhardt
Dynon Avionics
Edward O'Callaghan
Egbert Eich
+ELSOFT AG
Eltan B.V
+Elyes Haouas
Eric Biederman
Eswar Nallusamy
+Evgeny Zinoviev
Fabian Kunkel
+Fabrice Bellard
Facebook, Inc.
Felix Held
+Felix Singer
Frederic Potter
Free Software Foundation, Inc.
Freescale Semiconductor, Inc.
Gary Jennejohn
+George Trudeau
+Gerald Van Baren
Gerd Hoffmann
Gergely Kiss
Google LLC
Greg Watson
+Guennadi Liakhovetski
+Hal Martin
+HardenedLinux
+Hewlett-Packard Development Company, L.P.
+Hewlett Packard Enterprise Development LP
+Huaqin Telecom Inc.
+IBM Corporation
Idwer Vollering
+Igor Pavlov
Imagination Technologies
Infineon Technologies
+InKi Dae
Intel Corporation
+Iru Cai
+Isaku Yamahata
+Ivan Vatlin
+James Ye
Jason Zhao
+Joe Pillow
+Johanna Schander
+Jonas 'Sortie' Termansen
+Jonathan A. Kollasch
Jonathan Neuschäfer
Jordan Crouse
Joseph Smith
Keith Hui
Keith Packard
Kevin Cody-Little
+Kevin O'Connor
+Kontron Europe GmbH
Kshitij
Kyösti Mälkki
+Leah Rowe
Lei Wen
Li-Ta Lo
Libra Li
Libretrend LDA
+Linaro Limited
Linus Torvalds
Linux Networx, Inc.
+LiPPERT ADLINK Technology GmbH
+Lubomir Rintel
Luc Verhaegen
+Maciej Matuszczyk
+Marc Bertens
Marc Jones
Marek Vasut
Marius Gröger
Martin Mares
+Martin Renters
+Martin Roth
Marvell International Ltd.
Marvell Semiconductor Inc.
Matt DeVillier
+Maxim Polyakov
MediaTek Inc.
+Michael Brunner
+Michael Schroeder
+Michael Niewöhner
+Mika Westerberg
Mondrian Nuessle
MontaVista Software, Inc.
Myles Watson
@@ -87,69 +150,96 @@ Network Appliance Inc.
Nicholas Sielicki
Nick Barker
Nico Huber
+Nico Rikken
Nicola Corna
+Nils Jacobs
+Nir Tzachar
+Nokia Corporation
+NVIDIA Corporation
+Olivier Langlois
Ollie Lo
Omar Pakker
+Online SAS
Orion Technologies, LLC
Patrick Georgi
Patrick Rudolph
+Pattrick Hueper
+Paulo Alcantara
Pavel Sayekat
PC Engines GmbH
Per Odlund
+Peter Korsgaard
Peter Stuge
Philipp Degler
+Philipp Deppenwiese
+Philipp Hug
Protectli
+Purism SPC
+Qualcomm Technologies
Raptor Engineering, LLC
-Red Hat Inc
+Red Hat, Inc
Reinhard Meyer
+Renze Nicolai
Richard Spiegel
Richard Woodruff
+Rob Landley
+Robert Reeves
+Robinson P. Tryon
+Rockchip, Inc.
+Romain Lievin
+Roman Zippel
Ronald G. Minnich
Rudolf Marek
Russell King
+Ruud Schramp
Sage Electronic Engineering, LLC
+Sam Ravnborg
Samsung Electronics
Samuel Holland
SciTech Software, Inc.
Sebastian Grzywna
secunet Security Networks AG
+Sencore Inc
+Sergej Ivanov
Siemens AG
+SiFive, Inc
Silicon Integrated System Corporation
-Silverback ltd.
+Silverback Ltd.
Stefan Reinauer
+Stefan Tauner
Steve Magnani
+Steve Shenton
ST Microelectronics
SUSE LINUX AG
Sven Schnelle
Syed Mohammed Khasim
+System76
Texas Instruments
+The Android Open Source Project
The ChromiumOS Authors
The Linux Foundation
+The Regents of the University of California
Thomas Winischhofer
Timothy Pearson
Tobias Diedrich
+Tristan Corrick
Tungsten Graphics, Inc.
Tyan Computer Corp.
ucRobotics Inc.
University of Heidelberg
Uwe Hermann
VIA Technologies, Inc
+Vikram Narayanan
Vipin Kumar
Vladimir Serbinenko
+Vlado Cibic
Wang Qing Pei
Ward Vandewege
+Wilbert Duijvenvoorde
Win Enterprises
+Wiwynn Corp.
Wolfgang Denk
+YADRO
+Yann Collet
Yinghai Lu
-
-
-
-# Directories transferred
-src/acpi
-src/arch
-src/commonlib
-src/console
-src/cpu
-src/device
-src/drivers
-src/superio
+Zachary Yedidia
diff --git a/Documentation/Intel/SoC/soc.html b/Documentation/Intel/SoC/soc.html
index 6b1bb30740..53131c6e6f 100644
--- a/Documentation/Intel/SoC/soc.html
+++ b/Documentation/Intel/SoC/soc.html
@@ -657,7 +657,7 @@ Use the following steps to debug the call to TempRamInit:
The EDK2 data structure is defined in
MdeModulePkg/Include/IndustryStandard/Acpi61.h
The coreboot data structure is defined in
- src/arch/x86/include/arch/acpi.h
+ src/arch/x86/include/arch/acpi.h
diff --git a/Documentation/acpi/devicetree.md b/Documentation/acpi/devicetree.md
index 556c9668f6..c3c4c2e402 100644
--- a/Documentation/acpi/devicetree.md
+++ b/Documentation/acpi/devicetree.md
@@ -157,7 +157,7 @@ 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``.
+``src/arch/x86/include/acpi/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``.
diff --git a/Documentation/acpi/gpio.md b/Documentation/acpi/gpio.md
index d42042f36f..abde3a0d3d 100644
--- a/Documentation/acpi/gpio.md
+++ b/Documentation/acpi/gpio.md
@@ -73,6 +73,15 @@ calling the platform specific acpigen_soc_{set,clear}_tx_gpio
functions internally. Thus, all the ACPI AML calling conventions for
the platform functions apply to these helper functions as well.
+3. Get Rx GPIO
+ int acpigen_get_rx_gpio(struct acpi_gpio gpio)
+
+This function takes as input, an struct acpi_gpio type and outputs
+AML code to read the *logical* value of a gpio (after taking its
+polarity into consideration), into the Local0 variable. It calls
+the platform specific acpigen_soc_read_rx_gpio() to actually read
+the raw Rx gpio value.
+
## Implementation Details
ACPI library in coreboot will provide weak definitions for all the
diff --git a/Documentation/acpi/index.md b/Documentation/acpi/index.md
index c378722018..2f65e29968 100644
--- a/Documentation/acpi/index.md
+++ b/Documentation/acpi/index.md
@@ -1,6 +1,9 @@
# ACPI-specific documentation
-This section contains documentation about coreboot on ACPI.
+This section contains documentation about coreboot on ACPI. coreboot dropped
+backwards support for ACPI 1.0 and is only compatible to ACPI version 2.0 and
+upwards.
+
- [SSDT UID generation](uid.md)
diff --git a/Documentation/contributing/documentation_ideas.md b/Documentation/contributing/documentation_ideas.md
new file mode 100644
index 0000000000..54b3efa5bc
--- /dev/null
+++ b/Documentation/contributing/documentation_ideas.md
@@ -0,0 +1,173 @@
+# Documentation Ideas
+
+This section collects ideas to improve the coreboot documentation and
+should serve as a pool of ideas for people who want to improve the current
+documentation status of coreboot.
+
+The main purpose of this document is to gather documentation ideas for technical
+writers of the seasons of docs. Nevertheless anyone who wants to help improving
+the current documentation situation can take one of the projects.
+
+Each entry should outline what would be done, the benefit it brings
+to the project, the pre-requisites, both in knowledge and parts. They
+should also list people interested in supporting people who want to work
+on them.
+
+## Restructure Existing Documentation
+
+The goal is to improve the user experience and structure the documentation more
+logically. The current situation makes it very hard for beginners, but also for
+experienced developers to find anything in the coreboot documentation.
+
+One possible approach to restructure the documentation is to split it up such
+that we divide the group of users into:
+
+* (End-)users
+Most probably users which _just_ want to use coreboot as fast as possible. This
+section should include guidelines on how to build coreboot, how to flash coreboot
+and also which hardware is currently supported.
+
+* Developers
+This section should more focus on the developer side-of-view. This section would
+include how to get started developing coreboot, explaining the basic concepts of
+coreboot and also give guideance on how to proceed after the first steps.
+
+* Knowledge area
+This section is very tighlight coupled to the developer section and might be merged
+into it. The _Knowledge area_ can give a technical deep dive on various drivers,
+technologies, etc.
+
+* Community area
+This section gives some room for the community: Youtube channels, conferences,
+meetups, forums, chat, etc.
+
+A [first approach](https://review.coreboot.org/c/coreboot/+/40327) has already been made here and might be a basis for the work.
+Most of the documentation is already there, but scattered around the documentation
+folder.
+
+### Requirements
+* Understanding on how a different groups of users might use the documentation area
+* Basic understanding of how coreboot works (Can be worked out _on-the-fly_)
+
+### Mentors
+* christian.walter@9elements.com
+* TBD
+
+## Update Howto/Guides
+
+An important part to involve new people in the project, either as developer or
+as enduser, are guides and how-to's. There are already some guides which need
+to be updated to work, and could also be extended to multiple platforms, like
+Fedora or Arch-Linux. Also guidance for setting up coreboot with a Windows
+environment would be helpful.
+
+In addition, the vboot guidance needs an update/extensions, that the security
+features within coreboot can be used by non-technical people.
+
+For developers, how to debug coreboot and various debugging techniques need
+documentation.
+
+### Requirements
+* Knowledge of virtual machines, how to install different OSs and set up the
+ toolchain on different operating systems
+* Knowledge of debugging tools like gdb
+
+### Mentors
+* christian.walter@9elements.com
+* TBD
+
+## How to Support a New Board
+
+coreboot benefits from running on as many platforms as possible. Therefore we
+want to encourage new developers on porting existing hardware to coreboot.
+Guidance for those new developers need to be made such that they are able to
+take the first steps supporting new mainboards, when the SoC support already
+exists. There should be a 'how-to' guide for this. Also what are common problems
+and how to solve those.
+
+### Requirements
+* Knowledge of how to add support for a new mainboard in coreboot
+
+### Mentors
+* christian.walter@9elements.com
+* TBD
+
+## Payloads
+
+The current documentation of the payloads is not very effective. There should be
+more detailed documentation on the payloads that can be selected via the make
+menuconfig within coreboot. Also the use-cases should be described in more
+detail: When to use which payload? What are the benefits of using payload X over
+Y in a specific use-case ?
+
+In addition it should be made clear how additional functionality e.g. extend
+LinuxBoot with more commands, can be achieved.
+
+### Requirements
+* Basic knowledge of the supported payloads like SeaBIOS, TinanoCore, LinuxBoot,
+ GRUB, Linux, ...
+
+
+### Mentors
+* christian.walter@9elements.com
+* TBD
+
+
+## coreboot Util Documentation
+
+coreboot inherits a variaty of utilities. The current documentation only
+provides a "one-liner" as an explanation. The list of util should be updated
+with a more detailed explanation where possible. Also more "in-depths"
+explanations should be added with examples if possible.
+
+### Requirements
+* coreboot utilities
+
+### Mentors
+* christian.walter@9elements.com
+* TBD
+
+
+## CBMEM Developer Guide
+
+CBMEM is the API that provides memory buffers for the use at OS runtime. It's a
+core component and thus should be documented. Dos, don'ts and pitfalls when
+using CBMEM. This "in-depth" guide is clearly for developers.
+
+### Requirements
+* Deep understanding of coreboot's internals
+
+### Mentors
+* TBD
+* TBD
+
+
+## CBFS Developer Guide
+
+CBFS is the in-flash filesystem that is used by coreboot. It's a core component
+and thus should be documented. Update the existing CBFS.txt that still shows
+version 1 of the implementation. A [first approach](https://review.coreboot.org/c/coreboot/+/33663/2)
+has been made here.
+This "in-depth" guide is clearly for developers.
+
+### Requirements
+* Deep understanding of coreboot's internals
+
+### Mentors
+* TBD
+* TBD
+
+
+## Region API Developer Guide
+
+The region API is used by coreboot when dealing with memory mapped objects that
+can be split into chunks. It's a core component and thus should be documented.
+This "in-depth" guide is clearly for developers.
+
+### Requirements
+* Deep understanding of coreboot's internals
+
+### Mentors
+* TBD
+* TBD
+
diff --git a/Documentation/contributing/project_ideas.md b/Documentation/contributing/project_ideas.md
index 90164a2bfa..141023fd3d 100644
--- a/Documentation/contributing/project_ideas.md
+++ b/Documentation/contributing/project_ideas.md
@@ -27,7 +27,9 @@ which is a bad experience when trying to build coreboot the first time.
Provide packages/installers of our compiler toolchain for Linux distros,
Windows, Mac OS. For Windows, this should also include the environment
-(shell, make, ...).
+(shell, make, ...). A student doesn't have to cover _all_ platforms, but
+pick a set of systems that match their interest and knowledge and lay
+out a plan on how to do this.
The scripts to generate these packages should be usable on a Linux
host, as that's what we're using for our automated build testing system
@@ -131,26 +133,6 @@ their bug reports.
### Mentors
* Patrick Georgi
-## Make coreboot coverity clean
-coreboot and several other of our projects are automatically tested
-using Synopsys' free "Coverity Scan" service. While some fare pretty
-good, like [em100](https://scan.coverity.com/projects/em100) at 0 known
-defects, there are still many open issues in other projects, most notably
-[coreboot](https://scan.coverity.com/projects/coreboot) itself (which
-is also the largest codebase).
-
-Not all of the reports are actual issues, but the project benefits a
-lot if the list of unhandled reports is down to 0 because that provides
-a baseline when future changes reintroduce new issues: it's easier to
-triage and handle a list of 5 issues rather than more than 350.
-
-This project would be going through all reports and handling them
-appropriately: Figure out if reports are valid or not and mark them
-as such. For valid reports, provide patches to fix the underlying issue.
-
-### Mentors
-* Patrick Georgi
-
## Extend Ghidra to support analysis of firmware images
[Ghidra](https://ghidra-sre.org) is a recently released cross-platform
disassembler and decompiler that is extensible through plugins. Make it
@@ -158,6 +140,11 @@ useful for firmware related work: Automatically parse formats (eg. by
integrating UEFITool, cbfstool, decompressors), automatically identify
16/32/64bit code on x86/amd64, etc.
+This has been done in 2019 with [some neat
+features](https://github.com/al3xtjames/ghidra-firmware-utils) being
+developed, but it may be possible to expand support for all kinds of firmware
+analyses.
+
## Learn hardware behavior from I/O and memory access logs
[SerialICE](https://www.serialice.com) is a tool to trace the behavior of
executable code like firmware images. One result of that is a long log file
@@ -179,3 +166,84 @@ This is a research-heavy project.
### Mentors
* Ron Minnich
+
+## Libpayload based memtest payload
+[Memtest86+](https://www.memtest.org/) has some limitations: first and
+foremost it only works on x86, while it can print to serial console the
+GUI only works in legacy VGA mode.
+
+This project would involve porting the memtest suite to libpayload and
+build a payload around it.
+
+### Requirements
+* coreboot knowledge: Should know how to build coreboot images and
+ include payloads.
+* other knowledge: Knowledge on how dram works is a plus.
+* hardware requirements: Initial work can happen on qemu targets,
+ being able to test on coreboot supported hardware is a plus.
+
+### Mentors
+* TODO
+
+## Fix POST code handling
+coreboot supports writing POST codes to I/O port 80.
+There are various Kconfigs that deal with POST codes, which don't have
+effect on most platforms.
+The code to send POST codes is scattered in C and Assembly, some use
+functions, some use macros and others simply use the `outb` instruction.
+The POST codes are duplicated between stages and aren't documented properly.
+
+
+Tasks:
+* Guard Kconfigs with a *depends on* to only show on supported platforms
+* Remove duplicated Kconfigs
+* Replace `outb(0x80, ...)` with calls to `post_code(...)`
+* Update Documentation/POSTCODES
+* Use defines from console/post_codes.h where possible
+* Drop duplicated POST codes
+* Make use of all possible 255 values
+
+### Requirements
+* knowledge in the coreboot build system and the concept of stages
+* other knowledge: Little experience with C and x86 Assembly
+* hardware requirements: Nothing special
+
+### Mentors
+* Patrick Rudolph
+* Christian Walter
+
+## Board status replacement
+The [Board status page](https://coreboot.org/status/board-status.html) allows
+to see last working commit of a board. The page is generated by a cron job
+that runs on a huge git repository.
+
+Build an open source replacement written in Golang using existing tools
+and libraries, consisting of a backend, a frontend and client side
+scripts. The backend should connect to an SQL database with can be
+controlled using a RESTful API. The RESTful API should have basic authentication
+for managment tasks and new board status uploads.
+
+At least one older test result should be keept in the database.
+
+The frontend should use established UI libraries or frameworks (for example
+Angular) to display the current board status, that is if it's working or not
+and some details provided with the last test. If a board isn't working the last
+working commit (if any) should be shown in addition to the broken one.
+
+Provide a script/tool that allows to:
+1. Push mainboard details from coreboot master CI
+2. Push mainboard test results from authenticated users containing
+ * working
+ * commit hash
+ * bootlog (if any)
+ * dmesg (if it's booting)
+ * timestamps (if it's booting)
+ * coreboot config
+
+### Requirements
+* coreboot knowledge: Non-technical, needed to perform requirements analysis
+* software knowledge: Golang, SQL for the backend, JS for the frontend
+
+### Mentors
+* Patrick Rudolph
+* Christian Walter
diff --git a/Documentation/drivers/smmstore.md b/Documentation/drivers/smmstore.md
index ecf937b1d0..53bac4dc9e 100644
--- a/Documentation/drivers/smmstore.md
+++ b/Documentation/drivers/smmstore.md
@@ -22,7 +22,7 @@ The API provides append-only semantics for key/value pairs.
By default SMMSTORE will operate on a separate FMAP region called
`SMMSTORE`. The default generated FMAP will include such a region.
-On systems with a locked FMAP, e.g. in an existing VBOOT setup
+On systems with a locked FMAP, e.g. in an existing vboot setup
with a locked RO region, the option exists to add a cbfsfile
called `smm_store` in the `RW_LEGACY` (if CHROMEOS) or in the
`COREBOOT` FMAP regions. It is recommended for new builds using
diff --git a/Documentation/flash_tutorial/int_flashrom.md b/Documentation/flash_tutorial/int_flashrom.md
index 28b534b003..982aca287d 100644
--- a/Documentation/flash_tutorial/int_flashrom.md
+++ b/Documentation/flash_tutorial/int_flashrom.md
@@ -5,7 +5,7 @@
## Using flashrom
This method does only work on Linux, if it isn't locked down.
-You may also need to boot with 'iomem=relaxed' in the kernel command
+You may also need to boot with `iomem=relaxed` in the kernel command
line if CONFIG_IO_STRICT_DEVMEM is set.
diff --git a/Documentation/getting_started/gpio.md b/Documentation/getting_started/gpio.md
index 26939ce7cf..81a06eb410 100644
--- a/Documentation/getting_started/gpio.md
+++ b/Documentation/getting_started/gpio.md
@@ -25,7 +25,7 @@ how to appropriately set these registers. In addition, some mainboards are
based on a baseboard/variant model, where several variant mainboards may share a
lot of their circuitry and ICs and the commonality between the boards is
collected into a virtual ``baseboard.`` In that case, the GPIOs which are shared
-between multiple boards are placed in the baseboard's ``gpio.c` file, while the
+between multiple boards are placed in the baseboard's ``gpio.c`` file, while the
ones that are board-specific go into each variant's ``gpio.c`` file.
## Intel SoCs
diff --git a/Documentation/gfx/libgfxinit.md b/Documentation/gfx/libgfxinit.md
index 0608363906..bb4528b958 100644
--- a/Documentation/gfx/libgfxinit.md
+++ b/Documentation/gfx/libgfxinit.md
@@ -65,11 +65,20 @@ board can initialize graphics through *libgfxinit*:
select MAINBOARD_HAS_LIBGFXINIT
Internal ports share some hardware blocks (e.g. backlight, panel
-power sequencer). Therefore, each board has to select either eDP
-or LVDS as the internal port, if any:
+power sequencer). Therefore, each system with an integrated panel
+should set `GFX_GMA_PANEL_1_PORT` to the respective port, e.g.:
- select GFX_GMA_INTERNAL_IS_EDP # the default, or
- select GFX_GMA_INTERNAL_IS_LVDS
+ config GFX_GMA_PANEL_1_PORT
+ default "DP3"
+
+For the most common cases, LVDS and eDP, exists a shorthand, one
+can select either:
+
+ select GFX_GMA_PANEL_1_ON_EDP # the default, or
+ select GFX_GMA_PANEL_1_ON_LVDS
+
+Some newer chips feature a second block of panel control logic.
+For this, `GFX_GMA_PANEL_2_PORT` can be set.
Boards with a DVI-I connector share the DDC (I2C) pins for both
analog and digital displays. In this case, *libgfxinit* needs to
@@ -96,7 +105,8 @@ You can select from the following Ports:
type Port_Type is
(Disabled, -- optionally terminates the list
- Internal, -- either eDP or LVDS as selected in Kconfig
+ LVDS,
+ eDP,
DP1,
DP2,
DP3,
@@ -112,8 +122,7 @@ both DPx and HDMIx should be listed.
A good example is the mainboard Kontron/KTQM77, it features two
DP++ ports (DP2/HDMI2, DP3/HDMI3), one DVI-I port (HDMI1/Analog),
-eDP and LVDS. Due to the constraints mentioned above, only one of
-eDP and LVDS can be enabled. It defines `ports` as follows:
+eDP and LVDS. It defines `ports` as follows:
ports : constant Port_List :=
(DP2,
@@ -122,7 +131,8 @@ eDP and LVDS can be enabled. It defines `ports` as follows:
HDMI2,
HDMI3,
Analog,
- Internal,
+ LVDS,
+ eDP,
others => Disabled);
The `GMA.gfxinit()` procedure probes for display EDIDs in the
diff --git a/Documentation/ifdtool/layout.md b/Documentation/ifdtool/layout.md
index 950db6f7ff..2513929db9 100644
--- a/Documentation/ifdtool/layout.md
+++ b/Documentation/ifdtool/layout.md
@@ -14,14 +14,26 @@ The names of the IFD regions in the FMAP should follow the convention of
starting with the prefix `SI_` which stands for `silicon initialization` as a
way to categorize anything required by the SoC but not provided by coreboot.
-|IFD Region index|IFD Region name|FMAP Name|Notes|
-|---|---|---|---|
-|0|Flash Descriptor|SI_DESC|Always the top 4KB of flash|
-|1|BIOS|SI_BIOS|This is the region that contains coreboot|
-|2|Intel ME|SI_ME||
-|3|Gigabit Ethernet|SI_GBE||
-|4|Platform Data|SI_PDR||
-|8|EC Firmware|SI_EC|Most Chrome OS devices do not use this region; EC firmware is stored BIOS region of flash|
+```eval_rst
++------------+------------------+-----------+-------------------------------------------+
+| IFD Region | IFD Region name | FMAP Name | Notes |
+| index | | | |
++============+==================+===========+===========================================+
+| 0 | Flash Descriptor | SI_DESC | Always the top 4KB of flash |
++------------+------------------+-----------+-------------------------------------------+
+| 1 | BIOS | SI_BIOS | This is the region that contains coreboot |
++------------+------------------+-----------+-------------------------------------------+
+| 2 | Intel ME | SI_ME | |
++------------+------------------+-----------+-------------------------------------------+
+| 3 | Gigabit Ethernet | SI_GBE | |
++------------+------------------+-----------+-------------------------------------------+
+| 4 | Platform Data | SI_PDR | |
++------------+------------------+-----------+-------------------------------------------+
+| 8 | EC Firmware | SI_EC | Most Chrome OS devices do not use this |
+| | | | region; EC firmware is stored in BIOS |
+| | | | region of flash |
++------------+------------------+-----------+-------------------------------------------+
+```
## Validation
diff --git a/Documentation/index.md b/Documentation/index.md
index b636b61911..a7c4869db2 100644
--- a/Documentation/index.md
+++ b/Documentation/index.md
@@ -164,6 +164,7 @@ Contents:
* [Tutorial](tutorial/index.md)
* [Coding Style](coding_style.md)
* [Project Ideas](contributing/project_ideas.md)
+* [Documentation Ideas](contributing/documentation_ideas.md)
* [Code of Conduct](community/code_of_conduct.md)
* [Community forums](community/forums.md)
* [Project services](community/services.md)
diff --git a/Documentation/mainboard/51nb/x210.jpg b/Documentation/mainboard/51nb/x210.jpg
new file mode 100644
index 0000000000..66fb7e3a8e
Binary files /dev/null and b/Documentation/mainboard/51nb/x210.jpg differ
diff --git a/Documentation/mainboard/51nb/x210.md b/Documentation/mainboard/51nb/x210.md
new file mode 100644
index 0000000000..2c41fd8a31
--- /dev/null
+++ b/Documentation/mainboard/51nb/x210.md
@@ -0,0 +1,46 @@
+# 51NB X210
+
+## Extracting vendor EC firmware
+
+EC firmware is included in the SPI image. To extract it, run:
+
+```
+dd bs=64K skip=32 count=1 if=bios.rom of=ec.bin
+```
+
+and ensure that you have a file that includes the string "Insyde Software Corp".
+
+## Flashing instructions
+
+This can be performed using the internal SPI controller, even when flashing
+from stock firmware. Use `flashrom -p internal` and follow the appropriate
+flashrom instructions to force it. Alternatively, external flashing has been
+tested with Dediprog SF100 and SF600 and using a Beaglebone Black. The flash
+is located on the upper side of the motherboard, below the keyboard
+connector. It is circled in red here:
+
+
+
+## Flashing a subset of the ROM
+
+If you want to flash coreboot without extracting firmware blobs, you can
+flash coreboot without overwriting those blobs. After building coreboot,
+create a layout file with the following content:
+
+```
+00000000:001fffff me
+00200000:0020ffff ec
+00210000:007fffff main
+```
+
+and run flashrom with the `--layout rom.layout --image main` arguments. This
+will flash the main firmware without overwriting the existing EC or ME
+firmware.
+
+## Working
+
+All hardware features are believed to be working, although the SD reader is
+untested. Note that certain hotkeys don't work (including the ThinkVantage
+button) - this is a limitation of the EC firmware, and these keys also
+generate no events under the stock vendor firmware.
+
diff --git a/Documentation/mainboard/asrock/h110m-dvs.md b/Documentation/mainboard/asrock/h110m-dvs.md
index 66d491d44c..4d26cfd0f8 100644
--- a/Documentation/mainboard/asrock/h110m-dvs.md
+++ b/Documentation/mainboard/asrock/h110m-dvs.md
@@ -31,8 +31,6 @@ make distclean
touch .config
./util/scripts/config --enable VENDOR_ASROCK
./util/scripts/config --enable BOARD_ASROCK_H110M_DVS
-./util/scripts/config --enable CONFIG_ADD_FSP_BINARIES
-./util/scripts/config --enable CONFIG_FSP_USE_REPO
./util/scripts/config --set-str REALTEK_8168_MACADDRESS "xx:xx:xx:xx:xx:xx"
make olddefconfig
```
diff --git a/Documentation/mainboard/asus/p8z77-m_pro.md b/Documentation/mainboard/asus/p8z77-m_pro.md
index 7c841499fc..110108966b 100644
--- a/Documentation/mainboard/asus/p8z77-m_pro.md
+++ b/Documentation/mainboard/asus/p8z77-m_pro.md
@@ -1,6 +1,6 @@
-# ASUS P8Z77-M Pro
+# ASUS P8Z77-M PRO
-This page describes how to run coreboot on the [ASUS P8Z77-M Pro]
+This page describes how to run coreboot on the [ASUS P8Z77-M PRO]
## Flashing coreboot
@@ -163,6 +163,6 @@ easy to remove and reflash.
- [Flash chip datasheet][W25Q64FVA1Q]
-[ASUS P8Z88-M Pro]: https://www.asus.com/Motherboards/P8Z77M_PRO/
+[ASUS P8Z77-M PRO]: https://www.asus.com/Motherboards/P8Z77M_PRO/
[W25Q64FVA1Q]: https://www.winbond.com/resource-files/w25q64fv%20revs%2007182017.pdf
[flashrom]: https://flashrom.org/Flashrom
diff --git a/Documentation/mainboard/hp/8760w.md b/Documentation/mainboard/hp/8760w.md
index 714745aa04..071d35e251 100644
--- a/Documentation/mainboard/hp/8760w.md
+++ b/Documentation/mainboard/hp/8760w.md
@@ -2,6 +2,9 @@
This page describes how to run coreboot on the [HP EliteBook 8760w].
+The coreboot code for this laptop is still not merged, you need to
+checkout the [code on gerrit] to build coreboot for the laptop.
+
## Flashing coreboot
```eval_rst
@@ -29,7 +32,7 @@ This page describes how to run coreboot on the [HP EliteBook 8760w].
## Required proprietary blobs
- Intel Firmware Descriptor, ME and GbE firmware
-- EC: please read [EliteBook Series](elitebook_series)
+- EC: please read [HP Laptops with KBC1126 Embedded Controller](hp_kbc1126_laptops)
## Flashing instructions
@@ -80,3 +83,4 @@ clip to read and flash the chip.
```
[HP EliteBook 8760w]: https://support.hp.com/us-en/product/hp-elitebook-8760w-mobile-workstation/5071180
+[code on gerrit]: https://review.coreboot.org/c/coreboot/+/30936
diff --git a/Documentation/mainboard/hp/elitebook_series.md b/Documentation/mainboard/hp/hp_kbc1126_laptops.md
similarity index 81%
rename from Documentation/mainboard/hp/elitebook_series.md
rename to Documentation/mainboard/hp/hp_kbc1126_laptops.md
index 6668928008..357af4fb42 100644
--- a/Documentation/mainboard/hp/elitebook_series.md
+++ b/Documentation/mainboard/hp/hp_kbc1126_laptops.md
@@ -1,13 +1,14 @@
-# HP EliteBook series
+# HP Laptops with KBC1126 Embedded Controller
This document is about HP EliteBook series laptops up to Ivy Bridge era
which use SMSC KBC1126 as embedded controller.
-## EC
+SMSC KBC1126 (and older similar chips like KBC1098) has been used in
+HP EliteBooks for many generations. BIOS and EC firmware share an SPI
+flash chip in these laptops, so we need to put firmware blobs for the
+EC to the coreboot image.
-SMSC KBC1098/KBC1126 has been used in HP EliteBooks for many generations.
-They use similar EC firmware that will load other code and data from the
-SPI flash chip, so we need to put some firmware blobs to the coreboot image.
+## EC firmware extraction and coreboot building
The following document takes EliteBook 2760p as an example.
@@ -32,18 +33,15 @@ Chipset --->
(2760p-fw2.bin) KBC1126 filename #2 path and filename
```
-## Super I/O
+## Porting guide for HP laptops with KBC1126
-EliteBook 8000 series laptops have SMSC LPC47n217 Super I/O to provide
-a serial port and a parallel port, you can debug the laptop via this
-serial port.
-
-## porting
-
-To port coreboot to an HP EliteBook laptop, you need to do the following:
+To port coreboot to an HP laptop with KBC1126, you need to do the
+following:
- select Kconfig option `EC_HP_KBC1126`
-- select Kconfig option `SUPERIO_SMSC_LPC47N217` if there is LPC47n217 Super I/O
+- select Kconfig option `SUPERIO_SMSC_LPC47N217` if there is LPC47n217
+ Super I/O, usually in EliteBook 8000 series, which can be used for
+ debugging via serial port
- initialize EC and Super I/O in romstage
- add EC and Super I/O support to devicetree.cb
@@ -51,8 +49,8 @@ To get the related values for EC in devicetree.cb, you need to extract the EFI
module EcThermalInit from the vendor UEFI firmware with [UEFITool]. Usually,
`ec_data_port`, `ec_cmd_port` and `ec_ctrl_reg` has the following values:
-- For xx60 series: 0x60, 0x64, 0xca
-- For xx70 series: 0x62, 0x66, 0x81
+- For EliteBook xx60 series: 0x60, 0x64, 0xca
+- For EliteBook xx70 series: 0x62, 0x66, 0x81
You can use [radare2] and the following [r2pipe] Python script to find
these values from the EcThermalInit EFI module:
diff --git a/Documentation/mainboard/index.md b/Documentation/mainboard/index.md
index ce30ee2f1c..e80ff0b512 100644
--- a/Documentation/mainboard/index.md
+++ b/Documentation/mainboard/index.md
@@ -2,6 +2,10 @@
This section contains documentation about coreboot on specific mainboards.
+## 51NB
+
+- [X210](51nb/x210.md)
+
## AMD
- [padmelon](amd/padmelon/padmelon.md)
@@ -54,7 +58,7 @@ The boards in this section are not real mainboards, but emulators.
### EliteBook series
-- [EliteBook common](hp/elitebook_series.md)
+- [HP Laptops with KBC1126 EC](hp/hp_kbc1126_laptops.md)
- [EliteBook 8760w](hp/8760w.md)
## Intel
@@ -70,27 +74,29 @@ The boards in this section are not real mainboards, but emulators.
- [R60](lenovo/r60.md)
- [T4xx common](lenovo/t4xx_series.md)
- [X2xx common](lenovo/x2xx_series.md)
+- [vboot](lenovo/vboot.md)
-### Nehalem series
+### Arrandale series
- [T410](lenovo/t410.md)
### GM45 series
+- [X200 / T400 / T500 / X301 common](lenovo/montevina_series.md)
- [X301](lenovo/x301.md)
### Sandy Bridge series
- [T420](lenovo/t420.md)
-- [T420 / T520 / X220 / T420s / W520 common](lenovo/xx20_series.md)
-- [x1](lenovo/x1.md)
+- [T420 / T520 / X220 / T420s / W520 common](lenovo/Sandy_Bridge_series.md)
+- [X1](lenovo/x1.md)
### Ivy Bridge series
- [T430](lenovo/t430.md)
- [T530](lenovo/w530.md)
- [W530](lenovo/w530.md)
-- [T430 / T530 / X230 / W530 common](lenovo/xx30_series.md)
+- [T430 / T530 / X230 / W530 common](lenovo/Ivy_Bridge_series.md)
- [T431s](lenovo/t431s.md)
- [Internal flashing](lenovo/ivb_internal_flashing.md)
@@ -98,6 +104,10 @@ The boards in this section are not real mainboards, but emulators.
- [T440p](lenovo/t440p.md)
+## Libretrend
+
+- [LT1000](libretrend/lt1000.md)
+
## MSI
- [MS-7707](msi/ms7707/ms7707.md)
@@ -116,6 +126,11 @@ The boards in this section are not real mainboards, but emulators.
- [PQ7-M107](portwell/pq7-m107.md)
+## Protectli
+
+- [FW2B / FW4B](protectli/fw2b_fw4b.md)
+- [FW6A / FW6B / FW6C](protectli/fw6.md)
+
## Roda
- [RK9 Flash Header](roda/rk9/flash_header.md)
@@ -130,6 +145,10 @@ The boards in this section are not real mainboards, but emulators.
- [X11 LGA1151 series](supermicro/x11-lga1151-series/x11-lga1151-series.md)
- [Flashing using the BMC](supermicro/flashing_on_vendorbmc.md)
+## System76
+
+- [Lemur Pro](system76/lemp9.md)
+
## UP
- [Squared](up/squared/index.md)
diff --git a/Documentation/mainboard/lenovo/xx30_series.md b/Documentation/mainboard/lenovo/Ivy_Bridge_series.md
similarity index 78%
rename from Documentation/mainboard/lenovo/xx30_series.md
rename to Documentation/mainboard/lenovo/Ivy_Bridge_series.md
index ad856057f0..f4f0efff6c 100644
--- a/Documentation/mainboard/lenovo/xx30_series.md
+++ b/Documentation/mainboard/lenovo/Ivy_Bridge_series.md
@@ -1,5 +1,7 @@
# Lenovo Ivy Bridge series
+This information is valid for all supported models, except T430s and T431s.
+
## Flashing coreboot
```eval_rst
+---------------------+--------------------------------+
@@ -72,5 +74,20 @@ region. The update is then written into the EC once.
![][fl]
-[fl]: flashlayout_xx30.svg
+[fl]: flashlayout_Ivy_Bridge.svg
+## Reducing Intel Managment Engine firmware size
+
+It is possible to reduce the Intel ME firmware size to free additional
+space for the `bios` region. This is usually referred to as *cleaning the ME* or
+*stripping the ME*.
+After reducing the Intel ME firmware size you must modify the original IFD,
+[split the resulting coreboot ROM](#splitting-the-coreboot-rom) and then write
+each ROM using an [external programmer].
+Have a look at [me_cleaner] for more information.
+
+Tests on Lenovo W530 showed no issues with a stripped and shrunken ME firmware.
+
+
+[me_cleaner]: ../../northbridge/intel/sandybridge/me_cleaner.md
+[external programmer]: ../../flash_tutorial/index.md
diff --git a/Documentation/mainboard/lenovo/xx20_series.md b/Documentation/mainboard/lenovo/Sandy_Bridge_series.md
similarity index 64%
rename from Documentation/mainboard/lenovo/xx20_series.md
rename to Documentation/mainboard/lenovo/Sandy_Bridge_series.md
index 8603853b94..37a75b9799 100644
--- a/Documentation/mainboard/lenovo/xx20_series.md
+++ b/Documentation/mainboard/lenovo/Sandy_Bridge_series.md
@@ -33,9 +33,7 @@
usable by coreboot.
* ROM chip size should be set to 8MiB.
-```eval_rst
-Please also have a look at :doc:`../../flash_tutorial/index`.
-```
+Please also have a look at the [flashing tutorial]
## Flash layout
There's one 8MiB flash which contains IFD, GBE, ME and BIOS regions.
@@ -44,5 +42,28 @@ region. The update is then written into the EC once.
![][fl]
-[fl]: flashlayout_xx20.svg
+[fl]: flashlayout_Sandy_Bridge.svg
+## Reducing Intel Managment Engine firmware size
+
+It is possible to reduce the Intel ME firmware size to free additional
+space for the `bios` region. This is usually referred to as *cleaning the ME* or
+*stripping the ME*.
+After reducing the Intel ME firmware size you must modify the original IFD
+and then write a full ROM using an [external programmer].
+Have a look at [me_cleaner] for more information.
+
+Tests on Lenovo X220 showed no issues with a stripped ME firmware.
+
+**Modified flash layout:**
+
+![][fl2]
+
+[fl2]: flashlayout_Sandy_Bridge_stripped_me.svg
+
+The overall size of the `gbe`, `me,` `ifd` region is less than 128KiB, leaving
+the remaining space for the `bios` partition.
+
+
+[me_cleaner]: ../../northbridge/intel/sandybridge/me_cleaner.md
+[external programmer]: ../../flash_tutorial/index.md
diff --git a/Documentation/mainboard/lenovo/codenames.csv b/Documentation/mainboard/lenovo/codenames.csv
index ad77059480..655ff7b07a 100644
--- a/Documentation/mainboard/lenovo/codenames.csv
+++ b/Documentation/mainboard/lenovo/codenames.csv
@@ -1,4 +1,6 @@
-t60,magi-5|magi-7|austin-3
+t60,magi (dGPU) | lisa (iGPU)
+z61m,BW2
+z61t,BV2
t400,malibu-3
t400s,shinai
t410,nozomi-1
@@ -16,13 +18,18 @@ w510,kendo-1 workstation
w520,kendo-3 workstation
w530,kendo-4 workstation
w700,n-note
+w701,n-note 3.0 (nico-3)
x1_carbon_gen1,genesis-1
x60,ks note
x61,ks note-3
x200,mocha-1
+x200s,pecan-1
+x200t,caramel-1
x201,mocha-3
x220,dasher-1
+x220t,comet-1
x230,dasher-2
+x230t,comet-2
x230s,rogue-1
x240,rogue-2
x300,kodachi
diff --git a/Documentation/mainboard/lenovo/flashlayout_xx30.svg b/Documentation/mainboard/lenovo/flashlayout_Ivy_Bridge.svg
similarity index 100%
rename from Documentation/mainboard/lenovo/flashlayout_xx30.svg
rename to Documentation/mainboard/lenovo/flashlayout_Ivy_Bridge.svg
diff --git a/Documentation/mainboard/lenovo/flashlayout_xx20.svg b/Documentation/mainboard/lenovo/flashlayout_Sandy_Bridge.svg
similarity index 100%
rename from Documentation/mainboard/lenovo/flashlayout_xx20.svg
rename to Documentation/mainboard/lenovo/flashlayout_Sandy_Bridge.svg
diff --git a/Documentation/mainboard/lenovo/flashlayout_Sandy_Bridge_stripped_me.svg b/Documentation/mainboard/lenovo/flashlayout_Sandy_Bridge_stripped_me.svg
new file mode 100644
index 0000000000..d8d8213d12
--- /dev/null
+++ b/Documentation/mainboard/lenovo/flashlayout_Sandy_Bridge_stripped_me.svg
@@ -0,0 +1,74 @@
+
+
+
diff --git a/Documentation/mainboard/lenovo/ivb_internal_flashing.md b/Documentation/mainboard/lenovo/ivb_internal_flashing.md
index e6b597b284..1d02cac5c4 100644
--- a/Documentation/mainboard/lenovo/ivb_internal_flashing.md
+++ b/Documentation/mainboard/lenovo/ivb_internal_flashing.md
@@ -102,7 +102,7 @@ Replace the last line (`command.com`) with this (change path to the
Save the file, then unmount the partition:
- sudo unmount /mnt
+ sudo umount /mnt
Write this image to a USB drive (replace `/dev/sdX` with your USB drive
device name):
diff --git a/Documentation/mainboard/lenovo/montevina_series.md b/Documentation/mainboard/lenovo/montevina_series.md
new file mode 100644
index 0000000000..62e87969f9
--- /dev/null
+++ b/Documentation/mainboard/lenovo/montevina_series.md
@@ -0,0 +1,164 @@
+# Lenovo X200 / T400 / T500 / X301 common
+
+These models are sold with either 8 MiB or 4 MiB flash chip. You can identify
+the chip in your machine through flashrom:
+```console
+# flashrom -p internal
+```
+
+Note that this does not allow you to determine whether the chip is in a SOIC-8
+or a SOIC-16 package.
+
+## Installing without ME firmware
+
+```eval_rst
+.. Note::
+ **ThinkPad R500** has slightly different flash layout (it doesn't have
+ ``gbe`` region), so the process would be a little different for that model.
+```
+
+On Montevina machines it's possible to disable ME and remove its firmware from
+SPI flash by modifying the flash descriptor. This also makes it possible to use
+the flash region the ME used for `bios` region, allowing for much larger
+payloads.
+
+First of all create a backup of your ROM with an external programmer:
+```console
+# flashrom -p YOUR_PROGRAMMER -r backup.rom
+```
+
+Then, split the IFD regions into separate files with ifdtool. You will need
+`flashregion_3_gbe.bin` later.
+```console
+$ ifdtool -x backup.rom
+```
+
+Now you need to patch the flash descriptor. You can either [modify the one from
+your backup with **ifdtool**](#modifying-flash-descriptor-using-ifdtool), or
+[generate a completely new one with **bincfg**](#creating-a-new-flash-descriptor-using-bincfg).
+
+#### Modifying flash descriptor using ifdtool
+
+Pick the layout according to your chip size from the table below and save it to
+the `new_layout.txt` file:
+
+```eval_rst
++---------------------------+---------------------------+---------------------------+
+| 4 MB chip | 8 MB chip | 16 MB chip |
++===========================+===========================+===========================+
+| .. code-block:: none | .. code-block:: none | .. code-block:: none |
+| | | |
+| 00000000:00000fff fd | 00000000:00000fff fd | 00000000:00000fff fd |
+| 00001000:00002fff gbe | 00001000:00002fff gbe | 00001000:00002fff gbe |
+| 00003000:003fffff bios | 00003000:007fffff bios | 00003000:01ffffff bios |
+| 00fff000:00000fff pd | 00fff000:00000fff pd | 00fff000:00000fff pd |
+| 00fff000:00000fff me | 00fff000:00000fff me | 00fff000:00000fff me |
++---------------------------+---------------------------+---------------------------+
+```
+
+The last two lines define `pd` and `me` regions of negative size. This way
+ifdtool will mark those as unused.
+
+Update regions in the flash descrpitor (it was extracted previously with
+`ifdtool -x`):
+```console
+$ ifdtool -n new_layout.txt flashregion_0_flashdescriptor.bin
+```
+
+Set `MeDisable` bit in ICH0 and MCH0 straps:
+```console
+$ ifdtool -M 1 flashregion_0_flashdescriptor.bin.new
+```
+
+Delete previous descriptors and rename the final one:
+```console
+$ rm flashregion_0_flashdescriptor.bin
+$ rm flashregion_0_flashdescriptor.bin.new
+$ mv flashregion_0_flashdescriptor.bin.new.new flashregion_0_flashdescriptor.bin
+```
+
+Continue to the [Configuring coreboot](#configuring-coreboot) section.
+
+#### Creating a new flash descriptor using bincfg
+
+There is a tool to generate a modified flash descriptor called **bincfg**. Go to
+`util/bincfg` and build it:
+```console
+$ cd util/bincfg
+$ make
+```
+
+If your flash is not 8 MB, you need to change values of `flcomp_density1` and
+`flreg1_limit` in the ifd-x200.set file according to following table:
+
+```eval_rst
++-----------------+-------+-------+--------+
+| | 4 MB | 8 MB | 16 MB |
++=================+=======+=======+========+
+| flcomp_density1 | 0x3 | 0x4 | 0x5 |
++-----------------+-------+-------+--------+
+| flreg1_limit | 0x3ff | 0x7ff | 0x1fff |
++-----------------+-------+-------+--------+
+```
+
+Then create the flash descriptor:
+```console
+$ ./bincfg ifd-x200.spec ifd-x200.set ifd.bin
+```
+
+#### Configuring coreboot
+
+Now configure coreboot. You need to select correct chip size and specify paths
+to flash descriptor and gbe dump.
+
+```
+Mainboard --->
+ ROM chip size (8192 KB (8 MB)) # According to your chip
+ (0x7fd000) Size of CBFS filesystem in ROM # or 0x3fd000 for 4 MB chip / 0x1ffd000 for 16 MB chip
+
+Chipset --->
+ [*] Add Intel descriptor.bin file
+ # Note: if you used bincfg, specify path to generated util/bincfg/ifd.bin
+ (/path/to/flashregion_0_flashdescriptor.bin) Path and filename of the descriptor.bin file
+
+ [*] Add gigabit ethernet configuration
+ (/path/to/flashregion_3_gbe.bin) Path to gigabit ethernet configuration
+```
+
+Then build coreboot and flash whole `build/coreboot.rom` to the chip.
+
+## Installing with ME firmware
+
+To install coreboot and keep ME working, you don't need to do anything special
+with the flash descriptor. Just flash only `bios` externally and don't touch any
+other regions:
+```console
+# flashrom -p YOUR_PROGRAMMER -w coreboot.rom --ifd -i bios
+```
+
+## Flash layout
+
+The flash layouts of the OEM firmware are as follows:
+
+```eval_rst
++---------------------------------+---------------------------------+
+| 4 MB chip | 8 MB chip |
++=================================+=================================+
+| .. code-block:: none | .. code-block:: none |
+| | |
+| 00000000:00000fff fd | 00000000:00000fff fd |
+| 00001000:001f5fff me | 00001000:005f5fff me |
+| 001f6000:001f7fff gbe | 005f6000:005f7fff gbe |
+| 001f8000:001fffff pd | 005f8000:005fffff pd |
+| 00200000:003fffff bios | 00600000:007fffff bios |
+| 00290000:002affff ec | 00690000:006affff ec |
+| 003e0000:003fffff bootblock | 007e0000:007fffff bootblock |
++---------------------------------+---------------------------------+
+```
+
+On each boot of vendor BIOS `ec` area in flash is checked for having firmware
+there, and if there is one, it proceedes to update firmware on H8S/2116 (when
+both external power and main battery are attached). Once update is performed,
+first 64 KB of `ec` area is erased. Visit
+[thinkpad-ec repository](https://github.com/hamishcoleman/thinkpad-ec) to learn
+more about how to extract EC firmware from vendor updates.
diff --git a/Documentation/mainboard/lenovo/t420.md b/Documentation/mainboard/lenovo/t420.md
index 831cb58765..00ce45f69a 100644
--- a/Documentation/mainboard/lenovo/t420.md
+++ b/Documentation/mainboard/lenovo/t420.md
@@ -14,12 +14,10 @@ W25Q64CVSIG. Do not rely on dots painted in the corner of the chip (such as
the blue dot pictured) to orient the pins!
For more details have a look at [T420 / T520 / X220 / T420s / W520 common] and
-
-```eval_rst
-:doc:`../../flash_tutorial/ext_power`
-```
+the general [flashing tutorial].
Steps to access the flash IC are described here [T4xx series].
[T4xx series]: t4xx_series.md
-[T420 / T520 / X220 / T420s / W520 common]: xx20_series.md
+[flashing tutorial]: ../../flash_tutorial/ext_power.md
+[T420 / T520 / X220 / T420s / W520 common]: Sandy_Bridge_series.md
diff --git a/Documentation/mainboard/lenovo/t430.md b/Documentation/mainboard/lenovo/t430.md
index 787246f4d4..c2cddca053 100644
--- a/Documentation/mainboard/lenovo/t430.md
+++ b/Documentation/mainboard/lenovo/t430.md
@@ -5,11 +5,10 @@ You have to disassemble the whole device, as the flash ICs are on the bottom
of the mainboard.
For more details have a look at [T430 / T530 / X230 / T430s / W530 common] and
-```eval_rst
-:doc:`../../flash_tutorial/ext_power`
-```
+the general [flashing tutorial].
Steps to access the flash IC are described here [T4xx series].
+[flashing tutorial]: ../../flash_tutorial/ext_power.md
[T4xx series]: t4xx_series.md
-[T430 / T530 / X230 / T430s / W530 common]: xx30_series.md
+[T430 / T530 / X230 / T430s / W530 common]: Ivy_Bridge_series.md
diff --git a/Documentation/mainboard/lenovo/t431s.md b/Documentation/mainboard/lenovo/t431s.md
index 146e1c12a3..f177e0f452 100644
--- a/Documentation/mainboard/lenovo/t431s.md
+++ b/Documentation/mainboard/lenovo/t431s.md
@@ -26,9 +26,7 @@ the programmer.

-```eval_rst
-:doc:`../../flash_tutorial/ext_power`
-```
+The general [flashing tutorial] has more details.
Currently, detecting the model of soldered RAM at runtime and loading
the corresponding SPD datum from CBFS is not implemented yet. You may
@@ -39,4 +37,4 @@ inteltool, and replace the content of the SPD hex with what is dumped.
I do not know how to find gpio ports for that, and SPD data stored in
vendor firmware.)
-[T420 / T520 / X220 / T420s / W520 common]: xx20_series.md
+[T420 / T520 / X220 / T420s / W520 common]: Sandy_Bridge_series.md
diff --git a/Documentation/mainboard/lenovo/t440p.md b/Documentation/mainboard/lenovo/t440p.md
index 98c1da54ac..08df76fdca 100644
--- a/Documentation/mainboard/lenovo/t440p.md
+++ b/Documentation/mainboard/lenovo/t440p.md
@@ -31,15 +31,10 @@ the laptop able to power on.
## Known Issues
- No audio output when using a headphone
-- The touchpad is misconfigured, the 3 keys on top are all identified
- as left button
- Cannot get the mainboard serial number from the mainboard: the OEM
UEFI firmware gets the serial number from an "emulated EEPROM" via
I/O port 0x1630/0x1634, but it's still unknown how to make it work
-
-## Untested
-
-- the dGPU model
+- The dGPU does not currently work in Windows.
## Working
@@ -61,6 +56,7 @@ the laptop able to power on.
- CMOS options: wlan, trackpoint, fn_ctrl_swap
- internal flashing when IFD is unlocked
- using `me_cleaner`
+- dGPU (must be enabled in CMOS options)
[Lenovo ThinkPad T440p]: https://pcsupport.lenovo.com/us/zh/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t440p
[Hardware Maintenance Manual]: https://download.lenovo.com/ibmdl/pub/pc/pccbbs/mobiles_pdf/t440p_hmm_en_sp40a25467_04.pdf
diff --git a/Documentation/mainboard/lenovo/vboot.md b/Documentation/mainboard/lenovo/vboot.md
new file mode 100644
index 0000000000..3f1536018f
--- /dev/null
+++ b/Documentation/mainboard/lenovo/vboot.md
@@ -0,0 +1,38 @@
+# Using coreboot's verified boot on Lenovo devices
+
+By default a single instance of coreboot is present in the firmware flash,
+no verification is done and the flash is not write-protected, so as to allow
+firmware updates from the OS.
+The verified boot mechanism also called [vboot] allows secure firmware
+updates using an A/B partitioning scheme once enabled.
+
+## Enabling vboot
+You can enable [vboot] in Kconfig's *Security* section. Besides a verified
+boot you can also enable a measured boot by setting
+`CONFIG_VBOOT_MEASURED_BOOT`. Both options need a working TPM, which is
+present on all recent Lenovo devices.
+
+## Updating and recovery
+As the A/B partition is writeable you can still update them from the OS.
+By using the [vboot] mechanism you store a copy of coreboot in the `RO`
+partition that acts as failsafe in case the regular firmware update, that
+goes to the `A` or `B` partition fails.
+
+**Note:** The `RO` partition isn't write-protected by default, therefore you
+have to enable the protection in the security Kconfig menu by yourself.
+
+On *Lenovo* devices you can enable the *Fn* key as recovery mode switch, by
+enabling `CONFIG_H8_FN_KEY_AS_VBOOT_RECOVERY_SW`.
+Holding the *Fn* at boot will then switch to the recovery image, allowing
+to boot and flash a working image to the A/B partition.
+
+## 8 MiB ROM limitation
+*Lenovo* devices with 8 MiB ROM only have a `RO`+`A` partition enabled in the
+default FMAP. They are missing the `B` partition, due to size constaints.
+You can still provide your own FMAP if you need `RO`+`A`+`B` partitions.
+
+## CMOS
+[vboot] on *Lenovo* devices uses the CMOS to store configuration data, like
+boot failures and the last successfully booted partition.
+
+[vboot]: ../../security/vboot/index.md
diff --git a/Documentation/mainboard/lenovo/w530.md b/Documentation/mainboard/lenovo/w530.md
index f91d9cee6a..e3fe6b8d4f 100644
--- a/Documentation/mainboard/lenovo/w530.md
+++ b/Documentation/mainboard/lenovo/w530.md
@@ -10,9 +10,7 @@ As all lines except /CS are shared between the flash ICs you can access
both with an external programmer.
For more details have a look at [T430 / T530 / X230 / T430s / W530 common] and
-```eval_rst
-:doc:`../../flash_tutorial/ext_power`
-```
+the general [flashing tutorial].
### After removing the keyboard and palm rest
![][w530-1]
@@ -24,4 +22,5 @@ For more details have a look at [T430 / T530 / X230 / T430s / W530 common] and
[w530-2]: w530-2.jpg
-[T430 / T530 / X230 / T430s / W530 common]: xx30_series.md
+[flashing tutorial]: ../../flash_tutorial/ext_power.md
+[T430 / T530 / X230 / T430s / W530 common]: Ivy_Bridge_series.md
diff --git a/Documentation/mainboard/lenovo/x1.md b/Documentation/mainboard/lenovo/x1.md
index cb9248a4e4..9f915bc07f 100644
--- a/Documentation/mainboard/lenovo/x1.md
+++ b/Documentation/mainboard/lenovo/x1.md
@@ -13,12 +13,10 @@ The flash IC can be a SOIC-8 one or a WSON-8 one, and may be covered with
a piece of insulation tape.
For more details have a look at [T420 / T520 / X220 / T420s / W520 common] and
-
-```eval_rst
-:doc:`../../flash_tutorial/ext_power`
-```
+the general [flashing tutorial].
Steps to access the flash IC are described here [X2xx series].
[X2xx series]: x2xx_series.md
-[T420 / T520 / X220 / T420s / W520 common]: xx20_series.md
+[flashing tutorial]: ../../flash_tutorial/ext_power.md
+[T420 / T520 / X220 / T420s / W520 common]: Sandy_Bridge_series.md
diff --git a/Documentation/mainboard/lenovo/x301.md b/Documentation/mainboard/lenovo/x301.md
index 28b512d24d..b273fc5a33 100644
--- a/Documentation/mainboard/lenovo/x301.md
+++ b/Documentation/mainboard/lenovo/x301.md
@@ -22,23 +22,26 @@ SOIC-8 one (you might need to add the chip to the IFD VSCC list), as
what is done in the photo.
The vendor IFD VSCC list contains:
- -MACRONIX_MX25L6405 (0xc2, 0x2017)
- -WINBOND_NEX_W25X64 (0xef, 0x3017)
- -ATMEL_AT25DF641 (0x1f, 0x4800)
+- MACRONIX_MX25L6405 (0xc2, 0x2017)
+- WINBOND_NEX_W25X64 (0xef, 0x3017)
+- ATMEL_AT25DF641 (0x1f, 0x4800)
+
+The general [flashing tutorial] has more details.
-```eval_rst
-:doc:`../../flash_tutorial/ext_power`
-```
Tested:
- - CPU Core 2 Duo U9400
- - Slotted DIMM 4GiB*2 from samsung
- - Camera
- - pci-e slots
- - sata and usb2
- - libgfxinit-based graphic init
- - NVRAM options for North and South bridges
- - Sound
- - Thinkpad EC
- - S3
- - Linux 4.19.67-2 within Debian GNU/Linux stable, loaded from
- Linux payload (Heads) and Seabios.
+- Core 2 Duo U9400 CPU
+- Slotted DIMM 4GiB*2 from Samsung
+- Camera
+- PCI-e slots
+- SATA and USB2
+- libgfxinit-based graphics init
+- NVRAM options for North and South bridges
+- Sound
+- ThinkPad EC
+- S3
+- Linux 4.19.67-2 within Debian GNU/Linux stable, loaded from
+ Linux payload (Heads) and SeaBIOS.
+
+
+[flashing tutorial]: ../../flash_tutorial/ext_power.md
+
diff --git a/Documentation/mainboard/libretrend/lt1000.jpg b/Documentation/mainboard/libretrend/lt1000.jpg
new file mode 100644
index 0000000000..c450c4add3
Binary files /dev/null and b/Documentation/mainboard/libretrend/lt1000.jpg differ
diff --git a/Documentation/mainboard/libretrend/lt1000.md b/Documentation/mainboard/libretrend/lt1000.md
new file mode 100644
index 0000000000..78d5fc056c
--- /dev/null
+++ b/Documentation/mainboard/libretrend/lt1000.md
@@ -0,0 +1,117 @@
+# Libretrend LT1000
+
+This page describes how to run coreboot on the [Libretrend LT1000] (aka
+Librebox).
+
+
+
+## Required proprietary blobs
+
+To build a minimal working coreboot image some blobs are required (assuming
+only the BIOS region is being modified).
+
+```eval_rst
++-----------------+---------------------------------+---------------------+
+| Binary file | Apply | Required / Optional |
++=================+=================================+=====================+
+| FSP-M, FSP-S | Intel Firmware Support Package | Required |
++-----------------+---------------------------------+---------------------+
+| microcode | CPU microcode | Required |
++-----------------+---------------------------------+---------------------+
+```
+
+FSP-M and FSP-S are obtained after splitting the Kaby Lake FSP binary (done
+automatically by coreboot build system and included into the image) from the
+*3rdparty/fsp* submodule.
+
+Microcode updates are automatically included into the coreboot image by build
+system from the *3rdparty/intel-microcode* submodule.
+
+The mainboard code also contains a VBT file (version 1.00, BDB version 2.09)
+which is automatically included into the image by coreboot build system.
+
+## Flashing coreboot
+
+### Internal programming
+
+The main SPI flash can be accessed using [flashrom]. It is strongly advised to
+flash only the BIOS region if not having an external programmer, see known
+issues.
+
+### External programming
+
+The system has an internal flash chip which is a 8 MiB soldered SOIC-8 chip.
+This chip is located on the top middle side of the board near the CPU fan,
+between the DIMM slots and the M.2 disk. Use a clip (or solder the wires) to
+program the chip. Specifically, it's a Winbond W25Q64FV (3.3V) -
+[datasheet][W25Q64FV].
+
+## Known issues
+
+- Fastboot (MRC cache) is not working reliably (missing schematics for CPU to
+ DIMM wiring).
+- Flashing ME region with already cleaned ME firmware may lead to platform not
+ booting, flashing full ME firmware is needed to recover.
+- In order to have the USB device wake support from S3 state using the front
+ USB 3.0 ports, one has to move the jumper on DUSB1_PWR_SET header (it will
+ switch the power rails for the USB 3.0 ports).
+- There are 6 unknown GPIO pins on the board.
+
+## Untested
+
+Not all mainboard's peripherals and functions were tested because of lack of
+the cables or not being populated on the board case.
+
+- LVDS header
+- Onboard USB 2.0 and USB 3.0 headers
+- Speakers and mic header
+- SPDIF header
+- Audio header
+- PS/2 header
+- LPT header
+- CIR (infrared header)
+- COM2 port RS485 mode (RS232/RS485 mode is controlled via jumper)
+- SYS_FAN header
+
+## Working
+
+- USB
+- Ethernet
+- Integrated graphics (with libgfxinit) on VGA and HDMI ports
+- flashrom
+- PCIe
+- NVMe
+- WiFi and Bluetooth
+- SATA
+- Serial ports 1-6
+- SMBus
+- HDA (verbs not implemented yet, but works under GNU/Linux (4.15 tested))
+- Initialization with KBL FSP 2.0
+- SeaBIOS payload (version rel-1.13.0)
+- TPM2 ([custom module] connected to LPC DEBUG header)
+- Automatic fan control
+- Platform boots with cleaned ME (MFS partition must be left on SPI flash)
+
+## Technology
+
+The platform contains an LR-i7S65T1 baseboard (LR-i7S65T2 with two NICs not
+sold yet). More details on [baseboard site]. Unfortunately the board manual is
+not publicly available.
+
+```eval_rst
++------------------+--------------------------------------------------+
+| CPU | Intel Core i7-6500U |
++------------------+--------------------------------------------------+
+| PCH | Skylake-U Premium |
++------------------+--------------------------------------------------+
+| Super I/O | ITE IT8786E |
++------------------+--------------------------------------------------+
+| Coprocessor | Intel Management Engine |
++------------------+--------------------------------------------------+
+```
+
+[Libretrend LT1000]: https://libretrend.com/specs/librebox/
+[W25Q64FV]: https://www.winbond.com/resource-files/w25q64fv%20revs%2007182017.pdf
+[flashrom]: https://flashrom.org/Flashrom
+[baseboard site]: http://www.minicase.net/product_LR-i7S65T1.html
+[custom module]: https://shop.3mdeb.com/product/tpm2-module-for-librebox/
diff --git a/Documentation/mainboard/msi/ms7707/ms7707.md b/Documentation/mainboard/msi/ms7707/ms7707.md
index 789431872c..c27ff60142 100644
--- a/Documentation/mainboard/msi/ms7707/ms7707.md
+++ b/Documentation/mainboard/msi/ms7707/ms7707.md
@@ -75,7 +75,7 @@ Put all back in place and restart the board. It might need 1-2 AC power cycles
to reinitialize (running at full fan speed - don't panic).
* External flashing has been tested with RPi2 without main power connected.
3.3V provided by RPi2. Read more about flashing methods [here](https://doc.coreboot.org/flash_tutorial/index.html).
-* In case of going back to proprietary BIOS create/save cmos settings as early
+* In case of going back to proprietary BIOS create/save CMOS settings as early
as possible (do not leave BIOS on first start without saving settings).
The BIOS might corrupt nvram (not cmos!) and leave the system in a dead state
that needs an external flasher to revive. If stuck, reset the Fintek (see
diff --git a/Documentation/mainboard/protectli/fw2b.jpg b/Documentation/mainboard/protectli/fw2b.jpg
new file mode 100644
index 0000000000..d6f41059bd
Binary files /dev/null and b/Documentation/mainboard/protectli/fw2b.jpg differ
diff --git a/Documentation/mainboard/protectli/fw2b_fw4b.md b/Documentation/mainboard/protectli/fw2b_fw4b.md
new file mode 100644
index 0000000000..e7d5cbfcc9
--- /dev/null
+++ b/Documentation/mainboard/protectli/fw2b_fw4b.md
@@ -0,0 +1,128 @@
+# Protectli Vault FW2B and FW4B
+
+This page describes how to run coreboot on the [Protectli FW2B] and
+[Protectli FW4B].
+
+
+## Required proprietary blobs
+
+To build a minimal working coreboot image some blobs are required (assuming
+only the BIOS region is being modified).
+
+```eval_rst
++-----------------+---------------------------------+---------------------+
+| Binary file | Apply | Required / Optional |
++=================+=================================+=====================+
+| FSP | Intel Firmware Support Package | Required |
++-----------------+---------------------------------+---------------------+
+| microcode | CPU microcode | Required |
++-----------------+---------------------------------+---------------------+
+| vgabios | VGA Option ROM | Optional |
++-----------------+---------------------------------+---------------------+
+```
+
+FSP is automatically added by coreboot build system into the image) from the
+`3rdparty/fsp` submodule.
+
+microcode updates are automatically included into the coreboot image by build
+system from the `3rdparty/intel-microcode` submodule.
+
+VGA Option ROM is not required to boot, but if one needs graphics in pre-OS
+stage, it should be included.
+
+## Flashing coreboot
+
+### Internal programming
+
+The main SPI flash can be accessed using [flashrom].
+
+### External programming
+
+The system has an internal flash chip which is a 8 MiB soldered SOIC-8 chip.
+This chip is located on the bottom side of the case (the radiator side). One
+has to remove all screws (in order): 4 top cover screws, 4 side cover screws
+(one side is enough), 4 mainboard screws, 3 CPU screws (under the DIMM). Lift
+up the mainboard and turn around it. The flash chip is near the mainboard edge
+close to the Ethernet Controllers. Use a clip (or solder the wires) to program
+the chip. **Watch out on the voltage, the SPI operates at 1.8V!** Specifically,
+it's a Macronix MX25U6435F (1.8V) - [datasheet][MX25U6435F].
+
+## Known issues
+
+- After flashing with external programmer the board will not boot if flashed
+ the BIOS region only. For some reason it is required to flash whole image
+ along with TXE region.
+- USB 3.0 ports get detected very late in SeaBIOS, it needs huge timeout
+ values in order to get the devices detected.
+
+## Untested
+
+Not all mainboard's peripherals and functions were tested because of lack of
+the cables or not being populated on the board case.
+
+- internal USB 2.0 header
+
+## Working
+
+- USB 3.0 front ports (SeaBIOS and Linux)
+- 4 Ethernet ports (2 Ethernet ports on FW2B)
+- 2 HDMI ports with VGA Option ROM
+- 2 HDMI ports with libgfxinit
+- flashrom
+- PCIe WiFi
+- SATA and mSATA
+- Super I/O serial port 0 (RS232 via front RJ45 connector)
+- SMBus (reading SPD from DIMMs)
+- initialization with Braswell FSP
+- SeaBIOS payload (version rel-1.13.0)
+
+- booting Debian, Ubuntu, FreeBSD
+
+## Not working
+
+- mPCIe debug card connected to mSATA (mSATA slot has LPC signals routed,
+ however for some reason the debug card is not powered)
+
+## Technology
+
+The mainboard has two variants: FW2B and FW4B. They have different Braswell
+SoC. The FW2B replaces 2 out of 4 Ethernet Controllers with 4 USB ports
+connected via [FE1.1 USB 2.0 hub].
+
+- FW2B:
+
+```eval_rst
++------------------+--------------------------------------------------+
+| CPU | Intel Celeron J3060 |
++------------------+--------------------------------------------------+
+| PCH | Braswell |
++------------------+--------------------------------------------------+
+| Super I/O | ITE IT8613E |
++------------------+--------------------------------------------------+
+| Coprocessor | Intel Trusted Execution Engine |
++------------------+--------------------------------------------------+
+```
+
+
+
+- FW4B:
+
+```eval_rst
++------------------+--------------------------------------------------+
+| CPU | Intel Celeron J3160 |
++------------------+--------------------------------------------------+
+| PCH | Braswell |
++------------------+--------------------------------------------------+
+| Super I/O | ITE IT8613E |
++------------------+--------------------------------------------------+
+| Coprocessor | Intel Trusted Execution Engine |
++------------------+--------------------------------------------------+
+```
+
+
+
+[Protectli FW2B]: https://protectli.com/vault-2-port/
+[Protectli FW4B]: https://protectli.com/product/fw4b/
+[MX25U6435F]: https://www.macronix.com/Lists/Datasheet/Attachments/7411/MX25U6435F,%201.8V,%2064Mb,%20v1.5.pdf
+[FE1.1 USB 2.0 hub]: https://cdn-shop.adafruit.com/product-files/2991/FE1.1s+Data+Sheet+(Rev.+1.0).pdf
+[flashrom]: https://flashrom.org/Flashrom
diff --git a/Documentation/mainboard/protectli/fw4b.jpg b/Documentation/mainboard/protectli/fw4b.jpg
new file mode 100644
index 0000000000..98548eae1b
Binary files /dev/null and b/Documentation/mainboard/protectli/fw4b.jpg differ
diff --git a/Documentation/mainboard/protectli/fw6.jpg b/Documentation/mainboard/protectli/fw6.jpg
new file mode 100644
index 0000000000..0c0b46d5a7
Binary files /dev/null and b/Documentation/mainboard/protectli/fw6.jpg differ
diff --git a/Documentation/mainboard/protectli/fw6.md b/Documentation/mainboard/protectli/fw6.md
new file mode 100644
index 0000000000..86449d1cf1
--- /dev/null
+++ b/Documentation/mainboard/protectli/fw6.md
@@ -0,0 +1,137 @@
+# Protectli Vault FW6 series
+
+This page describes how to run coreboot on the [Protectli FW6].
+
+
+
+## Required proprietary blobs
+
+To build a minimal working coreboot image some blobs are required (assuming
+only the BIOS region is being modified).
+
+```eval_rst
++-----------------+---------------------------------+---------------------+
+| Binary file | Apply | Required / Optional |
++=================+=================================+=====================+
+| FSP-M, FSP-S | Intel Firmware Support Package | Required |
++-----------------+---------------------------------+---------------------+
+| microcode | CPU microcode | Required |
++-----------------+---------------------------------+---------------------+
+| vgabios | VGA Option ROM | Optional |
++-----------------+---------------------------------+---------------------+
+```
+
+FSP-M and FSP-S are obtained after splitting the Kaby Lake FSP binary (done
+automatically by the coreboot build system and included into the image) from
+the `3rdparty/fsp` submodule.
+
+Microcode updates are automatically included into the coreboot image by build
+system from the `3rdparty/intel-microcode` submodule.
+
+VGA Option ROM is not required to boot, but if one needs graphics in pre-OS
+stage, it should be included (if not using libgfxinit).
+
+## Flashing coreboot
+
+### Internal programming
+
+The main SPI flash can be accessed using [flashrom]. The first version
+supporting the chipset is flashrom v1.1. Firmware an be easily flashed
+with internal programmer (either BIOS region or full image).
+
+### External programming
+
+The system has an internal flash chip which is a 8 MiB soldered SOIC-8 chip.
+This chip is located on the bottom side of the case (the radiator side). One
+has to remove all screws (in order): 4 top cover screws, 4 side cover screws
+(one side is enough), 4 mainboard screws, 4 CPU screws (under DIMMs). Lift up
+the mainboard and turn around it. The flash chip is near the SoC on the DIMM
+slots side. Use a clip (or solder the wires) to program the chip. Specifically,
+it's a Macronix MX25L6406E (3.3V) -[datasheet][MX25L6406E].
+
+## Known issues
+
+- After flashing with external programmer it is always required to reset RTC
+ with jumper or disconnect coin cell temporarily. Only then the platform will
+ boot after flashing.
+- FW6A does not always work reliably with all DIMMs. Linux happens to hang or
+ gives many panics. This issue was present also with vendor BIOS.
+- Sometimes FSPMemoryInit return errors or hangs (especially with 2 DIMMs
+ connected). A workaround is to power cycle the board (even a few times) or
+ temporarily disconnect DIMM when platform is powered off.
+- When using libgfxinit and SeaBIOS bootsplash, the red color is dim
+
+## Untested
+
+Not all mainboard's peripherals and functions were tested because of lack of
+the cables or not being populated on the board case.
+
+- Internal USB 2.0 headers
+- Boot with cleaned ME
+
+## Working
+
+- USB 3.0 front ports (SeaBIOS and Linux)
+- 6 Ethernet ports
+- HDMI port with libgfxinit and VGA Option ROM
+- flashrom
+- PCIe WiFi
+- SATA and mSATA
+- Super I/O serial port 0 (RS232 via front RJ45 connector)
+- SMBus (reading SPD from DIMMs)
+- Initialization with KBL FSP 2.0 (with MemoryInit issues)
+- SeaBIOS payload (version rel-1.12.1)
+- Mini PCIe debug card connected to mSATA (mSATA slot has LPC signals routed)
+- Reset switch
+- Booting Debian, Ubuntu, FreeBSD
+
+## Technology
+
+There are 3 variants of FW6 boards: FW6A, FW6B and FW6C. They differ only in
+used SoC.
+
+- FW6A:
+
+```eval_rst
++------------------+--------------------------------------------------+
+| CPU | Intel Celeron 3865U |
++------------------+--------------------------------------------------+
+| PCH | Kaby Lake U w/ iHDCP2.2 Base |
++------------------+--------------------------------------------------+
+| Super I/O, EC | ITE IT8772E |
++------------------+--------------------------------------------------+
+| Coprocessor | Intel Management Engine |
++------------------+--------------------------------------------------+
+```
+
+- FW6B:
+
+```eval_rst
++------------------+--------------------------------------------------+
+| CPU | Intel Core i3-7100U |
++------------------+--------------------------------------------------+
+| PCH | Kaby Lake U w/ iHDCP2.2 Premium |
++------------------+--------------------------------------------------+
+| Super I/O, EC | ITE IT8772E |
++------------------+--------------------------------------------------+
+| Coprocessor | Intel Management Engine |
++------------------+--------------------------------------------------+
+```
+
+- FW6C:
+
+```eval_rst
++------------------+--------------------------------------------------+
+| CPU | Intel Core i5-7200U |
++------------------+--------------------------------------------------+
+| PCH | Kaby Lake U w/ iHDCP2.2 Premium |
++------------------+--------------------------------------------------+
+| Super I/O, EC | ITE IT8772E |
++------------------+--------------------------------------------------+
+| Coprocessor | Intel Management Engine |
++------------------+--------------------------------------------------+
+```
+
+[Protectli FW6]: https://protectli.com/vault-6-port/
+[MX25L6406E]: https://www.macronix.com/Lists/Datasheet/Attachments/7370/MX25L6406E,%203V,%2064Mb,%20v1.9.pdf
+[flashrom]: https://flashrom.org/Flashrom
diff --git a/Documentation/northbridge/intel/sandybridge/me_cleaner.md b/Documentation/northbridge/intel/sandybridge/me_cleaner.md
index 1086e7e091..b457dcdd3c 100644
--- a/Documentation/northbridge/intel/sandybridge/me_cleaner.md
+++ b/Documentation/northbridge/intel/sandybridge/me_cleaner.md
@@ -5,7 +5,7 @@ from the ME firmware partition. In this state the ME errors out and doesn't
operate any more.
**Using a 'cleaned' ME partition may lead to issues and its use should be
-carefully evaulated.**
+carefully evaluated.**
## Observations with 'cleaned' ME
@@ -18,3 +18,67 @@ carefully evaulated.**
Always test with unmodified IFD and ME section before reporting bugs to the
coreboot project.
+
+## Tutorial reducing the Intel ME firmware size
+
+By default the cleaned ME firmware will still occupy the same space in
+the firmware image. It's possible to change the firmware partition layout
+and reclaim the space for the use by coreboot.
+With the reduced Intel ME firmware the `ifd`, `gbe` and `me` regions require
+less than 128 KiB of space in the ROM, which leaves the remaining for the
+`bios` region.
+
+This tutorial will guide you through the steps necessary.
+
+### 1. Obtain a full ROM
+
+You need a full and working ROM with a full Intel ME firmware.
+
+### 2. Running me_cleaner
+
+You need to run the *me_cleaner* on a full ROM, here called `fulldump.rom`:
+The full ROM contains:
+* IFD
+* fully working Intel ME
+* GbE (optional)
+* BIOS (any firmware)
+
+Running the command will generate two new files:
+```console
+./util/me_cleaner/me_cleaner.py -D patched_desciptor.bin -M stripped_me.bin fulldump.rom -t -r -S
+```
+
+The generated files are:
+* a patched IFD called `patched_desciptor.bin`
+* stripped Intel ME called `stripped_me.bin`
+
+The patched IFD has the *AltMeDisable* bit set and a modified flash layout.
+
+
+*Note:* coreboot allows to select `CONFIG_ME_CLEANER` as part of the
+build-process, but that doesn't rework the flash layout, it only removes
+files from ME and sets the *AltMeDisable*-bit.
+
+### 3. Build coreboot
+
+1. Now include the two new files from the previous step into coreboot's
+ build system.
+2. Make sure to also increase the CBFS size
+ * 0x7E0000 for a 8MiB ROM
+ * 0xBE0000 for a 12MiB ROM
+ * 0xFE0000 for a 16MiB ROM
+3. Make sure to **not** enable me_cleaner in Kconfig again as
+ you have already run it
+
+### 4. Flashing the ROM
+
+As you have modified the layout you need to write the **full ROM** to flash
+using an [external programmer].
+Make sure to include all partitions into the ROM:
+* IFD
+* EC (might be unused)
+* GbE (might be unused)
+* ME
+* BIOS
+
+[external programmer]: ../../../flash_tutorial/index.md
diff --git a/Documentation/payloads.md b/Documentation/payloads.md
index b1eae615ec..eee841eacd 100644
--- a/Documentation/payloads.md
+++ b/Documentation/payloads.md
@@ -40,3 +40,15 @@ availability of well-tested, battle-hardened drivers (as compared to
firmware project drivers that often reinvent the wheel) and the ability to
define boot policy with familiar tools, no matter if those are shell scripts
or compiled userland programs written in C, Go or other programming languages.
+
+## Heads
+
+[Heads] is a distribution that bundles coreboot, Linux, busybox and custom
+tools to provide reproducible ROMs. [Heads] aims to provide a secure and
+flexible boot environment for laptops and servers.
+It supports features like measured boot, kexec, GPG, OTP, TLS, firmware
+updates, but only works on a limited amount of mainboards.
+For more details have a look at [heads-wiki].
+
+[Heads]: https://github.com/osresearch/heads
+[heads-wiki]: http://osresearch.net/
\ No newline at end of file
diff --git a/Documentation/releases/checklist.md b/Documentation/releases/checklist.md
index 706d08e379..ea05c2036a 100644
--- a/Documentation/releases/checklist.md
+++ b/Documentation/releases/checklist.md
@@ -68,6 +68,7 @@ be more frequent than was needed, so we scaled it back to twice a year.
- [ ] Test the commit selected for release.
- [ ] Update release notes with actual commit id, push to repo.
- [ ] Run release script.
+- [ ] Run vboot_list script.
- [ ] Test the release from the actual release tarballs.
- [ ] Push signed Tag to repo.
- [ ] Announce that the release tag is done on IRC.
diff --git a/Documentation/releases/coreboot-4.11-relnotes.md b/Documentation/releases/coreboot-4.11-relnotes.md
index 890c2d7c36..f26de27104 100644
--- a/Documentation/releases/coreboot-4.11-relnotes.md
+++ b/Documentation/releases/coreboot-4.11-relnotes.md
@@ -175,7 +175,7 @@ of becoming more generally useful.
Payload integration has been updated, coreinfo learned to cope with
UPPER CASE commands and libpayload knows how to deal with USB3 hubs.
-### Added VBOOT support to the following platforms:
+### Added vboot support to the following platforms:
* intel/gm45
* intel/nehalem
diff --git a/Documentation/releases/coreboot-4.12-relnotes.md b/Documentation/releases/coreboot-4.12-relnotes.md
index 7943aa7161..b172c4a92e 100644
--- a/Documentation/releases/coreboot-4.12-relnotes.md
+++ b/Documentation/releases/coreboot-4.12-relnotes.md
@@ -10,6 +10,69 @@ notes.
* The chip and board additions and removals will be updated right
before the release, so those do not need to be added.
+Deprecations
+------------
+
+For the 4.12 release a few features on x86 became mandatory. These are
+relocatable ramstage, postcar stage and C_ENVIRONMENT_BOOTBLOCK.
+
+### Relocatable ramstage
+
+Relocatable stages are a feature implemented only on x86, where stages
+can be relocated at runtime. This is used to place ramstage in a better
+location that does not collide with memory the OS or the payload tends
+to use. The rationale behind making this mandatory is that you always
+want cbmem to be cached so it's a good location to run ramstage from.
+It avoids using lower memory altogether so the OS can make use of it
+and no backing up needs to happen on S3 resume.
+
+### Postcar stage
+
+With Postcar stage tearing down Cache-as-Ram is done in a separate
+stage. This means that romstage has a clean program boundary and
+that all variables in romstage can be accessed via their linked
+addresses without runtime resolution. There is no need to link
+global and static variables via the CAR\_GLOBAL macro and no need
+to access them with car\_set/get\_var/ptr functions.
+
+### C\_ENVIRONMENT\_BOOTBLOCK
+
+Historically the bootblock on x86 platforms has been compiled with
+romcc. This means that the generated code only uses CPU registers
+and therefore no stack. This 20K+ LOC compiler is limited and hard
+to maintain and so is the code that one has to write in that
+environment. A different solution is to set up Cache-as-Ram in the
+bootblock and run GCC compiled code in the bootblock. The advantages
+are increased flexibility and consistency with other architectures as
+well as other stages: e.g. printing to console is possible and
+VBOOT can run before romstage, making romstage updatable via RW FMAP
+regions.
+
+### Platforms dropped from master
+
+The following platforms did not implement those feature are dropped
+from master to allow the master branch to move on:
+- AMDFAM10
+- all FSP1.0 platforms: BROADWELL_DE, FSP_BAYTRAIL, RANGELEY
+- VIA VX900
+- TODO (AMD?)
+
+In particular on FSP1.0 it is impossible to implement POSTCAR stage.
+The reason is that FSP1.0 relocates the CAR region to the HOB before
+returning to coreboot. This means that after FSP returns to coreboot
+accessing variables via their original address is not possible. One
+way of obtaining that behavior would be to set up Cache-as-Ram again
+(but with open source code) and copy the relocated data from the HOB
+there. This solution is deemed too hacky. Maybe a lesson can be
+learned from this: blobs should not interfere with the execution
+environment, as this makes proper integration much harder.
+
+### 4.11_branch
+
+Given that some platforms supported by FSP1.0 are being produced and
+popular, the 4.11 release was made into a branch in which further
+development can happen.
+
Significant changes
-------------------
diff --git a/Documentation/releases/coreboot-4.5-relnotes.md b/Documentation/releases/coreboot-4.5-relnotes.md
index 8b649991a1..12230b298b 100644
--- a/Documentation/releases/coreboot-4.5-relnotes.md
+++ b/Documentation/releases/coreboot-4.5-relnotes.md
@@ -73,7 +73,7 @@ Areas with significant updates
### Vendorcode
* AMD (14 commits) - Cleanup, add libagesa.a builds, remove unused code.
-* Google (22 commits) - VBoot2 updates and cleanup
+* Google (22 commits) - vboot2 updates and cleanup
* Intel (86 commits) - Add Intel FSP 2.0, update Broadwell DE support
### Payloads (37 commits)
diff --git a/Documentation/releases/coreboot-4.6-relnotes.md b/Documentation/releases/coreboot-4.6-relnotes.md
index faa3303b4c..6151b2c3fd 100644
--- a/Documentation/releases/coreboot-4.6-relnotes.md
+++ b/Documentation/releases/coreboot-4.6-relnotes.md
@@ -164,7 +164,7 @@ Drivers (29 commits)
* i2c/hid: Add generic I2C HID driver
* i2c/max98927: add i2c driver for Maxim 98927 codec
* i2c/wacom_ts: Add support for WCOM touchscreen device driver
-* pc80/rtc: Check cmos checksum BEFORE reading cmos value
+* pc80/rtc: Check CMOS checksum BEFORE reading CMOS value
* regulator: Add driver for handling GPIO-based fixed regulator
* storage: Add SD/MMC/eMMC driver based upon depthcharge
@@ -180,7 +180,7 @@ SuperIO (12 commits)
* Add 2 new chips
* Consolidate code to use common routines
-Vboot (23 commits)
+vboot (23 commits)
* Add support for recovery hash space in TPM
RISC-V (25 commits)
diff --git a/Documentation/releases/coreboot-4.8.1-relnotes.md b/Documentation/releases/coreboot-4.8.1-relnotes.md
index 8a6ab964e8..14f1068a34 100644
--- a/Documentation/releases/coreboot-4.8.1-relnotes.md
+++ b/Documentation/releases/coreboot-4.8.1-relnotes.md
@@ -40,7 +40,7 @@ possible
Lenovo mainboards
-----------------
-* Started integration of VBT (Video Bios Table) binary files to
+* Started integration of VBT (Video BIOS Table) binary files to
support native graphics initialisation
Internal changes
@@ -77,7 +77,7 @@ Security
--------
* Start of refactoring the TPM software stack
* Introduced coreboot security section in kconfig
-* VBoot & TPM code moved into src/security
+* vboot & TPM code moved into src/security
Intelmetool
-----------
diff --git a/Documentation/security/vboot/index.md b/Documentation/security/vboot/index.md
index 400c2b5149..faa8cb8561 100644
--- a/Documentation/security/vboot/index.md
+++ b/Documentation/security/vboot/index.md
@@ -12,6 +12,8 @@ Google's verified boot support consists of:
Google's vboot verifies the firmware and places measurements within the TPM.
+- [List of supported Devices](list_vboot.md)
+
***
## Root of Trust
@@ -194,7 +196,7 @@ not into the read/write coreboot file systems in *FW_MAIN_A* and *FW_MAIN_B*.
**VBOOT_ENABLE_CBFS_FALLBACK**
Normally coreboot will use the active read/write coreboot file system for all
-of it's file access when VBOOT is active and is not in recovery mode.
+of it's file access when vboot is active and is not in recovery mode.
When the `VBOOT_ENABLE_CBFS_FALLBACK` option is enabled the cbfs file system will
first try to locate a file in the active read/write file system. If the file
@@ -229,7 +231,7 @@ More details are available in `3rdparty/vboot/README`.
# The keys were made using the following command
#
# 3rdparty/vboot/scripts/keygeneration/create_new_keys.sh \
-# --4k --4k-root --output $PWD/keys
+# --output $PWD/keys
#
#
# The "magic" numbers below are derived from the GBB section in
diff --git a/Documentation/security/vboot/list_vboot.md b/Documentation/security/vboot/list_vboot.md
new file mode 100644
index 0000000000..6b41597f18
--- /dev/null
+++ b/Documentation/security/vboot/list_vboot.md
@@ -0,0 +1,223 @@
+# vboot-enabled devices
+
+## Emulation
+- QEMU x86 i440fx/piix4 (aka qemu -M pc)
+- QEMU x86 q35/ich9 (aka qemu -M q35, since v1.4)
+
+## Facebook
+- Facebook Monolith
+
+## Google
+- Auron_Paine (Acer C740 Chromebook)
+- Auron_Yuna (Acer Chromebook 15 (C910/CB5-531))
+- Buddy (Acer Chromebase 24)
+- Gandof (Toshiba Chromebook 2 (2015))
+- Lulu (Dell Chromebook 13 7310)
+- Samus (Google Chromebook Pixel (2015))
+- Mccloud (Acer Chromebox CXI)
+- Monroe (LG Chromebase 22CV241 & 22CB25S)
+- Panther (ASUS Chromebox CN60)
+- Tricky (Dell Chromebox 3010)
+- Zako (HP Chromebox G1)
+- Butterfly (HP Pavilion Chromebook 14)
+- Cheza
+- Banon (Acer Chromebook 15 (CB3-532))
+- Celes (Samsung Chromebook 3)
+- Cyan (Acer Chromebook R11 (C738T))
+- Edgar (Acer Chromebook 14 (CB3-431))
+- Kefka (Dell Chromebook 11 3180/3189)
+- Reks (Lenovo N22/N42 Chromebook)
+- Relm
+- Setzer (HP Chromebook 11 G5)
+- Terra (ASUS Chromebook C202SA/C300SA/C301SA)
+- Ultima (Lenovo Yoga 11e G3)
+- Wizpig
+- Daisy (Samsung Chromebook (2012))
+- DragonEgg
+- Drallion
+- Eve (Google Pixelbook)
+- Fizz
+- Karma
+- Endeavour
+- Foster
+- Gale (Google WiFi)
+- Asuka (Dell Chromebook 13 3380)
+- Caroline (Samsung Chromebook Pro)
+- Cave (Asus Chromebook Flip C302SA)
+- Chell (HP Chromebook 13 G1)
+- Glados Skylake Reference Board
+- Lars (Acer Chromebook 14 for Work (CP5-471))
+- Sentry (Lenovo Thinkpad 13 Chromebook)
+- Kevin (Samsung Chromebook Plus)
+- Gru
+- Bob (Asus Chromebook Flip C101PA)
+- Scarlet
+- Nefario
+- Rainier
+- Akemi
+- Dratini
+- Hatch
+- Jinlon
+- Kohaku
+- Kindred
+- Helios
+- Mushu
+- Palkia
+- Nightfury
+- Puff
+- Helios_Diskswap
+- Stryke
+- Guado (ASUS Chromebox CN62)
+- Jecht
+- Rikku (Acer Chromebox CXI2)
+- Tidus (Lenovo ThinkCentre Chromebox)
+- Aleena
+- Careena
+- Grunt
+- Liara
+- Nuwani
+- Treeya
+- Kukui
+- Krane
+- Kodama
+- Kakadu
+- Flapjack
+- Jacuzzi
+- Juniper
+- Kappa
+- Damu
+- Link (Google Chromebook Pixel (2013))
+- Mistral
+- Nyan
+- Nyan Big (Acer Chromebook 13 (CB5-311))
+- Nyan Blaze (HP Chromebook 14 G3)
+- Oak
+- Elm (Acer Chromebook R13)
+- Hana (Lenovo N23 Yoga Chromebook)
+- Parrot (Acer C7/C710 Chromebook)
+- Peach Pit (Samsung Chromebook 2 11\")
+- Atlas
+- Poppy
+- Nami
+- Nautilus
+- Nocturne
+- Rammus
+- Soraka
+- Banjo (Acer Chromebook 15 (CB3-531))
+- Candy (Dell Chromebook 11 3120)
+- Clapper (Lenovo N20 Chromebook)
+- Enguarde
+- Glimmer (Lenovo ThinkPad 11e Chromebook)
+- Gnawty (Acer Chromebook 11 (CB3-111/131,C730/C730E/C735))
+- Heli (Haier Chromebook G2)
+- Kip (HP Chromebook 11 G3 / G4 / G4 EE)
+- Ninja (AOpen Chromebox Commercial)
+- Orco (Lenovo 100S Chromebook)
+- Quawks (ASUS Chromebook C300)
+- Squawks (ASUS Chromebook C200)
+- Rambi
+- Sumo (AOpen Chromebase Commercial)
+- Swanky (Toshiba Chromebook 2)
+- Winky (Samsung Chromebook 2 (XE500C12))
+- Reef/Electro (Acer Chromebook Spin 11 R751T)
+- Pyro (Lenovo Thinkpad (Yoga) 11e Chromebook)
+- Sand (Acer Chromebook 15 CB515-1HT/1H)
+- Snappy (HP Chromebook x360 11 G1 EE)
+- Nasher
+- Coral
+- Arcada
+- Sarien
+- Falco (HP Chromebook 14)
+- Leon (Toshiba Chromebook)
+- Peppy (Acer C720/C720P Chromebook)
+- Wolf (Dell Chromebook 11)
+- Smaug (Google Pixel C)
+- Storm (OnHub Router TGR1900)
+- Stout (Lenovo Thinkpad X131e Chromebook)
+- Trogdor
+- Veyron_Jaq (Haier Chromebook 11)
+- Veyron_Jerry (Hisense Chromebook 11)
+- Veyron_Mighty (Haier Chromebook 11(edu))
+- Veyron_Minnie (ASUS Chromebook Flip C100)
+- Veyron_Speedy (ASUS C201 Chromebook)
+- Veyron_Mickey (Asus Chromebit CS10)
+- Veyron_Rialto
+
+## HP
+- Z220 SFF Workstation
+
+## Intel
+- Basking Ridge CRB
+- Cannonlake U LPDDR4 RVP
+- Cannonlake Y LPDDR4 RVP
+- Coffeelake U SO-DIMM DDR4 RVP
+- Coffeelake H SO-DIMM DDR4 RVP11
+- Whiskeylake U DDR4 RVP
+- Coffeelake S U-DIMM DDR4 RVP8
+- Cometlake U DDR4 RVP
+- Emerald Lake 2 CRB
+- Galileo
+- Glkrvp
+- Icelake U DDR4/LPDDR4 RVP
+- Icelake Y LPDDR4 RVP
+- Jasperlake DDR4/LPDDR4 RVP
+- Jasperlake DDR4/LPDDR4 RVP with Chrome EC
+- Kabylake LPDDR3 RVP3
+- Kabylake DDR3L RVP7
+- Kabylake DDR4 RVP8
+- Kabylake DDR4 RVP11
+- Kunimitsu
+- Strago
+- Tigerlake UP3 RVP
+- Tigerlake UP4 RVP
+- Whitetip Mountain 2 CRB
+
+## Lenovo
+- ThinkPad T400
+- ThinkPad T500
+- ThinkPad R400
+- ThinkPad R500
+- ThinkPad W500
+- ThinkPad T410
+- ThinkPad T420
+- ThinkPad T420s
+- ThinkPad T430
+- ThinkPad T430s
+- ThinkPad T431s
+- ThinkPad T440p
+- ThinkPad T520
+- ThinkPad W520
+- ThinkPad T530
+- ThinkPad W530
+- ThinkPad X131e
+- ThinkPad X1 carbon gen 1
+- ThinkPad X200 / X200s / X200t
+- ThinkPad X301
+- ThinkPad X201 / X201i / X201s / X201t
+- ThinkPad X220
+- ThinkPad X220i
+- ThinkPad X1
+- ThinkPad X230
+- ThinkPad X230t
+
+## OpenCellular
+- Elgon (GBCv2)
+
+## SAMSUNG
+- Lumpy
+- Stumpy
+
+## Siemens
+- MC APL1
+- MC APL2
+- MC APL3
+- MC APL4
+- MC APL5
+- MC APL6
+
+## Supermicro
+- X11SSH-TF
+- X11SSM-F
+
+## UP
+- Squared
diff --git a/Documentation/security/vboot/measured_boot.md b/Documentation/security/vboot/measured_boot.md
index 45d66dd2d2..df4cc68008 100644
--- a/Documentation/security/vboot/measured_boot.md
+++ b/Documentation/security/vboot/measured_boot.md
@@ -120,12 +120,12 @@ PCR-7 are left empty.
### PCR-0
_Hash:_ SHA1
-_Description:_ Google VBoot GBB flags.
+_Description:_ Google vboot GBB flags.
### PCR-1
_Hash:_ SHA1/SHA256
-_Description:_ Google VBoot GBB HWID.
+_Description:_ Google vboot GBB HWID.
### PCR-2
_Hash:_ SHA1/SHA256
diff --git a/Documentation/soc/amd/psp_integration.md b/Documentation/soc/amd/psp_integration.md
index 5f53a39f05..9c7b1be404 100755
--- a/Documentation/soc/amd/psp_integration.md
+++ b/Documentation/soc/amd/psp_integration.md
@@ -37,38 +37,40 @@ any of the eligible locations. Below are typical definitions within the
structure (for all families combined). Individual features supported vary by
family and model.
- +--------------+---------------+------------------+----------------------------+
- | Field Name | Offset (Hex) | Size (In Bytes) | Description/Purpose |
- +--------------+---------------+------------------+----------------------------+
- | Signature | 0x00 | 4 | 0x55aa55aa |
- |--------------|---------------|------------------|----------------------------|
- | IMC FW | 0x04 | 4 | Integrated Micro |
- | | | | Controller: unsupported |
- | | | | but functional in some |
- | | | | systems |
- |--------------|---------------|------------------|----------------------------|
- | GbE FW | 0x08 | 4 | Gigabit Ethernet |
- |--------------|---------------|------------------|----------------------------|
- | xHCI FW | 0x0c | 4 | xHCI firmware |
- |--------------|---------------|------------------|----------------------------|
- | PSP Dir Tbl | 0x10 | 4 | Pointer to PSP Directory |
- | | | | Table (early devices) |
- |--------------|---------------|------------------|----------------------------|
- | PSP Dir Tbl | 0x14 | 4 | Pointer to PSP Directory |
- | | | | Table (later devices and |
- | | | | is combo capable) |
- |--------------|---------------|------------------|----------------------------|
- | BIOS Dir Tbl | 0x18 | 4 | Pointer to BIOS Directory |
- | | | | Table for models n* |
- |--------------|---------------|------------------|----------------------------|
- | BIOS Dir Tbl | 0x1c | 4 | Pointer to BIOS Directory |
- | | | | Table for models nn |
- |--------------|---------------|------------------|----------------------------|
- | BIOS Dir Tbl | 0x20 | 4 | Pointer to BIOS Directory |
- | | | | Table for models nnn |
- |--------------|---------------|------------------|----------------------------|
- | … | | | ... |
- +--------------+---------------+------------------+----------------------------+
+```eval_rst
++--------------+---------------+------------------+----------------------------+
+| Field Name | Offset (Hex) | Size (In Bytes) | Description/Purpose |
++==============+===============+==================+============================+
+| Signature | 0x00 | 4 | 0x55aa55aa |
++--------------+---------------+------------------+----------------------------+
+| IMC FW | 0x04 | 4 | Integrated Micro |
+| | | | Controller: unsupported |
+| | | | but functional in some |
+| | | | systems |
++--------------+---------------+------------------+----------------------------+
+| GbE FW | 0x08 | 4 | Gigabit Ethernet |
++--------------+---------------+------------------+----------------------------+
+| xHCI FW | 0x0c | 4 | xHCI firmware |
++--------------+---------------+------------------+----------------------------+
+| PSP Dir Tbl | 0x10 | 4 | Pointer to PSP Directory |
+| | | | Table (early devices) |
++--------------+---------------+------------------+----------------------------+
+| PSP Dir Tbl | 0x14 | 4 | Pointer to PSP Directory |
+| | | | Table (later devices and |
+| | | | is combo capable) |
++--------------+---------------+------------------+----------------------------+
+| BIOS Dir Tbl | 0x18 | 4 | Pointer to BIOS Directory |
+| | | | Table for models n* |
++--------------+---------------+------------------+----------------------------+
+| BIOS Dir Tbl | 0x1c | 4 | Pointer to BIOS Directory |
+| | | | Table for models nn |
++--------------+---------------+------------------+----------------------------+
+| BIOS Dir Tbl | 0x20 | 4 | Pointer to BIOS Directory |
+| | | | Table for models nnn |
++--------------+---------------+------------------+----------------------------+
+| … | | | ... |
++--------------+---------------+------------------+----------------------------+
+```
* The Embedded Firmware Structure may support pointers to multiple generations
of devices, e.g. Family 17h Models 00h-0Fh, Family 17h Models 10h-1Fh, etc.
@@ -83,46 +85,47 @@ allowing secondary tables to be referenced by device ID. No coreboot
implementations currently use combo tables.
### PSP Directory Table Header
-
- +--------------+---------------+------------------+----------------------------+
- | Field Name | Offset (Hex) | Size (In Bytes) | Description/Purpose |
- +--------------+---------------+------------------+----------------------------+
- | PSP Cookie | 0x00 | 4 | PSP cookie "$PSP" to |
- | | | | recognize the header. |
- | | | | Cookie “$PL2” for level 2 |
- |--------------|---------------|------------------|----------------------------|
- | Checksum | 0x04 | 4 | 32-bit CRC value of header |
- | | | | below this field and |
- | | | | including all entries |
- |--------------|---------------|------------------|----------------------------|
- | Total Entries| 0x08 | 4 | Number of PSP Directory |
- | | | | entries in the table |
- |--------------|---------------|------------------|----------------------------|
- | Reserved | 0x0C | 4 | Reserved - Set to zero |
- +--------------+---------------+------------------+----------------------------+
+```eval_rst
++--------------+---------------+------------------+----------------------------+
+| Field Name | Offset (Hex) | Size (In Bytes) | Description/Purpose |
++==============+===============+==================+============================+
+| PSP Cookie | 0x00 | 4 | PSP cookie "$PSP" to |
+| | | | recognize the header. |
+| | | | Cookie “$PL2” for level 2 |
++--------------+---------------+------------------+----------------------------+
+| Checksum | 0x04 | 4 | 32-bit CRC value of header |
+| | | | below this field and |
+| | | | including all entries |
++--------------+---------------+------------------+----------------------------+
+| Total Entries| 0x08 | 4 | Number of PSP Directory |
+| | | | entries in the table |
++--------------+---------------+------------------+----------------------------+
+| Reserved | 0x0C | 4 | Reserved - Set to zero |
++--------------+---------------+------------------+----------------------------+
+```
### PSP Directory Table Entries
-
- +--------------+---------------+------------------+----------------------------+
- | Field Name | Offset (Hex) | Size (In Bits) | Description/Purpose |
- +--------------+---------------+------------------+----------------------------+
- | Type | 0x00 | 8 | Entry type (see below) |
- |--------------|---------------|------------------|----------------------------|
- | Sub Program | 0x01 | 8 | Specifies sub program |
- |--------------|---------------|------------------|----------------------------|
- | Reserved | 0x02 | 16 | Reserved - set to 0 |
- |--------------|---------------|------------------|----------------------------|
- | Size | 0x04 | 32 | Size of PSP entry in bytes |
- |--------------|---------------|------------------|----------------------------|
- | Location / | 0x08 | 64 | Location: Physical Address |
- | Value | | | of SPIROM location where |
- | | | | corresponding PSP entry |
- | | | | located. |
- | | | | |
- | | | | Value: 64-bit value for the|
- | | | | PSP Entry |
- +--------------+---------------+------------------+----------------------------+
-
+```eval_rst
++--------------+---------------+------------------+----------------------------+
+| Field Name | Offset (Hex) | Size (In Bits) | Description/Purpose |
++==============+===============+==================+============================+
+| Type | 0x00 | 8 | Entry type (see below) |
++--------------+---------------+------------------+----------------------------+
+| Sub Program | 0x01 | 8 | Specifies sub program |
++--------------+---------------+------------------+----------------------------+
+| Reserved | 0x02 | 16 | Reserved - set to 0 |
++--------------+---------------+------------------+----------------------------+
+| Size | 0x04 | 32 | Size of PSP entry in bytes |
++--------------+---------------+------------------+----------------------------+
+| Location / | 0x08 | 64 | Location: Physical Address |
+| Value | | | of SPIROM location where |
+| | | | corresponding PSP entry |
+| | | | located. |
+| | | | |
+| | | | Value: 64-bit value for the|
+| | | | PSP Entry |
++--------------+---------------+------------------+----------------------------+
+```
### PSP Directory Table Types
**0x00**: AMD public key
@@ -248,68 +251,72 @@ The BIOS Directory table structure is slightly different from the PSP Directory:
### BIOS Directory Table Header
- +--------------+---------------+------------------+----------------------------+
- | Field Name | Offset (Hex) | Size (In Bytes) | Description/Purpose |
- +--------------+---------------+------------------+----------------------------+
- | BIOS Cookie | 0x00 | 4 | BIOS cookie "$BHD" to |
- | | | | recognize the header. |
- | | | | Cookie “$BL2” for level 2 |
- |--------------|---------------|------------------|----------------------------|
- | Checksum | 0x04 | 4 | 32 bit CRC value of header |
- | | | | below this field and |
- | | | | including all entries |
- |--------------|---------------|------------------|----------------------------|
- | Total Entries| 0x08 | 4 | Number of BIOS Directory |
- | | | | entries in the table |
- |--------------|---------------|------------------|----------------------------|
- | Reserved | 0x0C | 4 | Reserved - Set to zero |
- +--------------+---------------+------------------+----------------------------+
+```eval_rst
++--------------+---------------+------------------+----------------------------+
+| Field Name | Offset (Hex) | Size (In Bytes) | Description/Purpose |
++==============+===============+==================+============================+
+| BIOS Cookie | 0x00 | 4 | BIOS cookie "$BHD" to |
+| | | | recognize the header. |
+| | | | Cookie “$BL2” for level 2 |
++--------------+---------------+------------------+----------------------------+
+| Checksum | 0x04 | 4 | 32 bit CRC value of header |
+| | | | below this field and |
+| | | | including all entries |
++--------------+---------------+------------------+----------------------------+
+| Total Entries| 0x08 | 4 | Number of BIOS Directory |
+| | | | entries in the table |
++--------------+---------------+------------------+----------------------------+
+| Reserved | 0x0C | 4 | Reserved - Set to zero |
++--------------+---------------+------------------+----------------------------+
+```
### BIOS Directory Table Entries
- +--------------+---------------+------------------+----------------------------+
- | Field Name | Offset (Hex) | Size (In Bits) | Description/Purpose |
- +--------------+---------------+------------------+----------------------------+
- | Type | 0x00 | 8 | Entry type (see below) |
- |--------------|---------------|------------------|----------------------------|
- | Region Type | 0x01 | 8 | Setup the memory region's |
- | | | | security attribute for the |
- | | | | BIOS entry |
- |--------------|---------------|------------------|----------------------------|
- | Reset Image | 0x02[0] | 1 | Boolean value to define the|
- | | | | BIOS entry is a reset |
- | | | | binary image |
- |--------------|---------------|------------------|----------------------------|
- | Copy Image | 0x02[1] | 1 | Define the binary image of |
- | | | | the BIOS entry is for |
- | | | | copying over to the memory |
- | | | | region |
- |--------------|---------------|------------------|----------------------------|
- | Read Only | 0x02[2] | 1 | Setup the memory region for|
- | | | | the BIOS entry to read only|
- |--------------|---------------|------------------|----------------------------|
- | Compressed | 0x02[3] | 1 | Compressed using zlib |
- | | | | |
- |--------------|---------------|------------------|----------------------------|
- | Instance | 0x02[7:4] | 4 | Specify the Instance of an |
- | | | | entry |
- |--------------|---------------|------------------|----------------------------|
- | SubProgram | 0x03[2:0] | 3 | Specify the SubProgram |
- |--------------|---------------|------------------|----------------------------|
- | Reserved | 0x03[7:3] | 5 | Reserved - Set to zero |
- |--------------|---------------|------------------|----------------------------|
- | Size | 0x04 | 32 | Memory Region Size |
- |--------------|---------------|------------------|----------------------------|
- | Source | 0x08 | 64 | Physical Address of SPIROM |
- | Address | | | location where the data for|
- | | | | the corresponding entry is |
- | | | | located |
- |--------------|---------------|------------------|----------------------------|
- | Destination | 0x10 | 64 | Destination Address of |
- | Address | | | memory location where the |
- | | | | data for the corresponding |
- | | | | BIOS Entry is copied |
- +--------------+---------------+------------------+----------------------------+
+```eval_rst
++--------------+---------------+------------------+----------------------------+
+| Field Name | Offset (Hex) | Size (In Bits) | Description/Purpose |
++==============+===============+==================+============================+
+| Type | 0x00 | 8 | Entry type (see below) |
++--------------+---------------+------------------+----------------------------+
+| Region Type | 0x01 | 8 | Setup the memory region's |
+| | | | security attribute for the |
+| | | | BIOS entry |
++--------------+---------------+------------------+----------------------------+
+| Reset Image | 0x02[0] | 1 | Boolean value to define the|
+| | | | BIOS entry is a reset |
+| | | | binary image |
++--------------+---------------+------------------+----------------------------+
+| Copy Image | 0x02[1] | 1 | Define the binary image of |
+| | | | the BIOS entry is for |
+| | | | copying over to the memory |
+| | | | region |
++--------------+---------------+------------------+----------------------------+
+| Read Only | 0x02[2] | 1 | Setup the memory region for|
+| | | | the BIOS entry to read only|
++--------------+---------------+------------------+----------------------------+
+| Compressed | 0x02[3] | 1 | Compressed using zlib |
+| | | | |
++--------------+---------------+------------------+----------------------------+
+| Instance | 0x02[7:4] | 4 | Specify the Instance of an |
+| | | | entry |
++--------------+---------------+------------------+----------------------------+
+| SubProgram | 0x03[2:0] | 3 | Specify the SubProgram |
++--------------+---------------+------------------+----------------------------+
+| Reserved | 0x03[7:3] | 5 | Reserved - Set to zero |
++--------------+---------------+------------------+----------------------------+
+| Size | 0x04 | 32 | Memory Region Size |
++--------------+---------------+------------------+----------------------------+
+| Source | 0x08 | 64 | Physical Address of SPIROM |
+| Address | | | location where the data for|
+| | | | the corresponding entry is |
+| | | | located |
++--------------+---------------+------------------+----------------------------+
+| Destination | 0x10 | 64 | Destination Address of |
+| Address | | | memory location where the |
+| | | | data for the corresponding |
+| | | | BIOS Entry is copied |
++--------------+---------------+------------------+----------------------------+
+```
### BIOS Directory Table Entry Types
diff --git a/Documentation/soc/intel/fit.md b/Documentation/soc/intel/fit.md
index 8b638f0433..553fef3c16 100644
--- a/Documentation/soc/intel/fit.md
+++ b/Documentation/soc/intel/fit.md
@@ -57,4 +57,4 @@ execution of the IA32 reset vector happens.
## References
* [Intel TXT LAB handout](https://downloadmirror.intel.com/18931/eng/Intel%20TXT%20LAB%20Handout.pdf)
-* [FIT bios specification](https://www.intel.com/content/dam/www/public/us/en/documents/guides/fit-bios-specification.pdf)
+* [FIT BIOS specification](https://www.intel.com/content/dam/www/public/us/en/documents/guides/fit-bios-specification.pdf)
diff --git a/Documentation/soc/intel/fsp/index.md b/Documentation/soc/intel/fsp/index.md
index 769b98b4fc..912c44beea 100644
--- a/Documentation/soc/intel/fsp/index.md
+++ b/Documentation/soc/intel/fsp/index.md
@@ -45,6 +45,11 @@ those are fixed. If possible a workaround is described here as well.
* Workaround: Disable internal UART manually after calling FSP
* Issue on public tracker: [Issue 10]
+### CoffeeLakeFsp
+* Disabling the internal graphics causes a crash in FSP-M
+ * 7.0.68.40 and older version
+ * Workaround: Set "tconfig->PanelPowerEnable = 0"
+ * Issue on public tracker: [Issue 49]
## Open Source Intel FSP specification
@@ -72,4 +77,5 @@ those are fixed. If possible a workaround is described here as well.
[Issue 22]: https://github.com/IntelFsp/FSP/issues/22
[Issue 35]: https://github.com/IntelFsp/FSP/issues/35
[Issue 41]: https://github.com/IntelFsp/FSP/issues/41
+[Issue 49]: https://github.com/IntelFsp/FSP/issues/49
diff --git a/Documentation/superio/common/pnp.md b/Documentation/superio/common/pnp.md
index 314cac27ed..3c17259e58 100644
--- a/Documentation/superio/common/pnp.md
+++ b/Documentation/superio/common/pnp.md
@@ -15,13 +15,13 @@ specification is still the main reference though.
Super I/O chips connected via LPC to the southbridge usually have their
I/O-mapped configuration interface with a size of two bytes at the base
-address 0x2e or 0x4e. Other PNP devices have their configuration
+address `0x2e` or `0x4e`. Other PNP devices have their configuration
interface at other addresses.
The two byte registers allow access to an indirect 256 bytes big
-register space that contains the configuration. By writing the index
-to the lower byte (e.g. 0x2e), you can access the register contents at
-that index by reading/writing the higher byte (e.g. 0x2f).
+register space that contains the configuration. By writing the index to
+the lower byte (e.g. `0x2e`), you can access the register contents at
+that index by reading/writing the higher byte (e.g. `0x2f`).
To prevent accidental changes of the Super I/O (SIO) configuration,
the SIOs need a configuration mode unlock sequence. After changing the
@@ -31,18 +31,18 @@ the configuration mode lock sequence.
## Logical device numbers (LDN)
Each PNP device can contain multiple logical devices. The bytes from
-0x00 to 0x2f in the indirect configuration register space are common
-for all LDNs, but some SIO chips require a certain LDN to be selected
-in order to write certain registers in there. An LDN gets selected by
-writing the LDN number to the LDN select register 0x07. Registers 0x30
-to 0xFF are specific to each LDN number.
+`0x00` to `0x2f` in the indirect configuration register space are common
+for all LDNs, but some SIO chips require a certain LDN to be selected in
+order to write certain registers in there. An LDN gets selected by
+writing the LDN number to the LDN select register `0x07`. Registers
+`0x30` to `0xff` are specific to each LDN number.
coreboot encodes the physical LDN number in the lower byte of the LDN
number.
### Virtual logical device numbers
-Register 0x30 is the LDN enable register and since it is an 8 bit
+Register `0x30` is the LDN enable register and since it is an 8 bit
register, it can contain up to 8 enable bits for different parts of
the functionality of that logical device. To set a certain enable bit
in one physical LDN, the concept of virtual LDNs was introduced.
@@ -54,7 +54,7 @@ part in the lower 3 bits of the higher byte of the LDN number.
## I/O resources
-Starting at register address 0x60, each LDN has 2 byte wide I/O base
+Starting at register address `0x60`, each LDN has 2 byte wide I/O base
address registers. The size of an I/O resource is always a power of
two.
@@ -67,29 +67,29 @@ number of LSBs being zero, which can also be zero if the LSB is a one,
the resource has N address bits and a size of 2\*\*N bytes. The mask
address is also the highest possible address to map the I/O region.
-A typical example for an I/O resource mask is 0x07f8 which is
-0b0000011111111000 in binary notation. The three LSBs are zeros here,
+A typical example for an I/O resource mask is `0x07f8` which is
+`0b0000011111111000` in binary notation. The three LSBs are zeros here,
so it's an eight byte I/O resource with three address offset bits
inside the resource. The highest base address it can be mapped to is
-0x07f8, so the region will end at 0x07ff.
+`0x07f8`, so the region will end at `0x07ff`.
The Super I/O datasheets typically contain the information about the
I/O resource masks. On most Super I/O chips the mask can also be found
-out by writing 0xffff to the corresponding I/O base address register
+out by writing `0xffff` to the corresponding I/O base address register
and reading back the value; since the lowest and highest bits are
hard-wired to zero according to the I/O resource size and maximal
possible I/O address, this gives the mask.
## IRQ resources
-Each physical LDN has up to two configurable interrupt request
-register pairs 0x70, 0x71 and 0x72, 0x73. Each pair can be configured
-to use a certain IRQ number. Writing 1 to 15 into the first register
+Each physical LDN has up to two configurable interrupt request register
+pairs `0x70`, `0x71` and `0x72`, `0x73`. Each pair can be configured to
+use a certain IRQ number. Writing 1 to 15 into the first register
selects the IRQ number generated by the corresponding IRQ source and
-enables IRQ generation; writing 0 to it disables the generation of
-IRQs for the source. The second register selects the IRQ type (level
-or edge) and IRQ level (high or low). For LPC SIOs the IRQ type is
-hard-wired to edge.
+enables IRQ generation; writing 0 to it disables the generation of IRQs
+for the source. The second register selects the IRQ type (level or edge)
+and IRQ level (high or low). For LPC SIOs the IRQ type is hard-wired to
+edge.
On the LPC bus a shared SERIRQ line is used to signal IRQs to the
host; the IRQ number gets encoded by the number of LPC clock cycles
@@ -106,7 +106,7 @@ number. The quiet mode is often broken.
## DRQ resources
Each physical LDN has two legacy ISA-style DMA request channel
-registers at 0x74 and 0x75. Those are only used for legacy devices
+registers at `0x74` and `0x75`. Those are only used for legacy devices
like parallel printer ports or floppy disk controllers.
Each device using LPC legacy DMA needs its own LDMA line to the host.
diff --git a/Documentation/superio/index.md b/Documentation/superio/index.md
index 053663b215..81287bb108 100644
--- a/Documentation/superio/index.md
+++ b/Documentation/superio/index.md
@@ -5,6 +5,7 @@ This section contains documentation about coreboot on specific SuperIOs.
## Nuvoton
- [NPCD378](nuvoton/npcd378.md)
+- [NCT5539D](nuvoton/nct5539d.md)
## Common
- [PNP devices](common/pnp.md)
diff --git a/Documentation/superio/nuvoton/nct5539d.md b/Documentation/superio/nuvoton/nct5539d.md
new file mode 100644
index 0000000000..e91ebc3abb
--- /dev/null
+++ b/Documentation/superio/nuvoton/nct5539d.md
@@ -0,0 +1,9 @@
+# NCT5539D SuperIO
+
+The SuperIO has the ID `0xd121` and the source can be found in
+`src/superio/nuvoton/nct5539d/`.
+
+## For developers
+
+The SuperIO generates ACPI using the
+[SSDT generator for generic SuperIOs](../common/ssdt.md).
diff --git a/Documentation/technotes/2020-03-unit-testing-coreboot.md b/Documentation/technotes/2020-03-unit-testing-coreboot.md
new file mode 100644
index 0000000000..0d1d8ece49
--- /dev/null
+++ b/Documentation/technotes/2020-03-unit-testing-coreboot.md
@@ -0,0 +1,319 @@
+# Unit testing coreboot
+
+## Preface
+First part of this document, Introduction, comprises disambiguation for what
+unit testing is and what is not. This definition will be a basis for the whole
+paper.
+
+Next, Rationale, explains why to use unit testing and how coreboot specifically
+may benefit from it.
+
+This is followed by evaluation of different available free C unit test
+frameworks. Firstly, collection of requirements is provided. Secondly, there is
+a description of a few selected candidates. Finally, requirements are applied to
+candidates to see if they might be a good fit.
+
+Fourth part is a summary of evaluation, with proposal of unit test framework
+for coreboot to be used.
+
+Finally, Implementation proposal paragraph touches how build system and coreboot
+codebase in general should be organized, in order to support unit testing. This
+comprises couple of design considerations which need to be addressed.
+
+## Introduction
+A unit test is supposed to test a single unit of code in isolation. In C
+language (in contrary to OOP) unit usually means a function. One may also
+consider unit under test to be a single compilation unit which exposes some
+API (set of functions). A function, talking to some external component can be
+tested if this component can be mocked out.
+
+In other words (looking from C compilation angle), there should be no extra
+dependencies (executables) required beside unit under test and test harness in
+order to compile unit test binary. Test harness, beside code examining a
+routines, may comprise test framework implementation.
+
+It is hard to apply this strict definition of unit test to firmware code in
+practice, mostly due to constraints on speed of execution and size of final
+executable. coreboot codebase often cannot be adjusted to be testable. Because
+of this, coreboot unit testing subsystem should allow to include some additional
+source object files beside unit under test. That being said, the default and
+goal wherever possible, should be to isolate unit under test from other parts.
+
+Unit testing is not an integration testing and it doesn't replace it. First of
+all, integration tests cover larger set of components and interactions between
+them. Positive integration test result gives more confidence than a positive
+unit test does. Furthermore, unit tests are running on the build machine, while
+integration tests usually are executed on the target (or simulator).
+
+## Rationale
+Considering above, what is the benefit of unit testing, especially keeping in
+mind that coreboot is low-level firmware? Unit tests should be quick, thus may
+be executed frequently during development process. It is much easier to build
+and run a unit test on a build machine, than any integration test. This in turn
+may be used by dev to gather extra confidence early during code development
+process. Actually developer may even write unit tests earlier than the code -
+see [TDD](https://en.wikipedia.org/wiki/Test-driven_development) concept.
+
+That being said, unit testing embedded C code is a difficult task, due to
+significant amount of dependencies on underlying hardware. Mocking can handle
+some hardware dependencies. However, complex mocks make the unit test
+susceptible to failing and can require significant development effort.
+
+Writing unit tests for a code (both new and currently existing) may be favorable
+for the code quality. It is not only about finding bugs, but in general - easily
+testable code is a good code.
+
+coreboot benefits the most from testing common libraries (lib/, commonlib/,
+payloads/libpayload) and coreboot infrastructure (console/, device/, security/).
+
+## Evaluation of unit testing frameworks
+
+### Requirements
+Requirements for unit testing frameworks:
+
+* Easy to use
+* Few dependencies
+
+ Standard C library is all we should need
+
+* Isolation between tests
+* Support for mocking
+* Support for some machine parsable output
+* Compiler similarity
+
+ Compiler for the host _must_ support the same language standards as the target
+ compiler. Ideally the same toolchain should be used for building firmware
+ executables and test binaries, however the host complier will be used to build
+ unit tests, whereas the coreboot toolchain will be used for building the
+ firmware executables. For some targets, the host compiler and the target
+ compiler could be the same, but this is not a requirement.
+
+* Same language for tests and code
+
+ Unit tests will be written in C, because coreboot code is also written in C
+
+### Desirables
+
+* Easy to integrate with build system/build tools
+
+ Ideally JUnit-like XML output format for Jenkins
+
+* Popularity is a plus
+
+ We want a larger community for a couple of reasons. Firstly, easier access to
+ people with knowledge and tutorials. Secondly, bug fixes for the top of tree
+ are more frequent and known issues are usually shorter in the pending state.
+ Last but not least, larger reviewer pool means better and easier upstream
+ improvements that we would like to submit.
+
+* Extra features may be a plus
+* Compatible license
+
+ This should not be a blocker, since test binaries are not distributed.
+ However ideally compatible with GPL.
+
+* IDE integration
+
+### Candidates
+There is a lot of frameworks which allow unit testing C code
+([list](https://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#C) from
+Wikipedia). While not all of them were evaluated, because that would take an
+excessive amount of time, couple of them were selected based on the good
+opinions among C devs, popularity and fitting above criteria.
+
+* [SputUnit](https://www.use-strict.de/sput-unit-testing/)
+* [GoogleTest](https://github.com/google/googletest)
+* [Cmocka](https://cmocka.org/)
+* [Unity](http://www.throwtheswitch.org/unity) (CMock, Ceedling)
+
+We looked at several other test frameworks, but decided not to do a full evaluation
+for various reasons such as functionality, size of the developer community, or
+compatibility.
+
+### Evaluation
+* [SputUnit](https://www.use-strict.de/sput-unit-testing/)
+ * Pros
+ * No dependencies, one header file to include - that’s all
+ * Pure C
+ * Very easy to use
+ * BSD license
+ * Cons
+ * Main repo doesn’t have support for generating JUnit XML reports for
+ Jenkins to consume - this feature is available only on the fork from
+ SputUnit called “Sput_report”. It makes it niche in a niche, so there are
+ some reservations whether support for this will be satisfactory
+ * No support for mocks
+ * Not too popular
+ * No automatic test registration
+* [GoogleTest](https://github.com/google/googletest)
+ * Pros
+ * Automatic test registration
+ * Support for different output formats (including XML for Jenkins)
+ * Good support, widely used, the biggest and the most active community out
+ of all frameworks that were investigated
+ * Available as a package in the most common distributions
+ * Test fixtures easily available
+ * Well documented
+ * Easy to integrate with an IDE
+ * BSD license
+ * Cons
+ * Requires C++11 compiler
+ * To make most out of it (use GMock) C++ knowledge is required
+* [Cmocka](https://cmocka.org/)
+ * Pros
+ * Self-contained, autonomous framework
+ * Pure C
+ * API is well documented
+ * Multiple output formats (including XML for Jenkins)
+ * Available as a package in the most common distributions
+ * Used in some popular open source projects (libssh, OpenVPN, Samba)
+ * Test fixtures available
+ * Support for exception handling
+ * Cons
+ * No automatic test registration
+ * It will require some effort to make it work from within an IDE
+ * Apache 2.0 license (not compatible with GPLv2)
+* [Unity](http://www.throwtheswitch.org/unity) (CMock, Ceedling)
+ * Pros
+ * Pure C (Unity testing framework itself, not test runner)
+ * Support for different output formats (including XML for Jenkins)
+ * There are some (rather easy) hints how to use this from an IDE (e.g. Eclipse)
+ * MIT license
+ * Cons
+ * Test runner (Ceedling) is not written in C - uses Ruby
+ * Mocking/Exception handling functionalities are actually separate tools
+ * No automatic test registration
+ * Not too popular
+
+### Summary & framework proposal
+After research, we propose using the Cmocka unit test framework. Cmocka fulfills
+all stated evaluation criteria. It is rather easy to use, doesn’t have extra
+dependencies, written fully in C, allows for tests fixtures and some popular
+open source projects already are using it. Cmocka also includes support for
+mocks.
+
+Cmocka's limitations, such as the lack of automatic test registration, are
+considered minor issues that will require only minimal additional work from a
+developer. At the same time, it may be worth to propose improvement to Cmocka
+community or simply apply some extra wrapper with demanded functionality.
+
+## Implementation
+
+### Framework as a submodule or external package
+Unit test frameworks may be either compiled from source (from a git submodule
+under 3rdparty/) or pre-compiled as a package. The second option seems to be
+easier to maintain, while at the same time may bring some unwanted consequences
+(different version across distributions, frequent changes in API). It makes sense
+to initially experiment with packages and check how it works. If this will
+cause any issues, then it is always possible to switch to submodule approach.
+
+### Integration with build system
+To get the most out of unit testing framework, it should be integrated with
+Jenkins automation server. Verification of all unit tests for new changes may
+improve code reliability to some extent.
+
+### Build configuration (Kconfig)
+While building unit under test object file, it is necessary to apply some
+configuration (config) just like when building usual firmware. For simplicity,
+there will be one default tests .config `qemu_x86_i440fx` for all unit tests. At
+the same time, some tests may require running with different values of particular
+config. This should be handled by adding extra header, included after config.h.
+This header will comprise #undef of old CONFIG values and #define of the
+required value. When unit testing will be integrated with Jenkins, it may be
+preferred to use every available config for periodic builds.
+
+### Directory structure
+Tests should be kept separate from the code, while at the same time it must be
+easy to match code with test harness.
+
+We create new directory for test files ($(toplevel)/tests/) and mimic the
+structure of src/ directory.
+
+Test object files (test harness, unit under tests and any additional executables
+are stored under build/tests/ directory.
+
+Below example shows how directory structure is organized for the two test cases:
+tests/lib/string-test and tests/device/i2c-test:
+
+```bash
+├── src
+│ ├── lib
+│ │ ├── string.c <- unit under test
+│ │
+│ ├── device
+│ ├── i2c.c
+│
+├── tests
+│ ├── include
+│ │ ├── mocks <- mock headers, which replace original headers
+│ │
+│ ├── Makefile.inc <- top Makefile for unit tests subsystem
+│ ├── lib
+│ │ ├── Makefile.inc
+│ │ ├── string-test.c <- test code for src/lib/string.c
+│ │ │
+│ ├── device
+│ │ ├── Makefile.inc
+│ ├── i2c-test.c
+│
+├── build
+│ ├── tests <-all test-related executables
+ ├── config.h <- default config used for tests builds
+ ├── lib
+ │ ├── string-test <- all string-test executables
+ │ │ ├── run <- final test binary
+ │ │ ├── tests <- all test harness executables
+ │ │ ├── lib
+ │ │ ├── string-test.o <-test harness executable
+ │ │ ├── src <- unit under test and other src executables
+ │ │ ├── lib
+ │ │ ├── string.o <- unit under test executable
+ ├── device
+ ├── i2c-test
+ ├── run
+ ├── tests
+ │ ├── device
+ │ ├── i2c-test.o
+ ├── src
+ ├── device
+ ├── i2c.o
+```
+
+### Adding new tests
+For purpose of this description, let's assume that we want to add a new unit test
+for src/device/i2c.c module. Since this module is rather simple, it will be enough
+to have only one test module.
+
+Firstly (assuming there is no tests/device/Makefile.inc file) we need to create
+Makefile.inc in main unit test module directory. Inside this Makefile.inc, one
+need to register new test and can specify multiple different attributes for it.
+
+```bash
+# Register new test, by adding its name to tests variable
+tests-y += i2c-test
+
+# All attributes are defined by - variables
+# -srcs is used to register all input files (test harness, unit under
+# test and others) for this particular test. Remember to add relative paths.
+i2c-test-srcs += tests/device/i2c-test.c
+i2c-test-srcs += src/device/i2c.c
+
+# We can define extra cflags for this particular test
+i2c-test-cflags += -DSOME_DEFINE=1
+
+# For mocking out external dependencies (functions which cannot be resolved by
+# linker), it is possible to register a mock function. To register new mock, it
+# is enough to add function-to-be-mocked name to -mocks variable.
+i2c-test-mocks += platform_i2c_transfer
+
+# Similar to coreboot concept, unit tests also runs in the context of stages.
+# By default all unit tests are compiled to be ramstage executables. If one want
+# to overwrite this setting, there is -stage variable available.
+i2c-test-stage:= bootblock
+```
+
+### Writing new tests
+Full description of how to write unit tests and Cmocka API description is out of
+the scope of this document. There are other documents related to this
+[Cmocka API](https://api.cmocka.org/) and
+[Mocks](https://lwn.net/Articles/558106/).
diff --git a/Documentation/technotes/index.md b/Documentation/technotes/index.md
index 7c231fc672..5367e69aa2 100644
--- a/Documentation/technotes/index.md
+++ b/Documentation/technotes/index.md
@@ -2,3 +2,4 @@
* [Dealing with Untrusted Input in SMM](2017-02-dealing-with-untrusted-input-in-smm.md)
* [Rebuilding coreboot image generation](2015-11-rebuilding-coreboot-image-generation.md)
+* [Unit testing coreboot](2020-03-unit-testing-coreboot.md)
diff --git a/Documentation/tutorial/part1.md b/Documentation/tutorial/part1.md
index 0c7ef67cbb..7e3da01572 100644
--- a/Documentation/tutorial/part1.md
+++ b/Documentation/tutorial/part1.md
@@ -173,7 +173,7 @@ Here's the command line instruction broken down:
This starts the QEMU emulator with the i440FX host PCI bridge and PIIX3 PCI to
ISA bridge.
* `-bios build/coreboot.rom`
-Use the bios rom image that we just built. If this flag is left out, the
+Use the coreboot rom image that we just built. If this flag is left out, the
standard SeaBIOS image that comes with QEMU is used.
* `-serial stdio`
Send the serial output to the console. This allows you to view the coreboot
diff --git a/Documentation/util.md b/Documentation/util.md
index 1a8f36db2b..27a7c9cab9 100644
--- a/Documentation/util.md
+++ b/Documentation/util.md
@@ -10,8 +10,6 @@ available targets. `bash`
* __amdtools__ - A set of tools to compare extended) K8 memory
settings. `Perl`
* __archive__ - Concatenate files and create an archive `C`
-* __mksunxiboot__ - A simple tool to generate bootable image for sunxi
-platform. `C`
* __autoport__ - Automated porting coreboot to Sandy Bridge/Ivy Bridge
platforms `Go`
* __bincfg__ - Compiler/Decompiler for data blobs with specs `Lex`
@@ -26,11 +24,11 @@ file `Python`
* _fmaptool_ - Converts plaintext fmd files into fmap blobs `C`
* _rmodtool_ - Creates rmodules `C`
* _ifwitool_ - For manipulating IFWI `C`
-* __cbmem__ - Cbmem console log reader `C`
-* __checklist__ - Board implementation checklist generator `Make`
-* __chromeos__ - These scripts can be used to extract System Agent
-reference code and other blobs (e.g. mrc.bin, refcode, VGA option roms)
-from a Chrome OS recovery image. `C`
+* __cbmem__ - CBMEM parser to read e.g. timestamps and console log `C`
+* __chromeos__ - These scripts can be used to access Chrome OS
+resources, for example to extract System Agent reference code and other
+blobs (e.g. mrc.bin, refcode, VGA option roms) from a Chrome OS
+recovery image. `C`
* __crossgcc__ - A cross toolchain builder for -elf toolchains (ie. no
libc support)
* __docker__ - Dockerfiles for _coreboot-sdk_, _coreboot-jenkins-node_,
@@ -62,8 +60,6 @@ specified base and size `Python`
* _mbncat.py_ - Generate ipq8064 uber SBL `Python`
* *mbn_tools.py* - Contains all MBN Utilities for image
generation `Python`
-* __k8resdump__ - This program will dump the IO/memory/PCI resources
-from the K8 memory controller `C`
* __kbc1126__ - Tools used to dump the two blobs from the factory
firmware of many HP laptops with 8051-based SMSC KBC1098/KBC1126
embedded controller and insert them to the firmware image. `C`
@@ -78,6 +74,8 @@ partial deblobbing of Intel ME/TXE firmware images `Python`
* __nvidia__ - nvidia blob parsers
* __nvramtool__ - Reads and writes coreboot parameters and displaying
information from the coreboot table in CMOS/NVRAM. `C`
+* __pgtblgen__ - Generates page tables based on fixed physical address.
+`C`
* __pmh7tool__ - Dumps, reads and writes PMH7 registers on Lenovo
ThinkPads. PMH7 is used for switching on and off the power of some
devices on the board such as dGPU. `C`
@@ -91,14 +89,14 @@ can be passed to SPIKE, the RISC-V reference emulator.`Bash`
* _sifive-gpt.py_ - Wraps the bootblock in a GPT partition for
SiFive's bootrom. `Python3`
* __rockchip__ - Generate Rockchip idblock bootloader. `Python2`
-* __romcc__ - Compile a C source file generating a binary that does not
-implicitly use RAM. `C`
* __sconfig__ - coreboot device tree compiler `Lex` `Yacc`
* __scripts__
* _config_ - Manipulate options in a .config file from the
command line `Bash`
* _cross-repo-cherrypick_ - Pull in patches from another tree
from a gerrit repository. `Shell`
+ * _decode_spd.sh_ - Decodes Serial Presence Detect (SPD) files
+into various human readable formats.
* _dts-to-fmd.sh_ -Converts a depthcharge fmap.dts into an
fmaptool compatible .fmd format `Bash`
* _find-unused-kconfig-symbols.sh_ - Points out Kconfig
@@ -116,18 +114,22 @@ file `Perl`
* _ucode_h_to_bin.sh_ - Microcode conversion tool `Bash`
* _update_submodules_ - Check all submodules for updates `Bash`
* __showdevicetree__ - Compile and dump the device tree `C`
+* __spdtool__ - Dumps SPD ROMs from a given blob to separate files
+using known patterns and reserved bits. Useful for analysing firmware
+that holds SPDs on boards that have soldered down DRAM. `python`
* __spkmodem_recv__ - Decode spkmodem signals `C`
* __superiotool__ - A user-space utility to detect Super I/O of a
mainboard and provide detailed information about the register contents
of the Super I/O. `C`
+* __smcbiosinfo__ - Generates SMC biosinfo for BMC BIOS updates `C`
* __testing__ - coreboot test targets `Make`
* __uio_usbdebug__ - Debug coreboot's usbdebug driver inside a running
operating system (only Linux at this time). `C`
* __util_readme__ - Creates README.md of description files in `./util`
subdirectories `Bash`
+* __vboot_list__ - Tools to generate a list of vboot enabled devices to
+the documentation `Bash`
* __vgabios__ - emulated vga driver for qemu `C`
-* __viatool__ - Extract certain configuration bits on VIA chipsets and
-CPUs. `C`
* __x86__ - Generates 32-bit PAE page tables based on a CSV input file.
`Go`
* __xcompile__ - Cross compile setup `Bash`
diff --git a/MAINTAINERS b/MAINTAINERS
index 77769c0487..bc1e1fc40f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -198,10 +198,10 @@ M: Damien Zammit
S: Odd Fixes
F: src/mainboard/gigabyte/ga-g41m-es2l
-GIGABYTE GA-H61M-S2PV MAINBOARD
+GIGABYTE GA-H61M SERIES MAINBOARDS
M: Angel Pons
S: Maintained
-F: src/mainboard/gigabyte/ga-h61m-s2pv
+F: src/mainboard/gigabyte/ga-h61m-series
GOOGLE PANTHER MAINBOARD
M: Stefan Reinauer
@@ -223,7 +223,7 @@ F: src/mainboard/google/slippy/
F: src/mainboard/google/stout/
OPENCELLULAR MAINBOARDS
-M: Philipp Deppenwiese
+M: Christian Walter
M: Patrick Rudolph
S: Supported
F: src/mainboard/opencellular/elgon/
@@ -317,12 +317,24 @@ M: Vlado Cibic
S: Maintained
F: src/mainboard/asus/p8z77-m_pro/
+LIBRETREND LT1000 MAINBOARD
+M: Piotr Król
+M: Michał Żygowski
+S: Maintained
+F: src/mainboard/libretrend/lt1000
+
PC ENGINES ALL MAINBOARDS
M: Piotr Król
M: Michał Żygowski
S: Supported
F: src/mainboard/pcengines/
+PROTECTLI ALL MAINBOARDS
+M: Piotr Król
+M: Michał Żygowski
+S: Maintained
+F: src/mainboard/protectli/
+
SIEMENS MC_xxxx MAINBOARDS
M: Werner Zeh
S: Maintained
@@ -362,10 +374,6 @@ S: Supported
F: src/drivers/aspeed/common/
F: src/drivers/aspeed/ast2050/
-ATI MACH64 Driver
-S: Orphan
-F: src/drivers/ati/mach64/
-
ABUILD
M: Patrick Georgi
M: Martin Roth
@@ -397,13 +405,10 @@ F: util/rockchip/
ORPHANED ARM SOCS
S: Orphaned
-F: src/cpu/allwinner/
F: src/cpu/armltd/
F: src/cpu/ti/
-F: src/soc/marvell/
F: src/soc/qualcomm/
F: src/soc/samsung/
-F: util/arm_boot_tools/
F: util/exynos/
F: util/ipqheader/
@@ -443,7 +448,7 @@ M: Stefan Reinauer
F: util/inteltool/
INTELMETOOL
-M: Philipp Deppenwiese
+M: Christian Walter
F: util/intelmetool/
ME_CLEANER
@@ -505,15 +510,11 @@ F: src/drivers/uart/
NVRAM
F: util/nvramtool/
-F: util/optionlist/
F: payloads/nvramcui/
LIBPAYLOAD
F: payloads/libpayload/
-BAYOU PAYLOAD
-F: payloads/bayou/
-
COREINFO PAYLOAD
F: payloads/coreinfo/
@@ -523,7 +524,7 @@ M: Martin Roth
F: payloads/external
LINUXBOOT PAYLOAD INTEGRATION
-M: Philipp Deppenwiese
+M: Christian Walter
M: Marcello Sylvester Bauer
S: Supported
F: payloads/external/LinuxBoot
@@ -533,10 +534,9 @@ M: Aaron Durbin
F: src/security/vboot/
TPM SUPPORT
-M: Philipp Deppenwiese
+M: Christian Walter
S: Supported
F: src/drivers/*/tpm/
-F: src/security/vboot/vboot_crtm.*
F: src/security/tpm
DOCKER
@@ -585,7 +585,7 @@ MISSING: ELOG
MISSING: SPI
-# *** Infrastructure Owners***
+# *** Infrastructure Owners ***
# This is intended to let people know who they should contact for issues with various infrastructure pieces.
# Hardware
# Owners: Stefan, Patrick
@@ -596,11 +596,11 @@ MISSING: SPI
# Backups:
# Website
-# Owners: Martin, Philipp
+# Owners: Martin
# Backups: Patrick, Stefan
# Documentation Website
-# Owners: Patrick, Philipp
+# Owners: Patrick
# Backups:
CODE OF CONDUCT
diff --git a/Makefile b/Makefile
index 41a9b3afa4..55d3db1e88 100644
--- a/Makefile
+++ b/Makefile
@@ -42,6 +42,8 @@ objutil ?= $(obj)/util
objk := $(objutil)/kconfig
absobj := $(abspath $(obj))
+VBOOT_HOST_BUILD ?= $(abspath $(objutil)/vboot_lib)
+
COREBOOT_EXPORTS := COREBOOT_EXPORTS
COREBOOT_EXPORTS += top src srck obj objutil objk
@@ -82,6 +84,7 @@ Q:=@
ifneq ($(V),1)
ifneq ($(Q),)
.SILENT:
+MAKEFLAGS += -s
endif
endif
@@ -138,6 +141,14 @@ NOMKDIR:=1
endif
endif
+ifneq ($(filter %-test %-tests,$(MAKECMDGOALS)),)
+ifneq ($(filter-out %-test %-tests, $(MAKECMDGOALS)),)
+$(error Cannot mix unit-tests targets with other targets)
+endif
+UNIT_TEST:=1
+NOCOMPILE:=
+endif
+
.xcompile: util/xcompile/xcompile
rm -f $@
$< $(XGCCPATH) > $@.tmp
@@ -156,7 +167,9 @@ real-all:
@exit 1
else
+ifneq ($(UNIT_TEST),1)
include $(DOTCONFIG)
+endif
# in addition to the dependency below, create the file if it doesn't exist
# to silence stupid warnings about a file that would be generated anyway.
@@ -174,7 +187,9 @@ ifneq ($(CONFIG_MMX),y)
CFLAGS_x86_32 += -mno-mmx
endif
+ifneq ($(UNIT_TEST),1)
include toolchain.inc
+endif
strip_quotes = $(strip $(subst ",,$(subst \",,$(1))))
# fix makefile syntax highlighting after strip macro \" "))
@@ -273,7 +288,14 @@ evaluate_subdirs= \
# collect all object files eligible for building
subdirs:=$(TOPLEVEL)
postinclude-hooks :=
+
+# Don't iterate through Makefile.incs under src/ when building tests
+ifneq ($(UNIT_TEST),1)
$(eval $(call evaluate_subdirs))
+else
+include $(TOPLEVEL)/tests/Makefile.inc
+endif
+
ifeq ($(FAILBUILD),1)
$(error cannot continue build)
endif
diff --git a/Makefile.inc b/Makefile.inc
index 1f18726e5d..e315732ec9 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -293,7 +293,7 @@ $(obj)/$(1).aml: $(src)/mainboard/$(MAINBOARDDIR)/$(1).asl $(obj)/config.h
endef
#######################################################################
-# Parse plaintext cmos defaults into binary format
+# Parse plaintext CMOS defaults into binary format
# arg1: source file
# arg2: binary file name
cbfs-files-processor-nvramtool= \
@@ -421,6 +421,7 @@ 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 -Wvla
+CFLAGS_common += -Wlogical-op -Wduplicated-cond -Wdangling-else
CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer
CFLAGS_common += -ffunction-sections -fdata-sections -fno-pie
ifeq ($(CONFIG_COMPILER_GCC),y)
@@ -895,52 +896,42 @@ FMAP_BIOS_SIZE := $(call int-align-down, $(shell echo $(CONFIG_CBFS_SIZE) | tr A
# X86 CONSOLE FMAP region
#
# position, size and entry line of CONSOLE relative to BIOS_BASE, if enabled
-FMAP_CONSOLE_BASE := 0
+
+FMAP_CURRENT_BASE := 0
+
ifeq ($(CONFIG_CONSOLE_SPI_FLASH),y)
+FMAP_CONSOLE_BASE := $(FMAP_CURRENT_BASE)
FMAP_CONSOLE_SIZE := $(CONFIG_CONSOLE_SPI_FLASH_BUFFER_SIZE)
FMAP_CONSOLE_ENTRY := CONSOLE@$(FMAP_CONSOLE_BASE) $(FMAP_CONSOLE_SIZE)
-else # ifeq ($(CONFIG_CONSOLE_SPI_FLASH),y)
-FMAP_CONSOLE_SIZE := 0
+FMAP_CURRENT_BASE := $(call int-add, $(FMAP_CONSOLE_BASE) $(FMAP_CONSOLE_SIZE))
+else
FMAP_CONSOLE_ENTRY :=
-endif # ifeq ($(CONFIG_CONSOLE_SPI_FLASH),y)
+endif
-#
-# X86 RW_MRC_CACHE FMAP region
-#
-# position, size and entry line of MRC_CACHE relative to BIOS_BASE, if enabled
ifeq ($(CONFIG_CACHE_MRC_SETTINGS),y)
-FMAP_MRC_CACHE_BASE := $(call int-align, $(call int-add, $(FMAP_CONSOLE_BASE) \
- $(FMAP_CONSOLE_SIZE)), 0x10000)
+FMAP_MRC_CACHE_BASE := $(call int-align, $(FMAP_CURRENT_BASE), 0x10000)
FMAP_MRC_CACHE_SIZE := $(CONFIG_MRC_SETTINGS_CACHE_SIZE)
FMAP_MRC_CACHE_ENTRY := RW_MRC_CACHE@$(FMAP_MRC_CACHE_BASE) $(FMAP_MRC_CACHE_SIZE)
-else # ifeq ($(CONFIG_CACHE_MRC_SETTINGS),y)
-FMAP_MRC_CACHE_BASE := 0
-FMAP_MRC_CACHE_SIZE := 0
+FMAP_CURRENT_BASE := $(call int-add, $(FMAP_MRC_CACHE_BASE) $(FMAP_MRC_CACHE_SIZE))
+else
FMAP_MRC_CACHE_ENTRY :=
-endif # ifeq ($(CONFIG_CACHE_MRC_SETTINGS),y)
+endif
-#
-# X86 SMMSTORE FMAP region
-#
-# position, size and entry line of SMMSTORE relative to BIOS_BASE, if enabled
ifeq ($(CONFIG_SMMSTORE),y)
-FMAP_SMMSTORE_BASE := $(call int-align, $(call int-add, $(FMAP_CONSOLE_BASE) \
- $(FMAP_CONSOLE_SIZE) $(FMAP_MRC_CACHE_SIZE)), 0x10000)
+FMAP_SMMSTORE_BASE := $(call int-align, $(FMAP_CURRENT_BASE), 0x10000)
FMAP_SMMSTORE_SIZE := $(CONFIG_SMMSTORE_SIZE)
FMAP_SMMSTORE_ENTRY := SMMSTORE@$(FMAP_SMMSTORE_BASE) $(FMAP_SMMSTORE_SIZE)
-else # ifeq ($(CONFIG_SMMSTORE),y)
-FMAP_SMMSTORE_BASE := 0
-FMAP_SMMSTORE_SIZE := 0
+FMAP_CURRENT_BASE := $(call int-add, $(FMAP_SMMSTORE_BASE) $(FMAP_SMMSTORE_SIZE))
+else
FMAP_SMMSTORE_ENTRY :=
-endif # ifeq ($(CONFIG_CACHE_MRC_SETTINGS),y)
+endif
#
# X86 FMAP region
#
#
# position, size
-FMAP_FMAP_BASE := $(call int-add, $(FMAP_CONSOLE_BASE) $(FMAP_CONSOLE_SIZE) \
- $(FMAP_MRC_CACHE_SIZE) $(FMAP_SMMSTORE_SIZE))
+FMAP_FMAP_BASE := $(FMAP_CURRENT_BASE)
FMAP_FMAP_SIZE := 0x200
#
@@ -949,7 +940,9 @@ FMAP_FMAP_SIZE := 0x200
# position and size of CBFS, relative to BIOS_BASE
FMAP_CBFS_BASE := $(call int-add, $(FMAP_FMAP_BASE) $(FMAP_FMAP_SIZE))
FMAP_CBFS_SIZE := $(call int-subtract, $(FMAP_BIOS_SIZE) $(FMAP_CBFS_BASE))
+
else # ifeq ($(CONFIG_ARCH_X86),y)
+
DEFAULT_FLASHMAP:=$(top)/util/cbfstool/default.fmd
# entire flash
FMAP_ROM_ADDR := 0
@@ -960,49 +953,43 @@ FMAP_BIOS_BASE := 0
FMAP_BIOS_SIZE := $(CONFIG_CBFS_SIZE)
# position and size of flashmap, relative to BIOS_BASE
FMAP_FMAP_BASE := 0x20000
-FMAP_FMAP_SIZE := 0x100
+FMAP_FMAP_SIZE := 0x200
+
+FMAP_CURRENT_BASE := $(call int-add, $(FMAP_FMAP_BASE) $(FMAP_FMAP_SIZE))
#
# NON-X86 CONSOLE FMAP region
#
# position, size and entry line of CONSOLE relative to BIOS_BASE, if enabled
ifeq ($(CONFIG_CONSOLE_SPI_FLASH),y)
-FMAP_CONSOLE_BASE := $(call int-add, $(FMAP_FMAP_BASE) $(FMAP_FMAP_SIZE))
+FMAP_CONSOLE_BASE := $(FMAP_CURRENT_BASE)
FMAP_CONSOLE_SIZE := $(CONFIG_CONSOLE_SPI_FLASH_BUFFER_SIZE)
FMAP_CONSOLE_ENTRY := CONSOLE@$(FMAP_CONSOLE_BASE) $(FMAP_CONSOLE_SIZE)
-else # ifeq ($(CONFIG_CONSOLE_SPI_FLASH),y)
-FMAP_CONSOLE_BASE := 0
-FMAP_CONSOLE_SIZE := 0
+FMAP_CURRENT_BASE := $(call int-add, $(FMAP_CONSOLE_BASE) $(FMAP_CONSOLE_SIZE))
+else
FMAP_CONSOLE_ENTRY :=
-endif # ifeq ($(CONFIG_CONSOLE_SPI_FLASH),y)
+endif
#
# NON-X86 RW_MRC_CACHE FMAP region
#
# position, size and entry line of MRC_CACHE relative to BIOS_BASE, if enabled
ifeq ($(CONFIG_CACHE_MRC_SETTINGS),y)
-ifeq ($(CONFIG_CONSOLE_SPI_FLASH),y)
-FMAP_MRC_CACHE_BASE := $(call int-align, $(call int-add, $(FMAP_CONSOLE_BASE) \
- $(FMAP_CONSOLE_SIZE)), 0x10000)
-else
-FMAP_MRC_CACHE_BASE := $(call int-align, $(call int-add, $(FMAP_FMAP_BASE) \
- $(FMAP_FMAP_SIZE)), 0x10000)
-endif
+FMAP_MRC_CACHE_BASE := $(call int-align, $(FMAP_CURRENT_BASE), 0x10000)
FMAP_MRC_CACHE_SIZE := $(CONFIG_MRC_SETTINGS_CACHE_SIZE)
FMAP_MRC_CACHE_ENTRY := RW_MRC_CACHE@$(FMAP_MRC_CACHE_BASE) $(FMAP_MRC_CACHE_SIZE)
-else # ifeq ($(CONFIG_CACHE_MRC_SETTINGS),y)
-FMAP_MRC_CACHE_BASE := 0
-FMAP_MRC_CACHE_SIZE := 0
+FMAP_CURRENT_BASE := $(call int-add, $(FMAP_MRC_CACHE_BASE) $(FMAP_MRC_CACHE_SIZE))
+else
FMAP_MRC_CACHE_ENTRY :=
-endif # ifeq ($(CONFIG_CACHE_MRC_SETTINGS),y)
+endif
#
# NON-X86 COREBOOT default cbfs FMAP region
#
# position and size of CBFS, relative to BIOS_BASE
-FMAP_CBFS_BASE := $(call int-add,$(FMAP_FMAP_BASE) $(FMAP_FMAP_SIZE) $(FMAP_CONSOLE_SIZE) \
- $(FMAP_MRC_CACHE_SIZE))
+FMAP_CBFS_BASE := $(FMAP_CURRENT_BASE)
FMAP_CBFS_SIZE := $(call int-subtract,$(FMAP_BIOS_SIZE) $(FMAP_CBFS_BASE))
+
endif # ifeq ($(CONFIG_ARCH_X86),y)
$(obj)/fmap.fmd: $(top)/Makefile.inc $(DEFAULT_FLASHMAP) $(obj)/config.h
@@ -1110,7 +1097,12 @@ ifeq ($(CONFIG_SEABIOS_ADD_SERCON_PORT_FILE),y)
@printf " SeaBIOS Add sercon-port file\n"
$(CBFSTOOL) $@.tmp add-int -i $(CONFIG_SEABIOS_SERCON_PORT_ADDR) -n etc/sercon-port
endif
+ifeq ($(CONFIG_SEABIOS_THREAD_OPTIONROMS),y)
+ @printf " SeaBIOS Thread optionroms\n"
+ $(CBFSTOOL) $@.tmp add-int -i 2 -n etc/threads
+endif
ifeq ($(CONFIG_CPU_INTEL_FIRMWARE_INTERFACE_TABLE),y)
+ifneq ($(CONFIG_UPDATE_IMAGE),y) # never update the bootblock
ifeq ($(CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_HEADER),y)
@printf " UPDATE-FIT\n"
$(IFITTOOL) -f $@.tmp -a -n cpu_microcode_blob.bin -t 1 -s $(CONFIG_CPU_INTEL_NUM_FIT_ENTRIES) \
@@ -1145,7 +1137,8 @@ endif
endif
-endif
+endif # !CONFIG_UPDATE_IMAGE
+endif # CONFIG_CPU_INTEL_FIRMWARE_INTERFACE_TABLE
mv $@.tmp $@
@printf " CBFSLAYOUT $(subst $(obj)/,,$(@))\n\n"
$(CBFSTOOL) $@ layout
diff --git a/configs/builder/config.intel.cpx.crb b/configs/builder/config.intel.cpx.crb
new file mode 100644
index 0000000000..b825a9239f
--- /dev/null
+++ b/configs/builder/config.intel.cpx.crb
@@ -0,0 +1,17 @@
+# type this to get working .config:
+# make defconfig KBUILD_DEFCONFIG=configs/builder/config.intel.cpx.crb
+
+CONFIG_VENDOR_INTEL=y
+CONFIG_BOARD_INTEL_CEDARISLAND_CRB=y
+CONFIG_HAVE_IFD_BIN=y
+CONFIG_HAVE_ME_BIN=y
+CONFIG_DO_NOT_TOUCH_DESCRIPTOR_REGION=y
+CONFIG_USE_CPU_MICROCODE_CBFS_BINS=y
+CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS=y
+CONFIG_CPU_UCODE_BINARIES="site-local/cedarisland_crb/ucode-05-06-5a"
+CONFIG_ADD_FSP_BINARIES=y
+CONFIG_FSP_T_FILE="site-local/cedarisland_crb/Server_T.fd"
+CONFIG_FSP_M_FILE="site-local/cedarisland_crb/Server_M.fd"
+CONFIG_FSP_S_FILE="site-local/cedarisland_crb/Server_S.fd"
+CONFIG_ME_BIN_PATH="site-local/cedarisland_crb/me.bin"
+CONFIG_IFD_BIN_PATH="site-local/cedarisland_crb/descriptor.bin"
diff --git a/configs/builder/config.ocp.tiogapass b/configs/builder/config.ocp.tiogapass
new file mode 100644
index 0000000000..9121431b5b
--- /dev/null
+++ b/configs/builder/config.ocp.tiogapass
@@ -0,0 +1,17 @@
+# type this to get working .config:
+# make defconfig KBUILD_DEFCONFIG=configs/builder/config.ocp.tiogapass
+
+CONFIG_VENDOR_OCP=y
+CONFIG_HAVE_IFD_BIN=y
+CONFIG_HAVE_ME_BIN=y
+CONFIG_DO_NOT_TOUCH_DESCRIPTOR_REGION=y
+CONFIG_USE_CPU_MICROCODE_CBFS_BINS=y
+CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS=y
+CONFIG_CPU_UCODE_BINARIES="3rdparty/intel-microcode/intel-ucode/06-55-04"
+CONFIG_ADD_FSP_BINARIES=y
+CONFIG_FSP_T_FILE="site-local/tiogapass/Server_T.fd"
+CONFIG_FSP_M_FILE="site-local/tiogapass/Server_M.fd"
+CONFIG_FSP_S_FILE="site-local/tiogapass/Server_S.fd"
+CONFIG_ME_BIN_PATH="site-local/tiogapass/me.bin"
+CONFIG_IFD_BIN_PATH="site-local/tiogapass/descriptor.bin"
+CONFIG_USE_BLOBS=y
diff --git a/configs/config.emulation_qemu_aarch64_fit_support_timestamps b/configs/config.emulation_qemu_aarch64_fit_support_timestamps
new file mode 100644
index 0000000000..7d0054ca6b
--- /dev/null
+++ b/configs/config.emulation_qemu_aarch64_fit_support_timestamps
@@ -0,0 +1,7 @@
+CONFIG_COLLECT_TIMESTAMPS=y
+CONFIG_TIMESTAMPS_ON_CONSOLE=y
+CONFIG_MAINBOARD_VENDOR="Emulation"
+CONFIG_CBFS_SIZE=0x1000000
+CONFIG_BOARD_EMULATION_QEMU_AARCH64=y
+CONFIG_COREBOOT_ROMSIZE_KB_16384=y
+CONFIG_PAYLOAD_FIT_SUPPORT=y
diff --git a/configs/config.facebook_fbg1701 b/configs/config.facebook_fbg1701.mboot_vboot
similarity index 100%
rename from configs/config.facebook_fbg1701
rename to configs/config.facebook_fbg1701.mboot_vboot
diff --git a/configs/config.google_meep_cros b/configs/config.google_meep_cros
index f87b02b5e9..9911614f16 100644
--- a/configs/config.google_meep_cros
+++ b/configs/config.google_meep_cros
@@ -14,7 +14,6 @@ CONFIG_MRC_CLEAR_NORMAL_CACHE_ON_RECOVERY_RETRAIN=y
# Event Logging
CONFIG_CMOS_POST=y
-CONFIG_CMOS_POST_EXTRA=y
CONFIG_CMOS_POST_OFFSET=0x70
CONFIG_COLLECT_TIMESTAMPS=y
CONFIG_ELOG=y
diff --git a/configs/config.google_octopus_spi_flash_console b/configs/config.google_octopus_spi_flash_console
new file mode 100644
index 0000000000..df8889b019
--- /dev/null
+++ b/configs/config.google_octopus_spi_flash_console
@@ -0,0 +1,4 @@
+CONFIG_VENDOR_GOOGLE=y
+CONFIG_BOARD_GOOGLE_OCTOPUS=y
+CONFIG_CONSOLE_SPI_FLASH=y
+# CONFIG_VBOOT_MEASURED_BOOT is not set
diff --git a/configs/config.google_reef_cros b/configs/config.google_reef_cros
index 9bbb3b3f59..6dcda442db 100644
--- a/configs/config.google_reef_cros
+++ b/configs/config.google_reef_cros
@@ -10,5 +10,4 @@ CONFIG_SPI_FLASH_SMM=y
# CONFIG_CONSOLE_SERIAL is not set
CONFIG_CMOS_POST=y
CONFIG_CMOS_POST_OFFSET=0x70
-CONFIG_CMOS_POST_EXTRA=y
CONFIG_PAYLOAD_NONE=y
diff --git a/configs/config.intel.cfl_rvp11_fsp_car b/configs/config.intel_coffeelake_rvp11.fsp_car
similarity index 83%
rename from configs/config.intel.cfl_rvp11_fsp_car
rename to configs/config.intel_coffeelake_rvp11.fsp_car
index 33192c4e1f..689821717e 100644
--- a/configs/config.intel.cfl_rvp11_fsp_car
+++ b/configs/config.intel_coffeelake_rvp11.fsp_car
@@ -2,8 +2,6 @@ CONFIG_USE_BLOBS=y
CONFIG_VENDOR_INTEL=y
CONFIG_INTEL_GMA_VBT_FILE="3rdparty/fsp/CoffeeLakeFspBinPkg/SampleCode/Vbt/Vbt.bin"
CONFIG_BOARD_INTEL_COFFEELAKE_RVP11=y
-CONFIG_ADD_FSP_BINARIES=y
CONFIG_USE_CANNONLAKE_FSP_CAR=y
CONFIG_RUN_FSP_GOP=y
-CONFIG_FSP_USE_REPO=y
CONFIG_PAYLOAD_NONE=y
diff --git a/configs/config.libretrend_lt1000 b/configs/config.libretrend_lt1000
new file mode 100644
index 0000000000..f12ae3f81c
--- /dev/null
+++ b/configs/config.libretrend_lt1000
@@ -0,0 +1,5 @@
+CONFIG_VENDOR_LIBRETREND=y
+CONFIG_POWER_STATE_OFF_AFTER_FAILURE=y
+CONFIG_GENERIC_LINEAR_FRAMEBUFFER=y
+CONFIG_USER_TPM2=y
+CONFIG_SEABIOS_ADD_SERCON_PORT_FILE=y
diff --git a/configs/config.ocp_tiogapass b/configs/config.ocp_tiogapass
new file mode 100644
index 0000000000..ca0a5b791a
--- /dev/null
+++ b/configs/config.ocp_tiogapass
@@ -0,0 +1,5 @@
+CONFIG_VENDOR_OCP=y
+CONFIG_BOARD_OCP_TIOGAPASS=y
+CONFIG_USE_CPU_MICROCODE_CBFS_BINS=y
+CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS=y
+CONFIG_CPU_UCODE_BINARIES="3rdparty/intel-microcode/intel-ucode/06-55-04"
diff --git a/payloads/Kconfig b/payloads/Kconfig
index 4e86c21ec7..cfb28d6e81 100644
--- a/payloads/Kconfig
+++ b/payloads/Kconfig
@@ -57,10 +57,16 @@ config PAYLOAD_FILE
choice
prompt "Payload compression algorithm"
default COMPRESSED_PAYLOAD_LZMA
+ default COMPRESSED_PAYLOAD_NONE if PAYLOAD_LINUX || PAYLOAD_LINUXBOOT || PAYLOAD_FIT
depends on !PAYLOAD_NONE && !PAYLOAD_LINUX && !PAYLOAD_LINUXBOOT && !PAYLOAD_FIT
help
Choose the compression algorithm for the chosen payloads.
- You can choose between LZMA and LZ4.
+ You can choose between None, LZMA, or LZ4.
+
+config COMPRESSED_PAYLOAD_NONE
+ bool "Use no compression for payloads"
+ help
+ Do not compress the payload.
config COMPRESSED_PAYLOAD_LZMA
bool "Use LZMA compression for payloads"
@@ -126,7 +132,8 @@ config MEMTEST_SECONDARY_PAYLOAD
config NVRAMCUI_SECONDARY_PAYLOAD
bool "Load nvramcui as a secondary payload"
default n
- depends on ARCH_X86
+ depends on ARCH_X86 && HAVE_OPTION_TABLE
+ select USE_OPTION_TABLE
help
nvramcui can be loaded as a secondary payload under SeaBIOS, GRUB,
or any other payload that can load additional payloads.
diff --git a/payloads/coreinfo/cpuinfo_module.c b/payloads/coreinfo/cpuinfo_module.c
index 94379f3077..2b833a9447 100644
--- a/payloads/coreinfo/cpuinfo_module.c
+++ b/payloads/coreinfo/cpuinfo_module.c
@@ -233,7 +233,7 @@ static int cpuinfo_module_redraw(WINDOW *win)
}
if (cpu_khz != 0)
- mvwprintw(win, row++, 1, "CPU Speed: %d Mhz", cpu_khz / 1000);
+ mvwprintw(win, row++, 1, "CPU Speed: %d MHz", cpu_khz / 1000);
else
mvwprintw(win, row++, 1, "CPU Speed: Error");
diff --git a/payloads/external/GRUB2/Makefile b/payloads/external/GRUB2/Makefile
index f13c12892a..31b0f53b18 100644
--- a/payloads/external/GRUB2/Makefile
+++ b/payloads/external/GRUB2/Makefile
@@ -17,12 +17,13 @@ checkout:
echo " GIT GRUB2 $(NAME-y)"
test -d $(project_dir) || git clone $(project_git_repo) $(project_dir)
git -C $(project_dir) fetch
-ifeq ("$(shell test -d $(project_dir) && \
- (git -C $(project_dir) status --ignored=no --untracked-files=no --porcelain))",)
+ifeq ($(shell test -d $(project_dir) && \
+ (git -C $(project_dir) status --ignored=no --untracked-files=no --porcelain)),)
git -C $(project_dir) checkout -f $(TAG-y)
else
echo "WARNING: index/tree not clean, skipping update / force checkout."
- echo " Checkout manually with `git -C $(project_dir) checkout -f`."
+ echo " Checkout manually with "\
+ "\`git -C payloads/external/GRUB2/$(project_dir) checkout -f\`."
endif
grub2/build/config.h: $(CONFIG_DEP) | checkout
diff --git a/payloads/external/Makefile.inc b/payloads/external/Makefile.inc
index b8af8c9120..5274581256 100644
--- a/payloads/external/Makefile.inc
+++ b/payloads/external/Makefile.inc
@@ -78,7 +78,7 @@ etc/grub.cfg-required := the GRUB runtime configuration file ($(CONFIG_GRUB2_RUN
# SeaBIOS
SEABIOS_CC_OFFSET=$(if $(filter %ccache,$(HOSTCC)),2,1)
-payloads/external/SeaBIOS/seabios/out/bios.bin.elf seabios: $(DOTCONFIG)
+payloads/external/SeaBIOS/seabios/out/bios.bin.elf: $(DOTCONFIG)
$(MAKE) -C payloads/external/SeaBIOS \
HOSTCC="$(HOSTCC)" \
CC=$(word $(SEABIOS_CC_OFFSET),$(CC_x86_32)) \
@@ -102,9 +102,10 @@ payloads/external/SeaBIOS/seabios/out/bios.bin.elf seabios: $(DOTCONFIG)
CONFIG_SEABIOS_DEBUG_LEVEL=$(CONFIG_SEABIOS_DEBUG_LEVEL) \
CONFIG_DRIVERS_UART_8250MEM_32=$(CONFIG_DRIVERS_UART_8250MEM_32) \
CONFIG_ENABLE_HSUART=$(CONFIG_ENABLE_HSUART) \
- CONFIG_CONSOLE_UART_BASE_ADDRESS=$(CONFIG_CONSOLE_UART_BASE_ADDRESS)
+ CONFIG_CONSOLE_UART_BASE_ADDRESS=$(CONFIG_CONSOLE_UART_BASE_ADDRESS) \
+ CONFIG_SEABIOS_HARDWARE_IRQ=$(CONFIG_SEABIOS_HARDWARE_IRQ)
-payloads/external/SeaBIOS/seabios/out/vgabios.bin: seabios
+payloads/external/SeaBIOS/seabios/out/vgabios.bin: payloads/external/SeaBIOS/seabios/out/bios.bin.elf
payloads/external/SeaBIOS/seabios/.config: payloads/external/SeaBIOS/seabios/out/bios.bin.elf
payloads/external/SeaBIOS/seabios/out/autoversion.h: payloads/external/SeaBIOS/seabios/out/bios.bin.elf
@@ -263,6 +264,7 @@ payloads/external/iPXE/ipxe/ipxe.rom ipxe: $(DOTCONFIG) $(PXE_CONFIG_SCRIPT)
CONFIG_SCRIPT=$(PXE_CONFIG_SCRIPT) \
CONFIG_HAS_SCRIPT=$(CONFIG_PXE_ADD_SCRIPT) \
CONFIG_PXE_NO_PROMT=$(CONFIG_PXE_NO_PROMT) \
+ CONFIG_PXE_HAS_HTTPS=$(CONFIG_PXE_HAS_HTTPS) \
MFLAGS= MAKEFLAGS=
# LinuxBoot
diff --git a/payloads/external/SeaBIOS/Kconfig b/payloads/external/SeaBIOS/Kconfig
index 8ec7361813..21e47206f4 100644
--- a/payloads/external/SeaBIOS/Kconfig
+++ b/payloads/external/SeaBIOS/Kconfig
@@ -51,6 +51,16 @@ config SEABIOS_THREAD_OPTIONROMS
variations during option ROM code execution. It is not
known if all option ROMs will behave properly with this option.
+config SEABIOS_HARDWARE_IRQ
+ prompt "Hardware Interrupts"
+ default y
+ bool
+ help
+ Program and support hardware interrupts using the i8259
+ programmable interrupt controller (PIC). Deselected by
+ boards which would otherwise hang at the boot menu (eg,
+ google/rambi).
+
config SEABIOS_VGA_COREBOOT
prompt "Include generated option rom that implements legacy VGA BIOS compatibility"
default y if !VENDOR_EMULATION
@@ -125,7 +135,7 @@ config SEABIOS_DEBUG_LEVEL
level 1 - Basic output, interrupts 5, 18h, 19h, 40h, SMP, PNP, PMM
level 2 - AHCI, Floppy, Basic ps2, interrupts 11h, 12h, 14h, 17h
level 3 - bootsplash, initializations, SeaBIOS VGA BIOS interrupts
- level 4 - bios tables, more optionrom
+ level 4 - BIOS tables, more optionrom
level 5 - Extra bootsplash, more XHCI
level 6 - ATA commands, extra optionrom
level 7 - extra ps2 commands, more OHCI & EHCI
diff --git a/payloads/external/SeaBIOS/Makefile b/payloads/external/SeaBIOS/Makefile
index 0086775b8d..cd646d9d73 100644
--- a/payloads/external/SeaBIOS/Makefile
+++ b/payloads/external/SeaBIOS/Makefile
@@ -72,6 +72,9 @@ endif
ifneq ($(CONFIG_SEABIOS_DEBUG_LEVEL),-1)
echo "CONFIG_DEBUG_LEVEL=$(CONFIG_SEABIOS_DEBUG_LEVEL)" >> seabios/.config
endif
+ifneq ($(CONFIG_SEABIOS_HARDWARE_IRQ),y)
+ echo "# CONFIG_HARDWARE_IRQ is not set" >> seabios/.config
+endif
# This shows how to force a previously set .config option *off*
# echo "# CONFIG_SMBIOS is not set" >> seabios/.config
$(MAKE) -C seabios olddefconfig OUT=out/
diff --git a/payloads/external/depthcharge/Makefile b/payloads/external/depthcharge/Makefile
index c1993e4538..c4dd1bf14b 100644
--- a/payloads/external/depthcharge/Makefile
+++ b/payloads/external/depthcharge/Makefile
@@ -10,6 +10,7 @@ libpayload_dir=$(abspath $(CURDIR)/../../libpayload)
libpayload_install_dir=$(output_dir)/lp_$(BOARD)
VBOOT_SOURCE ?= $(abspath $(CURDIR)/../../../3rdparty/vboot)
+EC_HEADERS ?= $(abspath $(CURDIR)/../../../3rdparty/chromeec/include)
TAG-$(DEPTHCHARGE_MASTER)=origin/master
TAG-$(DEPTHCHARGE_STABLE)=$(STABLE_COMMIT_ID)
@@ -79,13 +80,15 @@ config: $(project_dir)/.version_$(TAG-y) $(libpayload_install_dir)
cd $(project_dir) && \
$(MAKE) BOARD=$(BOARD) \
LIBPAYLOAD_DIR=$(libpayload_install_dir)/libpayload \
- VB_SOURCE=$(VBOOT_SOURCE) defconfig
+ VB_SOURCE=$(VBOOT_SOURCE) \
+ EC_HEADERS=$(EC_HEADERS) defconfig
build: config
echo " MAKE $(project_name) $(TAG-y)"
$(MAKE) -C $(project_dir) depthcharge BOARD=$(BOARD) \
LIBPAYLOAD_DIR=$(libpayload_install_dir)/libpayload \
VB_SOURCE=$(VBOOT_SOURCE) \
+ EC_HEADERS=$(EC_HEADERS) \
PATH="$(abspath ../../../build/util/cbfstool):$$PATH"
clean:
diff --git a/payloads/external/iPXE/Kconfig b/payloads/external/iPXE/Kconfig
index 7cb0d1e249..1636138039 100644
--- a/payloads/external/iPXE/Kconfig
+++ b/payloads/external/iPXE/Kconfig
@@ -113,5 +113,13 @@ config PXE_SCRIPT
Uses the ipxe script instead showing the prompt:
"Press Ctrl-B to start iPXE..."
+config PXE_HAS_HTTPS
+ bool "Enable HTTPS protocol"
+ default y
+ depends on BUILD_IPXE
+ help
+ Enable HTTPS protocol, which allows you to encrypt all communication
+ with a web server and to verify the server's identity
+
endmenu
endif
diff --git a/payloads/external/iPXE/Makefile b/payloads/external/iPXE/Makefile
index 0c071fa13b..489bcfae9c 100644
--- a/payloads/external/iPXE/Makefile
+++ b/payloads/external/iPXE/Makefile
@@ -65,6 +65,10 @@ ifeq ($(CONFIG_PXE_NO_PROMT),y)
sed 's|#define\s*BANNER_TIMEOUT.*|#define BANNER_TIMEOUT 0|' "$(project_dir)/src/config/general.h" > "$(project_dir)/src/config/general.h.tmp"
mv "$(project_dir)/src/config/general.h.tmp" "$(project_dir)/src/config/general.h"
endif
+ifeq ($(CONFIG_PXE_HAS_HTTPS),y)
+ sed 's|.*DOWNLOAD_PROTO_HTTPS|#define DOWNLOAD_PROTO_HTTPS|g' "$(project_dir)/src/config/general.h" > "$(project_dir)/src/config/general.h.tmp"
+ mv "$(project_dir)/src/config/general.h.tmp" "$(project_dir)/src/config/general.h"
+endif
build: config $(CONFIG_SCRIPT)
ifeq ($(CONFIG_HAS_SCRIPT),y)
diff --git a/payloads/external/tianocore/Kconfig b/payloads/external/tianocore/Kconfig
index 7717917f94..7d5f038ebd 100644
--- a/payloads/external/tianocore/Kconfig
+++ b/payloads/external/tianocore/Kconfig
@@ -83,7 +83,6 @@ config TIANOCORE_USE_8254_TIMER
config TIANOCORE_BOOTSPLASH_IMAGE
bool "Use a custom bootsplash image"
- 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
@@ -92,7 +91,6 @@ 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/Makefile b/payloads/external/tianocore/Makefile
index 7adb700a6e..21bae758da 100644
--- a/payloads/external/tianocore/Makefile
+++ b/payloads/external/tianocore/Makefile
@@ -24,10 +24,12 @@ 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)
+logo_pkg=MdeModulePkg
+build_flavor=-D BOOTLOADER=COREBOOT -D PCIE_BASE=$(CONFIG_MMCONF_BASE_ADDRESS) -DPS2_KEYBOARD_ENABLE
TAG=upstream/master
else
bootloader=CorebootPayloadPkg
+logo_pkg=CorebootPayloadPkg
# STABLE revision is MrChromebox's coreboot framebuffer (coreboot_fb) branch
TAG=origin/$(project_git_branch)
endif
@@ -49,9 +51,9 @@ TIMER=-DUSE_HPET_TIMER
endif
ifeq ($(CONFIG_TIANOCORE_TARGET_IA32), y)
- BUILD_STR=-a IA32 -t COREBOOT -p $(bootloader)/$(bootloader)Ia32.dsc -b $(BUILD_TYPE) $(TIMER) $(build_flavor)
+ BUILD_STR=-q -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 $(bootloader)/$(bootloader)Ia32X64.dsc -b $(BUILD_TYPE) $(TIMER) $(build_flavor)
+ BUILD_STR=-q -a IA32 -a X64 -t COREBOOT -p $(bootloader)/$(bootloader)Ia32X64.dsc -b $(BUILD_TYPE) $(TIMER) $(build_flavor)
endif
all: clean build
@@ -70,12 +72,13 @@ update: $(project_dir)
echo " $(TAG) is not a valid git reference"; \
exit 1; \
fi; \
- if git describe --all --dirty | grep -qv dirty; then \
+ if git status --ignore-submodules=dirty | grep -qv clean; then \
echo " Checking out $(project_name) revision $(TAG)"; \
git checkout --detach $(TAG); \
else \
echo " Working directory not clean; will not overwrite"; \
- fi
+ fi; \
+ git submodule update --init --recursive
checktools:
echo "Checking uuid-dev..."
@@ -91,13 +94,13 @@ checktools:
build: update checktools
unset CC; $(MAKE) -C $(project_dir)/BaseTools
echo " build $(project_name) $(TAG)"
- if [ -n $(CONFIG_TIANOCORE_BOOTSPLASH_FILE) ]; then \
+ if [ -n "$(CONFIG_TIANOCORE_BOOTSPLASH_FILE)" ]; then \
echo " Copying custom bootsplash image"; \
case "$(CONFIG_TIANOCORE_BOOTSPLASH_FILE)" in \
/*) cp $(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \
- $(project_dir)/CorebootPayloadPkg/Logo/Logo.bmp;; \
+ $(project_dir)/$(logo_pkg)/Logo/Logo.bmp;; \
*) cp $(top)/$(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \
- $(project_dir)/CorebootPayloadPkg/Logo/Logo.bmp;; \
+ $(project_dir)/$(logo_pkg)/Logo/Logo.bmp;; \
esac \
fi; \
cd $(project_dir); \
@@ -110,7 +113,7 @@ build: update checktools
fi; \
build $(BUILD_STR); \
mv $(project_dir)/Build/$(bootloader)*/*/FV/UEFIPAYLOAD.fd $(project_dir)/Build/UEFIPAYLOAD.fd; \
- git checkout CorebootPayloadPkg/Logo/Logo.bmp > /dev/null 2>&1 || true
+ git checkout $(logo_pkg)/Logo/Logo.bmp > /dev/null 2>&1 || true
clean:
test -d $(project_dir) && (cd $(project_dir); rm -rf Build; rm -f Conf/tools_def.txt) || exit 0
diff --git a/payloads/libpayload/Kconfig b/payloads/libpayload/Kconfig
index f7501e36b0..f8e176e998 100644
--- a/payloads/libpayload/Kconfig
+++ b/payloads/libpayload/Kconfig
@@ -257,6 +257,11 @@ config QCS405_SERIAL_CONSOLE
depends on SERIAL_CONSOLE
default n
+config QUALCOMM_QUPV3_SERIAL_CONSOLE
+ bool "Qualcomm QUPV3 serial port driver"
+ depends on SERIAL_CONSOLE
+ default n
+
config PL011_SERIAL_CONSOLE
bool "PL011 compatible serial port driver"
depends on 8250_SERIAL_CONSOLE
@@ -315,6 +320,13 @@ config COREBOOT_VIDEO_CONSOLE
Say Y here if coreboot switched to a graphics mode and
your payload wants to use it.
+config COREBOOT_VIDEO_CENTERED
+ bool "Center a classic 80x25 console on bigger screens"
+ depends on COREBOOT_VIDEO_CONSOLE
+ help
+ Say 'y' here if your payload is hardcoded to a 80x25 console. Otherwise
+ its output would look squeezed into the upper-left corner of the screen.
+
config FONT_SCALE_FACTOR
int "Scale factor for the included font"
depends on GEODELX_VIDEO_CONSOLE || COREBOOT_VIDEO_CONSOLE
diff --git a/payloads/libpayload/arch/arm64/cpu.S b/payloads/libpayload/arch/arm64/cpu.S
index d80f73c112..70a1044b02 100644
--- a/payloads/libpayload/arch/arm64/cpu.S
+++ b/payloads/libpayload/arch/arm64/cpu.S
@@ -29,6 +29,7 @@
*/
#include
+#include
.macro dcache_apply_all crm
dsb sy
@@ -96,3 +97,17 @@ ENDPROC(dcache_clean_all)
ENTRY(dcache_clean_invalidate_all)
dcache_apply_all crm=cisw
ENDPROC(dcache_clean_invalidate_all)
+
+/* This must be implemented in assembly to ensure there are no accesses to
+ memory (e.g. the stack) in between disabling and flushing the cache. */
+ENTRY(mmu_disable)
+ str x30, [sp, #-0x8]
+ mrs x0, sctlr_el2
+ mov x1, #~(SCTLR_C | SCTLR_M)
+ and x0, x0, x1
+ msr sctlr_el2, x0
+ isb
+ bl dcache_clean_invalidate_all
+ ldr x30, [sp, #-0x8]
+ ret
+ENDPROC(mmu_disable)
diff --git a/payloads/libpayload/arch/arm64/head.S b/payloads/libpayload/arch/arm64/head.S
index 8bac70fee5..c44169b82a 100644
--- a/payloads/libpayload/arch/arm64/head.S
+++ b/payloads/libpayload/arch/arm64/head.S
@@ -28,11 +28,15 @@
*/
#include
+#include
/*
* Our entry point
*/
ENTRY(_entry)
+ /* Initialize SCTLR to intended state (icache and stack-alignment on) */
+ ldr w1, =(SCTLR_RES1 | SCTLR_I | SCTLR_SA)
+ msr sctlr_el2, x1
/* Save off the location of the coreboot tables */
ldr x1, 1f
diff --git a/payloads/libpayload/arch/arm64/mmu.c b/payloads/libpayload/arch/arm64/mmu.c
index d1dd5b0147..3a5e04db6c 100644
--- a/payloads/libpayload/arch/arm64/mmu.c
+++ b/payloads/libpayload/arch/arm64/mmu.c
@@ -303,30 +303,6 @@ static uint32_t is_mmu_enabled(void)
return (sctlr & SCTLR_M);
}
-/*
- * Func: mmu_disable
- * Desc: Invalidate caches and disable mmu
- */
-void mmu_disable(void)
-{
- uint32_t sctlr;
-
- sctlr = raw_read_sctlr_el2();
- sctlr &= ~(SCTLR_C | SCTLR_M | SCTLR_I);
-
- tlbiall_el2();
- dcache_clean_invalidate_all();
-
- dsb();
- isb();
-
- raw_write_sctlr_el2(sctlr);
-
- dcache_clean_invalidate_all();
- dsb();
- isb();
-}
-
/*
* Func: mmu_enable
* Desc: Initialize MAIR, TCR, TTBR and enable MMU by setting appropriate bits
diff --git a/payloads/libpayload/configs/config.bubs b/payloads/libpayload/configs/config.bubs
new file mode 100644
index 0000000000..7e162e5ddb
--- /dev/null
+++ b/payloads/libpayload/configs/config.bubs
@@ -0,0 +1,8 @@
+CONFIG_LP_CHROMEOS=y
+CONFIG_LP_ARCH_ARM64=y
+CONFIG_LP_TIMER_ARM64_ARCH=y
+CONFIG_LP_SERIAL_CONSOLE=y
+CONFIG_LP_QUALCOMM_QUPV3_SERIAL_CONSOLE=y
+CONFIG_LP_USB=y
+CONFIG_LP_USB_EHCI=y
+CONFIG_LP_USB_XHCI=y
diff --git a/payloads/libpayload/configs/config.trogdor b/payloads/libpayload/configs/config.trogdor
index 413f66ffe8..6309d2b45f 100644
--- a/payloads/libpayload/configs/config.trogdor
+++ b/payloads/libpayload/configs/config.trogdor
@@ -4,3 +4,5 @@ CONFIG_LP_TIMER_ARM64_ARCH=y
CONFIG_LP_USB=y
CONFIG_LP_USB_EHCI=y
CONFIG_LP_USB_XHCI=y
+CONFIG_LP_SERIAL_CONSOLE=y
+CONFIG_LP_QUALCOMM_QUPV3_SERIAL_CONSOLE=y
diff --git a/payloads/libpayload/drivers/Makefile.inc b/payloads/libpayload/drivers/Makefile.inc
index a3916700df..115cf40285 100644
--- a/payloads/libpayload/drivers/Makefile.inc
+++ b/payloads/libpayload/drivers/Makefile.inc
@@ -38,6 +38,7 @@ libc-$(CONFIG_LP_S5P_SERIAL_CONSOLE) += serial/s5p.c serial/serial.c
libc-$(CONFIG_LP_IPQ806X_SERIAL_CONSOLE) += serial/ipq806x.c serial/serial.c
libc-$(CONFIG_LP_IPQ40XX_SERIAL_CONSOLE) += serial/ipq40xx.c serial/serial.c
libc-$(CONFIG_LP_QCS405_SERIAL_CONSOLE) += serial/qcs405.c serial/serial.c
+libc-$(CONFIG_LP_QUALCOMM_QUPV3_SERIAL_CONSOLE) += serial/qcom_qupv3_serial.c serial/serial.c
libc-$(CONFIG_LP_PC_KEYBOARD) += i8042/keyboard.c
libc-$(CONFIG_LP_PC_MOUSE) += i8042/mouse.c
libc-$(CONFIG_LP_PC_I8042) += i8042/i8042.c
diff --git a/payloads/libpayload/drivers/i8042/keyboard.c b/payloads/libpayload/drivers/i8042/keyboard.c
index 79455cfe7b..f96f28a3c8 100644
--- a/payloads/libpayload/drivers/i8042/keyboard.c
+++ b/payloads/libpayload/drivers/i8042/keyboard.c
@@ -349,7 +349,7 @@ static int set_scancode_set(void)
/*
* Set default parameters.
- * Fix for broken QEMU ps/2 make scancodes.
+ * Fix for broken QEMU PS/2 make scancodes.
*/
ret = keyboard_cmd(I8042_KBCMD_SET_DEFAULT);
if (!ret) {
diff --git a/payloads/libpayload/drivers/nvram.c b/payloads/libpayload/drivers/nvram.c
index a116d1b65f..1a80efef24 100644
--- a/payloads/libpayload/drivers/nvram.c
+++ b/payloads/libpayload/drivers/nvram.c
@@ -2,6 +2,7 @@
* This file is part of the libpayload project.
*
* Copyright (C) 2008 Uwe Hermann
+ * Copyright (C) 2017 Patrick Rudolph
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -111,23 +112,107 @@ int nvram_updating(void)
*/
void rtc_read_clock(struct tm *time)
{
+ u16 timeout = 10000;
+ u8 statusB;
+ u8 reg8;
+
memset(time, 0, sizeof(*time));
- while(nvram_updating());
+ while (nvram_updating())
+ if (!timeout--)
+ return;
- time->tm_mon = bcd2dec(nvram_read(NVRAM_RTC_MONTH)) - 1;
- time->tm_sec = bcd2dec(nvram_read(NVRAM_RTC_SECONDS));
- time->tm_min = bcd2dec(nvram_read(NVRAM_RTC_MINUTES));
- time->tm_mday = bcd2dec(nvram_read(NVRAM_RTC_DAY));
- time->tm_hour = bcd2dec(nvram_read(NVRAM_RTC_HOURS));
+ statusB = nvram_read(NVRAM_RTC_STATUSB);
+
+ if (!(statusB & NVRAM_RTC_FORMAT_BINARY)) {
+ time->tm_mon = bcd2dec(nvram_read(NVRAM_RTC_MONTH)) - 1;
+ time->tm_sec = bcd2dec(nvram_read(NVRAM_RTC_SECONDS));
+ time->tm_min = bcd2dec(nvram_read(NVRAM_RTC_MINUTES));
+ time->tm_mday = bcd2dec(nvram_read(NVRAM_RTC_DAY));
+
+ if (!(statusB & NVRAM_RTC_FORMAT_24HOUR)) {
+ reg8 = nvram_read(NVRAM_RTC_HOURS);
+ time->tm_hour = bcd2dec(reg8 & 0x7f);
+ time->tm_hour += (reg8 & 0x80) ? 12 : 0;
+ time->tm_hour %= 24;
+ } else {
+ time->tm_hour = bcd2dec(nvram_read(NVRAM_RTC_HOURS));
+ }
+ time->tm_year = bcd2dec(nvram_read(NVRAM_RTC_YEAR));
+ } else {
+ time->tm_mon = nvram_read(NVRAM_RTC_MONTH) - 1;
+ time->tm_sec = nvram_read(NVRAM_RTC_SECONDS);
+ time->tm_min = nvram_read(NVRAM_RTC_MINUTES);
+ time->tm_mday = nvram_read(NVRAM_RTC_DAY);
+ if (!(statusB & NVRAM_RTC_FORMAT_24HOUR)) {
+ reg8 = nvram_read(NVRAM_RTC_HOURS);
+ time->tm_hour = reg8 & 0x7f;
+ time->tm_hour += (reg8 & 0x80) ? 12 : 0;
+ time->tm_hour %= 24;
+ } else {
+ time->tm_hour = nvram_read(NVRAM_RTC_HOURS);
+ }
+ time->tm_year = nvram_read(NVRAM_RTC_YEAR);
+ }
/* Instead of finding the century register,
we just make an assumption that if the year value is
less then 80, then it is 2000+
*/
-
- time->tm_year = bcd2dec(nvram_read(NVRAM_RTC_YEAR));
-
if (time->tm_year < 80)
time->tm_year += 100;
}
+
+/**
+ * Write the current time and date to the RTC
+ *
+ * @param time A pointer to a broken-down time structure
+ */
+void rtc_write_clock(const struct tm *time)
+{
+ u16 timeout = 10000;
+ u8 statusB;
+ u8 reg8, year;
+
+ while (nvram_updating())
+ if (!timeout--)
+ return;
+
+ statusB = nvram_read(NVRAM_RTC_STATUSB);
+
+ year = time->tm_year;
+ if (year > 100)
+ year -= 100;
+
+ if (!(statusB & NVRAM_RTC_FORMAT_BINARY)) {
+ nvram_write(dec2bcd(time->tm_mon + 1), NVRAM_RTC_MONTH);
+ nvram_write(dec2bcd(time->tm_sec), NVRAM_RTC_SECONDS);
+ nvram_write(dec2bcd(time->tm_min), NVRAM_RTC_MINUTES);
+ nvram_write(dec2bcd(time->tm_mday), NVRAM_RTC_DAY);
+ if (!(statusB & NVRAM_RTC_FORMAT_24HOUR)) {
+ if (time->tm_hour > 12)
+ reg8 = dec2bcd(time->tm_hour - 12) | 0x80;
+ else
+ reg8 = dec2bcd(time->tm_hour);
+ } else {
+ reg8 = dec2bcd(time->tm_hour);
+ }
+ nvram_write(reg8, NVRAM_RTC_HOURS);
+ nvram_write(dec2bcd(year), NVRAM_RTC_YEAR);
+ } else {
+ nvram_write(time->tm_mon + 1, NVRAM_RTC_MONTH);
+ nvram_write(time->tm_sec, NVRAM_RTC_SECONDS);
+ nvram_write(time->tm_min, NVRAM_RTC_MINUTES);
+ nvram_write(time->tm_mday, NVRAM_RTC_DAY);
+ if (!(statusB & NVRAM_RTC_FORMAT_24HOUR)) {
+ if (time->tm_hour > 12)
+ reg8 = (time->tm_hour - 12) | 0x80;
+ else
+ reg8 = time->tm_hour;
+ } else {
+ reg8 = time->tm_hour;
+ }
+ nvram_write(reg8, NVRAM_RTC_HOURS);
+ nvram_write(year, NVRAM_RTC_YEAR);
+ }
+}
diff --git a/payloads/libpayload/drivers/options.c b/payloads/libpayload/drivers/options.c
index 2b0a42e1b7..0bdb8bcff9 100644
--- a/payloads/libpayload/drivers/options.c
+++ b/payloads/libpayload/drivers/options.c
@@ -157,7 +157,7 @@ static struct cb_cmos_entries *lookup_cmos_entry(struct cb_cmos_option_table *op
struct cb_cmos_entries *cmos_entry;
int len = name ? strnlen(name, CB_CMOS_MAX_NAME_LENGTH) : 0;
- /* cmos entries are located right after the option table */
+ /* CMOS entries are located right after the option table */
cmos_entry = first_cmos_entry(option_table);
while (cmos_entry) {
if (memcmp((const char*)cmos_entry->name, name, len) == 0)
@@ -186,12 +186,12 @@ struct cb_cmos_entries *next_cmos_entry(struct cb_cmos_entries *cmos_entry)
struct cb_cmos_enums *first_cmos_enum(struct cb_cmos_option_table *option_table)
{
struct cb_cmos_entries *cmos_entry;
- /* cmos entries are located right after the option table. Skip them */
+ /* CMOS entries are located right after the option table. Skip them */
cmos_entry = (struct cb_cmos_entries *)((unsigned char *)option_table + option_table->header_length);
while (cmos_entry->tag == CB_TAG_OPTION)
cmos_entry = (struct cb_cmos_entries*)((unsigned char *)cmos_entry + cmos_entry->size);
- /* cmos enums are located after cmos entries. */
+ /* CMOS enums are located after CMOS entries. */
return (struct cb_cmos_enums *)cmos_entry;
}
@@ -237,7 +237,7 @@ static struct cb_cmos_enums *lookup_cmos_enum_core(struct cb_cmos_option_table *
{
int len = strnlen(text, CB_CMOS_MAX_TEXT_LENGTH);
- /* cmos enums are located after cmos entries. */
+ /* CMOS enums are located after CMOS entries. */
struct cb_cmos_enums *cmos_enum;
for ( cmos_enum = first_cmos_enum_of_id(option_table, config_id);
cmos_enum;
diff --git a/payloads/libpayload/drivers/serial/8250.c b/payloads/libpayload/drivers/serial/8250.c
index 9502d4b147..4a7cc01a0a 100644
--- a/payloads/libpayload/drivers/serial/8250.c
+++ b/payloads/libpayload/drivers/serial/8250.c
@@ -31,7 +31,9 @@
#include
#include
-#define IOBASE lib_sysinfo.serial->baseaddr
+static struct cb_serial cb_serial;
+
+#define IOBASE cb_serial.baseaddr
#define MEMBASE (phys_to_virt(IOBASE))
static int serial_hardware_is_present = 0;
@@ -39,14 +41,14 @@ static int serial_is_mem_mapped = 0;
static uint8_t serial_read_reg(int offset)
{
- offset *= lib_sysinfo.serial->regwidth;
+ offset *= cb_serial.regwidth;
#if CONFIG(LP_IO_ADDRESS_SPACE)
if (!serial_is_mem_mapped)
return inb(IOBASE + offset);
else
#endif
- if (lib_sysinfo.serial->regwidth == 4)
+ if (cb_serial.regwidth == 4)
return readl(MEMBASE + offset) & 0xff;
else
return readb(MEMBASE + offset);
@@ -54,14 +56,14 @@ static uint8_t serial_read_reg(int offset)
static void serial_write_reg(uint8_t val, int offset)
{
- offset *= lib_sysinfo.serial->regwidth;
+ offset *= cb_serial.regwidth;
#if CONFIG(LP_IO_ADDRESS_SPACE)
if (!serial_is_mem_mapped)
outb(val, IOBASE + offset);
else
#endif
- if (lib_sysinfo.serial->regwidth == 4)
+ if (cb_serial.regwidth == 4)
writel(val & 0xff, MEMBASE + offset);
else
writeb(val, MEMBASE + offset);
@@ -108,11 +110,7 @@ static struct console_output_driver consout = {
void serial_init(void)
{
- if (!lib_sysinfo.serial)
- return;
-
- serial_is_mem_mapped =
- (lib_sysinfo.serial->type == CB_SERIAL_TYPE_MEMORY_MAPPED);
+ serial_is_mem_mapped = (cb_serial.type == CB_SERIAL_TYPE_MEMORY_MAPPED);
if (!serial_is_mem_mapped) {
#if CONFIG(LP_IO_ADDRESS_SPACE)
@@ -130,15 +128,16 @@ void serial_init(void)
#if CONFIG(LP_SERIAL_SET_SPEED)
serial_hardware_init(CONFIG_LP_SERIAL_BAUD_RATE, 8, 0, 1);
#endif
+ serial_hardware_is_present = 1;
}
void serial_console_init(void)
{
if (!lib_sysinfo.serial)
return;
+ cb_serial = *lib_sysinfo.serial;
serial_init();
- serial_hardware_is_present = 1;
console_add_input_driver(&consin);
console_add_output_driver(&consout);
diff --git a/payloads/libpayload/drivers/serial/ipq40xx.c b/payloads/libpayload/drivers/serial/ipq40xx.c
index 7656ad73e0..5a9079b46b 100644
--- a/payloads/libpayload/drivers/serial/ipq40xx.c
+++ b/payloads/libpayload/drivers/serial/ipq40xx.c
@@ -442,7 +442,7 @@ static unsigned int msm_boot_uart_dm_reset(void *base)
}
/*
- * msm_boot_uart_dm_init - initilaizes UART controller
+ * msm_boot_uart_dm_init - Initializes UART controller
* @uart_dm_base: UART controller base address
*/
unsigned int msm_boot_uart_dm_init(void *uart_dm_base)
@@ -550,7 +550,7 @@ int serial_getchar(void)
static struct console_input_driver consin = {};
static struct console_output_driver consout = {};
-/* For simplicity sake let's rely on coreboot initalizing the UART. */
+/* For simplicity's sake, let's rely on coreboot initializing the UART. */
void serial_console_init(void)
{
struct cb_serial *sc_ptr = lib_sysinfo.serial;
diff --git a/payloads/libpayload/drivers/serial/ipq806x.c b/payloads/libpayload/drivers/serial/ipq806x.c
index 183ada6563..ef4ce80849 100644
--- a/payloads/libpayload/drivers/serial/ipq806x.c
+++ b/payloads/libpayload/drivers/serial/ipq806x.c
@@ -235,7 +235,7 @@ static unsigned int msm_boot_uart_dm_reset(void *base)
}
/*
- * msm_boot_uart_dm_init - initilaizes UART controller
+ * msm_boot_uart_dm_init - Initializes UART controller
* @uart_dm_base: UART controller base address
*/
static unsigned int msm_boot_uart_dm_init(void *uart_dm_base)
@@ -340,7 +340,7 @@ int serial_getchar(void)
return byte;
}
-/* For simplicity sake let's rely on coreboot initalizing the UART. */
+/* For simplicity's sake, let's rely on coreboot initializing the UART. */
void serial_console_init(void)
{
struct cb_serial *sc_ptr = lib_sysinfo.serial;
diff --git a/payloads/libpayload/drivers/serial/qcom_qupv3_serial.c b/payloads/libpayload/drivers/serial/qcom_qupv3_serial.c
new file mode 100644
index 0000000000..9100a27a8c
--- /dev/null
+++ b/payloads/libpayload/drivers/serial/qcom_qupv3_serial.c
@@ -0,0 +1,341 @@
+/*
+ * This file is part of the libpayload project.
+ * Copyright (c) 2020 Qualcomm Technologies.
+ *
+ * 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 The Linux Foundation 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 "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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.
+ */
+
+
+/* For simplicity sake let's rely on coreboot initializing the UART. */
+#include
+#include
+#include
+
+#define GENI_STATUS_M_GENI_CMD_ACTIVE_MASK 0x1
+#define RX_FIFO_WC_MSK 0x1FFFFFF
+#define START_UART_TX 0x8000000
+
+union proto_word_len {
+ u32 uart_tx_word_len;
+ u32 spi_word_len;
+};
+
+union proto_tx_trans_len {
+ u32 uart_tx_stop_bit_len;
+ u32 i2c_tx_trans_len;
+ u32 spi_tx_trans_len;
+};
+
+union proto_rx_trans_len {
+ u32 uart_tx_trans_len;
+ u32 i2c_rx_trans_len;
+ u32 spi_rx_trans_len;
+};
+
+struct qup_regs {
+ u32 geni_init_cfg_revision;
+ u32 geni_s_init_cfg_revision;
+ u8 _reserved1[0x10 - 0x08];
+ u32 geni_general_cfg;
+ u32 geni_rx_fifo_ctrl;
+ u8 _reserved2[0x20 - 0x18];
+ u32 geni_force_default_reg;
+ u32 geni_output_ctrl;
+ u32 geni_cgc_ctrl;
+ u32 geni_char_cfg;
+ u32 geni_char_data_n;
+ u8 _reserved3[0x40 - 0x34];
+ u32 geni_status;
+ u32 geni_test_bus_ctrl;
+ u32 geni_ser_m_clk_cfg;
+ u32 geni_ser_s_clk_cfg;
+ u32 geni_prog_rom_ctrl_reg;
+ u8 _reserved4[0x60 - 0x54];
+ u32 geni_clk_ctrl_ro;
+ u32 fifo_if_disable_ro;
+ u32 geni_fw_revision_ro;
+ u32 geni_s_fw_revision_ro;
+ u32 geni_fw_multilock_protns_ro;
+ u32 geni_fw_multilock_msa_ro;
+ u32 geni_fw_multilock_sp_ro;
+ u32 geni_clk_sel;
+ u32 geni_dfs_if_cfg;
+ u8 _reserved5[0x100 - 0x084];
+ u32 geni_cfg_reg0;
+ u32 geni_cfg_reg1;
+ u32 geni_cfg_reg2;
+ u32 geni_cfg_reg3;
+ u32 geni_cfg_reg4;
+ u32 geni_cfg_reg5;
+ u32 geni_cfg_reg6;
+ u32 geni_cfg_reg7;
+ u32 geni_cfg_reg8;
+ u32 geni_cfg_reg9;
+ u32 geni_cfg_reg10;
+ u32 geni_cfg_reg11;
+ u32 geni_cfg_reg12;
+ u32 geni_cfg_reg13;
+ u32 geni_cfg_reg14;
+ u32 geni_cfg_reg15;
+ u32 geni_cfg_reg16;
+ u32 geni_cfg_reg17;
+ u32 geni_cfg_reg18;
+ u8 _reserved6[0x200 - 0x14C];
+ u32 geni_cfg_reg64;
+ u32 geni_cfg_reg65;
+ u32 geni_cfg_reg66;
+ u32 geni_cfg_reg67;
+ u32 geni_cfg_reg68;
+ u32 geni_cfg_reg69;
+ u32 geni_cfg_reg70;
+ u32 geni_cfg_reg71;
+ u32 geni_cfg_reg72;
+ u32 spi_cpha;
+ u32 geni_cfg_reg74;
+ u32 proto_loopback_cfg;
+ u32 spi_cpol;
+ u32 i2c_noise_cancellation_ctl;
+ u32 i2c_monitor_ctl;
+ u32 geni_cfg_reg79;
+ u32 geni_cfg_reg80;
+ u32 geni_cfg_reg81;
+ u32 geni_cfg_reg82;
+ u32 spi_demux_output_inv;
+ u32 spi_demux_sel;
+ u32 geni_byte_granularity;
+ u32 geni_dma_mode_en;
+ u32 uart_tx_trans_cfg_reg;
+ u32 geni_tx_packing_cfg0;
+ u32 geni_tx_packing_cfg1;
+ union proto_word_len word_len;
+ union proto_tx_trans_len tx_trans_len;
+ union proto_rx_trans_len rx_trans_len;
+ u32 spi_pre_post_cmd_dly;
+ u32 i2c_scl_counters;
+ u32 geni_cfg_reg95;
+ u32 uart_rx_trans_cfg;
+ u32 geni_rx_packing_cfg0;
+ u32 geni_rx_packing_cfg1;
+ u32 uart_rx_word_len;
+ u32 geni_cfg_reg100;
+ u32 uart_rx_stale_cnt;
+ u32 geni_cfg_reg102;
+ u32 geni_cfg_reg103;
+ u32 geni_cfg_reg104;
+ u32 uart_tx_parity_cfg;
+ u32 uart_rx_parity_cfg;
+ u32 uart_manual_rfr;
+ u32 geni_cfg_reg108;
+ u32 geni_cfg_reg109;
+ u32 geni_cfg_reg110;
+ u8 _reserved7[0x600 - 0x2BC];
+ u32 geni_m_cmd0;
+ u32 geni_m_cmd_ctrl_reg;
+ u8 _reserved8[0x10 - 0x08];
+ u32 geni_m_irq_status;
+ u32 geni_m_irq_enable;
+ u32 geni_m_irq_clear;
+ u32 geni_m_irq_en_set;
+ u32 geni_m_irq_en_clear;
+ u32 geni_m_cmd_err_status;
+ u32 geni_m_fw_err_status;
+ u8 _reserved9[0x30 - 0x2C];
+ u32 geni_s_cmd0;
+ u32 geni_s_cmd_ctrl_reg;
+ u8 _reserved10[0x40 - 0x38];
+ u32 geni_s_irq_status;
+ u32 geni_s_irq_enable;
+ u32 geni_s_irq_clear;
+ u32 geni_s_irq_en_set;
+ u32 geni_s_irq_en_clear;
+ u8 _reserved11[0x700 - 0x654];
+ u32 geni_tx_fifon;
+ u8 _reserved12[0x780 - 0x704];
+ u32 geni_rx_fifon;
+ u8 _reserved13[0x800 - 0x784];
+ u32 geni_tx_fifo_status;
+ u32 geni_rx_fifo_status;
+ u32 geni_tx_fifo_threshold;
+ u32 geni_tx_watermark_reg;
+ u32 geni_rx_watermark_reg;
+ u32 geni_rx_rfr_watermark_reg;
+ u8 _reserved14[0x900 - 0x818];
+ u32 geni_gp_output_reg;
+ u8 _reserved15[0x908 - 0x904];
+ u32 geni_ios;
+ u32 geni_timestamp;
+ u32 geni_m_gp_length;
+ u32 geni_s_gp_length;
+ u8 _reserved16[0x920 - 0x918];
+ u32 geni_hw_irq_en;
+ u32 geni_hw_irq_ignore_on_active;
+ u8 _reserved17[0x930 - 0x928];
+ u32 geni_hw_irq_cmd_param_0;
+ u8 _reserved18[0xA00 - 0x934];
+ u32 geni_i3c_ibi_cfg_tablen;
+ u8 _reserved19[0xA80 - 0xA04];
+ u32 geni_i3c_ibi_status;
+ u32 geni_i3c_ibi_rd_data;
+ u32 geni_i3c_ibi_search_pattern;
+ u32 geni_i3c_ibi_search_data;
+ u32 geni_i3c_sw_ibi_en;
+ u32 geni_i3c_sw_ibi_en_recover;
+ u8 _reserved20[0xC30 - 0xA98];
+ u32 dma_tx_ptr_l;
+ u32 dma_tx_ptr_h;
+ u32 dma_tx_attr;
+ u32 dma_tx_length;
+ u32 dma_tx_irq_stat;
+ u32 dma_tx_irq_clr;
+ u32 dma_tx_irq_en;
+ u32 dma_tx_irq_en_set;
+ u32 dma_tx_irq_en_clr;
+ u32 dma_tx_length_in;
+ u32 dma_tx_fsm_rst;
+ u32 dma_tx_max_burst_size;
+ u8 _reserved21[0xD30 - 0xC60];
+ u32 dma_rx_ptr_l;
+ u32 dma_rx_ptr_h;
+ u32 dma_rx_attr;
+ u32 dma_rx_length;
+ u32 dma_rx_irq_stat;
+ u32 dma_rx_irq_clr;
+ u32 dma_rx_irq_en;
+ u32 dma_rx_irq_en_set;
+ u32 dma_rx_irq_en_clr;
+ u32 dma_rx_length_in;
+ u32 dma_rx_fsm_rst;
+ u32 dma_rx_max_burst_size;
+ u32 dma_rx_flush;
+ u8 _reserved22[0xE14 - 0xD64];
+ u32 se_irq_high_priority;
+ u32 se_gsi_event_en;
+ u32 se_irq_en;
+ u32 dma_if_en_ro;
+ u32 se_hw_param_0;
+ u32 se_hw_param_1;
+ u32 se_hw_param_2;
+ u32 dma_general_cfg;
+ u8 _reserved23[0x40 - 0x34];
+ u32 dma_debug_reg0;
+ u32 dma_test_bus_ctrl;
+ u32 se_top_test_bus_ctrl;
+ u8 _reserved24[0x1000 - 0x0E4C];
+ u32 se_geni_fw_revision;
+ u32 se_s_fw_revision;
+ u8 _reserved25[0x10-0x08];
+ u32 se_geni_cfg_ramn;
+ u8 _reserved26[0x2000 - 0x1014];
+ u32 se_geni_clk_ctrl;
+ u32 se_dma_if_en;
+ u32 se_fifo_if_disable;
+ u32 se_geni_fw_multilock_protns;
+ u32 se_geni_fw_multilock_msa;
+ u32 se_geni_fw_multilock_sp;
+};
+check_member(qup_regs, geni_clk_sel, 0x7C);
+check_member(qup_regs, geni_cfg_reg108, 0x2B0);
+check_member(qup_regs, geni_dma_mode_en, 0x258);
+check_member(qup_regs, geni_i3c_ibi_rd_data, 0xA84);
+check_member(qup_regs, dma_test_bus_ctrl, 0xE44);
+check_member(qup_regs, se_geni_cfg_ramn, 0x1010);
+check_member(qup_regs, se_geni_fw_multilock_sp, 0x2014);
+
+static struct console_input_driver consin = {
+ .havekey = serial_havechar,
+ .getchar = serial_getchar,
+ .input_type = CONSOLE_INPUT_TYPE_UART,
+};
+
+static struct console_output_driver consout = {
+ .putchar = serial_putchar,
+};
+
+static struct qup_regs *uart_base_address(void)
+{
+ return (void *)(uintptr_t)lib_sysinfo.serial->baseaddr;
+}
+
+static void uart_qupv3_tx_flush(void)
+{
+ struct qup_regs *regs = uart_base_address();
+
+ while (read32(®s->geni_status) & GENI_STATUS_M_GENI_CMD_ACTIVE_MASK)
+ ;
+}
+
+static unsigned char uart_qupv3_rx_byte(void)
+{
+ struct qup_regs *regs = uart_base_address();
+
+ if (read32(®s->geni_rx_fifo_status) & RX_FIFO_WC_MSK)
+ return read32(®s->geni_rx_fifon) & 0xFF;
+
+ return 0;
+}
+
+static void uart_qupv3_tx_byte(unsigned char data)
+{
+ struct qup_regs *regs = uart_base_address();
+
+ uart_qupv3_tx_flush();
+
+ write32(®s->rx_trans_len.uart_tx_trans_len, 1);
+ /* Start TX */
+ write32(®s->geni_m_cmd0, START_UART_TX);
+ write32(®s->geni_tx_fifon, data);
+}
+
+void serial_putchar(unsigned int data)
+{
+ if (data == 0xa)
+ uart_qupv3_tx_byte(0xd);
+ uart_qupv3_tx_byte(data);
+}
+
+int serial_havechar(void)
+{
+ struct qup_regs *regs = uart_base_address();
+
+ if (read32(®s->geni_rx_fifo_status) & RX_FIFO_WC_MSK)
+ return 1;
+
+ return 0;
+}
+
+int serial_getchar(void)
+{
+ return uart_qupv3_rx_byte();
+}
+
+void serial_console_init(void)
+{
+ if (!lib_sysinfo.serial)
+ return;
+
+ console_add_output_driver(&consout);
+ console_add_input_driver(&consin);
+}
diff --git a/payloads/libpayload/drivers/serial/qcs405.c b/payloads/libpayload/drivers/serial/qcs405.c
index 06ec5b9e1d..1a7b9e901b 100644
--- a/payloads/libpayload/drivers/serial/qcs405.c
+++ b/payloads/libpayload/drivers/serial/qcs405.c
@@ -434,7 +434,7 @@ static unsigned int msm_boot_uart_dm_reset(void *base)
}
/*
- * msm_boot_uart_dm_init - initilaizes UART controller
+ * msm_boot_uart_dm_init - Initializes UART controller
* @uart_dm_base: UART controller base address
*/
unsigned int msm_boot_uart_dm_init(void *uart_dm_base)
@@ -538,7 +538,7 @@ int serial_getchar(void)
return byte;
}
-/* For simplicity sake let's rely on coreboot initalizing the UART. */
+/* For simplicity's sake, let's rely on coreboot initializing the UART. */
void serial_console_init(void)
{
struct cb_serial *sc_ptr = lib_sysinfo.serial;
diff --git a/payloads/libpayload/drivers/udc/chipidea.c b/payloads/libpayload/drivers/udc/chipidea.c
index 702cd6e4d2..d8d02f22c8 100644
--- a/payloads/libpayload/drivers/udc/chipidea.c
+++ b/payloads/libpayload/drivers/udc/chipidea.c
@@ -81,7 +81,7 @@ static int chipidea_hw_init(struct usbdev_ctrl *this, void *_opreg,
memcpy(&this->device_descriptor, dd, sizeof(*dd));
if (p->qhlist == NULL)
- die("failed to allocate memory for usb device mode");
+ die("failed to allocate memory for USB device mode");
memset(p->qhlist, 0, sizeof(struct qh) * CI_QHELEMENTS);
@@ -102,7 +102,7 @@ static int chipidea_hw_init(struct usbdev_ctrl *this, void *_opreg,
p->qhlist[1].config = QH_MPS(64) | QH_NO_AUTO_ZLT | QH_IOS;
do {
- debug("waiting for usb phy clk valid: %x\n",
+ debug("waiting for USB phy clk valid: %x\n",
readl(&p->opreg->susp_ctrl));
mdelay(1);
} while ((readl(&p->opreg->susp_ctrl) & (1 << 7)) == 0);
diff --git a/payloads/libpayload/drivers/udc/chipidea_priv.h b/payloads/libpayload/drivers/udc/chipidea_priv.h
index ede97ab264..82870c3579 100644
--- a/payloads/libpayload/drivers/udc/chipidea_priv.h
+++ b/payloads/libpayload/drivers/udc/chipidea_priv.h
@@ -47,7 +47,7 @@ struct chipidea_opreg {
uint32_t portsc; // 0x174
uint32_t pad178[15];
uint32_t devlc; // 0x1b4
- /* 25:26: host-desired usb version
+ /* 25:26: host-desired USB version
* 23: force full speed */
uint32_t pad1b8[16];
uint32_t usbmode; // 0x1f8
diff --git a/payloads/libpayload/drivers/udc/dwc2.c b/payloads/libpayload/drivers/udc/dwc2.c
index e95eb7938d..025c0710fe 100644
--- a/payloads/libpayload/drivers/udc/dwc2.c
+++ b/payloads/libpayload/drivers/udc/dwc2.c
@@ -253,7 +253,7 @@ static void dwc2_halt_ep(struct usbdev_ctrl *this, int ep, int in_dir)
usb_debug("dwc2_halt_ep ep %d-%d\n", ep, in_dir);
depctl.d32 = readl(&ep_reg->depctl);
- /*Alread disabled*/
+ /* Already disabled */
if (!depctl.epena)
return;
/* First step: disable EP */
@@ -558,7 +558,7 @@ static void dwc2_outep_intr(struct usbdev_ctrl *this, dwc2_ep_t *ep)
writel(DXEPINT_AHBERR, &ep->ep_regs->depint);
}
- /* Handle Setup Phase Done (Contorl Ep) */
+ /* Handle Setup Phase Done (Control Ep) */
if (depint.setup) {
usb_debug("DEPINT_SETUP\n");
writel(DXEPINT_SETUP, &ep->ep_regs->depint);
diff --git a/payloads/libpayload/drivers/usb/dwc2.c b/payloads/libpayload/drivers/usb/dwc2.c
index 963ae84762..eef486bcc9 100644
--- a/payloads/libpayload/drivers/usb/dwc2.c
+++ b/payloads/libpayload/drivers/usb/dwc2.c
@@ -233,7 +233,7 @@ dwc2_do_xfer(endpoint_t *ep, int size, int pid, ep_dir_t dir,
packet_size = ep->maxpacketsize;
packet_cnt = ALIGN_UP(size, packet_size) / packet_size;
inpkt_length = packet_cnt * packet_size;
- /* At least 1 packet should be programed */
+ /* At least 1 packet should be programmed */
packet_cnt = (packet_cnt == 0) ? 1 : packet_cnt;
/*
diff --git a/payloads/libpayload/drivers/usb/ehci.c b/payloads/libpayload/drivers/usb/ehci.c
index 68763402af..7969febce9 100644
--- a/payloads/libpayload/drivers/usb/ehci.c
+++ b/payloads/libpayload/drivers/usb/ehci.c
@@ -78,7 +78,7 @@ static void dump_qh(ehci_qh_t *cur)
usb_debug("+===================================================+\n");
usb_debug("| ############# EHCI QH at [0x%08lx] ########### |\n", virt_to_phys(cur));
usb_debug("+---------------------------------------------------+\n");
- usb_debug("| Horizonal Link Pointer [0x%08lx] |\n", cur->horiz_link_ptr);
+ usb_debug("| Horizontal Link Pointer [0x%08lx] |\n", cur->horiz_link_ptr);
usb_debug("+------------------[ 0x%08lx ]-------------------+\n", cur->epchar);
usb_debug("| | Maximum Packet Length | [%04ld] |\n", ((cur->epchar & (0x7ffUL << 16)) >> 16));
usb_debug("| | Device Address | [%ld] |\n", cur->epchar & 0x7F);
@@ -133,7 +133,7 @@ static void ehci_reset (hci_t *controller)
{
short count = 0;
ehci_stop(controller);
- /* wait 10 ms just to be shure */
+ /* wait 10 ms just to be sure */
mdelay(10);
if (EHCI_INST(controller)->operation->usbsts & HC_OP_HC_HALTED) {
EHCI_INST(controller)->operation->usbcmd = HC_OP_HC_RESET;
@@ -215,7 +215,7 @@ static int fill_td(qtd_t *td, void* data, int datalen)
total_len += page_len;
while (page_no < 5) {
- /* we have a continguous mapping between virtual and physical memory */
+ /* we have a contiguous mapping between virtual and physical memory */
page += 4096;
td->bufptrs[page_no++] = page;
@@ -291,7 +291,7 @@ static int ehci_set_async_schedule(ehci_t *ehcic, int enable)
/* Memory barrier to ensure that all memory accesses before we set the
* async schedule are complete. It was observed especially in the case of
- * arm64, that netboot and usb stuff resulted in lots of errors possibly
+ * arm64, that netboot and USB stuff resulted in lots of errors possibly
* due to CPU reordering. Hence, enforcing strict CPU ordering.
*/
mb();
@@ -860,9 +860,9 @@ ehci_pci_init (pcidev_t addr)
hci_t *controller;
u32 reg_base;
- u32 pci_command = pci_read_config32(addr, PCI_COMMAND);
+ u16 pci_command = pci_read_config16(addr, PCI_COMMAND);
pci_command = (pci_command | PCI_COMMAND_MEMORY) & ~PCI_COMMAND_IO ;
- pci_write_config32(addr, PCI_COMMAND, pci_command);
+ pci_write_config16(addr, PCI_COMMAND, pci_command);
reg_base = pci_read_config32 (addr, USBBASE);
diff --git a/payloads/libpayload/drivers/usb/generic_hub.c b/payloads/libpayload/drivers/usb/generic_hub.c
index 9d444ee792..7263400840 100644
--- a/payloads/libpayload/drivers/usb/generic_hub.c
+++ b/payloads/libpayload/drivers/usb/generic_hub.c
@@ -218,9 +218,11 @@ generic_hub_poll(usbdev_t *const dev)
if (!hub)
return;
- if (hub->ops->hub_status_changed &&
- hub->ops->hub_status_changed(dev) != 1)
+ if (!(dev->quirks & USB_QUIRK_HUB_NO_USBSTS_PCD) &&
+ hub->ops->hub_status_changed &&
+ hub->ops->hub_status_changed(dev) != 1) {
return;
+ }
int port;
for (port = 1; port <= hub->num_ports; ++port) {
diff --git a/payloads/libpayload/drivers/usb/ohci.c b/payloads/libpayload/drivers/usb/ohci.c
index f1dc081656..2571273378 100644
--- a/payloads/libpayload/drivers/usb/ohci.c
+++ b/payloads/libpayload/drivers/usb/ohci.c
@@ -66,7 +66,7 @@ dump_td (td_t *cur)
usb_debug("|:| C | Condition Code | [%02ld] |:|\n", (cur->config & (0xFUL << 28)) >> 28);
usb_debug("|:| O | Direction/PID | [%ld] |:|\n", (cur->config & (3UL << 19)) >> 19);
usb_debug("|:| N | Buffer Rounding | [%ld] |:|\n", (cur->config & (1UL << 18)) >> 18);
- usb_debug("|:| F | Delay Intterrupt | [%ld] |:|\n", (cur->config & (7UL << 21)) >> 21);
+ usb_debug("|:| F | Delay Interrupt | [%ld] |:|\n", (cur->config & (7UL << 21)) >> 21);
usb_debug("|:| I | Data Toggle | [%ld] |:|\n", (cur->config & (3UL << 24)) >> 24);
usb_debug("|:| G | Error Count | [%ld] |:|\n", (cur->config & (3UL << 26)) >> 26);
usb_debug("|:+-----------------------------------------------+:|\n");
@@ -879,7 +879,7 @@ ohci_process_done_queue(ohci_t *const ohci, const int spew_debug)
intrq_td_t *const td = INTRQ_TD_FROM_TD(done_td);
intr_queue_t *const intrq = td->intrq;
/* Check if the corresponding interrupt
- queue is still beeing processed. */
+ queue is still being processed. */
if (intrq->destroy) {
/* Free this TD, and */
free(td);
diff --git a/payloads/libpayload/drivers/usb/quirks.c b/payloads/libpayload/drivers/usb/quirks.c
index 0a3514933c..d5be0e6cda 100644
--- a/payloads/libpayload/drivers/usb/quirks.c
+++ b/payloads/libpayload/drivers/usb/quirks.c
@@ -59,6 +59,30 @@ usb_quirks_t usb_quirks[] = {
*/
};
+#if CONFIG(LP_USB_PCI)
+usb_quirks_t pci_quirks[] = {
+ /* QEMU XHCI root hub does not implement port change detect */
+ { 0x1b36, 0x000d, USB_QUIRK_HUB_NO_USBSTS_PCD, 0 },
+};
+
+u32 pci_quirk_check(pcidev_t controller)
+{
+ int i;
+ u16 vendor = pci_read_config16(controller, REG_VENDOR_ID);
+ u16 device = pci_read_config16(controller, REG_DEVICE_ID);
+
+ for (i = 0; i < ARRAY_SIZE(pci_quirks); i++) {
+ if ((pci_quirks[i].vendor == vendor) &&
+ (pci_quirks[i].device == device)) {
+ printf("PCI quirks enabled: %08x\n", pci_quirks[i].quirks);
+ return pci_quirks[i].quirks;
+ }
+ }
+
+ return USB_QUIRK_NONE;
+}
+#endif
+
u32 usb_quirk_check(u16 vendor, u16 device)
{
int i;
diff --git a/payloads/libpayload/drivers/usb/usb.c b/payloads/libpayload/drivers/usb/usb.c
index 4004def9d9..942e1b1f6b 100644
--- a/payloads/libpayload/drivers/usb/usb.c
+++ b/payloads/libpayload/drivers/usb/usb.c
@@ -499,7 +499,7 @@ set_address (hci_t *controller, usb_speed speed, int hubport, int hubaddr)
break;
}
- /* Gather up all endpoints belonging to this inteface */
+ /* Gather up all endpoints belonging to this interface */
dev->num_endp = 1;
for (; ptr + 2 <= end && ptr[0] && ptr + ptr[0] <= end; ptr += ptr[0]) {
if (ptr[1] == DT_INTF || ptr[1] == DT_CFG ||
@@ -634,14 +634,14 @@ set_address (hci_t *controller, usb_speed speed, int hubport, int hubaddr)
/*
* Should be called by the hub drivers whenever a physical detach occurs
- * and can be called by usb class drivers if they are unsatisfied with a
+ * and can be called by USB class drivers if they are unsatisfied with a
* malfunctioning device.
*/
void
usb_detach_device(hci_t *controller, int devno)
{
/* check if device exists, as we may have
- been called yet by the usb class driver */
+ been called yet by the USB class driver */
if (controller->devices[devno]) {
controller->devices[devno]->destroy (controller->devices[devno]);
@@ -654,7 +654,7 @@ usb_detach_device(hci_t *controller, int devno)
controller->devices[devno]->configuration = NULL;
/* Tear down the device itself *after* destroy_device()
- * has had a chance to interoogate it. */
+ * has had a chance to interrogate it. */
free(controller->devices[devno]);
controller->devices[devno] = NULL;
}
diff --git a/payloads/libpayload/drivers/usb/usbhub.c b/payloads/libpayload/drivers/usb/usbhub.c
index 87c58169c5..5c39eac3d9 100644
--- a/payloads/libpayload/drivers/usb/usbhub.c
+++ b/payloads/libpayload/drivers/usb/usbhub.c
@@ -285,7 +285,7 @@ usb_hub_init(usbdev_t *const dev)
return;
}
- /* Get number of ports from hub decriptor */
+ /* Get number of ports from hub descriptor */
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,
diff --git a/payloads/libpayload/drivers/usb/usbinit.c b/payloads/libpayload/drivers/usb/usbinit.c
index 0ac27e4456..49634c6c06 100644
--- a/payloads/libpayload/drivers/usb/usbinit.c
+++ b/payloads/libpayload/drivers/usb/usbinit.c
@@ -62,11 +62,11 @@ static int usb_controller_initialize(int bus, int dev, int func)
/* enable busmaster */
if (devclass == 0xc03) {
- u32 pci_command;
+ u16 pci_command;
- pci_command = pci_read_config32(pci_device, PCI_COMMAND);
+ pci_command = pci_read_config16(pci_device, PCI_COMMAND);
pci_command |= PCI_COMMAND_MASTER;
- pci_write_config32(pci_device, PCI_COMMAND, pci_command);
+ pci_write_config16(pci_device, PCI_COMMAND, pci_command);
usb_debug("%02x:%02x.%x %04x:%04x.%d ", bus, dev, func,
pciid >> 16, pciid & 0xFFFF, func);
diff --git a/payloads/libpayload/drivers/usb/usbmsc.c b/payloads/libpayload/drivers/usb/usbmsc.c
index d8b7bcea6e..ed7ad1acd4 100755
--- a/payloads/libpayload/drivers/usb/usbmsc.c
+++ b/payloads/libpayload/drivers/usb/usbmsc.c
@@ -126,7 +126,7 @@ enum {
* MSC commands can be
* successful,
* fail with proper response or
- * fail totally, which results in detaching of the usb device
+ * fail totally, which results in detaching of the USB device
* and immediate cleanup of the usbdev_t structure.
* In the latter case the caller has to make sure, that he won't
* use the device any more.
@@ -538,7 +538,7 @@ usb_msc_test_unit_ready (usbdev_t *dev)
time_t start_time_secs;
struct timeval tv;
/* SCSI/ATA specs say we have to wait up to 30s, but most devices
- * are ready much sooner. Use a 5 sec timeout to better accomodate
+ * are ready much sooner. Use a 5 sec timeout to better accommodate
* devices which fail to respond. */
const int timeout_secs = 5;
@@ -569,7 +569,7 @@ usb_msc_test_unit_ready (usbdev_t *dev)
MSC_INST (dev)->ready = USB_MSC_NOT_READY;
}
- /* Don't bother spinning up the stroage device if the device is not
+ /* Don't bother spinning up the storage device if the device is not
* ready. This can happen when empty card readers are present.
* Polling will pick it back up if readiness changes. */
if (!MSC_INST (dev)->ready)
@@ -703,14 +703,14 @@ usb_msc_poll (usbdev_t *dev)
return;
if (!prev_ready && msc->ready) {
- usb_debug ("usb msc: not ready -> ready (lun %d)\n", msc->lun);
+ usb_debug ("USB msc: not ready -> ready (lun %d)\n", msc->lun);
usb_msc_create_disk (dev);
} else if (prev_ready && !msc->ready) {
- usb_debug ("usb msc: ready -> not ready (lun %d)\n", msc->lun);
+ usb_debug ("USB msc: ready -> not ready (lun %d)\n", msc->lun);
usb_msc_remove_disk (dev);
} else if (!prev_ready && !msc->ready) {
u8 new_lun = (msc->lun + 1) % msc->num_luns;
- usb_debug("usb msc: not ready (lun %d) -> lun %d\n", msc->lun,
+ usb_debug("USB msc: not ready (lun %d) -> lun %d\n", msc->lun,
new_lun);
msc->lun = new_lun;
}
diff --git a/payloads/libpayload/drivers/usb/xhci.c b/payloads/libpayload/drivers/usb/xhci.c
index 0a69c5137b..53dd782c84 100644
--- a/payloads/libpayload/drivers/usb/xhci.c
+++ b/payloads/libpayload/drivers/usb/xhci.c
@@ -185,26 +185,27 @@ xhci_init (unsigned long physical_bar)
goto _free_xhci;
}
- xhci->capreg = phys_to_virt(physical_bar);
- xhci->opreg = ((void *)xhci->capreg) + xhci->capreg->caplength;
- xhci->hcrreg = ((void *)xhci->capreg) + xhci->capreg->rtsoff;
- xhci->dbreg = ((void *)xhci->capreg) + xhci->capreg->dboff;
+ xhci->capreg = phys_to_virt(physical_bar);
+ xhci->opreg = phys_to_virt(physical_bar) + CAP_GET(CAPLEN, xhci->capreg);
+ xhci->hcrreg = phys_to_virt(physical_bar) + xhci->capreg->rtsoff;
+ xhci->dbreg = phys_to_virt(physical_bar) + xhci->capreg->dboff;
+
xhci_debug("regbase: 0x%"PRIx32"\n", physical_bar);
- xhci_debug("caplen: 0x%"PRIx32"\n", xhci->capreg->caplength);
+ xhci_debug("caplen: 0x%"PRIx32"\n", CAP_GET(CAPLEN, xhci->capreg));
xhci_debug("rtsoff: 0x%"PRIx32"\n", xhci->capreg->rtsoff);
xhci_debug("dboff: 0x%"PRIx32"\n", xhci->capreg->dboff);
xhci_debug("hciversion: %"PRIx8".%"PRIx8"\n",
- xhci->capreg->hciver_hi, xhci->capreg->hciver_lo);
- if ((xhci->capreg->hciversion < 0x96) ||
- (xhci->capreg->hciversion > 0x110)) {
+ CAP_GET(CAPVER_HI, xhci->capreg), CAP_GET(CAPVER_LO, xhci->capreg));
+ if ((CAP_GET(CAPVER, xhci->capreg) < 0x96) ||
+ (CAP_GET(CAPVER, xhci->capreg) > 0x120)) {
xhci_debug("Unsupported xHCI version\n");
goto _free_xhci;
}
xhci_debug("context size: %dB\n", CTXSIZE(xhci));
- xhci_debug("maxslots: 0x%02lx\n", xhci->capreg->MaxSlots);
- xhci_debug("maxports: 0x%02lx\n", xhci->capreg->MaxPorts);
+ xhci_debug("maxslots: 0x%02lx\n", CAP_GET(MAXSLOTS, xhci->capreg));
+ xhci_debug("maxports: 0x%02lx\n", CAP_GET(MAXPORTS, xhci->capreg));
const unsigned pagesize = xhci->opreg->pagesize << 12;
xhci_debug("pagesize: 0x%04x\n", pagesize);
@@ -213,7 +214,8 @@ xhci_init (unsigned long physical_bar)
* structures at first and can still chicken out easily if we run out
* of memory.
*/
- xhci->max_slots_en = xhci->capreg->MaxSlots & CONFIG_LP_MASK_MaxSlotsEn;
+ xhci->max_slots_en = CAP_GET(MAXSLOTS, xhci->capreg) &
+ CONFIG_LP_MASK_MaxSlotsEn;
xhci->dcbaa = xhci_align(64, (xhci->max_slots_en + 1) * sizeof(u64));
xhci->dev = malloc((xhci->max_slots_en + 1) * sizeof(*xhci->dev));
if (!xhci->dcbaa || !xhci->dev) {
@@ -227,8 +229,9 @@ xhci_init (unsigned long physical_bar)
* Let dcbaa[0] point to another array of pointers, sp_ptrs.
* The pointers therein point to scratchpad buffers (pages).
*/
- const size_t max_sp_bufs = xhci->capreg->Max_Scratchpad_Bufs_Hi << 5 |
- xhci->capreg->Max_Scratchpad_Bufs_Lo;
+ const size_t max_sp_bufs =
+ CAP_GET(MAX_SCRATCH_BUFS_HI, xhci->capreg) << 5 |
+ CAP_GET(MAX_SCRATCH_BUFS_LO, xhci->capreg);
xhci_debug("max scratchpad bufs: 0x%zx\n", max_sp_bufs);
if (max_sp_bufs) {
const size_t sp_ptrs_size = max_sp_bufs * sizeof(u64);
@@ -311,9 +314,13 @@ xhci_pci_init (pcidev_t addr)
controller = xhci_init((unsigned long)reg_addr);
if (controller) {
+ xhci_t *xhci = controller->instance;
controller->pcidev = addr;
xhci_switch_ppt_ports(addr);
+
+ /* Set up any quirks for controller root hub */
+ xhci->roothub->quirks = pci_quirk_check(addr);
}
return controller;
@@ -376,7 +383,8 @@ xhci_reinit (hci_t *controller)
xhci_debug("event ring @%p (0x%08x)\n",
xhci->er.ring, virt_to_phys(xhci->er.ring));
xhci_debug("ERST Max: 0x%lx -> 0x%lx entries\n",
- xhci->capreg->ERST_Max, 1 << xhci->capreg->ERST_Max);
+ CAP_GET(ERST_MAX, xhci->capreg),
+ 1 << CAP_GET(ERST_MAX, xhci->capreg));
memset((void*)xhci->ev_ring_table, 0x00, sizeof(erst_entry_t));
xhci->ev_ring_table[0].seg_base_lo = virt_to_phys(xhci->er.ring);
xhci->ev_ring_table[0].seg_base_hi = 0;
@@ -432,8 +440,9 @@ xhci_shutdown(hci_t *const controller)
#endif
if (xhci->sp_ptrs) {
- size_t max_sp_bufs = xhci->capreg->Max_Scratchpad_Bufs_Hi << 5 |
- xhci->capreg->Max_Scratchpad_Bufs_Lo;
+ const size_t max_sp_bufs =
+ CAP_GET(MAX_SCRATCH_BUFS_HI, xhci->capreg) << 5 |
+ CAP_GET(MAX_SCRATCH_BUFS_LO, xhci->capreg);
for (i = 0; i < max_sp_bufs; ++i) {
if (xhci->sp_ptrs[i])
free(phys_to_virt(xhci->sp_ptrs[i]));
diff --git a/payloads/libpayload/drivers/usb/xhci_private.h b/payloads/libpayload/drivers/usb/xhci_private.h
index ab1dfa98e1..0264f1f218 100644
--- a/payloads/libpayload/drivers/usb/xhci_private.h
+++ b/payloads/libpayload/drivers/usb/xhci_private.h
@@ -274,7 +274,6 @@ typedef volatile struct epctx {
} epctx_t;
#define NUM_EPS 32
-#define CTXSIZE(xhci) ((xhci)->capreg->csz ? 64 : 32)
typedef union devctx {
/* set of pointers, so we can dynamically adjust Slot/EP context size */
@@ -321,65 +320,64 @@ typedef struct erst_entry {
u32 rsvd;
} erst_entry_t;
+#define CAP_CAPLEN_FIELD hciparams
+#define CAP_CAPLEN_START 0
+#define CAP_CAPLEN_LEN 8
+#define CAP_CAPVER_FIELD hciparams
+#define CAP_CAPVER_START 16
+#define CAP_CAPVER_LEN 16
+#define CAP_CAPVER_HI_FIELD hciparams
+#define CAP_CAPVER_HI_START 24
+#define CAP_CAPVER_HI_LEN 8
+#define CAP_CAPVER_LO_FIELD hciparams
+#define CAP_CAPVER_LO_START 16
+#define CAP_CAPVER_LO_LEN 8
+#define CAP_MAXSLOTS_FIELD hcsparams1
+#define CAP_MAXSLOTS_START 0
+#define CAP_MAXSLOTS_LEN 7
+#define CAP_MAXINTRS_FIELD hcsparams1
+#define CAP_MAXINTRS_START 7
+#define CAP_MAXINTRS_LEN 11
+#define CAP_MAXPORTS_FIELD hcsparams1
+#define CAP_MAXPORTS_START 24
+#define CAP_MAXPORTS_LEN 8
+#define CAP_IST_FIELD hcsparams2
+#define CAP_IST_START 0
+#define CAP_IST_LEN 4
+#define CAP_ERST_MAX_FIELD hcsparams2
+#define CAP_ERST_MAX_START 4
+#define CAP_ERST_MAX_LEN 4
+#define CAP_MAX_SCRATCH_BUFS_HI_FIELD hcsparams2
+#define CAP_MAX_SCRATCH_BUFS_HI_START 21
+#define CAP_MAX_SCRATCH_BUFS_HI_LEN 5
+#define CAP_MAX_SCRATCH_BUFS_LO_FIELD hcsparams2
+#define CAP_MAX_SCRATCH_BUFS_LO_START 27
+#define CAP_MAX_SCRATCH_BUFS_LO_LEN 5
+#define CAP_U1_LATENCY_FIELD hcsparams3
+#define CAP_U1_LATENCY_START 0
+#define CAP_U1_LATENCY_LEN 8
+#define CAP_U2_LATENCY_FIELD hcsparams3
+#define CAP_U2_LATENCY_START 16
+#define CAP_U2_LATENCY_LEN 16
+#define CAP_CSZ_FIELD hccparams
+#define CAP_CSZ_START 2
+#define CAP_CSZ_LEN 1
+
+#define CAP_MASK(tok) MASK(CAP_##tok##_START, CAP_##tok##_LEN)
+#define CAP_GET(tok, cap) (((cap)->CAP_##tok##_FIELD & CAP_MASK(tok)) \
+ >> CAP_##tok##_START)
+
+#define CTXSIZE(xhci) (CAP_GET(CSZ, (xhci)->capreg) ? 64 : 32)
+
typedef struct xhci {
- /* capreg is read-only, so no need for volatile,
- and thus 32bit accesses can be assumed. */
struct capreg {
- u8 caplength; /* 0x00 */
- u8 res1; /* 0x01 */
- union { /* 0x02 */
- u16 hciversion;
- struct {
- u8 hciver_lo;
- u8 hciver_hi;
- } __packed;
- } __packed;
- union { /* 0x04 */
- u32 hcsparams1;
- struct {
- unsigned long MaxSlots:7;
- unsigned long MaxIntrs:11;
- unsigned long:6;
- unsigned long MaxPorts:8;
- } __packed;
- } __packed;
- union { /* 0x08 */
- u32 hcsparams2;
- struct {
- unsigned long IST:4;
- unsigned long ERST_Max:4;
- unsigned long:13;
- unsigned long Max_Scratchpad_Bufs_Hi:5;
- unsigned long SPR:1;
- unsigned long Max_Scratchpad_Bufs_Lo:5;
- } __packed;
- } __packed;
- union { /* 0x0C */
- u32 hcsparams3;
- struct {
- unsigned long u1latency:8;
- unsigned long:8;
- unsigned long u2latency:16;
- } __packed;
- } __packed;
- union { /* 0x10 */
- u32 hccparams;
- struct {
- unsigned long ac64:1;
- unsigned long bnc:1;
- unsigned long csz:1;
- unsigned long ppc:1;
- unsigned long pind:1;
- unsigned long lhrc:1;
- unsigned long ltc:1;
- unsigned long nss:1;
- unsigned long:4;
- unsigned long MaxPSASize:4;
- unsigned long xECP:16;
- } __packed;
- } __packed;
- u32 dboff; /* 0x14 */
- u32 rtsoff; /* 0x18 */
+ u32 hciparams;
+ u32 hcsparams1;
+ u32 hcsparams2;
+ u32 hcsparams3;
+ u32 hccparams;
+ u32 dboff;
+ u32 rtsoff;
} __packed *capreg;
/* opreg is R/W is most places, so volatile access is necessary.
diff --git a/payloads/libpayload/drivers/usb/xhci_rh.c b/payloads/libpayload/drivers/usb/xhci_rh.c
index 453fa5b409..865b9ac18b 100644
--- a/payloads/libpayload/drivers/usb/xhci_rh.c
+++ b/payloads/libpayload/drivers/usb/xhci_rh.c
@@ -160,7 +160,7 @@ xhci_rh_init (usbdev_t *dev)
dev->port = -1;
const int num_ports = /* TODO: maybe we need to read extended caps */
- (XHCI_INST(dev->controller)->capreg->hcsparams1 >> 24) & 0xff;
+ CAP_GET(MAXPORTS, XHCI_INST(dev->controller)->capreg);
generic_hub_init(dev, num_ports, &xhci_rh_ops);
usb_debug("xHCI: root hub init done\n");
diff --git a/payloads/libpayload/drivers/video/corebootfb.c b/payloads/libpayload/drivers/video/corebootfb.c
index b5ad1a511d..efd13a7d12 100644
--- a/payloads/libpayload/drivers/video/corebootfb.c
+++ b/payloads/libpayload/drivers/video/corebootfb.c
@@ -61,45 +61,42 @@ static const u32 vga_colors[] = {
(0xFF << 16) | (0xFF << 8) | 0xFF,
};
-/* Addresses for the various components */
-static unsigned long fbinfo;
-static unsigned long fbaddr;
-static unsigned long chars;
+struct cb_framebuffer fbinfo;
+static unsigned short *chars;
-#define FI ((struct cb_framebuffer *) phys_to_virt(fbinfo))
-#define FB ((unsigned char *) phys_to_virt(fbaddr))
-#define CHARS ((unsigned short *) phys_to_virt(chars))
+/* Shorthand for up-to-date virtual framebuffer address */
+#define FB ((unsigned char *)phys_to_virt(fbinfo.physical_address))
static void corebootfb_scroll_up(void)
{
unsigned char *dst = FB;
- unsigned char *src = FB + (FI->bytes_per_line * font_height);
+ unsigned char *src = FB + (fbinfo.bytes_per_line * font_height);
int y;
/* Scroll all lines up */
- for(y = 0; y < FI->y_resolution - font_height; y++) {
- memcpy(dst, src, FI->x_resolution * (FI->bits_per_pixel >> 3));
+ for (y = 0; y < fbinfo.y_resolution - font_height; y++) {
+ memcpy(dst, src, fbinfo.x_resolution * (fbinfo.bits_per_pixel >> 3));
- dst += FI->bytes_per_line;
- src += FI->bytes_per_line;
+ dst += fbinfo.bytes_per_line;
+ src += fbinfo.bytes_per_line;
}
/* Erase last line */
- dst = FB + (FI->y_resolution - font_height) * FI->bytes_per_line;
+ dst = FB + (fbinfo.y_resolution - font_height) * fbinfo.bytes_per_line;
- for(; y < FI->y_resolution; y++) {
- memset(dst, 0, FI->x_resolution * (FI->bits_per_pixel >> 3));
- dst += FI->bytes_per_line;
+ for (; y < fbinfo.y_resolution; y++) {
+ memset(dst, 0, fbinfo.x_resolution * (fbinfo.bits_per_pixel >> 3));
+ dst += fbinfo.bytes_per_line;
}
/* And update the char buffer */
- dst = (unsigned char *) CHARS;
- src = (unsigned char *) (CHARS + coreboot_video_console.columns);
+ dst = (unsigned char *)chars;
+ src = (unsigned char *)(chars + coreboot_video_console.columns);
memcpy(dst, src, coreboot_video_console.columns *
(coreboot_video_console.rows - 1) * 2);
int column;
for (column = 0; column < coreboot_video_console.columns; column++)
- CHARS[(coreboot_video_console.rows - 1) * coreboot_video_console.columns + column] = (VGA_COLOR_DEFAULT << 8);
+ chars[(coreboot_video_console.rows - 1) * coreboot_video_console.columns + column] = (VGA_COLOR_DEFAULT << 8);
cursor_y--;
}
@@ -110,15 +107,15 @@ static void corebootfb_clear(void)
unsigned char *ptr = FB;
/* Clear the screen */
- for(row = 0; row < FI->y_resolution; row++) {
- memset(ptr, 0, FI->x_resolution * (FI->bits_per_pixel >> 3));
- ptr += FI->bytes_per_line;
+ for (row = 0; row < fbinfo.y_resolution; row++) {
+ memset(ptr, 0, fbinfo.x_resolution * (fbinfo.bits_per_pixel >> 3));
+ ptr += fbinfo.bytes_per_line;
}
/* And update the char buffer */
for(row = 0; row < coreboot_video_console.rows; row++)
for (column = 0; column < coreboot_video_console.columns; column++)
- CHARS[row * coreboot_video_console.columns + column] = (VGA_COLOR_DEFAULT << 8);
+ chars[row * coreboot_video_console.columns + column] = (VGA_COLOR_DEFAULT << 8);
}
static void corebootfb_putchar(u8 row, u8 col, unsigned int ch)
@@ -133,55 +130,55 @@ static void corebootfb_putchar(u8 row, u8 col, unsigned int ch)
int x, y;
- if (FI->bits_per_pixel > 8) {
- bgval = ((((vga_colors[bg] >> 0) & 0xff) >> (8 - FI->blue_mask_size)) << FI->blue_mask_pos) |
- ((((vga_colors[bg] >> 8) & 0xff) >> (8 - FI->green_mask_size)) << FI->green_mask_pos) |
- ((((vga_colors[bg] >> 16) & 0xff) >> (8 - FI->red_mask_size)) << FI->red_mask_pos);
- fgval = ((((vga_colors[fg] >> 0) & 0xff) >> (8 - FI->blue_mask_size)) << FI->blue_mask_pos) |
- ((((vga_colors[fg] >> 8) & 0xff) >> (8 - FI->green_mask_size)) << FI->green_mask_pos) |
- ((((vga_colors[fg] >> 16) & 0xff) >> (8 - FI->red_mask_size)) << FI->red_mask_pos);
+ if (fbinfo.bits_per_pixel > 8) {
+ bgval = ((((vga_colors[bg] >> 0) & 0xff) >> (8 - fbinfo.blue_mask_size)) << fbinfo.blue_mask_pos) |
+ ((((vga_colors[bg] >> 8) & 0xff) >> (8 - fbinfo.green_mask_size)) << fbinfo.green_mask_pos) |
+ ((((vga_colors[bg] >> 16) & 0xff) >> (8 - fbinfo.red_mask_size)) << fbinfo.red_mask_pos);
+ fgval = ((((vga_colors[fg] >> 0) & 0xff) >> (8 - fbinfo.blue_mask_size)) << fbinfo.blue_mask_pos) |
+ ((((vga_colors[fg] >> 8) & 0xff) >> (8 - fbinfo.green_mask_size)) << fbinfo.green_mask_pos) |
+ ((((vga_colors[fg] >> 16) & 0xff) >> (8 - fbinfo.red_mask_size)) << fbinfo.red_mask_pos);
}
- dst = FB + ((row * font_height) * FI->bytes_per_line);
- dst += (col * font_width * (FI->bits_per_pixel >> 3));
+ dst = FB + ((row * font_height) * fbinfo.bytes_per_line);
+ dst += (col * font_width * (fbinfo.bits_per_pixel >> 3));
for(y = 0; y < font_height; y++) {
for(x = font_width - 1; x >= 0; x--) {
- switch (FI->bits_per_pixel) {
+ switch (fbinfo.bits_per_pixel) {
case 8: /* Indexed */
- dst[(font_width - x) * (FI->bits_per_pixel >> 3)] = font_glyph_filled(ch, x, y) ? fg : bg;
+ dst[(font_width - x) * (fbinfo.bits_per_pixel >> 3)] = font_glyph_filled(ch, x, y) ? fg : bg;
break;
case 16: /* 16 bpp */
- dst16 = (u16 *)(dst + (font_width - x) * (FI->bits_per_pixel >> 3));
+ dst16 = (u16 *)(dst + (font_width - x) * (fbinfo.bits_per_pixel >> 3));
*dst16 = font_glyph_filled(ch, x, y) ? fgval : bgval;
break;
case 24: /* 24 bpp */
if (font_glyph_filled(ch, x, y)) {
- dst[(font_width - x) * (FI->bits_per_pixel >> 3) + 0] = fgval & 0xff;
- dst[(font_width - x) * (FI->bits_per_pixel >> 3) + 1] = (fgval >> 8) & 0xff;
- dst[(font_width - x) * (FI->bits_per_pixel >> 3) + 2] = (fgval >> 16) & 0xff;
+ dst[(font_width - x) * (fbinfo.bits_per_pixel >> 3) + 0] = fgval & 0xff;
+ dst[(font_width - x) * (fbinfo.bits_per_pixel >> 3) + 1] = (fgval >> 8) & 0xff;
+ dst[(font_width - x) * (fbinfo.bits_per_pixel >> 3) + 2] = (fgval >> 16) & 0xff;
} else {
- dst[(font_width - x) * (FI->bits_per_pixel >> 3) + 0] = bgval & 0xff;
- dst[(font_width - x) * (FI->bits_per_pixel >> 3) + 1] = (bgval >> 8) & 0xff;
- dst[(font_width - x) * (FI->bits_per_pixel >> 3) + 2] = (bgval >> 16) & 0xff;
+ dst[(font_width - x) * (fbinfo.bits_per_pixel >> 3) + 0] = bgval & 0xff;
+ dst[(font_width - x) * (fbinfo.bits_per_pixel >> 3) + 1] = (bgval >> 8) & 0xff;
+ dst[(font_width - x) * (fbinfo.bits_per_pixel >> 3) + 2] = (bgval >> 16) & 0xff;
}
break;
case 32: /* 32 bpp */
- dst32 = (u32 *)(dst + (font_width - x) * (FI->bits_per_pixel >> 3));
+ dst32 = (u32 *)(dst + (font_width - x) * (fbinfo.bits_per_pixel >> 3));
*dst32 = font_glyph_filled(ch, x, y) ? fgval : bgval;
break;
}
}
- dst += FI->bytes_per_line;
+ dst += fbinfo.bytes_per_line;
}
}
static void corebootfb_putc(u8 row, u8 col, unsigned int ch)
{
- CHARS[row * coreboot_video_console.columns + col] = ch;
+ chars[row * coreboot_video_console.columns + col] = ch;
corebootfb_putchar(row, col, ch);
}
@@ -189,10 +186,10 @@ static void corebootfb_update_cursor(void)
{
int ch, paint;
if(cursor_en) {
- ch = CHARS[cursor_y * coreboot_video_console.columns + cursor_x];
+ ch = chars[cursor_y * coreboot_video_console.columns + cursor_x];
paint = (ch & 0xff) | ((ch << 4) & 0xf000) | ((ch >> 4) & 0x0f00);
} else {
- paint = CHARS[cursor_y * coreboot_video_console.columns + cursor_x];
+ paint = chars[cursor_y * coreboot_video_console.columns + cursor_x];
}
if (cursor_y < coreboot_video_console.rows)
@@ -230,25 +227,42 @@ static int corebootfb_init(void)
if (lib_sysinfo.framebuffer == NULL)
return -1;
- /* We might have been called before relocation (like FILO does). So
- just keep the physical address which won't break on relocation. */
- fbinfo = virt_to_phys(lib_sysinfo.framebuffer);
+ fbinfo = *lib_sysinfo.framebuffer;
- fbaddr = FI->physical_address;
- if (fbaddr == 0)
+ if (fbinfo.physical_address == 0)
return -1;
- font_init(FI->x_resolution);
+ font_init(fbinfo.x_resolution);
- coreboot_video_console.columns = FI->x_resolution / font_width;
- coreboot_video_console.rows = FI->y_resolution / font_height;
+ /* Draw centered on the framebuffer if requested and feasible, */
+ const int center =
+ IS_ENABLED(CONFIG_LP_COREBOOT_VIDEO_CENTERED)
+ && coreboot_video_console.columns * font_width <= fbinfo.x_resolution
+ && coreboot_video_console.rows * font_height <= fbinfo.y_resolution;
+ /* adapt to the framebuffer size, otherwise. */
+ if (!center) {
+ coreboot_video_console.columns = fbinfo.x_resolution / font_width;
+ coreboot_video_console.rows = fbinfo.y_resolution / font_height;
+ }
- /* See setting of fbinfo above. */
- chars = virt_to_phys(malloc(coreboot_video_console.rows *
- coreboot_video_console.columns * 2));
+ chars = malloc(coreboot_video_console.rows *
+ coreboot_video_console.columns * 2);
+ if (!chars)
+ return -1;
// clear boot splash screen if there is one.
corebootfb_clear();
+
+ if (center) {
+ fbinfo.physical_address +=
+ (fbinfo.x_resolution - coreboot_video_console.columns * font_width)
+ / 2 * fbinfo.bits_per_pixel / 8
+ + (fbinfo.y_resolution - coreboot_video_console.rows * font_height)
+ / 2 * fbinfo.bytes_per_line;
+ fbinfo.x_resolution = coreboot_video_console.columns * font_width;
+ fbinfo.y_resolution = coreboot_video_console.rows * font_height;
+ }
+
return 0;
}
diff --git a/payloads/libpayload/drivers/video/graphics.c b/payloads/libpayload/drivers/video/graphics.c
index d346e4b733..9494de31f5 100644
--- a/payloads/libpayload/drivers/video/graphics.c
+++ b/payloads/libpayload/drivers/video/graphics.c
@@ -349,8 +349,8 @@ int draw_rounded_box(const struct scale *pos_rel, const struct scale *dim_rel,
/* Use 64 bits to avoid overflow */
int32_t x, y;
uint64_t yy;
- const uint64_t rrx = r.x * r.x, rry = r.y * r.y;
- const uint64_t ssx = s.x * s.x, ssy = s.y * s.y;
+ const uint64_t rrx = (uint64_t)r.x * r.x, rry = (uint64_t)r.y * r.y;
+ const uint64_t ssx = (uint64_t)s.x * s.x, ssy = (uint64_t)s.y * s.y;
x_begin = 0;
x_end = 0;
for (y = r.y - 1; y >= 0; y--) {
@@ -358,7 +358,7 @@ int draw_rounded_box(const struct scale *pos_rel, const struct scale *dim_rel,
* The inequality is valid in the beginning of each iteration:
* y^2 + x_end^2 < r^2
*/
- yy = y * y;
+ yy = (uint64_t)y * y;
/* Check yy/ssy + xx/ssx < 1 */
while (yy * ssx + x_begin * x_begin * ssy < ssx * ssy)
x_begin++;
@@ -509,7 +509,7 @@ static int draw_bitmap_v3(const struct vector *top_left,
* When d hits the right bottom corner, s0 also hits the right bottom
* corner of the pixel array because that's how scale->x and scale->y
* have been set. Since the pixel array size is already validated in
- * parse_bitmap_header_v3, s0 is guranteed not to exceed pixel array
+ * parse_bitmap_header_v3, s0 is guaranteed not to exceed pixel array
* boundary.
*/
struct vector s0, s1, d;
diff --git a/payloads/libpayload/include/arm64/arch/cache.h b/payloads/libpayload/include/arm64/arch/cache.h
index de68cee3f1..ace0e0ecd6 100644
--- a/payloads/libpayload/include/arm64/arch/cache.h
+++ b/payloads/libpayload/include/arm64/arch/cache.h
@@ -35,38 +35,6 @@
#include
#include
-/* SCTLR bits */
-#define SCTLR_M (1 << 0) /* MMU enable */
-#define SCTLR_A (1 << 1) /* Alignment check enable */
-#define SCTLR_C (1 << 2) /* Data/unified cache enable */
-/* Bits 4:3 are reserved */
-#define SCTLR_CP15BEN (1 << 5) /* CP15 barrier enable */
-/* Bit 6 is reserved */
-#define SCTLR_B (1 << 7) /* Endianness */
-/* Bits 9:8 */
-#define SCTLR_SW (1 << 10) /* SWP and SWPB enable */
-#define SCTLR_Z (1 << 11) /* Branch prediction enable */
-#define SCTLR_I (1 << 12) /* Instruction cache enable */
-#define SCTLR_V (1 << 13) /* Low/high exception vectors */
-#define SCTLR_RR (1 << 14) /* Round Robin select */
-/* Bits 16:15 are reserved */
-#define SCTLR_HA (1 << 17) /* Hardware Access flag enable */
-/* Bit 18 is reserved */
-/* Bits 20:19 reserved virtualization not supported */
-#define SCTLR_WXN (1 << 19) /* Write permission implies XN */
-#define SCTLR_UWXN (1 << 20) /* Unprivileged write permission
- implies PL1 XN */
-#define SCTLR_FI (1 << 21) /* Fast interrupt config enable */
-#define SCTLR_U (1 << 22) /* Unaligned access behavior */
-#define SCTLR_VE (1 << 24) /* Interrupt vectors enable */
-#define SCTLR_EE (1 << 25) /* Exception endianness */
-/* Bit 26 is reserved */
-#define SCTLR_NMFI (1 << 27) /* Non-maskable FIQ support */
-#define SCTLR_TRE (1 << 28) /* TEX remap enable */
-#define SCTLR_AFE (1 << 29) /* Access flag enable */
-#define SCTLR_TE (1 << 30) /* Thumb exception enable */
-/* Bit 31 is reserved */
-
/*
* Cache maintenance API
*/
diff --git a/payloads/libpayload/include/arm64/arch/lib_helpers.h b/payloads/libpayload/include/arm64/arch/lib_helpers.h
index 7617f97426..b2e3a069e0 100644
--- a/payloads/libpayload/include/arm64/arch/lib_helpers.h
+++ b/payloads/libpayload/include/arm64/arch/lib_helpers.h
@@ -30,11 +30,29 @@
#ifndef __ARCH_LIB_HELPERS_H__
#define __ARCH_LIB_HELPERS_H__
+#define SCTLR_M (1 << 0) /* MMU enable */
+#define SCTLR_A (1 << 1) /* Alignment check enable */
+#define SCTLR_C (1 << 2) /* Data/unified cache enable */
+#define SCTLR_SA (1 << 3) /* Stack alignment check enable */
+#define SCTLR_NAA (1 << 6) /* non-aligned access STA/LDR */
+#define SCTLR_I (1 << 12) /* Instruction cache enable */
+#define SCTLR_ENDB (1 << 13) /* Pointer auth (data B) */
+#define SCTLR_WXN (1 << 19) /* Write permission implies XN */
+#define SCTLR_IESB (1 << 21) /* Implicit error sync event */
+#define SCTLR_EE (1 << 25) /* Exception endianness (BE) */
+#define SCTLR_ENDA (1 << 27) /* Pointer auth (data A) */
+#define SCTLR_ENIB (1 << 30) /* Pointer auth (insn B) */
+#define SCTLR_ENIA (1 << 31) /* Pointer auth (insn A) */
+#define SCTLR_RES1 ((0x3 << 4) | (0x1 << 11) | (0x1 << 16) | \
+ (0x1 << 18) | (0x3 << 22) | (0x3 << 28))
+
#define DAIF_DBG_BIT (1 << 3)
#define DAIF_ABT_BIT (1 << 2)
#define DAIF_IRQ_BIT (1 << 1)
#define DAIF_FIQ_BIT (1 << 0)
+#ifndef __ASSEMBLER__
+
#include
#define MAKE_REGISTER_ACCESSORS(reg) \
@@ -273,4 +291,6 @@ static inline void tlbivaa_el1(uint64_t va)
#define dsb() dsb_opt(sy)
#define isb() isb_opt()
+#endif /* __ASSEMBLER__ */
+
#endif /* __ARCH_LIB_HELPERS_H__ */
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h
index 4b6a250f28..e3f8fd363f 100644
--- a/payloads/libpayload/include/libpayload.h
+++ b/payloads/libpayload/include/libpayload.h
@@ -130,6 +130,9 @@ static const char _pstruct(key)[] \
#define NVRAM_RTC_YEAR 9 /**< RTC Year offset in CMOS */
#define NVRAM_RTC_FREQ_SELECT 10 /**< RTC Update Status Register */
#define NVRAM_RTC_UIP 0x80
+#define NVRAM_RTC_STATUSB 11 /**< RTC Status Register B */
+#define NVRAM_RTC_FORMAT_24HOUR 0x02
+#define NVRAM_RTC_FORMAT_BINARY 0x04
/** Broken down time structure */
struct tm {
@@ -148,6 +151,7 @@ u8 nvram_read(u8 addr);
void nvram_write(u8 val, u8 addr);
int nvram_updating(void);
void rtc_read_clock(struct tm *tm);
+void rtc_write_clock(const struct tm *tm);
/** @} */
/**
diff --git a/payloads/libpayload/include/usb/usb.h b/payloads/libpayload/include/usb/usb.h
index 8505c4f60b..328e8839fc 100644
--- a/payloads/libpayload/include/usb/usb.h
+++ b/payloads/libpayload/include/usb/usb.h
@@ -217,7 +217,7 @@ struct usbdev {
hci_t *controller;
endpoint_t endpoints[32];
int num_endp;
- int address; // usb address
+ int address; // USB address
int hub; // hub, device is attached to
int port; // port where device is attached
usb_speed speed;
@@ -263,7 +263,7 @@ struct usbdev_hc {
u8* (*poll_intr_queue) (void *queue);
void *instance;
- /* set_address(): Tell the usb device its address (xHCI
+ /* set_address(): Tell the USB device its address (xHCI
controllers want to do this by
themselves). Also, allocate the usbdev
structure, initialize enpoint 0
@@ -318,6 +318,7 @@ void usb_detach_device(hci_t *controller, int devno);
int usb_attach_device(hci_t *controller, int hubaddress, int port,
usb_speed speed);
+u32 pci_quirk_check(pcidev_t controller);
u32 usb_quirk_check(u16 vendor, u16 device);
int usb_interface_check(u16 vendor, u16 device);
@@ -330,6 +331,7 @@ int usb_interface_check(u16 vendor, u16 device);
#define USB_QUIRK_MSC_FORCE_TRANS_CBI_I (1 << 6)
#define USB_QUIRK_MSC_NO_TEST_UNIT_READY (1 << 7)
#define USB_QUIRK_MSC_SHORT_INQUIRY (1 << 8)
+#define USB_QUIRK_HUB_NO_USBSTS_PCD (1 << 9)
#define USB_QUIRK_TEST (1 << 31)
#define USB_QUIRK_NONE 0
diff --git a/payloads/libpayload/include/x86/arch/io.h b/payloads/libpayload/include/x86/arch/io.h
index c417ce0c66..46836d9f7b 100644
--- a/payloads/libpayload/include/x86/arch/io.h
+++ b/payloads/libpayload/include/x86/arch/io.h
@@ -64,6 +64,11 @@ static inline __attribute__((always_inline)) uint32_t read32(const volatile void
return *((volatile uint32_t *)(addr));
}
+static inline __attribute__((always_inline)) uint64_t read64(const volatile void *addr)
+{
+ return *((volatile uint64_t *)(addr));
+}
+
static inline __attribute__((always_inline)) void write8(volatile void *addr, uint8_t value)
{
*((volatile uint8_t *)(addr)) = value;
@@ -79,6 +84,11 @@ static inline __attribute__((always_inline)) void write32(volatile void *addr, u
*((volatile uint32_t *)(addr)) = value;
}
+static inline __attribute__((always_inline)) void write64(volatile void *addr, uint64_t value)
+{
+ *((volatile uint64_t *)(addr)) = value;
+}
+
static inline unsigned int inl(int port)
{
unsigned long val;
diff --git a/payloads/libpayload/libc/args.c b/payloads/libpayload/libc/args.c
index 663d767dc5..3839c629af 100644
--- a/payloads/libpayload/libc/args.c
+++ b/payloads/libpayload/libc/args.c
@@ -52,7 +52,7 @@ int string_argc;
*
* @param caller to be used as argv[0] (may be NULL to ignore)
* @param string to process
- * @return 0 if no error occured.
+ * @return 0 if no error occurred.
*/
int string_to_args(char *caller, char *string)
{
@@ -66,7 +66,7 @@ int string_to_args(char *caller, char *string)
/* Terminate if the string ends */
while (string && *string) {
- /* whitespace occured? */
+ /* whitespace occurred? */
if ((*string == ' ') || (*string == '\t')) {
/* skip all whitespace (and null it) */
while (*string == ' ' || *string == '\t')
diff --git a/payloads/libpayload/libc/malloc.c b/payloads/libpayload/libc/malloc.c
index 510758970e..f2a54a70c8 100644
--- a/payloads/libpayload/libc/malloc.c
+++ b/payloads/libpayload/libc/malloc.c
@@ -310,15 +310,16 @@ void *realloc(void *ptr, size_t size)
if (ret == NULL || ret == ptr)
return ret;
- /* Copy the memory to the new location. */
- memcpy(ret, ptr, osize > size ? size : osize);
+ /* Move the memory to the new location. Might be before the old location
+ and overlap since the free() above includes a _consolidate(). */
+ memmove(ret, ptr, osize > size ? size : osize);
return ret;
}
struct align_region_t
{
- /* If alignment is 0 then the region reqpresents a large region which
+ /* If alignment is 0 then the region represents a large region which
* has no metadata for tracking subelements. */
int alignment;
/* start in memory, and size in bytes */
diff --git a/payloads/libpayload/libc/readline.c b/payloads/libpayload/libc/readline.c
index 9387e09149..7324e04666 100644
--- a/payloads/libpayload/libc/readline.c
+++ b/payloads/libpayload/libc/readline.c
@@ -129,7 +129,7 @@ char *readline(const char *prompt)
if (ch < 0x20)
break;
- /* ignore unprintables */
+ /* ignore unprintable characters */
if (ch >= 0x7f)
break;
diff --git a/payloads/libpayload/libc/string.c b/payloads/libpayload/libc/string.c
index 0e34a036b0..9309223da1 100644
--- a/payloads/libpayload/libc/string.c
+++ b/payloads/libpayload/libc/string.c
@@ -268,7 +268,7 @@ size_t strlcat(char *d, const char *s, size_t n)
*
* @param s The string.
* @param c The character.
- * @return A pointer to the first occurence of the character in the
+ * @return A pointer to the first occurrence of the character in the
* string, or NULL if the character was not encountered within the string.
*/
char *strchr(const char *s, int c)
@@ -288,7 +288,7 @@ char *strchr(const char *s, int c)
*
* @param s The string.
* @param c The character.
- * @return A pointer to the last occurence of the character in the
+ * @return A pointer to the last occurrence of the character in the
* string, or NULL if the character was not encountered within the string.
*/
@@ -327,7 +327,7 @@ char *strdup(const char *s)
*
* @param h The haystack string.
* @param n The needle string (substring).
- * @return A pointer to the first occurence of the substring in
+ * @return A pointer to the first occurrence of the substring in
* the string, or NULL if the substring was not encountered within the string.
*/
char *strstr(const char *h, const char *n)
diff --git a/payloads/libpayload/libcbfs/cbfs_core.c b/payloads/libpayload/libcbfs/cbfs_core.c
index e94e1e76ba..30a41f8a72 100644
--- a/payloads/libpayload/libcbfs/cbfs_core.c
+++ b/payloads/libpayload/libcbfs/cbfs_core.c
@@ -212,9 +212,15 @@ struct cbfs_handle *cbfs_get_handle(struct cbfs_media *media, const char *name)
}
// Move to next file.
- offset += ntohl(file.len) + ntohl(file.offset);
- if (offset % CBFS_ALIGNMENT)
- offset += CBFS_ALIGNMENT - (offset % CBFS_ALIGNMENT);
+ uint32_t next_offset = offset + ntohl(file.len) + ntohl(file.offset);
+ if (next_offset % CBFS_ALIGNMENT)
+ next_offset += CBFS_ALIGNMENT - (next_offset % CBFS_ALIGNMENT);
+ // Check that offset is strictly monotonic to prevent infinite loop
+ if (next_offset <= offset) {
+ ERROR("ERROR: corrupted CBFS file header at 0x%x.\n", offset);
+ break;
+ }
+ offset = next_offset;
}
media->close(media);
LOG("WARNING: '%s' not found.\n", name);
@@ -309,7 +315,14 @@ void *cbfs_get_attr(struct cbfs_handle *handle, uint32_t tag)
return NULL;
}
if (ntohl(attr.tag) != tag) {
- offset += ntohl(attr.len);
+ uint32_t next_offset = offset + ntohl(attr.len);
+ // Check that offset is strictly monotonic to prevent infinite loop
+ if (next_offset <= offset) {
+ ERROR("ERROR: corrupted CBFS attribute at 0x%x.\n", offset);
+ m->close(m);
+ return NULL;
+ }
+ offset = next_offset;
continue;
}
ret = m->map(m, offset, ntohl(attr.len));
diff --git a/payloads/libpayload/liblz4/lz4.c.inc b/payloads/libpayload/liblz4/lz4.c.inc
index baa911021d..68fac47c89 100644
--- a/payloads/libpayload/liblz4/lz4.c.inc
+++ b/payloads/libpayload/liblz4/lz4.c.inc
@@ -150,6 +150,7 @@ FORCE_INLINE int LZ4_decompress_generic(
if ((length=(token>>ML_BITS)) == RUN_MASK)
{
unsigned s;
+ if ((endOnInput) && unlikely(ip>=iend-RUN_MASK)) goto _output_error; /* overflow detection */
do
{
s = *ip++;
diff --git a/payloads/libpayload/liblz4/lz4_wrapper.c b/payloads/libpayload/liblz4/lz4_wrapper.c
index d125ce336f..3d17fe6742 100644
--- a/payloads/libpayload/liblz4/lz4_wrapper.c
+++ b/payloads/libpayload/liblz4/lz4_wrapper.c
@@ -141,6 +141,9 @@ size_t ulz4fn(const void *src, size_t srcn, void *dst, size_t dstn)
}
while (1) {
+ if ((size_t)(in - src) + sizeof(struct lz4_block_header) > srcn)
+ break; /* input overrun */
+
struct lz4_block_header b = { .raw = le32toh(*(uint32_t *)in) };
in += sizeof(struct lz4_block_header);
diff --git a/payloads/libpayload/liblzma/lzma.c b/payloads/libpayload/liblzma/lzma.c
index 57a8b3a5c7..1845afc883 100644
--- a/payloads/libpayload/liblzma/lzma.c
+++ b/payloads/libpayload/liblzma/lzma.c
@@ -28,6 +28,11 @@ unsigned long ulzman(const unsigned char *src, unsigned long srcn,
SizeT mallocneeds;
unsigned char *scratchpad;
+ if (srcn < data_offset) {
+ printf("lzma: Input too small.\n");
+ return 0;
+ }
+
memcpy(properties, src, LZMA_PROPERTIES_SIZE);
memcpy(&outSize, src + LZMA_PROPERTIES_SIZE, sizeof(outSize));
if (outSize > dstn)
diff --git a/src/Kconfig b/src/Kconfig
index f75f94279e..65404995c9 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -1,8 +1,6 @@
##
## This file is part of the coreboot project.
##
-## Copyright (C) 2012 Alexandru Gagniuc
-## 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
@@ -205,7 +203,7 @@ config INCLUDE_CONFIG_FILE
Alignment: 64 bytes
Name Offset Type Size
- cmos_layout.bin 0x0 cmos layout 1159
+ cmos_layout.bin 0x0 CMOS layout 1159
fallback/romstage 0x4c0 stage 339756
fallback/ramstage 0x53440 stage 186664
fallback/payload 0x80dc0 payload 51526
@@ -228,6 +226,7 @@ config TIMESTAMPS_ON_CONSOLE
config USE_BLOBS
bool "Allow use of binary-only repository"
+ default y
help
This draws in the blobs repository, which contains binary files that
might be required for some chipsets or boards.
@@ -625,12 +624,6 @@ config GFXUMA
help
Enable Unified Memory Architecture for graphics.
-config HAVE_ACPI_TABLES
- bool
- help
- This variable specifies whether a given board has ACPI table support.
- It is usually set in mainboard/*/Kconfig.
-
config HAVE_MP_TABLE
bool
help
@@ -657,12 +650,6 @@ config ACPI_NHLT
help
Build support for NHLT (non HD Audio) ACPI table generation.
-config ACPI_BERT
- bool
- depends on HAVE_ACPI_TABLES
- help
- Build an ACPI Boot Error Record Table.
-
#These Options are here to avoid "undefined" warnings.
#The actual selection and help texts are in the following menu.
@@ -764,7 +751,7 @@ comment "General Debug Settings"
config GDB_STUB
bool "GDB debugging support"
default n
- depends on CONSOLE_SERIAL
+ depends on DRIVERS_UART
help
If enabled, you will be able to set breakpoints for gdb debugging.
See src/arch/x86/lib/c_start.S for details.
diff --git a/src/acpi/Kconfig b/src/acpi/Kconfig
index 3c6aeb1a18..22e0323c52 100644
--- a/src/acpi/Kconfig
+++ b/src/acpi/Kconfig
@@ -1,11 +1,23 @@
# SPDX-License-Identifier: GPL-2.0-only
# This file is part of the coreboot project.
-config ACPI_SATA_GENERATOR
- bool
- default n
+config ACPI_AMD_HARDWARE_SLEEP_VALUES
+ def_bool n
help
- Use ACPI SATA port generator.
+ Provide common definitions for AMD hardware PM1_CNT register sleep
+ values.
+
+config ACPI_CPU_STRING
+ string
+ default "\\_SB.CP%02d"
+ depends on HAVE_ACPI_TABLES
+ help
+ Sets the ACPI name string in the processor scope as written by
+ the acpigen function. Default is \_SB.CPxx. Note that you need
+ the \ escape character in the string.
+
+config ACPI_HAVE_PCAT_8259
+ def_bool y if !ACPI_NO_PCAT_8259
config ACPI_INTEL_HARDWARE_SLEEP_VALUES
def_bool n
@@ -13,8 +25,13 @@ config ACPI_INTEL_HARDWARE_SLEEP_VALUES
Provide common definitions for Intel hardware PM1_CNT register sleep
values.
-config ACPI_AMD_HARDWARE_SLEEP_VALUES
- def_bool n
+config ACPI_NO_PCAT_8259
+ bool
help
- Provide common definitions for AMD hardware PM1_CNT register sleep
- values.
+ Selected by platforms that don't expose a PC/AT 8259 PIC pair.
+
+config HAVE_ACPI_TABLES
+ bool
+ help
+ This variable specifies whether a given board has ACPI table support.
+ It is usually set in mainboard/*/Kconfig.
diff --git a/src/acpi/Makefile.inc b/src/acpi/Makefile.inc
index 7c2092d5f5..09b990603f 100644
--- a/src/acpi/Makefile.inc
+++ b/src/acpi/Makefile.inc
@@ -1,4 +1,22 @@
# SPDX-License-Identifier: GPL-2.0-only
# This file is part of the coreboot project.
-ramstage-$(CONFIG_ACPI_SATA_GENERATOR) += sata.c
+ifeq ($(CONFIG_HAVE_ACPI_TABLES),y)
+
+ramstage-y += acpi.c
+ramstage-y += acpigen.c
+ramstage-y += acpigen_dsm.c
+ramstage-y += acpigen_ps2_keybd.c
+ramstage-y += device.c
+ramstage-y += pld.c
+ramstage-y += sata.c
+
+ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/acpi_tables.c),)
+ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/acpi_tables.c
+endif
+$(eval $(call asl_template,dsdt))
+ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/fadt.c),)
+ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/fadt.c
+endif
+
+endif # CONFIG_GENERATE_ACPI_TABLES
diff --git a/src/arch/x86/acpi.c b/src/acpi/acpi.c
similarity index 95%
rename from src/arch/x86/acpi.c
rename to src/acpi/acpi.c
index 6dab3733cc..d5b2c6b274 100644
--- a/src/arch/x86/acpi.c
+++ b/src/acpi/acpi.c
@@ -1,15 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
- * 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.
- *
* coreboot ACPI Table support
*/
@@ -25,13 +16,12 @@
#include
#include
-#include
-#include
-#include
+#include
+#include
+#include
#include
#include
#include
-#include
#include
#include
#include
@@ -136,6 +126,18 @@ int acpi_create_madt_lapic(acpi_madt_lapic_t *lapic, u8 cpu, u8 apic)
return lapic->length;
}
+int acpi_create_madt_lx2apic(acpi_madt_lx2apic_t *lapic, u32 cpu, u32 apic)
+{
+ lapic->type = LOCAL_X2APIC; /* Local APIC structure */
+ lapic->reserved = 0;
+ lapic->length = sizeof(acpi_madt_lx2apic_t);
+ lapic->flags = (1 << 0); /* Processor/LAPIC enabled */
+ lapic->processor_id = cpu;
+ lapic->x2apic_id = apic;
+
+ return lapic->length;
+}
+
unsigned long acpi_create_madt_lapics(unsigned long current)
{
struct device *cpu;
@@ -155,8 +157,12 @@ unsigned long acpi_create_madt_lapics(unsigned long current)
if (num_cpus > 1)
bubblesort(apic_ids, num_cpus, NUM_ASCENDING);
for (index = 0; index < num_cpus; index++) {
- current += acpi_create_madt_lapic((acpi_madt_lapic_t *)current,
- index, apic_ids[index]);
+ if (apic_ids[index] < 0xff)
+ current += acpi_create_madt_lapic((acpi_madt_lapic_t *)current,
+ index, apic_ids[index]);
+ else
+ current += acpi_create_madt_lx2apic((acpi_madt_lx2apic_t *)current,
+ index, apic_ids[index]);
}
return current;
@@ -200,6 +206,30 @@ int acpi_create_madt_lapic_nmi(acpi_madt_lapic_nmi_t *lapic_nmi, u8 cpu,
return lapic_nmi->length;
}
+int acpi_create_madt_lx2apic_nmi(acpi_madt_lx2apic_nmi_t *lapic_nmi, u32 cpu,
+ u16 flags, u8 lint)
+{
+ lapic_nmi->type = LOCAL_X2APIC_NMI; /* Local APIC NMI structure */
+ lapic_nmi->length = sizeof(acpi_madt_lx2apic_nmi_t);
+ lapic_nmi->flags = flags;
+ lapic_nmi->processor_id = cpu;
+ lapic_nmi->lint = lint;
+ lapic_nmi->reserved[0] = 0;
+ lapic_nmi->reserved[1] = 0;
+ lapic_nmi->reserved[2] = 0;
+
+ return lapic_nmi->length;
+}
+
+__weak uintptr_t cpu_get_lapic_addr(void)
+{
+ /*
+ * If an architecture does not support LAPIC, this weak implementation returns LAPIC
+ * addr as 0.
+ */
+ return 0;
+}
+
void acpi_create_madt(acpi_madt_t *madt)
{
acpi_header_t *header = &(madt->header);
@@ -220,7 +250,7 @@ void acpi_create_madt(acpi_madt_t *madt)
header->length = sizeof(acpi_madt_t);
header->revision = get_acpi_table_revision(MADT);
- madt->lapic_addr = LOCAL_APIC_ADDR;
+ madt->lapic_addr = cpu_get_lapic_addr();
if (CONFIG(ACPI_HAVE_PCAT_8259))
madt->flags |= 1;
@@ -439,8 +469,8 @@ void acpi_create_ssdt_generator(acpi_header_t *ssdt, const char *oem_table_id)
{
struct device *dev;
for (dev = all_devices; dev; dev = dev->next)
- if (dev->ops && dev->ops->acpi_fill_ssdt_generator)
- dev->ops->acpi_fill_ssdt_generator(dev);
+ if (dev->ops && dev->ops->acpi_fill_ssdt)
+ dev->ops->acpi_fill_ssdt(dev);
current = (unsigned long) acpigen_get_current();
}
@@ -736,9 +766,9 @@ void acpi_create_hpet(acpi_hpet_t *hpet)
header->checksum = acpi_checksum((void *)hpet, sizeof(acpi_hpet_t));
}
-void acpi_create_vfct(struct device *device,
+void acpi_create_vfct(const struct device *device,
acpi_vfct_t *vfct,
- unsigned long (*acpi_fill_vfct)(struct device *device,
+ unsigned long (*acpi_fill_vfct)(const struct device *device,
acpi_vfct_t *vfct_struct, unsigned long current))
{
acpi_header_t *header = &(vfct->header);
@@ -769,7 +799,7 @@ void acpi_create_vfct(struct device *device,
header->checksum = acpi_checksum((void *)vfct, header->length);
}
-void acpi_create_ipmi(struct device *device,
+void acpi_create_ipmi(const struct device *device,
struct acpi_spmi *spmi,
const u16 ipmi_revision,
const acpi_addr_t *addr,
@@ -849,7 +879,7 @@ void acpi_create_ivrs(acpi_ivrs_t *ivrs,
header->checksum = acpi_checksum((void *)ivrs, header->length);
}
-unsigned long acpi_write_hpet(struct device *device, unsigned long current,
+unsigned long acpi_write_hpet(const struct device *device, unsigned long current,
acpi_rsdp_t *rsdp)
{
acpi_hpet_t *hpet;
@@ -1375,8 +1405,8 @@ unsigned long write_acpi_tables(unsigned long start)
acpigen_set_current((char *) current);
for (dev = all_devices; dev; dev = dev->next)
- if (dev->ops && dev->ops->acpi_inject_dsdt_generator)
- dev->ops->acpi_inject_dsdt_generator(dev);
+ if (dev->ops && dev->ops->acpi_inject_dsdt)
+ dev->ops->acpi_inject_dsdt(dev);
current = (unsigned long) acpigen_get_current();
memcpy((char *)current,
(char *)dsdt_file + sizeof(acpi_header_t),
@@ -1563,9 +1593,9 @@ int get_acpi_table_revision(enum acpi_tables table)
{
switch (table) {
case FADT:
- return ACPI_FADT_REV_ACPI_3_0;
+ return ACPI_FADT_REV_ACPI_6_0;
case MADT: /* ACPI 3.0: 2, ACPI 4.0/5.0: 3, ACPI 6.2b/6.3: 5 */
- return 2;
+ return 3;
case MCFG:
return 1;
case TCPA:
diff --git a/src/arch/x86/acpigen.c b/src/acpi/acpigen.c
similarity index 95%
rename from src/arch/x86/acpigen.c
rename to src/acpi/acpigen.c
index 72605bb766..a2dc84f799 100644
--- a/src/arch/x86/acpigen.c
+++ b/src/acpi/acpigen.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/* How much nesting do we support? */
#define ACPIGEN_LENSTACK_SIZE 10
@@ -23,10 +13,12 @@
#include
#include
-#include
+#include
#include
#include
#include
+#include
+#include
static char *gencurrent;
@@ -350,7 +342,7 @@ void acpigen_write_scope(const char *name)
void acpigen_write_processor(u8 cpuindex, u32 pblock_addr, u8 pblock_len)
{
/*
- Processor (\_PR.CPcpuindex, cpuindex, pblock_addr, pblock_len)
+ Processor (\_SB.CPcpuindex, cpuindex, pblock_addr, pblock_len)
{
*/
char pscope[16];
@@ -386,7 +378,7 @@ void acpigen_write_processor_cnot(const unsigned int number_of_cores)
{
int core_id;
- acpigen_write_method("\\_PR.CNOT", 1);
+ acpigen_write_method("\\_SB.CNOT", 1);
for (core_id = 0; core_id < number_of_cores; core_id++) {
char buffer[DEVICE_PATH_MAX];
snprintf(buffer, sizeof(buffer), CONFIG_ACPI_CPU_STRING,
@@ -522,7 +514,7 @@ static void acpigen_write_field_name(const char *name, uint32_t size)
* PMCS, 2
* }
*/
-void acpigen_write_field(const char *name, struct fieldlist *l, size_t count,
+void acpigen_write_field(const char *name, const struct fieldlist *l, size_t count,
uint8_t flags)
{
uint16_t i;
@@ -1155,7 +1147,7 @@ void acpigen_write_uuid(const char *uuid)
* PowerResource (name, level, order)
*/
void acpigen_write_power_res(const char *name, uint8_t level, uint16_t order,
- const char *dev_states[], size_t dev_states_count)
+ const char * const dev_states[], size_t dev_states_count)
{
size_t i;
for (i = 0; i < dev_states_count; i++) {
@@ -1194,6 +1186,14 @@ void acpigen_write_store_ops(uint8_t src, uint8_t dst)
acpigen_emit_byte(dst);
}
+/* Store (src, "namestr") */
+void acpigen_write_store_op_to_namestr(uint8_t src, const char *dst)
+{
+ acpigen_write_store();
+ acpigen_emit_byte(src);
+ acpigen_emit_namestring(dst);
+}
+
/* Or (arg1, arg2, res) */
void acpigen_write_or(uint8_t arg1, uint8_t arg2, uint8_t res)
{
@@ -1203,6 +1203,15 @@ void acpigen_write_or(uint8_t arg1, uint8_t arg2, uint8_t res)
acpigen_emit_byte(res);
}
+/* Xor (arg1, arg2, res) */
+void acpigen_write_xor(uint8_t arg1, uint8_t arg2, uint8_t res)
+{
+ acpigen_emit_byte(XOR_OP);
+ acpigen_emit_byte(arg1);
+ acpigen_emit_byte(arg2);
+ acpigen_emit_byte(res);
+}
+
/* And (arg1, arg2, res) */
void acpigen_write_and(uint8_t arg1, uint8_t arg2, uint8_t res)
{
@@ -1273,6 +1282,20 @@ void acpigen_write_if_lequal_op_int(uint8_t op, uint64_t val)
acpigen_write_integer(val);
}
+/*
+ * Generates ACPI code for checking if operand1 and operand2 are equal, where,
+ * operand1 is namestring and operand2 is an integer.
+ *
+ * If (Lequal ("namestr", val))
+ */
+void acpigen_write_if_lequal_namestr_int(const char *namestr, uint64_t val)
+{
+ acpigen_write_if();
+ acpigen_emit_byte(LEQUAL_OP);
+ acpigen_emit_namestring(namestr);
+ acpigen_write_integer(val);
+}
+
void acpigen_write_else(void)
{
acpigen_emit_byte(ELSE_OP);
@@ -1759,6 +1782,14 @@ int acpigen_disable_tx_gpio(struct acpi_gpio *gpio)
return acpigen_soc_clear_tx_gpio(gpio->pins[0]);
}
+void acpigen_get_rx_gpio(struct acpi_gpio *gpio)
+{
+ acpigen_soc_read_rx_gpio(gpio->pins[0]);
+
+ if (gpio->polarity == ACPI_GPIO_ACTIVE_LOW)
+ acpigen_write_xor(LOCAL0_OP, 1, LOCAL0_OP);
+}
+
/* refer to ACPI 6.4.3.5.3 Word Address Space Descriptor section for details */
void acpigen_resource_word(u16 res_type, u16 gen_flags, u16 type_flags, u16 gran,
u16 range_min, u16 range_max, u16 translation, u16 length)
@@ -1833,3 +1864,25 @@ void acpigen_resource_qword(u16 res_type, u16 gen_flags, u16 type_flags,
acpigen_emit_qword(translation);
acpigen_emit_qword(length);
}
+
+void acpigen_write_ADR(uint64_t adr)
+{
+ acpigen_write_name_qword("_ADR", adr);
+}
+
+void acpigen_write_ADR_pci_devfn(pci_devfn_t devfn)
+{
+ /*
+ * _ADR for PCI Bus is encoded as follows:
+ * [63:32] - unused
+ * [31:16] - device #
+ * [15:0] - function #
+ */
+ acpigen_write_ADR(PCI_SLOT(devfn) << 16 | PCI_FUNC(devfn));
+}
+
+void acpigen_write_ADR_pci_device(const struct device *dev)
+{
+ assert(dev->path.type == DEVICE_PATH_PCI);
+ acpigen_write_ADR_pci_devfn(dev->path.pci.devfn);
+}
diff --git a/src/arch/x86/acpigen_dsm.c b/src/acpi/acpigen_dsm.c
similarity index 71%
rename from src/arch/x86/acpigen_dsm.c
rename to src/acpi/acpigen_dsm.c
index 294c6c346b..b7b2a0bf18 100644
--- a/src/arch/x86/acpigen_dsm.c
+++ b/src/acpi/acpigen_dsm.c
@@ -1,18 +1,8 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
-#include
-#include
+#include
+#include
/* ------------------- I2C HID DSM ---------------------------- */
diff --git a/src/acpi/acpigen_ps2_keybd.c b/src/acpi/acpigen_ps2_keybd.c
new file mode 100644
index 0000000000..be8d2eb999
--- /dev/null
+++ b/src/acpi/acpigen_ps2_keybd.c
@@ -0,0 +1,302 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include
+#include
+#include
+#include
+#include
+
+#define KEYMAP(scancode, keycode) (((uint32_t)(scancode) << 16) | (keycode & 0xFFFF))
+#define SCANCODE(keymap) ((keymap >> 16) & 0xFFFF)
+
+/* Possible keymaps for function keys in the top row */
+static const uint32_t function_keymaps[] = {
+ KEYMAP(0x3b, KEY_F1),
+ KEYMAP(0x3c, KEY_F2),
+ KEYMAP(0x3d, KEY_F3),
+ KEYMAP(0x3e, KEY_F4),
+ KEYMAP(0x3f, KEY_F5),
+ KEYMAP(0x40, KEY_F6),
+ KEYMAP(0x41, KEY_F7),
+ KEYMAP(0x42, KEY_F8),
+ KEYMAP(0x43, KEY_F9),
+ KEYMAP(0x44, KEY_F10),
+ KEYMAP(0x57, KEY_F11),
+ KEYMAP(0x58, KEY_F12),
+ KEYMAP(0x59, KEY_F13),
+ KEYMAP(0x5a, KEY_F14),
+ KEYMAP(0x5b, KEY_F15),
+};
+
+/*
+ * Possible keymaps for action keys in the top row. This is a superset of
+ * possible keys. Individual keyboards will have a subset of these keys.
+ * The scancodes are true / condensed 1 byte scancodes from set-1
+ */
+static const uint32_t action_keymaps[] = {
+ [PS2_KEY_BACK] = KEYMAP(0xea, KEY_BACK), /* e06a */
+ [PS2_KEY_FORWARD] = KEYMAP(0xe9, KEY_FORWARD), /* e069 */
+ [PS2_KEY_REFRESH] = KEYMAP(0xe7, KEY_REFRESH), /* e067 */
+ [PS2_KEY_FULLSCREEN] = KEYMAP(0x91, KEY_FULL_SCREEN), /* e011 */
+ [PS2_KEY_OVERVIEW] = KEYMAP(0x92, KEY_SCALE), /* e012 */
+ [PS2_KEY_VOL_MUTE] = KEYMAP(0xa0, KEY_MUTE), /* e020 */
+ [PS2_KEY_VOL_DOWN] = KEYMAP(0xae, KEY_VOLUMEDOWN), /* e02e */
+ [PS2_KEY_VOL_UP] = KEYMAP(0xb0, KEY_VOLUMEUP), /* e030 */
+ [PS2_KEY_PLAY_PAUSE] = KEYMAP(0x9a, KEY_PLAYPAUSE), /* e01a */
+ [PS2_KEY_NEXT_TRACK] = KEYMAP(0x99, KEY_NEXTSONG), /* e019 */
+ [PS2_KEY_PREV_TRACK] = KEYMAP(0x90, KEY_PREVIOUSSONG), /* e010 */
+ [PS2_KEY_SNAPSHOT] = KEYMAP(0x93, KEY_SYSRQ), /* e013 */
+ [PS2_KEY_BRIGHTNESS_DOWN] = KEYMAP(0x94, KEY_BRIGHTNESSDOWN),/* e014 */
+ [PS2_KEY_BRIGHTNESS_UP] = KEYMAP(0x95, KEY_BRIGHTNESSUP), /* e015 */
+ [PS2_KEY_KBD_BKLIGHT_DOWN] = KEYMAP(0x97, KEY_KBDILLUMDOWN), /* e017 */
+ [PS2_KEY_KBD_BKLIGHT_UP] = KEYMAP(0x98, KEY_KBDILLUMUP), /* e018 */
+ [PS2_KEY_PRIVACY_SCRN_TOGGLE] = KEYMAP(0x96, /* e016 */
+ KEY_PRIVACY_SCREEN_TOGGLE),
+};
+
+/* Keymap for numeric keypad keys */
+static uint32_t numeric_keypad_keymaps[] = {
+ /* Row-0 */
+ KEYMAP(0xc9, KEY_PAGEUP),
+ KEYMAP(0xd1, KEY_PAGEDOWN),
+ KEYMAP(0xc7, KEY_HOME),
+ KEYMAP(0xcf, KEY_END),
+ /* Row-1 */
+ KEYMAP(0xd3, KEY_DELETE),
+ KEYMAP(0xb5, KEY_KPSLASH),
+ KEYMAP(0x37, KEY_KPASTERISK),
+ KEYMAP(0x4a, KEY_KPMINUS),
+ /* Row-2 */
+ KEYMAP(0x47, KEY_KP7),
+ KEYMAP(0x48, KEY_KP8),
+ KEYMAP(0x49, KEY_KP9),
+ KEYMAP(0x4e, KEY_KPPLUS),
+ /* Row-3 */
+ KEYMAP(0x4b, KEY_KP4),
+ KEYMAP(0x4c, KEY_KP5),
+ KEYMAP(0x4d, KEY_KP6),
+ /* Row-4 */
+ KEYMAP(0x4f, KEY_KP1),
+ KEYMAP(0x50, KEY_KP2),
+ KEYMAP(0x51, KEY_KP3),
+ KEYMAP(0x9c, KEY_KPENTER),
+ /* Row-5 */
+ KEYMAP(0x52, KEY_KP0),
+ KEYMAP(0x53, KEY_KPDOT),
+};
+
+/*
+ * Keymap for rest of non-top-row keys. This is a superset of all the possible
+ * keys that any chromeos keyboards can have.
+ */
+static uint32_t rest_of_keymaps[] = {
+ /* Row-0 */
+ KEYMAP(0x01, KEY_ESC),
+ /* Row-1 */
+ KEYMAP(0x29, KEY_GRAVE),
+ KEYMAP(0x02, KEY_1),
+ KEYMAP(0x03, KEY_2),
+ KEYMAP(0x04, KEY_3),
+ KEYMAP(0x05, KEY_4),
+ KEYMAP(0x06, KEY_5),
+ KEYMAP(0x07, KEY_6),
+ KEYMAP(0x08, KEY_7),
+ KEYMAP(0x09, KEY_8),
+ KEYMAP(0x0a, KEY_9),
+ KEYMAP(0x0b, KEY_0),
+ KEYMAP(0x0c, KEY_MINUS),
+ KEYMAP(0x0d, KEY_EQUAL),
+ KEYMAP(0x7d, KEY_YEN), /* JP keyboards only */
+ KEYMAP(0x0e, KEY_BACKSPACE),
+ /* Row-2 */
+ KEYMAP(0x0f, KEY_TAB),
+ KEYMAP(0x10, KEY_Q),
+ KEYMAP(0x11, KEY_W),
+ KEYMAP(0x12, KEY_E),
+ KEYMAP(0x13, KEY_R),
+ KEYMAP(0x14, KEY_T),
+ KEYMAP(0x15, KEY_Y),
+ KEYMAP(0x16, KEY_U),
+ KEYMAP(0x17, KEY_I),
+ KEYMAP(0x18, KEY_O),
+ KEYMAP(0x19, KEY_P),
+ KEYMAP(0x1a, KEY_LEFTBRACE),
+ KEYMAP(0x1b, KEY_RIGHTBRACE),
+ KEYMAP(0x2b, KEY_BACKSLASH),
+ /* Row-3 */
+ KEYMAP(0xdb, KEY_LEFTMETA), /* Search Key */
+ KEYMAP(0x1e, KEY_A),
+ KEYMAP(0x1f, KEY_S),
+ KEYMAP(0x20, KEY_D),
+ KEYMAP(0x21, KEY_F),
+ KEYMAP(0x22, KEY_G),
+ KEYMAP(0x23, KEY_H),
+ KEYMAP(0x24, KEY_J),
+ KEYMAP(0x25, KEY_K),
+ KEYMAP(0x26, KEY_L),
+ KEYMAP(0x27, KEY_SEMICOLON),
+ KEYMAP(0x28, KEY_APOSTROPHE),
+ KEYMAP(0x1c, KEY_ENTER),
+ /* Row-4 */
+ KEYMAP(0x2a, KEY_LEFTSHIFT),
+ KEYMAP(0x56, KEY_102ND), /* UK keyboards only */
+ KEYMAP(0x2c, KEY_Z),
+ KEYMAP(0x2d, KEY_X),
+ KEYMAP(0x2e, KEY_C),
+ KEYMAP(0x2f, KEY_V),
+ KEYMAP(0x30, KEY_B),
+ KEYMAP(0x31, KEY_N),
+ KEYMAP(0x32, KEY_M),
+ KEYMAP(0x33, KEY_COMMA),
+ KEYMAP(0x34, KEY_DOT),
+ KEYMAP(0x35, KEY_SLASH),
+ KEYMAP(0x73, KEY_RO), /* JP keyboards only */
+ KEYMAP(0x36, KEY_RIGHTSHIFT),
+ /* Row-5 */
+ KEYMAP(0x1d, KEY_LEFTCTRL),
+ KEYMAP(0x38, KEY_LEFTALT),
+ KEYMAP(0x7b, KEY_MUHENKAN), /* JP keyboards only */
+ KEYMAP(0x39, KEY_SPACE),
+ KEYMAP(0x79, KEY_HENKAN), /* JP keyboards only */
+ KEYMAP(0xb8, KEY_RIGHTALT),
+ KEYMAP(0x9d, KEY_RIGHTCTRL),
+ /* Arrow keys */
+ KEYMAP(0xcb, KEY_LEFT),
+ KEYMAP(0xd0, KEY_DOWN),
+ KEYMAP(0xcd, KEY_RIGHT),
+ KEYMAP(0xc8, KEY_UP),
+};
+
+static void ssdt_generate_physmap(struct acpi_dp *dp, uint8_t num_top_row_keys,
+ enum ps2_action_key action_keys[])
+{
+ struct acpi_dp *dp_array;
+ enum ps2_action_key key;
+ uint32_t keymap, i;
+
+ dp_array = acpi_dp_new_table("function-row-physmap");
+ if (!dp_array) {
+ printk(BIOS_ERR, "PS2K: couldn't write function-row-physmap\n");
+ return;
+ }
+
+ printk(BIOS_INFO, "PS2K: Physmap: [");
+ for (i = 0; i < num_top_row_keys; i++) {
+ key = action_keys[i];
+ if (key && key < ARRAY_SIZE(action_keymaps)) {
+ keymap = action_keymaps[key];
+ } else {
+ keymap = 0;
+ printk(BIOS_ERR,
+ "PS2K: invalid top-action-key-%u: %u(skipped)\n",
+ i, key);
+ }
+ acpi_dp_add_integer(dp_array, NULL, SCANCODE(keymap));
+ printk(BIOS_INFO, " %X", SCANCODE(keymap));
+ }
+
+ printk(BIOS_INFO, " ]\n");
+ acpi_dp_add_array(dp, dp_array);
+}
+
+static void ssdt_generate_keymap(struct acpi_dp *dp, uint8_t num_top_row_keys,
+ enum ps2_action_key action_keys[],
+ bool can_send_function_keys,
+ bool has_numeric_keypad,
+ bool has_scrnlock_key)
+{
+ struct acpi_dp *dp_array;
+ enum ps2_action_key key;
+ uint32_t keymap;
+ unsigned int i, total = 0;
+
+ dp_array = acpi_dp_new_table("linux,keymap");
+ if (!dp_array) {
+ printk(BIOS_ERR, "PS2K: couldn't write linux,keymap\n");
+ return;
+ }
+
+ /* Write out keymap for top row action keys */
+ for (i = 0; i < num_top_row_keys; i++) {
+ key = action_keys[i];
+ if (!key || key >= ARRAY_SIZE(action_keymaps)) {
+ printk(BIOS_ERR,
+ "PS2K: invalid top-action-key-%u: %u\n", i, key);
+ continue;
+ }
+ keymap = action_keymaps[key];
+ acpi_dp_add_integer(dp_array, NULL, keymap);
+ total++;
+ }
+
+ /* Write out keymap for function keys, if keyboard can send them */
+ if (can_send_function_keys) {
+ for (i = 0; i < num_top_row_keys; i++) {
+ keymap = function_keymaps[i];
+ acpi_dp_add_integer(dp_array, NULL, keymap);
+ }
+
+ total += num_top_row_keys;
+ }
+
+ /* Write out keymap for numeric keypad, if the keyboard has it */
+ if (has_numeric_keypad) {
+ for (i = 0; i < ARRAY_SIZE(numeric_keypad_keymaps); i++) {
+ keymap = numeric_keypad_keymaps[i];
+ acpi_dp_add_integer(dp_array, NULL, keymap);
+ }
+
+ total += ARRAY_SIZE(numeric_keypad_keymaps);
+ }
+
+ /* Provide keymap for screenlock only if it is present */
+ if (has_scrnlock_key) {
+ acpi_dp_add_integer(dp_array, NULL, KEYMAP(0x5d, KEY_SLEEP));
+ total++;
+ }
+
+ /* Write out keymap for rest of keys */
+ for (i = 0; i < ARRAY_SIZE(rest_of_keymaps); i++) {
+ keymap = rest_of_keymaps[i];
+ acpi_dp_add_integer(dp_array, NULL, keymap);
+ }
+
+ total += ARRAY_SIZE(rest_of_keymaps);
+ printk(BIOS_INFO, "PS2K: Passing %u keymaps to kernel\n", total);
+
+ acpi_dp_add_array(dp, dp_array);
+}
+
+void acpigen_ps2_keyboard_dsd(const char *scope, uint8_t num_top_row_keys,
+ enum ps2_action_key action_keys[],
+ bool can_send_function_keys,
+ bool has_numeric_keypad,
+ bool has_scrnlock_key)
+{
+ struct acpi_dp *dsd;
+
+ if (!scope ||
+ num_top_row_keys < PS2_MIN_TOP_ROW_KEYS ||
+ num_top_row_keys > PS2_MAX_TOP_ROW_KEYS) {
+ printk(BIOS_ERR, "PS2K: %s: invalid args\n", __func__);
+ return;
+ }
+
+ dsd = acpi_dp_new_table("_DSD");
+ if (!dsd) {
+ printk(BIOS_ERR, "PS2K: couldn't write _DSD\n");
+ return;
+ }
+
+ acpigen_write_scope(scope);
+ ssdt_generate_physmap(dsd, num_top_row_keys, action_keys);
+ ssdt_generate_keymap(dsd, num_top_row_keys, action_keys,
+ can_send_function_keys, has_numeric_keypad,
+ has_scrnlock_key);
+ acpi_dp_write(dsd);
+ acpigen_pop_len(); /* Scope */
+}
diff --git a/src/arch/x86/acpi_device.c b/src/acpi/device.c
similarity index 95%
rename from src/arch/x86/acpi_device.c
rename to src/acpi/device.c
index 1092c7317b..6b067f3a0f 100644
--- a/src/arch/x86/acpi_device.c
+++ b/src/acpi/device.c
@@ -1,20 +1,11 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+#include
#include
-#include
-#include
-#include
+#include
+#include
+#include
#include
#include
#include
@@ -104,7 +95,7 @@ const char *acpi_device_hid(const struct device *dev)
* Generate unique ID based on the ACPI path.
* Collisions on the same _HID are possible but very unlikely.
*/
-uint32_t acpi_device_uid(struct device *dev)
+uint32_t acpi_device_uid(const struct device *dev)
{
const char *path = acpi_device_path(dev);
if (!path)
@@ -209,7 +200,7 @@ int acpi_device_status(const struct device *dev)
/* Write the unique _UID based on ACPI device path. */
-void acpi_device_write_uid(struct device *dev)
+void acpi_device_write_uid(const struct device *dev)
{
acpigen_write_name_integer("_UID", acpi_device_uid(dev));
}
@@ -536,7 +527,7 @@ void acpi_device_write_spi(const struct acpi_spi *spi)
/* PowerResource() with Enable and/or Reset control */
void acpi_device_add_power_res(const struct acpi_power_res_params *params)
{
- static const char *power_res_dev_states[] = { "_PR0", "_PR3" };
+ static const char * const power_res_dev_states[] = { "_PR0", "_PR3" };
unsigned int reset_gpio = params->reset_gpio ? params->reset_gpio->pins[0] : 0;
unsigned int enable_gpio = params->enable_gpio ? params->enable_gpio->pins[0] : 0;
unsigned int stop_gpio = params->stop_gpio ? params->stop_gpio->pins[0] : 0;
@@ -674,7 +665,7 @@ void acpi_dp_write(struct acpi_dp *table)
char *dp_count, *prop_count = NULL;
int child_count = 0;
- if (!table || table->type != ACPI_DP_TYPE_TABLE)
+ if (!table || table->type != ACPI_DP_TYPE_TABLE || !table->next)
return;
/* Name (name) */
@@ -888,7 +879,7 @@ struct acpi_dp *acpi_dp_add_array(struct acpi_dp *dp, struct acpi_dp *array)
}
struct acpi_dp *acpi_dp_add_integer_array(struct acpi_dp *dp, const char *name,
- uint64_t *array, int len)
+ const uint64_t *array, int len)
{
struct acpi_dp *dp_array;
int i;
@@ -937,3 +928,34 @@ struct acpi_dp *acpi_dp_add_gpio(struct acpi_dp *dp, const char *name,
return gpio;
}
+
+/*
+ * This function writes a PCI device with _ADR object:
+ * Example:
+ * Scope (\_SB.PCI0)
+ * {
+ * Device (IGFX)
+ * {
+ * Name (_ADR, 0x0000000000000000)
+ * Method (_STA, 0, NotSerialized) { Return (status) }
+ * }
+ * }
+ */
+void acpi_device_write_pci_dev(const struct device *dev)
+{
+ const char *scope = acpi_device_scope(dev);
+ const char *name = acpi_device_name(dev);
+
+ assert(dev->path.type == DEVICE_PATH_PCI);
+ assert(name);
+ assert(scope);
+
+ acpigen_write_scope(scope);
+ acpigen_write_device(name);
+
+ acpigen_write_ADR_pci_device(dev);
+ acpigen_write_STA(acpi_device_status(dev));
+
+ acpigen_pop_len(); /* Device */
+ acpigen_pop_len(); /* Scope */
+}
diff --git a/src/arch/x86/acpi_pld.c b/src/acpi/pld.c
similarity index 86%
rename from src/arch/x86/acpi_pld.c
rename to src/acpi/pld.c
index 6fbbfe74e3..a2d0dd7fe7 100644
--- a/src/arch/x86/acpi_pld.c
+++ b/src/acpi/pld.c
@@ -1,20 +1,10 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
-#include
-#include
+#include
+#include
int acpi_pld_fill_usb(struct acpi_pld *pld, enum acpi_upc_type type,
struct acpi_pld_group *group)
diff --git a/src/acpi/sata.c b/src/acpi/sata.c
index f2b381124e..110742e84c 100644
--- a/src/acpi/sata.c
+++ b/src/acpi/sata.c
@@ -1,10 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/* This file is part of the coreboot project. */
-#include "sata.h"
-
-#include
-#include
+#include
+#include
+#include
/* e.g.
* generate_sata_ssdt_ports("\_SB.PCI0.SATA", 0x3);
diff --git a/src/arch/arm/Makefile.inc b/src/arch/arm/Makefile.inc
index 508b0a80f8..a8abfaf4cc 100644
--- a/src/arch/arm/Makefile.inc
+++ b/src/arch/arm/Makefile.inc
@@ -1,16 +1,8 @@
################################################################################
##
+## SPDX-License-Identifier: GPL-2.0-only
## 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.
-##
###############################################################################
# ARM specific options
diff --git a/src/arch/arm/armv4/Makefile.inc b/src/arch/arm/armv4/Makefile.inc
index 2cc5ebba8c..b3366bf9ec 100644
--- a/src/arch/arm/armv4/Makefile.inc
+++ b/src/arch/arm/armv4/Makefile.inc
@@ -1,16 +1,8 @@
################################################################################
##
+## SPDX-License-Identifier: GPL-2.0-only
## 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.
-##
###############################################################################
armv4_flags = -marm -march=armv4t -I$(src)/arch/arm/include/armv4/ \
diff --git a/src/arch/arm/armv4/bootblock.S b/src/arch/arm/armv4/bootblock.S
index cf37647e27..9bf9614762 100644
--- a/src/arch/arm/armv4/bootblock.S
+++ b/src/arch/arm/armv4/bootblock.S
@@ -1,16 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
- * 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.
- *
* Early initialization code for ARM architecture.
*
* This file is based off of the OMAP3530/ARM Cortex start.S file from Das
diff --git a/src/arch/arm/armv4/cache.c b/src/arch/arm/armv4/cache.c
index 140beee060..a79df69203 100644
--- a/src/arch/arm/armv4/cache.c
+++ b/src/arch/arm/armv4/cache.c
@@ -1,31 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
/*
- * 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
* cache.c: Cache maintenance routines for ARMv7-A and ARMv7-R
*
* Reference: ARM Architecture Reference Manual, ARMv7-A and ARMv7-R edition
diff --git a/src/arch/arm/armv7/Makefile.inc b/src/arch/arm/armv7/Makefile.inc
index 58592a0818..756412a19c 100644
--- a/src/arch/arm/armv7/Makefile.inc
+++ b/src/arch/arm/armv7/Makefile.inc
@@ -1,16 +1,8 @@
################################################################################
##
+## SPDX-License-Identifier: GPL-2.0-only
## 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.
-##
###############################################################################
armv7_flags = -mthumb -I$(src)/arch/arm/include/armv7/ -D__COREBOOT_ARM_ARCH__=7
diff --git a/src/arch/arm/armv7/bootblock.S b/src/arch/arm/armv7/bootblock.S
index da2671c519..62d3c1feb8 100644
--- a/src/arch/arm/armv7/bootblock.S
+++ b/src/arch/arm/armv7/bootblock.S
@@ -1,22 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
- * 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.
- *
- * 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.
*/
+/* Early initialization code for ARMv7 architecture. */
+
#include
.arm
diff --git a/src/arch/arm/armv7/bootblock_m.S b/src/arch/arm/armv7/bootblock_m.S
index 2e46ca064f..4d691414ba 100644
--- a/src/arch/arm/armv7/bootblock_m.S
+++ b/src/arch/arm/armv7/bootblock_m.S
@@ -1,32 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright 2014 Google Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
- */
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
#include
diff --git a/src/arch/arm/armv7/cache.c b/src/arch/arm/armv7/cache.c
index ef3ad018fc..eea63ac27a 100644
--- a/src/arch/arm/armv7/cache.c
+++ b/src/arch/arm/armv7/cache.c
@@ -1,31 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
/*
- * 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
* cache.c: Cache maintenance routines for ARMv7-A and ARMv7-R
*
* Reference: ARM Architecture Reference Manual, ARMv7-A and ARMv7-R edition
diff --git a/src/arch/arm/armv7/cache_m.c b/src/arch/arm/armv7/cache_m.c
index ec8a970167..f4bede6d20 100644
--- a/src/arch/arm/armv7/cache_m.c
+++ b/src/arch/arm/armv7/cache_m.c
@@ -1,31 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
/*
- * This file is part of the coreboot project.
- *
- * Copyright 2014 Google Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
* cache.c: Cache maintenance routines for ARMv7-M
*/
diff --git a/src/arch/arm/armv7/cpu.S b/src/arch/arm/armv7/cpu.S
index 3f90c0b611..4d1ce8ed96 100644
--- a/src/arch/arm/armv7/cpu.S
+++ b/src/arch/arm/armv7/cpu.S
@@ -1,32 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
/*
- * This file is part of the coreboot project.
- *
- * Copyright (c) 2010 Per Odlund
- * Copyright (c) 2014 Google Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
* 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
diff --git a/src/arch/arm/armv7/exception.c b/src/arch/arm/armv7/exception.c
index d6891b0b8d..372cd40311 100644
--- a/src/arch/arm/armv7/exception.c
+++ b/src/arch/arm/armv7/exception.c
@@ -1,31 +1,5 @@
-/*
- * 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- */
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/arm/armv7/exception_asm.S b/src/arch/arm/armv7/exception_asm.S
index 6aa4188abc..8d14dbd3b4 100644
--- a/src/arch/arm/armv7/exception_asm.S
+++ b/src/arch/arm/armv7/exception_asm.S
@@ -1,31 +1,5 @@
-/*
- * 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- */
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
.text
diff --git a/src/arch/arm/armv7/exception_mr.c b/src/arch/arm/armv7/exception_mr.c
index 01e834ea47..075641b7e9 100644
--- a/src/arch/arm/armv7/exception_mr.c
+++ b/src/arch/arm/armv7/exception_mr.c
@@ -1,31 +1,5 @@
-/*
- * 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- */
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/arm/armv7/mmu.c b/src/arch/arm/armv7/mmu.c
index 77b9b4b435..36a6a09050 100644
--- a/src/arch/arm/armv7/mmu.c
+++ b/src/arch/arm/armv7/mmu.c
@@ -1,32 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (c) 2015, The Linux Foundation. All rights reserved.
- * 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- */
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/arm/armv7/thread.c b/src/arch/arm/armv7/thread.c
index 4e82be708c..c5d2bd54d8 100644
--- a/src/arch/arm/armv7/thread.c
+++ b/src/arch/arm/armv7/thread.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
diff --git a/src/arch/arm/asmlib.h b/src/arch/arm/asmlib.h
index cae4081efd..6769352d52 100644
--- a/src/arch/arm/asmlib.h
+++ b/src/arch/arm/asmlib.h
@@ -1,15 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
- * 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
- * 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.
- *
* This file contains arm architecture specific defines
* for the different processors.
*
diff --git a/src/arch/arm/boot.c b/src/arch/arm/boot.c
index 9d1e4cde5f..dfd568fbde 100644
--- a/src/arch/arm/boot.c
+++ b/src/arch/arm/boot.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/arm/clock.c b/src/arch/arm/clock.c
index 5f68e6fa9d..71dfc8df1a 100644
--- a/src/arch/arm/clock.c
+++ b/src/arch/arm/clock.c
@@ -1,32 +1,6 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright 2014 Google Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
- */
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
+
#include
#include
diff --git a/src/arch/arm/cpu.c b/src/arch/arm/cpu.c
index 1e0e0fd60b..f4e7db70ec 100644
--- a/src/arch/arm/cpu.c
+++ b/src/arch/arm/cpu.c
@@ -1,32 +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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
- */
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
+
#include
#include
diff --git a/src/arch/arm/div0.c b/src/arch/arm/div0.c
index fa3bf7f090..28ca0e3e5e 100644
--- a/src/arch/arm/div0.c
+++ b/src/arch/arm/div0.c
@@ -1,16 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* This file is part of the coreboot project. */
#include
diff --git a/src/arch/arm/eabi_compat.c b/src/arch/arm/eabi_compat.c
index b2caf9c377..f936176e4b 100644
--- a/src/arch/arm/eabi_compat.c
+++ b/src/arch/arm/eabi_compat.c
@@ -1,18 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * This program is Free Software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * Utility functions needed for (some) EABI conformant tool chains.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* This file is part of the coreboot project. */
#include
#include
@@ -22,7 +9,7 @@
int raise(int signum) __attribute__((used));
int raise(int signum)
{
- printk(BIOS_CRIT, "raise: Signal # %d caught\n", signum);
+ printk(BIOS_CRIT, "%s: Signal # %d caught\n", __func__, signum);
return 0;
}
diff --git a/src/arch/arm/id.S b/src/arch/arm/id.S
index 16173fb598..3cdd013535 100644
--- a/src/arch/arm/id.S
+++ b/src/arch/arm/id.S
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
diff --git a/src/arch/arm/include/arch/asm.h b/src/arch/arm/include/arch/asm.h
index b9591b6b86..7ecdfe18a7 100644
--- a/src/arch/arm/include/arch/asm.h
+++ b/src/arch/arm/include/arch/asm.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARM_ASM_H
#define __ARM_ASM_H
diff --git a/src/arch/arm/include/arch/boot/boot.h b/src/arch/arm/include/arch/boot/boot.h
index 07d3adcf7d..c73fe217df 100644
--- a/src/arch/arm/include/arch/boot/boot.h
+++ b/src/arch/arm/include/arch/boot/boot.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef ASM_ARM_BOOT_H
#define ASM_ARM_BOOT_H
diff --git a/src/arch/arm/include/arch/byteorder.h b/src/arch/arm/include/arch/byteorder.h
index 37cb8b6df6..096ef7585a 100644
--- a/src/arch/arm/include/arch/byteorder.h
+++ b/src/arch/arm/include/arch/byteorder.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef _BYTEORDER_H
#define _BYTEORDER_H
diff --git a/src/arch/arm/include/arch/cbconfig.h b/src/arch/arm/include/arch/cbconfig.h
index 35c1387895..fedc8bdcc6 100644
--- a/src/arch/arm/include/arch/cbconfig.h
+++ b/src/arch/arm/include/arch/cbconfig.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef _ARCH_CBCONFIG_H_
#define _ARCH_CBCONFIG_H_
diff --git a/src/arch/arm/include/arch/clock.h b/src/arch/arm/include/arch/clock.h
index 248da0607a..2139f017c0 100644
--- a/src/arch/arm/include/arch/clock.h
+++ b/src/arch/arm/include/arch/clock.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARM_CLOCK_H_
#define __ARM_CLOCK_H_
diff --git a/src/arch/arm/include/arch/header.ld b/src/arch/arm/include/arch/header.ld
index 5d93673579..c834879023 100644
--- a/src/arch/arm/include/arch/header.ld
+++ b/src/arch/arm/include/arch/header.ld
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
diff --git a/src/arch/arm/include/arch/hlt.h b/src/arch/arm/include/arch/hlt.h
index 915f4c003a..064d42583a 100644
--- a/src/arch/arm/include/arch/hlt.h
+++ b/src/arch/arm/include/arch/hlt.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef ARCH_HLT_H
#define ARCH_HLT_H
diff --git a/src/arch/arm/include/arch/memlayout.h b/src/arch/arm/include/arch/memlayout.h
index 26b8ef4708..7a8fc0cb9d 100644
--- a/src/arch/arm/include/arch/memlayout.h
+++ b/src/arch/arm/include/arch/memlayout.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/* This file contains macro definitions for memlayout.ld linker scripts. */
diff --git a/src/arch/arm/include/arch/pci_ops.h b/src/arch/arm/include/arch/pci_ops.h
index 8389f3c4e4..54897fefe0 100644
--- a/src/arch/arm/include/arch/pci_ops.h
+++ b/src/arch/arm/include/arch/pci_ops.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef ARCH_ARM_PCI_OPS_H
#define ARCH_ARM_PCI_OPS_H
diff --git a/src/arch/arm/include/arch/stages.h b/src/arch/arm/include/arch/stages.h
index 795a3a3e7a..09167846cd 100644
--- a/src/arch/arm/include/arch/stages.h
+++ b/src/arch/arm/include/arch/stages.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_STAGES_H
#define __ARCH_STAGES_H
diff --git a/src/arch/arm/include/armv4/arch/cache.h b/src/arch/arm/include/armv4/arch/cache.h
index ed3b96fffe..ee4bf9c603 100644
--- a/src/arch/arm/include/armv4/arch/cache.h
+++ b/src/arch/arm/include/armv4/arch/cache.h
@@ -1,31 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
/*
- * 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
* cache.h: Cache maintenance API for ARM
*/
diff --git a/src/arch/arm/include/armv4/arch/cpu.h b/src/arch/arm/include/armv4/arch/cpu.h
index 3a27743cbf..765ea0295d 100644
--- a/src/arch/arm/include/armv4/arch/cpu.h
+++ b/src/arch/arm/include/armv4/arch/cpu.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_CPU_H__
#define __ARCH_CPU_H__
diff --git a/src/arch/arm/include/armv4/arch/exception.h b/src/arch/arm/include/armv4/arch/exception.h
index d4e9658f75..1e71c53f08 100644
--- a/src/arch/arm/include/armv4/arch/exception.h
+++ b/src/arch/arm/include/armv4/arch/exception.h
@@ -1,31 +1,5 @@
-/*
- * 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- */
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
#ifndef _ARCH_EXCEPTION_H
#define _ARCH_EXCEPTION_H
diff --git a/src/arch/arm/include/armv4/arch/mmio.h b/src/arch/arm/include/armv4/arch/mmio.h
index 2c43789abf..71bf887ab9 100644
--- a/src/arch/arm/include/armv4/arch/mmio.h
+++ b/src/arch/arm/include/armv4/arch/mmio.h
@@ -1,16 +1,6 @@
-/*
- * 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
- * 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.
- *
- * Originally imported from linux/include/asm-arm/io.h. This file has changed
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+/* Originally imported from linux/include/asm-arm/io.h. This file has changed
* substantially since then.
*/
diff --git a/src/arch/arm/include/armv4/arch/smp/spinlock.h b/src/arch/arm/include/armv4/arch/smp/spinlock.h
index e49dc4440a..59656c3868 100644
--- a/src/arch/arm/include/armv4/arch/smp/spinlock.h
+++ b/src/arch/arm/include/armv4/arch/smp/spinlock.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef _ARCH_SMP_SPINLOCK_H
#define _ARCH_SMP_SPINLOCK_H
diff --git a/src/arch/arm/include/armv7.h b/src/arch/arm/include/armv7.h
index 626e6083f3..7f1d6098f9 100644
--- a/src/arch/arm/include/armv7.h
+++ b/src/arch/arm/include/armv7.h
@@ -1,16 +1,6 @@
-/*
- * This file is part of the coreboot project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* This file is part of the coreboot project. */
+
#ifndef ARMV7_H
#define ARMV7_H
#include
diff --git a/src/arch/arm/include/armv7/arch/cache.h b/src/arch/arm/include/armv7/arch/cache.h
index b2b6a33333..01918a7286 100644
--- a/src/arch/arm/include/armv7/arch/cache.h
+++ b/src/arch/arm/include/armv7/arch/cache.h
@@ -1,32 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
/*
- * This file is part of the coreboot project.
- *
- * Copyright (c) 2015, The Linux Foundation. All rights reserved.
- * 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
* cache.h: Cache maintenance API for ARM
*/
diff --git a/src/arch/arm/include/armv7/arch/cpu.h b/src/arch/arm/include/armv7/arch/cpu.h
index 0377e2a5c9..60db1d74eb 100644
--- a/src/arch/arm/include/armv7/arch/cpu.h
+++ b/src/arch/arm/include/armv7/arch/cpu.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_CPU_H__
#define __ARCH_CPU_H__
diff --git a/src/arch/arm/include/armv7/arch/exception.h b/src/arch/arm/include/armv7/arch/exception.h
index df3930977b..958a51bdda 100644
--- a/src/arch/arm/include/armv7/arch/exception.h
+++ b/src/arch/arm/include/armv7/arch/exception.h
@@ -1,31 +1,5 @@
-/*
- * 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- */
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
#ifndef _ARCH_EXCEPTION_H
#define _ARCH_EXCEPTION_H
diff --git a/src/arch/arm/include/armv7/arch/mmio.h b/src/arch/arm/include/armv7/arch/mmio.h
index 87f68715e8..47b2e84876 100644
--- a/src/arch/arm/include/armv7/arch/mmio.h
+++ b/src/arch/arm/include/armv7/arch/mmio.h
@@ -1,15 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
- * 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
- * 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.
- *
* Originally imported from linux/include/asm-arm/io.h. This file has changed
* substantially since then.
*/
diff --git a/src/arch/arm/include/clocks.h b/src/arch/arm/include/clocks.h
index 4904b6e96a..4379b63468 100644
--- a/src/arch/arm/include/clocks.h
+++ b/src/arch/arm/include/clocks.h
@@ -1,16 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* This file is part of the coreboot project. */
/* Standard clock speeds */
diff --git a/src/arch/arm/include/smp/spinlock.h b/src/arch/arm/include/smp/spinlock.h
index 189bf2c507..3183cc1c80 100644
--- a/src/arch/arm/include/smp/spinlock.h
+++ b/src/arch/arm/include/smp/spinlock.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef ARCH_SMP_SPINLOCK_H
#define ARCH_SMP_SPINLOCK_H
diff --git a/src/arch/arm/libgcc/Makefile.inc b/src/arch/arm/libgcc/Makefile.inc
index 2d0f6a81da..b64a5fa1e8 100644
--- a/src/arch/arm/libgcc/Makefile.inc
+++ b/src/arch/arm/libgcc/Makefile.inc
@@ -1,16 +1,8 @@
################################################################################
##
+## SPDX-License-Identifier: GPL-2.0-only
## 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.
-##
################################################################################
libgcc_files = ashldi3.S lib1funcs.S lshrdi3.S muldi3.S ucmpdi2.S uldivmod.S
diff --git a/src/arch/arm/libgcc/ashldi3.S b/src/arch/arm/libgcc/ashldi3.S
index 473e15f3f3..8243cedc35 100644
--- a/src/arch/arm/libgcc/ashldi3.S
+++ b/src/arch/arm/libgcc/ashldi3.S
@@ -1,26 +1,5 @@
-/*
-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
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-In addition to the permissions in the GNU General Public License, the
-Free Software Foundation gives you unlimited permission to link the
-compiled version of this file into combinations with other programs,
-and to distribute those combinations without any restriction coming
-from the use of this file. (The General Public License restrictions
-do apply in other respects; for example, they cover modification of
-the file, and distribution when not linked into a combine
-executable.)
-
-This file 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.
-*/
-
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* This file is part of the coreboot project. */
#if defined __GNUC__
diff --git a/src/arch/arm/libgcc/lib1funcs.S b/src/arch/arm/libgcc/lib1funcs.S
index 5c2a6ade17..af98022eaf 100644
--- a/src/arch/arm/libgcc/lib1funcs.S
+++ b/src/arch/arm/libgcc/lib1funcs.S
@@ -1,26 +1,5 @@
-/*
-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
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-In addition to the permissions in the GNU General Public License, the
-Free Software Foundation gives you unlimited permission to link the
-compiled version of this file into combinations with other programs,
-and to distribute those combinations without any restriction coming
-from the use of this file. (The General Public License restrictions
-do apply in other respects; for example, they cover modification of
-the file, and distribution when not linked into a combine
-executable.)
-
-This file 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.
-*/
-
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* This file is part of the coreboot project. */
/*
* linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines
*/
diff --git a/src/arch/arm/libgcc/libgcc.h b/src/arch/arm/libgcc/libgcc.h
index 95f4564a29..a8407dd35c 100644
--- a/src/arch/arm/libgcc/libgcc.h
+++ b/src/arch/arm/libgcc/libgcc.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_ARM_LIBGCC_LIBGCC_H__
#define __ARCH_ARM_LIBGCC_LIBGCC_H__
diff --git a/src/arch/arm/libgcc/lshrdi3.S b/src/arch/arm/libgcc/lshrdi3.S
index 5e67690010..4c55384bd8 100644
--- a/src/arch/arm/libgcc/lshrdi3.S
+++ b/src/arch/arm/libgcc/lshrdi3.S
@@ -1,26 +1,5 @@
-/*
-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
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-In addition to the permissions in the GNU General Public License, the
-Free Software Foundation gives you unlimited permission to link the
-compiled version of this file into combinations with other programs,
-and to distribute those combinations without any restriction coming
-from the use of this file. (The General Public License restrictions
-do apply in other respects; for example, they cover modification of
-the file, and distribution when not linked into a combine
-executable.)
-
-This file 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.
-*/
-
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* This file is part of the coreboot project. */
#if defined __GNUC__
diff --git a/src/arch/arm/libgcc/muldi3.S b/src/arch/arm/libgcc/muldi3.S
index c7584745b9..98136f566a 100644
--- a/src/arch/arm/libgcc/muldi3.S
+++ b/src/arch/arm/libgcc/muldi3.S
@@ -1,17 +1,6 @@
-/*
- * 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
- * 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
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+/* 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 771e93b502..27671a29fa 100644
--- a/src/arch/arm/libgcc/ucmpdi2.S
+++ b/src/arch/arm/libgcc/ucmpdi2.S
@@ -1,17 +1,6 @@
-/*
- * 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
- * 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
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+/* Based on linux/arch/arm/lib/ucmpdi2.S */
#if defined __GNUC__
diff --git a/src/arch/arm/libgcc/udivmoddi4.c b/src/arch/arm/libgcc/udivmoddi4.c
index 6073848fb2..7c4b2563dd 100644
--- a/src/arch/arm/libgcc/udivmoddi4.c
+++ b/src/arch/arm/libgcc/udivmoddi4.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include "libgcc.h"
diff --git a/src/arch/arm/libgcc/uldivmod.S b/src/arch/arm/libgcc/uldivmod.S
index ecbeccfe4b..528be4654e 100644
--- a/src/arch/arm/libgcc/uldivmod.S
+++ b/src/arch/arm/libgcc/uldivmod.S
@@ -1,39 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright 2010, Google Inc.
- * 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 Google Inc. 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
- * OWNER 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.
- *
- * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2 as published by the Free
- * Software Foundation.
- */
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */
+/* This file is part of the coreboot project. */
#include
diff --git a/src/arch/arm/libgcc/umoddi3.c b/src/arch/arm/libgcc/umoddi3.c
index a1d9a161c2..0f111f2b13 100644
--- a/src/arch/arm/libgcc/umoddi3.c
+++ b/src/arch/arm/libgcc/umoddi3.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include "libgcc.h"
uint64_t __umoddi3(uint64_t num, uint64_t den)
diff --git a/src/arch/arm/memcpy.S b/src/arch/arm/memcpy.S
index 19592dbfaf..50b34f6e9e 100644
--- a/src/arch/arm/memcpy.S
+++ b/src/arch/arm/memcpy.S
@@ -1,15 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
- * 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
- * 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
*/
diff --git a/src/arch/arm/memmove.S b/src/arch/arm/memmove.S
index 3b5681ced2..bcee5c98bd 100644
--- a/src/arch/arm/memmove.S
+++ b/src/arch/arm/memmove.S
@@ -1,17 +1,6 @@
-/*
- * 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
- * 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
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+/* Based on linux/arch/arm/lib/memmove.S */
#include
#include "asmlib.h"
diff --git a/src/arch/arm/memset.S b/src/arch/arm/memset.S
index 7d71a88bc3..d4cd2aabb9 100644
--- a/src/arch/arm/memset.S
+++ b/src/arch/arm/memset.S
@@ -1,15 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
- * 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
- * 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/memset.S
*
* ASM optimised string functions
diff --git a/src/arch/arm/stages.c b/src/arch/arm/stages.c
index fc2ebdb2fc..128b48cf55 100644
--- a/src/arch/arm/stages.c
+++ b/src/arch/arm/stages.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
* This file contains entry/exit functions for each stage during coreboot
@@ -24,7 +14,6 @@
#include
#include
-#include
/**
* generic stage entry point. override this if board specific code is needed.
diff --git a/src/arch/arm/tables.c b/src/arch/arm/tables.c
index ab2b579f0a..2d79585506 100644
--- a/src/arch/arm/tables.c
+++ b/src/arch/arm/tables.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/arm64/Makefile.inc b/src/arch/arm64/Makefile.inc
index a8742f2e13..c3d1fe5e0e 100644
--- a/src/arch/arm64/Makefile.inc
+++ b/src/arch/arm64/Makefile.inc
@@ -1,16 +1,8 @@
################################################################################
##
+## SPDX-License-Identifier: GPL-2.0-only
## 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.
-##
################################################################################
################################################################################
diff --git a/src/arch/arm64/arch_timer.c b/src/arch/arm64/arch_timer.c
index 2db235a5da..3707c89f0d 100644
--- a/src/arch/arm64/arch_timer.c
+++ b/src/arch/arm64/arch_timer.c
@@ -1,15 +1,5 @@
-/*
- * 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 and
- * only 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/arm64/armv8/Makefile.inc b/src/arch/arm64/armv8/Makefile.inc
index 127c5f114b..c794181c2b 100644
--- a/src/arch/arm64/armv8/Makefile.inc
+++ b/src/arch/arm64/armv8/Makefile.inc
@@ -1,16 +1,8 @@
################################################################################
##
+## SPDX-License-Identifier: GPL-2.0-only
## 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.
-##
################################################################################
ifeq ($(CONFIG_ARCH_ARMV8_EXTENSION),0)
diff --git a/src/arch/arm64/armv8/bootblock.S b/src/arch/arm64/armv8/bootblock.S
index 64d2405895..8cfa5606b6 100644
--- a/src/arch/arm64/armv8/bootblock.S
+++ b/src/arch/arm64/armv8/bootblock.S
@@ -1,16 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
- * 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.
- *
* Early initialization code for aarch64 (a.k.a. armv8)
*/
diff --git a/src/arch/arm64/armv8/cache.c b/src/arch/arm64/armv8/cache.c
index 46dc85958d..6df38b9bc7 100644
--- a/src/arch/arm64/armv8/cache.c
+++ b/src/arch/arm64/armv8/cache.c
@@ -1,31 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
/*
- * This file is part of the coreboot project.
- *
- * Copyright 2014 Google Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
* cache.c: Cache maintenance routines for ARMv8 (aarch64)
*
* Reference: ARM Architecture Reference Manual, ARMv8-A edition
diff --git a/src/arch/arm64/armv8/cpu.S b/src/arch/arm64/armv8/cpu.S
index 5f06c7e677..fa4e3bcb67 100644
--- a/src/arch/arm64/armv8/cpu.S
+++ b/src/arch/arm64/armv8/cpu.S
@@ -1,15 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
- * 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
- * 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.
- *
* Optimized assembly for low-level CPU operations on ARM64 processors.
*/
diff --git a/src/arch/arm64/armv8/exception.c b/src/arch/arm64/armv8/exception.c
index 4d566aa415..e2dfea0040 100644
--- a/src/arch/arm64/armv8/exception.c
+++ b/src/arch/arm64/armv8/exception.c
@@ -1,36 +1,9 @@
-/*
- * 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- */
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
#include
#include
#include
-#include
#include
#include
#include
diff --git a/src/arch/arm64/armv8/mmu.c b/src/arch/arm64/armv8/mmu.c
index bdec55c8c2..7cce9372a6 100644
--- a/src/arch/arm64/armv8/mmu.c
+++ b/src/arch/arm64/armv8/mmu.c
@@ -1,31 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright 2014 Google Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- */
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/arm64/bl31.c b/src/arch/arm64/bl31.c
index c94b1d101e..c06eee07ca 100644
--- a/src/arch/arm64/bl31.c
+++ b/src/arch/arm64/bl31.c
@@ -1,17 +1,6 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
-#include
#include
#include
#include
diff --git a/src/arch/arm64/boot.c b/src/arch/arm64/boot.c
index 479a910cae..58b33a0915 100644
--- a/src/arch/arm64/boot.c
+++ b/src/arch/arm64/boot.c
@@ -1,18 +1,7 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
-#include
#include
#include
#include
diff --git a/src/arch/arm64/div0.c b/src/arch/arm64/div0.c
index daf1d920b0..3cb31cf2da 100644
--- a/src/arch/arm64/div0.c
+++ b/src/arch/arm64/div0.c
@@ -1,16 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* This file is part of the coreboot project. */
#include
diff --git a/src/arch/arm64/eabi_compat.c b/src/arch/arm64/eabi_compat.c
index 79b201758a..22268b266e 100644
--- a/src/arch/arm64/eabi_compat.c
+++ b/src/arch/arm64/eabi_compat.c
@@ -1,16 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* This file is part of the coreboot project. */
/*
- * This file is part of the coreboot project.
- *
- * This program is Free Software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
* Utility functions needed for (some) EABI conformant tool chains.
*/
diff --git a/src/arch/arm64/fit_payload.c b/src/arch/arm64/fit_payload.c
index 7009a3f25d..6d8064898e 100644
--- a/src/arch/arm64/fit_payload.c
+++ b/src/arch/arm64/fit_payload.c
@@ -1,16 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/arm64/id.S b/src/arch/arm64/id.S
index 16173fb598..3cdd013535 100644
--- a/src/arch/arm64/id.S
+++ b/src/arch/arm64/id.S
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
diff --git a/src/arch/arm64/include/arch/acpi.h b/src/arch/arm64/include/arch/acpi.h
index 4015d18021..5a9005c078 100644
--- a/src/arch/arm64/include/arch/acpi.h
+++ b/src/arch/arm64/include/arch/acpi.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_ACPI_H_
#define __ARCH_ACPI_H_
diff --git a/src/arch/arm64/include/arch/acpigen.h b/src/arch/arm64/include/arch/acpigen.h
index 1ca538e703..8550e69817 100644
--- a/src/arch/arm64/include/arch/acpigen.h
+++ b/src/arch/arm64/include/arch/acpigen.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_ACPIGEN_H_
#define __ARCH_ACPIGEN_H_
diff --git a/src/arch/arm64/include/arch/asm.h b/src/arch/arm64/include/arch/asm.h
index 7d3ad7e6b3..9ed3299bbf 100644
--- a/src/arch/arm64/include/arch/asm.h
+++ b/src/arch/arm64/include/arch/asm.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARM_ARM64_ASM_H
#define __ARM_ARM64_ASM_H
diff --git a/src/arch/arm64/include/arch/boot/boot.h b/src/arch/arm64/include/arch/boot/boot.h
index ae6913cc0c..043481f690 100644
--- a/src/arch/arm64/include/arch/boot/boot.h
+++ b/src/arch/arm64/include/arch/boot/boot.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef ASM_ARM64_BOOT_H
#define ASM_ARM64_BOOT_H
diff --git a/src/arch/arm64/include/arch/byteorder.h b/src/arch/arm64/include/arch/byteorder.h
index 37cb8b6df6..096ef7585a 100644
--- a/src/arch/arm64/include/arch/byteorder.h
+++ b/src/arch/arm64/include/arch/byteorder.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef _BYTEORDER_H
#define _BYTEORDER_H
diff --git a/src/arch/arm64/include/arch/cbconfig.h b/src/arch/arm64/include/arch/cbconfig.h
index 35c1387895..fedc8bdcc6 100644
--- a/src/arch/arm64/include/arch/cbconfig.h
+++ b/src/arch/arm64/include/arch/cbconfig.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef _ARCH_CBCONFIG_H_
#define _ARCH_CBCONFIG_H_
diff --git a/src/arch/arm64/include/arch/header.ld b/src/arch/arm64/include/arch/header.ld
index dcba068f9a..9ac6bfd1b1 100644
--- a/src/arch/arm64/include/arch/header.ld
+++ b/src/arch/arm64/include/arch/header.ld
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
diff --git a/src/arch/arm64/include/arch/hlt.h b/src/arch/arm64/include/arch/hlt.h
index 915f4c003a..064d42583a 100644
--- a/src/arch/arm64/include/arch/hlt.h
+++ b/src/arch/arm64/include/arch/hlt.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef ARCH_HLT_H
#define ARCH_HLT_H
diff --git a/src/arch/arm64/include/arch/memlayout.h b/src/arch/arm64/include/arch/memlayout.h
index 984a09b86e..98347cb2b5 100644
--- a/src/arch/arm64/include/arch/memlayout.h
+++ b/src/arch/arm64/include/arch/memlayout.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/* This file contains macro definitions for memlayout.ld linker scripts. */
diff --git a/src/arch/arm64/include/arch/mpidr.h b/src/arch/arm64/include/arch/mpidr.h
index cc43309e4b..97ea327530 100644
--- a/src/arch/arm64/include/arch/mpidr.h
+++ b/src/arch/arm64/include/arch/mpidr.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_MPIDR_H__
#define __ARCH_MPIDR_H__
diff --git a/src/arch/arm64/include/arch/pci_ops.h b/src/arch/arm64/include/arch/pci_ops.h
index 65dd059529..94992c0c00 100644
--- a/src/arch/arm64/include/arch/pci_ops.h
+++ b/src/arch/arm64/include/arch/pci_ops.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef ARCH_ARM64_PCI_OPS_H
#define ARCH_ARM64_PCI_OPS_H
diff --git a/src/arch/arm64/include/arch/stages.h b/src/arch/arm64/include/arch/stages.h
index c8a3bdd20e..5c44f63929 100644
--- a/src/arch/arm64/include/arch/stages.h
+++ b/src/arch/arm64/include/arch/stages.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_STAGES_H
#define __ARCH_STAGES_H
diff --git a/src/arch/arm64/include/arch/transition.h b/src/arch/arm64/include/arch/transition.h
index 8a49eed8de..98625946a6 100644
--- a/src/arch/arm64/include/arch/transition.h
+++ b/src/arch/arm64/include/arch/transition.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_ARM64_TRANSITION_H__
#define __ARCH_ARM64_TRANSITION_H__
diff --git a/src/arch/arm64/include/armv8/arch/barrier.h b/src/arch/arm64/include/armv8/arch/barrier.h
index 8da2cc29c8..790a130050 100644
--- a/src/arch/arm64/include/armv8/arch/barrier.h
+++ b/src/arch/arm64/include/armv8/arch/barrier.h
@@ -1,15 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
- * 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
- * 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 arch/arm/include/asm/barrier.h
*/
#ifndef __ASM_ARM_BARRIER_H
diff --git a/src/arch/arm64/include/armv8/arch/cache.h b/src/arch/arm64/include/armv8/arch/cache.h
index 1168992cc4..7b19ca5ad0 100644
--- a/src/arch/arm64/include/armv8/arch/cache.h
+++ b/src/arch/arm64/include/armv8/arch/cache.h
@@ -1,31 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
/*
- * 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
* cache.h: Cache maintenance API for ARM64
*/
diff --git a/src/arch/arm64/include/armv8/arch/cpu.h b/src/arch/arm64/include/armv8/arch/cpu.h
index 9b08bb4f7e..cfccf4c165 100644
--- a/src/arch/arm64/include/armv8/arch/cpu.h
+++ b/src/arch/arm64/include/armv8/arch/cpu.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_CPU_H__
#define __ARCH_CPU_H__
diff --git a/src/arch/arm64/include/armv8/arch/exception.h b/src/arch/arm64/include/armv8/arch/exception.h
index 155060f954..35021591ba 100644
--- a/src/arch/arm64/include/armv8/arch/exception.h
+++ b/src/arch/arm64/include/armv8/arch/exception.h
@@ -1,31 +1,5 @@
-/*
- * 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- */
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
#ifndef _ARCH_EXCEPTION_H
#define _ARCH_EXCEPTION_H
diff --git a/src/arch/arm64/include/armv8/arch/lib_helpers.h b/src/arch/arm64/include/armv8/arch/lib_helpers.h
index 9d5b508453..cd4aa449c4 100644
--- a/src/arch/arm64/include/armv8/arch/lib_helpers.h
+++ b/src/arch/arm64/include/armv8/arch/lib_helpers.h
@@ -1,16 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
- * 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.
- *
* lib_helpers.h: All library function prototypes and macros are defined in this
* file.
*/
diff --git a/src/arch/arm64/include/armv8/arch/mmio.h b/src/arch/arm64/include/armv8/arch/mmio.h
index 4a92ddb38d..47e7f349c0 100644
--- a/src/arch/arm64/include/armv8/arch/mmio.h
+++ b/src/arch/arm64/include/armv8/arch/mmio.h
@@ -1,15 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
- * 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
- * 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.
- *
* Originally imported from linux/include/asm-arm/io.h. This file has changed
* substantially since then.
*/
diff --git a/src/arch/arm64/include/armv8/arch/mmu.h b/src/arch/arm64/include/armv8/arch/mmu.h
index 4b6d78792a..f79510ec31 100644
--- a/src/arch/arm64/include/armv8/arch/mmu.h
+++ b/src/arch/arm64/include/armv8/arch/mmu.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_ARM64_MMU_H__
#define __ARCH_ARM64_MMU_H__
diff --git a/src/arch/arm64/include/bl31.h b/src/arch/arm64/include/bl31.h
index 0f90e774b3..c96bddf5d4 100644
--- a/src/arch/arm64/include/bl31.h
+++ b/src/arch/arm64/include/bl31.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __BL31_H__
#define __BL31_H__
diff --git a/src/arch/arm64/include/clocks.h b/src/arch/arm64/include/clocks.h
index 4904b6e96a..4379b63468 100644
--- a/src/arch/arm64/include/clocks.h
+++ b/src/arch/arm64/include/clocks.h
@@ -1,16 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* This file is part of the coreboot project. */
/* Standard clock speeds */
diff --git a/src/arch/arm64/include/cpu/cortex_a57.h b/src/arch/arm64/include/cpu/cortex_a57.h
index 3259934232..9497cd648c 100644
--- a/src/arch/arm64/include/cpu/cortex_a57.h
+++ b/src/arch/arm64/include/cpu/cortex_a57.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_ARM64_CORTEX_A57_H__
#define __ARCH_ARM64_CORTEX_A57_H__
diff --git a/src/arch/arm64/memcpy.S b/src/arch/arm64/memcpy.S
index ef37ea5dc9..a79abd5216 100644
--- a/src/arch/arm64/memcpy.S
+++ b/src/arch/arm64/memcpy.S
@@ -1,15 +1,5 @@
-/*
- * 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
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
diff --git a/src/arch/arm64/memmove.S b/src/arch/arm64/memmove.S
index ac2865054e..23b2a918f0 100644
--- a/src/arch/arm64/memmove.S
+++ b/src/arch/arm64/memmove.S
@@ -1,15 +1,5 @@
-/*
- * 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
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
/*
diff --git a/src/arch/arm64/memset.S b/src/arch/arm64/memset.S
index 5b61b31053..44e1047f4f 100644
--- a/src/arch/arm64/memset.S
+++ b/src/arch/arm64/memset.S
@@ -1,15 +1,5 @@
-/*
- * 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
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
diff --git a/src/arch/arm64/ramdetect.c b/src/arch/arm64/ramdetect.c
index bc034c311b..1b2b3cee3f 100644
--- a/src/arch/arm64/ramdetect.c
+++ b/src/arch/arm64/ramdetect.c
@@ -1,8 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/arm64/romstage.c b/src/arch/arm64/romstage.c
index 58c47e78f3..3eede4ffc2 100644
--- a/src/arch/arm64/romstage.c
+++ b/src/arch/arm64/romstage.c
@@ -1,16 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/arm64/tables.c b/src/arch/arm64/tables.c
index 62334a725f..825cef189d 100644
--- a/src/arch/arm64/tables.c
+++ b/src/arch/arm64/tables.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/arm64/transition.c b/src/arch/arm64/transition.c
index ac59d19acf..b21ee05b45 100644
--- a/src/arch/arm64/transition.c
+++ b/src/arch/arm64/transition.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/arm64/transition_asm.S b/src/arch/arm64/transition_asm.S
index bdb412f36d..f62183e823 100644
--- a/src/arch/arm64/transition_asm.S
+++ b/src/arch/arm64/transition_asm.S
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
* transition_asm.S: This file handles the entry and exit from an exception
diff --git a/src/arch/ppc64/Makefile.inc b/src/arch/ppc64/Makefile.inc
index fae4c926b7..1c35f6f3f8 100644
--- a/src/arch/ppc64/Makefile.inc
+++ b/src/arch/ppc64/Makefile.inc
@@ -1,16 +1,8 @@
################################################################################
##
+## SPDX-License-Identifier: GPL-2.0-only
## 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.
-##
################################################################################
ppc64_flags = -I$(src)/arch/ppc64/ -mbig-endian -mcpu=power8 -mtune=power8
diff --git a/src/arch/ppc64/boot.c b/src/arch/ppc64/boot.c
index 6c13761538..1bd1c09b75 100644
--- a/src/arch/ppc64/boot.c
+++ b/src/arch/ppc64/boot.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
diff --git a/src/arch/ppc64/bootblock.S b/src/arch/ppc64/bootblock.S
index 2628e0dabe..4c13bc94b6 100644
--- a/src/arch/ppc64/bootblock.S
+++ b/src/arch/ppc64/bootblock.S
@@ -1,16 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
- * 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.
- *
* Early initialization code for POWER8.
*/
diff --git a/src/arch/ppc64/id.ld b/src/arch/ppc64/id.ld
index 932375665e..4f6853fc9d 100644
--- a/src/arch/ppc64/id.ld
+++ b/src/arch/ppc64/id.ld
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
SECTIONS {
. = (0xffffffff - CONFIG_ID_SECTION_OFFSET) - (__id_end - __id_start) + 1;
diff --git a/src/arch/ppc64/include/arch/byteorder.h b/src/arch/ppc64/include/arch/byteorder.h
index 37cb8b6df6..096ef7585a 100644
--- a/src/arch/ppc64/include/arch/byteorder.h
+++ b/src/arch/ppc64/include/arch/byteorder.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef _BYTEORDER_H
#define _BYTEORDER_H
diff --git a/src/arch/ppc64/include/arch/cache.h b/src/arch/ppc64/include/arch/cache.h
index 37174475f5..1f0b9c282f 100644
--- a/src/arch/ppc64/include/arch/cache.h
+++ b/src/arch/ppc64/include/arch/cache.h
@@ -1,32 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright 2017 Google Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
- */
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
#ifndef ARCH_CACHE_H
#define ARCH_CACHE_H
diff --git a/src/arch/ppc64/include/arch/cbconfig.h b/src/arch/ppc64/include/arch/cbconfig.h
index 35c1387895..fedc8bdcc6 100644
--- a/src/arch/ppc64/include/arch/cbconfig.h
+++ b/src/arch/ppc64/include/arch/cbconfig.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef _ARCH_CBCONFIG_H_
#define _ARCH_CBCONFIG_H_
diff --git a/src/arch/ppc64/include/arch/cpu.h b/src/arch/ppc64/include/arch/cpu.h
index 89816903c8..4714b7cc4a 100644
--- a/src/arch/ppc64/include/arch/cpu.h
+++ b/src/arch/ppc64/include/arch/cpu.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_CPU_H__
#define __ARCH_CPU_H__
diff --git a/src/arch/ppc64/include/arch/exception.h b/src/arch/ppc64/include/arch/exception.h
index 07030e5b95..c88b55cbac 100644
--- a/src/arch/ppc64/include/arch/exception.h
+++ b/src/arch/ppc64/include/arch/exception.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef _ARCH_EXCEPTION_H
#define _ARCH_EXCEPTION_H
diff --git a/src/arch/ppc64/include/arch/header.ld b/src/arch/ppc64/include/arch/header.ld
index badeefdf49..d4aa134441 100644
--- a/src/arch/ppc64/include/arch/header.ld
+++ b/src/arch/ppc64/include/arch/header.ld
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/* We use ELF as output format. So that we can debug the code in some form. */
OUTPUT_ARCH(powerpc)
diff --git a/src/arch/ppc64/include/arch/hlt.h b/src/arch/ppc64/include/arch/hlt.h
index 1ba1e35b67..37d43026c2 100644
--- a/src/arch/ppc64/include/arch/hlt.h
+++ b/src/arch/ppc64/include/arch/hlt.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
static __always_inline void hlt(void)
{
diff --git a/src/arch/ppc64/include/arch/io.h b/src/arch/ppc64/include/arch/io.h
index 804d7dc1b1..1d865968bf 100644
--- a/src/arch/ppc64/include/arch/io.h
+++ b/src/arch/ppc64/include/arch/io.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef _ASM_IO_H
#define _ASM_IO_H
diff --git a/src/arch/ppc64/include/arch/memlayout.h b/src/arch/ppc64/include/arch/memlayout.h
index 09e87c9574..c65649c0cc 100644
--- a/src/arch/ppc64/include/arch/memlayout.h
+++ b/src/arch/ppc64/include/arch/memlayout.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/* This file contains macro definitions for memlayout.ld linker scripts. */
diff --git a/src/arch/ppc64/include/arch/mmio.h b/src/arch/ppc64/include/arch/mmio.h
index 8ffb81691a..55609acdf4 100644
--- a/src/arch/ppc64/include/arch/mmio.h
+++ b/src/arch/ppc64/include/arch/mmio.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_MMIO_H__
#define __ARCH_MMIO_H__
diff --git a/src/arch/ppc64/include/arch/stages.h b/src/arch/ppc64/include/arch/stages.h
index 37e9f85c8c..92caebc48e 100644
--- a/src/arch/ppc64/include/arch/stages.h
+++ b/src/arch/ppc64/include/arch/stages.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_STAGES_H
#define __ARCH_STAGES_H
diff --git a/src/arch/ppc64/prologue.inc b/src/arch/ppc64/prologue.inc
index 9e22eb3d49..7685f5b625 100644
--- a/src/arch/ppc64/prologue.inc
+++ b/src/arch/ppc64/prologue.inc
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
.section ".rom.data", "a", @progbits
.section ".rom.text", "ax", @progbits
diff --git a/src/arch/ppc64/rom_media.c b/src/arch/ppc64/rom_media.c
index 0fc8be26e0..90e037331b 100644
--- a/src/arch/ppc64/rom_media.c
+++ b/src/arch/ppc64/rom_media.c
@@ -1,16 +1,6 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
#include
/* This assumes that the CBFS resides at 0x0, which is true for the default
diff --git a/src/arch/ppc64/stages.c b/src/arch/ppc64/stages.c
index aacf45f88f..edb49ce29c 100644
--- a/src/arch/ppc64/stages.c
+++ b/src/arch/ppc64/stages.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
* This file contains entry/exit functions for each stage during coreboot
diff --git a/src/arch/ppc64/tables.c b/src/arch/ppc64/tables.c
index e9de4bfd71..eafc87e2af 100644
--- a/src/arch/ppc64/tables.c
+++ b/src/arch/ppc64/tables.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/riscv/Makefile.inc b/src/arch/riscv/Makefile.inc
index 003852324b..17f225a523 100644
--- a/src/arch/riscv/Makefile.inc
+++ b/src/arch/riscv/Makefile.inc
@@ -1,19 +1,8 @@
################################################################################
##
+## SPDX-License-Identifier: GPL-2.0-only
## This file is part of the coreboot project.
##
-## Copyright (C) 2014 The ChromiumOS Authors
-## Copyright (C) 2018 HardenedLinux
-##
-## This program is free software; you can redistribute 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.
-##
################################################################################
################################################################################
diff --git a/src/arch/riscv/arch_timer.c b/src/arch/riscv/arch_timer.c
index 55b1f723ee..af5db5ed61 100644
--- a/src/arch/riscv/arch_timer.c
+++ b/src/arch/riscv/arch_timer.c
@@ -1,17 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright 2018 Philipp Hug
- *
- * This program is free software; you can redistribute 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/riscv/boot.c b/src/arch/riscv/boot.c
index f9f94a7086..0e6e2233f2 100644
--- a/src/arch/riscv/boot.c
+++ b/src/arch/riscv/boot.c
@@ -1,17 +1,5 @@
-/*
- * 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.
- *
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/riscv/bootblock.S b/src/arch/riscv/bootblock.S
index b0796f9fbc..b25a541949 100644
--- a/src/arch/riscv/bootblock.S
+++ b/src/arch/riscv/bootblock.S
@@ -1,18 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
* Early initialization code for RISC-V
- *
- * Copyright 2013 Google Inc.
- * Copyright 2016 Jonathan Neuschäfer
- *
- * This program is free software; you can redistribute 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
diff --git a/src/arch/riscv/fit_payload.c b/src/arch/riscv/fit_payload.c
index 63cda846fc..58d40f3959 100644
--- a/src/arch/riscv/fit_payload.c
+++ b/src/arch/riscv/fit_payload.c
@@ -1,18 +1,5 @@
-/*
- * Copyright 2013 Google Inc.
- * Copyright 2018 Facebook, Inc.
- * Copyright 2019 9elements Agency 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; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/riscv/fp_asm.S b/src/arch/riscv/fp_asm.S
index 9c6cc650d8..5961047aa9 100644
--- a/src/arch/riscv/fp_asm.S
+++ b/src/arch/riscv/fp_asm.S
@@ -1,17 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2018 HardenedLinux
- *
- * This program is free software; you can redistribute 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
* This file define some function used to swap value between memory
diff --git a/src/arch/riscv/include/arch/barrier.h b/src/arch/riscv/include/arch/barrier.h
index 257e2a2bc3..d5e61e8b47 100644
--- a/src/arch/riscv/include/arch/barrier.h
+++ b/src/arch/riscv/include/arch/barrier.h
@@ -1,33 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright 2014 Google Inc.
- * Copyright 2016 Jonathan Neuschäfer
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
- */
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_BARRIER_H_
#define __ARCH_BARRIER_H__
diff --git a/src/arch/riscv/include/arch/boot.h b/src/arch/riscv/include/arch/boot.h
index c05c669f00..be1e6f1ce3 100644
--- a/src/arch/riscv/include/arch/boot.h
+++ b/src/arch/riscv/include/arch/boot.h
@@ -1,17 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2018 Jonathan Neuschäfer
- *
- * This program is free software; you can redistribute 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef ARCH_RISCV_INCLUDE_ARCH_BOOT_H
#define ARCH_RISCV_INCLUDE_ARCH_BOOT_H
diff --git a/src/arch/riscv/include/arch/byteorder.h b/src/arch/riscv/include/arch/byteorder.h
index 37cb8b6df6..096ef7585a 100644
--- a/src/arch/riscv/include/arch/byteorder.h
+++ b/src/arch/riscv/include/arch/byteorder.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef _BYTEORDER_H
#define _BYTEORDER_H
diff --git a/src/arch/riscv/include/arch/cache.h b/src/arch/riscv/include/arch/cache.h
index 37d0662de8..b42ad95ea0 100644
--- a/src/arch/riscv/include/arch/cache.h
+++ b/src/arch/riscv/include/arch/cache.h
@@ -1,32 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright 2017 Google Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
- */
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
#ifndef ARCH_CACHE_H
#define ARCH_CACHE_H
diff --git a/src/arch/riscv/include/arch/cbconfig.h b/src/arch/riscv/include/arch/cbconfig.h
index 9467f52646..fedc8bdcc6 100644
--- a/src/arch/riscv/include/arch/cbconfig.h
+++ b/src/arch/riscv/include/arch/cbconfig.h
@@ -1,17 +1,5 @@
-/*
- * 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.
- *
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef _ARCH_CBCONFIG_H_
#define _ARCH_CBCONFIG_H_
diff --git a/src/arch/riscv/include/arch/cpu.h b/src/arch/riscv/include/arch/cpu.h
index c62199e3f0..e249aa3964 100644
--- a/src/arch/riscv/include/arch/cpu.h
+++ b/src/arch/riscv/include/arch/cpu.h
@@ -1,17 +1,5 @@
-/*
- * 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.
- *
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_CPU_H__
#define __ARCH_CPU_H__
diff --git a/src/arch/riscv/include/arch/encoding.h b/src/arch/riscv/include/arch/encoding.h
index f84c9d4a9d..8aae565ba0 100644
--- a/src/arch/riscv/include/arch/encoding.h
+++ b/src/arch/riscv/include/arch/encoding.h
@@ -1,29 +1,5 @@
-/*
- * Copyright (c) 2010-2017, The Regents of the University of California
- * (Regents). All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. Neither the name of the Regents nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
- * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
- * OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
- * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
- * HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
- * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- */
+/* SPDX-License-Identifier: BSD-4-Clause-UC */
+/* This file is part of the coreboot project. */
#ifndef RISCV_CSR_ENCODING_H
#define RISCV_CSR_ENCODING_H
diff --git a/src/arch/riscv/include/arch/errno.h b/src/arch/riscv/include/arch/errno.h
index 6f80ee5afd..1aa8eebb87 100644
--- a/src/arch/riscv/include/arch/errno.h
+++ b/src/arch/riscv/include/arch/errno.h
@@ -1,29 +1,5 @@
-/*
- * Copyright (c) 2013, The Regents of the University of California (Regents).
- * All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. Neither the name of the Regents nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
- * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
- * OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
- * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
- * HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
- * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- */
+/* SPDX-License-Identifier: BSD-4-Clause-UC */
+/* This file is part of the coreboot project. */
#ifndef _RISCV_ERRNO_BASE_H
#define _RISCV_ERRNO_BASE_H
diff --git a/src/arch/riscv/include/arch/exception.h b/src/arch/riscv/include/arch/exception.h
index 6fbbdf0a89..3e8da6c0f4 100644
--- a/src/arch/riscv/include/arch/exception.h
+++ b/src/arch/riscv/include/arch/exception.h
@@ -1,31 +1,5 @@
-/*
- * This file is part of the libpayload 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- */
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* This file is part of the coreboot project. */
#ifndef _ARCH_EXCEPTION_H
#define _ARCH_EXCEPTION_H
diff --git a/src/arch/riscv/include/arch/header.ld b/src/arch/riscv/include/arch/header.ld
index 4b1104778c..1168b37b8c 100644
--- a/src/arch/riscv/include/arch/header.ld
+++ b/src/arch/riscv/include/arch/header.ld
@@ -1,17 +1,5 @@
-/*
- * 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.
- *
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
diff --git a/src/arch/riscv/include/arch/hlt.h b/src/arch/riscv/include/arch/hlt.h
index a955ebbb0c..4020defe30 100644
--- a/src/arch/riscv/include/arch/hlt.h
+++ b/src/arch/riscv/include/arch/hlt.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
static __always_inline void hlt(void)
{
diff --git a/src/arch/riscv/include/arch/memlayout.h b/src/arch/riscv/include/arch/memlayout.h
index ac707d0978..fcbe6a7042 100644
--- a/src/arch/riscv/include/arch/memlayout.h
+++ b/src/arch/riscv/include/arch/memlayout.h
@@ -1,17 +1,5 @@
-/*
- * 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.
- *
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/* This file contains macro definitions for memlayout.ld linker scripts. */
diff --git a/src/arch/riscv/include/arch/mmio.h b/src/arch/riscv/include/arch/mmio.h
index 4cbc07bbc7..e66629e4ad 100644
--- a/src/arch/riscv/include/arch/mmio.h
+++ b/src/arch/riscv/include/arch/mmio.h
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_MMIO_H__
#define __ARCH_MMIO_H__
diff --git a/src/arch/riscv/include/arch/pmp.h b/src/arch/riscv/include/arch/pmp.h
index 6cdb997220..8335349e4f 100644
--- a/src/arch/riscv/include/arch/pmp.h
+++ b/src/arch/riscv/include/arch/pmp.h
@@ -1,17 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2018 HardenedLinux
- *
- * This program is free software; you can redistribute 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __RISCV_PMP_H__
#define __RISCV_PMP_H__
diff --git a/src/arch/riscv/include/arch/smp/atomic.h b/src/arch/riscv/include/arch/smp/atomic.h
index de7fd19bd3..1ac6e79a9a 100644
--- a/src/arch/riscv/include/arch/smp/atomic.h
+++ b/src/arch/riscv/include/arch/smp/atomic.h
@@ -1,30 +1,5 @@
-/*
- * Copyright (c) 2013, The Regents of the University of California (Regents).
- * Copyright (c) 2018, HardenedLinux.
- * All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. Neither the name of the Regents nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
- * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
- * OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
- * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
- * HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
- * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- */
+/* SPDX-License-Identifier: BSD-4-Clause-UC */
+/* This file is part of the coreboot project. */
#ifndef _RISCV_ATOMIC_H
#define _RISCV_ATOMIC_H
diff --git a/src/arch/riscv/include/arch/smp/smp.h b/src/arch/riscv/include/arch/smp/smp.h
index e996404476..353f8f5f36 100644
--- a/src/arch/riscv/include/arch/smp/smp.h
+++ b/src/arch/riscv/include/arch/smp/smp.h
@@ -1,17 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2018 HardenedLinux.
- *
- * This program is free software; you can redistribute 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef _RISCV_SMP_H
#define _RISCV_SMP_H
diff --git a/src/arch/riscv/include/arch/smp/spinlock.h b/src/arch/riscv/include/arch/smp/spinlock.h
index 95e60bfefc..c9c2e6c02b 100644
--- a/src/arch/riscv/include/arch/smp/spinlock.h
+++ b/src/arch/riscv/include/arch/smp/spinlock.h
@@ -1,17 +1,6 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2018 HardenedLinux.
- *
- * This program is free software; you can redistribute 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
#ifndef ARCH_SMP_SPINLOCK_H
#define ARCH_SMP_SPINLOCK_H
diff --git a/src/arch/riscv/include/arch/stages.h b/src/arch/riscv/include/arch/stages.h
index 138298fd03..2d8166894f 100644
--- a/src/arch/riscv/include/arch/stages.h
+++ b/src/arch/riscv/include/arch/stages.h
@@ -1,17 +1,5 @@
-/*
- * 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.
- *
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef __ARCH_STAGES_H
#define __ARCH_STAGES_H
diff --git a/src/arch/riscv/include/bits.h b/src/arch/riscv/include/bits.h
index d824f3ec98..8afb14a5d7 100644
--- a/src/arch/riscv/include/bits.h
+++ b/src/arch/riscv/include/bits.h
@@ -1,29 +1,5 @@
-/*
- * Copyright (c) 2013, The Regents of the University of California (Regents).
- * All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. Neither the name of the Regents nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
- * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
- * OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
- * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
- * HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
- * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- */
+/* SPDX-License-Identifier: BSD-4-Clause-UC */
+/* This file is part of the coreboot project. */
#ifndef _BITS_H
#define _BITS_H
diff --git a/src/arch/riscv/include/mcall.h b/src/arch/riscv/include/mcall.h
index d7d67ce33b..44b2d27334 100644
--- a/src/arch/riscv/include/mcall.h
+++ b/src/arch/riscv/include/mcall.h
@@ -1,17 +1,5 @@
-/*
- * 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.
- *
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef _MCALL_H
#define _MCALL_H
diff --git a/src/arch/riscv/include/sbi.h b/src/arch/riscv/include/sbi.h
index 2943704a84..2905310b88 100644
--- a/src/arch/riscv/include/sbi.h
+++ b/src/arch/riscv/include/sbi.h
@@ -1,17 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2018 HardenedLinux
- *
- * This program is free software; you can redistribute 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#ifndef RISCV_SBI_H
#define RISCV_SBI_H
diff --git a/src/arch/riscv/include/vm.h b/src/arch/riscv/include/vm.h
index 9f6236ea75..5c2b1d4f6a 100644
--- a/src/arch/riscv/include/vm.h
+++ b/src/arch/riscv/include/vm.h
@@ -1,29 +1,5 @@
-/*
- * Copyright (c) 2013, The Regents of the University of California (Regents).
- * All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. Neither the name of the Regents nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
- * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
- * OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
- * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
- * HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
- * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- */
+/* SPDX-License-Identifier: BSD-4-Clause-UC */
+/* This file is part of the coreboot project. */
#ifndef _VM_H
#define _VM_H
diff --git a/src/arch/riscv/mcall.c b/src/arch/riscv/mcall.c
index afb17c1043..8e788a7c70 100644
--- a/src/arch/riscv/mcall.c
+++ b/src/arch/riscv/mcall.c
@@ -1,29 +1,5 @@
-/*
- * Copyright (c) 2013, The Regents of the University of California (Regents).
- * All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. Neither the name of the Regents nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
- * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
- * OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
- * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
- * HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
- * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- */
+/* SPDX-License-Identifier: BSD-4-Clause-UC */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/riscv/misaligned.c b/src/arch/riscv/misaligned.c
index ebff2d6678..172b21524c 100644
--- a/src/arch/riscv/misaligned.c
+++ b/src/arch/riscv/misaligned.c
@@ -1,17 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2018 HardenedLinux
- *
- * This program is free software; you can redistribute 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/riscv/misc.c b/src/arch/riscv/misc.c
index 1909dbc5f1..71bef1d787 100644
--- a/src/arch/riscv/misc.c
+++ b/src/arch/riscv/misc.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
diff --git a/src/arch/riscv/opensbi.c b/src/arch/riscv/opensbi.c
index 695c24f756..d9fdc2fb8e 100644
--- a/src/arch/riscv/opensbi.c
+++ b/src/arch/riscv/opensbi.c
@@ -1,17 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2019 9elements Agency 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.
- *
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/riscv/payload.c b/src/arch/riscv/payload.c
index 297d30d2a5..715d7f378c 100644
--- a/src/arch/riscv/payload.c
+++ b/src/arch/riscv/payload.c
@@ -1,19 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2016 Google Inc
- * Copyright (C) 2018 HardenedLinux
- * Copyright (C) 2018 Jonathan Neuschäfer
- *
- * This program is free software; you can redistribute 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/riscv/pmp.c b/src/arch/riscv/pmp.c
index 5e32f9ca23..e707051a85 100644
--- a/src/arch/riscv/pmp.c
+++ b/src/arch/riscv/pmp.c
@@ -1,17 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2018 HardenedLinux
- *
- * This program is free software; you can redistribute 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/riscv/ramstage.S b/src/arch/riscv/ramstage.S
index 2468c231bc..676c59ba1f 100644
--- a/src/arch/riscv/ramstage.S
+++ b/src/arch/riscv/ramstage.S
@@ -1,17 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2018 HardenedLinux
- *
- * This program is free software; you can redistribute 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/riscv/romstage.c b/src/arch/riscv/romstage.c
index d5f5a43ce1..0991c681b4 100644
--- a/src/arch/riscv/romstage.c
+++ b/src/arch/riscv/romstage.c
@@ -1,17 +1,5 @@
-/*
- * 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.
- *
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
* Entry points must be placed at the location the previous stage jumps
diff --git a/src/arch/riscv/sbi.c b/src/arch/riscv/sbi.c
index 27701895dd..bbde935ea9 100644
--- a/src/arch/riscv/sbi.c
+++ b/src/arch/riscv/sbi.c
@@ -1,17 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2018 HardenedLinux
- *
- * This program is free software; you can redistribute 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/riscv/smp.c b/src/arch/riscv/smp.c
index 95d116a629..eb435d85a4 100644
--- a/src/arch/riscv/smp.c
+++ b/src/arch/riscv/smp.c
@@ -1,17 +1,5 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2018 HardenedLinux.
- *
- * This program is free software; you can redistribute 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/riscv/tables.c b/src/arch/riscv/tables.c
index c5bcab0661..8a60b43e62 100644
--- a/src/arch/riscv/tables.c
+++ b/src/arch/riscv/tables.c
@@ -1,19 +1,5 @@
-/*
- * 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.
- *
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/riscv/trap_handler.c b/src/arch/riscv/trap_handler.c
index 6b39faba79..91db11479b 100644
--- a/src/arch/riscv/trap_handler.c
+++ b/src/arch/riscv/trap_handler.c
@@ -1,17 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
* Early initialization code for riscv
- *
- * 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
diff --git a/src/arch/riscv/trap_util.S b/src/arch/riscv/trap_util.S
index 8aba48b986..0e7d53bfcf 100644
--- a/src/arch/riscv/trap_util.S
+++ b/src/arch/riscv/trap_util.S
@@ -1,17 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
* Early initialization code for riscv
- *
- * 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
diff --git a/src/arch/riscv/virtual_memory.c b/src/arch/riscv/virtual_memory.c
index 2f13ecb398..431f711ba3 100644
--- a/src/arch/riscv/virtual_memory.c
+++ b/src/arch/riscv/virtual_memory.c
@@ -1,17 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
* Early initialization code for riscv virtual memory
- *
- * 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
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index 1c55bdbf3c..7e10f60c0e 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -1,15 +1,7 @@
##
+## SPDX-License-Identifier: GPL-2.0-only
## 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.
-##
config ARCH_X86
bool
@@ -97,9 +89,10 @@ config X86_RESET_VECTOR
config RESET_VECTOR_IN_RAM
bool
depends on ARCH_X86
+ select NO_XIP_EARLY_STAGES
help
- Select this option if the x86 soc implements custom code to handle the
- reset vector in RAM instead of the traditional 0xfffffff0 location.
+ Select this option if the x86 processor's reset vector is in
+ preinitialized DRAM 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.
@@ -214,6 +207,7 @@ config VERSTAGE_ADDR
config POSTCAR_STAGE
def_bool y
depends on ARCH_X86
+ depends on !RESET_VECTOR_IN_RAM
config VERSTAGE_DEBUG_SPINLOOP
bool
@@ -252,22 +246,11 @@ config SKIP_MAX_REBOOT_CNT_CLEAR
Note that it is the responsibility of the payload to reset the
normal boot bit to 1 after each successful boot.
-config ACPI_NO_PCAT_8259
+config ACPI_BERT
bool
- help
- Selected by platforms that don't expose a PC/AT 8259 PIC pair.
-
-config ACPI_HAVE_PCAT_8259
- def_bool y if !ACPI_NO_PCAT_8259
-
-config ACPI_CPU_STRING
- string
- default "\\_PR.CP%02d"
depends on HAVE_ACPI_TABLES
help
- Sets the ACPI name string in the processor scope as written by
- the acpigen function. Default is \_PR.CPxx. Note that you need
- the \ escape character in the string.
+ Build an ACPI Boot Error Record Table.
config COLLECT_TIMESTAMPS_NO_TSC
bool
@@ -330,4 +313,10 @@ config MAX_PIRQ_LINKS
table specifies links greater than 4, pirq_route_irqs will not
function properly, unless this variable is correctly set.
+config MAX_ACPI_TABLE_SIZE_KB
+ int
+ default 144
+ help
+ Set the maximum size of all ACPI tables in KiB.
+
endif
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index 534f2ce20d..c29d5edf23 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -1,15 +1,7 @@
##
+## SPDX-License-Identifier: GPL-2.0-only
## 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.
-##
ifeq ($(CONFIG_POSTCAR_STAGE),y)
$(eval $(call init_standard_toolchain,postcar))
@@ -42,6 +34,11 @@ cbfs-files-$(CONFIG_VGA_BIOS) += pci$(stripped_vgabios_id).rom
pci$(stripped_vgabios_id).rom-file := $(call strip_quotes,$(CONFIG_VGA_BIOS_FILE))
pci$(stripped_vgabios_id).rom-type := optionrom
+stripped_second_vbios_id = $(call strip_quotes,$(CONFIG_VGA_BIOS_SECOND_ID))
+cbfs-files-$(CONFIG_VGA_BIOS_SECOND) += pci$(stripped_second_vbios_id).rom
+pci$(stripped_second_vbios_id).rom-file := $(call strip_quotes,$(CONFIG_VGA_BIOS_SECOND_FILE))
+pci$(stripped_second_vbios_id).rom-type := optionrom
+
stripped_vgabios_dgpu_id = $(call strip_quotes,$(CONFIG_VGA_BIOS_DGPU_ID))
cbfs-files-$(CONFIG_VGA_BIOS_DGPU) += pci$(stripped_vgabios_dgpu_id).rom
pci$(stripped_vgabios_dgpu_id).rom-file := $(call strip_quotes,$(CONFIG_VGA_BIOS_DGPU_FILE))
@@ -233,11 +230,6 @@ $(CONFIG_CBFS_PREFIX)/postcar-compression := none
ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32)$(CONFIG_ARCH_RAMSTAGE_X86_64),y)
-ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c
-ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpigen.c
-ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpigen_dsm.c
-ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi_device.c
-ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi_pld.c
ramstage-$(CONFIG_HAVE_ACPI_RESUME) += acpi_s3.c
ramstage-$(CONFIG_ACPI_BERT) += acpi_bert_storage.c
ramstage-y += c_start.S
@@ -289,15 +281,6 @@ endif
ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/reset.c),)
ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/reset.c
endif
-ifeq ($(CONFIG_HAVE_ACPI_TABLES),y)
-ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/acpi_tables.c),)
-ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/acpi_tables.c
-endif
-$(eval $(call asl_template,dsdt))
-ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/fadt.c),)
-ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/fadt.c
-endif
-endif # CONFIG_GENERATE_ACPI_TABLES
ramstage-libs ?=
diff --git a/src/arch/x86/acpi/debug.asl b/src/arch/x86/acpi/debug.asl
index 36afac6211..2c1d2ce471 100644
--- a/src/arch/x86/acpi/debug.asl
+++ b/src/arch/x86/acpi/debug.asl
@@ -1,18 +1,8 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
- #include
+ #include
DefinitionBlock (
"DSDT.AML",
"DSDT",
diff --git a/src/arch/x86/acpi/globutil.asl b/src/arch/x86/acpi/globutil.asl
index e9b428ad36..76671000a4 100644
--- a/src/arch/x86/acpi/globutil.asl
+++ b/src/arch/x86/acpi/globutil.asl
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/*
Scope(\_SB) {
diff --git a/src/arch/x86/acpi/statdef.asl b/src/arch/x86/acpi/statdef.asl
index 99194f428c..d6959ffec6 100644
--- a/src/arch/x86/acpi/statdef.asl
+++ b/src/arch/x86/acpi/statdef.asl
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/* Status and notification definitions */
diff --git a/src/arch/x86/acpi_bert_storage.c b/src/arch/x86/acpi_bert_storage.c
index 130f97a678..c5f98f7ea8 100644
--- a/src/arch/x86/acpi_bert_storage.c
+++ b/src/arch/x86/acpi_bert_storage.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
@@ -17,7 +7,7 @@
#include
#include
#include
-#include
+#include
#include
#include
diff --git a/src/arch/x86/acpi_s3.c b/src/arch/x86/acpi_s3.c
index 52f8a201f7..39e3a056cd 100644
--- a/src/arch/x86/acpi_s3.c
+++ b/src/arch/x86/acpi_s3.c
@@ -1,19 +1,9 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
-#include
+#include
#include
#include
#include
@@ -33,10 +23,10 @@ static void acpi_handoff_wakeup(void)
{
if (acpi_slp_type < 0) {
if (romstage_handoff_is_resume()) {
- printk(BIOS_DEBUG, "S3 Resume.\n");
+ printk(BIOS_DEBUG, "S3 Resume\n");
acpi_slp_type = ACPI_S3;
} else {
- printk(BIOS_DEBUG, "Normal boot.\n");
+ printk(BIOS_DEBUG, "Normal boot\n");
acpi_slp_type = ACPI_S0;
}
}
diff --git a/src/arch/x86/assembly_entry.S b/src/arch/x86/assembly_entry.S
index fef5ce9240..59b34c8713 100644
--- a/src/arch/x86/assembly_entry.S
+++ b/src/arch/x86/assembly_entry.S
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
@@ -19,6 +9,13 @@
* continue with C code execution one needs to set stack pointer and
* clear .bss variables that are stage specific.
*/
+
+#if CONFIG(RESET_VECTOR_IN_RAM)
+ #define _STACK_TOP _eearlyram_stack
+#else
+ #define _STACK_TOP _ecar_stack
+#endif
+
.section ".text._start", "ax", @progbits
.global _start
_start:
@@ -26,8 +23,8 @@ _start:
/* Migrate GDT to this text segment */
call gdt_init
- /* reset stack pointer to CAR stack */
- mov $_ecar_stack, %esp
+ /* reset stack pointer to CAR/EARLYRAM stack */
+ mov $_STACK_TOP, %esp
/* clear .bss section as it is not shared */
cld
@@ -38,7 +35,7 @@ _start:
shrl $2, %ecx
rep stosl
-#if ((ENV_VERSTAGE && CONFIG(VERSTAGE_DEBUG_SPINLOOP)) \
+#if ((ENV_SEPARATE_VERSTAGE && CONFIG(VERSTAGE_DEBUG_SPINLOOP)) \
|| (ENV_ROMSTAGE && CONFIG(ROMSTAGE_DEBUG_SPINLOOP)))
/* Wait for a JTAG debugger to break in and set EBX non-zero */
diff --git a/src/arch/x86/boot.c b/src/arch/x86/boot.c
index ada49d0368..ae14bc200a 100644
--- a/src/arch/x86/boot.c
+++ b/src/arch/x86/boot.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/x86/bootblock_crt0.S b/src/arch/x86/bootblock_crt0.S
index 325673162c..5d3ba4ec78 100644
--- a/src/arch/x86/bootblock_crt0.S
+++ b/src/arch/x86/bootblock_crt0.S
@@ -1,16 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* This file is part of the coreboot project. */
/*
- * This file is part of the coreboot project.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
* This is the modern bootblock. It prepares the system for C environment runtime
* setup. The actual setup is done by hardware-specific code.
*
diff --git a/src/arch/x86/bootblock_normal.c b/src/arch/x86/bootblock_normal.c
index b6b31af89f..e5de25596f 100644
--- a/src/arch/x86/bootblock_normal.c
+++ b/src/arch/x86/bootblock_normal.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/x86/c_start.S b/src/arch/x86/c_start.S
index 887243964e..1148e058cf 100644
--- a/src/arch/x86/c_start.S
+++ b/src/arch/x86/c_start.S
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/x86/car.ld b/src/arch/x86/car.ld
index 2e29112467..92b26a0877 100644
--- a/src/arch/x86/car.ld
+++ b/src/arch/x86/car.ld
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
/* This file is included inside a SECTIONS block */
. = CONFIG_DCACHE_RAM_BASE;
@@ -30,8 +20,8 @@
/* Vboot measured boot TCPA log measurements.
* Needs to be transferred until CBMEM is available
*/
-#if CONFIG(VBOOT_MEASURED_BOOT)
- VBOOT2_TPM_LOG(., 2K)
+#if CONFIG(TPM_MEASURED_BOOT)
+ TPM_TCPA_LOG(., 2K)
#endif
/* Stack for CAR stages. Since it persists across all stages that
* use CAR it can be reused. The chipset/SoC is expected to provide
diff --git a/src/arch/x86/cbmem.c b/src/arch/x86/cbmem.c
index b20eb67b9b..55215f651a 100644
--- a/src/arch/x86/cbmem.c
+++ b/src/arch/x86/cbmem.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
diff --git a/src/arch/x86/cf9_reset.c b/src/arch/x86/cf9_reset.c
index d93bed74a4..675d5edbb3 100644
--- a/src/arch/x86/cf9_reset.c
+++ b/src/arch/x86/cf9_reset.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
diff --git a/src/arch/x86/cpu.c b/src/arch/x86/cpu.c
index 30d2cca87a..b52376885f 100644
--- a/src/arch/x86/cpu.c
+++ b/src/arch/x86/cpu.c
@@ -1,20 +1,11 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
#include
#include
#include
+#include
#include
#include
#include
@@ -221,7 +212,7 @@ static void set_cpu_ops(struct device *cpu)
cpu->ops = driver ? driver->ops : NULL;
}
-/* Keep track of default apic ids for SMM. */
+/* Keep track of default APIC ids for SMM. */
static int cpus_default_apic_id[CONFIG_MAX_CPUS];
/*
@@ -363,3 +354,8 @@ int cpu_index(void)
}
return -1;
}
+
+uintptr_t cpu_get_lapic_addr(void)
+{
+ return LOCAL_APIC_ADDR;
+}
diff --git a/src/arch/x86/cpu_common.c b/src/arch/x86/cpu_common.c
index 0fd0af016f..1646b44ecc 100644
--- a/src/arch/x86/cpu_common.c
+++ b/src/arch/x86/cpu_common.c
@@ -1,15 +1,5 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
diff --git a/src/arch/x86/early_ram.ld b/src/arch/x86/early_ram.ld
new file mode 100644
index 0000000000..941c385b04
--- /dev/null
+++ b/src/arch/x86/early_ram.ld
@@ -0,0 +1,43 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+/* This file is included inside a SECTIONS block */
+
+_STACK_SIZE = CONFIG_EARLYRAM_BSP_STACK_SIZE;
+_ = ASSERT(_STACK_SIZE > 0x0, "EARLYRAM_BSP_STACK_SIZE is not configured");
+
+_CONSOLE_SIZE = CONFIG_PRERAM_CBMEM_CONSOLE_SIZE;
+_ = ASSERT(_CONSOLE_SIZE > 0x0, "PRERAM_CBMEM_CONSOLE_SIZE is not configured");
+
+_TIMESTAMPS_SIZE = 0x200;
+#if !CONFIG(NO_FMAP_CACHE)
+_FMAP_SIZE = FMAP_SIZE;
+#else
+_FMAP_SIZE = 0;
+#endif
+
+/*
+ * The PRERAM_CBMEM_CONSOLE, TIMESTAMP, and FMAP_CACHE regions are shared
+ * between the pre-ram stages (bootblock, romstage, etc). We need to assign a
+ * fixed size and consistent link address so they can be shared between stages.
+ *
+ * The stack area is not shared between stages, but is defined here for
+ * convenience.
+ */
+. = CONFIG_X86_RESET_VECTOR - ARCH_STACK_ALIGN_SIZE - _STACK_SIZE - _CONSOLE_SIZE - _TIMESTAMPS_SIZE - _FMAP_SIZE;
+
+_ = ASSERT(. > _eprogram, "Not enough room for .earlyram.data. Try increasing C_ENV_BOOTBLOCK_SIZE, or decreasing either EARLYRAM_BSP_STACK_SIZE or PRERAM_CBMEM_CONSOLE_SIZE.");
+
+.stack ALIGN(ARCH_STACK_ALIGN_SIZE) (NOLOAD) : {
+ EARLYRAM_STACK(., _STACK_SIZE)
+}
+
+.persistent ALIGN(ARCH_POINTER_ALIGN_SIZE) (NOLOAD) : {
+ PRERAM_CBMEM_CONSOLE(., _CONSOLE_SIZE)
+ TIMESTAMP(., _TIMESTAMPS_SIZE)
+ #if !CONFIG(NO_FMAP_CACHE)
+ FMAP_CACHE(., FMAP_SIZE)
+ #endif
+}
+
+_ = ASSERT(. <= CONFIG_X86_RESET_VECTOR, "Earlyram data regions don't fit below the reset vector!");
diff --git a/src/arch/x86/ebda.c b/src/arch/x86/ebda.c
index f92f305d6f..99aa2d3f16 100644
--- a/src/arch/x86/ebda.c
+++ b/src/arch/x86/ebda.c
@@ -1,19 +1,8 @@
-/*
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
#include
-#include
+#include
#include
#include