Compare commits

...

37 Commits

Author SHA1 Message Date
Tim Crawford
af37b54564 mb/system76/bonw14: Enable TAS5825M smart amp
The Bonobo has 2 AMPs: one for the speakers and one for the subwoofer.

Smart AMP data was collected using a logic analyzer connected to the IC
during system start on proprietary firmware. This data is then used to
generate a C file [1].

[1]: https://github.com/system76/smart-amp

Change-Id: I5389a9890563ebd3adb20096b6225f474bc006f9
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-05-22 13:30:20 -06:00
Kenneth Chan
6a3ff9ce68 mb/google/brya/var/nova: Add SOLDERDOWN support
Nova will use SOLDERDOWN. Add memory.c to override baseboard.
Update dram id table for correct platform parameter.

BUG=b:328711879

Change-Id: I6fbce991ef5ab9f0e6216ad1a5af73fcc1996a2a
Signed-off-by: Kenneth Chan <kenneth.chan@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82474
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: David Wu <david_wu@quanta.corp-partner.google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-05-21 13:46:17 +00:00
Wu Garen
7dcb3d9c72 mb/google/brox/var/greenbayupoc: Update verb table from ALC256 to ALC236
On GreenbayPOC, HDA Codec used is ALC236, different with Brox (ALC256)
Update to Realtek provided verb table for ALC236 audio codec.

BUG=b:336967284
TEST=Verified headset and audio workable on DUT with "rec" and
"aplay" command.

Change-Id: I9fbe57a0acab20387754f6b6cb5705e34c1c149b
Signed-off-by: Wu Garen <wu.garen@inventec.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82413
Reviewed-by: Ivan Chen <yulunchen@google.com>
Reviewed-by: Derek Huang <derekhuang@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-05-21 13:45:49 +00:00
Maximilian Brune
33079b8174 lib/device_tree: Add some FDT helper functions
This adds some helper functions for FDT, since more and more mainboards
seem to need FDT nowadays. For example our QEMU boards need it in order
to know how much RAM is available. Also all RISC-V boards in our tree
need FDT.

This also adds some tests in order to test said functions.

Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
Change-Id: I2fb1d93c5b3e1cb2f7d9584db52bbce3767b63d8
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81081
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-05-21 13:44:47 +00:00
Maximilian Brune
25c737d403 tests/lib: Factor out file related functions
Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
Change-Id: I5c22913b35848c5ea32d6805ea081abefd3380bf
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82237
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub Czapiga <czapiga@google.com>
2024-05-21 13:44:39 +00:00
Tony Huang
62a6188da5 soc/intel/meteorlake: Add PsysPL2 configuration
psys_pl2_watts is configured in SoC node of devicetree.
Value represents Watts.

BUG=b:320410462
BRANCH=firmware-rex-15709.B
TEST=emerge-ovis coreboot

Change-Id: I9c4d62b93fc751db9e0ea04e475acb8861a844f8
Signed-off-by: Tony Huang <tony-huang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82553
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2024-05-21 13:37:09 +00:00
Shon Wang
0da12e0f2a mb/google/brya/var/bujia: Add devicetree based on schematics
Add devicetree settings per the schematic.
Differences to gladios:
1. remove SD reader
2. remove EMMC setting
3. modify USB port distribution

FRONT
-------------------------------------------------------
|                                        A3   A1      |
|               C0                       A2   A0      |
-------------------------------------------------------

BACK
-------------------------------------------------------
|                    ---------------                  |
|                    |    TX25A    |                  |
-------------------------------------------------------

BUG=b:327549688
TEST= USE="-project_all project_bujia" emerge-brask coreboot

Change-Id: Ia010e99c21e8d6088f6bb873f79dc19cadc9e455
Signed-off-by: Shon Wang <shon.wang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81447
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Derek Huang <derekhuang@google.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
2024-05-21 13:36:33 +00:00
Elyes Haouas
b4949d3de5 crossgcc: Update LLVM from 18.1.5 to 18.1.6
Change-Id: Ie087f43e6f60df7b97d7d7b402d3540c3a0a2461
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82552
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
2024-05-20 20:33:20 +00:00
Martin Roth
c3086b12a4 util/docker: Change Debian suite from Sid to stable
Debian sid is too unstable at this point, and frequently ends up having
issues that cause the coreboot-sdk docker image to fail to build. Using
stable also better reflects what users will typically be running.

Also remove the parameters to quiet the apt-get install command so that
if something does break, we can see what happened more easily.

Fixes bug 536

Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: I41b6464b024df89c114db2cdb9367c0526eb0297
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82411
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-05-20 19:30:33 +00:00
Angel Pons
455538d3ae 3rdparty/libgfxinit: Update submodule pointer
Update the submodule pointer to current main. This brings in 5 commits:

* e096913 connector_info: Fix HDMI/DVI default bytes per color setting
* 87469f2 gma config: Add new device IDs for Raptor Lake
* 4be2e75 gma: Update transcoder setup for TGL
* 4b991bf gfxtest: Drop unnecessary with of ancestor
* 17cfc92 tgl plls: Disable warnings about unused variable

Change-Id: Ic40edc773ba11ab9a0f9e92057bd687d10b95069
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82554
Reviewed-by: Dinesh Gehlot <digehlot@google.com>
Reviewed-by: Ronak Kanabar <ronak.kanabar@intel.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
2024-05-20 13:24:36 +00:00
Angel Pons
78a26aca8b mb/prodrive/hermes/hda_verb.c: Refactor port B Vref cfg
Refactor the `get_port_b_vref_cfg()` function to only return the
variable bits of the value. The NID itself is not connected, and
the `misc` field in the verb conveys the Vref value.

Change-Id: I5108f5339c5b002403a4e5339da6d52046c8bcbe
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82395
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-05-20 12:58:07 +00:00
Subrata Banik
f2d260d988 Libpayload: Rename arch variable _ARCH to _ARCHDIR for consistency
This commit renames the variable _ARCH to _ARCHDIR in the libpayload
build script (lpgcc) to align with the naming convention of other
variables used in this file.

This change improves code readability and maintainability.

Change-Id: Iea4af68e49ab1cd7ec8156a14f8215244e9c0622
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82479
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-05-18 18:27:53 +00:00
Robert Chen
67a96902d5 mb/google/dedede/var/kracko: Disable un-used C1 port by daughterboard
Probe C1 port in devicetree and disable un-used C1/A1 port by FW_CONFG.

BUG=b:339534479
BRANCH=firmware-dedede-13606.B
TEST=emerge-dedede coreboot chromeos-bootimage
flash and check boot log on DUT.

Change-Id: I944ff6f2fa712e7579ed1c9879f75835adc3ac4c
Signed-off-by: Robert Chen <robert.chen@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82263
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2024-05-17 17:48:59 +00:00
Kenneth Chan
917bdbffd3 mb/google/brask/var/nova: Remove unused retimer
Remove unused setting for retimer.

BUG=b:328711879
Change-Id: I48d8680d43a07aa3408dfbf5b25b568c2b51b343
Signed-off-by: Kenneth Chan <kenneth.chan@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82475
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-05-17 13:17:37 +00:00
Tyler Wang
557aad1df9 cr50: Replace "cr50" to "GSC" in debug messages
The cr50.c file currently prints "cr50" in debug messages no
matter the system is using Cr50 or Ti50. This can be confusing
for developers.

This patch replaces "cr50" with "GSC" in debug messages. Using
"GSC" makes the messages more clear and easier to search via
`grep`.

BUG=none
TEST=Build and test on karis

Change-Id: I21f66cf8b608ca4e4dc82d7a55a851ec996c8bb3
Signed-off-by: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82420
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Jon Murphy <jpmurphy@google.com>
2024-05-17 12:50:28 +00:00
Shuo Liu
43a54184b0 mb/intel/beechnutcity_crb: Add GNR/SRF-SP 2S server board Beechnut City
Beechnut City CRB is the 2 socket reference board for 6th Gen Xeon-SP
SP SoCs (Granite Rapids SP and Sierra Forest SP).

This patch initially sets the code set up as a compilation target with
GNR N-1 FSP, and with basic feature supports (Integrated IO Controller
(IIO) configuration, BMC, UART, HPET).

TEST=Build on intel/beechnutcity CRB

Change-Id: I3f6a0fb97b62baadb438fb9f11fdd78fccb3f89a
Signed-off-by: Shuo Liu <shuo.liu@intel.com>
Co-authored-by: Gang Chen <gang.c.chen@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81322
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
2024-05-16 21:05:28 +00:00
Gang Chen
921ddba69e mb/intel/avenuecity_crb: Add GNR/SRF-AP 2S server board Avenue City
Avenue City CRB is the 2 socket reference board for 6th Gen Xeon-SP
AP SoCs (Granite Rapids AP and Sierra Forest AP).

This patch initially sets the code set up as a compilation target
with GNR N-1 FSP, and with basic feature supports (Integrated IO
Controller (IIO) configuration, BMC, UART, HPET).

TEST=Build on intel/avenuecity CRB

Change-Id: I64fdd5388aadf7732f6d3daa600c1455d3672a46
Signed-off-by: Gang Chen <gang.c.chen@intel.com>
Co-authored-by: Shuo Liu <shuo.liu@intel.com>
Co-authored-by: Jincheng Li <jincheng.li@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81319
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
2024-05-16 20:55:05 +00:00
Gang Chen
6258093575 soc/intel/xeon_sp/gnr: Add IIO config utils
Add IIO configuration utils shared in GNR boards to handle the
complex IIO configuration settings.

Change-Id: If7146761db6f73a0c4b0d31b010c0d30a42bf690
Signed-off-by: Gang Chen <gang.c.chen@intel.com>
Co-authored-by: Shuo Liu <shuo.liu@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81318
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
2024-05-16 20:52:20 +00:00
Aseda Aboagye
cc82f74605 chromeec/ec_acpi: Convert TK_DICTATE to ps2_action_key
When support for the dictation key was added in commit f2782b8328
(acpigen_ps2_keybd: Add support for dictation key), I had failed to
include this portion of the change in that commit. The top row key of
`TK_DICTATE` needs to be converted to the ps2_action_key.  This commit
simply adds that mapping so that it can be translated.

BUG=b:333101631
TEST=Flash DUT that emits a scancode for a dictation key, verify that it
is mapped to KEY_DICTATE in the Linux kernel using `evtest`.

Change-Id: I1be8c0a96931cca36e6bbbfa0be7d36c4cd93768
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82274
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Caveh Jalali <caveh@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-05-16 17:08:56 +00:00
Felix Held
e189043aec mb/amd/birman/update_devicetree_phoenix_opensil: use common header file
Instead of including stub/mpio/chip.h, include chip/mpio/chip.h that
will include the correct implementation to be able to use the same file
with both the openSIL stub and the actual openSIL implementation glue
code.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Iaae26a0dfe0ba96842e72582c06f1b0b3f29871c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82472
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-05-16 15:47:15 +00:00
Subrata Banik
c61b35b696 mb/google/rex: Remove redundant VPU enablement code
This patch removes VPU enablement code that is no longer needed because
the VPU is already enabled by default in the baseboard devicetree.

BUG=b:332488817
TEST=Able to see VPU PCI device in lspci list after booting
google/screebo to OS

Change-Id: I94de92e970be1548068ed4e19309a95129f041ff
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82423
Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com>
Reviewed-by: Jamie Ryu <jamie.m.ryu@intel.com>
Reviewed-by: Dinesh Gehlot <digehlot@google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2024-05-16 13:03:31 +00:00
Subrata Banik
a0426b6d93 mb/google/rex: Enable VPU device for Rex/Ovis baseboard
This patch enables the Versatile Processing Unit (VPU) by default for
Rex/Ovis baseboard. VPU is a dedicated AI engine that is included in
the 14th generation "Meteor Lake" Core processors.

The VPU is designed to efficiently run AI models directly on the
system on chip (SoC). There is no power regression observed while
keeping the VPU default enabled to run AI models natively hence, this
patch enables the VPU by default.

BUG=b:332488817
TEST=Able to see VPU PCI device in lspci (0:11:0) list after booting
google/screebo to OS.

Change-Id: I8b3521c8ec613b002f971eaf9d346927fe8cd656
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82422
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Jamie Ryu <jamie.m.ryu@intel.com>
Reviewed-by: Dinesh Gehlot <digehlot@google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
2024-05-16 13:03:24 +00:00
Saurabh Mishra
1b2fe88a04 include/device/pci_ids.h: Update TWL device IDs
Set lowercase hex format for IGD DIDs.

BUG=b:326901448
TEST=Build tivviks and verify the IGD IDs.

Change-Id: I1299512d1c48eba854fea2ec394cef40d44a87d7
Signed-off-by: Saurabh Mishra <mishra.saurabh@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82414
Reviewed-by: V Sowmya <v.sowmya@intel.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
2024-05-16 11:29:40 +00:00
Tony Huang
3d4128299f mb/google/rex/var/baseboard/ovis: Support CPU power limits per variant
There is no direct way to override CPU default power_limits for
different SKUs.

This CL add structure variant_get_soc_power_limit_config() for
variants to define and configure the values of soc_power_limits_config
for current CPU SKU.

Variants can override these values i.e. pl1, pl2, psyspl2
in variant_devtree_update().

BUG=b:320410462
BRANCH=firmware-rex-15709.B
TEST=FSP debug emerge-ovis coreboot intelfsp
     check overrides setting

Change-Id: Ib60fa4e3fc502d0aeb0c94ad46ba5a55b4dd027c
Signed-off-by: Tony Huang <tony-huang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82199
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-05-16 11:28:58 +00:00
Shon Wang
ff79993e95 mb/google/brask/var/bujia: Update gpio table
Based on latest schematic to update the gpio table.

BUG=b:327549688
TEST= USE="-project_all project_bujia" emerge-brask coreboot

Change-Id: I3d01e3b9eaef72d9e143f5163ee49d8c8f455b5f
Signed-off-by: Shon Wang <shon.wang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82412
Reviewed-by: Derek Huang <derekhuang@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-05-16 11:28:00 +00:00
Krystian Hebel
a8fdafa427 cpu/x86/pae/pgtbl.c: remove dead paging_identity_map_addr()
This function had roughly the same use (except PAT) as part of
memset_pae(), however the latter is able to make use of PAE and map
physical memory located above 4 GB. Remove paging_identity_map_addr()
to avoid semi-duplicated code.

The function has been unused since CB:26745.

Change-Id: I7a4ebd84a6f5d222c3b2c6c6e3d26d6464cf01b8
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82248
Reviewed-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-05-15 16:53:50 +00:00
Elyes Haouas
07913736e0 Doc/releases: List toolchain updates in coreboot-24.08-relnotes
Report upgraded version for ACPICA, CMake, nasm, LLVM and GCC.

Change-Id: I93a9ae4a2f4c3403a6e8c9a8b7aca74b996e7db8
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82410
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2024-05-15 16:51:31 +00:00
Nicholas Sudsgaard
744e389800 payload/external/edk2: Explicitly define the build arch as X64
Upstream commit 11ad164bce (UefiPayloadPkg: Make UPL build script arch
agnostic, 2024-02-22) changes the build script's behavior to not assume
the arch. Without defining BUILD_ARCH, the build script will not
function properly and results in the payload failing to build.

Both UefiPayload and Universal Payload can only be built in X64.

Change-Id: Icd942d0c15a99231d09f9cbdc5eb48333b6aa6e5
Signed-off-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80883
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
2024-05-15 16:49:26 +00:00
Jason Glenesk
ab42a64d99 Add 24.08 release notes template
In preparation for the upcoming release, add the template for the
24.05 release and update index.md.

Change-Id: I733f541a2d6e556c82aff1656fe7f79ae3673ba7
Signed-off-by: Jason Glenesk <jason.glenesk@amd.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82400
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
2024-05-15 15:16:52 +00:00
Felix Held
b43accd233 mb/amd/birman: add function to update MPIO config in devicetree
Phoenix 2 has less PCIe lanes than Phoenix, so some of the lane end
numbers need to be adjusted to take that into account. When the Kconfig
options WLAN01 or WWAN01 are set, either the WLAN or the WWAN card uses
both PICe lanes that are available for those two devices, so the MPIO
descriptor information the devicetree needs to be updated accordingly
and the bridge to the PCIe port that doesn't have any lane left needs to
be disabled. Two other PCIe devices will be disabled when the
corresponding Kconfig options ENABLE_EVAL_CARD and DISABLE_DT_M2 have
the value that results in the device being disabled via some GPIO driven
by the EC. Since the code is specific to the openSIL case, only include
it in the build in the CONFIG_BOARD_AMD_BIRMAN_PHOENIX_OPENSIL case.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I23c14cc03980ea1e39f7e5aec551b975c237e487
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82106
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-by: Varshit Pandya <pandyavarshit@gmail.com>
2024-05-15 15:01:55 +00:00
Felix Held
d7158c8149 mb/amd/birman/devicetree_phoenix_opensil: add stub MPIO chips
Add the stub MPIO chips that contain the PCIe engine configuration for
the external PCIe interfaces to the devicetree. Birman's
port_descriptors_phoenix.c was used as a reference. The static
configuration in the devicetree assumes that the default WLAN0_WWAN0 is
selected; for the other cases we'll still need to fix up things
accordingly in the mutable devicetree. The WLAN01 and WWAN01 cases still
need to be handled in a follow-up patch. Since openSIL currently doesn't
use the info from the gpio_group struct element, but deasserts both PCIe
reset pins GPIO 26 and 27, the gpio_group isn't specified in the chip
configuration in the devicetree.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Icabe60322d46c1195284dd77ec39f9d143e3d2cb
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81101
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
2024-05-15 15:01:05 +00:00
EricKY Cheng
7728ed3ea2 mb/google/brya: Create orisa variant
Create the orisa variant of the nissa reference board by copying
the template files to a new directory named for the variant.

(Auto-Generated by create_coreboot_variant.sh version 4.5.0.)

BUG=b:337178014
BRANCH=None
TEST=util/abuild/abuild -p none -t google/brya -x -a
make sure the build includes GOOGLE_ORISA

Change-Id: I0cd8d763ffd8864b455a7f8909e95f6aee8bb23e
Signed-off-by: EricKY Cheng <ericky_cheng@compal.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82241
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Amanda Hwang <amanda_hwang@compal.corp-partner.google.com>
Reviewed-by: Dinesh Gehlot <digehlot@google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
2024-05-15 12:08:23 +00:00
Felix Singer
acdd8dd14d util/crossgcc: Update GCC from 13.2 to 14.1.0
Change-Id: Idf5912d1fcdfabab7fe006b7e0cd4ebd25c07d09
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81683
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2024-05-15 01:53:34 +00:00
Lennart Eichhorn
e885aa5a05 util/crossgcc: Update LLVM from 17.0.6 to 18.1.5
Change-Id: I03a44e0c23a925396f614f282882405dc886ba58
Signed-off-by: Lennart Eichhorn <lennarteichhorn@googlemail.com>
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80314
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2024-05-15 01:53:22 +00:00
Elyes Haouas
0090039bbd crossgcc: upgrade nasm from 2.16.01 to 2.16.03
Remove the patch since it was picked from master before and thus it's
included in the new release.

Change-Id: I70408b189b974f8abaadc66f0c809a1dbe10504b
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81900
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-05-15 01:53:10 +00:00
Felix Singer
41fdb882f1 util/crossgcc: Update ACPICA from 20230628 to 20240321
Change-Id: I41f56ba58af51b1ec1d7554fb35a49ccf9e778f6
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81671
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
2024-05-14 23:35:39 +00:00
Felix Singer
6b4036ee9e util/crossgcc: Update CMake from 3.28.3 to 3.29.3
Change-Id: Iaf2d4f579d987fbfd4187ae41c1be5cec55e0e8e
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81672
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
2024-05-14 23:34:36 +00:00
123 changed files with 5114 additions and 628 deletions

View File

@@ -0,0 +1,100 @@
Upcoming release - coreboot 24.08
========================================================================
The 24.08 release is scheduled for Mid Aug, 2024
Update this document with changes that should be in the release notes.
* Please use Markdown.
* See the past few release notes for the general format.
* The chip and board additions and removals will be updated right
before the release, so those do not need to be added.
* Note that all changes before the release are done are marked upcoming.
A final version of the notes are done after the release.
Significant or interesting changes
----------------------------------
* Add changes that need a full description here
* This section should have full descriptions and can or should have
a link to the referenced commits.
Additional coreboot changes
---------------------------
The following are changes across a number of patches, or changes worth
noting, but not needing a full description.
* Changes that only need a line or two of description go here.
Changes to external resources
-----------------------------
### Toolchain updates
* Upgrade ACPICA from 20230628 to 20240321
* Upgrade CMake from 3.28.3 to 3.29.3
* Upgrade nasm from 2.16.01 to 2.16.03
* Upgrade LLVM from 17.0.6 to 18.1.6
* Upgrade GCC from 13.2 to 14.1.0
### Git submodule pointers
### External payloads
Platform Updates
----------------
### Added mainboards:
* To be filled in immediately before the release by the release team
### Removed Mainboards
* To be filled in immediately before the release by the release team
### Updated SoCs
* To be filled in immediately before the release by the release team
Plans to move platform support to a branch
------------------------------------------
* To be filled in immediately before the release by the release team
Statistics from the 24.05 to the 24.08 release
--------------------------------------------
* To be filled in immediately before the release by the release team
Significant Known and Open Issues
---------------------------------
Issues from the coreboot bugtracker: https://ticket.coreboot.org/
* To be filled in immediately before the release by the release team
coreboot Links and Contact Information
--------------------------------------
* Main Web site: https://www.coreboot.org
* Downloads: https://coreboot.org/downloads.html
* Source control: https://review.coreboot.org
* Documentation: https://doc.coreboot.org
* Issue tracker: https://ticket.coreboot.org/projects/coreboot
* Donations: https://coreboot.org/donate.html

