-
-Google's vboot verifies the firmware and places measurements
-within the TPM.
-
-
-
Root of Trust
-
-When using vboot, the root-of-trust is basically the read-only portion of the
-SPI flash. The following items factor into the trust equation:
-
-
-
The GCC compiler must reliably translate the code into machine code
- without inserting any additional code (virus, backdoor, etc.)
-
-
The CPU must reliably execute the reset sequence and instructions as
- documented by the CPU manufacturer.
-
-
The SPI flash must provide only the code programmed into it to the CPU
- without providing any alternative reset vector or code sequence.
-
-
The SPI flash must honor the write-protect input and protect the
- specified portion of the SPI flash from all erase and write accesses.
-
-
-
-
-The firmware is typically protected using the write-protect pin on the SPI
-flash part and setting some of the write-protect bits in the status register
-during manufacturing. The protected area is platform specific and for x86
-platforms is typically 1/4th of the SPI flash
-part size. Because this portion of the SPI flash is hardware write protected,
-it is not possible to update this portion of the SPI flash in the field,
-without altering the system to eliminate the ground connection to the SPI flash
-write-protect pin. Without hardware modifications, this portion of the SPI
-flash maintains the manufactured state during the system's lifetime.
-
-
-
-
Firmware Layout
-
-Several sections are added to the firmware layout to support vboot:
-
-
-
Read-only section
-
Google Binary Blob (GBB) area
-
Read/write section A
-
Read/write section B
-
-
-The following sections describe the various portions of the flash layout.
-
-
-
Read-Only Section
-
-The read-only section contains a coreboot file system (CBFS) that contains all
-of the boot firmware necessary to perform recovery for the system. This
-firmware is typically protected using the write-protect pin on the SPI flash
-part and setting some of the write-protect bits in the status register during
-manufacturing. The protected area is typically 1/4th of the SPI flash part
-size and must cover the entire read-only section which consists of:
-
-
-
Vital Product Data (VPD) area
-
Firmware ID area
-
Google Binary Blob (GBB) area
-
coreboot file system containing read-only recovery firmware
-
-
-
Google Binary Blob (GBB) Area
-
-The GBB area is part of the read-only section. This area contains a 4096 or
-8192 bit public root RSA key that is used to verify the VBLOCK area to obtain
-the firmware signing key.
-
-
-
Recovery Firmware
-
-The recovery firmware is contained within a coreboot file system and consists
-of:
-
-
-
reset vector
-
bootblock
-
verstage
-
romstage
-
postcar
-
ramstage
-
payload
-
flash map file
-
config file
-
processor specific files:
-
-
Microcode
-
fspm.bin
-
fsps.bin
-
-
-
-
-
-The recovery firmware is written during manufacturing and typically contains
-code to write the storage device (eMMC device or hard disk). The recovery
-image is usually contained on a socketed device such as a USB flash drive or
-an SD card. Depending upon the payload firmware doing the recovery, it may
-be possible for the user to interact with the system to specify the recovery
-image path. Part of the recovery is also to write the A and B areas of the
-SPI flash device to boot the system.
-
-
-
-
Read/Write Section
-
-
-The read/write sections contain an area which contains the firmware signing
-key and signature and an area containing a coreboot file system with a subset
-of the firmware. The firmware files in FW_MAIN_A and FW_MAIN_B are:
-
-
-
romstage
-
postcar
-
ramstage
-
payload
-
config file
-
processor specific files:
-
-
Microcode
-
fspm.bin
-
fsps.bin
-
-
-
-
-
-The firmware subset enables most issues to be fixed in the field with firmware
-updates. The firmware files handle memory and most of silicon initialization.
-These files also produce the tables which get passed to the operating system.
-
-
-
-
Firmware Updates
-
-The read/write sections exist in one of three states:
-
-
-
Invalid
-
Ready to boot
-
Successfully booted
-
-
-
-
-
-Where is this state information written?
- CMOS?
- RW_NVRAM?
- RW_FWID_*
-
-
-
-
-
-Firmware updates are handled by the operating system by writing any read/write
-section that is not in the "successfully booted" state. Upon the next reboot,
-vboot determines the section to boot. If it finds one in the "ready to boot"
-state then it attempts to boot using that section. If the boot fails then
-vboot marks the section as invalid and attempts to fall back to a read/write
-section in the "successfully booted" state. If vboot is not able to find a
-section in the "successfully booted" state then vboot enters recovery mode.
-
-
-
-Only the operating system is able to transition a section from the "ready to
-boot" state to the "successfully booted" state. The transition is typically
-done after the operating system has been running for a while indicating
-that successful boot was possible and the operating system is stable.
-
-
-
-Note that as long as the SPI write protection is in place then the system is
-always recoverable. If the flash update fails then the system will continue
-to boot using the previous read/write area. The same is true if coreboot
-passes control to the payload or the operating system and then the boot fails.
-In the worst case, the SPI flash gets totally corrupted in which case vboot
-fails the signature checks and enters recovery mode. There are no times where
-the SPI flash is exposed and the reset vector or part of the recovery firmware
-gets corrupted.
-
-
-
-
Build Flags
-
-The following Kconfig values need to be selected to enable vboot:
-
-
-
COLLECT_TIMESTAMPS
-
VBOOT
-
-
-
-The starting stage needs to be specified by selecting either
-VBOOT_STARTS_IN_BOOTBLOCK or VBOOT_STARTS_IN_ROMSTAGE.
-
-
-
-If vboot starts in bootblock then vboot may be built as a separate stage by
-selecting VBOOT_SEPARATE_VERSTAGE. Additionally, if static RAM is too small
-to fit both verstage and romstage then selecting VBOOT_RETURN_FROM_VERSTAGE
-enables bootblock to reuse the RAM occupied by verstage for romstage.
-
-
-
-Non-volatile flash is needed for vboot operation. This flash area may be in
-CMOS, the EC, or in a read/write area of the SPI flash device. Select one of
-the following:
-
-
-
VBOOT_VBNV_CMOS
-
VBOOT_VBNV_EC
-
VBOOT_VBNV_FLASH
-
-
-More non-volatile storage features may be found in src/vboot/Kconfig.
-
-
-
-A TPM is also required for vboot operation. TPMs are available in
-drivers/i2c/tpm and drivers/pc80/tpm.
-
-
-
-In addition to adding the coreboot files into the read-only region, enabling
-vboot causes the build script to add the read/write files into coreboot file
-systems in FW_MAIN_A and FW_MAIN_B.
-
-
-
-
Signing the coreboot Image
-
-The following command script is an example of how to sign the coreboot image file.
-This script is used on the Intel Galileo board and creates the GBB area and
-inserts it into the coreboot image. It also updates the VBLOCK areas with the
-firmware signing key and the signature for the FW_MAIN firmware. More details
-are available in 3rdparty/vboot/README.
-
-
-
#!/bin/sh
-#
-# The necessary tools were built and installed using the following commands:
-#
-# pushd 3rdparty/vboot
-# make
-# sudo make install
-# popd
-#
-# The keys were made using the following command
-#
-# 3rdparty/vboot/scripts/keygeneration/create_new_keys.sh \
-# --4k --4k-root --output $PWD/keys
-#
-#
-# The "magic" numbers below are derived from the GBB section in
-# src/mainboard/intel/galileo/vboot.fmd.
-#
-# GBB Header Size: 0x80
-# GBB Offset: 0x611000, 4KiB block number: 1553 (0x611)
-# GBB Length: 0x7f000, 4KiB blocks: 127 (0x7f)
-# COREBOOT Offset: 0x690000, 4KiB block number: 1680 (0x690)
-# COREBOOT Length: 0x170000, 4KiB blocks: 368 (0x170)
-#
-# 0x7f000 (GBB Length) = 0x80 + 0x100 + 0x1000 + 0x7ce80 + 0x1000
-#
-# Create the GBB area blob
-# Parameters: hwid_size,rootkey_size,bmpfv_size,recoverykey_size
-#
-gbb_utility -c 0x100,0x1000,0x7ce80,0x1000 gbb.blob
-
-#
-# Copy from the start of the flash to the GBB region into the signed flash
-# image.
-#
-# 1553 * 4096 = 0x611 * 0x1000 = 0x611000, size of area before GBB
-#
-dd conv=fdatasync ibs=4096 obs=4096 count=1553 \
- if=build/coreboot.rom of=build/coreboot.signed.rom
-
-#
-# Append the empty GBB area to the coreboot.rom image.
-#
-# 1553 * 4096 = 0x611 * 0x1000 = 0x611000, offset to GBB
-#
-dd conv=fdatasync obs=4096 obs=4096 seek=1553 if=gbb.blob \
- of=build/coreboot.signed.rom
-
-#
-# Append the rest of the read-only region into the signed flash image.
-#
-# 1680 * 4096 = 0x690 * 0x1000 = 0x690000, offset to COREBOOT area
-# 368 * 4096 = 0x170 * 0x1000 = 0x170000, length of COREBOOT area
-#
-dd conv=fdatasync ibs=4096 obs=4096 skip=1680 seek=1680 count=368 \
- if=build/coreboot.rom of=build/coreboot.signed.rom
-
-#
-# Insert the HWID and public root and recovery RSA keys into the GBB area.
-#
-gbb_utility \
- --set --hwid='Galileo' \
- -r $PWD/keys/recovery_key.vbpubk \
- -k $PWD/keys/root_key.vbpubk \
- build/coreboot.signed.rom
-
-#
-# Sign the read/write firmware areas with the private signing key and update
-# the VBLOCK_A and VBLOCK_B regions.
-#
-3rdparty/vboot/scripts/image_signing/sign_firmware.sh \
- build/coreboot.signed.rom \
- $PWD/keys \
- build/coreboot.signed.rom
-
-
-
-
Boot Flow
-
-The reset vector exist in the read-only area and points to the bootblock entry
-point. The only copy of the bootblock exists in the read-only area of the SPI
-flash. Verstage may be part of the bootblock or a separate stage. If separate
-then the bootblock loads verstage from the read-only area and transfers control
-to it.
-
-
-
-Upon first boot, verstage attempts to verify the read/write section A. It gets
-the public root key from the GBB area and uses that to verify the VBLOCK area
-in read-write section A. If the VBLOCK area is valid then it extracts the
-firmware signing key (1024-8192 bits) and uses that to verify the FW_MAIN_A
-area of read/write section A. If the verification is successful then verstage
-instructs coreboot to use the coreboot file system in read/write section A for
-the contents of the remaining boot firmware (romstage, postcar, ramstage and
-the payload).
-
-
-
-If verification fails for the read/write area and the other read/write area is
-not valid vboot falls back to the read-only area to boot into system recovery.
-
-
-
-
Chromebook Special Features
-
-Google's Chromebooks have some special features:
-
-
-
Developer mode
-
Write-protect screw
-
-
-
Developer Mode
-
-Developer mode allows the user to use coreboot to boot another operating system.
-This may be a another (beta) version of Chrome OS, or another flavor of
-GNU/Linux. Use of developer mode does not void the system warranty. Upon
-entry into developer mode, all locally saved data on the system is lost.
-This prevents someone from entering developer mode to subvert the system
-security to access files on the local system or cloud.
-
-
-
Write Protect Screw
-
-Chromebooks have a write-protect screw which provides the ground to the
-write-protect pin of the SPI flash. Google specifically did this to allow
-the manufacturing line and advanced developers to re-write the entire SPI flash
-part. Once the screw is removed, any firmware may be placed on the device.
-However, accessing this screw requires opening the case and voids the system
-warranty!
-
-
-
-
Modified: 2 May 2017
-
-
diff --git a/Documentation/mainboard/index.md b/Documentation/mainboard/index.md
index 7eaf425e20..9af5c80883 100644
--- a/Documentation/mainboard/index.md
+++ b/Documentation/mainboard/index.md
@@ -70,6 +70,10 @@ The boards in this section are not real mainboards, but emulators.
- [T430 / T530 / X230 / W530 common](lenovo/xx30_series.md)
- [T431s](lenovo/t431s.md)
+## MSI
+
+- [MS-7707](msi/ms7707/ms7707.md)
+
## SiFive
- [SiFive HiFive Unleashed](sifive/hifive-unleashed.md)
diff --git a/Documentation/mainboard/msi/ms7707/J1-flash-protect.jpg b/Documentation/mainboard/msi/ms7707/J1-flash-protect.jpg
new file mode 100644
index 0000000000..b649d059a8
Binary files /dev/null and b/Documentation/mainboard/msi/ms7707/J1-flash-protect.jpg differ
diff --git a/Documentation/mainboard/msi/ms7707/JSPI1-Winbond-W25Q32BVSIG.jpg b/Documentation/mainboard/msi/ms7707/JSPI1-Winbond-W25Q32BVSIG.jpg
new file mode 100644
index 0000000000..7a0df71dd7
Binary files /dev/null and b/Documentation/mainboard/msi/ms7707/JSPI1-Winbond-W25Q32BVSIG.jpg differ
diff --git a/Documentation/mainboard/msi/ms7707/JSPI1-connected.jpg b/Documentation/mainboard/msi/ms7707/JSPI1-connected.jpg
new file mode 100644
index 0000000000..d1eed2760e
Binary files /dev/null and b/Documentation/mainboard/msi/ms7707/JSPI1-connected.jpg differ
diff --git a/Documentation/mainboard/msi/ms7707/JSPI1.png b/Documentation/mainboard/msi/ms7707/JSPI1.png
new file mode 100644
index 0000000000..b1eadc28e6
Binary files /dev/null and b/Documentation/mainboard/msi/ms7707/JSPI1.png differ
diff --git a/Documentation/mainboard/msi/ms7707/flashlayout.svg b/Documentation/mainboard/msi/ms7707/flashlayout.svg
new file mode 100644
index 0000000000..2bd826b10c
--- /dev/null
+++ b/Documentation/mainboard/msi/ms7707/flashlayout.svg
@@ -0,0 +1,34 @@
+
+
diff --git a/Documentation/mainboard/msi/ms7707/ms7707.md b/Documentation/mainboard/msi/ms7707/ms7707.md
new file mode 100644
index 0000000000..789431872c
--- /dev/null
+++ b/Documentation/mainboard/msi/ms7707/ms7707.md
@@ -0,0 +1,112 @@
+# MSI MS-7707 V1.1
+
+* MSI MS-7707 V1.1 (Medion OEM Akoya P4385D MSN10014555)
+* SandyBridge Intel P67 (BD82x6x)
+* Winbond 25Q32BV (4MB)
+* Fintek F71808A SuperIO
+* Intel 82579V Gigabit
+* NEC uPD720200 USB 3.0 Host Controller
+* IME 7.0.4.1197
+
+## Flash chip (Winbond 25Q32BV)
+```eval_rst
++---------------------+--------------------+
+| Type | Value |
++=====================+====================+
+| Size | 4 MiB |
++---------------------+--------------------+
+| BIOS range | 2 MiB |
++---------------------+--------------------+
+| Write protection | Yes (via jumper) |
++---------------------+--------------------+
+| Header | Yes (JSPI1) |
++---------------------+--------------------+
+| Package | SOIC-8 |
++---------------------+--------------------+
+| In circuit flashing | Yes |
++---------------------+--------------------+
+| Internal flashing | Yes |
++---------------------+--------------------+
+| Socketed flash | No |
++---------------------+--------------------+
+| Dual BIOS feature | No |
++---------------------+--------------------+
+| ME removable | Yes |
++---------------------+--------------------+
+```
+
+## Installation instructions
+* The standard method is to only flash the 2MiB BIOS region. In that case it's
+not needed to extract blobs from vendor firmware and internal flashing is
+sufficient.
+* To flash the whole chip (e.g. to disable ME) blobs are needed to build
+coreboot. Blobs can be extracted with util/ifdtool from 4MiB full dump image
+(see below). Its recommended to include the VGA BIOS as well (4MiB write only).
+Kconfig is prepared already if it gets enabled (path and 8086,0102).
+```
+coreboot/3rdparty/blobs/mainboard/msi/ms7707
+├── descriptor.bin
+├── gbe.bin
+├── me.bin
+└── vgabios.bin
+```
+* Never write a full 4MiB image if blobs are not included. The generated
+coreboot.rom file is always 4MiB but the 2MiB flash command below will only
+flash the last 2MiB (BIOS) block.
+* The J1-Jumper sets the 'Flash Descriptor Override Strap-Pin' and enables
+full 4MiB access for internal flasher (read and write).
+* **Write BIOS-range** (2MiB) with J1-Jumper=off (as on picture/default
+ position):
+```
+flashrom -p internal:ich_spi_force=yes --noverify-all --ifd -i bios -w coreboot.rom
+```
+* **Read full dump** (4MiB) with J1-jumper=on:
+```
+flashrom -p internal -r original.rom
+```
+* **Write full dump** (4MiB) with J1-Jumper=on:
+```
+flashrom -p internal -w coreboot.rom
+```
+* After successful flashing turn main power off, wait some seconds to drain
+the capacitors, pull the battery and set the JBAT (clrcmos) jumper for some
+seconds. Setting the jumper alone is not enough (the Fintek is VBAT backed).
+Put all back in place and restart the board. It might need 1-2 AC power cycles
+to reinitialize (running at full fan speed - don't panic).
+* External flashing has been tested with RPi2 without main power connected.
+3.3V provided by RPi2. Read more about flashing methods [here](https://doc.coreboot.org/flash_tutorial/index.html).
+* In case of going back to proprietary BIOS create/save cmos settings as early
+as possible (do not leave BIOS on first start without saving settings).
+The BIOS might corrupt nvram (not cmos!) and leave the system in a dead state
+that needs an external flasher to revive. If stuck, reset the Fintek (see
+above) and restart the system several times and/or try setting J1 to
+temporarily disable ME.
+
+
+
+* The JSPI1 header (5×2 2.0mm pitch pin header) for external flashing is
+directly connected to the flash chip. Additional 3.3V to /HOLD and /WP is not
+needed (internally re-routed already).
+
+
+
+
+
+
+
+## Flash layout
+
+* The 4MiB flashrom is divided into 4 sections:
+
+![][flashlayout]
+
+## Links
+
+- [BIOS ROM]
+- [Fintek F71808A datasheet]
+- [Winbond 25Q32BV datasheet]
+
+[BIOS ROM]: https://www.medion.com/de/servicebackend/_lightbox/treiber_details.php?did=9744
+[Winbond 25Q32BV datasheet]: https://www.winbond.com/resource-files/w25q32bv_revi_100413_wo_automotive.pdf
+[Fintek F71808A datasheet]: https://www.alldatasheet.com/datasheet-pdf/pdf/459069/FINTEK/F71808A.html
+[flashlayout]: flashlayout.svg
diff --git a/Documentation/security/index.md b/Documentation/security/index.md
index 89db42ecee..9ad54866c2 100644
--- a/Documentation/security/index.md
+++ b/Documentation/security/index.md
@@ -4,4 +4,5 @@ This section describes documentation about the security architecture of coreboot
## Vendor
+- [Verified Boot](vboot/index.md)
- [Measured Boot](vboot/measured_boot.md)
diff --git a/Documentation/security/vboot/index.md b/Documentation/security/vboot/index.md
new file mode 100644
index 0000000000..97420893e5
--- /dev/null
+++ b/Documentation/security/vboot/index.md
@@ -0,0 +1,324 @@
+# vboot - Verified Boot Support
+
+Google's verified boot support consists of:
+
+* A root of trust
+* Special firmware layout
+* Firmware verification
+* Firmware measurements
+* A firmware update mechanism
+* Specific build flags
+* Signing the coreboot image
+
+Google's vboot verifies the firmware and places measurements within the TPM.
+
+***
+
+## Root of Trust
+
+When using vboot, the root-of-trust is basically the read-only portion of the
+SPI flash. The following items factor into the trust equation:
+
+* The GCC compiler must reliably translate the code into machine code
+ without inserting any additional code (virus, backdoor, etc.)
+* The CPU must reliably execute the reset sequence and instructions as
+ documented by the CPU manufacturer.
+* The SPI flash must provide only the code programmed into it to the CPU
+ without providing any alternative reset vector or code sequence.
+* The SPI flash must honor the write-protect input and protect the specified
+ portion of the SPI flash from all erase and write accesses.
+
+The firmware is typically protected using the write-protect pin on the SPI
+flash part and setting some of the write-protect bits in the status register
+during manufacturing. The protected area is platform specific and for x86
+platforms is typically 1/4th of the SPI flash part size.
+Because this portion of the SPI flash is hardware write protected, it is not
+possible to update this portion of the SPI flash in the field, without altering
+the system to eliminate the ground connection to the SPI flash write-protect pin.
+Without hardware modifications, this portion of the SPI flash maintains the
+manufactured state during the system's lifetime.
+
+***
+
+## Firmware Layout
+
+Several sections are added to the firmware layout to support vboot:
+
+* Read-only section
+* Google Binary Blob (GBB) area
+* Read/write section A
+* Read/write section B
+
+The following sections describe the various portions of the flash layout.
+
+### Read-Only Section
+
+The read-only section contains a coreboot file system (CBFS) that contains all
+of the boot firmware necessary to perform recovery for the system. This firmware
+is typically protected using the write-protect pin on the SPI flash part and
+setting some of the write-protect bits in the status register during
+manufacturing.
+The protected area is typically 1/4th of the SPI flash part size and must cover
+the entire read-only section which consists of:
+
+* Vital Product Data (VPD) area
+* Firmware ID area
+* Google Binary Blob (GBB) area
+* coreboot file system containing read-only recovery firmware
+
+### Google Binary Blob (GBB) Area
+
+The GBB area is part of the read-only section. This area contains a 4096 or 8192
+bit public root RSA key that is used to verify the *VBLOCK* area to obtain the
+firmware signing key.
+
+### Recovery Firmware
+
+The recovery firmware is contained within a coreboot file system and consists of:
+
+* reset vector
+* bootblock
+* verstage
+* romstage
+* postcar
+* ramstage
+* payload
+* flash map file
+* config file
+* processor specific files:
+ * Microcode
+ * fspm.bin
+ * fsps.bin
+
+The recovery firmware is written during manufacturing and typically contains
+code to write the storage device (eMMC device or hard disk). The recovery image
+is usually contained on a socketed device such as a USB flash drive or an
+SD card. Depending upon the payload firmware doing the recovery, it may be
+possible for the user to interact with the system to specify the recovery
+image path. Part of the recovery is also to write the A and B areas of the SPI
+flash device to boot the system.
+
+### Read/Write Section
+
+The read/write sections contain an area which contains the firmware signing
+key and signature and an area containing a coreboot file system with a subset
+of the firmware. The firmware files in *FW_MAIN_A* and *FW_MAIN_B* are:
+
+* romstage
+* postcar
+* ramstage
+* payload
+* config file
+* processor specific files:
+ * Microcode
+ * fspm.bin
+ * fsps.bin
+
+The firmware subset enables most issues to be fixed in the field with firmware
+updates. The firmware files handle memory and most of silicon initialization.
+These files also produce the tables which get passed to the operating system.
+
+***
+
+## Firmware Updates
+
+The read/write sections exist in one of three states:
+
+* Invalid
+* Ready to boot
+* Successfully booted
+
+
+Firmware updates are handled by the operating system by writing any read/write
+section that is not in the "successfully booted" state. Upon the next reboot,
+vboot determines the section to boot. If it finds one in the "ready to boot"
+state then it attempts to boot using that section. If the boot fails then
+vboot marks the section as invalid and attempts to fall back to a read/write
+section in the "successfully booted" state. If vboot is not able to find a
+section in the "successfully booted" state then vboot enters recovery mode.
+
+Only the operating system is able to transition a section from the
+"ready to boot" state to the "successfully booted" state.
+The transition is typically done after the operating system has been running
+for a while indicating that successful boot was possible and the operating
+system is stable.
+
+Note that as long as the SPI write protection is in place then the system
+is always recoverable. If the flash update fails then the system will continue
+to boot using the previous read/write area. The same is true if coreboot passes
+control to the payload or the operating system and then the boot fails. In the
+worst case, the SPI flash gets totally corrupted in which case vboot fails the
+signature checks and enters recovery mode. There are no times where the SPI
+flash is exposed and the reset vector or part of the recovery firmware gets
+corrupted.
+
+***
+
+## Build Flags
+
+The following *Kconfig* values need to be selected to enable vboot:
+
+* COLLECT_TIMESTAMPS
+* VBOOT
+
+The starting stage needs to be specified by selecting either
+VBOOT_STARTS_IN_BOOTBLOCK or VBOOT_STARTS_IN_ROMSTAGE.
+
+If vboot starts in bootblock then vboot may be built as a separate stage by
+selecting `VBOOT_SEPARATE_VERSTAGE`. Additionally, if static RAM is too small
+to fit both verstage and romstage then selecting `VBOOT_RETURN_FROM_VERSTAGE`
+enables bootblock to reuse the RAM occupied by verstage for romstage.
+
+Non-volatile flash is needed for vboot operation. This flash area may be in
+CMOS, the EC, or in a read/write area of the SPI flash device.
+Select one of the following:
+
+* `VBOOT_VBNV_CMOS`
+* `VBOOT_VBNV_EC`
+* `VBOOT_VBNV_FLASH`
+
+More non-volatile storage features may be found in `security/vboot/Kconfig`.
+
+A TPM is also required for vboot operation.
+TPMs are available in `drivers/i2c/tpm` and `drivers/pc80/tpm`.
+
+In addition to adding the coreboot files into the read-only region,
+enabling vboot causes the build script to add the read/write files into
+coreboot file systems in *FW_MAIN_A* and *FW_MAIN_B*.
+
+***
+
+## Signing the coreboot Image
+
+The following command script is an example of how to sign the coreboot image
+file. This script is used on the Intel Galileo board and creates the *GBB* area
+and inserts it into the coreboot image. It also updates the *VBLOCK* areas with
+the firmware signing key and the signature for the *FW_MAIN* firmware.
+More details are available in `3rdparty/vboot/README`.
+
+```bash
+#!/bin/sh
+#
+# The necessary tools were built and installed using the following commands:
+#
+# pushd 3rdparty/vboot
+# make
+# sudo make install
+# popd
+#
+# The keys were made using the following command
+#
+# 3rdparty/vboot/scripts/keygeneration/create_new_keys.sh \
+# --4k --4k-root --output $PWD/keys
+#
+#
+# The "magic" numbers below are derived from the GBB section in
+# src/mainboard/intel/galileo/vboot.fmd.
+#
+# GBB Header Size: 0x80
+# GBB Offset: 0x611000, 4KiB block number: 1553 (0x611)
+# GBB Length: 0x7f000, 4KiB blocks: 127 (0x7f)
+# COREBOOT Offset: 0x690000, 4KiB block number: 1680 (0x690)
+# COREBOOT Length: 0x170000, 4KiB blocks: 368 (0x170)
+#
+# 0x7f000 (GBB Length) = 0x80 + 0x100 + 0x1000 + 0x7ce80 + 0x1000
+#
+# Create the GBB area blob
+# Parameters: hwid_size,rootkey_size,bmpfv_size,recoverykey_size
+#
+gbb_utility -c 0x100,0x1000,0x7ce80,0x1000 gbb.blob
+
+#
+# Copy from the start of the flash to the GBB region into the signed flash
+# image.
+#
+# 1553 * 4096 = 0x611 * 0x1000 = 0x611000, size of area before GBB
+#
+dd conv=fdatasync ibs=4096 obs=4096 count=1553 \
+if=build/coreboot.rom of=build/coreboot.signed.rom
+
+#
+# Append the empty GBB area to the coreboot.rom image.
+#
+# 1553 * 4096 = 0x611 * 0x1000 = 0x611000, offset to GBB
+#
+dd conv=fdatasync obs=4096 obs=4096 seek=1553 if=gbb.blob \
+of=build/coreboot.signed.rom
+
+#
+# Append the rest of the read-only region into the signed flash image.
+#
+# 1680 * 4096 = 0x690 * 0x1000 = 0x690000, offset to COREBOOT area
+# 368 * 4096 = 0x170 * 0x1000 = 0x170000, length of COREBOOT area
+#
+dd conv=fdatasync ibs=4096 obs=4096 skip=1680 seek=1680 count=368 \
+if=build/coreboot.rom of=build/coreboot.signed.rom
+
+#
+# Insert the HWID and public root and recovery RSA keys into the GBB area.
+#
+gbb_utility \
+--set --hwid='Galileo' \
+-r $PWD/keys/recovery_key.vbpubk \
+-k $PWD/keys/root_key.vbpubk \
+build/coreboot.signed.rom
+
+#
+# Sign the read/write firmware areas with the private signing key and update
+# the VBLOCK_A and VBLOCK_B regions.
+#
+3rdparty/vboot/scripts/image_signing/sign_firmware.sh \
+build/coreboot.signed.rom \
+$PWD/keys \
+ build/coreboot.signed.rom
+```
+
+***
+
+## Boot Flow
+
+The reset vector exist in the read-only area and points to the bootblock
+entry point. The only copy of the bootblock exists in the read-only area
+of the SPI flash. Verstage may be part of the bootblock or a separate stage.
+If separate then the bootblock loads verstage from the read-only area and
+transfers control to it.
+
+Upon first boot, verstage attempts to verify the read/write section A.
+It gets the public root key from the GBB area and uses that to verify the
+*VBLOCK* area in read-write section A. If the *VBLOCK* area is valid then it
+extracts the firmware signing key (1024-8192 bits) and uses that to verify
+the *FW_MAIN_A* area of read/write section A. If the verification is successful
+then verstage instructs coreboot to use the coreboot file system in read/write
+section A for the contents of the remaining boot firmware (romstage, postcar,
+ramstage and the payload).
+
+If verification fails for the read/write area and the other read/write area is
+not valid vboot falls back to the read-only area to boot into system recovery.
+
+***
+
+## Chromebook Special Features
+
+Google's Chromebooks have some special features:
+
+* Developer mode
+* Write-protect screw
+
+### Developer Mode
+
+Developer mode allows the user to use coreboot to boot another operating system.
+This may be a another (beta) version of Chrome OS, or another flavor of
+GNU/Linux. Use of developer mode does not void the system warranty. Upon entry
+into developer mode, all locally saved data on the system is lost.
+This prevents someone from entering developer mode to subvert the system
+security to access files on the local system or cloud.
+
+### Write Protect Screw
+
+Chromebooks have a write-protect screw which provides the ground to the
+write-protect pin of the SPI flash.
+Google specifically did this to allow the manufacturing line and advanced
+developers to re-write the entire SPI flash part. Once the screw is removed,
+any firmware may be placed on the device.
+However, accessing this screw requires opening the case and voids the
+system warranty!
diff --git a/Makefile.inc b/Makefile.inc
index fc04a16fad..a9aaaed783 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -196,14 +196,11 @@ ifeq ($(CONFIG_USE_BLOBS),y)
# this is necessary because 3rdparty/blobs is update=none, and so is ignored
# unless explicitly requested and enabled through --checkout
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/blobs))
-ifeq ($(CONFIG_PLATFORM_USES_FSP2_0),y)
+ifeq ($(CONFIG_PLATFORM_USES_FSP1_0)$(CONFIG_PLATFORM_USES_FSP1_1)$(CONFIG_PLATFORM_USES_FSP2_0),y)
+# this is necessary because 3rdparty/fsp is update=none, and so is ignored
+# unless explicitly requested and enabled through --checkout
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/fsp))
endif
-ifeq ($(CONFIG_PLATFORM_USES_FSP1_0),y)
-ifeq ($(CONFIG_SOC_INTEL_FSP_BROADWELL_DE),y)
-forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/fsp))
-endif
-endif
endif
UPDATED_SUBMODULES:=1
COREBOOT_EXPORTS += UPDATED_SUBMODULES
diff --git a/configs/config.lenovo_t420_static_option_table_no_mem_fuses b/configs/config.lenovo_t420_static_option_table_no_mem_fuses
index a268d88b78..0a3513cfac 100644
--- a/configs/config.lenovo_t420_static_option_table_no_mem_fuses
+++ b/configs/config.lenovo_t420_static_option_table_no_mem_fuses
@@ -4,4 +4,6 @@ CONFIG_VENDOR_LENOVO=y
CONFIG_BOARD_LENOVO_T420=y
CONFIG_NATIVE_RAMINIT_IGNORE_MAX_MEM_FUSES=y
CONFIG_NATIVE_RAMINIT_IGNORE_XMP_MAX_DIMMS=y
+CONFIG_VBOOT=y
+CONFIG_H8_FN_KEY_AS_VBOOT_RECOVERY_SW=y
# CONFIG_INTEL_CHIPSET_LOCKDOWN is not set
diff --git a/src/Kconfig b/src/Kconfig
index 90c724ebb5..b4898bd456 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -370,8 +370,6 @@ source "src/superio/*/*/Kconfig"
comment "Embedded Controllers"
source "src/ec/acpi/Kconfig"
source "src/ec/*/*/Kconfig"
-# FIXME move to vendorcode
-source "src/drivers/intel/fsp1_0/Kconfig"
source "src/southbridge/intel/common/firmware/Kconfig"
source "src/vendorcode/*/Kconfig"
@@ -1155,7 +1153,6 @@ config GENERIC_SPD_BIN
config DIMM_MAX
int
default 4
- depends on GENERIC_SPD_BIN
help
Total number of memory DIMM slots available on motherboard.
It is multiplication of number of channel to number of DIMMs per
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c
index 7c87c693e1..589f4f0e30 100644
--- a/src/arch/x86/smbios.c
+++ b/src/arch/x86/smbios.c
@@ -999,6 +999,56 @@ static int smbios_write_type127(unsigned long *current, int handle)
return len;
}
+/* Generate Type9 entries from devicetree */
+static int smbios_walk_device_tree_type9(struct device *dev, int *handle,
+ unsigned long *current)
+{
+ enum misc_slot_usage usage;
+ enum slot_data_bus_bandwidth bandwidth;
+ enum misc_slot_type type;
+ enum misc_slot_length length;
+
+ if (dev->path.type != DEVICE_PATH_PCI)
+ return 0;
+
+ if (!dev->smbios_slot_type && !dev->smbios_slot_data_width &&
+ !dev->smbios_slot_designation && !dev->smbios_slot_length)
+ return 0;
+
+ if (dev_is_active_bridge(dev))
+ usage = SlotUsageInUse;
+ else if (dev->enabled)
+ usage = SlotUsageAvailable;
+ else
+ usage = SlotUsageUnknown;
+
+ if (dev->smbios_slot_data_width)
+ bandwidth = dev->smbios_slot_data_width;
+ else
+ bandwidth = SlotDataBusWidthUnknown;
+
+ if (dev->smbios_slot_type)
+ type = dev->smbios_slot_type;
+ else
+ type = SlotTypeUnknown;
+
+ if (dev->smbios_slot_length)
+ length = dev->smbios_slot_length;
+ else
+ length = SlotLengthUnknown;
+
+ return smbios_write_type9(current, handle,
+ dev->smbios_slot_designation,
+ type,
+ bandwidth,
+ usage,
+ length,
+ 1,
+ 0,
+ dev->bus->secondary,
+ dev->path.pci.devfn);
+}
+
static int smbios_walk_device_tree(struct device *tree, int *handle,
unsigned long *current)
{
@@ -1011,6 +1061,7 @@ static int smbios_walk_device_tree(struct device *tree, int *handle,
dev_name(dev));
len += dev->ops->get_smbios_data(dev, handle, current);
}
+ len += smbios_walk_device_tree_type9(dev, handle, current);
}
return len;
}
diff --git a/src/arch/x86/stages.c b/src/arch/x86/stages.c
deleted file mode 100644
index b4d0723e16..0000000000
--- a/src/arch/x86/stages.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2010 coresystems GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-static void skip_romstage(void)
-{
- asm volatile (
- "jmp __main\n"
- );
-}
diff --git a/src/commonlib/cbfs.c b/src/commonlib/cbfs.c
index 4379099ffe..a509bc9f61 100644
--- a/src/commonlib/cbfs.c
+++ b/src/commonlib/cbfs.c
@@ -18,6 +18,7 @@
#include
#include
#include
+#include
#if !defined(ERROR)
#define ERROR(x...) printk(BIOS_ERR, "CBFS: " x)
diff --git a/src/console/vtxprintf.c b/src/console/vtxprintf.c
index 043a1dae37..f42ed6d077 100644
--- a/src/console/vtxprintf.c
+++ b/src/console/vtxprintf.c
@@ -56,8 +56,10 @@ static int number(void (*tx_byte)(unsigned char byte, void *data),
int count = 0;
#ifdef SUPPORT_64BIT_INTS
unsigned long long num = inum;
+ long long snum = num;
#else
- unsigned long num = (long)inum;
+ unsigned long num = (unsigned long)inum;
+ long snum = (long)num;
if (num != inum) {
/* Alert user to an incorrect result by printing #^!. */
@@ -76,9 +78,9 @@ static int number(void (*tx_byte)(unsigned char byte, void *data),
c = (type & ZEROPAD) ? '0' : ' ';
sign = 0;
if (type & SIGN) {
- if ((signed long long)num < 0) {
+ if (snum < 0) {
sign = '-';
- num = -num;
+ num = -snum;
size--;
} else if (type & PLUS) {
sign = '+';
diff --git a/src/device/device_util.c b/src/device/device_util.c
index 5c4f911b8b..47df3052e2 100644
--- a/src/device/device_util.c
+++ b/src/device/device_util.c
@@ -628,7 +628,7 @@ void disable_children(struct bus *bus)
/*
* Returns true if the device is an enabled bridge that has at least
- * one enabled device on its secondary bus.
+ * one enabled device on its secondary bus that is not of type NONE.
*/
bool dev_is_active_bridge(struct device *dev)
{
@@ -643,6 +643,9 @@ bool dev_is_active_bridge(struct device *dev)
for (link = dev->link_list; link; link = link->next) {
for (child = link->children; child; child = child->sibling) {
+ if (child->path.type == DEVICE_PATH_NONE)
+ continue;
+
if (child->enabled)
return 1;
}
diff --git a/src/drivers/intel/fsp1_1/Kconfig b/src/drivers/intel/fsp1_1/Kconfig
index 2575577ba4..a8658ec7e6 100644
--- a/src/drivers/intel/fsp1_1/Kconfig
+++ b/src/drivers/intel/fsp1_1/Kconfig
@@ -25,8 +25,14 @@ if PLATFORM_USES_FSP1_1
comment "Intel FSP 1.1"
+config FSP_USE_REPO
+ bool "Use FSP binary from 3rdparty/fsp repo"
+ select HAVE_FSP_BIN
+ depends on SOC_INTEL_BRASWELL && !USE_GOOGLE_FSP
+ default y
+
config HAVE_FSP_BIN
- bool "Should the Intel FSP binary be added to the flash image"
+ bool "Add Intel FSP binary to flash image"
help
Select this option to add an Intel FSP binary to
the resulting coreboot image.
@@ -34,6 +40,25 @@ config HAVE_FSP_BIN
Note: Without this binary, coreboot builds relying on the FSP
will not boot
+config FSP_FILE
+ string
+ prompt "Intel FSP binary path and filename" if !FSP_USE_REPO
+ depends on HAVE_FSP_BIN
+ default "3rdparty/fsp/BraswellFspBinPkg/FspBin/BSWFSP.fd" if FSP_USE_REPO
+ default ""
+ help
+ The path and filename of the Intel FSP binary for this platform.
+
+config FSP_LOC
+ hex "Intel FSP Binary location in CBFS"
+ default 0xfff6e000 if SOC_INTEL_BRASWELL && USE_GOOGLE_FSP
+ default 0xfff20000 if SOC_INTEL_BRASWELL
+ default 0xffee0000 if SOC_INTEL_SKYLAKE
+ help
+ The location in CBFS that the FSP is located. This must match the
+ value that is set in the FSP binary. If the FSP needs to be moved,
+ rebase the FSP with Intel's BCT (tool).
+
config CPU_MICROCODE_CBFS_LEN
hex "Microcode update region length in bytes"
default 0x0
@@ -47,19 +72,6 @@ config CPU_MICROCODE_CBFS_LOC
The location (base address) in CBFS that contains the microcode update
binary.
-config FSP_FILE
- string "Intel FSP binary path and filename"
- help
- The path and filename of the Intel FSP binary for this platform.
-
-config FSP_LOC
- hex "Intel FSP Binary location in CBFS"
- default 0xffee0000
- help
- The location in CBFS that the FSP is located. This must match the
- value that is set in the FSP binary. If the FSP needs to be moved,
- rebase the FSP with Intel's BCT (tool).
-
config DISPLAY_HOBS
bool "Display hand-off-blocks (HOBs)"
default n
diff --git a/src/drivers/intel/fsp1_1/cache_as_ram.inc b/src/drivers/intel/fsp1_1/cache_as_ram.inc
index 48fcb8f39f..fa5c40677b 100644
--- a/src/drivers/intel/fsp1_1/cache_as_ram.inc
+++ b/src/drivers/intel/fsp1_1/cache_as_ram.inc
@@ -24,9 +24,8 @@
* performs the final stage of initialization.
*/
-
-#define LHLT_DELAY 0x50000 /* I/O delay between post codes on failure */
-
+/* I/O delay between post codes on failure */
+#define LHLT_DELAY 0x50000
/*
* Per FSP1.1 specs, following registers are preserved:
* EBX, EDI, ESI, EBP, MM0, MM1
@@ -165,8 +164,8 @@ halt1:
* 0x01 - FV signature, "_FVH" not present
* 0x02 - FFS GUID not present
* 0x03 - FSP INFO Header not found
- * 0x04 - ImageBase does not equal CONFIG_FSP_LOC - Is the FSP rebased to
- * a different location, or does it need to be?
+ * 0x04 - ImageBase does not equal CONFIG_FSP_LOC - Is the FSP rebased
+ * to a different location, or does it need to be?
* 0x05 - FSP INFO Header signature "FSPH" not found
* 0x06 - FSP Image ID is not the expected ID.
*/
@@ -181,7 +180,8 @@ halt2:
* 0x02 - FSP_INVALID_PARAMETER: Input parameters are invalid.
* 0x03 - FSP_UNSUPPORTED: The FSP calling conditions were not met.
* 0x07 - FSP_DEVICE_ERROR: Temp RAM initialization failed
- * 0x0E - FSP_NOT_FOUND: No valid microcode was found in the microcode region.
+ * 0x0E - FSP_NOT_FOUND: No valid microcode was found in the microcode
+ * region.
* 0x14 - FSP_ALREADY_STARTED: Temp RAM initialization has been invoked
*/
movb $0xBB, %ah
@@ -213,7 +213,7 @@ CAR_init_params:
.long CONFIG_CPU_MICROCODE_CBFS_LOC /* Microcode Location */
.long CONFIG_CPU_MICROCODE_CBFS_LEN /* Microcode Length */
.long 0xFFFFFFFF - CONFIG_ROM_SIZE + 1 /* Firmware Location */
- .long CONFIG_ROM_SIZE /* Total Firmware Length */
+ .long CONFIG_ROM_SIZE /* Firmware Length */
CAR_init_stack:
.long CAR_init_done
diff --git a/src/drivers/intel/fsp1_1/include/fsp/romstage.h b/src/drivers/intel/fsp1_1/include/fsp/romstage.h
index d608484999..b01f11059c 100644
--- a/src/drivers/intel/fsp1_1/include/fsp/romstage.h
+++ b/src/drivers/intel/fsp1_1/include/fsp/romstage.h
@@ -18,20 +18,28 @@
#ifndef _COMMON_ROMSTAGE_H_
#define _COMMON_ROMSTAGE_H_
+#include
#include
#include
#include
#include
#include
#include
-#include
#include /* chip_power_state */
struct romstage_params {
uint32_t fsp_version;
struct chipset_power_state *power_state;
- struct pei_data *pei_data;
void *chipset_context;
+
+ /* Fast boot and S3 resume MRC data */
+ size_t saved_data_size;
+ const void *saved_data;
+ bool disable_saved_data;
+
+ /* New save data from MRC */
+ size_t data_to_save_size;
+ const void *data_to_save;
};
/*
diff --git a/src/drivers/intel/fsp1_1/raminit.c b/src/drivers/intel/fsp1_1/raminit.c
index 8405c943aa..726cc26a0c 100644
--- a/src/drivers/intel/fsp1_1/raminit.c
+++ b/src/drivers/intel/fsp1_1/raminit.c
@@ -28,6 +28,7 @@
void raminit(struct romstage_params *params)
{
+ const bool s3wake = params->power_state->prev_sleep_state == ACPI_S3;
const EFI_GUID bootldr_tolum_guid = FSP_BOOTLOADER_TOLUM_HOB_GUID;
EFI_HOB_RESOURCE_DESCRIPTOR *cbmem_root;
FSP_INFO_HEADER *fsp_header;
@@ -46,7 +47,6 @@ void raminit(struct romstage_params *params)
u32 *mrc_hob;
u32 fsp_reserved_bytes;
MEMORY_INIT_UPD *original_params;
- struct pei_data *pei_ptr;
EFI_STATUS status;
VPD_DATA_REGION *vpd_ptr;
UPD_DATA_REGION *upd_ptr;
@@ -80,10 +80,9 @@ void raminit(struct romstage_params *params)
/* Zero fill RT Buffer data and start populating fields. */
memset(&fsp_rt_common_buffer, 0, sizeof(fsp_rt_common_buffer));
- pei_ptr = params->pei_data;
- if (pei_ptr->boot_mode == ACPI_S3) {
+ if (s3wake) {
fsp_rt_common_buffer.BootMode = BOOT_ON_S3_RESUME;
- } else if (pei_ptr->saved_data != NULL) {
+ } else if (params->saved_data != NULL) {
fsp_rt_common_buffer.BootMode =
BOOT_ASSUMING_NO_CONFIGURATION_CHANGES;
} else {
@@ -93,7 +92,7 @@ void raminit(struct romstage_params *params)
fsp_rt_common_buffer.BootLoaderTolumSize = cbmem_overhead_size();
/* Get any board specific changes */
- fsp_memory_init_params.NvsBufferPtr = (void *)pei_ptr->saved_data;
+ fsp_memory_init_params.NvsBufferPtr = (void *)params->saved_data;
fsp_memory_init_params.RtBufferPtr = &fsp_rt_common_buffer;
fsp_memory_init_params.HobListPtr = &hob_list_ptr;
@@ -158,7 +157,7 @@ void raminit(struct romstage_params *params)
/* Migrate CAR data */
printk(BIOS_DEBUG, "0x%p: cbmem_top\n", cbmem_top());
- if (pei_ptr->boot_mode != ACPI_S3) {
+ if (!s3wake) {
cbmem_initialize_empty_id_size(CBMEM_ID_FSP_RESERVED_MEMORY,
fsp_reserved_bytes);
} else if (cbmem_initialize_id_size(CBMEM_ID_FSP_RESERVED_MEMORY,
@@ -220,7 +219,7 @@ void raminit(struct romstage_params *params)
}
hob_ptr.Raw = get_next_guid_hob(&mrc_guid, hob_list_ptr);
if (hob_ptr.Raw == NULL) {
- if (params->pei_data->saved_data == NULL) {
+ if (params->saved_data == NULL) {
printk(BIOS_ERR, "7.3: FSP_NON_VOLATILE_STORAGE_HOB missing!\n");
fsp_verification_failure = 1;
}
@@ -294,8 +293,8 @@ void raminit(struct romstage_params *params)
"Memory Configuration Data Hob not present\n");
else if (!vboot_recovery_mode_enabled()) {
/* Do not save MRC data in recovery path */
- pei_ptr->data_to_save = GET_GUID_HOB_DATA(mrc_hob);
- pei_ptr->data_to_save_size = ALIGN(
+ params->data_to_save = GET_GUID_HOB_DATA(mrc_hob);
+ params->data_to_save_size = ALIGN(
((u32)GET_HOB_LENGTH(mrc_hob)), 16);
}
}
diff --git a/src/drivers/intel/fsp1_1/romstage.c b/src/drivers/intel/fsp1_1/romstage.c
index ebb6a6678b..433e16cf13 100644
--- a/src/drivers/intel/fsp1_1/romstage.c
+++ b/src/drivers/intel/fsp1_1/romstage.c
@@ -41,9 +41,7 @@
asmlinkage void *romstage_main(FSP_INFO_HEADER *fih)
{
void *top_of_stack;
- struct pei_data pei_data;
struct romstage_params params = {
- .pei_data = &pei_data,
.chipset_context = fih,
};
@@ -55,8 +53,6 @@ asmlinkage void *romstage_main(FSP_INFO_HEADER *fih)
if (CONFIG(SUPPORT_CPU_UCODE_IN_CBFS))
intel_update_microcode_from_cbfs();
- memset(&pei_data, 0, sizeof(pei_data));
-
/* Display parameters */
if (!CONFIG(NO_MMCONF_SUPPORT))
printk(BIOS_SPEW, "CONFIG_MMCONF_BASE_ADDRESS: 0x%08x\n",
@@ -94,14 +90,11 @@ void romstage_common(struct romstage_params *params)
{
bool s3wake;
struct region_device rdev;
- struct pei_data *pei_data;
post_code(0x32);
timestamp_add_now(TS_BEFORE_INITRAM);
- pei_data = params->pei_data;
- pei_data->boot_mode = params->power_state->prev_sleep_state;
s3wake = params->power_state->prev_sleep_state == ACPI_S3;
if (CONFIG(ELOG_BOOT_COUNT) && !s3wake)
@@ -112,9 +105,9 @@ void romstage_common(struct romstage_params *params)
post_code(0x33);
/* Check recovery and MRC cache */
- params->pei_data->saved_data_size = 0;
- params->pei_data->saved_data = NULL;
- if (!params->pei_data->disable_saved_data) {
+ params->saved_data_size = 0;
+ params->saved_data = NULL;
+ if (!params->disable_saved_data) {
if (vboot_recovery_mode_enabled()) {
/* Recovery mode does not use MRC cache */
printk(BIOS_DEBUG,
@@ -124,12 +117,11 @@ void romstage_common(struct romstage_params *params)
params->fsp_version,
&rdev))) {
/* MRC cache found */
- params->pei_data->saved_data_size =
- region_device_sz(&rdev);
- params->pei_data->saved_data = rdev_mmap_full(&rdev);
+ params->saved_data_size = region_device_sz(&rdev);
+ params->saved_data = rdev_mmap_full(&rdev);
/* Assume boot device is memory mapped. */
assert(CONFIG(BOOT_DEVICE_MEMORY_MAPPED));
- } else if (params->pei_data->boot_mode == ACPI_S3) {
+ } else if (s3wake) {
/* Waking from S3 and no cache. */
printk(BIOS_DEBUG,
"No MRC cache found in S3 resume path.\n");
@@ -147,15 +139,15 @@ void romstage_common(struct romstage_params *params)
/* Save MRC output */
if (CONFIG(CACHE_MRC_SETTINGS)) {
- printk(BIOS_DEBUG, "MRC data at %p %d bytes\n",
- pei_data->data_to_save, pei_data->data_to_save_size);
- if ((params->pei_data->boot_mode != ACPI_S3)
- && (params->pei_data->data_to_save_size != 0)
- && (params->pei_data->data_to_save != NULL))
+ printk(BIOS_DEBUG, "MRC data at %p %zu bytes\n",
+ params->data_to_save, params->data_to_save_size);
+ if (!s3wake
+ && (params->data_to_save_size != 0)
+ && (params->data_to_save != NULL))
mrc_cache_stash_data(MRC_TRAINING_DATA,
params->fsp_version,
- params->pei_data->data_to_save,
- params->pei_data->data_to_save_size);
+ params->data_to_save,
+ params->data_to_save_size);
}
/* Save DIMM information */
@@ -343,13 +335,6 @@ __weak int mrc_cache_stash_data(int type, uint32_t version,
return -1;
}
-/* Transition RAM from off or self-refresh to active */
-__weak void raminit(struct romstage_params *params)
-{
- post_code(POST_MEM_PREINIT_PREP_START);
- die("ERROR - No RAM initialization specified!\n");
-}
-
/* Display the memory configuration */
__weak void report_memory_config(void)
{
diff --git a/src/drivers/intel/fsp2_0/memory_init.c b/src/drivers/intel/fsp2_0/memory_init.c
index 985ee3a07f..b3afb98c4d 100644
--- a/src/drivers/intel/fsp2_0/memory_init.c
+++ b/src/drivers/intel/fsp2_0/memory_init.c
@@ -310,8 +310,6 @@ static void do_fsp_memory_init(struct fsp_header *hdr, bool s3wake,
post_code(POST_FSP_MEMORY_EXIT);
timestamp_add_now(TS_FSP_MEMORY_INIT_END);
- fsp_debug_after_memory_init(status);
-
/* Handle any errors returned by FspMemoryInit */
fsp_handle_reset(status);
if (status != FSP_SUCCESS) {
@@ -320,6 +318,13 @@ static void do_fsp_memory_init(struct fsp_header *hdr, bool s3wake,
}
do_fsp_post_memory_init(s3wake, fsp_version);
+
+ /*
+ * fsp_debug_after_memory_init() checks whether the end of the tolum
+ * region is the same as the top of cbmem, so must be called here
+ * after cbmem has been initialised in do_fsp_post_memory_init().
+ */
+ fsp_debug_after_memory_init(status);
}
/* Load the binary into the memory specified by the info header. */
diff --git a/src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c b/src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c
index e26701b099..cdc98e06de 100644
--- a/src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c
+++ b/src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c
@@ -45,9 +45,6 @@ static efi_return_status_t mp_get_processor_info(const
efi_uintn_t processor_number,
efi_processor_information *processor_info_buffer)
{
- if (cpu_index() < 0)
- return FSP_DEVICE_ERROR;
-
if (processor_info_buffer == NULL)
return FSP_INVALID_PARAMETER;
@@ -71,9 +68,6 @@ static efi_return_status_t mp_startup_all_aps(const
efi_ap_procedure procedure, efi_boolean_t ignored3,
efi_uintn_t timeout_usec, void *argument)
{
- if (cpu_index() < 0)
- return FSP_DEVICE_ERROR;
-
if (procedure == NULL)
return FSP_INVALID_PARAMETER;
@@ -91,9 +85,6 @@ static efi_return_status_t mp_startup_this_ap(const
efi_ap_procedure procedure, efi_uintn_t processor_number,
efi_uintn_t timeout_usec, void *argument)
{
- if (cpu_index() < 0)
- return FSP_DEVICE_ERROR;
-
if (processor_number > get_cpu_count())
return FSP_NOT_FOUND;
diff --git a/src/drivers/pc80/rtc/mc146818rtc.c b/src/drivers/pc80/rtc/mc146818rtc.c
index 99079b985e..6e37cd2f78 100644
--- a/src/drivers/pc80/rtc/mc146818rtc.c
+++ b/src/drivers/pc80/rtc/mc146818rtc.c
@@ -39,6 +39,9 @@
#define LB_CKS_LOC 0
#endif
+/* Don't warn for checking >= LB_CKS_RANGE_START even though it may be 0. */
+#pragma GCC diagnostic ignored "-Wtype-limits"
+
#include
#if (defined(__PRE_RAM__) && \
diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c
index fc831c3e9c..ae1d2efb22 100644
--- a/src/drivers/spi/spi_flash.c
+++ b/src/drivers/spi/spi_flash.c
@@ -339,7 +339,7 @@ int spi_flash_generic_probe(const struct spi_slave *spi,
printk(BIOS_INFO, "Manufacturer: %02x\n", *idp);
/* search the table for matches in shift and id */
- for (i = 0; i < ARRAY_SIZE(flashes); ++i)
+ for (i = 0; i < (int)ARRAY_SIZE(flashes); ++i)
if (flashes[i].shift == shift && flashes[i].idcode == *idp) {
/* we have a match, call probe */
if (flashes[i].probe(spi, idp, flash) == 0) {
diff --git a/src/ec/lenovo/h8/Kconfig b/src/ec/lenovo/h8/Kconfig
index b109831105..d874975428 100644
--- a/src/ec/lenovo/h8/Kconfig
+++ b/src/ec/lenovo/h8/Kconfig
@@ -32,6 +32,14 @@ config H8_HAS_BAT_TRESHOLDS_IMPL
bool
default n
+config H8_FN_KEY_AS_VBOOT_RECOVERY_SW
+ bool "Enable Fn-Key as VBOOT recovery switch"
+ depends on VBOOT
+ default n
+ help
+ If VBOOT is enabled, press Fn-Key at power on to force a recovery mode
+ boot instead of regular FW_MAIN_x boot.
+
endif
config H8_DOCK_EARLY_INIT
diff --git a/src/ec/lenovo/h8/Makefile.inc b/src/ec/lenovo/h8/Makefile.inc
index ebf6d7d7a4..51c11be625 100644
--- a/src/ec/lenovo/h8/Makefile.inc
+++ b/src/ec/lenovo/h8/Makefile.inc
@@ -1,5 +1,18 @@
ifeq ($(CONFIG_EC_LENOVO_H8),y)
+ramstage-y += sense.c
+verstage-y += sense.c
+romstage-y += sense.c
+bootblock-y += sense.c
+postcar-y += sense.c
+smm-y += sense.c
+
+ramstage-$(CONFIG_VBOOT) += vboot.c
+verstage-$(CONFIG_VBOOT) += vboot.c
+romstage-$(CONFIG_VBOOT) += vboot.c
+bootblock-$(CONFIG_VBOOT) += vboot.c
+postcar-$(CONFIG_VBOOT) += vboot.c
+
ifneq ($(filter y,$(CONFIG_H8_BEEP_ON_DEATH) $(CONFIG_H8_FLASH_LEDS_ON_DEATH)),)
romstage-y += panic.c
ramstage-y += panic.c
diff --git a/src/ec/lenovo/h8/h8.h b/src/ec/lenovo/h8/h8.h
index a46ba1f5e0..14948c55ce 100644
--- a/src/ec/lenovo/h8/h8.h
+++ b/src/ec/lenovo/h8/h8.h
@@ -38,6 +38,9 @@ void h8_usb_always_on(void);
void h8_mainboard_init_dock (void);
+int h8_get_fn_key(void);
+int h8_get_sense_ready(void);
+
void h8_bluetooth_enable(int on);
bool h8_bluetooth_nv_enable(void);
bool h8_has_bdc(struct device *dev);
@@ -135,8 +138,10 @@ void h8_ssdt_generator(struct device *dev);
#define H8_EVENT_FN_PRESS 0x39
#define H8_STATUS0 0x46
+#define H8_STATUS0_FN_KEY_DOWN 0x01
#define H8_STATUS1 0x47
#define H8_STATUS2 0x48
+#define H8_STATUS3 0x49
#define H8_EVENT_BAT0 0x4a
#define H8_EVENT_BAT0_STATE 0x4b
diff --git a/src/ec/lenovo/h8/sense.c b/src/ec/lenovo/h8/sense.c
new file mode 100644
index 0000000000..b929d7ede3
--- /dev/null
+++ b/src/ec/lenovo/h8/sense.c
@@ -0,0 +1,54 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Patrick Rudolph
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include
+
+#include "h8.h"
+
+/**
+ * Return the EC sense status register state.
+ *
+ * Observations showed the sense registers are all zero until the EC populates
+ * them after some time. Likely the EC sets all bits to it's valid state at
+ * once, but there's no prove as the firmware isn't available.
+ *
+ * Wait for any register having at least one bit set.
+ * Unlikely that all register will be zero after booting has finished.
+ *
+ * @return 1 if the EC provides valid data in sense status registers
+ */
+int h8_get_sense_ready(void)
+{
+ static const u8 regs[] = { H8_STATUS0, H8_STATUS1, H8_STATUS2,
+ H8_STATUS3};
+
+ for (size_t i = 0; i < ARRAY_SIZE(regs); i++) {
+ if (ec_read(regs[i]))
+ return 1;
+ }
+
+ return 0;
+}
+
+/**
+ * Return the state of Fn key.
+ * Only valid if h8_get_sense_ready (see above) returns true.
+ *
+ * @return 1 if the key is pressed.
+ */
+int h8_get_fn_key(void)
+{
+ return ec_read(H8_STATUS0) & H8_STATUS0_FN_KEY_DOWN;
+}
diff --git a/src/ec/lenovo/h8/vboot.c b/src/ec/lenovo/h8/vboot.c
new file mode 100644
index 0000000000..3b9f74a117
--- /dev/null
+++ b/src/ec/lenovo/h8/vboot.c
@@ -0,0 +1,55 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 Patrick Rudolph
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include
+#include
+#include
+#include
+
+#include "h8.h"
+
+/**
+ * HACK: Use Fn-Key as recovery mode switch.
+ * Wait for sense register ready and read Fn-Key state.
+ */
+int get_recovery_mode_switch(void)
+{
+ struct stopwatch sw;
+
+ if (!CONFIG(H8_FN_KEY_AS_VBOOT_RECOVERY_SW))
+ return 0;
+
+ /* Tests showed that it takes:
+ * - 700msec on Lenovo T500 from AC power on
+ * - less than 150msec on Lenovo T520 from AC power on
+ */
+ stopwatch_init_msecs_expire(&sw, 1000);
+ while (!stopwatch_expired(&sw) && !h8_get_sense_ready())
+ mdelay(1);
+
+ if (!h8_get_sense_ready())
+ return 0;
+
+ return h8_get_fn_key();
+}
+
+/**
+ * Only used if CONFIG_CHROMEOS is set.
+ * Always zero as the #WP pin of the flash is tied high.
+ */
+int get_write_protect_state(void)
+{
+ return 0;
+}
diff --git a/src/include/assert.h b/src/include/assert.h
index 6036635273..4575a29e44 100644
--- a/src/include/assert.h
+++ b/src/include/assert.h
@@ -19,6 +19,12 @@
#include
#include
+/* TODO: Fix vendorcode headers to not define macros coreboot uses or to be more
+ properly isolated. */
+#ifdef ASSERT
+#undef ASSERT
+#endif
+
/* GCC and CAR versions */
#define ASSERT(x) { \
if (!(x)) { \
diff --git a/src/include/device/device.h b/src/include/device/device.h
index 39a4d567a2..32cf07282b 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -141,6 +141,12 @@ struct device {
#if !DEVTREE_EARLY
struct chip_operations *chip_ops;
const char *name;
+#if CONFIG(GENERATE_SMBIOS_TABLES)
+ u8 smbios_slot_type;
+ u8 smbios_slot_data_width;
+ u8 smbios_slot_length;
+ const char *smbios_slot_designation;
+#endif
#endif
DEVTREE_CONST void *chip_info;
};
diff --git a/src/include/device/pci_ids.h b/src/include/device/pci_ids.h
index 85bd6c3864..64539510ce 100644
--- a/src/include/device/pci_ids.h
+++ b/src/include/device/pci_ids.h
@@ -2689,6 +2689,11 @@
#define PCI_DEVICE_ID_INTEL_SPT_LP_U_BASE 0x9d43
#define PCI_DEVICE_ID_INTEL_SPT_LP_U_PREMIUM 0x9d48
#define PCI_DEVICE_ID_INTEL_SPT_LP_Y_PREMIUM 0x9d46
+#define PCI_DEVICE_ID_INTEL_SPT_H_H170 0xa144
+#define PCI_DEVICE_ID_INTEL_SPT_H_Z170 0xa145
+#define PCI_DEVICE_ID_INTEL_SPT_H_Q170 0xa146
+#define PCI_DEVICE_ID_INTEL_SPT_H_Q150 0xa147
+#define PCI_DEVICE_ID_INTEL_SPT_H_B150 0xa148
#define PCI_DEVICE_ID_INTEL_SPT_H_C236 0xa150
#define PCI_DEVICE_ID_INTEL_SPT_H_PREMIUM 0xa14e
#define PCI_DEVICE_ID_INTEL_SPT_H_H110 0xa143
diff --git a/src/mainboard/apple/macbook21/romstage.c b/src/mainboard/apple/macbook21/romstage.c
index c056ac8fcb..468cffb7d9 100644
--- a/src/mainboard/apple/macbook21/romstage.c
+++ b/src/mainboard/apple/macbook21/romstage.c
@@ -26,7 +26,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/src/mainboard/apple/macbookair4_2/Kconfig b/src/mainboard/apple/macbookair4_2/Kconfig
index 82f120ab08..4b2ee8fdc8 100644
--- a/src/mainboard/apple/macbookair4_2/Kconfig
+++ b/src/mainboard/apple/macbookair4_2/Kconfig
@@ -12,7 +12,7 @@ config BOARD_SPECIFIC_OPTIONS
select SERIRQ_CONTINUOUS_MODE
select SOUTHBRIDGE_INTEL_BD82X6X
select SYSTEM_TYPE_LAPTOP
- select GFX_GMA_INTERNAL_IS_LVDS
+ select GFX_GMA_INTERNAL_IS_EDP
select MAINBOARD_HAS_LIBGFXINIT
config MAINBOARD_DIR
diff --git a/src/mainboard/asus/p5gc-mx/romstage.c b/src/mainboard/asus/p5gc-mx/romstage.c
index beb276c7da..08379f78a1 100644
--- a/src/mainboard/asus/p5gc-mx/romstage.c
+++ b/src/mainboard/asus/p5gc-mx/romstage.c
@@ -29,7 +29,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/src/mainboard/asus/p5qpl-am/romstage.c b/src/mainboard/asus/p5qpl-am/romstage.c
index 4174981ac2..bd6bfc6ee7 100644
--- a/src/mainboard/asus/p5qpl-am/romstage.c
+++ b/src/mainboard/asus/p5qpl-am/romstage.c
@@ -24,7 +24,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/src/mainboard/getac/p470/romstage.c b/src/mainboard/getac/p470/romstage.c
index d643b12f8a..aaa3422c02 100644
--- a/src/mainboard/getac/p470/romstage.c
+++ b/src/mainboard/getac/p470/romstage.c
@@ -25,7 +25,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/src/mainboard/google/beltino/mainboard.c b/src/mainboard/google/beltino/mainboard.c
index e0fd105eb1..7bda2f6694 100644
--- a/src/mainboard/google/beltino/mainboard.c
+++ b/src/mainboard/google/beltino/mainboard.c
@@ -14,7 +14,6 @@
* GNU General Public License for more details.
*/
-#include
#include
#include
#include
@@ -25,8 +24,8 @@
#include
#include
#include
-#include "onboard.h"
+#include "onboard.h"
void mainboard_suspend_resume(void)
{
diff --git a/src/mainboard/google/cheza/chromeos.fmd b/src/mainboard/google/cheza/chromeos.fmd
index 71e85562d6..b0d2d99996 100644
--- a/src/mainboard/google/cheza/chromeos.fmd
+++ b/src/mainboard/google/cheza/chromeos.fmd
@@ -24,16 +24,15 @@ FLASH@0x0 8M {
RO_FRID 0x100
}
RO_VPD(PRESERVE) 16K
- # TODO(hungte): Remove RO_PRESERVE.
- RO_PRESERVE(PRESERVE) {
- RO_DDR_TRAINING 8K
- RO_FSG
- }
+ RO_DDR_TRAINING(PRESERVE) 8K
+ RO_LIMITS_CFG(PRESERVE) 4K
+ RO_FSG(PRESERVE)
}
RW_VPD(PRESERVE) 32K
RW_NVRAM(PRESERVE) 16K
- RW_DDR_TRAINING 8K
+ RW_DDR_TRAINING(PRESERVE) 8K
+ RW_LIMITS_CFG(PRESERVE) 4K
RW_ELOG(PRESERVE) 4K
RW_SHARED 4K {
SHARED_DATA
diff --git a/src/mainboard/google/cheza/mainboard.c b/src/mainboard/google/cheza/mainboard.c
index cb4f5d061a..42adf56c79 100644
--- a/src/mainboard/google/cheza/mainboard.c
+++ b/src/mainboard/google/cheza/mainboard.c
@@ -16,9 +16,23 @@
#include
#include
#include
+#include
+#include
+
+static struct usb_board_data usb1_board_data = {
+ .pll_bias_control_2 = 0x28,
+ .imp_ctrl1 = 0x08,
+ .port_tune1 = 0x20,
+};
static void setup_usb(void)
{
+ /*
+ * Primary USB is used only for DP functionality on cheza platform.
+ * Hence Setting up only Secondary USB DWC3 controller.
+ */
+ setup_usb_host1(&usb1_board_data);
+
gpio_output(GPIO(120), 1); /* Deassert HUB_RST_L to enable hub. */
}
diff --git a/src/mainboard/google/cheza/romstage.c b/src/mainboard/google/cheza/romstage.c
index ad8506193d..de737b1159 100644
--- a/src/mainboard/google/cheza/romstage.c
+++ b/src/mainboard/google/cheza/romstage.c
@@ -14,7 +14,22 @@
*/
#include
+#include
+#include
+
+static void prepare_usb(void)
+{
+ /*
+ * Do DWC3 core and phy reset. Kick these resets
+ * off early so they get at least 1ms to settle.
+ */
+ reset_usb1();
+}
void platform_romstage_main(void)
{
+ prepare_usb();
+
+ /* QCLib: DDR init & train */
+ qclib_load_and_run();
}
diff --git a/src/mainboard/google/cyan/Kconfig b/src/mainboard/google/cyan/Kconfig
index b3c6790e57..aac14c06c3 100644
--- a/src/mainboard/google/cyan/Kconfig
+++ b/src/mainboard/google/cyan/Kconfig
@@ -16,6 +16,7 @@ config BOARD_GOOGLE_BASEBOARD_CYAN
select HAVE_ACPI_RESUME
select PCIEXP_L1_SUB_STATE if !BOARD_GOOGLE_CYAN
select SYSTEM_TYPE_LAPTOP
+ select USE_GOOGLE_FSP
if BOARD_GOOGLE_BASEBOARD_CYAN
diff --git a/src/mainboard/google/cyan/acpi/codec_maxim.asl b/src/mainboard/google/cyan/acpi/codec_maxim.asl
index 81bec16ea5..b412551a4a 100644
--- a/src/mainboard/google/cyan/acpi/codec_maxim.asl
+++ b/src/mainboard/google/cyan/acpi/codec_maxim.asl
@@ -35,7 +35,7 @@ Scope (\_SB.PCI0.I2C2)
}
})
- Method(_CRS, 0x0, NotSerialized)
+ Method(_CRS, 0x0, Serialized)
{
Name(SBUF,ResourceTemplate ()
{
diff --git a/src/mainboard/google/cyan/acpi/codec_realtek.asl b/src/mainboard/google/cyan/acpi/codec_realtek.asl
index 4a1d48de7b..d697aace3e 100644
--- a/src/mainboard/google/cyan/acpi/codec_realtek.asl
+++ b/src/mainboard/google/cyan/acpi/codec_realtek.asl
@@ -26,7 +26,7 @@ Scope (\_SB.PCI0.I2C5)
Name (_DDN, AUDIO_CODEC_DDN)
Name (_UID, 1)
- Method(_CRS, 0x0, NotSerialized)
+ Method(_CRS, 0x0, Serialized)
{
Name(SBUF,ResourceTemplate ()
{
diff --git a/src/mainboard/google/cyan/romstage.c b/src/mainboard/google/cyan/romstage.c
index aa20593d5f..c877e42055 100644
--- a/src/mainboard/google/cyan/romstage.c
+++ b/src/mainboard/google/cyan/romstage.c
@@ -16,15 +16,12 @@
#include
#include
-#include
+
+#include "spd/spd_util.h"
/* All FSP specific code goes in this block */
void mainboard_romstage_entry(struct romstage_params *rp)
{
- struct pei_data *ps = rp->pei_data;
-
- mainboard_fill_spd_data(ps);
-
/* Call back into chipset code with platform values updated. */
romstage_common(rp);
}
@@ -32,16 +29,7 @@ void mainboard_romstage_entry(struct romstage_params *rp)
void mainboard_memory_init_params(struct romstage_params *params,
MEMORY_INIT_UPD *memory_params)
{
- /* Update SPD data */
- if (CONFIG(BOARD_GOOGLE_CYAN)) {
- memory_params->PcdMemoryTypeEnable = MEM_DDR3;
- memory_params->PcdMemorySpdPtr =
- (u32)params->pei_data->spd_data_ch0;
- } else
- memory_params->PcdMemoryTypeEnable = MEM_LPDDR3;
-
- memory_params->PcdMemChannel0Config = params->pei_data->spd_ch0_config;
- memory_params->PcdMemChannel1Config = params->pei_data->spd_ch1_config;
+ spd_memory_init_params(memory_params);
/* Variant-specific memory params */
variant_memory_init_params(memory_params);
diff --git a/src/mainboard/google/cyan/spd/spd.c b/src/mainboard/google/cyan/spd/spd.c
index af694a4339..7c66e947fc 100644
--- a/src/mainboard/google/cyan/spd/spd.c
+++ b/src/mainboard/google/cyan/spd/spd.c
@@ -40,11 +40,24 @@ __weak uint8_t get_ramid(void)
return gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios));
}
-static void *get_spd_pointer(char *spd_file_content, int total_spds, int *dual)
+static void *get_spd_pointer(int *dual)
{
+ char *spd_file;
+ size_t spd_file_len;
+ int total_spds;
int ram_id = 0;
int spd_index = 0;
+ /* Find the SPD data in CBFS. */
+ spd_file = cbfs_boot_map_with_leak("spd.bin", CBFS_TYPE_SPD,
+ &spd_file_len);
+ if (!spd_file)
+ die("SPD data not found.");
+
+ if (spd_file_len < SPD_PAGE_LEN)
+ die("Missing SPD data.");
+ total_spds = spd_file_len / SPD_PAGE_LEN;
+
ram_id = get_ramid();
printk(BIOS_DEBUG, "ram_id=%d, total_spds: %d\n", ram_id, total_spds);
@@ -54,33 +67,20 @@ static void *get_spd_pointer(char *spd_file_content, int total_spds, int *dual)
return NULL;
}
/* Return the serial product data for the RAM */
- return &spd_file_content[SPD_PAGE_LEN * spd_index];
+ return &spd_file[SPD_PAGE_LEN * spd_index];
}
/* Copy SPD data for on-board memory */
-void mainboard_fill_spd_data(struct pei_data *ps)
+void spd_memory_init_params(MEMORY_INIT_UPD *memory_params)
{
- char *spd_file;
- size_t spd_file_len;
void *spd_content;
int dual_channel = 0;
- /* Find the SPD data in CBFS. */
- spd_file = cbfs_boot_map_with_leak("spd.bin", CBFS_TYPE_SPD,
- &spd_file_len);
- if (!spd_file)
- die("SPD data not found.");
-
- if (spd_file_len < SPD_PAGE_LEN)
- die("Missing SPD data.");
-
/*
* Both channels are always present in SPD data. Always use matched
* DIMMs so use the same SPD data for each DIMM.
*/
- spd_content = get_spd_pointer(spd_file,
- spd_file_len / SPD_PAGE_LEN,
- &dual_channel);
+ spd_content = get_spd_pointer(&dual_channel);
if (CONFIG(DISPLAY_SPD_DATA) && spd_content != NULL) {
printk(BIOS_DEBUG, "SPD Data:\n");
hexdump(spd_content, SPD_PAGE_LEN);
@@ -94,21 +94,27 @@ void mainboard_fill_spd_data(struct pei_data *ps)
* 2=DimmDisabled
*/
if (spd_content != NULL) {
- ps->spd_data_ch0 = spd_content;
- ps->spd_ch0_config = 1;
+ memory_params->PcdMemChannel0Config = 1;
printk(BIOS_DEBUG, "Channel 0 DIMM soldered down\n");
if (dual_channel) {
printk(BIOS_DEBUG, "Channel 1 DIMM soldered down\n");
- ps->spd_data_ch1 = spd_content;
- ps->spd_ch1_config = 1;
+ memory_params->PcdMemChannel1Config = 1;
} else {
printk(BIOS_DEBUG, "Channel 1 DIMM not installed\n");
- ps->spd_ch1_config = 2;
+ memory_params->PcdMemChannel1Config = 2;
}
}
+
+ /* Update SPD data */
+ if (CONFIG(BOARD_GOOGLE_CYAN)) {
+ memory_params->PcdMemoryTypeEnable = MEM_DDR3;
+ memory_params->PcdMemorySpdPtr = (uintptr_t)spd_content;
+ } else {
+ memory_params->PcdMemoryTypeEnable = MEM_LPDDR3;
+ }
}
-static void set_dimm_info(uint8_t *spd, struct dimm_info *dimm)
+static void set_dimm_info(const uint8_t *spd, struct dimm_info *dimm)
{
const int spd_capmb[8] = { 1, 2, 4, 8, 16, 32, 64, 0 };
const int spd_ranks[8] = { 1, 2, 3, 4, -1, -1, -1, -1 };
@@ -171,9 +177,15 @@ static void set_dimm_info(uint8_t *spd, struct dimm_info *dimm)
void mainboard_save_dimm_info(struct romstage_params *params)
{
+ const void *spd_content;
+ int dual_channel;
struct dimm_info *dimm;
struct memory_info *mem_info;
+ spd_content = get_spd_pointer(&dual_channel);
+ if (spd_content == NULL)
+ return;
+
/*
* Allocate CBMEM area for DIMM information used to populate SMBIOS
* table 17
@@ -186,13 +198,13 @@ void mainboard_save_dimm_info(struct romstage_params *params)
/* Describe the first channel memory */
dimm = &mem_info->dimm[0];
- set_dimm_info(params->pei_data->spd_data_ch0, dimm);
+ set_dimm_info(spd_content, dimm);
mem_info->dimm_cnt = 1;
/* Describe the second channel memory */
- if (params->pei_data->spd_ch1_config == 1) {
+ if (dual_channel) {
dimm = &mem_info->dimm[1];
- set_dimm_info(params->pei_data->spd_data_ch1, dimm);
+ set_dimm_info(spd_content, dimm);
dimm->channel_num = 1;
mem_info->dimm_cnt = 2;
}
diff --git a/src/mainboard/google/cyan/spd/spd_util.h b/src/mainboard/google/cyan/spd/spd_util.h
index 11d6eaa16d..0c5b3265ef 100644
--- a/src/mainboard/google/cyan/spd/spd_util.h
+++ b/src/mainboard/google/cyan/spd/spd_util.h
@@ -16,7 +16,10 @@
#ifndef SPD_UTIL_H
#define SPD_UTIL_H
+#include
+
uint8_t get_ramid(void);
int get_variant_spd_index(int ram_id, int *dual);
+void spd_memory_init_params(MEMORY_INIT_UPD *memory_params);
#endif /* SPD_UTIL_H */
diff --git a/src/mainboard/google/cyan/variants/celes/devicetree.cb b/src/mainboard/google/cyan/variants/celes/devicetree.cb
index 2e708af0d6..a1ab510810 100644
--- a/src/mainboard/google/cyan/variants/celes/devicetree.cb
+++ b/src/mainboard/google/cyan/variants/celes/devicetree.cb
@@ -73,12 +73,6 @@ chip soc/intel/braswell
register "ISPEnable" = "0" # Disable IUNIT
register "ISPPciDevConfig" = "3"
register "PcdSdDetectChk" = "0" # Disable SD card detect
- # Follow Intel recommendation to set BSW D-stepping PERPORTRXISET 2 (low strength)
- register "D0Usb2Port0PerPortRXISet" = "2"
- register "D0Usb2Port1PerPortRXISet" = "2"
- register "D0Usb2Port2PerPortRXISet" = "2"
- register "D0Usb2Port3PerPortRXISet" = "2"
- register "D0Usb2Port4PerPortRXISet" = "2"
# LPE audio codec settings
register "lpe_codec_clk_src" = "LPE_CLK_SRC_XTAL" # 19.2MHz clock
diff --git a/src/mainboard/google/cyan/variants/celes/ramstage.c b/src/mainboard/google/cyan/variants/celes/ramstage.c
index 88b17f5da7..6c522a1d0c 100644
--- a/src/mainboard/google/cyan/variants/celes/ramstage.c
+++ b/src/mainboard/google/cyan/variants/celes/ramstage.c
@@ -19,29 +19,36 @@ void board_silicon_USB2_override(SILICON_INIT_UPD *params)
{
if (SocStepping() >= SocD0) {
+ //Follow Intel recommendation to set
+ //BSW D-stepping PERPORTRXISET 2 (low strength)
params->Usb2Port0PerPortPeTxiSet = 7;
params->Usb2Port0PerPortTxiSet = 0;
params->Usb2Port0IUsbTxEmphasisEn = 3;
params->Usb2Port0PerPortTxPeHalf = 1;
+ params->D0Usb2Port0PerPortRXISet = 2;
params->Usb2Port1PerPortPeTxiSet = 7;
params->Usb2Port1PerPortTxiSet = 0;
params->Usb2Port1IUsbTxEmphasisEn = 3;
params->Usb2Port1PerPortTxPeHalf = 1;
+ params->D0Usb2Port1PerPortRXISet = 2;
params->Usb2Port2PerPortPeTxiSet = 7;
params->Usb2Port2PerPortTxiSet = 6;
params->Usb2Port2IUsbTxEmphasisEn = 3;
params->Usb2Port2PerPortTxPeHalf = 1;
+ params->D0Usb2Port2PerPortRXISet = 2;
params->Usb2Port3PerPortPeTxiSet = 7;
params->Usb2Port3PerPortTxiSet = 6;
params->Usb2Port3IUsbTxEmphasisEn = 3;
params->Usb2Port3PerPortTxPeHalf = 1;
+ params->D0Usb2Port3PerPortRXISet = 2;
params->Usb2Port4PerPortPeTxiSet = 7;
params->Usb2Port4PerPortTxiSet = 6;
params->Usb2Port4IUsbTxEmphasisEn = 3;
params->Usb2Port4PerPortTxPeHalf = 1;
+ params->D0Usb2Port4PerPortRXISet = 2;
}
}
diff --git a/src/mainboard/google/cyan/variants/kefka/Makefile.inc b/src/mainboard/google/cyan/variants/kefka/Makefile.inc
index 5e94e715fa..7799e8d2b3 100644
--- a/src/mainboard/google/cyan/variants/kefka/Makefile.inc
+++ b/src/mainboard/google/cyan/variants/kefka/Makefile.inc
@@ -18,6 +18,7 @@ romstage-y += romstage.c
romstage-y += spd_util.c
ramstage-y += gpio.c
+ramstage-y += ramstage.c
SPD_BIN = $(obj)/spd.bin
diff --git a/src/mainboard/google/cyan/variants/kefka/devicetree.cb b/src/mainboard/google/cyan/variants/kefka/devicetree.cb
index 1ce056f32e..807dbcb2fe 100644
--- a/src/mainboard/google/cyan/variants/kefka/devicetree.cb
+++ b/src/mainboard/google/cyan/variants/kefka/devicetree.cb
@@ -80,13 +80,6 @@ chip soc/intel/braswell
register "I2C5Frequency" = "1"
register "I2C6Frequency" = "1"
- # Follow Intel recommendation to set BSW D-stepping PERPORTRXISET 2 (low strength)
- register "D0Usb2Port0PerPortRXISet" = "2"
- register "D0Usb2Port1PerPortRXISet" = "2"
- register "D0Usb2Port2PerPortRXISet" = "2"
- register "D0Usb2Port3PerPortRXISet" = "2"
- register "D0Usb2Port4PerPortRXISet" = "2"
-
# LPE audio codec settings
register "lpe_codec_clk_src" = "LPE_CLK_SRC_XTAL" # 19.2MHz clock
diff --git a/src/soc/intel/skylake/include/soc/pei_wrapper.h b/src/mainboard/google/cyan/variants/kefka/ramstage.c
similarity index 53%
rename from src/soc/intel/skylake/include/soc/pei_wrapper.h
rename to src/mainboard/google/cyan/variants/kefka/ramstage.c
index d53fe8b769..d790708cce 100644
--- a/src/soc/intel/skylake/include/soc/pei_wrapper.h
+++ b/src/mainboard/google/cyan/variants/kefka/ramstage.c
@@ -1,8 +1,7 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Google Inc.
- * Copyright (C) 2015 Intel Corporation.
+ * Copyright (C) 2014 Intel Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,14 +13,18 @@
* GNU General Public License for more details.
*/
-#ifndef _SOC_PEI_WRAPPER_H_
-#define _SOC_PEI_WRAPPER_H_
+#include
-#include
+void board_silicon_USB2_override(SILICON_INIT_UPD *params)
+{
+ if (SocStepping() >= SocD0) {
-typedef int ABI_X86(*pei_wrapper_entry_t)(struct pei_data *pei_data);
-
-void soc_fill_pei_data(struct pei_data *pei_data);
-void mainboard_fill_pei_data(struct pei_data *pei_data);
-
-#endif
+ //Follow Intel recommendation to set
+ //BSW D-stepping PERPORTRXISET 2 (low strength)
+ params->D0Usb2Port0PerPortRXISet = 2;
+ params->D0Usb2Port1PerPortRXISet = 2;
+ params->D0Usb2Port2PerPortRXISet = 2;
+ params->D0Usb2Port3PerPortRXISet = 2;
+ params->D0Usb2Port4PerPortRXISet = 2;
+ }
+}
diff --git a/src/mainboard/google/cyan/variants/relm/devicetree.cb b/src/mainboard/google/cyan/variants/relm/devicetree.cb
index 65e662c5dd..e1bbb0ac5b 100644
--- a/src/mainboard/google/cyan/variants/relm/devicetree.cb
+++ b/src/mainboard/google/cyan/variants/relm/devicetree.cb
@@ -80,13 +80,6 @@ chip soc/intel/braswell
register "I2C5Frequency" = "1"
register "I2C6Frequency" = "1"
- # Follow Intel recommendation to set BSW D-stepping PERPORTRXISET 2 (low strength)
- register "D0Usb2Port0PerPortRXISet" = "2"
- register "D0Usb2Port1PerPortRXISet" = "2"
- register "D0Usb2Port2PerPortRXISet" = "2"
- register "D0Usb2Port3PerPortRXISet" = "2"
- register "D0Usb2Port4PerPortRXISet" = "2"
-
# LPE audio codec settings
register "lpe_codec_clk_src" = "LPE_CLK_SRC_XTAL" # 19.2MHz clock
diff --git a/src/mainboard/google/cyan/variants/relm/ramstage.c b/src/mainboard/google/cyan/variants/relm/ramstage.c
index 27f9dfa241..3fbd2aebd9 100644
--- a/src/mainboard/google/cyan/variants/relm/ramstage.c
+++ b/src/mainboard/google/cyan/variants/relm/ramstage.c
@@ -36,5 +36,13 @@ void board_silicon_USB2_override(SILICON_INIT_UPD *params)
params->Usb2Port3PerPortTxiSet = 0;
params->Usb2Port3IUsbTxEmphasisEn = 2;
params->Usb2Port3PerPortTxPeHalf = 1;
+
+ //Follow Intel recommendation to set
+ //BSW D-stepping PERPORTRXISET 2 (low strength)
+ params->D0Usb2Port0PerPortRXISet = 2;
+ params->D0Usb2Port1PerPortRXISet = 2;
+ params->D0Usb2Port2PerPortRXISet = 2;
+ params->D0Usb2Port3PerPortRXISet = 2;
+ params->D0Usb2Port4PerPortRXISet = 2;
}
}
diff --git a/src/mainboard/google/eve/spd/spd.c b/src/mainboard/google/eve/spd/spd.c
index 2f365a7b5c..077bed4bf1 100644
--- a/src/mainboard/google/eve/spd/spd.c
+++ b/src/mainboard/google/eve/spd/spd.c
@@ -19,7 +19,6 @@
#include
#include
#include
-#include
#include
#include
diff --git a/src/mainboard/google/foster/pmic.c b/src/mainboard/google/foster/pmic.c
index e3efd34529..13e2a4743f 100644
--- a/src/mainboard/google/foster/pmic.c
+++ b/src/mainboard/google/foster/pmic.c
@@ -34,10 +34,6 @@ struct max77620_init_reg {
u8 delay;
};
-static struct max77620_init_reg init_list[] = {
- /* TODO */
-};
-
static void pmic_write_reg(unsigned bus, uint8_t reg, uint8_t val, int delay)
{
if (i2c_writeb(bus, MAX77620_I2C_ADDR, reg, val)) {
@@ -51,20 +47,8 @@ static void pmic_write_reg(unsigned bus, uint8_t reg, uint8_t val, int delay)
}
}
-static void pmic_slam_defaults(unsigned bus)
-{
- int i;
- for (i = 0; i < ARRAY_SIZE(init_list); i++) {
- struct max77620_init_reg *reg = &init_list[i];
- pmic_write_reg(bus, reg->reg, reg->val, reg->delay);
- }
-}
-
void pmic_init(unsigned bus)
{
- /* Restore PMIC POR defaults, in case kernel changed 'em */
- pmic_slam_defaults(bus);
-
/* Setup/Enable GPIO5 - VDD_CPU_REG_EN */
pmic_write_reg(bus, MAX77620_GPIO5_REG, 0x09, 1);
diff --git a/src/mainboard/google/glados/romstage.c b/src/mainboard/google/glados/romstage.c
index 81f0866dd6..47524c28ba 100644
--- a/src/mainboard/google/glados/romstage.c
+++ b/src/mainboard/google/glados/romstage.c
@@ -15,16 +15,16 @@
* GNU General Public License for more details.
*/
-#include
+#include
#include
#include
-#include
-#include
#include
-#include "spd/spd.h"
#include
#include
+#include "spd/spd_util.h"
+#include "spd/spd.h"
+
void mainboard_romstage_entry(struct romstage_params *params)
{
#ifdef EC_ENABLE_KEYBOARD_BACKLIGHT
@@ -32,18 +32,6 @@ void mainboard_romstage_entry(struct romstage_params *params)
if (params->power_state->prev_sleep_state != ACPI_S3)
google_chromeec_kbbacklight(25);
#endif
- /* Get SPD index */
- gpio_t spd_gpios[] = {
- GPIO_MEM_CONFIG_0,
- GPIO_MEM_CONFIG_1,
- GPIO_MEM_CONFIG_2,
- GPIO_MEM_CONFIG_3,
- };
- params->pei_data->mem_cfg_id =
- gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios));
- /* Fill out PEI DATA */
- mainboard_fill_pei_data(params->pei_data);
- mainboard_fill_spd_data(params->pei_data);
/* Initialize memory */
romstage_common(params);
}
@@ -51,26 +39,18 @@ void mainboard_romstage_entry(struct romstage_params *params)
void mainboard_memory_init_params(struct romstage_params *params,
MEMORY_INIT_UPD *memory_params)
{
- if (params->pei_data->spd_data[0][0][0] != 0) {
- memory_params->MemorySpdPtr00 =
- (UINT32)(params->pei_data->spd_data[0][0]);
- memory_params->MemorySpdPtr10 =
- (UINT32)(params->pei_data->spd_data[1][0]);
- }
- memcpy(memory_params->DqByteMapCh0, params->pei_data->dq_map[0],
- sizeof(params->pei_data->dq_map[0]));
- memcpy(memory_params->DqByteMapCh1, params->pei_data->dq_map[1],
- sizeof(params->pei_data->dq_map[1]));
- memcpy(memory_params->DqsMapCpu2DramCh0, params->pei_data->dqs_map[0],
- sizeof(params->pei_data->dqs_map[0]));
- memcpy(memory_params->DqsMapCpu2DramCh1, params->pei_data->dqs_map[1],
- sizeof(params->pei_data->dqs_map[1]));
- memcpy(memory_params->RcompResistor, params->pei_data->RcompResistor,
- sizeof(params->pei_data->RcompResistor));
- memcpy(memory_params->RcompTarget, params->pei_data->RcompTarget,
- sizeof(params->pei_data->RcompTarget));
+ /* Get SPD index */
+ const gpio_t spd_gpios[] = {
+ GPIO_MEM_CONFIG_0,
+ GPIO_MEM_CONFIG_1,
+ GPIO_MEM_CONFIG_2,
+ GPIO_MEM_CONFIG_3,
+ };
+ const int spd_idx = gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios));
+
memory_params->MemorySpdDataLen = SPD_LEN;
memory_params->DqPinsInterleaved = FALSE;
- if (CONFIG(BOARD_GOOGLE_CAROLINE))
- memory_params->DdrFreqLimit = 1600;
+
+ spd_memory_init_params(memory_params, spd_idx);
+ variant_memory_init_params(memory_params, spd_idx);
}
diff --git a/src/mainboard/google/glados/spd/spd.c b/src/mainboard/google/glados/spd/spd.c
index 391b702172..b3cf3f9416 100644
--- a/src/mainboard/google/glados/spd/spd.c
+++ b/src/mainboard/google/glados/spd/spd.c
@@ -19,10 +19,11 @@
#include
#include
#include
-#include
#include
#include
#include
+
+#include "spd_util.h"
#include "spd.h"
static void mainboard_print_spd_info(uint8_t spd[])
@@ -83,13 +84,11 @@ __weak int is_dual_channel(const int spd_index)
}
/* Copy SPD data for on-board memory */
-void mainboard_fill_spd_data(struct pei_data *pei_data)
+void spd_memory_init_params(MEMORY_INIT_UPD *const memory_params, int spd_index)
{
- char *spd_file;
+ uint8_t *spd_file;
size_t spd_file_len;
- int spd_index;
- spd_index = pei_data->mem_cfg_id;
printk(BIOS_INFO, "SPD index %d\n", spd_index);
/* Load SPD data from CBFS */
@@ -108,15 +107,15 @@ void mainboard_fill_spd_data(struct pei_data *pei_data)
spd_index = 1;
}
- /* Assume same memory in both channels */
- spd_index *= SPD_LEN;
- memcpy(pei_data->spd_data[0][0], spd_file + spd_index, SPD_LEN);
- if (is_dual_channel(spd_index))
- memcpy(pei_data->spd_data[1][0], spd_file + spd_index, SPD_LEN);
-
+ const size_t spd_offset = spd_index * SPD_LEN;
/* Make sure a valid SPD was found */
- if (pei_data->spd_data[0][0][0] == 0)
+ if (spd_file[spd_offset] == 0)
die("Invalid SPD data.");
- mainboard_print_spd_info(pei_data->spd_data[0][0]);
+ /* Assume same memory in both channels */
+ memory_params->MemorySpdPtr00 = (uintptr_t)spd_file + spd_offset;
+ if (is_dual_channel(spd_index))
+ memory_params->MemorySpdPtr10 = memory_params->MemorySpdPtr00;
+
+ mainboard_print_spd_info(spd_file + spd_offset);
}
diff --git a/src/soc/intel/braswell/include/soc/pei_wrapper.h b/src/mainboard/google/glados/spd/spd_util.h
similarity index 62%
rename from src/soc/intel/braswell/include/soc/pei_wrapper.h
rename to src/mainboard/google/glados/spd/spd_util.h
index 3222328bef..90dbd5ff98 100644
--- a/src/soc/intel/braswell/include/soc/pei_wrapper.h
+++ b/src/mainboard/google/glados/spd/spd_util.h
@@ -1,8 +1,6 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Google Inc.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -13,14 +11,11 @@
* GNU General Public License for more details.
*/
-#ifndef _SOC_PEI_WRAPPER_H_
-#define _SOC_PEI_WRAPPER_H_
+#ifndef SPD_UTIL_H
+#define SPD_UTIL_H
-#include
+#include
-typedef int ABI_X86(*pei_wrapper_entry_t)(struct pei_data *pei_data);
+void spd_memory_init_params(MEMORY_INIT_UPD *, int spd_index);
-void broadwell_fill_pei_data(struct pei_data *pei_data);
-void mainboard_fill_pei_data(struct pei_data *pei_data);
-
-#endif
+#endif /* SPD_UTIL_H */
diff --git a/src/mainboard/google/glados/variants/asuka/variant.c b/src/mainboard/google/glados/variants/asuka/variant.c
index 13cfe4fecd..4c778970fe 100644
--- a/src/mainboard/google/glados/variants/asuka/variant.c
+++ b/src/mainboard/google/glados/variants/asuka/variant.c
@@ -17,10 +17,10 @@
#include
#include
#include
-#include
-#include
+#include
-void mainboard_fill_pei_data(struct pei_data *pei_data)
+void variant_memory_init_params(
+ MEMORY_INIT_UPD *const memory_params, const int spd_index)
{
/* DQ byte map */
const u8 dq_map[2][12] = {
@@ -39,12 +39,14 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
/* Rcomp target */
const u16 RcompTarget[5] = { 100, 40, 40, 23, 40 };
- memcpy(pei_data->dq_map, dq_map, sizeof(dq_map));
- memcpy(pei_data->dqs_map, dqs_map, sizeof(dqs_map));
- memcpy(pei_data->RcompResistor, RcompResistor,
- sizeof(RcompResistor));
- memcpy(pei_data->RcompTarget, RcompTarget,
- sizeof(RcompTarget));
+ memcpy(memory_params->DqByteMapCh0, dq_map,
+ sizeof(memory_params->DqByteMapCh0) * 2);
+ memcpy(memory_params->DqsMapCpu2DramCh0, dqs_map,
+ sizeof(memory_params->DqsMapCpu2DramCh0) * 2);
+ memcpy(memory_params->RcompResistor, RcompResistor,
+ sizeof(memory_params->RcompResistor));
+ memcpy(memory_params->RcompTarget, RcompTarget,
+ sizeof(memory_params->RcompTarget));
}
int is_dual_channel(const int spd_index)
diff --git a/src/mainboard/google/glados/variants/baseboard/include/baseboard/variant.h b/src/mainboard/google/glados/variants/baseboard/include/baseboard/variant.h
index bbab7fc1f5..72eef684b8 100644
--- a/src/mainboard/google/glados/variants/baseboard/include/baseboard/variant.h
+++ b/src/mainboard/google/glados/variants/baseboard/include/baseboard/variant.h
@@ -15,7 +15,10 @@
#ifndef GLADOS_VARIANT_H
#define GLADOS_VARIANT_H
+#include
+
int is_dual_channel(const int spd_index);
void mainboard_gpio_smi_sleep(void);
+void variant_memory_init_params(MEMORY_INIT_UPD *memory_params, int spd_index);
#endif /* GLADOS_VARIANT_H */
diff --git a/src/mainboard/google/glados/variants/caroline/variant.c b/src/mainboard/google/glados/variants/caroline/variant.c
index a00eacf0ed..d61a538d56 100644
--- a/src/mainboard/google/glados/variants/caroline/variant.c
+++ b/src/mainboard/google/glados/variants/caroline/variant.c
@@ -15,14 +15,14 @@
*/
#include
+#include
#include
#include
#include
-#include
-#include
#include
-void mainboard_fill_pei_data(struct pei_data *pei_data)
+void variant_memory_init_params(
+ MEMORY_INIT_UPD *const memory_params, const int spd_index)
{
/* DQ byte map */
const u8 dq_map[2][12] = {
@@ -41,12 +41,15 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
/* Rcomp target */
const u16 RcompTarget[5] = { 100, 40, 40, 23, 40 };
- memcpy(pei_data->dq_map, dq_map, sizeof(dq_map));
- memcpy(pei_data->dqs_map, dqs_map, sizeof(dqs_map));
- memcpy(pei_data->RcompResistor, RcompResistor,
- sizeof(RcompResistor));
- memcpy(pei_data->RcompTarget, RcompTarget,
- sizeof(RcompTarget));
+ memcpy(memory_params->DqByteMapCh0, dq_map,
+ sizeof(memory_params->DqByteMapCh0) * 2);
+ memcpy(memory_params->DqsMapCpu2DramCh0, dqs_map,
+ sizeof(memory_params->DqsMapCpu2DramCh0) * 2);
+ memcpy(memory_params->RcompResistor, RcompResistor,
+ sizeof(memory_params->RcompResistor));
+ memcpy(memory_params->RcompTarget, RcompTarget,
+ sizeof(memory_params->RcompTarget));
+ memory_params->DdrFreqLimit = 1600;
}
void mainboard_gpio_smi_sleep(void)
diff --git a/src/mainboard/google/glados/variants/cave/variant.c b/src/mainboard/google/glados/variants/cave/variant.c
index 2ce0a9001c..fc27fb4b61 100644
--- a/src/mainboard/google/glados/variants/cave/variant.c
+++ b/src/mainboard/google/glados/variants/cave/variant.c
@@ -15,14 +15,14 @@
*/
#include
+#include
#include
#include
#include
-#include
-#include
#include
-void mainboard_fill_pei_data(struct pei_data *pei_data)
+void variant_memory_init_params(
+ MEMORY_INIT_UPD *const memory_params, const int spd_index)
{
/* DQ byte map */
const u8 dq_map[2][12] = {
@@ -41,12 +41,14 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
/* Rcomp target */
const u16 RcompTarget[5] = { 100, 40, 40, 23, 40 };
- memcpy(pei_data->dq_map, dq_map, sizeof(dq_map));
- memcpy(pei_data->dqs_map, dqs_map, sizeof(dqs_map));
- memcpy(pei_data->RcompResistor, RcompResistor,
- sizeof(RcompResistor));
- memcpy(pei_data->RcompTarget, RcompTarget,
- sizeof(RcompTarget));
+ memcpy(memory_params->DqByteMapCh0, dq_map,
+ sizeof(memory_params->DqByteMapCh0) * 2);
+ memcpy(memory_params->DqsMapCpu2DramCh0, dqs_map,
+ sizeof(memory_params->DqsMapCpu2DramCh0) * 2);
+ memcpy(memory_params->RcompResistor, RcompResistor,
+ sizeof(memory_params->RcompResistor));
+ memcpy(memory_params->RcompTarget, RcompTarget,
+ sizeof(memory_params->RcompTarget));
}
void mainboard_gpio_smi_sleep(void)
diff --git a/src/mainboard/google/glados/variants/chell/variant.c b/src/mainboard/google/glados/variants/chell/variant.c
index da83ed0f7d..2d1b363cab 100644
--- a/src/mainboard/google/glados/variants/chell/variant.c
+++ b/src/mainboard/google/glados/variants/chell/variant.c
@@ -15,14 +15,14 @@
*/
#include
+#include
#include
#include
#include
-#include
-#include
#include
-void mainboard_fill_pei_data(struct pei_data *pei_data)
+void variant_memory_init_params(
+ MEMORY_INIT_UPD *const memory_params, const int spd_index)
{
/* DQ byte map */
const u8 dq_map[2][12] = {
@@ -41,12 +41,14 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
/* Rcomp target */
const u16 RcompTarget[5] = { 100, 40, 40, 23, 40 };
- memcpy(pei_data->dq_map, dq_map, sizeof(dq_map));
- memcpy(pei_data->dqs_map, dqs_map, sizeof(dqs_map));
- memcpy(pei_data->RcompResistor, RcompResistor,
- sizeof(RcompResistor));
- memcpy(pei_data->RcompTarget, RcompTarget,
- sizeof(RcompTarget));
+ memcpy(memory_params->DqByteMapCh0, dq_map,
+ sizeof(memory_params->DqByteMapCh0) * 2);
+ memcpy(memory_params->DqsMapCpu2DramCh0, dqs_map,
+ sizeof(memory_params->DqsMapCpu2DramCh0) * 2);
+ memcpy(memory_params->RcompResistor, RcompResistor,
+ sizeof(memory_params->RcompResistor));
+ memcpy(memory_params->RcompTarget, RcompTarget,
+ sizeof(memory_params->RcompTarget));
}
void mainboard_gpio_smi_sleep(void)
diff --git a/src/mainboard/google/glados/variants/glados/variant.c b/src/mainboard/google/glados/variants/glados/variant.c
index 2ce0a9001c..fc27fb4b61 100644
--- a/src/mainboard/google/glados/variants/glados/variant.c
+++ b/src/mainboard/google/glados/variants/glados/variant.c
@@ -15,14 +15,14 @@
*/
#include
+#include
#include
#include
#include
-#include
-#include
#include
-void mainboard_fill_pei_data(struct pei_data *pei_data)
+void variant_memory_init_params(
+ MEMORY_INIT_UPD *const memory_params, const int spd_index)
{
/* DQ byte map */
const u8 dq_map[2][12] = {
@@ -41,12 +41,14 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
/* Rcomp target */
const u16 RcompTarget[5] = { 100, 40, 40, 23, 40 };
- memcpy(pei_data->dq_map, dq_map, sizeof(dq_map));
- memcpy(pei_data->dqs_map, dqs_map, sizeof(dqs_map));
- memcpy(pei_data->RcompResistor, RcompResistor,
- sizeof(RcompResistor));
- memcpy(pei_data->RcompTarget, RcompTarget,
- sizeof(RcompTarget));
+ memcpy(memory_params->DqByteMapCh0, dq_map,
+ sizeof(memory_params->DqByteMapCh0) * 2);
+ memcpy(memory_params->DqsMapCpu2DramCh0, dqs_map,
+ sizeof(memory_params->DqsMapCpu2DramCh0) * 2);
+ memcpy(memory_params->RcompResistor, RcompResistor,
+ sizeof(memory_params->RcompResistor));
+ memcpy(memory_params->RcompTarget, RcompTarget,
+ sizeof(memory_params->RcompTarget));
}
void mainboard_gpio_smi_sleep(void)
diff --git a/src/mainboard/google/glados/variants/lars/variant.c b/src/mainboard/google/glados/variants/lars/variant.c
index 4fe88ef7c8..cff0096291 100644
--- a/src/mainboard/google/glados/variants/lars/variant.c
+++ b/src/mainboard/google/glados/variants/lars/variant.c
@@ -17,8 +17,7 @@
#include
#include
#include
-#include
-#include
+#include
#define K4E6E304EB_MEM_ID 0x5
@@ -29,7 +28,8 @@
#define MEM_SINGLE_CHANB 0xb
#define MEM_SINGLE_CHANC 0xc
-void mainboard_fill_pei_data(struct pei_data *pei_data)
+void variant_memory_init_params(
+ MEMORY_INIT_UPD *const params, const int spd_index)
{
/* DQ byte map */
const u8 dq_map[2][12] = {
@@ -54,17 +54,18 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
/* Default Rcomp Target assignment */
const u16 *targeted_rcomp = RcompTarget;
- memcpy(pei_data->dq_map, dq_map, sizeof(dq_map));
- memcpy(pei_data->dqs_map, dqs_map, sizeof(dqs_map));
- memcpy(pei_data->RcompResistor, RcompResistor,
- sizeof(RcompResistor));
-
/* Override Rcomp Target assignment for specific SKU(s) */
- if (pei_data->mem_cfg_id == K4E6E304EB_MEM_ID)
+ if (spd_index == K4E6E304EB_MEM_ID)
targeted_rcomp = StrengthendRcompTarget;
- memcpy(pei_data->RcompTarget, targeted_rcomp,
- sizeof(pei_data->RcompTarget));
+ memcpy(params->DqByteMapCh0, dq_map,
+ sizeof(params->DqByteMapCh0) * 2);
+ memcpy(params->DqsMapCpu2DramCh0, dqs_map,
+ sizeof(params->DqsMapCpu2DramCh0) * 2);
+ memcpy(params->RcompResistor, RcompResistor,
+ sizeof(params->RcompResistor));
+ memcpy(params->RcompTarget, targeted_rcomp,
+ sizeof(params->RcompTarget));
}
int is_dual_channel(const int spd_index)
diff --git a/src/mainboard/google/glados/variants/sentry/variant.c b/src/mainboard/google/glados/variants/sentry/variant.c
index 00f49fecf7..4c7fa23f08 100644
--- a/src/mainboard/google/glados/variants/sentry/variant.c
+++ b/src/mainboard/google/glados/variants/sentry/variant.c
@@ -17,12 +17,12 @@
#include
#include
#include
-#include
-#include
+#include
#define K4E6E304EE_MEM_ID 0x3
-void mainboard_fill_pei_data(struct pei_data *pei_data)
+void variant_memory_init_params(
+ MEMORY_INIT_UPD *const memory_params, const int spd_index)
{
/* DQ byte map */
const u8 dq_map[2][12] = {
@@ -47,15 +47,16 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
/* Default Rcomp Target assignment */
const u16 *targeted_rcomp = RcompTarget;
- memcpy(pei_data->dq_map, dq_map, sizeof(dq_map));
- memcpy(pei_data->dqs_map, dqs_map, sizeof(dqs_map));
- memcpy(pei_data->RcompResistor, RcompResistor,
- sizeof(RcompResistor));
-
/* Override Rcomp Target assignment for specific SKU(s) */
- if (pei_data->mem_cfg_id == K4E6E304EE_MEM_ID)
+ if (spd_index == K4E6E304EE_MEM_ID)
targeted_rcomp = StrengthendRcompTarget;
- memcpy(pei_data->RcompTarget, targeted_rcomp,
- sizeof(pei_data->RcompTarget));
+ memcpy(memory_params->DqByteMapCh0, dq_map,
+ sizeof(memory_params->DqByteMapCh0) * 2);
+ memcpy(memory_params->DqsMapCpu2DramCh0, dqs_map,
+ sizeof(memory_params->DqsMapCpu2DramCh0) * 2);
+ memcpy(memory_params->RcompResistor, RcompResistor,
+ sizeof(memory_params->RcompResistor));
+ memcpy(memory_params->RcompTarget, targeted_rcomp,
+ sizeof(memory_params->RcompTarget));
}
diff --git a/src/mainboard/google/hatch/Kconfig b/src/mainboard/google/hatch/Kconfig
index 07ae7d214e..09f792128c 100644
--- a/src/mainboard/google/hatch/Kconfig
+++ b/src/mainboard/google/hatch/Kconfig
@@ -64,7 +64,7 @@ config GBB_HWID
depends on CHROMEOS
default "HATCH TEST 1823" if BOARD_GOOGLE_HATCH
default "HATCH_WHL TEST 2374" if BOARD_GOOGLE_HATCH_WHL
- default "KOHAKU TEST 1953" if BOARD_GOOGLE_HATCH_WHL
+ default "KOHAKU TEST 1953" if BOARD_GOOGLE_KOHAKU
config MAINBOARD_DIR
string
diff --git a/src/mainboard/google/hatch/variants/baseboard/gpio.c b/src/mainboard/google/hatch/variants/baseboard/gpio.c
index 198d930aba..32526cc74b 100644
--- a/src/mainboard/google/hatch/variants/baseboard/gpio.c
+++ b/src/mainboard/google/hatch/variants/baseboard/gpio.c
@@ -30,8 +30,8 @@ static const struct pad_config gpio_table[] = {
PAD_CFG_GPI_INT(GPP_A6, NONE, PLTRST, LEVEL),
/* A7 : PP3300_SOC_A */
PAD_NC(GPP_A7, NONE),
- /* A8 : EMR_GARAGE_DET */
- PAD_CFG_GPI_GPIO_DRIVER(GPP_A8, NONE, DEEP),
+ /* A8 : PEN_GARAGE_DET_L */
+ PAD_CFG_GPI_GPIO_DRIVER_SCI(GPP_A8, NONE, DEEP, LEVEL, NONE),
/* A9 : ESPI_CLK */
/* A10 : FPMCU_PCH_BOOT1 */
PAD_CFG_GPO(GPP_A10, 0, DEEP),
diff --git a/src/mainboard/google/hatch/variants/hatch/overridetree.cb b/src/mainboard/google/hatch/variants/hatch/overridetree.cb
index 4b1b8d85f2..562bb8b229 100644
--- a/src/mainboard/google/hatch/variants/hatch/overridetree.cb
+++ b/src/mainboard/google/hatch/variants/hatch/overridetree.cb
@@ -78,15 +78,17 @@ chip soc/intel/cannonlake
register "generic.probed" = "1"
register "generic.reset_gpio" =
"ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_D15)"
- register "generic.reset_delay_ms" = "30"
- register "generic.reset_off_delay_ms" = "3"
+ register "generic.reset_delay_ms" = "10"
+ register "generic.reset_off_delay_ms" = "1"
register "generic.has_power_resource" = "1"
register "hid_desc_reg_offset" = "0x01"
device i2c 5d on end
end
chip drivers/generic/gpio_keys
register "name" = ""PENH""
- register "gpio" = "ACPI_GPIO_INPUT_ACTIVE_HIGH(GPP_A8)"
+ register "gpio" = "ACPI_GPIO_IRQ_EDGE_BOTH(GPP_A8)"
+ register "key.wake" = "GPE0_DW0_08"
+ register "key.wakeup_event_action" = "EV_ACT_ASSERTED"
register "key.dev_name" = ""EJCT""
register "key.linux_code" = "SW_PEN_INSERTED"
register "key.linux_input_type" = "EV_SW"
diff --git a/src/mainboard/google/hatch/variants/hatch_whl/overridetree.cb b/src/mainboard/google/hatch/variants/hatch_whl/overridetree.cb
index c5d5964663..eec7880752 100644
--- a/src/mainboard/google/hatch/variants/hatch_whl/overridetree.cb
+++ b/src/mainboard/google/hatch/variants/hatch_whl/overridetree.cb
@@ -63,15 +63,17 @@ chip soc/intel/cannonlake
register "generic.probed" = "1"
register "generic.reset_gpio" =
"ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_D15)"
- register "generic.reset_delay_ms" = "30"
- register "generic.reset_off_delay_ms" = "3"
+ register "generic.reset_delay_ms" = "10"
+ register "generic.reset_off_delay_ms" = "1"
register "generic.has_power_resource" = "1"
register "hid_desc_reg_offset" = "0x01"
device i2c 5d on end
end
chip drivers/generic/gpio_keys
register "name" = ""PENH""
- register "gpio" = "ACPI_GPIO_INPUT_ACTIVE_HIGH(GPP_A8)"
+ register "gpio" = "ACPI_GPIO_IRQ_EDGE_BOTH(GPP_A8)"
+ register "key.wake" = "GPE0_DW0_08"
+ register "key.wakeup_event_action" = "EV_ACT_ASSERTED"
register "key.dev_name" = ""EJCT""
register "key.linux_code" = "SW_PEN_INSERTED"
register "key.linux_input_type" = "EV_SW"
diff --git a/src/mainboard/google/kahlee/mainboard.c b/src/mainboard/google/kahlee/mainboard.c
index 1bf6c07045..ad979a567f 100644
--- a/src/mainboard/google/kahlee/mainboard.c
+++ b/src/mainboard/google/kahlee/mainboard.c
@@ -145,13 +145,13 @@ static void mainboard_init(void *chip_info)
pm_write8(PM_PCIB_CFG, pm_read8(PM_PCIB_CFG) | PM_GENINT_DISABLE);
/* Set low-power mode for BayHub eMMC bridge's PCIe clock. */
- clrsetbits_le32((uint32_t *)(MISC_MMIO_BASE + GPP_CLK_CNTRL),
+ clrsetbits_le32((uint32_t *)(ACPIMMIO_MISC_BASE + GPP_CLK_CNTRL),
GPP_CLK2_REQ_MAP_MASK,
GPP_CLK2_REQ_MAP_CLK_REQ2 <<
GPP_CLK2_REQ_MAP_SHIFT);
/* Same for the WiFi */
- clrsetbits_le32((uint32_t *)(MISC_MMIO_BASE + GPP_CLK_CNTRL),
+ clrsetbits_le32((uint32_t *)(ACPIMMIO_MISC_BASE + GPP_CLK_CNTRL),
GPP_CLK0_REQ_MAP_MASK,
GPP_CLK0_REQ_MAP_CLK_REQ0 <<
GPP_CLK0_REQ_MAP_SHIFT);
diff --git a/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/acpi/audio.asl b/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/acpi/audio.asl
index 6bb41ae6b3..87890daf36 100644
--- a/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/acpi/audio.asl
+++ b/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/acpi/audio.asl
@@ -35,7 +35,7 @@ Device (I2S)
Name (RBUF, ResourceTemplate () {
// Memory resource is for MISC FCH register set.
// It is needed for enabling the clock.
- Memory32Fixed(ReadWrite, MISC_MMIO_BASE, 0x100)
+ Memory32Fixed(ReadWrite, ACPIMMIO_MISC_BASE, 0x100)
})
Return (RBUF)
diff --git a/src/mainboard/google/kahlee/variants/baseboard/spd/micron-MT40A512M16TB-062E-J.spd.hex b/src/mainboard/google/kahlee/variants/baseboard/spd/micron-MT40A512M16TB-062E-J.spd.hex
index d4afea7263..67640fe849 100644
--- a/src/mainboard/google/kahlee/variants/baseboard/spd/micron-MT40A512M16TB-062E-J.spd.hex
+++ b/src/mainboard/google/kahlee/variants/baseboard/spd/micron-MT40A512M16TB-062E-J.spd.hex
@@ -6,7 +6,7 @@
16 36 0B 35 00 00 16 36 0B 35 16 36 0B 35 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-00 00 00 00 00 00 9C B5 00 00 00 00 E7 00 60 5B
+00 00 00 00 00 00 9C B5 00 00 00 00 E7 00 30 53
0F 01 02 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
diff --git a/src/mainboard/google/kukui/chromeos.c b/src/mainboard/google/kukui/chromeos.c
index 44e75e29f0..35395014d6 100644
--- a/src/mainboard/google/kukui/chromeos.c
+++ b/src/mainboard/google/kukui/chromeos.c
@@ -27,6 +27,7 @@ void setup_chromeos_gpios(void)
gpio_input_pullup(EC_IRQ);
gpio_input_pullup(CR50_IRQ);
gpio_output(GPIO_RESET, 0);
+ gpio_output(GPIO_EN_SPK_AMP, 0);
}
void fill_lb_gpios(struct lb_gpios *gpios)
@@ -38,6 +39,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
{EC_IN_RW.id, ACTIVE_HIGH, -1, "EC in RW"},
{EC_IRQ.id, ACTIVE_LOW, -1, "EC interrupt"},
{CR50_IRQ.id, ACTIVE_HIGH, -1, "TPM interrupt"},
+ {GPIO_EN_SPK_AMP.id, ACTIVE_HIGH, -1, "speaker enable"},
};
lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
}
diff --git a/src/mainboard/google/kukui/gpio.h b/src/mainboard/google/kukui/gpio.h
index 92d238ece2..977acc3739 100644
--- a/src/mainboard/google/kukui/gpio.h
+++ b/src/mainboard/google/kukui/gpio.h
@@ -23,6 +23,7 @@
#define EC_IN_RW GPIO(PERIPHERAL_EN14)
#define CR50_IRQ GPIO(PERIPHERAL_EN3)
#define GPIO_RESET GPIO(PERIPHERAL_EN8)
+#define GPIO_EN_SPK_AMP GPIO(PERIPHERAL_EN12)
void setup_chromeos_gpios(void);
diff --git a/src/mainboard/google/kukui/mainboard.c b/src/mainboard/google/kukui/mainboard.c
index e1d8f5fb8d..40b8a49c61 100644
--- a/src/mainboard/google/kukui/mainboard.c
+++ b/src/mainboard/google/kukui/mainboard.c
@@ -16,6 +16,7 @@
#include
#include
#include
+#include
#include
static void configure_emmc(void)
@@ -37,10 +38,22 @@ static void configure_usb(void)
setup_usb_host();
}
+static void configure_audio(void)
+{
+ /* Audio PWR*/
+ mtcmos_audio_power_on();
+
+ /* SoC I2S */
+ gpio_set_mode(GPIO(CAM_RST0), PAD_CAM_RST0_FUNC_I2S2_LRCK);
+ gpio_set_mode(GPIO(CAM_PDN1), PAD_CAM_PDN1_FUNC_I2S2_BCK);
+ gpio_set_mode(GPIO(CAM_PDN0), PAD_CAM_PDN0_FUNC_I2S2_MCK);
+ gpio_set_mode(GPIO(EINT3), PAD_EINT3_FUNC_I2S3_DO);
+}
static void mainboard_init(struct device *dev)
{
configure_emmc();
configure_usb();
+ configure_audio();
}
static void mainboard_enable(struct device *dev)
diff --git a/src/mainboard/google/kukui/romstage.c b/src/mainboard/google/kukui/romstage.c
index 81ae9c538d..baaca43b90 100644
--- a/src/mainboard/google/kukui/romstage.c
+++ b/src/mainboard/google/kukui/romstage.c
@@ -17,6 +17,7 @@
#include
#include
#include
+#include
#include
#include "early_init.h"
@@ -28,6 +29,7 @@ void platform_romstage_main(void)
mainboard_early_init();
mt6358_init();
+ mt_pll_raise_ca53_freq(1989 * MHz);
rtc_boot();
mt_mem_init(get_sdram_config());
mtk_mmu_after_dram();
diff --git a/src/mainboard/google/link/i915.c b/src/mainboard/google/link/i915.c
index e09785d825..12d424cde0 100644
--- a/src/mainboard/google/link/i915.c
+++ b/src/mainboard/google/link/i915.c
@@ -25,19 +25,18 @@
#include
#include
#include
-#include "onboard.h"
-#include "ec.h"
#include
#include
-#include
#include
#include
-
#include
#include
#include
#include
#include
+
+#include "ec.h"
+#include "onboard.h"
#include "i915io.h"
enum {
diff --git a/src/mainboard/google/octopus/romstage.c b/src/mainboard/google/octopus/romstage.c
index 9d8b94d0b9..ff0354dc10 100644
--- a/src/mainboard/google/octopus/romstage.c
+++ b/src/mainboard/google/octopus/romstage.c
@@ -44,7 +44,7 @@ void mainboard_save_dimm_info(void)
if (!CONFIG(DRAM_PART_NUM_ALWAYS_IN_CBI)) {
/* Fall back on part numbers encoded in lp4cfg array. */
- if (board_id() < CONFIG_DRAM_PART_IN_CBI_BOARD_ID_MIN) {
+ if ((int)board_id() < CONFIG_DRAM_PART_IN_CBI_BOARD_ID_MIN) {
save_dimm_info_by_sku_config();
return;
}
diff --git a/src/mainboard/google/octopus/variants/baseboard/memory.c b/src/mainboard/google/octopus/variants/baseboard/memory.c
index aec2ba2a4f..fc7c87dcb2 100644
--- a/src/mainboard/google/octopus/variants/baseboard/memory.c
+++ b/src/mainboard/google/octopus/variants/baseboard/memory.c
@@ -210,7 +210,7 @@ const struct lpddr4_cfg *__weak variant_lpddr4_config(void)
if (!CONFIG(DRAM_PART_NUM_ALWAYS_IN_CBI)) {
/* Fall back non cbi memory config. */
- if (board_id() < CONFIG_DRAM_PART_IN_CBI_BOARD_ID_MIN)
+ if ((int)board_id() < CONFIG_DRAM_PART_IN_CBI_BOARD_ID_MIN)
return &non_cbi_lp4cfg;
}
diff --git a/src/mainboard/google/poppy/Kconfig b/src/mainboard/google/poppy/Kconfig
index 419b10eb3d..6bc8269aa7 100644
--- a/src/mainboard/google/poppy/Kconfig
+++ b/src/mainboard/google/poppy/Kconfig
@@ -10,6 +10,7 @@ config BOARD_GOOGLE_BASEBOARD_POPPY
select EC_GOOGLE_CHROMEEC_LPC
select HAVE_ACPI_RESUME
select HAVE_ACPI_TABLES
+ select INTEL_GMA_HAVE_VBT if BOARD_GOOGLE_NAMI
select INTEL_LPSS_UART_FOR_CONSOLE
select MAINBOARD_HAS_CHROMEOS
select MAINBOARD_USES_FSP2_0
@@ -151,6 +152,7 @@ config VARIANT_SPECIFIC_OPTIONS_ATLAS
select DRIVERS_I2C_MAX98373
select DRIVERS_I2C_DA7219
select DRIVERS_SPI_ACPI
+ select DRIVERS_USB_ACPI
select EXCLUDE_NATIVE_SD_INTERFACE
select MAINBOARD_HAS_SPI_TPM_CR50
select VARIANT_HAS_CAMERA_ACPI
diff --git a/src/mainboard/google/poppy/variants/atlas/devicetree.cb b/src/mainboard/google/poppy/variants/atlas/devicetree.cb
index ad79bcab0e..1ea28a0e5f 100644
--- a/src/mainboard/google/poppy/variants/atlas/devicetree.cb
+++ b/src/mainboard/google/poppy/variants/atlas/devicetree.cb
@@ -265,7 +265,30 @@ chip soc/intel/skylake
device pci 00.0 on end # Host Bridge
device pci 02.0 on end # Integrated Graphics Device
device pci 13.0 off end # Integrated Sensor Hub
- device pci 14.0 on end # USB xHCI
+ device pci 14.0 on
+ chip drivers/usb/acpi
+ register "desc" = ""Root Hub""
+ register "type" = "UPC_TYPE_HUB"
+ device usb 0.0 on
+ chip drivers/usb/acpi
+ register "desc" = ""USB Type C Port 1""
+ register "type" = "UPC_TYPE_C_USB2_SS_SWITCH"
+ device usb 2.0 on end
+ end
+ chip drivers/usb/acpi
+ register "desc" = ""Bluetooth""
+ register "type" = "UPC_TYPE_INTERNAL"
+ register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_E2)"
+ device usb 2.2 on end
+ end
+ chip drivers/usb/acpi
+ register "desc" = ""USB Type C Port 2""
+ register "type" = "UPC_TYPE_C_USB2_SS_SWITCH"
+ device usb 2.4 on end
+ end
+ end
+ end
+ end # USB xHCI
device pci 14.1 on end # USB xDCI (OTG)
device pci 14.2 on end # Thermal Subsystem
device pci 15.0 on
diff --git a/src/mainboard/google/poppy/variants/nami/Makefile.inc b/src/mainboard/google/poppy/variants/nami/Makefile.inc
index dc80357835..0033c60ee7 100644
--- a/src/mainboard/google/poppy/variants/nami/Makefile.inc
+++ b/src/mainboard/google/poppy/variants/nami/Makefile.inc
@@ -43,3 +43,6 @@ oem.bin-file := $(call strip_quotes,$(CONFIG_OEM_BIN_FILE))
oem.bin-type := raw
$(call add_vbt_to_cbfs, vbt-bard.bin, bard-data.vbt)
+$(call add_vbt_to_cbfs, vbt-akali.bin, akali-data.vbt)
+$(call add_vbt_to_cbfs, vbt-pantheon.bin, pantheon-data.vbt)
+$(call add_vbt_to_cbfs, vbt-vayne.bin, vayne-data.vbt)
diff --git a/src/mainboard/google/poppy/variants/nami/vbt-akali.bin b/src/mainboard/google/poppy/variants/nami/akali-data.vbt
similarity index 100%
rename from src/mainboard/google/poppy/variants/nami/vbt-akali.bin
rename to src/mainboard/google/poppy/variants/nami/akali-data.vbt
diff --git a/src/mainboard/google/poppy/variants/nami/data.vbt b/src/mainboard/google/poppy/variants/nami/data.vbt
new file mode 100644
index 0000000000..84063621d0
Binary files /dev/null and b/src/mainboard/google/poppy/variants/nami/data.vbt differ
diff --git a/src/mainboard/google/poppy/variants/nami/pantheon-data.vbt b/src/mainboard/google/poppy/variants/nami/pantheon-data.vbt
new file mode 100644
index 0000000000..7e4fb0afe5
Binary files /dev/null and b/src/mainboard/google/poppy/variants/nami/pantheon-data.vbt differ
diff --git a/src/mainboard/google/poppy/variants/nami/vayne-data.vbt b/src/mainboard/google/poppy/variants/nami/vayne-data.vbt
new file mode 100644
index 0000000000..7e4fb0afe5
Binary files /dev/null and b/src/mainboard/google/poppy/variants/nami/vayne-data.vbt differ
diff --git a/src/mainboard/google/sarien/Kconfig b/src/mainboard/google/sarien/Kconfig
index c48a908dc1..e6d1f1f60f 100644
--- a/src/mainboard/google/sarien/Kconfig
+++ b/src/mainboard/google/sarien/Kconfig
@@ -16,7 +16,6 @@ config BOARD_GOOGLE_BASEBOARD_SARIEN
select MAINBOARD_HAS_CHROMEOS
select MAINBOARD_HAS_I2C_TPM_CR50
select MAINBOARD_HAS_TPM2
- select SOC_INTEL_COMMON_ACPI_EC_PTS_WAK
select SOC_INTEL_WHISKEYLAKE
select SOC_INTEL_COMMON_BLOCK_HDA_VERB
select SOC_INTEL_COMMON_BLOCK_SMM_ESPI_DISABLE
diff --git a/src/mainboard/google/sarien/dsdt.asl b/src/mainboard/google/sarien/dsdt.asl
index e5b0ccad2e..58e0704deb 100644
--- a/src/mainboard/google/sarien/dsdt.asl
+++ b/src/mainboard/google/sarien/dsdt.asl
@@ -40,6 +40,8 @@ DefinitionBlock(
#include
#include
}
+ /* Per board variant mainboard hooks. */
+ #include
}
#if CONFIG(CHROMEOS)
diff --git a/src/mainboard/google/sarien/variants/arcada/devicetree.cb b/src/mainboard/google/sarien/variants/arcada/devicetree.cb
index cf64c4bb89..27c61f3563 100644
--- a/src/mainboard/google/sarien/variants/arcada/devicetree.cb
+++ b/src/mainboard/google/sarien/variants/arcada/devicetree.cb
@@ -37,10 +37,10 @@ chip soc/intel/cannonlake
register "tdp_pl2_override" = "51"
register "Device4Enable" = "1"
register "AcousticNoiseMitigation" = "1"
- register "SlowSlewRateForIa" = "0"
- register "SlowSlewRateForGt" = "0"
+ register "SlowSlewRateForIa" = "2"
+ register "SlowSlewRateForGt" = "2"
register "SlowSlewRateForSa" = "0"
- register "SlowSlewRateForFivr" = "0"
+ register "SlowSlewRateForFivr" = "2"
# Enable eDP device
register "DdiPortEdp" = "1"
# Enable HPD for DDI ports B/C
@@ -161,7 +161,7 @@ chip soc/intel/cannonlake
#| I2C4 | H1 TPM |
#+-------------------+---------------------------+
- register "tcc_offset" = "10"
+ register "tcc_offset" = "1"
register "common_soc_config" = "{
.chipset_lockdown = CHIPSET_LOCKDOWN_COREBOOT,
@@ -349,11 +349,15 @@ chip soc/intel/cannonlake
device pci 1c.5 off end # PCI Express Port 6
device pci 1c.6 off end # PCI Express Port 7
device pci 1c.7 off end # PCI Express Port 8
- device pci 1d.0 on end # PCI Express Port 9
+ device pci 1d.0 on
+ smbios_slot_desc "SlotTypeM2Socket1_SD" "SlotLengthOther" "2230" "SlotDataBusWidth1X"
+ end # PCI Express Port 9
device pci 1d.1 on end # PCI Express Port 10
device pci 1d.2 on end # PCI Express Port 11
device pci 1d.3 off end # PCI Express Port 12
- device pci 1d.4 on end # PCI Express Port 13 (x4)
+ device pci 1d.4 on
+ smbios_slot_desc "SlotTypeM2Socket3" "SlotLengthOther" "2280" "SlotDataBusWidth4X"
+ end # PCI Express Port 13 (x4)
device pci 1e.0 off end # UART #0
device pci 1e.1 off end # UART #1
device pci 1e.2 off end # GSPI #0
diff --git a/src/mainboard/google/sarien/variants/arcada/include/variant/acpi/dptf.asl b/src/mainboard/google/sarien/variants/arcada/include/variant/acpi/dptf.asl
index 6fa06c7d73..4d380713e2 100644
--- a/src/mainboard/google/sarien/variants/arcada/include/variant/acpi/dptf.asl
+++ b/src/mainboard/google/sarien/variants/arcada/include/variant/acpi/dptf.asl
@@ -13,14 +13,14 @@
* GNU General Public License for more details.
*/
-#define DPTF_CPU_PASSIVE 96
-#define DPTF_CPU_CRITICAL 103
+#define DPTF_CPU_PASSIVE 90
+#define DPTF_CPU_CRITICAL 105
/* Skin Sensor for CPU VR temperature monitor */
#define DPTF_TSR0_SENSOR_ID 1
#define DPTF_TSR0_SENSOR_NAME "Skin"
-#define DPTF_TSR0_PASSIVE 56
-#define DPTF_TSR0_CRITICAL 108
+#define DPTF_TSR0_PASSIVE 60
+#define DPTF_TSR0_CRITICAL 105
/* Memory Sensor for DDR temperature monitor */
#define DPTF_TSR1_SENSOR_ID 2
@@ -31,24 +31,24 @@
/* M.2 Sensor for Ambient temperature monitor */
#define DPTF_TSR2_SENSOR_ID 3
#define DPTF_TSR2_SENSOR_NAME "Ambient"
-#define DPTF_TSR2_PASSIVE 50
-#define DPTF_TSR2_CRITICAL 95
+#define DPTF_TSR2_PASSIVE 37
+#define DPTF_TSR2_CRITICAL 80
#undef DPTF_ENABLE_FAN_CONTROL
#undef DPTF_ENABLE_CHARGER
Name (DTRT, Package () {
/* CPU Throttle Effect on CPU */
- Package () { \_SB.PCI0.TCPU, \_SB.PCI0.TCPU, 100, 10, 0, 0, 0, 0 },
+ Package () { \_SB.PCI0.TCPU, \_SB.PCI0.TCPU, 500, 100, 0, 0, 0, 0 },
/* CPU Throttle Effect on Skin (TSR0) */
- Package () { \_SB.PCI0.TCPU, \_SB.DPTF.TSR0, 100, 600, 0, 0, 0, 0 },
+ Package () { \_SB.PCI0.TCPU, \_SB.DPTF.TSR0, 500, 30, 0, 0, 0, 0 },
/* CPU Throttle Effect on DDR (TSR1) */
- Package () { \_SB.PCI0.TCPU, \_SB.DPTF.TSR1, 100, 90, 0, 0, 0, 0 },
+ Package () { \_SB.PCI0.TCPU, \_SB.DPTF.TSR1, 100, 50, 2, 0, 0, 0 },
/* CPU Throttle Effect on Ambient (TSR2) */
- Package () { \_SB.PCI0.TCPU, \_SB.DPTF.TSR2, 100, 600, 0, 0, 0, 0 },
+ Package () { \_SB.PCI0.TCPU, \_SB.DPTF.TSR2, 1000, 100, 1, 0, 0, 0 },
})
Name (MPPC, Package ()
diff --git a/src/mainboard/google/sarien/variants/arcada/include/variant/acpi/mainboard.asl b/src/mainboard/google/sarien/variants/arcada/include/variant/acpi/mainboard.asl
new file mode 100644
index 0000000000..41121d28fe
--- /dev/null
+++ b/src/mainboard/google/sarien/variants/arcada/include/variant/acpi/mainboard.asl
@@ -0,0 +1,44 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2019 Intel Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#define CAM_EN GPP_B11 /* Active low */
+#define TS_PD GPP_E7
+
+/* Method called from LPIT prior to enter s0ix state */
+Method (MS0X, 1)
+{
+ If (Arg0) {
+ /* Turn off camera power */
+ \_SB.PCI0.STXS (CAM_EN)
+ } Else {
+ /* Turn on camera power */
+ \_SB.PCI0.CTXS (CAM_EN)
+ }
+}
+
+/* Method called from _PTS prior to enter sleep state */
+Method (MPTS, 1)
+{
+ \_SB.PCI0.LPCB.EC0.PTS (Arg0)
+
+ /* Clear touch screen pd pin to avoid leakage */
+ \_SB.PCI0.CTXS (TS_PD)
+}
+
+/* Method called from _WAK prior to wakeup */
+Method (MWAK, 1)
+{
+ \_SB.PCI0.LPCB.EC0.WAK (Arg0)
+}
diff --git a/src/mainboard/google/sarien/variants/sarien/devicetree.cb b/src/mainboard/google/sarien/variants/sarien/devicetree.cb
index e9786f14eb..3807047e0f 100644
--- a/src/mainboard/google/sarien/variants/sarien/devicetree.cb
+++ b/src/mainboard/google/sarien/variants/sarien/devicetree.cb
@@ -378,11 +378,15 @@ chip soc/intel/cannonlake
device pci 1c.5 off end # PCI Express Port 6
device pci 1c.6 off end # PCI Express Port 7
device pci 1c.7 on end # PCI Express Port 8
- device pci 1d.0 on end # PCI Express Port 9
+ device pci 1d.0 on
+ smbios_slot_desc "SlotTypeM2Socket1_SD" "SlotLengthOther" "2230" "SlotDataBusWidth1X"
+ end # PCI Express Port 9
device pci 1d.1 on end # PCI Express Port 10
device pci 1d.2 off end # PCI Express Port 11
device pci 1d.3 off end # PCI Express Port 12
- device pci 1d.4 on end # PCI Express Port 13 (x4)
+ device pci 1d.4 on
+ smbios_slot_desc "SlotTypeM2Socket3" "SlotLengthOther" "2280" "SlotDataBusWidth4X"
+ end # PCI Express Port 13 (x4)
device pci 1e.0 off end # UART #0
device pci 1e.1 off end # UART #1
device pci 1e.2 off end # GSPI #0
diff --git a/src/mainboard/google/sarien/variants/sarien/gpio.c b/src/mainboard/google/sarien/variants/sarien/gpio.c
index 53a937ff39..ec3b44d4a3 100644
--- a/src/mainboard/google/sarien/variants/sarien/gpio.c
+++ b/src/mainboard/google/sarien/variants/sarien/gpio.c
@@ -31,9 +31,9 @@ static const struct pad_config gpio_table[] = {
/* CLKOUT_LPC1 */ PAD_NC(GPP_A10, NONE),
/* PME# */ PAD_NC(GPP_A11, NONE),
/* BM_BUSY# */ PAD_NC(GPP_A12, NONE),
-/* SUSWARN# */ PAD_CFG_GPO(GPP_A13, 0, DEEP), /* Card reader D3 cold */
+
/* ESPI_RESET# */
-/* SUSACK# */ PAD_CFG_GPO(GPP_A15, 0, DEEP), /* Card reader D3 cold */
+
/* SD_1P8_SEL */ PAD_NC(GPP_A16, NONE),
/* SD_PWR_EN# */ PAD_NC(GPP_A17, NONE),
/* ISH_GP0 */ PAD_NC(GPP_A18, NONE),
@@ -224,9 +224,12 @@ static const struct pad_config gpio_table[] = {
/* Early pad configuration in bootblock */
static const struct pad_config early_gpio_table[] = {
-/* M2_SKT2_CFG0 */ PAD_CFG_GPO(GPP_H12, 0, DEEP), /* D3 cold RST */
+/* SUSWARN# */ PAD_CFG_GPO(GPP_A13, 0, DEEP), /* Card reader D3 cold */
+/* SUSACK# */ PAD_CFG_GPO(GPP_A15, 0, DEEP), /* Card reader D3 cold */
/* UART2_RXD */ PAD_CFG_NF(GPP_C20, NONE, DEEP, NF1), /* SERVOTX_UART */
/* UART2_TXD */ PAD_CFG_NF(GPP_C21, NONE, DEEP, NF1), /* SERVORX_UART */
+/* SSD RESET pin will stay low first */
+/* M2_SKT2_CFG0 */ PAD_CFG_GPO(GPP_H12, 0, DEEP), /* D3 cold RST */
/* I2C4_SDA */ PAD_CFG_NF(GPP_H8, NONE, DEEP, NF1), /* I2C_SDA_H1 */
/* I2C4_SCL */ PAD_CFG_NF(GPP_H9, NONE, DEEP, NF1), /* I2C_SCL_H1 */
/* DMIC_DATA1 */ PAD_CFG_GPI_APIC(GPP_D18, NONE, PLTRST,
@@ -236,9 +239,8 @@ static const struct pad_config early_gpio_table[] = {
/* CPU_GP0 */ PAD_CFG_GPI(GPP_E3, NONE, DEEP), /* MEM_INTERLEAVED */
/* SATALED# */ PAD_CFG_GPI(GPP_E8, NONE, DEEP), /* RECOVERY# */
/* DDPD_HPD2 */ PAD_CFG_GPI(GPP_E15, NONE, DEEP), /* H1_FLASH_WP */
-/* SSD RESET need to stay low first */
-/* M2_SKT2_CFG0 */ PAD_CFG_GPO(GPP_H12, 1, DEEP), /* D3 cold RST */
/* PWRBTN# */ PAD_CFG_NF(GPD3, UP_20K, DEEP, NF1), /* SIO_PWRBTN# */
+/* M2_SKT2_CFG0 */ PAD_CFG_GPO(GPP_H12, 1, DEEP), /* D3 cold RST */
};
const struct pad_config *variant_gpio_table(size_t *num)
diff --git a/src/mainboard/google/sarien/variants/sarien/include/variant/acpi/mainboard.asl b/src/mainboard/google/sarien/variants/sarien/include/variant/acpi/mainboard.asl
new file mode 100644
index 0000000000..41121d28fe
--- /dev/null
+++ b/src/mainboard/google/sarien/variants/sarien/include/variant/acpi/mainboard.asl
@@ -0,0 +1,44 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2019 Intel Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#define CAM_EN GPP_B11 /* Active low */
+#define TS_PD GPP_E7
+
+/* Method called from LPIT prior to enter s0ix state */
+Method (MS0X, 1)
+{
+ If (Arg0) {
+ /* Turn off camera power */
+ \_SB.PCI0.STXS (CAM_EN)
+ } Else {
+ /* Turn on camera power */
+ \_SB.PCI0.CTXS (CAM_EN)
+ }
+}
+
+/* Method called from _PTS prior to enter sleep state */
+Method (MPTS, 1)
+{
+ \_SB.PCI0.LPCB.EC0.PTS (Arg0)
+
+ /* Clear touch screen pd pin to avoid leakage */
+ \_SB.PCI0.CTXS (TS_PD)
+}
+
+/* Method called from _WAK prior to wakeup */
+Method (MWAK, 1)
+{
+ \_SB.PCI0.LPCB.EC0.WAK (Arg0)
+}
diff --git a/src/mainboard/google/smaug/pmic.c b/src/mainboard/google/smaug/pmic.c
index d9dacb7d08..9add211ccd 100644
--- a/src/mainboard/google/smaug/pmic.c
+++ b/src/mainboard/google/smaug/pmic.c
@@ -36,10 +36,6 @@ struct max77620_init_reg {
u8 delay;
};
-static struct max77620_init_reg init_list[] = {
- /* TODO */
-};
-
static void pmic_write_reg(unsigned bus, uint8_t chip, uint8_t reg, uint8_t val,
int delay)
{
@@ -66,20 +62,8 @@ static inline void pmic_write_reg_77621(unsigned bus, uint8_t reg, uint8_t val,
pmic_write_reg(bus, MAX77621_CPU_I2C_ADDR, reg, val, delay);
}
-static void pmic_slam_defaults(unsigned bus)
-{
- int i;
- for (i = 0; i < ARRAY_SIZE(init_list); i++) {
- struct max77620_init_reg *reg = &init_list[i];
- pmic_write_reg_77620(bus, reg->reg, reg->val, reg->delay);
- }
-}
-
void pmic_init(unsigned bus)
{
- /* Restore PMIC POR defaults, in case kernel changed 'em */
- pmic_slam_defaults(bus);
-
/* MAX77620: Set SD0 to 1.0V - VDD_CORE */
pmic_write_reg_77620(bus, MAX77620_SD0_REG, 0x20, 1);
pmic_write_reg_77620(bus, MAX77620_VDVSSD0_REG, 0x20, 1);
diff --git a/src/mainboard/google/stout/mainboard.c b/src/mainboard/google/stout/mainboard.c
index 5f51a6b8bc..05de8cb63d 100644
--- a/src/mainboard/google/stout/mainboard.c
+++ b/src/mainboard/google/stout/mainboard.c
@@ -22,14 +22,14 @@
#include
#include
#include
-#include "onboard.h"
-#include "ec.h"
#include
-#include
#include
#include
#include
+#include "ec.h"
+#include "onboard.h"
+
void mainboard_suspend_resume(void)
{
/* Stout EC needs to be put back in ACPI mode */
diff --git a/src/mainboard/ibase/mb899/romstage.c b/src/mainboard/ibase/mb899/romstage.c
index 7e3b7dba68..9cb1144b80 100644
--- a/src/mainboard/ibase/mb899/romstage.c
+++ b/src/mainboard/ibase/mb899/romstage.c
@@ -16,7 +16,6 @@
// __PRE_RAM__ means: use "unsigned" for device, not a struct.
#include
-#include
#include
#include
#include
diff --git a/src/mainboard/intel/dcp847ske/early_southbridge.c b/src/mainboard/intel/dcp847ske/early_southbridge.c
index 46f9a94e9e..778525f320 100644
--- a/src/mainboard/intel/dcp847ske/early_southbridge.c
+++ b/src/mainboard/intel/dcp847ske/early_southbridge.c
@@ -17,7 +17,6 @@
*/
#include
-#include
#include
#include
#include
diff --git a/src/mainboard/intel/kblrvp/spd/spd_util.c b/src/mainboard/intel/kblrvp/spd/spd_util.c
index 10043843a2..f22dcaa3b7 100644
--- a/src/mainboard/intel/kblrvp/spd/spd_util.c
+++ b/src/mainboard/intel/kblrvp/spd/spd_util.c
@@ -16,8 +16,6 @@
#include
#include
#include
-#include
-#include
#include "../board_id.h"
#include "spd.h"
diff --git a/src/mainboard/intel/kunimitsu/Makefile.inc b/src/mainboard/intel/kunimitsu/Makefile.inc
index dc4b83c0bb..3330a0aab8 100644
--- a/src/mainboard/intel/kunimitsu/Makefile.inc
+++ b/src/mainboard/intel/kunimitsu/Makefile.inc
@@ -18,8 +18,6 @@ subdirs-y += spd
bootblock-y += bootblock_mainboard.c
-romstage-y += pei_data.c
-
bootblock-$(CONFIG_CHROMEOS) += chromeos.c
verstage-$(CONFIG_CHROMEOS) += chromeos.c
romstage-$(CONFIG_CHROMEOS) += chromeos.c
@@ -28,7 +26,6 @@ ramstage-$(CONFIG_CHROMEOS) += chromeos.c
ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC) += ec.c
ramstage-y += mainboard.c
-ramstage-y += pei_data.c
ramstage-y += ramstage.c
smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c
diff --git a/src/mainboard/intel/kunimitsu/pei_data.c b/src/mainboard/intel/kunimitsu/pei_data.c
deleted file mode 100644
index bfc40c2748..0000000000
--- a/src/mainboard/intel/kunimitsu/pei_data.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2014 Google Inc.
- * Copyright (C) 2015 Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#include
-#include
-#include
-#include "boardid.h"
-#include "spd/spd.h"
-
-void mainboard_fill_pei_data(struct pei_data *pei_data)
-{
- mainboard_fill_dq_map_data(&pei_data->dq_map);
- mainboard_fill_dqs_map_data(&pei_data->dqs_map);
- mainboard_fill_rcomp_res_data(&pei_data->RcompResistor);
- mainboard_fill_rcomp_strength_data(&pei_data->RcompTarget);
-}
diff --git a/src/mainboard/intel/kunimitsu/romstage.c b/src/mainboard/intel/kunimitsu/romstage.c
index 1c6f5a2cd3..f25f88b4dd 100644
--- a/src/mainboard/intel/kunimitsu/romstage.c
+++ b/src/mainboard/intel/kunimitsu/romstage.c
@@ -15,20 +15,13 @@
* GNU General Public License for more details.
*/
-#include
#include
-#include
-#include
#include
#include "gpio.h"
#include "spd/spd.h"
void mainboard_romstage_entry(struct romstage_params *params)
{
- params->pei_data->mem_cfg_id = get_spd_index();
- /* Fill out PEI DATA */
- mainboard_fill_pei_data(params->pei_data);
- mainboard_fill_spd_data(params->pei_data);
/* Initialize memory */
romstage_common(params);
}
@@ -36,24 +29,11 @@ void mainboard_romstage_entry(struct romstage_params *params)
void mainboard_memory_init_params(struct romstage_params *params,
MEMORY_INIT_UPD *memory_params)
{
- if (params->pei_data->spd_data[0][0][0] != 0) {
- memory_params->MemorySpdPtr00 =
- (UINT32)(params->pei_data->spd_data[0][0]);
- memory_params->MemorySpdPtr10 =
- (UINT32)(params->pei_data->spd_data[1][0]);
- }
- memcpy(memory_params->DqByteMapCh0, params->pei_data->dq_map[0],
- sizeof(params->pei_data->dq_map[0]));
- memcpy(memory_params->DqByteMapCh1, params->pei_data->dq_map[1],
- sizeof(params->pei_data->dq_map[1]));
- memcpy(memory_params->DqsMapCpu2DramCh0, params->pei_data->dqs_map[0],
- sizeof(params->pei_data->dqs_map[0]));
- memcpy(memory_params->DqsMapCpu2DramCh1, params->pei_data->dqs_map[1],
- sizeof(params->pei_data->dqs_map[1]));
- memcpy(memory_params->RcompResistor, params->pei_data->RcompResistor,
- sizeof(params->pei_data->RcompResistor));
- memcpy(memory_params->RcompTarget, params->pei_data->RcompTarget,
- sizeof(params->pei_data->RcompTarget));
+ spd_memory_init_params(memory_params);
+ mainboard_fill_dq_map_data(&memory_params->DqByteMapCh0);
+ mainboard_fill_dqs_map_data(&memory_params->DqsMapCpu2DramCh0);
+ mainboard_fill_rcomp_res_data(&memory_params->RcompResistor);
+ mainboard_fill_rcomp_strength_data(&memory_params->RcompTarget);
memory_params->MemorySpdDataLen = SPD_LEN;
memory_params->DqPinsInterleaved = FALSE;
}
diff --git a/src/mainboard/intel/kunimitsu/spd/spd.c b/src/mainboard/intel/kunimitsu/spd/spd.c
index 8656d4bc17..bebb544a4d 100644
--- a/src/mainboard/intel/kunimitsu/spd/spd.c
+++ b/src/mainboard/intel/kunimitsu/spd/spd.c
@@ -16,8 +16,9 @@
#include
#include
-#include
+#include
#include
+#include
#include
#include "spd.h"
@@ -73,20 +74,19 @@ static void mainboard_print_spd_info(uint8_t spd[])
}
}
-/* Copy SPD data for on-board memory */
-void mainboard_fill_spd_data(struct pei_data *pei_data)
+/* Fill SPD pointers for on-board memory */
+void spd_memory_init_params(MEMORY_INIT_UPD *memory_params)
{
uintptr_t spd_data;
spd_data = mainboard_get_spd_data();
- memcpy(pei_data->spd_data[0][0], (void *)spd_data, SPD_LEN);
-
- if (mainboard_has_dual_channel_mem())
- memcpy(pei_data->spd_data[1][0], (void *)spd_data, SPD_LEN);
-
/* Make sure a valid SPD was found */
- if (pei_data->spd_data[0][0][0] == 0)
+ if (*(uint8_t *)spd_data == 0)
die("Invalid SPD data.");
- mainboard_print_spd_info(pei_data->spd_data[0][0]);
+ memory_params->MemorySpdPtr00 = spd_data;
+ if (mainboard_has_dual_channel_mem())
+ memory_params->MemorySpdPtr10 = spd_data;
+
+ mainboard_print_spd_info((uint8_t *)spd_data);
}
diff --git a/src/mainboard/intel/kunimitsu/spd/spd.h b/src/mainboard/intel/kunimitsu/spd/spd.h
index f53c9ec9fa..22d371f4bc 100644
--- a/src/mainboard/intel/kunimitsu/spd/spd.h
+++ b/src/mainboard/intel/kunimitsu/spd/spd.h
@@ -16,6 +16,7 @@
#ifndef MAINBOARD_SPD_H
+#include
#include
#include "../gpio.h"
@@ -53,6 +54,7 @@ static inline int get_spd_index(void) {
};
return (gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios)));
}
+void spd_memory_init_params(MEMORY_INIT_UPD *memory_params);
void mainboard_fill_dq_map_data(void *dq_map_ptr);
void mainboard_fill_dqs_map_data(void *dqs_map_ptr);
void mainboard_fill_rcomp_res_data(void *rcomp_ptr);
diff --git a/src/mainboard/intel/kunimitsu/spd/spd_util.c b/src/mainboard/intel/kunimitsu/spd/spd_util.c
index fc0581cb24..b173628e29 100644
--- a/src/mainboard/intel/kunimitsu/spd/spd_util.c
+++ b/src/mainboard/intel/kunimitsu/spd/spd_util.c
@@ -17,8 +17,6 @@
#include
#include
#include
-#include
-#include
#include "boardid.h"
#include "spd.h"
diff --git a/src/mainboard/intel/saddlebrook/Makefile.inc b/src/mainboard/intel/saddlebrook/Makefile.inc
index 63889af078..683462b9de 100644
--- a/src/mainboard/intel/saddlebrook/Makefile.inc
+++ b/src/mainboard/intel/saddlebrook/Makefile.inc
@@ -17,6 +17,5 @@
subdirs-y += spd
bootblock-y += bootblock.c
-romstage-y += pei_data.c
ramstage-y += ramstage.c
diff --git a/src/mainboard/intel/saddlebrook/romstage.c b/src/mainboard/intel/saddlebrook/romstage.c
index d19629cf9e..48d39db309 100644
--- a/src/mainboard/intel/saddlebrook/romstage.c
+++ b/src/mainboard/intel/saddlebrook/romstage.c
@@ -19,8 +19,6 @@
#include
#include
#include
-#include
-#include
#include
#include
#include "spd/spd.h"
@@ -38,8 +36,6 @@ void car_mainboard_pre_console_init(void)
void mainboard_romstage_entry(struct romstage_params *params)
{
post_code(0x31);
- /* Fill out PEI DATA */
- mainboard_fill_pei_data(params->pei_data);
romstage_common(params);
}
@@ -67,18 +63,10 @@ void mainboard_memory_init_params(
* should be set in the FSP flash image and should not need to be
* changed.
*/
- memcpy(memory_params->DqByteMapCh0, params->pei_data->dq_map[0],
- sizeof(params->pei_data->dq_map[0]));
- memcpy(memory_params->DqByteMapCh1, params->pei_data->dq_map[1],
- sizeof(params->pei_data->dq_map[1]));
- memcpy(memory_params->DqsMapCpu2DramCh0, params->pei_data->dqs_map[0],
- sizeof(params->pei_data->dqs_map[0]));
- memcpy(memory_params->DqsMapCpu2DramCh1, params->pei_data->dqs_map[1],
- sizeof(params->pei_data->dqs_map[1]));
- memcpy(memory_params->RcompResistor, params->pei_data->RcompResistor,
- sizeof(params->pei_data->RcompResistor));
- memcpy(memory_params->RcompTarget, params->pei_data->RcompTarget,
- sizeof(params->pei_data->RcompTarget));
+ mainboard_fill_dq_map_data(&memory_params->DqByteMapCh0);
+ mainboard_fill_dqs_map_data(&memory_params->DqsMapCpu2DramCh0);
+ mainboard_fill_rcomp_res_data(&memory_params->RcompResistor);
+ mainboard_fill_rcomp_strength_data(&memory_params->RcompTarget);
/* update spd length*/
memory_params->MemorySpdDataLen = blk.len;
diff --git a/src/mainboard/intel/saddlebrook/spd/spd_util.c b/src/mainboard/intel/saddlebrook/spd/spd_util.c
index 2c26d787d7..5055d9a3af 100644
--- a/src/mainboard/intel/saddlebrook/spd/spd_util.c
+++ b/src/mainboard/intel/saddlebrook/spd/spd_util.c
@@ -15,8 +15,6 @@
#include
#include
-#include
-#include
#include "spd.h"
void mainboard_fill_dq_map_data(void *dq_map_ptr)
diff --git a/src/mainboard/intel/strago/acpi/mainboard.asl b/src/mainboard/intel/strago/acpi/mainboard.asl
index 68ac133eec..1d5437bbf2 100644
--- a/src/mainboard/intel/strago/acpi/mainboard.asl
+++ b/src/mainboard/intel/strago/acpi/mainboard.asl
@@ -74,7 +74,7 @@ Scope (\_SB.PCI0.I2C1)
Name (_UID, 5)
Name (ISTP, 0) /* TouchScreen */
- Method(_CRS, 0x0, NotSerialized)
+ Method(_CRS, 0x0, Serialized)
{
Name (BUF0, ResourceTemplate ()
{
@@ -120,7 +120,7 @@ Scope (\_SB.PCI0.I2C5)
Name (_DDN, AUDIO_CODEC_DDN)
Name (_UID, 1)
- Method(_CRS, 0x0, NotSerialized)
+ Method(_CRS, 0x0, Serialized)
{
Name(SBUF,ResourceTemplate ()
{
diff --git a/src/mainboard/intel/strago/romstage.c b/src/mainboard/intel/strago/romstage.c
index 0f3067ea81..ba0ff7b85e 100644
--- a/src/mainboard/intel/strago/romstage.c
+++ b/src/mainboard/intel/strago/romstage.c
@@ -17,7 +17,6 @@
#include
#include
#include
-#include
#include "onboard.h"
#include
diff --git a/src/mainboard/kontron/986lcd-m/romstage.c b/src/mainboard/kontron/986lcd-m/romstage.c
index 3d01eb1e0f..b85bd6883d 100644
--- a/src/mainboard/kontron/986lcd-m/romstage.c
+++ b/src/mainboard/kontron/986lcd-m/romstage.c
@@ -16,7 +16,6 @@
/* __PRE_RAM__ means: use "unsigned" for device, not a struct. */
#include
-#include
#include
#include
#include
diff --git a/src/mainboard/lenovo/t400/devicetree.cb b/src/mainboard/lenovo/t400/devicetree.cb
index 8e90431d5f..475c45ebbd 100644
--- a/src/mainboard/lenovo/t400/devicetree.cb
+++ b/src/mainboard/lenovo/t400/devicetree.cb
@@ -109,6 +109,7 @@ chip northbridge/intel/gm45
end # PCIe Port #3
device pci 1c.3 on
subsystemid 0x17aa 0x20f3 # Expresscard
+ smbios_slot_desc "7" "3" "ExpressCard Slot" "8"
end # PCIe Port #4
device pci 1c.4 off end # PCIe Port #5
device pci 1c.5 off end # PCIe Port #6
diff --git a/src/mainboard/lenovo/t420/Kconfig b/src/mainboard/lenovo/t420/Kconfig
index ce81907ccb..3d3b56ae22 100644
--- a/src/mainboard/lenovo/t420/Kconfig
+++ b/src/mainboard/lenovo/t420/Kconfig
@@ -28,6 +28,26 @@ config BOARD_SPECIFIC_OPTIONS
# Workaround for EC/KBC IRQ1.
select SERIRQ_CONTINUOUS_MODE
+config VBOOT
+ select VBOOT_VBNV_CMOS
+ select GBB_FLAG_DISABLE_LID_SHUTDOWN
+ select GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC
+ select GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC
+ select GBB_FLAG_DISABLE_FWMP
+ select HAS_RECOVERY_MRC_CACHE
+
+config VBOOT_SLOTS_RW_A
+ default y
+
+config VBOOT_VBNV_OFFSET
+ hex
+ default 0x2a
+
+config FMDFILE
+ string
+ default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/vboot-rwa.fmd" if VBOOT
+ default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/board.fmd"
+
config MAINBOARD_DIR
string
default lenovo/t420
diff --git a/src/mainboard/lenovo/t420/board.fmd b/src/mainboard/lenovo/t420/board.fmd
new file mode 100644
index 0000000000..04cf827a87
--- /dev/null
+++ b/src/mainboard/lenovo/t420/board.fmd
@@ -0,0 +1,16 @@
+FLASH@0xff800000 0x800000 {
+ SI_ALL@0x0 0x500000 {
+ SI_DESC@0x0 0x1000
+ SI_GBE@0x1000 0x2000
+ SI_ME@0x3000 0x4ed000
+ }
+ SI_BIOS@0x500000 0x300000 {
+ RW_MRC_CACHE@0 0x10000
+ SMMSTORE(PRESERVE)@0x10000 0x40000
+
+ WP_RO@0x50000 0x2a0000 {
+ FMAP@0x0 0x800
+ COREBOOT(CBFS)@0x1000 0x29f000
+ }
+ }
+}
diff --git a/src/mainboard/lenovo/t420/cmos.layout b/src/mainboard/lenovo/t420/cmos.layout
index f55c2037d5..a9f5f5ff47 100644
--- a/src/mainboard/lenovo/t420/cmos.layout
+++ b/src/mainboard/lenovo/t420/cmos.layout
@@ -81,6 +81,9 @@ entries
440 8 h 0 volume
+# VBOOT
+448 128 r 0 vbnv
+
# SandyBridge MRC Scrambler Seed values
896 32 r 0 mrc_scrambler_seed
928 32 r 0 mrc_scrambler_seed_s3
diff --git a/src/mainboard/lenovo/t420/devicetree.cb b/src/mainboard/lenovo/t420/devicetree.cb
index 47c14ef909..c4092fe901 100644
--- a/src/mainboard/lenovo/t420/devicetree.cb
+++ b/src/mainboard/lenovo/t420/devicetree.cb
@@ -94,6 +94,7 @@ chip northbridge/intel/sandybridge
device pci 1c.2 off end # PCIe Port #3
device pci 1c.3 on
subsystemid 0x17aa 0x21ce
+ smbios_slot_desc "7" "3" "ExpressCard Slot" "8"
end # PCIe Port #4 ExpressCard
device pci 1c.4 on
subsystemid 0x17aa 0x21ce
diff --git a/src/mainboard/lenovo/t420/vboot-rwa.fmd b/src/mainboard/lenovo/t420/vboot-rwa.fmd
new file mode 100644
index 0000000000..8a4cd3b477
--- /dev/null
+++ b/src/mainboard/lenovo/t420/vboot-rwa.fmd
@@ -0,0 +1,29 @@
+FLASH@0xff800000 0x800000 {
+ SI_ALL@0x0 0x500000 {
+ SI_DESC@0x0 0x1000
+ SI_GBE@0x1000 0x2000
+ SI_ME@0x3000 0x4ed000
+ }
+ SI_BIOS@0x500000 0x300000 {
+ RW_SECTION_A@0x00000 0x180000 {
+ VBLOCK_A@0x0 0x10000
+ FW_MAIN_A(CBFS)@0x10000 0x16ffc0
+ RW_FWID_A@0x17ffc0 0x40
+ }
+ UNIFIED_MRC_CACHE@0x180000 0x20000 {
+ RECOVERY_MRC_CACHE@0x0 0x10000
+ RW_MRC_CACHE@0x10000 0x10000
+ }
+ RW_VPD(PRESERVE)@0x1a0000 0x1000
+ SMMSTORE(PRESERVE)@0x1a1000 0x40000
+
+ WP_RO@0x1e1000 0x11f000 {
+ FMAP@0x0 0x800
+ RO_FRID@0x800 0x40
+ RO_PADDING@0x840 0x7c0
+ RO_VPD(PRESERVE)@0x1000 0x1000
+ GBB@0x2000 0x1e000
+ COREBOOT(CBFS)@0x20000 0xff000
+ }
+ }
+}
diff --git a/src/mainboard/lenovo/t420s/Kconfig b/src/mainboard/lenovo/t420s/Kconfig
index c5efb55653..1383d4166c 100644
--- a/src/mainboard/lenovo/t420s/Kconfig
+++ b/src/mainboard/lenovo/t420s/Kconfig
@@ -27,6 +27,26 @@ config BOARD_SPECIFIC_OPTIONS
# Workaround for EC/KBC IRQ1.
select SERIRQ_CONTINUOUS_MODE
+config VBOOT
+ select VBOOT_VBNV_CMOS
+ select GBB_FLAG_DISABLE_LID_SHUTDOWN
+ select GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC
+ select GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC
+ select GBB_FLAG_DISABLE_FWMP
+ select HAS_RECOVERY_MRC_CACHE
+
+config VBOOT_SLOTS_RW_A
+ default y
+
+config VBOOT_VBNV_OFFSET
+ hex
+ default 0x2a
+
+config FMDFILE
+ string
+ default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/vboot-rwa.fmd" if VBOOT
+ default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/board.fmd"
+
config MAINBOARD_DIR
string
default lenovo/t420s
diff --git a/src/mainboard/lenovo/t420s/board.fmd b/src/mainboard/lenovo/t420s/board.fmd
new file mode 100644
index 0000000000..04cf827a87
--- /dev/null
+++ b/src/mainboard/lenovo/t420s/board.fmd
@@ -0,0 +1,16 @@
+FLASH@0xff800000 0x800000 {
+ SI_ALL@0x0 0x500000 {
+ SI_DESC@0x0 0x1000
+ SI_GBE@0x1000 0x2000
+ SI_ME@0x3000 0x4ed000
+ }
+ SI_BIOS@0x500000 0x300000 {
+ RW_MRC_CACHE@0 0x10000
+ SMMSTORE(PRESERVE)@0x10000 0x40000
+
+ WP_RO@0x50000 0x2a0000 {
+ FMAP@0x0 0x800
+ COREBOOT(CBFS)@0x1000 0x29f000
+ }
+ }
+}
diff --git a/src/mainboard/lenovo/t420s/cmos.layout b/src/mainboard/lenovo/t420s/cmos.layout
index 2be55f67c7..172191a59a 100644
--- a/src/mainboard/lenovo/t420s/cmos.layout
+++ b/src/mainboard/lenovo/t420s/cmos.layout
@@ -81,6 +81,9 @@ entries
440 8 h 0 volume
+# VBOOT
+448 128 r 0 vbnv
+
# SandyBridge MRC Scrambler Seed values
896 32 r 0 mrc_scrambler_seed
928 32 r 0 mrc_scrambler_seed_s3
diff --git a/src/mainboard/lenovo/t420s/devicetree.cb b/src/mainboard/lenovo/t420s/devicetree.cb
index 0f09db8fa9..d1e3f75499 100644
--- a/src/mainboard/lenovo/t420s/devicetree.cb
+++ b/src/mainboard/lenovo/t420s/devicetree.cb
@@ -93,6 +93,7 @@ chip northbridge/intel/sandybridge
device pci 1c.2 off end # PCIe Port #3
device pci 1c.3 on
subsystemid 0x17aa 0x21d2
+ smbios_slot_desc "7" "3" "ExpressCard Slot" "8"
end # PCIe Port #4 ExpressCard
device pci 1c.4 off end # PCIe Port #5
device pci 1c.5 off end # PCIe Port #6 Intel Gigabit Ethernet PHY (not PCIe)
diff --git a/src/mainboard/lenovo/t420s/vboot-rwa.fmd b/src/mainboard/lenovo/t420s/vboot-rwa.fmd
new file mode 100644
index 0000000000..8a4cd3b477
--- /dev/null
+++ b/src/mainboard/lenovo/t420s/vboot-rwa.fmd
@@ -0,0 +1,29 @@
+FLASH@0xff800000 0x800000 {
+ SI_ALL@0x0 0x500000 {
+ SI_DESC@0x0 0x1000
+ SI_GBE@0x1000 0x2000
+ SI_ME@0x3000 0x4ed000
+ }
+ SI_BIOS@0x500000 0x300000 {
+ RW_SECTION_A@0x00000 0x180000 {
+ VBLOCK_A@0x0 0x10000
+ FW_MAIN_A(CBFS)@0x10000 0x16ffc0
+ RW_FWID_A@0x17ffc0 0x40
+ }
+ UNIFIED_MRC_CACHE@0x180000 0x20000 {
+ RECOVERY_MRC_CACHE@0x0 0x10000
+ RW_MRC_CACHE@0x10000 0x10000
+ }
+ RW_VPD(PRESERVE)@0x1a0000 0x1000
+ SMMSTORE(PRESERVE)@0x1a1000 0x40000
+
+ WP_RO@0x1e1000 0x11f000 {
+ FMAP@0x0 0x800
+ RO_FRID@0x800 0x40
+ RO_PADDING@0x840 0x7c0
+ RO_VPD(PRESERVE)@0x1000 0x1000
+ GBB@0x2000 0x1e000
+ COREBOOT(CBFS)@0x20000 0xff000
+ }
+ }
+}
diff --git a/src/mainboard/lenovo/t430/devicetree.cb b/src/mainboard/lenovo/t430/devicetree.cb
index 9e731f9fbd..2731b69ec0 100644
--- a/src/mainboard/lenovo/t430/devicetree.cb
+++ b/src/mainboard/lenovo/t430/devicetree.cb
@@ -88,6 +88,7 @@ chip northbridge/intel/sandybridge
end
device pci 1c.2 on # PCIe Port #3
subsystemid 0x17aa 0x21f3
+ smbios_slot_desc "7" "3" "ExpressCard Slot" "8"
end
device pci 1c.3 off # PCIe Port #4
end
diff --git a/src/mainboard/lenovo/t430s/devicetree.cb b/src/mainboard/lenovo/t430s/devicetree.cb
index 2ecf05ee43..21d54acf11 100644
--- a/src/mainboard/lenovo/t430s/devicetree.cb
+++ b/src/mainboard/lenovo/t430s/devicetree.cb
@@ -99,6 +99,7 @@ chip northbridge/intel/sandybridge
end # PCIe Port #2 Integrated Wireless LAN
device pci 1c.2 on
subsystemid 0x17aa 0x21fb
+ smbios_slot_desc "7" "3" "ExpressCard Slot" "8"
end # PCIe Port #3 ExpressCard
device pci 1c.3 off end # PCIe Port #4
device pci 1c.4 off end # PCIe Port #5
diff --git a/src/mainboard/lenovo/t520/Kconfig b/src/mainboard/lenovo/t520/Kconfig
index 06f296bc6d..ba17e8092b 100644
--- a/src/mainboard/lenovo/t520/Kconfig
+++ b/src/mainboard/lenovo/t520/Kconfig
@@ -27,6 +27,21 @@ config BOARD_LENOVO_BASEBOARD_T520
if BOARD_LENOVO_BASEBOARD_T520
+config VBOOT
+ select VBOOT_VBNV_CMOS
+ select GBB_FLAG_DISABLE_LID_SHUTDOWN
+ select GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC
+ select GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC
+ select GBB_FLAG_DISABLE_FWMP
+ select HAS_RECOVERY_MRC_CACHE
+
+config VBOOT_SLOTS_RW_A
+ default y
+
+config VBOOT_VBNV_OFFSET
+ hex
+ default 0x2a
+
config VARIANT_DIR
string
default "t520" if BOARD_LENOVO_T520
@@ -40,6 +55,11 @@ config DEVICETREE
string
default "variants/$(CONFIG_VARIANT_DIR)/devicetree.cb"
+config FMDFILE
+ string
+ default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/vboot-rwa.fmd" if VBOOT
+ default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/board.fmd"
+
config MAINBOARD_PART_NUMBER
string
default "ThinkPad T520" if BOARD_LENOVO_T520
diff --git a/src/mainboard/lenovo/t520/board.fmd b/src/mainboard/lenovo/t520/board.fmd
new file mode 100644
index 0000000000..04cf827a87
--- /dev/null
+++ b/src/mainboard/lenovo/t520/board.fmd
@@ -0,0 +1,16 @@
+FLASH@0xff800000 0x800000 {
+ SI_ALL@0x0 0x500000 {
+ SI_DESC@0x0 0x1000
+ SI_GBE@0x1000 0x2000
+ SI_ME@0x3000 0x4ed000
+ }
+ SI_BIOS@0x500000 0x300000 {
+ RW_MRC_CACHE@0 0x10000
+ SMMSTORE(PRESERVE)@0x10000 0x40000
+
+ WP_RO@0x50000 0x2a0000 {
+ FMAP@0x0 0x800
+ COREBOOT(CBFS)@0x1000 0x29f000
+ }
+ }
+}
diff --git a/src/mainboard/lenovo/t520/cmos.layout b/src/mainboard/lenovo/t520/cmos.layout
index 1a7943e5a4..ec6ce858eb 100644
--- a/src/mainboard/lenovo/t520/cmos.layout
+++ b/src/mainboard/lenovo/t520/cmos.layout
@@ -81,6 +81,9 @@ entries
#437 3 r 0 unused
440 8 h 0 volume
+# VBOOT
+448 128 r 0 vbnv
+
# SandyBridge MRC Scrambler Seed values
896 32 r 0 mrc_scrambler_seed
928 32 r 0 mrc_scrambler_seed_s3
diff --git a/src/mainboard/lenovo/t520/variants/t520/devicetree.cb b/src/mainboard/lenovo/t520/variants/t520/devicetree.cb
index cf8e7ce1d2..eff2d69304 100644
--- a/src/mainboard/lenovo/t520/variants/t520/devicetree.cb
+++ b/src/mainboard/lenovo/t520/variants/t520/devicetree.cb
@@ -80,12 +80,16 @@ chip northbridge/intel/sandybridge
device pci 1c.0 off end # PCIe Port #1
device pci 1c.1 on end # PCIe Port #2 Integrated Wireless LAN
device pci 1c.2 off end # PCIe Port #3
- device pci 1c.3 on end # PCIe Port #4 Express Card
+ device pci 1c.3 on
+ smbios_slot_desc "7" "3" "ExpressCard Slot" "8"
+ end # PCIe Port #4 Express Card
device pci 1c.4 on end # PCIe Port #5 MMC/SDXC + IEEE1394
device pci 1c.5 off end # PCIe Port #6 Intel Ethernet PHY
device pci 1c.6 off end # PCIe Port #7 USB 3.0 only W520
device pci 1c.7 off end # PCIe Port #8
device pci 1d.0 on end # USB2 EHCI #1
+ device pci 1e.0 off end # PCI-2-PCI bridge
+
device pci 1f.0 on #LPC bridge
chip ec/lenovo/pmh7
device pnp ff.1 on # dummy
@@ -165,6 +169,8 @@ chip northbridge/intel/sandybridge
device i2c 5f on end
end
end # SMBus
+ device pci 1f.5 off end # IDE controller
+ device pci 1f.6 off end # Thermal controller
end
end
end
diff --git a/src/mainboard/lenovo/t520/variants/w520/devicetree.cb b/src/mainboard/lenovo/t520/variants/w520/devicetree.cb
index 1770ad9722..ceca46ea84 100644
--- a/src/mainboard/lenovo/t520/variants/w520/devicetree.cb
+++ b/src/mainboard/lenovo/t520/variants/w520/devicetree.cb
@@ -80,7 +80,9 @@ chip northbridge/intel/sandybridge
device pci 1c.0 off end # PCIe Port #1
device pci 1c.1 on end # PCIe Port #2 Integrated Wireless LAN
device pci 1c.2 off end # PCIe Port #3
- device pci 1c.3 on end # PCIe Port #4 Express Card
+ device pci 1c.3 on
+ smbios_slot_desc "7" "3" "ExpressCard Slot" "8"
+ end # PCIe Port #4 Express Card
device pci 1c.4 on end # PCIe Port #5 MMC/SDXC + IEEE1394
device pci 1c.5 off end # PCIe Port #6 Intel Ethernet PHY
device pci 1c.6 on end # PCIe Port #7 USB 3.0 only W520
diff --git a/src/mainboard/lenovo/t520/vboot-rwa.fmd b/src/mainboard/lenovo/t520/vboot-rwa.fmd
new file mode 100644
index 0000000000..8a4cd3b477
--- /dev/null
+++ b/src/mainboard/lenovo/t520/vboot-rwa.fmd
@@ -0,0 +1,29 @@
+FLASH@0xff800000 0x800000 {
+ SI_ALL@0x0 0x500000 {
+ SI_DESC@0x0 0x1000
+ SI_GBE@0x1000 0x2000
+ SI_ME@0x3000 0x4ed000
+ }
+ SI_BIOS@0x500000 0x300000 {
+ RW_SECTION_A@0x00000 0x180000 {
+ VBLOCK_A@0x0 0x10000
+ FW_MAIN_A(CBFS)@0x10000 0x16ffc0
+ RW_FWID_A@0x17ffc0 0x40
+ }
+ UNIFIED_MRC_CACHE@0x180000 0x20000 {
+ RECOVERY_MRC_CACHE@0x0 0x10000
+ RW_MRC_CACHE@0x10000 0x10000
+ }
+ RW_VPD(PRESERVE)@0x1a0000 0x1000
+ SMMSTORE(PRESERVE)@0x1a1000 0x40000
+
+ WP_RO@0x1e1000 0x11f000 {
+ FMAP@0x0 0x800
+ RO_FRID@0x800 0x40
+ RO_PADDING@0x840 0x7c0
+ RO_VPD(PRESERVE)@0x1000 0x1000
+ GBB@0x2000 0x1e000
+ COREBOOT(CBFS)@0x20000 0xff000
+ }
+ }
+}
diff --git a/src/mainboard/lenovo/t530/variants/t530/devicetree.cb b/src/mainboard/lenovo/t530/variants/t530/devicetree.cb
index 1a1e7075f2..335543a8f7 100644
--- a/src/mainboard/lenovo/t530/variants/t530/devicetree.cb
+++ b/src/mainboard/lenovo/t530/variants/t530/devicetree.cb
@@ -83,7 +83,9 @@ chip northbridge/intel/sandybridge
device pci 1b.0 on end # High Definition Audio
device pci 1c.0 on end # PCIe Port #1
device pci 1c.1 on end # PCIe Port #2
- device pci 1c.2 on end # PCIe Port #3 (expresscard)
+ device pci 1c.2 on
+ smbios_slot_desc "7" "3" "ExpressCard Slot" "8"
+ end # PCIe Port #3 (expresscard)
device pci 1c.3 off end # PCIe Port #4
device pci 1c.4 off end # PCIe Port #5
device pci 1c.5 off end # PCIe Port #6
diff --git a/src/mainboard/lenovo/t530/variants/w530/devicetree.cb b/src/mainboard/lenovo/t530/variants/w530/devicetree.cb
index 253096c316..0a80fa1d8c 100644
--- a/src/mainboard/lenovo/t530/variants/w530/devicetree.cb
+++ b/src/mainboard/lenovo/t530/variants/w530/devicetree.cb
@@ -98,6 +98,7 @@ chip northbridge/intel/sandybridge
end
device pci 1c.2 on # PCIe Port #3
subsystemid 0x17aa 0x21f6
+ smbios_slot_desc "7" "3" "ExpressCard Slot" "8"
end
device pci 1c.3 off # PCIe Port #4
end
diff --git a/src/mainboard/lenovo/t60/romstage.c b/src/mainboard/lenovo/t60/romstage.c
index ea207e80a9..0c7c0cfb2d 100644
--- a/src/mainboard/lenovo/t60/romstage.c
+++ b/src/mainboard/lenovo/t60/romstage.c
@@ -28,7 +28,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/src/mainboard/lenovo/x200/devicetree.cb b/src/mainboard/lenovo/x200/devicetree.cb
index d800e4fdfe..2ed4308cfa 100644
--- a/src/mainboard/lenovo/x200/devicetree.cb
+++ b/src/mainboard/lenovo/x200/devicetree.cb
@@ -113,6 +113,7 @@ chip northbridge/intel/gm45
end # PCIe Port #3
device pci 1c.3 on
subsystemid 0x17aa 0x20f3 # Expresscard
+ smbios_slot_desc "7" "3" "ExpressCard Slot" "8"
end # PCIe Port #4
device pci 1c.4 off end # PCIe Port #5
device pci 1c.5 off end # PCIe Port #6
diff --git a/src/mainboard/lenovo/x201/devicetree.cb b/src/mainboard/lenovo/x201/devicetree.cb
index fa33aeb431..6ece08bee6 100644
--- a/src/mainboard/lenovo/x201/devicetree.cb
+++ b/src/mainboard/lenovo/x201/devicetree.cb
@@ -92,7 +92,9 @@ chip northbridge/intel/nehalem
device pci 1c.0 on end # PCIe Port #1
device pci 1c.1 on end # PCIe Port #2 (wwan)
- device pci 1c.3 on end # PCIe Port #4 (Expresscard)
+ device pci 1c.3 on
+ smbios_slot_desc "7" "3" "ExpressCard Slot" "8"
+ end # PCIe Port #4 (Expresscard)
device pci 1c.4 on end # PCIe Port #5 (wlan)
device pci 1d.0 on # USB2 EHCI
diff --git a/src/mainboard/lenovo/x220/Kconfig b/src/mainboard/lenovo/x220/Kconfig
index 16f42e850e..358cf8ec39 100644
--- a/src/mainboard/lenovo/x220/Kconfig
+++ b/src/mainboard/lenovo/x220/Kconfig
@@ -26,6 +26,21 @@ config BOARD_SPECIFIC_OPTIONS
# Workaround for EC/KBC IRQ1.
select SERIRQ_CONTINUOUS_MODE
+config VBOOT
+ select VBOOT_VBNV_CMOS
+ select GBB_FLAG_DISABLE_LID_SHUTDOWN
+ select GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC
+ select GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC
+ select GBB_FLAG_DISABLE_FWMP
+ select HAS_RECOVERY_MRC_CACHE
+
+config VBOOT_SLOTS_RW_A
+ default y
+
+config VBOOT_VBNV_OFFSET
+ hex
+ default 0x2a
+
config MAINBOARD_DIR
string
default lenovo/x220
@@ -35,6 +50,10 @@ config VARIANT_DIR
default "x220" if BOARD_LENOVO_X220 || BOARD_LENOVO_X220I
default "x1" if BOARD_LENOVO_X1
+config FMDFILE
+ string
+ default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/vboot-rwa.fmd" if VBOOT
+ default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/board.fmd"
config MAINBOARD_PART_NUMBER
string
diff --git a/src/mainboard/lenovo/x220/board.fmd b/src/mainboard/lenovo/x220/board.fmd
new file mode 100644
index 0000000000..04cf827a87
--- /dev/null
+++ b/src/mainboard/lenovo/x220/board.fmd
@@ -0,0 +1,16 @@
+FLASH@0xff800000 0x800000 {
+ SI_ALL@0x0 0x500000 {
+ SI_DESC@0x0 0x1000
+ SI_GBE@0x1000 0x2000
+ SI_ME@0x3000 0x4ed000
+ }
+ SI_BIOS@0x500000 0x300000 {
+ RW_MRC_CACHE@0 0x10000
+ SMMSTORE(PRESERVE)@0x10000 0x40000
+
+ WP_RO@0x50000 0x2a0000 {
+ FMAP@0x0 0x800
+ COREBOOT(CBFS)@0x1000 0x29f000
+ }
+ }
+}
diff --git a/src/mainboard/lenovo/x220/cmos.layout b/src/mainboard/lenovo/x220/cmos.layout
index d4a4ed3371..dc98010ea2 100644
--- a/src/mainboard/lenovo/x220/cmos.layout
+++ b/src/mainboard/lenovo/x220/cmos.layout
@@ -80,6 +80,9 @@ entries
#435 549 r 0 unused
440 8 h 0 volume
+# VBOOT
+448 128 r 0 vbnv
+
# SandyBridge MRC Scrambler Seed values
896 32 r 0 mrc_scrambler_seed
928 32 r 0 mrc_scrambler_seed_s3
diff --git a/src/mainboard/lenovo/x220/devicetree.cb b/src/mainboard/lenovo/x220/devicetree.cb
index 0ec66f59b8..360de04943 100644
--- a/src/mainboard/lenovo/x220/devicetree.cb
+++ b/src/mainboard/lenovo/x220/devicetree.cb
@@ -98,6 +98,7 @@ chip northbridge/intel/sandybridge
end # PCIe Port #3
device pci 1c.3 on
subsystemid 0x17aa 0x21db
+ smbios_slot_desc "7" "3" "ExpressCard Slot" "8"
end # PCIe Port #4
device pci 1c.4 on
subsystemid 0x17aa 0x21db
diff --git a/src/mainboard/lenovo/x220/vboot-rwa.fmd b/src/mainboard/lenovo/x220/vboot-rwa.fmd
new file mode 100644
index 0000000000..8a4cd3b477
--- /dev/null
+++ b/src/mainboard/lenovo/x220/vboot-rwa.fmd
@@ -0,0 +1,29 @@
+FLASH@0xff800000 0x800000 {
+ SI_ALL@0x0 0x500000 {
+ SI_DESC@0x0 0x1000
+ SI_GBE@0x1000 0x2000
+ SI_ME@0x3000 0x4ed000
+ }
+ SI_BIOS@0x500000 0x300000 {
+ RW_SECTION_A@0x00000 0x180000 {
+ VBLOCK_A@0x0 0x10000
+ FW_MAIN_A(CBFS)@0x10000 0x16ffc0
+ RW_FWID_A@0x17ffc0 0x40
+ }
+ UNIFIED_MRC_CACHE@0x180000 0x20000 {
+ RECOVERY_MRC_CACHE@0x0 0x10000
+ RW_MRC_CACHE@0x10000 0x10000
+ }
+ RW_VPD(PRESERVE)@0x1a0000 0x1000
+ SMMSTORE(PRESERVE)@0x1a1000 0x40000
+
+ WP_RO@0x1e1000 0x11f000 {
+ FMAP@0x0 0x800
+ RO_FRID@0x800 0x40
+ RO_PADDING@0x840 0x7c0
+ RO_VPD(PRESERVE)@0x1000 0x1000
+ GBB@0x2000 0x1e000
+ COREBOOT(CBFS)@0x20000 0xff000
+ }
+ }
+}
diff --git a/src/mainboard/lenovo/x230/devicetree.cb b/src/mainboard/lenovo/x230/devicetree.cb
index 68e2f8ea2c..4687e9ccc3 100644
--- a/src/mainboard/lenovo/x230/devicetree.cb
+++ b/src/mainboard/lenovo/x230/devicetree.cb
@@ -110,6 +110,7 @@ chip northbridge/intel/sandybridge
end # PCIe Port #2
device pci 1c.2 on
subsystemid 0x17aa 0x21fa
+ smbios_slot_desc "7" "3" "ExpressCard Slot" "8"
end # PCIe Port #3 (expresscard)
device pci 1c.3 off end # PCIe Port #4
device pci 1c.4 off end # PCIe Port #5
diff --git a/src/mainboard/lenovo/x60/romstage.c b/src/mainboard/lenovo/x60/romstage.c
index 95192f733b..ea93707ce9 100644
--- a/src/mainboard/lenovo/x60/romstage.c
+++ b/src/mainboard/lenovo/x60/romstage.c
@@ -19,6 +19,7 @@
#include
#include
+#include
#include
#include
#include
@@ -28,7 +29,6 @@
#include
#include
#include
-#include