Skip to content

NovaCustom MiniPC #643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 16 commits into
base: dasharo
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rdparty/dasharo-blobs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not reuse FSP and GOP driver from the MTL laptops?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will try with the FSP, the laptop GOP driver doesn't work - it somehow alters the VBT (I've compared what ends up loaded by Ubuntu to what's in the repo) making the HDMI ports not work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VBT is always altered when seen by OS. VBT is a part of operation region that is used for communicating with graphics. You can't expect to have the same VBT after intiialization, as it is supposed to be patched runtime.

Also I don;t see a reason to use EFI GOP driver at all. FSP GOP should be sufficient in the first place. We used EFI GOP in laptops because of high DPI panel. The NUC BOX does not have internal LCD panel

Submodule dasharo-blobs updated 23 files
+ novacustom/nuc_box/IntelGopDriver.efi
+6,541 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/Fsp.bsf
+ novacustom/nuc_box/MeteorLakeFspBinPkg/Fsp.fd
+114 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/FspPkgPcdShare.dsc
+55 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/Include/FirmwareVersionInfo.h
+80 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/Include/FspProducerDataHeader.h
+48 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/Include/FspUpd.h
+5,218 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/Include/FspmUpd.h
+4,557 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/Include/FspsUpd.h
+420 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/Include/FsptUpd.h
+349 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/Include/GpioConfig.h
+382 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/Include/GpioSampleDef.h
+59 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/Include/HobUsageDataHob.h
+345 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/Include/MemInfoHob.h
+56 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/Include/SmbiosCacheInfoHob.h
+67 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/Include/SmbiosProcessorInfoHob.h
+49 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/Library/FspPcdListLib/FspPcdListLibNull.c
+86 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/Library/FspPcdListLib/FspPcdListLibNull.inf
+43 −0 novacustom/nuc_box/MeteorLakeFspBinPkg/MeteorLakeFspBinPkg.dec
+43 −0 novacustom/nuc_box/README.md
+3 −0 novacustom/nuc_box/SHA256SUMS
+ novacustom/nuc_box/ifd.bin
+ novacustom/nuc_box/me.bin
2 changes: 1 addition & 1 deletion 3rdparty/intel-microcode
Submodule intel-microcode updated from eeb93b to 8ac937
5 changes: 5 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ usage() {
echo -e "\tv540tu - build Dasharo for Novacustom V540TU"
echo -e "\tv560tnx - build Dasharo for Novacustom V560TNx"
echo -e "\tv560tu - build Dasharo for Novacustom V560TU"
echo -e "\tnuc_box - build Dasharo for Novacustom NUC BOX"
echo -e "\tapu2 - build Dasharo for PC Engines APU2"
echo -e "\tapu3 - build Dasharo for PC Engines APU3"
echo -e "\tapu4 - build Dasharo for PC Engines APU4"
Expand Down Expand Up @@ -445,6 +446,10 @@ case "$CMD" in
BOARD="v560tu"
build_novacustom_v5x0tu "v560tu"
;;
"nuc_box" | "nucbox" )
BOARD="nuc_box"
build_novacustom "nuc_box"
;;
"v540tu " | "V540TU " )
BOARD="v540tu"
build_novacustom_v5x0tu "v540tu "
Expand Down
61 changes: 61 additions & 0 deletions configs/config.novacustom_nuc_box
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
CONFIG_LOCALVERSION="v0.9.0-rc1"
CONFIG_CCACHE=y
CONFIG_USE_OPTION_TABLE=y
CONFIG_VENDOR_NOVACUSTOM=y
CONFIG_MAINBOARD_VENDOR="NovaCustom"
CONFIG_CBFS_SIZE=0x600000
CONFIG_VBOOT=y
# CONFIG_POST_IO is not set
CONFIG_IFD_BIN_PATH="3rdparty/dasharo-blobs/novacustom/nuc_box/ifd.bin"
CONFIG_ME_BIN_PATH="3rdparty/dasharo-blobs/novacustom/nuc_box/me.bin"
CONFIG_HAVE_IFD_BIN=y
CONFIG_BOARD_NOVACUSTOM_NUC_BOX=y
CONFIG_EDK2_BOOTSPLASH_FILE="3rdparty/dasharo-blobs/novacustom/bootsplash.bmp"
CONFIG_FSP_HEADER_PATH="3rdparty/dasharo-blobs/novacustom/nuc_box/MeteorLakeFspBinPkg/Include/"
CONFIG_FSP_FD_PATH="3rdparty/dasharo-blobs/novacustom/nuc_box/MeteorLakeFspBinPkg/Fsp.fd"
CONFIG_SOFTWARE_CONNECTION_MANAGER=y
CONFIG_VALIDATE_INTEL_DESCRIPTOR=y
CONFIG_HAVE_ME_BIN=y
CONFIG_NO_GFX_INIT=y
CONFIG_DRIVERS_EFI_VARIABLE_STORE=y
CONFIG_ADD_FSP_BINARIES=y
CONFIG_FSP_FULL_FD=y
CONFIG_USE_PC_CMOS_ALTCENTURY=y
CONFIG_VBOOT_CBFS_INTEGRATION=y
CONFIG_BOOTMEDIA_LOCK_CONTROLLER=y
CONFIG_BOOTMEDIA_SMM_BWP=y
CONFIG_BOOTMEDIA_LOCK_WPRO_VBOOT_RO=y
CONFIG_PAYLOAD_EDK2=y
CONFIG_EDK2_REPOSITORY="https://github.com/Dasharo/edk2"
CONFIG_EDK2_TAG_OR_REV="04af20830d1108571f3ed35341ecadbcb310f48d"
CONFIG_EDK2_USE_EDK2_PLATFORMS=y
CONFIG_EDK2_PLATFORMS_REPOSITORY="https://github.com/Dasharo/edk2-platforms"
CONFIG_EDK2_PLATFORMS_TAG_OR_REV="1002a59639f111a2f8178b77d1f5fde0ea8d976f"
CONFIG_EDK2_CBMEM_LOGGING=y
CONFIG_EDK2_FOLLOW_BGRT_SPEC=y
CONFIG_EDK2_SERIAL_SUPPORT=y
CONFIG_EDK2_FTDI_USB_UART_SUPPORT=y
CONFIG_EDK2_GOP_FILE="3rdparty/dasharo-blobs/novacustom/nuc_box/IntelGopDriver.efi"
CONFIG_BUILD_IPXE=y
CONFIG_IPXE_ADD_SCRIPT=y
CONFIG_IPXE_SCRIPT="3rdparty/dasharo-blobs/dasharo/dasharo.ipxe"
CONFIG_IPXE_CUSTOM_BUILD_ID="0123456789"
CONFIG_EDK2_SKIP_PS2_DETECT=y
CONFIG_EDK2_ENABLE_IPXE=y
# CONFIG_EDK2_SECURE_BOOT_DEFAULT_ENABLE is not set
CONFIG_EDK2_SETUP_PASSWORD=y
CONFIG_EDK2_PERFORMANCE_MEASUREMENT_ENABLE=y
CONFIG_EDK2_DASHARO_SYSTEM_FEATURES=y
CONFIG_EDK2_DASHARO_SECURITY_OPTIONS=y
CONFIG_EDK2_DASHARO_INTEL_ME_OPTIONS=y
CONFIG_EDK2_DASHARO_USB_CONFIG=y
CONFIG_EDK2_DASHARO_NETWORK_CONFIG=y
CONFIG_EDK2_DASHARO_POWER_CONFIG=y
CONFIG_EDK2_FAN_CURVE_OPTION=y
CONFIG_EDK2_CPU_THROTTLING_THRESHOLD_OPTION=y
CONFIG_EDK2_BOOT_MENU_KEY=0x0011
CONFIG_EDK2_SETUP_MENU_KEY=0x000C
CONFIG_EDK2_CREATE_PREINSTALLED_BOOT_OPTIONS=y
CONFIG_EDK2_ENABLE_FAST_BOOT_FEATURE=y
CONFIG_EDK2_ENABLE_QUIET_BOOT_FEATURE=y
CONFIG_COMPRESSED_PAYLOAD_LZ4=y
102 changes: 102 additions & 0 deletions src/mainboard/novacustom/nuc_box/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
## SPDX-License-Identifier: GPL-2.0-only