View File

@@ -6,7 +6,7 @@ Please add to the release notes as changes are added:
```{toctree}
:maxdepth: 1
24.05 - May 2024 <coreboot-24.05-relnotes.md>
24.08 - August 2024 <coreboot-24.08-relnotes.md>
```
The [checklist] contains instructions to ensure that a release covers all
@@ -22,6 +22,7 @@ important is taken care of.
```{toctree}
:maxdepth: 1
24.05 - May 2024 <coreboot-24.05-relnotes.md>
24.02 - February 2024 <coreboot-24.02-relnotes.md>
4.22 - November 2023 <coreboot-4.22-relnotes.md>
4.21 - August 2023 <coreboot-4.21-relnotes.md>

View File

@@ -0,0 +1,50 @@
# Type this in coreboot root directory to get a working .config:
# make defconfig KBUILD_DEFCONFIG=configs/builder/config.intel.crb.avc
#
# [RO] Board Configurations
#
CONFIG_VENDOR_INTEL=y
CONFIG_BOARD_INTEL_AVENUECITY_CRB=y
CONFIG_HAVE_CONFIGURABLE_RAMSTAGE=y
CONFIG_CONFIGURABLE_RAMSTAGE=y
CONFIG_NO_GFX_INIT=y
CONFIG_HAVE_IFD_BIN=y
CONFIG_DO_NOT_TOUCH_DESCRIPTOR_REGION=y
CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS=y
CONFIG_ADD_FSP_BINARIES=y
CONFIG_PAYLOAD_LINUX=y
CONFIG_UART_FOR_CONSOLE=0
CONFIG_CONSOLE_SERIAL_115200=y
#
# [RW] IFWI Ingredients
#
CONFIG_IFD_BIN_PATH="site-local/avenuecity/descriptor.bin"
CONFIG_CPU_UCODE_BINARIES="site-local/avenuecity/ucode.mcb"
CONFIG_FSP_T_FILE="site-local/avenuecity/Server_T.fd"
CONFIG_FSP_M_FILE="site-local/avenuecity/Server_M.fd"
CONFIG_FSP_S_FILE="site-local/avenuecity/Server_S.fd"
CONFIG_FSP_HEADER_PATH="src/vendorcode/intel/fsp/fsp2_0/graniterapids/ap/"
CONFIG_PAYLOAD_FILE="site-local/avenuecity/linuxboot_bzImage"
CONFIG_LINUX_COMMAND_LINE="loglevel=7 earlyprintk=serial,ttyS0,115200 console=ttyS0,115200"
#
# [RW] Debug Settings
#
CONFIG_CONSOLE_POST=y
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_8=y
CONFIG_VERIFY_HOBS=y
CONFIG_DISPLAY_MTRRS=y
CONFIG_DISPLAY_FSP_CALLS_AND_STATUS=y
CONFIG_DISPLAY_FSP_HEADER=y
CONFIG_HAVE_DEBUG_GPIO=y
CONFIG_DEBUG_GPIO=y

View File

@@ -0,0 +1,50 @@
# Type this in coreboot root directory to get a working .config:
# make defconfig KBUILD_DEFCONFIG=configs/builder/config.intel.crb.bnc
#
# [RO] Board Configurations
#
CONFIG_VENDOR_INTEL=y
CONFIG_BOARD_INTEL_BEECHNUTCITY_CRB=y
CONFIG_HAVE_CONFIGURABLE_RAMSTAGE=y
CONFIG_CONFIGURABLE_RAMSTAGE=y
CONFIG_NO_GFX_INIT=y
CONFIG_HAVE_IFD_BIN=y
CONFIG_DO_NOT_TOUCH_DESCRIPTOR_REGION=y
CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS=y
CONFIG_ADD_FSP_BINARIES=y
CONFIG_PAYLOAD_LINUX=y
CONFIG_UART_FOR_CONSOLE=0
CONFIG_CONSOLE_SERIAL_115200=y
#
# [RW] IFWI Ingredients
#
CONFIG_IFD_BIN_PATH="site-local/beechnutcity/descriptor.bin"
CONFIG_CPU_UCODE_BINARIES="site-local/beechnutcity/ucode.mcb"
CONFIG_FSP_T_FILE="site-local/beechnutcity/Server_T.fd"
CONFIG_FSP_M_FILE="site-local/beechnutcity/Server_M.fd"
CONFIG_FSP_S_FILE="site-local/beechnutcity/Server_S.fd"
CONFIG_FSP_HEADER_PATH="src/vendorcode/intel/fsp/fsp2_0/graniterapids/sp/"
CONFIG_PAYLOAD_FILE="site-local/beechnutcity/linuxboot_bzImage"
CONFIG_LINUX_COMMAND_LINE="loglevel=7 earlyprintk=serial,ttyS0,115200 console=ttyS0,115200"
#
# [RW] Debug Settings
#
CONFIG_CONSOLE_POST=y
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_8=y
CONFIG_VERIFY_HOBS=y
CONFIG_DISPLAY_MTRRS=y
CONFIG_DISPLAY_FSP_CALLS_AND_STATUS=y
CONFIG_DISPLAY_FSP_HEADER=y
CONFIG_HAVE_DEBUG_GPIO=y
CONFIG_DEBUG_GPIO=y

View File

@@ -37,6 +37,8 @@ BUILD_STR += -s
endif
endif
BUILD_STR += -D BUILD_ARCH=X64
#
# EDK II (edk2/master) has the following build options relevant to coreboot:
#

View File

@@ -74,34 +74,30 @@ else
fi
if [ "$CONFIG_LP_ARCH_ARM" = "y" ]; then
_ARCHINCDIR=$_INCDIR/arm
_ARCHLIBDIR=$_LIBDIR/arm
_ARCHDIR=arm
_ARCHEXTRA=""
_ARCH=arm
fi
if [ "$CONFIG_LP_ARCH_ARM64" = "y" ]; then
_ARCHINCDIR=$_INCDIR/arm64
_ARCHLIBDIR=$_LIBDIR/arm64
_ARCHDIR=arm64
_ARCHEXTRA=""
_ARCH=arm64
fi
if [ "$CONFIG_LP_ARCH_X86" = "y" ]; then
_ARCHINCDIR=$_INCDIR/x86
_ARCHLIBDIR=$_LIBDIR/x86
_ARCHDIR=x86
_ARCHEXTRA="-m32 "
_ARCH=x86
fi
if [ "$CONFIG_LP_ARCH_MOCK" = "y" ]; then
_ARCHINCDIR=$_INCDIR/mock
_ARCHLIBDIR=$_LIBDIR/mock
_ARCHDIR=mock
_ARCHEXTRA=""
_ARCH=mock
fi
_ARCHINCDIR=$_INCDIR/$_ARCHDIR
_ARCHLIBDIR=$_LIBDIR/$_ARCHDIR
if [ -f $_LIBDIR/libpayload.ldscript ]; then
_LDDIR=$_LIBDIR
elif [ -f $BASE/../arch/$_ARCH/libpayload.ldscript ]; then
_LDDIR=$BASE/../arch/$_ARCH
elif [ -f $BASE/../arch/$_ARCHDIR/libpayload.ldscript ]; then
_LDDIR=$BASE/../arch/$_ARCHDIR
fi
# Host arch should youse default linker script
if [ "$CONFIG_LP_ARCH_MOCK" = "y" ]; then

View File

@@ -277,177 +277,3 @@ int paging_enable_for_car(const char *pdpt_name, const char *pt_name)
return 0;
}
static void *get_pdpt_addr(void)
{
if (preram_symbols_available())
return _pdpt;
return (void *)(uintptr_t)read_cr3();
}
static uint64_t pde_pat_flags(int pat)
{
switch (pat) {
case PAT_UC:
return 0 | PDE_PCD | PDE_PWT;
case PAT_WC:
return 0 | 0 | PDE_PWT;
case PAT_WT:
return PDE_PAT | PDE_PCD | PDE_PWT;
case PAT_WP:
return PDE_PAT | 0 | PDE_PWT;
case PAT_WB:
return 0 | 0 | 0;
case PAT_UC_MINUS:
return 0 | PDE_PCD | 0;
default:
printk(BIOS_ERR, "PDE PAT defaulting to WB: %x\n", pat);
return pde_pat_flags(PAT_WB);
}
}
static uint64_t pde_page_flags(int pat)
{
uint64_t flags = PDE_PS | PDE_PRES | PDE_RW | PDE_A | PDE_D;
return flags | pde_pat_flags(pat);
}
static uint64_t pte_pat_flags(int pat)
{
switch (pat) {
case PAT_UC:
return 0 | PTE_PCD | PTE_PWT;
case PAT_WC:
return 0 | 0 | PTE_PWT;
case PAT_WT:
return PTE_PAT | PTE_PCD | PTE_PWT;
case PAT_WP:
return PTE_PAT | 0 | PTE_PWT;
case PAT_WB:
return 0 | 0 | 0;
case PAT_UC_MINUS:
return 0 | PTE_PCD | 0;
default:
printk(BIOS_ERR, "PTE PAT defaulting to WB: %x\n", pat);
return pte_pat_flags(PAT_WB);
}
}
static uint64_t pte_page_flags(int pat)
{
uint64_t flags = PTE_PRES | PTE_RW | PTE_A | PTE_D;
return flags | pte_pat_flags(pat);
}
/* Identity map an address. This function does not handle splitting or adding
* new pages to the page tables. It's assumed all the page tables are already
* seeded with the correct amount and topology. */
static int identity_map_one_page(uintptr_t base, size_t size, int pat,
int commit)
{
uint64_t (*pdpt)[4];
uint64_t pdpte;
uint64_t (*pd)[512];
uint64_t pde;
pdpt = get_pdpt_addr();
pdpte = (*pdpt)[(base >> PDPTE_IDX_SHIFT) & PDPTE_IDX_MASK];
/* No page table page allocation. */
if (!(pdpte & PDPTE_PRES))
return -1;
pd = (void *)(uintptr_t)(pdpte & PDPTE_ADDR_MASK);
/* Map in a 2MiB page. */
if (size == s2MiB) {
if (!commit)
return 0;
pde = base;
pde |= pde_page_flags(pat);
(*pd)[(base >> PDE_IDX_SHIFT) & PDE_IDX_MASK] = pde;
return 0;
}
if (size == s4KiB) {
uint64_t (*pt)[512];
uint64_t pte;
pde = (*pd)[(base >> PDE_IDX_SHIFT) & PDE_IDX_MASK];
/* No page table page allocation. */
if (!(pde & PDE_PRES)) {
printk(BIOS_ERR, "Cannot allocate page table for pde %p\n",
(void *)base);
return -1;
}
/* No splitting pages */
if (pde & PDE_PS) {
printk(BIOS_ERR, "Cannot split pde %p\n", (void *)base);
return -1;
}
if (!commit)
return 0;
pt = (void *)(uintptr_t)(pde & PDE_ADDR_MASK);
pte = base;
pte |= pte_page_flags(pat);
(*pt)[(base >> PTE_IDX_SHIFT) & PTE_IDX_MASK] = pte;
return 0;
}
return -1;
}
static int _paging_identity_map_addr(uintptr_t base, size_t size, int pat,
int commit)
{
while (size != 0) {
size_t map_size;
map_size = IS_ALIGNED(base, s2MiB) ? s2MiB : s4KiB;
map_size = MIN(size, map_size);
if (identity_map_one_page(base, map_size, pat, commit) < 0)
return -1;
base += map_size;
size -= map_size;
}
return 0;
}
static int paging_is_enabled(void)
{
return !!(read_cr0() & CR0_PG);
}
int paging_identity_map_addr(uintptr_t base, size_t size, int pat)
{
if (!paging_is_enabled()) {
printk(BIOS_ERR, "Paging is not enabled.\n");
return -1;
}
if (!IS_ALIGNED(base, s2MiB) && !IS_ALIGNED(base, s4KiB)) {
printk(BIOS_ERR, "base %p is not aligned.\n", (void *)base);
return -1;
}
if (!IS_ALIGNED(size, s2MiB) && !IS_ALIGNED(size, s4KiB)) {
printk(BIOS_ERR, "size %zx is not aligned.\n", size);
return -1;
}
/* First try without committing. If success commit. */
if (_paging_identity_map_addr(base, size, pat, 0))
return -1;
return _paging_identity_map_addr(base, size, pat, 1);
}

View File

@@ -498,7 +498,7 @@ tpm_result_t tpm_vendor_init(struct tpm_chip *chip, unsigned int bus, uint32_t d
if (rc)
return rc;
printk(BIOS_DEBUG, "cr50 TPM 2.0 (i2c %u:0x%02x id %#x)\n",
printk(BIOS_DEBUG, "GSC TPM 2.0 (i2c %u:0x%02x id %#x)\n",
bus, dev_addr, did_vid >> 16);
if (tpm_first_access_this_boot()) {

View File

@@ -233,6 +233,7 @@ static const enum ps2_action_key ps2_enum_val[] = {
[TK_KBD_BKLIGHT_TOGGLE] = PS2_KEY_KBD_BKLIGHT_TOGGLE,
[TK_MICMUTE] = PS2_KEY_MICMUTE,
[TK_MENU] = PS2_KEY_MENU,
[TK_DICTATE] = PS2_KEY_DICTATE,
};
static void fill_ssdt_ps2_keyboard(const struct device *dev)

View File

@@ -35,11 +35,6 @@ void paging_set_default_pat(void);
* failure. */
int paging_enable_for_car(const char *pdpt_name, const char *pt_name);
/* Identity map the region indicated by 'base' and 'size'. Both 'base' and
* 'size' need to be 4KiB or 2 MiB aligned. 'pat' should be one of the
* PAT defines above. 0 is returned on success, < 0 on failure. */
int paging_identity_map_addr(uintptr_t base, size_t size, int pat);
/* To be used with memset_pae */
#define MEMSET_PAE_VMEM_ALIGN (2 * MiB)
#define MEMSET_PAE_VMEM_SIZE (2 * MiB)

View File

@@ -4182,8 +4182,8 @@
#define PCI_DID_INTEL_RPL_U_GT4 0xa7ac
#define PCI_DID_INTEL_RPL_U_GT5 0xa7ad
#define PCI_DID_INTEL_LNL_M_GT2 0x64a0
#define PCI_DID_INTEL_TWL_GT1_1 0x46D3
#define PCI_DID_INTEL_TWL_GT1_2 0x46D4
#define PCI_DID_INTEL_TWL_GT1_1 0x46d3
#define PCI_DID_INTEL_TWL_GT1_2 0x46d4
#define PCI_DID_INTEL_PTL_GT2 0x64a0
/* Intel Northbridge Ids */

View File

@@ -4,6 +4,7 @@
#ifndef __DEVICE_TREE_H__
#define __DEVICE_TREE_H__
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <commonlib/list.h>
@@ -33,6 +34,7 @@ struct fdt_header {
#define FDT_TOKEN_BEGIN_NODE 1
#define FDT_TOKEN_END_NODE 2
#define FDT_TOKEN_PROPERTY 3
#define FDT_TOKEN_NOP 4
#define FDT_TOKEN_END 9
#define FDT_PHANDLE_ILLEGAL 0xdeadbeef
@@ -47,6 +49,11 @@ struct fdt_property
* Unflattened device tree structures.
*/
struct device_tree_region {
u64 addr;
u64 size;
};
struct device_tree_property
{
struct fdt_property prop;
@@ -91,6 +98,8 @@ struct device_tree
* which were consumed reading the requested value.
*/
/* Checks if blob points to a valid FDT */
bool fdt_is_valid(const void *blob);
/* Read the property at offset, if any exists. */
int fdt_next_property(const void *blob, uint32_t offset,
struct fdt_property *prop);
@@ -100,6 +109,26 @@ int fdt_node_name(const void *blob, uint32_t offset, const char **name);
void fdt_print_node(const void *blob, uint32_t offset);
int fdt_skip_node(const void *blob, uint32_t offset);
/* Read property and put into fdt_prop. Returns offset to property */
u32 fdt_read_prop(const void *blob, u32 node_offset, const char *prop_name,
struct fdt_property *fdt_prop);
/* Read reg property and save regions inside 'regions'. Returns number of regions read */
u32 fdt_read_reg_prop(const void *blob, u32 node_offset, u32 addr_cells, u32 size_cells,
struct device_tree_region regions[], size_t regions_count);
/* Find a node by a given path and return the offset */
u32 fdt_find_node_by_path(const void *blob, const char *path, u32 *addrcp, u32 *sizecp);
/* Find multiple nodes matching a given pattern. Returns number of nodes found */
size_t fdt_find_subnodes_by_prefix(const void *blob, u32 node_offset, const char *prefix,
u32 *addrcp, u32 *sizecp, u32 results[], size_t results_len);
/* Find a node by a given alias and return its offset */
u32 fdt_find_node_by_alias(const void *blob, const char *alias_name,
u32 *addr_cells, u32 *size_cells);
/*
* Read the node name into 'name' of the node behind 'node_offset'
* and return total bytes used for name
*/
int fdt_next_node_name(const void *blob, uint32_t node_offset, const char **name);
/* Read a flattened device tree into a hierarchical structure which refers to
the contents of the flattened tree in place. Modifying the flat tree
invalidates the unflattened one. */

View File

@@ -6,21 +6,39 @@
#include <ctype.h>
#include <device_tree.h>
#include <endian.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <stddef.h>
#include <stdlib.h>
#define FDT_PATH_MAX_DEPTH 10 // should be a good enough upper bound
#define FDT_PATH_MAX_LEN 128 // should be a good enough upper bound
/*
* Functions for picking apart flattened trees.
*/
static int fdt_skip_nops(const void *blob, uint32_t offset)
{
uint32_t *ptr = (uint32_t *)(((uint8_t *)blob) + offset);
int index = 0;
while (be32toh(ptr[index]) == FDT_TOKEN_NOP)
index++;
return index * sizeof(uint32_t);
}
int fdt_next_property(const void *blob, uint32_t offset,
struct fdt_property *prop)
{
struct fdt_header *header = (struct fdt_header *)blob;
uint32_t *ptr = (uint32_t *)(((uint8_t *)blob) + offset);
// skip NOP tokens
offset += fdt_skip_nops(blob, offset);
int index = 0;
if (be32toh(ptr[index++]) != FDT_TOKEN_PROPERTY)
return 0;
@@ -40,24 +58,369 @@ int fdt_next_property(const void *blob, uint32_t offset,
return index * sizeof(uint32_t);
}
int fdt_node_name(const void *blob, uint32_t offset, const char **name)
/*
* fdt_next_node_name reads a node name
*
* @params blob address of FDT
* @params offset offset to the node to read the name from
* @params name parameter to hold the name that has been read or NULL
*
* @returns Either 0 on error or offset to the properties that come after the node name
*/
int fdt_next_node_name(const void *blob, uint32_t offset, const char **name)
{
uint8_t *ptr = ((uint8_t *)blob) + offset;
// skip NOP tokens
offset += fdt_skip_nops(blob, offset);
char *ptr = ((char *)blob) + offset;
if (be32dec(ptr) != FDT_TOKEN_BEGIN_NODE)
return 0;
ptr += 4;
if (name)
*name = (char *)ptr;
return ALIGN_UP(strlen((char *)ptr) + 1, sizeof(uint32_t)) + 4;
*name = ptr;
return ALIGN_UP(strlen(ptr) + 1, 4) + 4;
}
static int dt_prop_is_phandle(struct device_tree_property *prop)
/*
* A utility function to skip past nodes in flattened trees.
*/
int fdt_skip_node(const void *blob, uint32_t start_offset)
{
return !(strcmp("phandle", prop->prop.name) &&
strcmp("linux,phandle", prop->prop.name));
uint32_t offset = start_offset;
const char *name;
int size = fdt_next_node_name(blob, offset, &name);
if (!size)
return 0;
offset += size;
while ((size = fdt_next_property(blob, offset, NULL)))
offset += size;
while ((size = fdt_skip_node(blob, offset)))
offset += size;
// skip NOP tokens
offset += fdt_skip_nops(blob, offset);
return offset - start_offset + sizeof(uint32_t);
}
/*
* fdt_read_prop reads a property inside a node
*
* @params blob address of FDT
* @params node_offset offset to the node to read the property from
* @params prop_name name of the property to read
* @params fdt_prop property is saved inside this parameter
*
* @returns Either 0 if no property has been found or an offset that points to the location
* of the property
*/
u32 fdt_read_prop(const void *blob, u32 node_offset, const char *prop_name,
struct fdt_property *fdt_prop)
{
u32 offset = node_offset;
offset += fdt_next_node_name(blob, offset, NULL); // skip node name
size_t size;
while ((size = fdt_next_property(blob, offset, fdt_prop))) {
if (strcmp(fdt_prop->name, prop_name) == 0)
return offset;
offset += size;
}
return 0; // property not found
}
/*
* fdt_read_reg_prop reads the reg property inside a node
*
* @params blob address of FDT
* @params node_offset offset to the node to read the reg property from
* @params addr_cells number of cells used for one address
* @params size_cells number of cells used for one size
* @params regions all regions that are read inside the reg property are saved inside
* this array
* @params regions_count maximum number of entries that can be saved inside the regions array.
*
* Returns: Either 0 on error or returns the number of regions put into the regions array.
*/
u32 fdt_read_reg_prop(const void *blob, u32 node_offset, u32 addr_cells, u32 size_cells,
struct device_tree_region regions[], size_t regions_count)
{
struct fdt_property prop;
u32 offset = fdt_read_prop(blob, node_offset, "reg", &prop);
if (!offset) {
printk(BIOS_DEBUG, "no reg property found in node_offset: %x\n", node_offset);
return 0;
}
// we found the reg property, now need to parse all regions in 'reg'
size_t count = prop.size / (4 * addr_cells + 4 * size_cells);
if (count > regions_count) {
printk(BIOS_ERR, "reg property at node_offset: %x has more entries (%zd) than regions array can hold (%zd)\n", node_offset, count, regions_count);
count = regions_count;
}
if (addr_cells > 2 || size_cells > 2) {
printk(BIOS_ERR, "addr_cells (%d) or size_cells (%d) bigger than 2\n",
addr_cells, size_cells);
return 0;
}
uint32_t *ptr = prop.data;
for (int i = 0; i < count; i++) {
if (addr_cells == 1)
regions[i].addr = be32dec(ptr);
else if (addr_cells == 2)
regions[i].addr = be64dec(ptr);
ptr += addr_cells;
if (size_cells == 1)
regions[i].size = be32dec(ptr);
else if (size_cells == 2)
regions[i].size = be64dec(ptr);
ptr += size_cells;
}
return count; // return the number of regions found in the reg property
}
static u32 fdt_read_cell_props(const void *blob, u32 node_offset, u32 *addrcp, u32 *sizecp)
{
struct fdt_property prop;
u32 offset = node_offset;
size_t size;
while ((size = fdt_next_property(blob, offset, &prop))) {
if (addrcp && !strcmp(prop.name, "#address-cells"))
*addrcp = be32dec(prop.data);
if (sizecp && !strcmp(prop.name, "#size-cells"))
*sizecp = be32dec(prop.data);
offset += size;
}
return offset;
}
/*
* fdt_find_node searches for a node relative to another node
*
* @params blob address of FDT
*
* @params parent_node_offset offset to node from which to traverse the tree
*
* @params path null terminated array of node names specifying a
* relative path (e.g: { "cpus", "cpu0", NULL })
*
* @params addrcp/sizecp If any address-cells and size-cells properties are found that are
* part of the parent node of the node we are looking, addrcp and sizecp
* are set to these respectively.
*
* @returns: Either 0 if no node has been found or the offset to the node found
*/
static u32 fdt_find_node(const void *blob, u32 parent_node_offset, char **path,
u32 *addrcp, u32 *sizecp)
{
if (*path == NULL)
return parent_node_offset; // node found
size_t size = fdt_next_node_name(blob, parent_node_offset, NULL); // skip node name
/*
* get address-cells and size-cells properties while skipping the others.
* According to spec address-cells and size-cells are not inherited, but we
* intentionally follow the Linux implementation here and treat them as inheritable.
*/
u32 node_offset = fdt_read_cell_props(blob, parent_node_offset + size, addrcp, sizecp);
const char *node_name;
// walk all children nodes
while ((size = fdt_next_node_name(blob, node_offset, &node_name))) {
if (!strcmp(*path, node_name)) {
// traverse one level deeper into the path
return fdt_find_node(blob, node_offset, path + 1, addrcp, sizecp);
}
// node is not the correct one. skip current node
node_offset += fdt_skip_node(blob, node_offset);
}
// we have searched everything and could not find a fitting node
return 0;
}
/*
* fdt_find_node_by_path finds a node behind a given node path
*
* @params blob address of FDT
* @params path absolute path to the node that should be searched for
*
* @params addrcp/sizecp Pointer that will be updated with any #address-cells and #size-cells
* value found in the node of the node specified by node_offset. Either
* may be NULL to ignore. If no #address-cells and #size-cells is found
* default values of #address-cells=2 and #size-cells=1 are returned.
*
* @returns Either 0 on error or the offset to the node found behind the path
*/
u32 fdt_find_node_by_path(const void *blob, const char *path, u32 *addrcp, u32 *sizecp)
{
// sanity check
if (path[0] != '/') {
printk(BIOS_ERR, "devicetree path must start with a /\n");
return 0;
}
if (!blob) {
printk(BIOS_ERR, "devicetree blob is NULL\n");
return 0;
}
if (addrcp)
*addrcp = 2;
if (sizecp)
*sizecp = 1;
struct fdt_header *fdt_hdr = (struct fdt_header *)blob;
/*
* split path into separate nodes
* e.g: "/cpus/cpu0" -> { "cpus", "cpu0" }
*/
char *path_array[FDT_PATH_MAX_DEPTH];
size_t path_size = strlen(path);
assert(path_size < FDT_PATH_MAX_LEN);
char path_copy[FDT_PATH_MAX_LEN];
memcpy(path_copy, path, path_size + 1);
char *cur = path_copy;
int i;
for (i = 0; i < FDT_PATH_MAX_DEPTH; i++) {
path_array[i] = strtok_r(NULL, "/", &cur);
if (!path_array[i])
break;
}
assert(i < FDT_PATH_MAX_DEPTH);
return fdt_find_node(blob, be32toh(fdt_hdr->structure_offset), path_array, addrcp, sizecp);
}
/*
* fdt_find_subnodes_by_prefix finds a node with a given prefix relative to a parent node
*
* @params blob The FDT to search.
*
* @params node_offset offset to the node of which the children should be searched
*
* @params prefix A string to search for a node with a given prefix. This can for example
* be 'cpu' to look for all nodes matching this prefix. Only children of
* node_offset are searched. Therefore in order to search all nodes matching
* the 'cpu' prefix, node_offset should probably point to the 'cpus' node.
* An empty prefix ("") searches for all children nodes of node_offset.
*
* @params addrcp/sizecp Pointer that will be updated with any #address-cells and #size-cells
* value found in the node of the node specified by node_offset. Either
* may be NULL to ignore. If no #address-cells and #size-cells is found
* addrcp and sizecp are left untouched.
*
* @params results Array of offsets pointing to each node matching the given prefix.
* @params results_len Number of entries allocated for the 'results' array
*
* @returns offset to last node found behind path or 0 if no node has been found
*/
size_t fdt_find_subnodes_by_prefix(const void *blob, u32 node_offset, const char *prefix,
u32 *addrcp, u32 *sizecp, u32 *results, size_t results_len)
{
// sanity checks
if (!blob || !results || !prefix) {
printk(BIOS_ERR, "%s: input parameter cannot be null/\n", __func__);
return 0;
}
u32 offset = node_offset;
// we don't care about the name of the current node
u32 size = fdt_next_node_name(blob, offset, NULL);
if (!size) {
printk(BIOS_ERR, "%s: node_offset: %x does not point to a node\n",
__func__, node_offset);
return 0;
}
offset += size;
/*
* update addrcp and sizecp if the node contains an address-cells and size-cells
* property. Otherwise use addrcp and sizecp provided by caller.
*/
offset = fdt_read_cell_props(blob, offset, addrcp, sizecp);
size_t count_results = 0;
int prefix_len = strlen(prefix);
const char *node_name;
// walk all children nodes of offset
while ((size = fdt_next_node_name(blob, offset, &node_name))) {
if (count_results >= results_len) {
printk(BIOS_WARNING,
"%s: results_len (%zd) smaller than count_results (%zd)\n",
__func__, results_len, count_results);
break;
}
if (!strncmp(prefix, node_name, prefix_len)) {
// we found a node that matches the prefix
results[count_results++] = offset;
}
// node does not match the prefix. skip current node
offset += fdt_skip_node(blob, offset);
}
// return last occurrence
return count_results;
}
static const char *fdt_read_alias_prop(const void *blob, const char *alias_name)
{
u32 node_offset = fdt_find_node_by_path(blob, "/aliases", NULL, NULL);
if (!node_offset) {
printk(BIOS_DEBUG, "no /aliases node found\n");
return NULL;
}
struct fdt_property alias_prop;
if (!fdt_read_prop(blob, node_offset, alias_name, &alias_prop)) {
printk(BIOS_DEBUG, "property %s in /aliases node not found\n", alias_name);
return NULL;
}
return (const char *)alias_prop.data;
}
/*
* Find a node in the tree from a string device tree path.
*
* @params blob Address to the FDT
* @params alias_name node name alias that should be searched for.
* @params addrcp/sizecp Pointer that will be updated with any #address-cells and #size-cells
* value found in the node of the node specified by node_offset. Either
* may be NULL to ignore. If no #address-cells and #size-cells is found
* default values of #address-cells=2 and #size-cells=1 are returned.
*
* @returns offset to last node found behind path or 0 if no node has been found
*/
u32 fdt_find_node_by_alias(const void *blob, const char *alias_name, u32 *addrcp, u32 *sizecp)
{
const char *node_name = fdt_read_alias_prop(blob, alias_name);
if (!node_name) {
printk(BIOS_DEBUG, "alias %s not found\n", alias_name);
return 0;
}
u32 node_offset = fdt_find_node_by_path(blob, node_name, addrcp, sizecp);
if (!node_offset) {
// This should not happen (invalid devicetree)
printk(BIOS_WARNING,
"Could not find node '%s', which alias was referring to '%s'\n",
node_name, alias_name);
return 0;
}
return node_offset;
}
/*
@@ -108,7 +471,7 @@ static int print_flat_node(const void *blob, uint32_t start_offset, int depth)
const char *name;
int size;
size = fdt_node_name(blob, offset, &name);
size = fdt_next_node_name(blob, offset, &name);
if (!size)
return 0;
offset += size;
@@ -139,38 +502,16 @@ void fdt_print_node(const void *blob, uint32_t offset)
print_flat_node(blob, offset, 0);
}
/*
* A utility function to skip past nodes in flattened trees.
*/
int fdt_skip_node(const void *blob, uint32_t start_offset)
{
int offset = start_offset;
int size;
const char *name;
size = fdt_node_name(blob, offset, &name);
if (!size)
return 0;
offset += size;
while ((size = fdt_next_property(blob, offset, NULL)))
offset += size;
while ((size = fdt_skip_node(blob, offset)))
offset += size;
return offset - start_offset + sizeof(uint32_t);
}
/*
* Functions to turn a flattened tree into an unflattened one.
*/
static int dt_prop_is_phandle(struct device_tree_property *prop)
{
return !(strcmp("phandle", prop->prop.name) &&
strcmp("linux,phandle", prop->prop.name));
}
static int fdt_unflatten_node(const void *blob, uint32_t start_offset,
struct device_tree *tree,
struct device_tree_node **new_node)
@@ -180,7 +521,7 @@ static int fdt_unflatten_node(const void *blob, uint32_t start_offset,
const char *name;
int size;
size = fdt_node_name(blob, offset, &name);
size = fdt_next_node_name(blob, offset, &name);
if (!size)
return 0;
offset += size;
@@ -237,30 +578,37 @@ static int fdt_unflatten_map_entry(const void *blob, uint32_t offset,
return sizeof(uint64_t) * 2;
}
struct device_tree *fdt_unflatten(const void *blob)
bool fdt_is_valid(const void *blob)
{
struct device_tree *tree = xzalloc(sizeof(*tree));
const struct fdt_header *header = (const struct fdt_header *)blob;
tree->header = header;
uint32_t magic = be32toh(header->magic);
uint32_t version = be32toh(header->version);
uint32_t last_comp_version = be32toh(header->last_comp_version);
if (magic != FDT_HEADER_MAGIC) {
printk(BIOS_DEBUG, "Invalid device tree magic %#.8x!\n", magic);
free(tree);
return NULL;
printk(BIOS_ERR, "Invalid device tree magic %#.8x!\n", magic);
return false;
}
if (last_comp_version > FDT_SUPPORTED_VERSION) {
printk(BIOS_DEBUG, "Unsupported device tree version %u(>=%u)\n",
printk(BIOS_ERR, "Unsupported device tree version %u(>=%u)\n",
version, last_comp_version);
free(tree);
return NULL;
return false;
}
if (version > FDT_SUPPORTED_VERSION)
printk(BIOS_NOTICE, "FDT version %u too new, should add support!\n",
version);
return true;
}
struct device_tree *fdt_unflatten(const void *blob)
{
struct device_tree *tree = xzalloc(sizeof(*tree));
const struct fdt_header *header = (const struct fdt_header *)blob;
tree->header = header;
if (fdt_is_valid(blob))
return NULL;
uint32_t struct_offset = be32toh(header->structure_offset);
uint32_t strings_offset = be32toh(header->strings_offset);
@@ -981,7 +1329,7 @@ void dt_add_u64_prop(struct device_tree_node *node, const char *name, u64 val)
* Add a 'reg' address list property to a node, or update it if it exists.
*
* @param node The device tree node to add to.
* @param addrs Array of address values to be stored in the property.
* @param regions Array of address values to be stored in the property.
* @param sizes Array of corresponding size values to 'addrs'.
* @param count Number of values in 'addrs' and 'sizes' (must be equal).
* @param addr_cells Value of #address-cells property valid for this node.

View File

@@ -9,6 +9,7 @@ romstage-$(CONFIG_BOARD_AMD_BIRMAN_GLINDA) += port_descriptors_glinda.c
ramstage-y += chromeos.c
ramstage-y += gpio.c
ramstage-$(CONFIG_BOARD_AMD_BIRMAN_PHOENIX_OPENSIL) += update_devicetree_phoenix_opensil.c
ramstage-$(CONFIG_BOARD_AMD_BIRMAN_PHOENIX_FSP) += port_descriptors_phoenix.c
ramstage-$(CONFIG_BOARD_AMD_BIRMAN_GLINDA) += port_descriptors_glinda.c

View File

@@ -43,25 +43,75 @@ chip soc/amd/phoenix
device domain 0 on
device ref iommu on end
device ref gpp_bridge_1_1 on end # MXM
device ref gpp_bridge_1_2 on
# Required so the NVMe gets placed into D3 when entering S0i3.
chip drivers/pcie/rtd3/device
register "name" = ""NVME""
device pci 00.0 on end
chip vendorcode/amd/opensil/chip/mpio
register "type" = "IFTYPE_PCIE"
register "start_lane" = "0"
register "end_lane" = "7"
register "aspm" = "ASPM_L1"
register "clk_req" = "CLK_REQ0"
# register "gpio_group" is currently not used
device ref gpp_bridge_1_1 on end # MXM
end
chip vendorcode/amd/opensil/chip/mpio
register "type" = "IFTYPE_PCIE"
register "start_lane" = "8"
register "end_lane" = "11"
register "aspm" = "ASPM_L1"
register "clk_req" = "CLK_REQ1"
device ref gpp_bridge_1_2 on # NVMe SSD1
# Required so the NVMe gets placed into D3 when entering S0i3.
chip drivers/pcie/rtd3/device
register "name" = ""NVME""
device pci 00.0 on end
end
end
end # NVMe SSD1
device ref gpp_bridge_1_3 on end # GBE
device ref gpp_bridge_2_1 on end # SD
device ref gpp_bridge_2_2 on end # WWAN
device ref gpp_bridge_2_3 on end # WIFI
device ref gpp_bridge_2_4 on
# Required so the NVMe gets placed into D3 when entering S0i3.
chip drivers/pcie/rtd3/device
register "name" = ""NVME""
device pci 00.0 on end
end
chip vendorcode/amd/opensil/chip/mpio
register "type" = "IFTYPE_PCIE"
register "start_lane" = "12"
register "end_lane" = "12"
register "aspm" = "ASPM_DISABLED"
register "clk_req" = "CLK_REQ6"
device ref gpp_bridge_1_3 on end # GBE
end
chip vendorcode/amd/opensil/chip/mpio
register "type" = "IFTYPE_PCIE"
register "start_lane" = "13"
register "end_lane" = "13"
register "aspm" = "ASPM_DISABLED"
register "clk_req" = "CLK_REQ5"
device ref gpp_bridge_2_1 on end # SD
end
chip vendorcode/amd/opensil/chip/mpio
register "type" = "IFTYPE_PCIE"
register "start_lane" = "14"
register "end_lane" = "14"
register "aspm" = "ASPM_DISABLED"
register "clk_req" = "CLK_REQ4"
device ref gpp_bridge_2_2 on end # WWAN
end
chip vendorcode/amd/opensil/chip/mpio
register "type" = "IFTYPE_PCIE"
register "start_lane" = "15"
register "end_lane" = "15"
register "aspm" = "ASPM_DISABLED"
register "clk_req" = "CLK_REQ3"
device ref gpp_bridge_2_3 on end # WIFI
end
chip vendorcode/amd/opensil/chip/mpio
register "type" = "IFTYPE_PCIE"
register "start_lane" = "16"
register "end_lane" = "19"
register "aspm" = "ASPM_DISABLED"
register "clk_req" = "CLK_REQ2"
device ref gpp_bridge_2_4 on # NVMe SSD0
# Required so the NVMe gets placed into D3 when entering S0i3.
chip drivers/pcie/rtd3/device
register "name" = ""NVME""
device pci 00.0 on end
end
end
end # NVMe SSD0
end
device ref gpp_bridge_a on # Internal GPP Bridge 0 to Bus A
device ref gfx on end # Internal GPU (GFX)
device ref gfx_hda on end # Display HD Audio Controller (GFXAZ)

View File

@@ -6,6 +6,7 @@
#include <device/device.h>
#include <types.h>
#include "gpio.h"
#include "update_devicetree.h"
/* TODO: Update for birman */
@@ -58,6 +59,9 @@ const struct fch_irq_routing *mb_get_fch_irq_mapping(size_t *length)
static void mainboard_init(void *chip_info)
{
mainboard_program_gpios();
if (CONFIG(BOARD_AMD_BIRMAN_PHOENIX_OPENSIL))
mainboard_update_devicetree_opensil();
}
struct chip_operations mainboard_ops = {

View File

@@ -0,0 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef MAINBOARD_UPDATE_DEVICETREE_H
#define MAINBOARD_UPDATE_DEVICETREE_H
void mainboard_update_devicetree_opensil(void);
#endif /* MAINBOARD_UPDATE_DEVICETREE_H */

View File

@@ -0,0 +1,45 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <device/device.h>
#include <soc/soc_util.h>
#include <vendorcode/amd/opensil/chip/mpio/chip.h>
#include "update_devicetree.h"
static void mainboard_update_mpio(void)
{
struct device *mxm_bridge = DEV_PTR(gpp_bridge_1_1);
struct device *ssd1_bridge = DEV_PTR(gpp_bridge_1_2);
struct device *wwan_bridge = DEV_PTR(gpp_bridge_2_2);
struct device *wlan_bridge = DEV_PTR(gpp_bridge_2_3);
struct vendorcode_amd_opensil_chip_mpio_config *mxm_bridge_cfg = config_of(mxm_bridge);
struct vendorcode_amd_opensil_chip_mpio_config *ssd1_bridge_cfg = config_of(ssd1_bridge);
struct vendorcode_amd_opensil_chip_mpio_config *wwan_bridge_cfg = config_of(wwan_bridge);
struct vendorcode_amd_opensil_chip_mpio_config *wlan_bridge_cfg = config_of(wlan_bridge);
/* Phoenix 2 has less PCIe lanes than Phoenix */
if (get_soc_type() == SOC_PHOENIX2) {
mxm_bridge_cfg->end_lane = 3;
ssd1_bridge_cfg->end_lane = 9;
}
if (!CONFIG(ENABLE_EVAL_CARD)) {
mxm_bridge->enabled = false;
}
if (CONFIG(DISABLE_DT_M2)) {
ssd1_bridge->enabled = false;
}
/* When the WLAN card uses 2 lanes, the WWAN card can't be used */
if (CONFIG(WLAN01)) {
wwan_bridge->enabled = false;
wlan_bridge_cfg->end_lane = 14;
}
/* When the WWAN card uses 2 lanes, the WLAN card can't be used */
if (CONFIG(WWAN01)) {
wlan_bridge->enabled = false;
wwan_bridge_cfg->end_lane = 15;
}
}
void mainboard_update_devicetree_opensil(void)
{
mainboard_update_mpio();
}

View File

@@ -7,13 +7,13 @@
const u32 cim_verb_data[] = {
/* coreboot specific header */
0x10ec0256, // Codec Vendor / Device ID: Realtek ALC256
0x10ec12ac, // Subsystem ID
0x10ec0236, // Codec Vendor / Device ID: Realtek ALC236
0x103C8C60, // Subsystem ID
0x00000013, // Number of jacks (NID entries)
AZALIA_RESET(0x1),
/* NID 0x01, HDA Codec Subsystem ID Verb table */
AZALIA_SUBVENDOR(0, 0x10ec12ac),
AZALIA_SUBVENDOR(0, 0x103C8C60),
/* Pin Widget Verb Table */
@@ -30,41 +30,56 @@ const u32 cim_verb_data[] = {
/* Pin widget 0x18 - NPC */
AZALIA_PIN_CFG(0, 0x18, 0x411111F0),
/* Pin widget 0x19 - MIC2 (Port-F) */
AZALIA_PIN_CFG(0, 0x19, 0x04A11040),
AZALIA_PIN_CFG(0, 0x19, 0x03A11020),
/* Pin widget 0x1A - LINE1 (Port-C) */
AZALIA_PIN_CFG(0, 0x1a, 0x411111F0),
/* Pin widget 0x1B - NPC */
AZALIA_PIN_CFG(0, 0x1b, 0x411111F0),
/* Pin widget 0x1D - BEEP-IN */
AZALIA_PIN_CFG(0, 0x1d, 0x40610041),
AZALIA_PIN_CFG(0, 0x1d, 0x40600001),
/* Pin widget 0x1E - NPC */
AZALIA_PIN_CFG(0, 0x1e, 0x411111F0),
/* Pin widget 0x21 - HP1-OUT (Port-I) */
AZALIA_PIN_CFG(0, 0x21, 0x04211020),
AZALIA_PIN_CFG(0, 0x21, 0x03211040),
/*
* ;Pin widget 0x19 - MIC2 (Port-F)
*/
0x01971C20,
0x01971D10,
0x01971EA1,
0x01971F03,
/*
* Pin widget 0x21 - HP1-OUT (Port-I)
*/
0x02171C40,
0x02171D10,
0x02171E21,
0x02171F03,
/*
* Widget node 0x20 - 1
* Codec hidden reset and speaker power 2W/4ohm
*/
0x0205001A,
0x0204C003,
0x02050038,
0x02047901,
/*
* Widget node 0x20 - 2
* Class D power on Reset
*/
0x0205003C,
0x02040354,
0x0205003C,
0x02040314,
/*
* Widget node 0x20 - 2
* Class D power on Reset
*/
0x0205001B,
0x02040A4B,
0x0205000B,
0x02047778,
/*
* Widget node 0x20 - 3
* Disable AGC and set AGC limit to -1.5dB
*/
0x02050016,
0x02040C50,
0x02050012,
0x0204EBC1,
0x02050046,
0x02040004,
0x05750003,
0x057409A3,
/*
* Widget node 0x20 - 4
* Set AGC Post gain +1.5dB then Enable AGC

View File

@@ -67,7 +67,7 @@ config BOARD_GOOGLE_BASEBOARD_BRASK
select CR50_RESET_CLEAR_EC_AP_IDLE_FLAG
select ENABLE_TCSS_DISPLAY_DETECTION if RUN_FSP_GOP
select HAVE_SLP_S0_GATE
select MEMORY_SODIMM if !BOARD_GOOGLE_CONSTITUTION
select MEMORY_SODIMM if !(BOARD_GOOGLE_CONSTITUTION || BOARD_GOOGLE_NOVA)
select RT8168_GEN_ACPI_POWER_RESOURCE
select RT8168_GET_MAC_FROM_VPD
select RT8168_SET_LED_MODE
@@ -362,6 +362,7 @@ config BOARD_GOOGLE_NOKRIS
config BOARD_GOOGLE_NOVA
select BOARD_GOOGLE_BASEBOARD_BRASK
select SOC_INTEL_RAPTORLAKE
select MEMORY_SOLDERDOWN
config BOARD_GOOGLE_OMNIGUL
select BOARD_GOOGLE_BASEBOARD_BRYA
@@ -370,6 +371,9 @@ config BOARD_GOOGLE_OMNIGUL
select SOC_INTEL_RAPTORLAKE
select USE_UNIFIED_AP_FIRMWARE_FOR_UFS_AND_NON_UFS
config BOARD_GOOGLE_ORISA
select BOARD_GOOGLE_BASEBOARD_TRULO
config BOARD_GOOGLE_OSIRIS
select BOARD_GOOGLE_BASEBOARD_BRYA
select CHROMEOS_WIFI_SAR if CHROMEOS
@@ -644,6 +648,7 @@ config DRIVER_TPM_I2C_BUS
default 0x0 if BOARD_GOOGLE_NIVVIKS
default 0x1 if BOARD_GOOGLE_NOVA
default 0x1 if BOARD_GOOGLE_OMNIGUL
default 0x0 if BOARD_GOOGLE_ORISA
default 0x1 if BOARD_GOOGLE_OSIRIS
default 0x0 if BOARD_GOOGLE_PIRRHA
default 0x1 if BOARD_GOOGLE_PRIMUS
@@ -733,6 +738,7 @@ config MAINBOARD_PART_NUMBER
default "Nokris" if BOARD_GOOGLE_NOKRIS
default "Nova" if BOARD_GOOGLE_NOVA
default "Omnigul" if BOARD_GOOGLE_OMNIGUL
default "Orisa" if BOARD_GOOGLE_ORISA
default "Osiris" if BOARD_GOOGLE_OSIRIS
default "Pirrha" if BOARD_GOOGLE_PIRRHA
default "Primus" if BOARD_GOOGLE_PRIMUS
@@ -797,6 +803,7 @@ config VARIANT_DIR
default "nokris" if BOARD_GOOGLE_NOKRIS
default "nova" if BOARD_GOOGLE_NOVA
default "omnigul" if BOARD_GOOGLE_OMNIGUL
default "orisa" if BOARD_GOOGLE_ORISA
default "osiris" if BOARD_GOOGLE_OSIRIS
default "pirrha" if BOARD_GOOGLE_PIRRHA
default "primus" if BOARD_GOOGLE_PRIMUS

View File

@@ -184,3 +184,6 @@ config BOARD_GOOGLE_SUNDANCE
config BOARD_GOOGLE_PUJJOGA
bool "-> Pujjoga"
config BOARD_GOOGLE_ORISA
bool "-> Orisa"

View File

@@ -0,0 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
bootblock-y += gpio.c
romstage-y += gpio.c
ramstage-y += gpio.c

View File

@@ -0,0 +1,149 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <baseboard/gpio.h>
#include <baseboard/variants.h>
#include <commonlib/helpers.h>
#include <soc/gpio.h>
/* Pad configuration in ramstage */
static const struct pad_config override_gpio_table[] = {
/* A14 : USB_OC1# ==> NC */
PAD_NC_LOCK(GPP_A14, NONE, LOCK_CONFIG),
/* A15 : USB_OC2# ==> NC */
PAD_NC_LOCK(GPP_A15, NONE, LOCK_CONFIG),
/* A18 : DDSP_HPDB ==> HDMIB_HPD */
PAD_CFG_NF(GPP_A18, NONE, DEEP, NF1),
/* A19 : DDSP_HPD1 ==> NC */
PAD_NC_LOCK(GPP_A19, NONE, LOCK_CONFIG),
/* A20 : DDSP_HPD2 ==> NC */
PAD_NC_LOCK(GPP_A20, NONE, LOCK_CONFIG),
/* A21 : DDPC_CTRCLK ==> NC */
PAD_NC(GPP_A21, NONE),
/* A22 : DDPC_CTRLDATA ==> NC */
PAD_NC_LOCK(GPP_A22, NONE, LOCK_CONFIG),
/* B2 : VRALERT# ==> M2_SSD_PLA_L */
PAD_NC(GPP_B2, NONE),
/* B7 : ISH_12C1_SDA ==> PCH_I2C_MISCB_SDA */
PAD_CFG_NF_LOCK(GPP_B7, NONE, NF2, LOCK_CONFIG),
/* B8 : ISH_I2C1_SCL ==> PCH_I2C_MISCB_SCL */
PAD_CFG_NF_LOCK(GPP_B8, NONE, NF2, LOCK_CONFIG),
/* D0 : ISH_GP0 ==> NC */
PAD_NC_LOCK(GPP_D0, NONE, LOCK_CONFIG),
/* D1 : ISH_GP1 ==> NC */
PAD_NC_LOCK(GPP_D1, NONE, LOCK_CONFIG),
/* D2 : ISH_GP2 ==> NC */
PAD_NC_LOCK(GPP_D2, NONE, LOCK_CONFIG),
/* D3 : ISH_GP3 ==> NC */
PAD_NC_LOCK(GPP_D3, NONE, LOCK_CONFIG),
/* D8 : SRCCLKREQ3# ==> NC */
PAD_NC(GPP_D8, NONE),
/* D9 : ISH_SPI_CS# ==> NC */
PAD_NC_LOCK(GPP_D9, NONE, LOCK_CONFIG),
/* D10 : ISH_SPI_CLK ==> GPI */
PAD_CFG_GPI_LOCK(GPP_D10, NONE, LOCK_CONFIG),
/* D17 : UART1_RXD */
PAD_CFG_NF(GPP_D17, NONE, DEEP, NF1),
/* D18 : UART1_TXD */
PAD_CFG_NF(GPP_D18, NONE, DEEP, NF1),
/* E14 : DDSP_HPDA ==> HDMIA_HPD */
PAD_CFG_NF(GPP_E14, NONE, DEEP, NF1),
/* E20 : DDP2_CTRLCLK ==> DDIA_HDMI_CTRLCLK */
PAD_CFG_NF(GPP_E20, NONE, DEEP, NF1),
/* E21 : DDP2_CTRLDATA ==> DDIA_HDMI_CTRLDATA */
PAD_CFG_NF(GPP_E21, NONE, DEEP, NF1),
/* F11 : THC1_SPI2_CLK ==> NC */
PAD_NC_LOCK(GPP_F11, NONE, LOCK_CONFIG),
/* F12 : GSXDOUT ==> NC */
PAD_NC_LOCK(GPP_F12, NONE, LOCK_CONFIG),
/* F13 : GSXDOUT ==> NC */
PAD_NC_LOCK(GPP_F13, NONE, LOCK_CONFIG),
/* F15 : GSXSRESET# ==> NC */
PAD_NC_LOCK(GPP_F15, NONE, LOCK_CONFIG),
/* F16 : GSXCLK ==> NC */
PAD_NC_LOCK(GPP_F16, NONE, LOCK_CONFIG),
/* H12 : I2C7_SDA ==> NC */
PAD_NC_LOCK(GPP_H12, NONE, LOCK_CONFIG),
/* H13 : I2C7_SCL ==> NC */
PAD_NC_LOCK(GPP_H13, NONE, LOCK_CONFIG),
/* R4 : HDA_RST# ==> NC */
PAD_NC(GPP_R4, NONE),
/* R5 : HDA_SDI1 ==> NC */
PAD_NC(GPP_R5, NONE),
/* R6 : I2S2_TXD ==> NC */
PAD_NC(GPP_R6, NONE),
/* R7 : I2S2_RXD ==> NC */
PAD_NC(GPP_R7, NONE),
};
/* Early pad configuration in bootblock */
static const struct pad_config early_gpio_table[] = {
/* A13 : PMC_I2C_SCL ==> GSC_PCH_INT_ODL */
PAD_CFG_GPI_APIC(GPP_A13, NONE, PLTRST, LEVEL, INVERT),
/* B4 : PROC_GP3 ==> SSD_PERST_L */
PAD_CFG_GPO(GPP_B4, 0, DEEP),
/* E15 : RSVD_TP ==> PCH_WP_OD */
PAD_CFG_GPI_GPIO_DRIVER(GPP_E15, NONE, DEEP),
/* F14 : GSXDIN ==> EN_PP3300_SSD */
PAD_CFG_GPO(GPP_F14, 1, DEEP),
/* F18 : THC1_SPI2_INT# ==> EC_IN_RW_OD */
PAD_CFG_GPI(GPP_F18, NONE, DEEP),
/* H6 : I2C1_SDA ==> PCH_I2C_TPM_SDA */
PAD_CFG_NF(GPP_H6, NONE, DEEP, NF1),
/* H7 : I2C1_SCL ==> PCH_I2C_TPM_SCL */
PAD_CFG_NF(GPP_H7, NONE, DEEP, NF1),
/* H10 : UART0_RXD ==> UART_PCH_RX_DBG_TX */
PAD_CFG_NF(GPP_H10, NONE, DEEP, NF2),
/* H11 : UART0_TXD ==> UART_PCH_TX_DBG_RX */
PAD_CFG_NF(GPP_H11, NONE, DEEP, NF2),
/* CPU PCIe VGPIO for PEG60 */
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_48, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_49, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_50, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_51, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_52, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_53, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_54, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_55, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_56, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_57, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_58, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_59, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_60, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_61, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_62, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_63, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_76, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_77, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_78, NONE, PLTRST, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_79, NONE, PLTRST, NF1),
};
static const struct pad_config romstage_gpio_table[] = {
/* B4 : PROC_GP3 ==> SSD_PERST_L */
PAD_CFG_GPO(GPP_B4, 1, DEEP),
};
const struct pad_config *variant_gpio_override_table(size_t *num)
{
*num = ARRAY_SIZE(override_gpio_table);
return override_gpio_table;
}
const struct pad_config *variant_early_gpio_table(size_t *num)
{
*num = ARRAY_SIZE(early_gpio_table);
return early_gpio_table;
}
const struct pad_config *variant_romstage_gpio_table(size_t *num)
{
*num = ARRAY_SIZE(romstage_gpio_table);
return romstage_gpio_table;
}

View File

@@ -1,6 +1,318 @@
chip soc/intel/alderlake
register "sagv" = "SaGv_Enabled"
device domain 0 on
end
# Intel Common SoC Config
#+-------------------+---------------------------+
#| Field | Value |
#+-------------------+---------------------------+
#| GSPI1 | NC |
#| I2C0 | Audio |
#| I2C1 | cr50 TPM. Early init is |
#| | required to set up a BAR |
#| | for TPM communication |
#| I2C3 | NC |
#| I2C5 | NC |
#+-------------------+---------------------------+
register "common_soc_config" = "{
.i2c[0] = {
.speed = I2C_SPEED_FAST,
.rise_time_ns = 600,
.fall_time_ns = 400,
.data_hold_time_ns = 50,
},
.i2c[1] = {
.early_init = 1,
.speed = I2C_SPEED_FAST,
.rise_time_ns = 600,
.fall_time_ns = 400,
.data_hold_time_ns = 50,
},
}"
register "usb2_ports[1]" = "USB2_PORT_MID(OC_SKIP)" # Type-A Port A2
register "usb2_ports[2]" = "USB2_PORT_MID(OC_SKIP)" # Type-A Port A3
register "usb2_ports[3]" = "USB2_PORT_MID(OC_SKIP)" # USB2 Port 3 - Port 5 for OPS interface
register "usb2_ports[6]" = "USB2_PORT_EMPTY" # Disable Port 6
register "usb3_ports[2]" = "USB3_PORT_EMPTY " # Disable Port 2
# USB3 Port 3 for OPS interface
register "tcss_ports[1]" = "TCSS_PORT_EMPTY" # Disable Port1
register "tcss_ports[2]" = "TCSS_PORT_EMPTY" # Disable Port2
register "serial_io_gspi_mode" = "{
[PchSerialIoIndexGSPI0] = PchSerialIoDisabled,
[PchSerialIoIndexGSPI1] = PchSerialIoDisabled,
}"
register "ddi_ports_config" = "{
[DDI_PORT_A] = DDI_ENABLE_HPD,
[DDI_PORT_B] = DDI_ENABLE_HPD | DDI_ENABLE_DDC,
[DDI_PORT_1] = DDI_ENABLE_HPD,
[DDI_PORT_3] = DDI_ENABLE_HPD | DDI_ENABLE_DDC,
}"
device domain 0 on
device ref dtt on
chip drivers/intel/dptf
## sensor information
register "options.tsr[0].desc" = ""DRAM""
register "options.tsr[1].desc" = ""Charger""
# TODO: below values are initial reference values only
## Active Policy
register "policies.active" = "{
[0] = {
.target = DPTF_CPU,
.thresholds = {
TEMP_PCT(85, 90),
TEMP_PCT(80, 80),
TEMP_PCT(75, 70),
}
}
}"
## Passive Policy
register "policies.passive" = "{
[0] = DPTF_PASSIVE(CPU, CPU, 95, 5000),
[1] = DPTF_PASSIVE(CPU, TEMP_SENSOR_0, 75, 5000),
[2] = DPTF_PASSIVE(CHARGER, TEMP_SENSOR_1, 75, 5000),
}"
## Critical Policy
register "policies.critical" = "{
[0] = DPTF_CRITICAL(CPU, 105, SHUTDOWN),
[1] = DPTF_CRITICAL(TEMP_SENSOR_0, 85, SHUTDOWN),
[2] = DPTF_CRITICAL(TEMP_SENSOR_1, 85, SHUTDOWN),
}"
register "controls.power_limits" = "{
.pl1 = {
.min_power = 3000,
.max_power = 15000,
.time_window_min = 28 * MSECS_PER_SEC,
.time_window_max = 32 * MSECS_PER_SEC,
.granularity = 200,
},
.pl2 = {
.min_power = 55000,
.max_power = 55000,
.time_window_min = 28 * MSECS_PER_SEC,
.time_window_max = 32 * MSECS_PER_SEC,
.granularity = 1000,
}
}"
## Charger Performance Control (Control, mA)
register "controls.charger_perf" = "{
[0] = { 255, 1700 },
[1] = { 24, 1500 },
[2] = { 16, 1000 },
[3] = { 8, 500 }
}"
## Fan Performance Control (Percent, Speed, Noise, Power)
register "controls.fan_perf" = "{
[0] = { 90, 6700, 220, 2200, },
[1] = { 80, 5800, 180, 1800, },
[2] = { 70, 5000, 145, 1450, },
[3] = { 60, 4900, 115, 1150, },
[4] = { 50, 3838, 90, 900, },
[5] = { 40, 2904, 55, 550, },
[6] = { 30, 2337, 30, 300, },
[7] = { 20, 1608, 15, 150, },
[8] = { 10, 800, 10, 100, },
[9] = { 0, 0, 0, 50, }
}"
## Fan options
register "options.fan.fine_grained_control" = "1"
register "options.fan.step_size" = "2"
device generic 0 alias dptf_policy on end
end
end
device ref pcie4_0 on
# Enable CPU PCIE RP 1 using CLK 0
register "cpu_pcie_rp[CPU_RP(1)]" = "{
.clk_req = 0,
.clk_src = 0,
.flags = PCIE_RP_LTR | PCIE_RP_AER,
}"
end #NVME
device ref tbt_pcie_rp1 off end
device ref tbt_pcie_rp2 off end
device ref tcss_dma0 on
chip drivers/intel/usb4/retimer
register "dfp[0].power_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_E4)"
use tcss_usb3_port1 as dfp[0].typec_port
device generic 0 on end
end
end
device ref tcss_dma1 off end
device ref cnvi_wifi on
chip drivers/wifi/generic
register "wake" = "GPE0_PME_B0"
device generic 0 on end
end
end
device ref i2c0 on
chip drivers/i2c/generic
register "hid" = ""10EC5650""
register "name" = ""RT58""
register "desc" = ""Realtek RT5650""
register "irq_gpio" = "ACPI_GPIO_IRQ_EDGE_BOTH(GPP_A23)"
register "property_count" = "1"
register "property_list[0].type" = "ACPI_DP_TYPE_INTEGER"
register "property_list[0].name" = ""realtek,jd-mode""
register "property_list[0].integer" = "2"
device i2c 1a on end
end
end # I2C0
device ref i2c1 on
chip drivers/i2c/tpm
register "hid" = ""GOOG0005""
register "irq" = "ACPI_IRQ_EDGE_LOW(GPP_A13_IRQ)"
device i2c 50 on end
end
end # I2C1
device ref pcie_rp7 on
chip drivers/net
register "wake" = "GPE0_DW0_07"
register "customized_leds" = "0x060f"
register "enable_aspm_l1_2" = "1"
register "add_acpi_dma_property" = "true"
device pci 00.0 on end
end
end # RTL8111 Ethernet NIC
device ref pcie_rp8 off end # disable SD reader
device ref gspi1 off end
device ref pch_espi on
chip ec/google/chromeec
use conn0 as mux_conn[0]
device pnp 0c09.0 on end
end
end
device ref pmc hidden
chip drivers/intel/pmc_mux
device generic 0 on
chip drivers/intel/pmc_mux/conn
use usb2_port1 as usb2_port
use tcss_usb3_port1 as usb3_port
device generic 0 alias conn0 on end
end
end
end
end
device ref tcss_xhci on
chip drivers/usb/acpi
device ref tcss_root_hub on
chip drivers/usb/acpi
register "desc" = ""USB3 Type-C Port C0 (MLB)""
register "type" = "UPC_TYPE_C_USB2_SS_SWITCH"
register "use_custom_pld" = "true"
register "custom_pld" = "ACPI_PLD_TYPE_C(FRONT, LEFT, ACPI_PLD_GROUP(1, 1))"
device ref tcss_usb3_port1 on end
end
end
end
end
device ref xhci on
chip drivers/usb/acpi
device ref xhci_root_hub on
chip drivers/usb/acpi
register "desc" = ""USB2 Type-C Port C0 (MLB)""
register "type" = "UPC_TYPE_C_USB2_SS_SWITCH"
register "use_custom_pld" = "true"
register "custom_pld" = "ACPI_PLD_TYPE_C(FRONT, LEFT, ACPI_PLD_GROUP(1, 1))"
device ref usb2_port1 on end
end
chip drivers/usb/acpi
register "desc" = ""USB2 Type-A Port A3 (MLB)""
register "type" = "UPC_TYPE_A"
register "use_custom_pld" = "true"
register "custom_pld" = "ACPI_PLD_TYPE_A(FRONT, LEFT, ACPI_PLD_GROUP(2, 1))"
register "custom_pld.vertical_position" = "PLD_VERTICAL_POSITION_UPPER"
device ref usb2_port2 on end
end
chip drivers/usb/acpi
register "desc" = ""USB2 Type-A Port A2 (MLB)""
register "type" = "UPC_TYPE_A"
register "use_custom_pld" = "true"
register "custom_pld" = "ACPI_PLD_TYPE_A(FRONT, LEFT, ACPI_PLD_GROUP(3, 1))"
register "custom_pld.vertical_position" = "PLD_VERTICAL_POSITION_LOWER"
device ref usb2_port3 on end
end
chip drivers/usb/acpi
register "desc" = ""USB2 OPS interface TX25A""
register "type" = "UPC_TYPE_A"
register "use_custom_pld" = "true"
register "custom_pld" = "ACPI_PLD_TYPE_A(BACK, CENTER, ACPI_PLD_GROUP(4, 1))"
device ref usb2_port4 on end
end
chip drivers/usb/acpi
register "desc" = ""USB2 OPS interface TX25A""
register "type" = "UPC_TYPE_A"
register "use_custom_pld" = "true"
register "custom_pld" = "ACPI_PLD_TYPE_A(BACK, CENTER, ACPI_PLD_GROUP(5, 1))"
device ref usb2_port5 on end
end
chip drivers/usb/acpi
register "desc" = ""USB2 OPS interface TX25A""
register "type" = "UPC_TYPE_A"
register "use_custom_pld" = "true"
register "custom_pld" = "ACPI_PLD_TYPE_A(BACK, CENTER, ACPI_PLD_GROUP(6, 1))"
device ref usb2_port6 on end
end
chip drivers/usb/acpi
register "desc" = ""USB2 Type-A Port A1 (MLB)""
register "type" = "UPC_TYPE_A"
register "use_custom_pld" = "true"
register "custom_pld" = "ACPI_PLD_TYPE_A(FRONT, RIGHT, ACPI_PLD_GROUP(7, 1))"
register "custom_pld.vertical_position" = "PLD_VERTICAL_POSITION_UPPER"
device ref usb2_port8 on end
end
chip drivers/usb/acpi
register "desc" = ""USB2 Type-A Port A0 (MLB)""
register "type" = "UPC_TYPE_A"
register "use_custom_pld" = "true"
register "custom_pld" = "ACPI_PLD_TYPE_A(FRONT, RIGHT, ACPI_PLD_GROUP(8, 1))"
register "custom_pld.vertical_position" = "PLD_VERTICAL_POSITION_LOWER"
device ref usb2_port9 on end
end
chip drivers/usb/acpi
register "desc" = ""USB2 Bluetooth""
register "type" = "UPC_TYPE_INTERNAL"
register "reset_gpio" =
"ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_D4)"
device ref usb2_port10 on end
end
chip drivers/usb/acpi
register "desc" = ""USB3 Type-A Port A0 (MLB)""
register "type" = "UPC_TYPE_USB3_A"
register "use_custom_pld" = "true"
register "custom_pld" = "ACPI_PLD_TYPE_A(FRONT, RIGHT, ACPI_PLD_GROUP(8, 1))"
register "custom_pld.vertical_position" = "PLD_VERTICAL_POSITION_LOWER"
device ref usb3_port1 on end
end
chip drivers/usb/acpi
register "desc" = ""USB3 Type-A Port A1 (MLB)""
register "type" = "UPC_TYPE_USB3_A"
register "use_custom_pld" = "true"
register "custom_pld" = "ACPI_PLD_TYPE_A(FRONT, RIGHT, ACPI_PLD_GROUP(7, 1))"
register "custom_pld.vertical_position" = "PLD_VERTICAL_POSITION_UPPER"
device ref usb3_port2 on end
end
chip drivers/usb/acpi
register "desc" = ""USB3 OPS interface TX25A""
register "type" = "UPC_TYPE_USB3_A"
register "use_custom_pld" = "true"
register "custom_pld" = "ACPI_PLD_TYPE_A(BACK, CENTER, ACPI_PLD_GROUP(4, 1))"
device ref usb3_port4 on end
end
end
end
end
end
end

View File

@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
bootblock-y += gpio.c
romstage-y += memory.c
romstage-y += gpio.c
ramstage-y += gpio.c

View File

@@ -0,0 +1,105 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <baseboard/gpio.h>
#include <baseboard/variants.h>
#include <gpio.h>
static const struct mb_cfg baseboard_memcfg = {
.type = MEM_TYPE_LP4X,
.rcomp = {
/* Baseboard uses only 100ohm Rcomp resistors */
.resistor = 100,
/* Baseboard Rcomp target values */
.targets = {40, 30, 30, 30, 30},
},
/* DQ byte map as per doc #573387 */
.lpx_dq_map = {
.ddr0 = {
.dq0 = { 3, 0, 2, 1, 4, 6, 5, 7, },
.dq1 = { 12, 13, 14, 15, 8, 9, 10, 11, },
},
.ddr1 = {
.dq0 = { 13, 14, 11, 12, 10, 8, 15, 9, },
.dq1 = { 5, 2, 4, 3, 1, 6, 0, 7, },
},
.ddr2 = {
.dq0 = { 2, 3, 1, 0, 7, 6, 5, 4, },
.dq1 = { 12, 13, 14, 15, 8, 9, 10, 11, },
},
.ddr3 = {
.dq0 = { 13, 14, 12, 15, 11, 9, 8, 10, },
.dq1 = { 5, 2, 1, 4, 7, 0, 3, 6, },
},
.ddr4 = {
.dq0 = { 11, 10, 8, 9, 14, 15, 13, 12, },
.dq1 = { 3, 0, 2, 1, 5, 4, 6, 7, },
},
.ddr5 = {
.dq0 = { 11, 15, 13, 12, 10, 9, 14, 8, },
.dq1 = { 3, 0, 2, 1, 6, 7, 5, 4, },
},
.ddr6 = {
.dq0 = { 11, 13, 10, 12, 15, 9, 14, 8, },
.dq1 = { 4, 3, 5, 2, 7, 0, 1, 6, },
},
.ddr7 = {
.dq0 = { 12, 13, 15, 14, 11, 9, 10, 8, },
.dq1 = { 4, 5, 1, 2, 6, 3, 0, 7, },
},
},
/* DQS CPU<>DRAM map as per doc #573387 */
.lpx_dqs_map = {
.ddr0 = { .dqs0 = 0, .dqs1 = 1 },
.ddr1 = { .dqs0 = 1, .dqs1 = 0 },
.ddr2 = { .dqs0 = 0, .dqs1 = 1 },
.ddr3 = { .dqs0 = 1, .dqs1 = 0 },
.ddr4 = { .dqs0 = 1, .dqs1 = 0 },
.ddr5 = { .dqs0 = 1, .dqs1 = 0 },
.ddr6 = { .dqs0 = 1, .dqs1 = 0 },
.ddr7 = { .dqs0 = 1, .dqs1 = 0 },
},
.LpDdrDqDqsReTraining = 1,
.ect = 1, /* Enable Early Command Training */
};
const struct mb_cfg *variant_memory_params(void)
{
return &baseboard_memcfg;
}
int variant_memory_sku(void)
{
/*
* Memory configuration board straps
* GPIO_MEM_CONFIG_0 GPP_F16
* GPIO_MEM_CONFIG_1 GPP_F12
* GPIO_MEM_CONFIG_2 GPP_F13
* GPIO_MEM_CONFIG_3 GPP_F15
*/
gpio_t spd_gpios[] = {
GPP_F16,
GPP_F12,
GPP_F13,
GPP_F15,
};
return gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios));
}
bool variant_is_half_populated(void)
{
/* GPIO_MEM_CH_SEL GPP_F11 */
return gpio_get(GPP_F11);
}
void variant_get_spd_info(struct mem_spd *spd_info)
{
spd_info->topo = MEM_TOPO_MEMORY_DOWN;
spd_info->cbfs_index = variant_memory_sku();
}

View File

@@ -1,8 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# This is an auto-generated file. Do not edit!!
# Generated by:
# util/spd_tools/bin/part_id_gen CZN lp4x src/mainboard/google/brya/variants/nova/memory src/mainboard/google/brya/variants/nova/memory/mem_parts_used.txt
# util/spd_tools/bin/part_id_gen ADL lp4x src/mainboard/google/brya/variants/nova/memory src/mainboard/google/brya/variants/nova/memory/mem_parts_used.txt
SPD_SOURCES =
SPD_SOURCES += spd/lp4x/set-1/spd-1.hex # ID = 0(0b0000) Parts = K4U6E3S4AB-MGCL, H9HCNNNBKMMLXR-NEE
SPD_SOURCES += spd/lp4x/set-1/spd-3.hex # ID = 1(0b0001) Parts = MT53E1G32D2NP-046 WT:B, K4UBE3D4AB-MGCL
SPD_SOURCES += spd/lp4x/set-0/spd-1.hex # ID = 0(0b0000) Parts = K4U6E3S4AB-MGCL, H9HCNNNBKMMLXR-NEE

View File

@@ -1,10 +1,8 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# This is an auto-generated file. Do not edit!!
# Generated by:
# util/spd_tools/bin/part_id_gen CZN lp4x src/mainboard/google/brya/variants/nova/memory src/mainboard/google/brya/variants/nova/memory/mem_parts_used.txt
# util/spd_tools/bin/part_id_gen ADL lp4x src/mainboard/google/brya/variants/nova/memory src/mainboard/google/brya/variants/nova/memory/mem_parts_used.txt
DRAM Part Name ID to assign
K4U6E3S4AB-MGCL 0 (0000)
H9HCNNNBKMMLXR-NEE 0 (0000)
MT53E1G32D2NP-046 WT:B 1 (0001)
K4UBE3D4AB-MGCL 1 (0001)

View File

@@ -1,4 +1,2 @@
K4U6E3S4AB-MGCL
H9HCNNNBKMMLXR-NEE
MT53E1G32D2NP-046 WT:B
K4UBE3D4AB-MGCL

View File

@@ -178,13 +178,6 @@ chip soc/intel/alderlake
.flags = PCIE_RP_LTR | PCIE_RP_AER,
}"
end
device ref tcss_dma0 on
chip drivers/intel/usb4/retimer
register "dfp[0].power_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_E4)"
use tcss_usb3_port1 as dfp[0].typec_port
device generic 0 on end
end
end
device ref cnvi_wifi on
chip drivers/wifi/generic
register "wake" = "GPE0_PME_B0"

View File

@@ -0,0 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef __VARIANT_EC_H__
#define __VARIANT_EC_H__
#include <baseboard/ec.h>
#endif

View File

@@ -0,0 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef VARIANT_GPIO_H
#define VARIANT_GPIO_H
#include <baseboard/gpio.h>
#endif

View File

@@ -0,0 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# This is an auto-generated file. Do not edit!!
# Add memory parts in mem_parts_used.txt and run spd_tools to regenerate.
SPD_SOURCES = placeholder

View File

@@ -0,0 +1 @@
DRAM Part Name ID to assign

View File

@@ -0,0 +1,11 @@
# This is a CSV file containing a list of memory parts used by this variant.
# One part per line with an optional fixed ID in column 2.
# Only include a fixed ID if it is required for legacy reasons!
# Generated IDs are dependent on the order of parts in this file,
# so new parts must always be added at the end of the file!
#
# Generate an updated Makefile.mk and dram_id.generated.txt by running the
# part_id_gen tool from util/spd_tools.
# See util/spd_tools/README.md for more details and instructions.
# Part Name

View File

@@ -0,0 +1,6 @@
chip soc/intel/alderlake
device domain 0 on
end
end

View File

@@ -133,6 +133,15 @@ chip soc/intel/jasperlake
probe DB_PORTS DB_PORTS_1C_LTE
end
end
chip drivers/usb/acpi
register "desc" = ""Right Type-C Port""
register "type" = "UPC_TYPE_C_USB2_SS_SWITCH"
register "group" = "ACPI_PLD_GROUP(2, 1)"
device usb 2.1 on
probe DB_PORTS DB_PORTS_1C_1A
probe DB_PORTS DB_PORTS_1C_LTE
end
end
chip drivers/usb/acpi
register "desc" = ""Right Type-A Port""
register "type" = "UPC_TYPE_A"
@@ -151,6 +160,15 @@ chip soc/intel/jasperlake
register "type" = "UPC_TYPE_INTERNAL"
device usb 2.6 on end
end
chip drivers/usb/acpi
register "desc" = ""Right Type-C Port""
register "type" = "UPC_TYPE_C_USB2_SS_SWITCH"
register "group" = "ACPI_PLD_GROUP(2, 1)"
device usb 3.1 on
probe DB_PORTS DB_PORTS_1C_1A
probe DB_PORTS DB_PORTS_1C_LTE
end
end
chip drivers/usb/acpi
register "desc" = ""LTE""
register "type" = "UPC_TYPE_INTERNAL"

View File

@@ -11,7 +11,23 @@ static void ext_vr_update(void)
cfg->disable_external_bypass_vr = 1;
}
static void usb_port_update(void)
{
struct soc_intel_jasperlake_config *cfg = config_of_soc();
if (fw_config_is_provisioned() &&
fw_config_probe(FW_CONFIG(DB_PORTS, DB_PORTS_NONE))) {
/* Disable USB C1 port */
cfg->usb2_ports[1].enable = 0;
cfg->usb3_ports[1].enable = 0;
/* Disable USB A1 port */
cfg->usb2_ports[3].enable = 0;
cfg->usb3_ports[3].enable = 0;
}
}
void variant_devtree_update(void)
{
ext_vr_update();
usb_port_update();
}

View File

@@ -24,6 +24,9 @@ int variant_memory_sku(void);
bool variant_is_half_populated(void);
void variant_update_soc_chip_config(struct soc_intel_meteorlake_config *config);
/* Get soc power limit config struct for current CPU sku */
struct soc_power_limits_config *variant_get_soc_power_limit_config(void);
enum s0ix_entry {
S0IX_EXIT,
S0IX_ENTRY,

View File

@@ -86,6 +86,7 @@ chip soc/intel/meteorlake
device domain 0 on
device ref igpu on end
device ref dtt on end
device ref vpu on end
device ref ioe_shared_sram on end
device ref xhci on end
device ref pmc_shared_sram on end

View File

@@ -1,8 +1,35 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <baseboard/variants.h>
#include <console/console.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
#include <intelblocks/power_limit.h>
#include <soc/pci_devs.h>
struct soc_power_limits_config *variant_get_soc_power_limit_config(void)
{
config_t *config = config_of_soc();
uint16_t mchid = pci_s_read_config16(PCI_DEV(0, 0, 0), PCI_DEVICE_ID);
u8 tdp = get_cpu_tdp();
size_t i = 0;
if (mchid == 0xffff)
return NULL;
for (i = 0; i < ARRAY_SIZE(cpuid_to_mtl); i++) {
if (mchid == cpuid_to_mtl[i].cpu_id && tdp == cpuid_to_mtl[i].cpu_tdp) {
return &config->power_limits_config[cpuid_to_mtl[i].limits];
}
}
if (i == ARRAY_SIZE(cpuid_to_mtl)) {
printk(BIOS_ERR, "Cannot find correct ovis sku index.\n");
return NULL;
}
return NULL;
}
/*
* SKU_ID, TDP (Watts), pl1_min (milliWatts), pl1_max (milliWatts),

View File

@@ -97,6 +97,7 @@ chip soc/intel/meteorlake
device domain 0 on
device ref igpu on end
device ref dtt on end
device ref vpu on end
device ref ioe_shared_sram on end
device ref xhci on end
device ref pmc_shared_sram on end

View File

@@ -34,10 +34,6 @@ fw_config
option DISABLE 0
option ENABLE 1
end
field VPU 22
option VPU_DIS 0
option VPU_EN 1
end
end
chip soc/intel/meteorlake
@@ -585,8 +581,5 @@ chip soc/intel/meteorlake
end
end
device ref hda on end
device ref vpu on
probe VPU VPU_EN
end
end
end

View File

@@ -52,10 +52,6 @@ fw_config
option ISH_DISABLE 0
option ISH_ENABLE 1
end
field VPU 22
option VPU_DIS 0
option VPU_EN 1
end
end
chip soc/intel/meteorlake
@@ -323,9 +319,6 @@ chip soc/intel/meteorlake
end
device ref tbt_pcie_rp0 on end
device ref tbt_pcie_rp2 on end
device ref vpu on
probe VPU VPU_EN
end
device ref tcss_xhci on
chip drivers/usb/acpi
device ref tcss_root_hub on

View File

@@ -30,10 +30,6 @@ fw_config
option WIFI_SAR_ID_0 0
option WIFI_SAR_ID_1 1
end
field VPU 22
option VPU_DIS 0
option VPU_EN 1
end
end
chip soc/intel/meteorlake
@@ -602,8 +598,5 @@ chip soc/intel/meteorlake
end
end
end
device ref vpu on
probe VPU VPU_EN
end
end
end

View File

@@ -0,0 +1,37 @@
## SPDX-License-Identifier: GPL-2.0-only
if BOARD_INTEL_AVENUECITY_CRB
config BOARD_SPECIFIC_OPTIONS
def_bool y
select BOARD_ROMSIZE_KB_65536
select SOC_INTEL_GRANITERAPIDS
select SUPERIO_ASPEED_AST2400
select HAVE_ACPI_TABLES
select IPMI_KCS
select IPMI_KCS_ROMSTAGE
select VPD
select OCP_VPD
select MEMORY_MAPPED_TPM
config CARDBUS_PLUGIN_SUPPORT
bool
default n
config MAINBOARD_DIR
string
default "intel/avenuecity_crb"
config MAINBOARD_PART_NUMBER
string
default "Avenue City CRB"
config FMDFILE
string
default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/board.fmd"
config DIMM_MAX
int
default 1
endif

View File

@@ -0,0 +1,4 @@
## SPDX-License-Identifier: GPL-2.0-only
config BOARD_INTEL_AVENUECITY_CRB
bool "Avenue City CRB"

View File

@@ -0,0 +1,6 @@
## SPDX-License-Identifier: GPL-2.0-only
bootblock-y += bootblock.c
romstage-y += romstage.c
romstage-y += config/iio.c
ramstage-y += ramstage.c

View File

@@ -0,0 +1,12 @@
FLASH@0xfc000000 64M {
SI_ALL 48M {
SI_DESC@0x0 0x1000
}
SI_BIOS 16M {
RW_MRC_CACHE 0x10000
FMAP 0x800
RW_VPD(PRESERVE) 0x4000
RO_VPD(PRESERVE) 0x4000
COREBOOT(CBFS)
}
}

View File

@@ -0,0 +1,6 @@
Vendor name: Intel
Board name: Avenue City CRB
Category: eval
ROM protocol: SPI
ROM socketed: y
Flashrom support: y

View File

@@ -0,0 +1,24 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <bootblock_common.h>
#include <console/console.h>
#include <intelblocks/lpc_lib.h>
#include <soc/intel/common/block/lpc/lpc_def.h>
#include <superio/aspeed/ast2400/ast2400.h>
#include <superio/aspeed/common/aspeed.h>
#define ASPEED_SIO_PORT 0x2E
void bootblock_mainboard_early_init(void)
{
/* Enable eSPI decoding for com1 (0x3f8), com2 (02f8) and superio (0x2e) */
lpc_io_setup_comm_a_b();
lpc_enable_fixed_io_ranges(LPC_IOE_SUPERIO_2E_2F);
if (CONFIG_UART_FOR_CONSOLE == 0) {
/* Setup superio com1 */
const pnp_devfn_t serial_dev = PNP_DEV(ASPEED_SIO_PORT, AST2400_SUART1);
aspeed_enable_serial(serial_dev, CONFIG_TTYS0_BASE);
} else
die("COMs other than COM1 not supported\n");
}

View File

@@ -0,0 +1,29 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <soc/iio.h>
static const struct iio_pe_config iio_config_table[] = {
/*
* CB_IIO_BIFURCATE_x8x2x2x2x2 is first set to indicate how the IIO is bifurcated
* then port settings are listed accordingly. The minimal port elements are x2.
* If an x8 port is enabled, the neighboring 3 x2 port elements needs to be
* disabled.
*/
{_IIO_PE_CFG_STRUCT(0x0, PE0, CB_IIO_BIFURCATE_x8x2x2x2x2, PE_TYPE_PCIE) {
/* _IIO_PORT_CFG_STRUCT_BASIC(sltpls, sltplv, psn) */
_IIO_PORT_CFG_STRUCT_BASIC_X8(0x0, 0x4B, 0x1),
_IIO_PORT_CFG_STRUCT_DISABLED,
_IIO_PORT_CFG_STRUCT_DISABLED,
_IIO_PORT_CFG_STRUCT_DISABLED,
_IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0x2),
_IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0x3),
_IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0x4),
_IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0x5),
}},
};
const struct iio_pe_config *get_iio_config_table(int *size)
{
*size = ARRAY_SIZE(iio_config_table);
return iio_config_table;
}

View File

@@ -0,0 +1,37 @@
## SPDX-License-Identifier: GPL-2.0-or-later
chip soc/intel/xeon_sp/gnr
# configure LPC generic IO decode ranges
# [bits 31..24: reserved]
# [bits 23..18: io decode address mask <7..2>]
# [bits 17..16: reserved]
# [bits 15..2 : io decode dword aligned address <15..2>]
# [bit 1 : reserved]
# [bit 0 : enabled]
register "gen1_dec" = "0x00000CA1" # IPMI KCS
# configure FSP debug settings
register "serial_io_uart_debug_io_base" = CONFIG_TTYS0_BASE
device domain 0 on
device pci 1f.0 on
chip superio/common
device pnp 2e.0 on
chip superio/aspeed/ast2400
register "use_espi" = "1"
device pnp 2e.2 on # SUART1
io 0x60 = 0x3f8 # PNP_IDX_IO0
irq 0x70 = 4 # PNP_IDX_IRQ0
end
end
end
end
chip drivers/ipmi
device pnp ca2.0 on end # BMC KCS
register "wait_for_bmc" = "1"
register "bmc_boot_timeout" = "60"
end
end
end
end

View File

@@ -0,0 +1,21 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <acpi/acpi.h>
DefinitionBlock(
"dsdt.aml",
"DSDT",
ACPI_DSDT_REV_2,
OEM_ID,
ACPI_TABLE_CREATOR,
0x20110725
)
{
#include <acpi/dsdt_top.asl>
#include <soc/intel/common/block/acpi/acpi/globalnvs.asl>
#include <soc/intel/xeon_sp/gnr/acpi/gpe.asl>
#include <southbridge/intel/common/acpi/sleepstates.asl>
#include <commonlib/include/commonlib/console/post_codes.h>
#include <arch/x86/acpi/post.asl>
#include <arch/x86/acpi/debug.asl>
}

View File

@@ -0,0 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <soc/ramstage.h>
void mainboard_silicon_init_params(FSPS_UPD *params)
{
}

View File

@@ -0,0 +1,49 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <console/console.h>
#include <drivers/ipmi/ipmi_if.h>
#include <drivers/ocp/include/vpd.h>
#include <drivers/vpd/vpd.h>
#include <fmap_config.h>
#include <device/device.h>
#include <soc/ddr.h>
#include <soc/iio.h>
#include <soc/romstage.h>
#include <string.h>
#include "chip.h"
void mainboard_memory_init_params(FSPM_UPD *mupd)
{
FSP_M_CONFIG *m_cfg = &mupd->FspmConfig;
/* FSP log outputs */
const config_t *config = config_of_soc();
m_cfg->SerialIoUartDebugIoBase = config->serial_io_uart_debug_io_base;
m_cfg->SerialIoUartDebugEnable = get_bool_from_vpd(FSP_LOG, FSP_LOG_DEFAULT);
m_cfg->DebugPrintLevel = config->debug_print_level;
m_cfg->serialDebugMsgLvl = get_int_from_vpd_range(FSP_MEM_LOG_LEVEL,
FSP_MEM_LOG_LEVEL_DEFAULT, 0, 4);
/* Early connect BMC, e.g. to query configuration parameters */
if (ipmi_premem_init(CONFIG_BMC_KCS_BASE, 0) == CB_SUCCESS)
printk(BIOS_INFO, "IPMI at 0x%04x initialized successfully\n",
CONFIG_BMC_KCS_BASE);
/* Set BIOS regeion UPD, otherwise MTRR might set incorrectly during TempRamExit API */
m_cfg->BiosRegionBase = FMAP_SECTION_SI_BIOS_START;
m_cfg->BiosRegionSize = FMAP_SECTION_SI_BIOS_SIZE;
printk(BIOS_INFO, "BiosRegionBase is set to %x\n", mupd->FspmConfig.BiosRegionBase);
printk(BIOS_INFO, "BiosRegionSize is set to %x\n", mupd->FspmConfig.BiosRegionSize);
/* IIO init */
int size;
const struct iio_pe_config *iio_config_table = get_iio_config_table(&size);
soc_config_iio_pe_ports(mupd, iio_config_table, size);
}
bool mainboard_dimm_slot_exists(uint8_t socket, uint8_t channel, uint8_t dimm)
{
//TODO: not implemented yet
return false;
}

View File

@@ -0,0 +1,37 @@
## SPDX-License-Identifier: GPL-2.0-only
if BOARD_INTEL_BEECHNUTCITY_CRB
config BOARD_SPECIFIC_OPTIONS
def_bool y
select BOARD_ROMSIZE_KB_65536
select SOC_INTEL_GRANITERAPIDS
select SUPERIO_ASPEED_AST2400
select HAVE_ACPI_TABLES
select IPMI_KCS
select IPMI_KCS_ROMSTAGE
select VPD
select OCP_VPD
select MEMORY_MAPPED_TPM
config CARDBUS_PLUGIN_SUPPORT
bool
default n
config MAINBOARD_DIR
string
default "intel/beechnutcity_crb"
config MAINBOARD_PART_NUMBER
string
default "Beechnut City CRB"
config FMDFILE
string
default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/board.fmd"
config DIMM_MAX
int
default 1
endif

View File

@@ -0,0 +1,4 @@
## SPDX-License-Identifier: GPL-2.0-only
config BOARD_INTEL_BEECHNUTCITY_CRB
bool "Beechnut City CRB"

View File

@@ -0,0 +1,6 @@
## SPDX-License-Identifier: GPL-2.0-only
bootblock-y += bootblock.c
romstage-y += romstage.c
romstage-y += config/iio.c
ramstage-y += ramstage.c

View File

@@ -0,0 +1,12 @@
FLASH@0xfc000000 64M {
SI_ALL 48M {
SI_DESC@0x0 0x1000
}
SI_BIOS 16M {
RW_MRC_CACHE 0x10000
FMAP 0x800
RW_VPD(PRESERVE) 0x4000
RO_VPD(PRESERVE) 0x4000
COREBOOT(CBFS)
}
}

View File

@@ -0,0 +1,6 @@
Vendor name: Intel
Board name: Beechnut City CRB
Category: eval
ROM protocol: SPI
ROM socketed: y
Flashrom support: y

View File

@@ -0,0 +1,24 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <bootblock_common.h>
#include <console/console.h>
#include <intelblocks/lpc_lib.h>
#include <soc/intel/common/block/lpc/lpc_def.h>
#include <superio/aspeed/ast2400/ast2400.h>
#include <superio/aspeed/common/aspeed.h>
#define ASPEED_SIO_PORT 0x2E
void bootblock_mainboard_early_init(void)
{
/* Enable eSPI decoding for com1 (0x3f8), com2 (02f8) and superio (0x2e) */
lpc_io_setup_comm_a_b();
lpc_enable_fixed_io_ranges(LPC_IOE_SUPERIO_2E_2F);
if (CONFIG_UART_FOR_CONSOLE == 0) {
/* Setup superio com1 */
const pnp_devfn_t serial_dev = PNP_DEV(ASPEED_SIO_PORT, AST2400_SUART1);
aspeed_enable_serial(serial_dev, CONFIG_TTYS0_BASE);
} else
die("COMs other than COM1 not supported\n");
}

View File

@@ -0,0 +1,29 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <soc/iio.h>
static const struct iio_pe_config iio_config_table[] = {
/*
* CB_IIO_BIFURCATE_x8x2x2x2x2 is first set to indicate how the IIO is bifurcated
* then port settings are listed accordingly. The minimal port elements are x2.
* If an x8 port is enabled, the neighboring 3 x2 port elements needs to be
* disabled.
*/
{_IIO_PE_CFG_STRUCT(0x0, PE0, CB_IIO_BIFURCATE_x8x2x2x2x2, PE_TYPE_PCIE) {
/* _IIO_PORT_CFG_STRUCT_BASIC(sltpls, sltplv, psn) */
_IIO_PORT_CFG_STRUCT_BASIC_X8(0x0, 0x4B, 0x1),
_IIO_PORT_CFG_STRUCT_DISABLED,
_IIO_PORT_CFG_STRUCT_DISABLED,
_IIO_PORT_CFG_STRUCT_DISABLED,
_IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0x2),
_IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0x3),
_IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0x4),
_IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0x5),
}},
};
const struct iio_pe_config *get_iio_config_table(int *size)
{
*size = ARRAY_SIZE(iio_config_table);
return iio_config_table;
}

View File

@@ -0,0 +1,37 @@
## SPDX-License-Identifier: GPL-2.0-or-later
chip soc/intel/xeon_sp/gnr
# configure LPC generic IO decode ranges
# [bits 31..24: reserved]
# [bits 23..18: io decode address mask <7..2>]
# [bits 17..16: reserved]
# [bits 15..2 : io decode dword aligned address <15..2>]
# [bit 1 : reserved]
# [bit 0 : enabled]
register "gen1_dec" = "0x00000CA1" # IPMI KCS
# configure FSP debug settings
register "serial_io_uart_debug_io_base" = CONFIG_TTYS0_BASE
device domain 0 on
device pci 1f.0 on
chip superio/common
device pnp 2e.0 on
chip superio/aspeed/ast2400
register "use_espi" = "1"
device pnp 2e.2 on # SUART1
io 0x60 = 0x3f8 # PNP_IDX_IO0
irq 0x70 = 4 # PNP_IDX_IRQ0
end
end
end
end
chip drivers/ipmi
device pnp ca2.0 on end # BMC KCS
register "wait_for_bmc" = "1"
register "bmc_boot_timeout" = "60"
end
end
end
end

View File

@@ -0,0 +1,21 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <acpi/acpi.h>
DefinitionBlock(
"dsdt.aml",
"DSDT",
ACPI_DSDT_REV_2,
OEM_ID,
ACPI_TABLE_CREATOR,
0x20110725
)
{
#include <acpi/dsdt_top.asl>
#include <soc/intel/common/block/acpi/acpi/globalnvs.asl>
#include <soc/intel/xeon_sp/gnr/acpi/gpe.asl>
#include <southbridge/intel/common/acpi/sleepstates.asl>
#include <commonlib/include/commonlib/console/post_codes.h>
#include <arch/x86/acpi/post.asl>
#include <arch/x86/acpi/debug.asl>
}

View File

@@ -0,0 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <soc/ramstage.h>
void mainboard_silicon_init_params(FSPS_UPD *params)
{
}

View File

@@ -0,0 +1,49 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <console/console.h>
#include <drivers/ipmi/ipmi_if.h>
#include <drivers/ocp/include/vpd.h>
#include <drivers/vpd/vpd.h>
#include <fmap_config.h>
#include <device/device.h>
#include <soc/ddr.h>
#include <soc/iio.h>
#include <soc/romstage.h>
#include <string.h>
#include "chip.h"
void mainboard_memory_init_params(FSPM_UPD *mupd)
{
FSP_M_CONFIG *m_cfg = &mupd->FspmConfig;
/* FSP log outputs */
const config_t *config = config_of_soc();
m_cfg->SerialIoUartDebugIoBase = config->serial_io_uart_debug_io_base;
m_cfg->SerialIoUartDebugEnable = get_bool_from_vpd(FSP_LOG, FSP_LOG_DEFAULT);
m_cfg->DebugPrintLevel = config->debug_print_level;
m_cfg->serialDebugMsgLvl = get_int_from_vpd_range(FSP_MEM_LOG_LEVEL,
FSP_MEM_LOG_LEVEL_DEFAULT, 0, 4);
/* Early connect BMC, e.g. to query configuration parameters */
if (ipmi_premem_init(CONFIG_BMC_KCS_BASE, 0) == CB_SUCCESS)
printk(BIOS_INFO, "IPMI at 0x%04x initialized successfully\n",
CONFIG_BMC_KCS_BASE);
/* Set BIOS regeion UPD, otherwise MTRR might set incorrectly during TempRamExit API */
m_cfg->BiosRegionBase = FMAP_SECTION_SI_BIOS_START;
m_cfg->BiosRegionSize = FMAP_SECTION_SI_BIOS_SIZE;
printk(BIOS_INFO, "BiosRegionBase is set to %x\n", mupd->FspmConfig.BiosRegionBase);
printk(BIOS_INFO, "BiosRegionSize is set to %x\n", mupd->FspmConfig.BiosRegionSize);
/* IIO init */
int size;
const struct iio_pe_config *iio_config_table = get_iio_config_table(&size);
soc_config_iio_pe_ports(mupd, iio_config_table, size);
}
bool mainboard_dimm_slot_exists(uint8_t socket, uint8_t channel, uint8_t dimm)
{
//TODO: not implemented yet
return false;
}

View File

@@ -95,15 +95,15 @@ static u32 get_port_b_vref_cfg(uint8_t pink_rear_vref)
switch (pink_rear_vref) {
default:
case 0:
return 0x411110f0; /* Disabled (Hi-Z) */
return 0; /* Disabled (Hi-Z) */
case 1:
return 0x411111f0; /* 50% of LDO out */
return 1; /* 50% of LDO out */
case 2:
return 0x411114f0; /* 80% of LDO out */
return 4; /* 80% of LDO out */
case 3:
return 0x411115f0; /* 100% of LDO out */
return 5; /* 100% of LDO out */
case 4:
return 0x411112f0; /* Ground */
return 2; /* Ground */
}
}
@@ -145,7 +145,7 @@ static void mainboard_r0x_configure_alc888(u8 *base, u32 viddid)
* persist after codec resets, a custom Realtek driver (ab)uses NID 0x12
* to restore port B Vref after resetting the codec.
*/
AZALIA_PIN_CFG(0, 0x12, port_b_vref_cfg),
AZALIA_PIN_CFG(0, 0x12, 0x411110f0 | port_b_vref_cfg << 8),
AZALIA_PIN_CFG(0, 0x19, front_mic_cfg),
AZALIA_PIN_CFG(0, 0x1b, front_panel_cfg),
0x0205000d, /* Pin 37 vrefo hidden register - used as port C vref */

View File

@@ -8,6 +8,7 @@ config BOARD_SPECIFIC_OPTIONS
select DRIVERS_GENERIC_CBFS_SERIAL
select DRIVERS_GENERIC_CBFS_UUID
select DRIVERS_I2C_HID
select DRIVERS_I2C_TAS5825M
select EC_SYSTEM76_EC
select EC_SYSTEM76_EC_DGPU
select HAVE_ACPI_RESUME

View File

@@ -10,3 +10,4 @@ romstage-y += romstage.c
ramstage-y += ramstage.c
ramstage-y += gpio.c
ramstage-y += hda_verb.c
ramstage-y += tas5825m.c

View File

@@ -219,7 +219,16 @@ chip soc/intel/cannonlake
device pci 1f.3 on # Intel HDA
register "PchHdaAudioLinkHda" = "1"
end
device pci 1f.4 on end # SMBus
device pci 1f.4 on # SMBus
chip drivers/i2c/tas5825m
register "id" = "0"
device i2c 4e on end # (8bit address: 0x9c)
end
chip drivers/i2c/tas5825m
register "id" = "1"
device i2c 4f on end # (8bit address: 0x9e)
end
end
device pci 1f.5 on end # PCH SPI
device pci 1f.6 off end # GbE
end

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <drivers/i2c/tas5825m/tas5825m.h>
#include "tas5825m-normal.c"
#include "tas5825m-sub.c"
int tas5825m_setup(struct device *dev, int id)
{
if (id == 0)
return tas5825m_setup_normal(dev);
if (id == 1)
return tas5825m_setup_sub(dev);
return -1;
}

View File

@@ -14,7 +14,7 @@ tpm_result_t tlcl_cr50_enable_nvcommits(void)
uint16_t sub_command = TPM2_CR50_SUB_CMD_NVMEM_ENABLE_COMMITS;
struct tpm2_response *response;
printk(BIOS_INFO, "Enabling cr50 nvmem commits\n");
printk(BIOS_INFO, "Enabling GSC nvmem commits\n");
response = tlcl2_process_command(TPM2_CR50_VENDOR_COMMAND, &sub_command);
@@ -37,7 +37,7 @@ tpm_result_t tlcl_cr50_enable_update(uint16_t timeout_ms,
TPM2_CR50_SUB_CMD_TURN_UPDATE_ON, timeout_ms
};
printk(BIOS_INFO, "Checking cr50 for pending updates\n");
printk(BIOS_INFO, "Checking GSC for pending updates\n");
response = tlcl2_process_command(TPM2_CR50_VENDOR_COMMAND, command_body);
@@ -53,7 +53,7 @@ tpm_result_t tlcl_cr50_get_recovery_button(uint8_t *recovery_button_state)
struct tpm2_response *response;
uint16_t sub_command = TPM2_CR50_SUB_CMD_GET_REC_BTN;
printk(BIOS_INFO, "Checking cr50 for recovery request\n");
printk(BIOS_INFO, "Checking GSC for recovery request\n");
response = tlcl2_process_command(TPM2_CR50_VENDOR_COMMAND, &sub_command);
@@ -70,7 +70,7 @@ tpm_result_t tlcl_cr50_get_tpm_mode(uint8_t *tpm_mode)
uint16_t mode_command = TPM2_CR50_SUB_CMD_TPM_MODE;
*tpm_mode = TPM_MODE_INVALID;
printk(BIOS_INFO, "Reading cr50 TPM mode\n");
printk(BIOS_INFO, "Reading GSC TPM mode\n");
response = tlcl2_process_command(TPM2_CR50_VENDOR_COMMAND, &mode_command);
@@ -110,7 +110,7 @@ tpm_result_t tlcl_cr50_get_boot_mode(uint8_t *boot_mode)
struct tpm2_response *response;
uint16_t mode_command = TPM2_CR50_SUB_CMD_GET_BOOT_MODE;
printk(BIOS_DEBUG, "Reading cr50 boot mode\n");
printk(BIOS_DEBUG, "Reading GSC boot mode\n");
response = tlcl2_process_command(TPM2_CR50_VENDOR_COMMAND, &mode_command);
@@ -140,7 +140,7 @@ tpm_result_t tlcl_cr50_immediate_reset(uint16_t timeout_ms)
/*
* Issue an immediate reset to the Cr50.
*/
printk(BIOS_INFO, "Issuing cr50 reset\n");
printk(BIOS_INFO, "Issuing GSC reset\n");
response = tlcl2_process_command(TPM2_CR50_VENDOR_COMMAND, &reset_command_body);
if (!response)

View File

@@ -109,7 +109,8 @@ if SOC_AMD_PHOENIX_BASE
config CHIPSET_DEVICETREE
string
default "soc/amd/phoenix/chipset.cb"
default "soc/amd/phoenix/chipset_fsp.cb" if SOC_AMD_PHOENIX_FSP
default "soc/amd/phoenix/chipset_opensil.cb"
config EARLY_RESERVED_DRAM_BASE
hex

View File

@@ -0,0 +1,170 @@
# TODO: Update for Phoenix
chip soc/amd/phoenix
device cpu_cluster 0 on
ops amd_cpu_bus_ops
end
device domain 0 on
ops phoenix_pci_domain_ops
device pci 00.0 alias gnb on ops phoenix_root_complex_operations end
device pci 00.2 alias iommu off ops amd_iommu_ops end
device pci 01.0 on end # Dummy device function, do not disable
# The PCIe GPP aliases in this SoC match the device and function numbers
chip vendorcode/amd/opensil/chip/mpio
device pci 01.1 alias gpp_bridge_1_1 hidden ops amd_external_pcie_gpp_ops end
end
chip vendorcode/amd/opensil/chip/mpio
device pci 01.2 alias gpp_bridge_1_2 hidden ops amd_external_pcie_gpp_ops end
end
chip vendorcode/amd/opensil/chip/mpio
device pci 01.3 alias gpp_bridge_1_3 hidden ops amd_external_pcie_gpp_ops end
end
chip vendorcode/amd/opensil/chip/mpio
device pci 01.4 alias gpp_bridge_1_4 hidden ops amd_external_pcie_gpp_ops end
end
device pci 02.0 on end # Dummy device function, do not disable
# The PCIe GPP aliases in this SoC match the device and function numbers
chip vendorcode/amd/opensil/chip/mpio
device pci 02.1 alias gpp_bridge_2_1 hidden ops amd_external_pcie_gpp_ops end
end
chip vendorcode/amd/opensil/chip/mpio
device pci 02.2 alias gpp_bridge_2_2 hidden ops amd_external_pcie_gpp_ops end
end
chip vendorcode/amd/opensil/chip/mpio
device pci 02.3 alias gpp_bridge_2_3 hidden ops amd_external_pcie_gpp_ops end
end
chip vendorcode/amd/opensil/chip/mpio
device pci 02.4 alias gpp_bridge_2_4 hidden ops amd_external_pcie_gpp_ops end
end
chip vendorcode/amd/opensil/chip/mpio
device pci 02.5 alias gpp_bridge_2_5 hidden ops amd_external_pcie_gpp_ops end
end
chip vendorcode/amd/opensil/chip/mpio
device pci 02.6 alias gpp_bridge_2_6 hidden ops amd_external_pcie_gpp_ops end
end
device pci 03.0 on end # Dummy device function, do not disable
device pci 03.1 alias usb4_pcie_bridge_0 off end
device pci 04.0 on end # Dummy device function, do not disable
device pci 04.1 alias usb4_pcie_bridge_1 off end
device pci 08.0 on end # Dummy device function, do not disable
device pci 08.1 alias gpp_bridge_a off # Internal GPP Bridge 0 to Bus A
ops amd_internal_pcie_gpp_ops
device pci 0.0 alias gfx off ops amd_graphics_ops end # Internal GPU (GFX)
device pci 0.1 alias gfx_hda off end # Display HD Audio Controller (GFXAZ)
device pci 0.2 alias crypto off end # Crypto Coprocessor
device pci 0.3 alias xhci_0 off
ops xhci_pci_ops
chip drivers/usb/acpi
register "type" = "UPC_TYPE_HUB"
device usb 0.0 alias xhci_0_root_hub off
chip drivers/usb/acpi
device usb 3.0 alias usb3_port2 off end
end
chip drivers/usb/acpi
device usb 3.1 alias usb3_port3 off end
end
chip drivers/usb/acpi
device usb 2.0 alias usb2_port2 off end
end
chip drivers/usb/acpi
device usb 2.1 alias usb2_port3 off end
end
chip drivers/usb/acpi
device usb 2.2 alias usb2_port4 off end
end
chip drivers/usb/acpi
device usb 2.3 alias usb2_port5 off end
end
chip drivers/usb/acpi
device usb 2.4 alias usb2_port6 off end
end
end
end
end
device pci 0.4 alias xhci_1 off
ops xhci_pci_ops
chip drivers/usb/acpi
register "type" = "UPC_TYPE_HUB"
device usb 0.0 alias xhci_1_root_hub off
chip drivers/usb/acpi
device usb 3.0 alias usb3_port7 off end
end
chip drivers/usb/acpi
device usb 2.0 alias usb2_port7 off end
end
end
end
end
device pci 0.5 alias acp off ops amd_acp_ops end # Audio Processor (ACP)
device pci 0.6 alias hda off end # Audio Processor HD Audio Controller (main AZ)
device pci 0.7 alias mp2 off end # Sensor Fusion Hub (MP2)
end
device pci 08.2 alias gpp_bridge_b off # Internal GPP Bridge 1 to Bus B
ops amd_internal_pcie_gpp_ops
device pci 0.0 on end # dummy, do not disable
device pci 0.1 alias ipu off end
end
device pci 08.3 alias gpp_bridge_c off # Internal GPP Bridge 2 to Bus C
ops amd_internal_pcie_gpp_ops
device pci 0.0 on end # dummy, do not disable
device pci 0.3 alias usb4_xhci_0 off
ops xhci_pci_ops
chip drivers/usb/acpi
register "type" = "UPC_TYPE_HUB"
device usb 0.0 alias usb4_xhci_0_root_hub off
chip drivers/usb/acpi
device usb 3.0 alias usb3_port0 off end
end
chip drivers/usb/acpi
device usb 2.0 alias usb2_port0 off end
end
end
end
end
device pci 0.4 alias usb4_xhci_1 off
ops xhci_pci_ops
chip drivers/usb/acpi
register "type" = "UPC_TYPE_HUB"
device usb 0.0 alias usb4_xhci_1_root_hub off
chip drivers/usb/acpi
device usb 3.0 alias usb3_port1 off end
end
chip drivers/usb/acpi
device usb 2.0 alias usb2_port1 off end
end
end
end
end
device pci 0.5 alias usb4_router_0 off end
device pci 0.6 alias usb4_router_1 off end
end
device pci 14.0 alias smbus on ops amd_smbus_ops end # primary FCH function
device pci 14.3 alias lpc_bridge on ops amd_lpc_ops end
device pci 18.0 alias data_fabric_0 on ops amd_data_fabric_ops end
device pci 18.1 alias data_fabric_1 on ops amd_data_fabric_ops end
device pci 18.2 alias data_fabric_2 on ops amd_data_fabric_ops end
device pci 18.3 alias data_fabric_3 on ops amd_data_fabric_ops end
device pci 18.4 alias data_fabric_4 on ops amd_data_fabric_ops end
device pci 18.5 alias data_fabric_5 on ops amd_data_fabric_ops end
device pci 18.6 alias data_fabric_6 on ops amd_data_fabric_ops end
device pci 18.7 alias data_fabric_7 on ops amd_data_fabric_ops end
end
device mmio 0xfedc2000 alias i2c_0 off ops soc_amd_i2c_mmio_ops end
device mmio 0xfedc3000 alias i2c_1 off ops soc_amd_i2c_mmio_ops end
device mmio 0xfedc4000 alias i2c_2 off ops soc_amd_i2c_mmio_ops end
device mmio 0xfedc5000 alias i2c_3 off ops soc_amd_i2c_mmio_ops end
device mmio 0xfedc9000 alias uart_0 off ops amd_uart_mmio_ops end
device mmio 0xfedca000 alias uart_1 off ops amd_uart_mmio_ops end
device mmio 0xfedce000 alias uart_2 off ops amd_uart_mmio_ops end
device mmio 0xfedcf000 alias uart_3 off ops amd_uart_mmio_ops end
device mmio 0xfedd1000 alias uart_4 off ops amd_uart_mmio_ops end
end

View File

@@ -515,6 +515,9 @@ struct soc_intel_meteorlake_config {
/* Platform Power Pmax in Watts. Zero means automatic. */
uint16_t psys_pmax_watts;
/* Platform Power Limit 2 in Watts. */
uint16_t psys_pl2_watts;
/* Enable or Disable Acoustic Noise Mitigation feature */
uint8_t enable_acoustic_noise_mitigation;
/* Disable Fast Slew Rate for Deep Package C States for VR domains */

View File

@@ -11,6 +11,7 @@ subdirs-y += ../../../../cpu/intel/microcode
romstage-y += romstage.c
romstage-y += soc_util.c
romstage-y += soc_iio.c
romstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c
ramstage-y += chip.c

View File

@@ -0,0 +1,153 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef _SOC_IIO_H_
#define _SOC_IIO_H_
#include <soc/soc_util.h>
#include <fsp/util.h>
#include <FspmUpd.h>
#include <IioPcieConfigUpd.h>
#define CB_IIO_BIFURCATE_xxxxxxxx IIO_BIFURCATE_xxxxxxxx
#define CB_IIO_BIFURCATE_x4x4x4x4 IIO_BIFURCATE_x4x4x4x4
#define CB_IIO_BIFURCATE_x8xxx4x4 IIO_BIFURCATE_x4x4xxx8
#define CB_IIO_BIFURCATE_x4x4x8xx IIO_BIFURCATE_xxx8x4x4
#define CB_IIO_BIFURCATE_x8xxx8xx IIO_BIFURCATE_xxx8xxx8
#define CB_IIO_BIFURCATE_x16xxxxx IIO_BIFURCATE_xxxxxx16
#define CB_IIO_BIFURCATE_x8x4x2x2 IIO_BIFURCATE_x2x2x4x8
#define CB_IIO_BIFURCATE_x8x2x2x4 IIO_BIFURCATE_x4x2x2x8
#define CB_IIO_BIFURCATE_x4x2x2x8 IIO_BIFURCATE_x8x2x2x4
#define CB_IIO_BIFURCATE_x2x2x4x8 IIO_BIFURCATE_x8x4x2x2
#define CB_IIO_BIFURCATE_x4x4x4x2x2 IIO_BIFURCATE_x2x2x4x4x4
#define CB_IIO_BIFURCATE_x4x4x2x2x4 IIO_BIFURCATE_x4x2x2x4x4
#define CB_IIO_BIFURCATE_x4x2x2x4x4 IIO_BIFURCATE_x4x4x2x2x4
#define CB_IIO_BIFURCATE_x2x2x4x4x4 IIO_BIFURCATE_x4x4x4x2x2
#define CB_IIO_BIFURCATE_x8x2x2x2x2 IIO_BIFURCATE_x2x2x2x2x8
#define CB_IIO_BIFURCATE_x2x2x2x2x8 IIO_BIFURCATE_x8x2x2x2x2
#define CB_IIO_BIFURCATE_x4x4x2x2x2x2 IIO_BIFURCATE_x2x2x2x2x4x4
#define CB_IIO_BIFURCATE_x4x2x2x4x2x2 IIO_BIFURCATE_x2x2x4x2x2x4
#define CB_IIO_BIFURCATE_x2x2x4x4x2x2 IIO_BIFURCATE_x2x2x4x4x2x2
#define CB_IIO_BIFURCATE_x4x2x2x2x2x4 IIO_BIFURCATE_x4x2x2x2x2x4
#define CB_IIO_BIFURCATE_x2x2x4x2x2x4 IIO_BIFURCATE_x4x2x2x4x2x2
#define CB_IIO_BIFURCATE_x2x2x2x2x4x4 IIO_BIFURCATE_x4x4x2x2x2x2
#define CB_IIO_BIFURCATE_x4x2x2x2x2x2x2 IIO_BIFURCATE_x2x2x2x2x2x2x4
#define CB_IIO_BIFURCATE_x2x2x4x2x2x2x2 IIO_BIFURCATE_x2x2x2x2x4x2x2
#define CB_IIO_BIFURCATE_x2x2x2x2x4x2x2 IIO_BIFURCATE_x2x2x4x2x2x2x2
#define CB_IIO_BIFURCATE_x2x2x2x2x2x2x4 IIO_BIFURCATE_x4x2x2x2x2x2x2
#define CB_IIO_BIFURCATE_x2x2x2x2x2x2x2x2 IIO_BIFURCATE_x2x2x2x2x2x2x2x2
#define CB_IIO_BIFURCATE_AUTO IIO_BIFURCATE_AUTO
struct iio_port_config {
uint8_t vpp_address; // SMBUS address of IO expander which provides VPP register
uint8_t vpp_port; // Port or bank on IoExpander which provides VPP register
uint8_t vpp_mux_address; // SMBUS address of MUX used to access VPP
uint8_t vpp_mux_channel; // Channel of the MUX used to access VPP
uint8_t slot_eip:1; // Electromechanical Interlock Present -
// Slot Capabilities (D0-10 / F0 / R0xA4 / B17)
uint8_t slot_hps:1; // Hot Plug surprise supported -
// Slot Capabilities (D0-10 / F0 / R0xA4 / B5)
uint8_t slot_pind:1; // Power Indicator Present -
// Slot Capabilities (D0-10 / F0 / R0xA4 / B4)
uint8_t slot_aind:1; // Attention Inductor Present -
// Slot Capabilities (D0-10 / F0 / R0xA4 / B3)
uint8_t slot_pctl:1; // Power Controller Present -
// Slot Capabilities (D0-10 / F0 / R0xA4 / B1)
uint8_t slot_abtn:1; // Attention Button Present -
// Slot Capabilities (D0-10 / F0 / R0xA4 / B0)
uint8_t slot_rsvd:2; // Reserved
uint8_t vpp_enabled:1; // If VPP is supported on given port
uint8_t vpp_exp_type:1; // IO Expander type used for VPP (see IIO_VPP_EXPANDER_TYPE
// for values definitions)
uint8_t slot_implemented:1;
uint8_t reserved:4;
uint16_t hot_plug:1; // If hotplug is supported on slot connected to this port
uint16_t mrl_sensor_present:1; // If MRL is present on slot connected to this port
uint16_t slot_power_limit_scale:2; // Slot Power Scale for slot connected to this port
uint16_t slot_power_limit_value:12; // Slot Power Value for slot connected to this port
uint16_t physical_slot_number; // Slot number for slot connected to this port
};
struct iio_pe_config {
uint8_t socket;
IIO_PACKAGE_PE pe;
IIO_BIFURCATION bifurcation;
uint8_t cxl_support:1;
uint8_t reserved:7;
struct iio_port_config port_config[MAX_IIO_PORTS_PER_STACK];
};
/*
* {_IIO_PE_CFG_STRUCT(socket, pe, bif, cxl) {
* _IIO_PORT_CFG_STRUCT(vppen vppex vaddr vport vmuxa vmuxc ...),
* _IIO_PORT_CFG_STRUCT(..),
* ...
* _IIO_PORT_CFG_STRUCT(..) //MAX_IIO_PORTS_PER_STACK port configs
* }}
*/
#define PE_TYPE_CXL 1
#define PE_TYPE_PCIE 0
#define _IIO_PE_CFG_STRUCT(s, p, bif, cxl) \
.socket = (s),\
.pe = (p),\
.bifurcation = (bif),\
.cxl_support = (cxl),\
.reserved = 0,\
.port_config =
/* TODO: to update rsv1 - rsv5 after SoC launch */
#define _IIO_PORT_CFG_STRUCT(vppen, vppex, vaddr, vport, vmuxa, vmuxc,\
slteip, slthps, sltpind, sltaind, sltpctl, sltabtn, hotp, mrlsp,\
sltimpl, sltpls, sltplv, psn,\
rsv1, rsv2, rsv3, rsv4, rsv5) {\
.vpp_enabled = (vppen),\
.vpp_exp_type = (vppex),\
.vpp_address = (vaddr),\
.vpp_port = (vport),\
.vpp_mux_address = (vmuxa),\
.vpp_mux_channel = (vmuxc),\
.slot_eip = (slteip),\
.slot_hps = (slthps),\
.slot_pind = (sltpind),\
.slot_aind = (sltaind),\
.slot_pctl = (sltpctl),\
.slot_abtn = (sltabtn),\
.slot_rsvd = 0,\
.slot_implemented = (sltimpl),\
.reserved = 0,\
.hot_plug = (hotp),\
.mrl_sensor_present = (mrlsp),\
.slot_power_limit_scale = (sltpls),\
.slot_power_limit_value = (sltplv),\
.physical_slot_number = (psn)\
}
#define _IIO_PORT_CFG_STRUCT_DISABLED \
_IIO_PORT_CFG_STRUCT(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,\
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
#define _IIO_PORT_CFG_STRUCT_X8 _IIO_PORT_CFG_STRUCT
#define _IIO_PORT_CFG_STRUCT_X4 _IIO_PORT_CFG_STRUCT
#define _IIO_PORT_CFG_STRUCT_X2 _IIO_PORT_CFG_STRUCT
#define _IIO_PORT_CFG_STRUCT_BASIC(sltpls, sltplv, psn)\
_IIO_PORT_CFG_STRUCT(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,\
0x0, 0x0, 0x0, 0x1, sltpls, sltplv, psn, 0x0, 0x0, 0x0, 0x0, 0x0)
#define _IIO_PORT_CFG_STRUCT_BASIC_X8 _IIO_PORT_CFG_STRUCT_BASIC
#define _IIO_PORT_CFG_STRUCT_BASIC_X4 _IIO_PORT_CFG_STRUCT_BASIC
#define _IIO_PORT_CFG_STRUCT_BASIC_X2 _IIO_PORT_CFG_STRUCT_BASIC
void soc_config_iio_pe_ports(FSPM_UPD *mupd, const struct iio_pe_config *config_table,
unsigned int num_entries);
const struct iio_pe_config *get_iio_config_table(int *size);
#endif /* _SOC_IIO_H_ */

View File

@@ -0,0 +1,66 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <soc/iio.h>
#include <string.h>
#include <fsp/util.h>
#include <IioPcieConfigUpd.h>
static IIO_BOARD_SETTINGS_HOB iio_upd_hob;
void soc_config_iio_pe_ports(FSPM_UPD *mupd, const struct iio_pe_config *config_table,
unsigned int num_entries)
{
int i;
uint8_t socket, pe, port;
const struct iio_pe_config *board_pe_config;
const struct iio_port_config *board_port_config;
IIO_BOARD_SETTINGS_PER_PE *upd_pe_config;
IIO_BOARD_SETTINGS_PER_PORT *upd_port_config;
for (i = 0; i < num_entries; i++) {
board_pe_config = &config_table[i];
socket = board_pe_config->socket;
pe = board_pe_config->pe;
upd_pe_config = &(iio_upd_hob.Socket[socket].Pe[pe]);
if ((socket >= MAX_SOCKET) || (pe >= MAX_IIO_PCIE_PER_SOCKET))
continue;
for (port = 0; port < MAX_IIO_PORTS_PER_STACK; port++) {
upd_port_config = &(upd_pe_config->Port[port]);
board_port_config = &(board_pe_config->port_config[port]);
upd_pe_config->Bifurcation = board_pe_config->bifurcation;
upd_pe_config->CxlSupportInUba = board_pe_config->cxl_support;
upd_port_config->Vpp.Address = board_port_config->vpp_address;
upd_port_config->Vpp.Port = board_port_config->vpp_port;
upd_port_config->Vpp.MuxAddress = board_port_config->vpp_mux_address;
upd_port_config->Vpp.MuxChannel = board_port_config->vpp_mux_channel;
upd_port_config->Slot.Eip = board_port_config->slot_eip;
upd_port_config->Slot.HotPlugSurprise = board_port_config->slot_hps;
upd_port_config->Slot.PowerInd = board_port_config->slot_pind;
upd_port_config->Slot.AttentionInd = board_port_config->slot_aind;
upd_port_config->Slot.PowerCtrl = board_port_config->slot_pctl;
upd_port_config->Slot.AttentionBtn = board_port_config->slot_abtn;
upd_port_config->VppEnabled = board_port_config->vpp_enabled;
upd_port_config->VppExpType = board_port_config->vpp_exp_type;
upd_port_config->SlotImplemented = board_port_config->slot_implemented;
upd_port_config->HotPlug = board_port_config->hot_plug;
upd_port_config->MrlSensorPresent = board_port_config->mrl_sensor_present;
upd_port_config->SlotPowerLimitScale = board_port_config->slot_power_limit_scale;
upd_port_config->SlotPowerLimitValue = board_port_config->slot_power_limit_value;
upd_port_config->PhysicalSlotNumber = board_port_config->physical_slot_number;
}
}
mupd->FspmConfig.IioBoardSettingsHobPtr = (UINT32)&iio_upd_hob;
mupd->FspmConfig.IioBoardSettingsHobLength = sizeof(iio_upd_hob);
}

View File

@@ -60,6 +60,7 @@ TEST_CFLAGS += -Os
endif
TEST_CFLAGS += -D__TEST__ -D__COREBOOT__
TEST_CFLAGS += -D__TEST_DATA_DIR__=\"$(testsrc)/data\"
ifneq ($(filter-out 0,$(TEST_PRINT)),)
TEST_CFLAGS += -DTEST_PRINT=1
@@ -121,7 +122,6 @@ $$($(1)-config-file): $(TEST_KCONFIG_AUTOHEADER)
$($(1)-objs): TEST_CFLAGS += -I$$(dir $$($(1)-config-file)) \
-D__$$(shell echo $$($(1)-stage) | tr '[:lower:]' '[:upper:]')__ \
-D__TEST_NAME__=\"$(subst /,_,$(1))\" \
-D__TEST_DATA_DIR__=\"$(testsrc)/data\"
# Give us a way to distinguish between coreboot source files and test files in code.
$($(1)-srcobjs): TEST_CFLAGS += -D__TEST_SRCOBJ__

Binary file not shown.

51
tests/helpers/file.c Normal file
View File

@@ -0,0 +1,51 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
/*
* Get the file size of a given file
*
* @params fname name of the file relative to the __TEST_DATA_DIR__ directory
*
* @return On success file size in bytes is returned. On failure -1 is returned.
*/
int test_get_file_size(const char *fname)
{
char path[strlen(__TEST_DATA_DIR__) + strlen(fname) + 2];
sprintf(path, "%s/%s", __TEST_DATA_DIR__, fname);
struct stat st;
if (stat(path, &st) == -1)
return -1;
return st.st_size;
}
/*
* Read a file and write its contents into a buffer
*
* @params fname name of the file relative to the __TEST_DATA_DIR__ directory
* @params buf buffer to write file contents into
* @params size size of buf
*
* @return On success number of bytes read is returned. On failure -1 is returned.
*/
int test_read_file(const char *fname, uint8_t *buf, size_t size)
{
char path[strlen(__TEST_DATA_DIR__) + strlen(fname) + 2];
sprintf(path, "%s/%s", __TEST_DATA_DIR__, fname);
int f = open(path, O_RDONLY);
if (f == -1)
return -1;
int read_size = read(f, buf, size);
close(f);
return read_size;
}

View File

@@ -0,0 +1,12 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _TESTS_HELPERS_FILE_H
#define _TESTS_HELPERS_FILE_H
#include <stddef.h>
#include <stdint.h>
int test_get_file_size(const char *fname);
int test_read_file(const char *fname, uint8_t *buf, size_t size);
#endif

View File

@@ -39,9 +39,15 @@ tests-y += cbfs-lookup-no-mcache-test
tests-y += cbfs-lookup-has-mcache-test
tests-y += lzma-test
tests-y += ux_locales-test
tests-y += device_tree-test
lib-test-srcs += tests/lib/lib-test.c
device_tree-test-srcs += tests/lib/device_tree-test.c
device_tree-test-srcs += tests/stubs/console.c
device_tree-test-srcs += src/lib/device_tree.c
device_tree-test-syssrcs += tests/helpers/file.c
string-test-srcs += tests/lib/string-test.c
string-test-srcs += src/lib/string.c
@@ -234,6 +240,7 @@ lzma-test-srcs += tests/lib/lzma-test.c
lzma-test-srcs += tests/stubs/console.c
lzma-test-srcs += src/lib/lzma.c
lzma-test-srcs += src/lib/lzmadecode.c
lzma-test-syssrcs += tests/helpers/file.c
ux_locales-test-srcs += tests/lib/ux_locales-test.c
ux_locales-test-srcs += tests/stubs/console.c

View File

@@ -0,0 +1,132 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <console/console.h>
#include <device_tree.h>
#include <helpers/file.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <tests/test.h>
static int setup_device_tree_test_group(void **state)
{
/*
* fattest FDT I could find from Linux Kernel to test the worst cases
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/nvidia/tegra30-ouya.dts?id=443b349019f2d946
*/
const char dtb_path[] = "lib/devicetree-test/tegra30-ouya.dtb";
int file_size = test_get_file_size(dtb_path);
assert_int_not_equal(file_size, -1);
void *big_fat_dtb = test_malloc(file_size);
assert_int_not_equal(big_fat_dtb, NULL);
assert_int_equal(test_read_file(dtb_path, big_fat_dtb, file_size), file_size);
*state = big_fat_dtb;
return 0;
}
static int teardown_device_tree_test_group(void **state)
{
test_free(*state);
return 0;
}
static void test_fdt_find_node_by_path(void **state)
{
uint32_t addrcp, sizecp;
assert_int_equal(0, fdt_find_node_by_path(*state, "test", &addrcp, &sizecp));
assert_int_equal(56, fdt_find_node_by_path(*state, "/", &addrcp, &sizecp));
assert_int_equal(2, addrcp);
assert_int_equal(1, sizecp);
assert_int_equal(0, fdt_find_node_by_path(*state, "/test", &addrcp, &sizecp));
assert_int_equal(0x181f4, fdt_find_node_by_path(*state, "/chosen", &addrcp, &sizecp));
assert_int_equal(1, addrcp);
assert_int_equal(1, sizecp);
assert_int_equal(0x156d4, fdt_find_node_by_path(*state, "/cpus", &addrcp, &sizecp));
assert_int_equal(1, addrcp);
assert_int_equal(1, sizecp);
assert_int_equal(0x1517c, fdt_find_node_by_path(*state, "/usb@7d004000/ethernet@2", &addrcp, &sizecp));
assert_int_equal(1, addrcp);
assert_int_equal(0, sizecp);
assert_int_equal(0x1517c, fdt_find_node_by_path(*state, "/usb@7d004000/ethernet@2/", &addrcp, &sizecp));
assert_int_equal(1, addrcp);
assert_int_equal(0, sizecp);
assert_int_equal(0xee08, fdt_find_node_by_path(*state, "/pinmux@70000868/pinmux/drive_groups",
&addrcp, &sizecp));
}
static void test_fdt_find_subnodes_by_prefix(void **state)
{
uint32_t offset = fdt_find_node_by_path(*state, "/cpus", NULL, NULL);
uint32_t results[3] = { 0 };
uint32_t addrcp, sizecp;
size_t count_results = fdt_find_subnodes_by_prefix(*state, offset, "cpu@",
&addrcp, &sizecp, results, 3);
assert_int_equal(3, count_results);
assert_int_equal(0x15700, results[0]);
assert_int_equal(0x157a0, results[1]);
assert_int_equal(0x15840, results[2]);
results[1] = 0xDEADBEEF;
results[2] = 0xDEADBEEF;
count_results = fdt_find_subnodes_by_prefix(*state, offset, "cpu@",
&addrcp, &sizecp, results, 1);
assert_int_equal(1, count_results);
assert_int_equal(0x15700, results[0]);
assert_int_equal(0xDEADBEEF, results[1]);
assert_int_equal(0xDEADBEEF, results[2]);
}
static void test_fdt_find_node_by_alias(void **state)
{
assert_int_equal(0xf298, fdt_find_node_by_alias(*state, "serial0", NULL, NULL));
assert_int_equal(0, fdt_find_node_by_alias(*state, "mmc2", NULL, NULL));
}
static void test_fdt_find_prop_in_node(void **state)
{
uintptr_t cnode_offset = fdt_find_node_by_path(*state, "/clock", NULL, NULL);
uintptr_t mnode_offset = fdt_find_node_by_path(*state, "/memory@80000000", NULL, NULL);
assert_int_equal(0x18400, cnode_offset);
struct fdt_property fdt_prop;
assert_int_equal(0x1840c, fdt_read_prop(*state, cnode_offset, "compatible", &fdt_prop));
assert_string_equal("fixed-clock", (char *)fdt_prop.data);
assert_int_equal(0x6094, fdt_read_prop(*state, mnode_offset, "reg", &fdt_prop));
assert_int_equal(0x0, fdt_read_prop(*state, cnode_offset, "notfound", &fdt_prop));
}
static void test_fdt_read_reg_prop(void **state)
{
uint32_t addrcp1, sizecp1, addrcp2, sizecp2;
uint64_t node_offset1 = fdt_find_node_by_path(*state, "/memory@80000000", &addrcp1, &sizecp1);
uint64_t node_offset2 = fdt_find_node_by_path(*state, "/reserved-memory/ramoops@bfdf0000", &addrcp2, &sizecp2);
struct device_tree_region regions[3];
regions[0].addr = 0xDEADBEEF;
regions[0].size = 0xDEADBEEF;
fdt_read_reg_prop(*state, node_offset1, addrcp1, sizecp1, regions, 0);
assert_int_equal(0xDEADBEEF, regions[0].addr);
assert_int_equal(0xDEADBEEF, regions[0].size);
fdt_read_reg_prop(*state, node_offset2, addrcp2, sizecp2, regions, 1);
assert_int_equal(0xbfdf0000, regions[0].addr);
assert_int_equal(0x00010000, regions[0].size);
}
int main(void)
{
const struct CMUnitTest tests[] = {
cmocka_unit_test(test_fdt_find_node_by_path),
cmocka_unit_test(test_fdt_find_subnodes_by_prefix),
cmocka_unit_test(test_fdt_find_node_by_alias),
cmocka_unit_test(test_fdt_find_prop_in_node),
cmocka_unit_test(test_fdt_read_reg_prop),
};
return cb_run_group_tests(tests, setup_device_tree_test_group,
teardown_device_tree_test_group);
}

View File

@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <fcntl.h>
#include <helpers/file.h>
#include <lib.h>
#include <lib/lzmadecode.h>
#include <stdlib.h>
@@ -10,7 +11,6 @@
#include <tests/test.h>
#include <unistd.h>
struct lzma_test_state {
char *raw_filename;
size_t raw_file_sz;
@@ -18,14 +18,6 @@ struct lzma_test_state {
size_t comp_file_sz;
};
static int get_file_size(const char *fname)
{
struct stat st;
if (stat(fname, &st) == -1)
return -1;
return st.st_size;
}
static int teardown_ulzman_file(void **state)
{
struct lzma_test_state *s = *state;
@@ -42,7 +34,7 @@ static int setup_ulzman_file(void **state)
{
int ret = 0;
const char *fname_base = *state;
const char path_prefix[] = __TEST_DATA_DIR__ "/lib/lzma-test/%s%s";
const char path_prefix[] = "lib/lzma-test/%s%s";
const char raw_file_suffix[] = ".bin";
const char comp_file_suffix[] = ".lzma.bin";
struct lzma_test_state *s = test_malloc(sizeof(*s));
@@ -69,8 +61,8 @@ static int setup_ulzman_file(void **state)
snprintf(s->comp_filename, comp_filename_size, path_prefix, fname_base,
comp_file_suffix);
s->raw_file_sz = get_file_size(s->raw_filename);
s->comp_file_sz = get_file_size(s->comp_filename);
s->raw_file_sz = test_get_file_size(s->raw_filename);
s->comp_file_sz = test_get_file_size(s->comp_filename);
if (s->raw_file_sz == -1) {
print_error("Unable to open file: %s\n", s->raw_filename);
@@ -91,20 +83,6 @@ error:
return ret;
}
static int read_file(const char *fname, uint8_t *buf, size_t sz)
{
int f = open(fname, O_RDONLY);
int read_sz = 0;
if (f == -1)
return -1;
read_sz = read(f, buf, sz);
close(f);
return read_sz;
}
static void test_ulzman_correct_file(void **state)
{
struct lzma_test_state *s = *state;
@@ -115,9 +93,10 @@ static void test_ulzman_correct_file(void **state)
assert_non_null(raw_buf);
assert_non_null(decomp_buf);
assert_non_null(comp_buf);
assert_int_equal(s->raw_file_sz, read_file(s->raw_filename, raw_buf, s->raw_file_sz));
assert_int_equal(s->raw_file_sz,
test_read_file(s->raw_filename, raw_buf, s->raw_file_sz));
assert_int_equal(s->comp_file_sz,
read_file(s->comp_filename, comp_buf, s->comp_file_sz));
test_read_file(s->comp_filename, comp_buf, s->comp_file_sz));
assert_int_equal(s->raw_file_sz,
ulzman(comp_buf, s->comp_file_sz, decomp_buf, s->raw_file_sz));

View File

@@ -38,13 +38,13 @@ COREBOOT_MIRROR_URL="https://www.coreboot.org/releases/crossgcc-sources"
GMP_VERSION=6.3.0
MPFR_VERSION=4.2.1
MPC_VERSION=1.3.1
GCC_VERSION=13.2.0
GCC_VERSION=14.1.0
BINUTILS_VERSION=2.42
IASL_VERSION="20230628"
IASL_VERSION=20240321
# CLANG version number
CLANG_VERSION=17.0.6
CMAKE_VERSION=3.28.3
NASM_VERSION=2.16.01
CLANG_VERSION=18.1.6
CMAKE_VERSION=3.29.3
NASM_VERSION=2.16.03
# Filename for each package
GMP_ARCHIVE="gmp-${GMP_VERSION}.tar.xz"
@@ -74,7 +74,7 @@ MPFR_BASE_URL="https://ftpmirror.gnu.org/mpfr"
MPC_BASE_URL="https://ftpmirror.gnu.org/mpc"
GCC_BASE_URL="https://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}"
BINUTILS_BASE_URL="https://ftpmirror.gnu.org/binutils"
IASL_BASE_URL="https://downloadmirror.intel.com/783534"
IASL_BASE_URL="https://downloadmirror.intel.com/819451"
# CLANG toolchain archive locations
LLVM_BASE_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-${CLANG_VERSION}"
CLANG_BASE_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-${CLANG_VERSION}"

View File

@@ -23,26 +23,19 @@ included first.
/* glibc versions earlier than 2.7 do not define the routines to handle
dynamically allocated CPU sets. For these targets, we use the static
--- gcc-13.2.0/gcc/ada/argv.c
+++ gcc-13.2.0.musl/gcc/ada/argv.c
@@ -42,6 +42,8 @@
main program, and these routines are accessed from the
Ada.Command_Line.Environment package. */
+#include "adaint.h"
+
#ifdef IN_RTS
#include "runtime.h"
#include <stdlib.h>
@@ -50,8 +52,6 @@
#include "config.h"
--- gcc-14-20240211/gcc/ada/argv.c
+++ gcc-14-20240211.musl/gcc/ada/argv.c
@@ -51,10 +51,6 @@
#include "system.h"
#endif
-
-#include "adaint.h"
-#ifndef LIGHT_RUNTIME
-#include "adaint.h"
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif
--- gcc-13.2.0/gcc/ada/cio.c
+++ gcc-13.2.0.musl/gcc/ada/cio.c
@@ -29,6 +29,8 @@

View File

@@ -1,231 +0,0 @@
From 7e80d6b834cd792dbbd7a99fbff98e46cdd5789f Mon Sep 17 00:00:00 2001
From: "H. Peter Anvin" <hpa@zytor.com>
Date: Tue, 17 Jan 2023 13:05:55 -0800
Subject: [PATCH] Make: handle warning files while building in a directory
The dependency on the warning files breaks when we are building in a
directory *and* the files already exist from being shipped with the
distribution tarballs. The make VPATH simply isn't sophisticated
enough to deal with it, so let the C compiler handle it by #including
the generated file from a dummy C file.
Reported-by: Rudi Heitbaum <rudi@heitbaum.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
Makefile.in | 38 ++++++++++++++++++++------------------
Mkfiles/msvc.mak | 14 +++++++-------
Mkfiles/openwcom.mak | 14 +++++++-------
doc/Makefile.in | 2 +-
6 files changed, 37 insertions(+), 34 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 148fcb50..95268fd2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -37,8 +37,10 @@ AR = @AR@
RANLIB = @RANLIB@
STRIP = @STRIP@
+tools = $(top_srcdir)/tools
+
PERL = perl
-PERLFLAGS = -I$(srcdir)/perllib -I$(srcdir)
+PERLFLAGS = -I$(top_srcdir)/perllib -I$(srcdir)
RUNPERL = $(PERL) $(PERLFLAGS)
PYTHON3 = python3
@@ -65,8 +67,8 @@ LN_S = @LN_S@
FIND = find
# Binary suffixes
-O = @OBJEXT@
-X = @EXEEXT@
+O = @OBJEXT@
+X = @EXEEXT@
A = @LIBEXT@
# Debug stuff
@@ -194,14 +196,14 @@ PERLREQ = config/unconfig.h \
x86/iflag.c x86/iflaggen.h \
macros/macros.c \
asm/pptok.ph asm/directbl.c asm/directiv.h \
- asm/warnings.c include/warnings.h doc/warnings.src \
+ $(WARNFILES) \
misc/nasmtok.el \
version.h version.mac version.mak nsis/version.nsh
INSDEP = x86/insns.dat x86/insns.pl x86/insns-iflags.ph x86/iflags.ph
config/unconfig.h: config/config.h.in
- $(RUNPERL) $(srcdir)/tools/unconfig.pl \
+ $(RUNPERL) $(tools)/unconfig.pl \
'$(srcdir)' config/config.h.in config/unconfig.h
x86/iflag.c: $(INSDEP)
@@ -273,7 +275,7 @@ x86/regs.h: x86/regs.dat x86/regs.pl
# reasonable, but doesn't update the time stamp if the files aren't
# changed, to avoid rebuilding everything every time. Track the actual
# dependency by the empty file asm/warnings.time.
-WARNFILES = asm/warnings.c include/warnings.h doc/warnings.src
+WARNFILES = asm/warnings_c.h include/warnings.h doc/warnings.src
warnings:
$(RM_F) $(WARNFILES) $(WARNFILES:=.time)
@@ -283,11 +285,11 @@ asm/warnings.time: $(ALLOBJ_NW:.$(O)=.c)
: > asm/warnings.time
$(MAKE) $(WARNFILES:=.time)
-asm/warnings.c.time: asm/warnings.pl asm/warnings.time
- $(RUNPERL) $(srcdir)/asm/warnings.pl c asm/warnings.c $(srcdir)
- : > asm/warnings.c.time
+asm/warnings_c.h.time: asm/warnings.pl asm/warnings.time
+ $(RUNPERL) $(srcdir)/asm/warnings.pl c asm/warnings_c.h $(srcdir)
+ : > asm/warnings_c.h.time
-asm/warnings.c: asm/warnings.c.time
+asm/warnings_c.h: asm/warnings_c.h.time
@: Side effect
include/warnings.h.time: asm/warnings.pl asm/warnings.time
@@ -506,8 +508,8 @@ EXTERNAL_DEPENDENCIES = 1
# the dependency information will remain external, so it doesn't
# pollute the git logs.
#
-Makefile.dep: $(PERLREQ) tools/mkdep.pl config.status
- $(RUNPERL) tools/mkdep.pl -M Makefile.in -- $(DEPDIRS)
+Makefile.dep: $(PERLREQ) $(tools)/mkdep.pl config.status
+ $(RUNPERL) $(tools)/mkdep.pl -M Makefile.in -- $(DEPDIRS)
dep: Makefile.dep
@@ -517,9 +519,9 @@ dep: Makefile.dep
# be invoked manually or via "make dist". It should be run before
# creating release archives.
#
-alldeps: $(PERLREQ) tools/syncfiles.pl tools/mkdep.pl
- $(RUNPERL) tools/syncfiles.pl Makefile.in Mkfiles/*.mak
- $(RUNPERL) tools/mkdep.pl -i -M Makefile.in Mkfiles/*.mak -- \
+alldeps: $(PERLREQ) $(tools)/syncfiles.pl $(tools)/mkdep.pl
+ $(RUNPERL) $(tools)/syncfiles.pl Makefile.in Mkfiles/*.mak
+ $(RUNPERL) $(tools)/mkdep.pl -i -M Makefile.in Mkfiles/*.mak -- \
$(DEPDIRS)
$(RM_F) *.dep
if [ -f config.status ]; then \
@@ -528,9 +530,9 @@ alldeps: $(PERLREQ) tools/syncfiles.pl tools/mkdep.pl
# Strip internal dependency information from all Makefiles; this makes
# the output good for git checkin
-cleandeps: $(PERLREQ) tools/syncfiles.pl tools/mkdep.pl
- $(RUNPERL) tools/syncfiles.pl Makefile.in Mkfiles/*.mak
- $(RUNPERL) tools/mkdep.pl -e -M Makefile.in Mkfiles/*.mak -- \
+cleandeps: $(PERLREQ) $(tools)/syncfiles.pl $(tools)/mkdep.pl
+ $(RUNPERL) $(tools)/syncfiles.pl Makefile.in Mkfiles/*.mak
+ $(RUNPERL) $(tools)/mkdep.pl -e -M Makefile.in Mkfiles/*.mak -- \
$(DEPDIRS)
$(RM_F) *.dep
if [ -f config.status ]; then \
diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak
index cf71fffc..da71c5c6 100644
--- a/Mkfiles/msvc.mak
+++ b/Mkfiles/msvc.mak
@@ -153,14 +153,14 @@ PERLREQ = config\unconfig.h \
x86\iflag.c x86\iflaggen.h \
macros\macros.c \
asm\pptok.ph asm\directbl.c asm\directiv.h \
- asm\warnings.c include\warnings.h doc\warnings.src \
+ $(WARNFILES) \
misc\nasmtok.el \
version.h version.mac version.mak nsis\version.nsh
INSDEP = x86\insns.dat x86\insns.pl x86\insns-iflags.ph x86\iflags.ph
config\unconfig.h: config\config.h.in
- $(RUNPERL) $(srcdir)\tools\unconfig.pl \
+ $(RUNPERL) $(tools)\unconfig.pl \
'$(srcdir)' config\config.h.in config\unconfig.h
x86\iflag.c: $(INSDEP)
@@ -232,7 +232,7 @@ x86\regs.h: x86\regs.dat x86\regs.pl
# reasonable, but doesn't update the time stamp if the files aren't
# changed, to avoid rebuilding everything every time. Track the actual
# dependency by the empty file asm\warnings.time.
-WARNFILES = asm\warnings.c include\warnings.h doc\warnings.src
+WARNFILES = asm\warnings_c.h include\warnings.h doc\warnings.src
warnings:
$(RM_F) $(WARNFILES) $(WARNFILES:=.time)
@@ -242,11 +242,11 @@ asm\warnings.time: $(ALLOBJ_NW:.$(O)=.c)
: > asm\warnings.time
$(MAKE) $(WARNFILES:=.time)
-asm\warnings.c.time: asm\warnings.pl asm\warnings.time
- $(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings.c $(srcdir)
- : > asm\warnings.c.time
+asm\warnings_c.h.time: asm\warnings.pl asm\warnings.time
+ $(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings_c.h $(srcdir)
+ : > asm\warnings_c.h.time
-asm\warnings.c: asm\warnings.c.time
+asm\warnings_c.h: asm\warnings_c.h.time
@: Side effect
include\warnings.h.time: asm\warnings.pl asm\warnings.time
diff --git a/Mkfiles/openwcom.mak b/Mkfiles/openwcom.mak
index 5394d85d..605f9afe 100644
--- a/Mkfiles/openwcom.mak
+++ b/Mkfiles/openwcom.mak
@@ -166,14 +166,14 @@ PERLREQ = config\unconfig.h &
x86\iflag.c x86\iflaggen.h &
macros\macros.c &
asm\pptok.ph asm\directbl.c asm\directiv.h &
- asm\warnings.c include\warnings.h doc\warnings.src &
+ $(WARNFILES) &
misc\nasmtok.el &
version.h version.mac version.mak nsis\version.nsh
INSDEP = x86\insns.dat x86\insns.pl x86\insns-iflags.ph x86\iflags.ph
config\unconfig.h: config\config.h.in
- $(RUNPERL) $(srcdir)\tools\unconfig.pl &
+ $(RUNPERL) $(tools)\unconfig.pl &
'$(srcdir)' config\config.h.in config\unconfig.h
x86\iflag.c: $(INSDEP)
@@ -245,7 +245,7 @@ x86\regs.h: x86\regs.dat x86\regs.pl
# reasonable, but doesn't update the time stamp if the files aren't
# changed, to avoid rebuilding everything every time. Track the actual
# dependency by the empty file asm\warnings.time.
-WARNFILES = asm\warnings.c include\warnings.h doc\warnings.src
+WARNFILES = asm\warnings_c.h include\warnings.h doc\warnings.src
warnings:
$(RM_F) $(WARNFILES) $(WARNFILES:=.time)
@@ -255,11 +255,11 @@ asm\warnings.time: $(ALLOBJ_NW:.$(O)=.c)
: > asm\warnings.time
$(MAKE) $(WARNFILES:=.time)
-asm\warnings.c.time: asm\warnings.pl asm\warnings.time
- $(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings.c $(srcdir)
- : > asm\warnings.c.time
+asm\warnings_c.h.time: asm\warnings.pl asm\warnings.time
+ $(RUNPERL) $(srcdir)\asm\warnings.pl c asm\warnings_c.h $(srcdir)
+ : > asm\warnings_c.h.time
-asm\warnings.c: asm\warnings.c.time
+asm\warnings_c.h: asm\warnings_c.h.time
@: Side effect
include\warnings.h.time: asm\warnings.pl asm\warnings.time
diff --git a/doc/Makefile.in b/doc/Makefile.in
index e92437a0..1c8393c5 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -20,7 +20,7 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
-PERL = perl -I$(srcdir)
+PERL = perl -I$(top_srcdir)/perllib -I$(srcdir)
PDFOPT = @PDFOPT@

View File

@@ -1 +0,0 @@
3b893fb771cf3fbd3531de3036e1a5bfc624c9d2 tarballs/acpica-unix-20230628.tar.gz

Some files were not shown because too many files have changed in this diff Show More