mainboard/protectli/vault_ehl: Add initial structure

This patch adds base code for the Protectli VP2420. The GPIO
config has been extracted with inteltool from the stock
firmware and then parsed with intelp2m. As of now, the platform
runs with edk2 with no apparent issues.

Signed-off-by: Kacper Stojek <kacper.stojek@3mdeb.com>
Signed-off-by: Artur Kowalski <artur.kowalski@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
Change-Id: Ia00c27117d48b76db306d3f988f159fc5d50e4a0
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72407
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Krystian Hebel <krystian.hebel@3mdeb.com>
This commit is contained in:
Kacper Stojek 2022-10-31 12:24:35 +01:00 committed by Michał Żygowski
parent e111de0752
commit 70089e9814
19 changed files with 2197 additions and 0 deletions

View File

@ -168,6 +168,7 @@ The boards in this section are not real mainboards, but emulators.
- [FW2B / FW4B](protectli/fw2b_fw4b.md)
- [FW6A / FW6B / FW6C](protectli/fw6.md)
- [VP2420](protectli/vp2420.md)
- [VP4630 / VP4650 / VP4670](protectli/vp46xx.md)
## Roda

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

@ -0,0 +1,87 @@
# Protectli Vault VP2420
This page describes how to run coreboot on the [Protectli VP2420].
![](VP2420_back.jpg)
![](VP2420_front.jpg)
## Required proprietary blobs
To build a minimal working coreboot image some blobs are required (assuming
only the BIOS region is being modified).
```eval_rst
+-----------------+---------------------------------+---------------------+
| Binary file | Apply | Required / Optional |
+=================+=================================+=====================+
| FSP-M, FSP-S | Intel Firmware Support Package | Required |
+-----------------+---------------------------------+---------------------+
| microcode | CPU microcode | Required |
+-----------------+---------------------------------+---------------------+
```
FSP-M and FSP-S are obtained after splitting the Elkhart Lake FSP binary (done
automatically by the coreboot build system and included into the image) from
the `3rdparty/fsp` submodule.
Microcode updates are automatically included into the coreboot image by build
system from the `3rdparty/intel-microcode` submodule.
## Flashing coreboot
### Internal programming
The main SPI flash can be accessed using [flashrom]. Firmware can be easily
flashed with internal programmer (either BIOS region or full image).
### External programming
The system has an internal flash chip which is a 16 MiB soldered SOIC-8 chip.
This chip is located on the top side of the case (the lid side). One has to
remove 4 top cover screws and lift up the lid. The flash chip is soldered in
under RAM, easily accessed after taking out the memory. Specifically, it's a
KH25L12835F (3.3V) which is a clone of Macronix
MX25L12835F - [datasheet][MX25L12835F].
![](VP2420_internal.jpg)
## Working
- USB 3.0 front ports (SeaBIOS, Tianocore UEFIPayload and Linux)
- 4 Ethernet ports
- HDMI, DisplayPort
- flashrom
- M.2 WiFi
- M.2 4G LTE
- M.2 SATA and NVMe
- 2.5'' SATA SSD
- eMMC
- Super I/O serial port 0 via front microUSB connector
- SMBus (reading SPD from DIMMs)
- Initialization with Elkhart Lake FSP 2.0
- SeaBIOS payload (version rel-1.16.0)
- TianoCore UEFIPayload
- Reset switch
- Booting Debian, Ubuntu, FreeBSD
## Technology
```eval_rst
+------------------+--------------------------------------------------+
| CPU | Intel Celeron J6412 |
+------------------+--------------------------------------------------+
| PCH | Intel Elkhart Lake |
+------------------+--------------------------------------------------+
| Super I/O, EC | ITE IT8613E |
+------------------+--------------------------------------------------+
| Coprocessor | Intel Management Engine |
+------------------+--------------------------------------------------+
```
## Useful links
- [VP2420 Hardware Overview](https://protectli.com/kb/vp2400-series-hardware-overview/)
- [VP2420 Product Page](https://protectli.com/product/vp2420/)
- [Protectli TPM module](https://protectli.com/product/tpm-module/)
- [MX25L12835F](https://www.mxic.com.tw/Lists/Datasheet/Attachments/8653/MX25L12835F,%203V,%20128Mb,%20v1.6.pdf)
- [flashrom](https://flashrom.org/Flashrom)

View File

@ -0,0 +1,13 @@
CONFIG_VENDOR_PROTECTLI=y
CONFIG_CBFS_SIZE=0x900000
CONFIG_ONBOARD_VGA_IS_PRIMARY=y
CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x20000
CONFIG_EDK2_BOOT_TIMEOUT=6
CONFIG_BOARD_PROTECTLI_VP2420=y
CONFIG_SMMSTORE_SIZE=0x40000
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_0=y
CONFIG_PAYLOAD_EDK2=y
CONFIG_EDK2_BOOT_MANAGER_ESCAPE=y
CONFIG_EDK2_FOLLOW_BGRT_SPEC=y
CONFIG_EDK2_SD_MMC_TIMEOUT=10
CONFIG_EDK2_SERIAL_SUPPORT=y

View File

@ -0,0 +1,49 @@
## SPDX-License-Identifier: GPL-2.0-only
if BOARD_PROTECTLI_VP2420
config BOARD_SPECIFIC_OPTIONS
def_bool y
select SOC_INTEL_ELKHARTLAKE
select BOARD_ROMSIZE_KB_16384
select HAVE_ACPI_RESUME
select HAVE_ACPI_TABLES
select SUPERIO_ITE_IT8613E
select SPI_FLASH_MACRONIX
select INTEL_GMA_HAVE_VBT
select SEABIOS_ADD_SERCON_PORT_FILE if PAYLOAD_SEABIOS
select MEMORY_MAPPED_TPM
config MAINBOARD_DIR
default "protectli/vault_ehl"
config MAINBOARD_PART_NUMBER
default "VP2420"
config MAINBOARD_FAMILY
default "Vault Pro"
config MAX_CPUS
default 4
config CBFS_SIZE
default 0x900000
config VBOOT
select GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC
select GBB_FLAG_DISABLE_FWMP
select GBB_FLAG_DISABLE_LID_SHUTDOWN
select GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC
select VBOOT_ALWAYS_ENABLE_DISPLAY
select VBOOT_NO_BOARD_SUPPORT
select VBOOT_VBNV_CMOS
select VBOOT_VBNV_CMOS_BACKUP_TO_FLASH
select VBOOT_SEPARATE_VERSTAGE
config VBOOT_SLOTS_RW_A
default y if VBOOT
config FMDFILE
default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/vboot-rwa.fmd" if VBOOT && VBOOT_SLOTS_RW_A
endif # BOARD_PROTECTLI_VP2420

View File

@ -0,0 +1,4 @@
## SPDX-License-Identifier: GPL-2.0-only
config BOARD_PROTECTLI_VP2420
bool "VP2420"

View File

@ -0,0 +1,12 @@
# SPDX-License-Identifier: GPL-2.0-only
bootblock-y += bootblock.c
romstage-y += romstage.c
ramstage-y += mainboard.c
bootblock-y += die.c
romstage-y += die.c
ramstage-y += die.c
smm-y += die.c

View File

@ -0,0 +1,6 @@
Vendor name: Protectli
Board name: VP2420
Category: sbc
ROM protocol: SPI
ROM socketed: n
Flashrom support: y

View File

@ -0,0 +1,20 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <bootblock_common.h>
#include <superio/ite/common/ite.h>
#include <superio/ite/it8613e/it8613e.h>
#define GPIO_DEV PNP_DEV(0x2e, IT8613E_GPIO)
#define UART_DEV PNP_DEV(0x2e, IT8613E_SP1)
void bootblock_mainboard_early_init(void)
{
ite_reg_write(GPIO_DEV, 0x29, 0xc1);
ite_reg_write(GPIO_DEV, 0x2c, 0x41); /* disable k8 power seq */
ite_enable_serial(UART_DEV, CONFIG_TTYS0_BASE);
}
void bootblock_mainboard_init(void)
{
}

Binary file not shown.

View File

@ -0,0 +1,214 @@
chip soc/intel/elkhartlake
#register "enable_vtd" = "1"
register "power_limits_config" = "{
.tdp_pl1_override = 10,
.tdp_pl2_override = 15,
}"
register "SaGv" = "SaGv_Enabled"
register "eist_enable" = "1"
# Enable lpss s0ix
register "s0ix_enable" = "1"
# GPE configuration
# Note that GPE events called out in ASL code rely on this
# route, i.e., if this route changes then the affected GPE
# offset bits also need to be changed. This sets the PMC register
# GPE_CFG fields.
#register "pmc_gpe0_dw1" = "PMC_GPE_SCC_63_32"
#register "pmc_gpe0_dw2" = "PMC_GPE_N_31_0"
#register "pmc_gpe0_dw3" = "PMC_GPE_SCC_31_0"
register "tcc_offset" = "5" # TCC of 95C
# USB 2.0 ports
register "usb2_ports[0]" = "USB2_PORT_SHORT(OC_SKIP)" # Header FUSB1
register "usb2_ports[1]" = "USB2_PORT_EMPTY"
register "usb2_ports[2]" = "USB2_PORT_SHORT(OC_SKIP)" # Header FUSB1
register "usb2_ports[3]" = "USB2_PORT_SHORT(OC_SKIP)" # M.2 WLAN
register "usb2_ports[4]" = "USB2_PORT_SHORT(OC_SKIP)" # M.2 WWAN
register "usb2_ports[5]" = "USB2_PORT_EMPTY"
register "usb2_ports[6]" = "USB2_PORT_SHORT(OC_SKIP)" # USB Type-A Upper
register "usb2_ports[7]" = "USB2_PORT_SHORT(OC_SKIP)" # USB Type-C
register "usb2_ports[8]" = "USB2_PORT_SHORT(OC_SKIP)" # USB Type-A Lower
register "usb2_ports[9]" = "USB2_PORT_EMPTY"
# USB 3.x ports
register "usb3_ports[0]" = "USB3_PORT_DEFAULT(OC_SKIP)" # USB Type-A Upper
register "usb3_ports[1]" = "USB3_PORT_DEFAULT(OC_SKIP)" # USB Type-A Lower
register "usb3_ports[2]" = "USB3_PORT_DEFAULT(OC_SKIP)" # USB Type-C Muxed
register "usb3_ports[3]" = "USB3_PORT_EMPTY"
# PCIe root ports related UPDs
register "PcieRpEnable[0]" = "1"
register "PcieRpEnable[1]" = "1"
register "PcieRpEnable[2]" = "1"
register "PcieRpEnable[4]" = "1"
register "PcieRpEnable[6]" = "1"
register "PcieClkSrcUsage[0]" = "PCIE_CLK_NOTUSED"
register "PcieClkSrcUsage[1]" = "PCIE_CLK_FREE"
register "PcieClkSrcUsage[2]" = "PCIE_CLK_FREE"
register "PcieClkSrcUsage[3]" = "PCIE_CLK_FREE"
register "PcieClkSrcUsage[4]" = "PCIE_CLK_FREE"
register "PcieClkSrcUsage[5]" = "PCIE_CLK_FREE"
register "PcieClkSrcClkReq[0]" = "PCIE_CLK_NOTUSED"
register "PcieClkSrcClkReq[1]" = "PCIE_CLK_NOTUSED"
register "PcieClkSrcClkReq[2]" = "PCIE_CLK_NOTUSED"
register "PcieClkSrcClkReq[3]" = "PCIE_CLK_NOTUSED"
register "PcieClkSrcClkReq[4]" = "PCIE_CLK_NOTUSED"
register "PcieClkSrcClkReq[5]" = "PCIE_CLK_NOTUSED"
# Storage (SATA/SDCARD/EMMC) related UPDs
register "SataSalpSupport" = "1"
register "SataPortsEnable[0]" = "1" # Header
register "SataPortsEnable[1]" = "1" # M.2 2280
register "SataPortsDevSlp[0]" = "0"
register "SataPortsDevSlp[1]" = "1"
register "PchHdaAudioLinkHdaEnable" = "1"
register "PchHdaSdiEnable[0]" = "1"
register "ScsEmmcHs400Enabled" = "1"
register "SkipCpuReplacementCheck" = "1"
# Enable DDI ports A/B/C
register "DdiPortAConfig" = "1"
register "DdiPortBConfig" = "1"
register "DdiPortCConfig" = "1"
# Enable HPD for DDI ports A/B
register "DdiPortAHpd" = "1"
register "DdiPortBHpd" = "1"
# Enable DDC for DDI ports A/B
register "DdiPortADdc" = "1"
register "DdiPortBDdc" = "1"
device cpu_cluster 0 on end
device domain 0 on
device pci 00.0 on end # Host Bridge
device pci 02.0 on end # Integrated Graphics Device
device pci 04.0 off end # SA Thermal device
device pci 08.0 off end # GNA
device pci 09.0 off end # CPU Intel Trace Hub
device pci 10.0 on end # I2C6
device pci 10.1 on end # I2C7
device pci 10.5 on end # Integrated Error Handler
device pci 11.0 off end # Intel PSE UART0
device pci 11.1 off end # Intel PSE UART1
device pci 11.2 off end # Intel PSE UART2
device pci 11.3 off end # Intel PSE UART3
device pci 11.4 off end # Intel PSE UART4
device pci 11.5 off end # Intel PSE UART5
device pci 11.6 off end # Intel PSE IS20
device pci 11.7 off end # Intel PSE IS21
device pci 12.0 on end # GSPI2
device pci 12.3 on end # Management Engine UMA Access
device pci 12.4 on end # Management Engine PTT DMA Controller
device pci 12.5 off end # UFS0
device pci 12.7 off end # UFS1
device pci 13.0 off end # Intel PSE GSPI0
device pci 13.1 off end # Intel PSE GSPI1
device pci 13.2 off end # Intel PSE GSPI2
device pci 13.3 off end # Intel PSE GSPI3
device pci 13.4 off end # Intel PSE GPIO0
device pci 13.5 off end # Intel PSE GPIO1
device pci 14.0 on end # USB3.1 xHCI
device pci 14.1 off end # USB3.1 xDCI (OTG)
device pci 14.2 on end # Shared RAM
device pci 15.0 off end # I2C0
device pci 15.1 off end # I2C1
device pci 15.2 off end # I2C2
device pci 15.3 off end # I2C3
device pci 16.0 on end # Management Engine Interface 1
device pci 16.1 off end # Management Engine Interface 2
device pci 16.4 off end # Management Engine Interface 3
device pci 16.5 off end # Management Engine Interface 4
device pci 17.0 on end # SATA
device pci 18.0 off end # Intel PSE I2C7
device pci 18.1 off end # Intel PSE CAN0
device pci 18.2 off end # Intel PSE CAN1
device pci 18.3 off end # Intel PSE QEP0
device pci 18.4 off end # Intel PSE QEP1
device pci 18.5 off end # Intel PSE QEP2
device pci 18.6 off end # Intel PSE QEP3
device pci 19.0 on end # I2C4
device pci 19.1 off end # I2C5
device pci 19.2 on end # UART2
device pci 1a.0 on end # eMMC
device pci 1a.1 off end # SD
device pci 1a.3 off end # Intel Safety Island
device pci 1b.0 off end # Intel PSE I2C0
device pci 1b.1 off end # Intel PSE I2C1
device pci 1b.2 off end # Intel PSE I2C2
device pci 1b.3 off end # Intel PSE I2C3
device pci 1b.4 off end # Intel PSE I2C4
device pci 1b.5 off end # Intel PSE I2C5
device pci 1b.6 off end # Intel PSE I2C6
device pci 1c.0 on end # RP0 (pcie0 single VC)
device pci 1c.1 on end # RP1 (pcie0 single VC)
device pci 1c.2 on end # RP2 (pcie0 single VC)
device pci 1c.3 off end # RP3 (pcie0 single VC)
device pci 1c.4 on end # RP4 (pcie1 multi VC)
device pci 1c.5 off end # RP5 (pcie2 multi VC)
device pci 1c.6 on end # RP6 (pcie3 multi VC)
device pci 1d.0 off end # Intel PSE IPC (local host to PSE)
device pci 1d.1 off end # Intel PSE Time-Sensitive Networking GbE 0
device pci 1d.2 off end # Intel PSE Time-Sensitive Networking GbE 1
device pci 1d.3 off end # Intel PSE DMA0
device pci 1d.4 off end # Intel PSE DMA1
device pci 1d.5 off end # Intel PSE DMA2
device pci 1d.6 off end # Intel PSE PWM
device pci 1d.7 off end # Intel PSE ADC
device pci 1e.0 off end # UART0
device pci 1e.1 off end # UART1
device pci 1e.2 off end # GSPI0
device pci 1e.3 off end # GSPI1
device pci 1e.4 off end # PCH Time-Sensitive Networking GbE
device pci 1e.6 off end # HPET
device pci 1e.7 off end # IOAPIC
device pci 1f.0 on # eSPI interface
chip superio/ite/it8613e
device pnp 2e.0 off end
device pnp 2e.1 on # COM 1
io 0x60 = 0x3f8
irq 0x70 = 4
end
device pnp 2e.4 off end # Environment Controller
device pnp 2e.5 off end # Keyboard
device pnp 2e.6 off end # Mouse
device pnp 2e.7 off end # GPIO
device pnp 2e.a off end # CIR
end
chip drivers/pc80/tpm
device pnp 0c31.0 on end
end
end
device pci 1f.1 on end # P2SB
device pci 1f.2 hidden end # Power Management Controller
device pci 1f.3 on end # Intel cAVS/HDA
device pci 1f.4 on end # SMBUS
device pci 1f.5 on end # PCH SPI (flash & TPM)
device pci 1f.7 off end # PCH Intel Trace Hub
end
end

View File

@ -0,0 +1,41 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <console/console.h>
#include <pc80/i8254.h>
#include <delay.h>
#include <gpio.h>
static void beep_and_blink(void)
{
static uint8_t blink = 0;
static uint8_t beep_count = 0;
gpio_set(GPP_E0, blink);
/* Beep 12 times at most, constant beeps may be annoying */
if (beep_count < 12) {
beep(800, 300);
mdelay(200);
beep_count++;
} else {
mdelay(500);
}
blink ^= 1;
}
void die_notify(void)
{
if (ENV_POSTCAR)
return;
/* Make SATA LED blink and use PC SPKR */
gpio_output(GPP_E0, 0);
while (1) {
beep_and_blink();
beep_and_blink();
beep_and_blink();
beep_and_blink();
delay(2);
}
}

View File

@ -0,0 +1,28 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <acpi/acpi.h>
DefinitionBlock(
"dsdt.aml",
"DSDT",
ACPI_DSDT_REV_2,
OEM_ID,
ACPI_TABLE_CREATOR,
0x20110725
)
{
#include <acpi/dsdt_top.asl>
#include <soc/intel/common/block/acpi/acpi/platform.asl>
#include <soc/intel/common/block/acpi/acpi/globalnvs.asl>
#include <cpu/intel/common/acpi/cpu.asl>
Scope (\_SB) {
Device (PCI0)
{
#include <soc/intel/common/block/acpi/acpi/northbridge.asl>
#include <soc/intel/elkhartlake/acpi/southbridge.asl>
}
}
#include <southbridge/intel/common/acpi/sleepstates.asl>
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <device/device.h>
#include <fsp/api.h>
#include <pc80/i8254.h>
#include <soc/ramstage.h>
static void mainboard_final(void *chip_info)
{
beep(1500, 200);
}
void mainboard_silicon_init_params(FSP_S_CONFIG *silconfig)
{
}
struct chip_operations mainboard_ops = {
.final = mainboard_final,
};

View File

@ -0,0 +1,53 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <soc/romstage.h>
#include <soc/meminit.h>
#include <spd_bin.h>
#include "gpio.h"
static const struct mb_cfg ddr4_mem_config = {
.UserBd = BOARD_TYPE_MOBILE,
.dq_pins_interleaved = 0,
.vref_ca_config = 2,
.ect = 0,
};
void mainboard_memory_init_params(FSPM_UPD *memupd)
{
FSP_M_CONFIG *mem_cfg = &memupd->FspmConfig;
struct spd_info module_spd_info = {
.read_type = READ_SPD_MEMPTR,
};
/* The only DIMM slot is routed to Channel 1 */
struct spd_block blk = {
.addr_map = { 0x52 },
};
gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table));
get_spd_smbus(&blk);
dump_spd_info(&blk);
if (blk.spd_array[0] == NULL)
die("No memory detected. Insert DIMM module");
module_spd_info.spd_spec.spd_data_ptr_info.spd_data_ptr = (uintptr_t)blk.spd_array[0];
module_spd_info.spd_spec.spd_data_ptr_info.spd_data_len = (uintptr_t)blk.len;
/* Set half_populated as false, because DIMM is on Channel 1 */
memcfg_init(mem_cfg, &ddr4_mem_config, &module_spd_info, false);
/* Clear Channel 0 DIMM 0 SPD, as the slot is not populated */
mem_cfg->MemorySpdPtr00 = 0;
/* Return back to coreboot if something goes wrong */
mem_cfg->ExitOnFailure = 1;
/* Disable both DIMMs at Channel 0 */
mem_cfg->DisableDimmChannel0 = 3;
/* Disable DIMM 1 at Channel 1 */
mem_cfg->DisableDimmChannel1 = 2;
mem_cfg->Lp4DqsOscEn = 0;
}

View File

@ -0,0 +1,38 @@
FLASH 16M {
SI_ALL 7M {
SI_DESC 4K
SI_ME
}
RW_MISC 424K {
UNIFIED_MRC_CACHE(PRESERVE) 128K {
RECOVERY_MRC_CACHE 64K
RW_MRC_CACHE 64K
}
SMMSTORE(PRESERVE) 256K
RW_SHARED 0x4000 {
SHARED_DATA@0x0 0x2000
VBLOCK_DEV@0x2000 0x2000
}
RW_NVRAM(PRESERVE) 24K
}
CONSOLE 0x20000
RW_SECTION_A {
VBLOCK_A 0x2000
FW_MAIN_A(CBFS)
RW_FWID_A 0x40
}
WP_RO@0xC00000 0x400000 {
RO_VPD(PRESERVE)@0x0 0x4000
RO_SECTION@0x4000 0x3fc000 {
FMAP@0x0 0x800
RO_FRID@0x800 0x40
RO_FRID_PAD@0x840 0x7c0
GBB@0x1000 0x3000
COREBOOT(CBFS)@0x4000 0x3f8000
}
}
}