config BOARD_NOVACUSTOM_NUC_BOX_COMMON
def_bool n
select BOARD_ROMSIZE_KB_32768
select CRB_TPM
select DRIVERS_GENERIC_CBFS_SERIAL
select DRIVERS_GENERIC_CBFS_UUID
select DRIVERS_UART_8250IO
select HAVE_ACPI_RESUME
select HAVE_ACPI_TABLES
select HAVE_CMOS_DEFAULT
select HAVE_INTEL_PTT
select HAVE_OPTION_TABLE
select INTEL_GMA_HAVE_VBT
select MAINBOARD_HAS_TPM2
select NO_UART_ON_SUPERIO
select PCIEXP_SUPPORT_RESIZABLE_BARS
select SOC_INTEL_COMMON_BLOCK_HDA_VERB
select SOC_INTEL_CRASHLOG
select SOC_INTEL_METEORLAKE
select SPD_READ_BY_WORD

config BOARD_NOVACUSTOM_NUC_BOX
select BOARD_NOVACUSTOM_NUC_BOX_COMMON
select SOC_INTEL_ENABLE_USB4_PCIE_RESOURCES
select SOC_INTEL_METEORLAKE_U_H

if BOARD_NOVACUSTOM_NUC_BOX_COMMON

config MAINBOARD_DIR
default "novacustom/nuc_box"

config VARIANT_DIR
default "nuc_box" if BOARD_NOVACUSTOM_NUC_BOX

config OVERRIDE_DEVICETREE
default "variants/\$(CONFIG_VARIANT_DIR)/overridetree.cb"

config MAINBOARD_PART_NUMBER
default "NUC BOX" if BOARD_NOVACUSTOM_NUC_BOX

config MAINBOARD_SMBIOS_PRODUCT_NAME
default "NUC_BOX" if BOARD_NOVACUSTOM_NUC_BOX

config MAINBOARD_VERSION
default "nuc_box" if BOARD_NOVACUSTOM_NUC_BOX

config CMOS_DEFAULT_FILE
default "src/mainboard/\$(MAINBOARDDIR)/cmos.default"

config CONSOLE_POST
default y

config D3COLD_SUPPORT
default n

config DIMM_SPD_SIZE
default 1024

config FMDFILE
default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/variants/\$(CONFIG_VARIANT_DIR)/board.fmd"

config ONBOARD_VGA_IS_PRIMARY
default y

config PCIEXP_DEFAULT_MAX_RESIZABLE_BAR_BITS
default 36

config POST_DEVICE
default n

config TPM_MEASURED_BOOT
default y

config UART_FOR_CONSOLE
default 0

# PM Timer Disabled, saves power
config USE_PM_ACPI_TIMER
default n

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 HAS_RECOVERY_MRC_CACHE
select VBOOT_ALWAYS_ENABLE_DISPLAY
select VBOOT_CLEAR_RECOVERY_IN_RAMSTAGE
select VBOOT_MOCK_SECDATA
select VBOOT_NO_BOARD_SUPPORT
select VBOOT_SLOTS_RW_A
select VBOOT_NO_TPM

config VBOOT_VBNV_OFFSET
default 0x28

config VBOOT_FWID_VERSION
default "\$(CONFIG_LOCALVERSION)"

endif
4 changes: 4 additions & 0 deletions src/mainboard/novacustom/nuc_box/Kconfig.name
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## SPDX-License-Identifier: GPL-2.0-only

config BOARD_NOVACUSTOM_NUC_BOX
bool "nuc_box"
13 changes: 13 additions & 0 deletions src/mainboard/novacustom/nuc_box/Makefile.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## SPDX-License-Identifier: GPL-2.0-only

CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include

bootblock-y += bootblock.c
bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c

romstage-y += variants/$(VARIANT_DIR)/romstage.c

ramstage-y += ramstage.c
ramstage-y += variants/$(VARIANT_DIR)/hda_verb.c
ramstage-y += variants/$(VARIANT_DIR)/gpio.c
ramstage-y += variants/$(VARIANT_DIR)/ramstage.c
6 changes: 6 additions & 0 deletions src/mainboard/novacustom/nuc_box/acpi/mainboard.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */

Scope (\_SB) {
#include "sio.asl"
#include "sleep.asl"
}
49 changes: 49 additions & 0 deletions src/mainboard/novacustom/nuc_box/acpi/sio.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* SPDX-License-Identifier: GPL-2.0-only */

Device (SIO) {
Name (_ADR, 0x2E)
OperationRegion (SIOA, SystemIO, 0x2E, 0x02)
Field (SIOA, ByteAcc, NoLock, Preserve)
{
SI2E, 8,
SI2F, 8,
}
IndexField (SI2E, SI2F, ByteAcc, NoLock, Preserve)
{
Offset (0x07),
SLDN, 8, /* Logical Device Number */
Offset(0xE5),
SRE5, 8, /* Register 0xE5 */
}

Method (ENTR, 0, Serialized) {
// Enter config mode
SI2E = 0x87
SI2E = 0x87
}

Method (EXIT, 0, Serialized) {
// Exit config mode
SI2E = 0xAA
}

Method (PTS, 0, Serialized) {
ENTR()

// Turn on fading LED
SLDN = 0x15
SRE5 = 0x43

EXIT()
}

Method (WAK, 0, Serialized) {
ENTR()

// Turn off fading LED
SLDN = 0x15
SRE5 = 0x42

EXIT()
}
}
11 changes: 11 additions & 0 deletions src/mainboard/novacustom/nuc_box/acpi/sleep.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0-only */

/* Method called from _PTS prior to enter sleep state */
Method (MPTS, 1) {
\_SB.SIO.PTS()
}

/* Method called from _WAK prior to wakeup */
Method (MWAK, 1) {
\_SB.SIO.WAK()
}
6 changes: 6 additions & 0 deletions src/mainboard/novacustom/nuc_box/board_info.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Vendor name: NovaCustom
Category: desktop
ROM package: WSON-8
ROM protocol: SPI
ROM socketed: y
Flashrom support: y
Loading
Loading