Skip to content
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

OptiPlex 7010/9010 v0.1.0 #541

Merged
merged 13 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,38 @@ jobs:
path: |
build/coreboot.rom
retention-days: 30
build_optiplex:
runs-on: ubuntu-22.04
container:
image: coreboot/coreboot-sdk:2023-11-24_2731fa619b
options: --user 1001
strategy:
matrix:
vendor: [ dell ]
model: [ optiplex_9010_sff, optiplex_9010_sff_uefi ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Checkout pull request HEAD commit instead of merge commit
# See: https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
ref: ${{ github.event.pull_request.head.sha }}
# Fetch complete history
fetch-depth: 0
- name: Checkout all submodules
run: git submodule update --init --recursive --checkout
- name: Build Dasharo
run: |
cp configs/config.${{ matrix.vendor }}_${{ matrix.model }}_txt .config
make olddefconfig
make
- name: Save artifacts
uses: actions/upload-artifact@v4
with:
name: "dasharo-${{ matrix.vendor }}-${{ matrix.model }}"
path: |
build/coreboot.rom
retention-days: 30
build_msi:
runs-on: ubuntu-22.04
container:
Expand Down
70 changes: 53 additions & 17 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,59 @@ set -euo pipefail
usage() {
echo "${0} CMD"
echo "Available CMDs:"
echo -e "\tz690a_ddr4 - build Dasharo image compatible with MSI PRO Z690-A (WIFI) DDR4"
echo -e "\tz690a_ddr5 - build Dasharo image compatible with MSI PRO Z690-A (WIFI)"
echo -e "\tz790p_ddr4 - build Dasharo image compatible with MSI PRO Z790-P (WIFI) DDR4"
echo -e "\tz790p_ddr5 - build Dasharo image compatible with MSI PRO Z790-P (WIFI)"
echo -e "\tvp66xx - build Dasharo for Protectli VP66xx"
echo -e "\tvp46xx - build Dasharo for Protectli VP46xx"
echo -e "\tvp2420 - build Dasharo for Protectli VP2420"
echo -e "\tvp2410 - build Dasharo for Protectli VP2410"
echo -e "\tV1210 - build Dasharo for Protectli V1210"
echo -e "\tV1410 - build Dasharo for Protectli V1410"
echo -e "\tV1610 - build Dasharo for Protectli V1610"
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"
echo -e "\tapu6 - build Dasharo for PC Engines APU6"
echo -e "\tqemu - build Dasharo for QEMU Q35"
echo -e "\tqemu_full - build Dasharo for QEMU Q35 with all menus available"
echo -e "\tz690a_ddr4 - build Dasharo image compatible with MSI PRO Z690-A (WIFI) DDR4"
echo -e "\tz690a_ddr5 - build Dasharo image compatible with MSI PRO Z690-A (WIFI)"
echo -e "\tz790p_ddr4 - build Dasharo image compatible with MSI PRO Z790-P (WIFI) DDR4"
echo -e "\tz790p_ddr5 - build Dasharo image compatible with MSI PRO Z790-P (WIFI)"
echo -e "\tvp66xx - build Dasharo for Protectli VP66xx"
echo -e "\tvp46xx - build Dasharo for Protectli VP46xx"
echo -e "\tvp2420 - build Dasharo for Protectli VP2420"
echo -e "\tvp2410 - build Dasharo for Protectli VP2410"
echo -e "\tV1210 - build Dasharo for Protectli V1210"
echo -e "\tV1410 - build Dasharo for Protectli V1410"
echo -e "\tV1610 - build Dasharo for Protectli V1610"
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"
echo -e "\tapu6 - build Dasharo for PC Engines APU6"
echo -e "\toptiplex_9010 - build Dasharo compatible with Dell OptiPlex 7010/9010"
echo -e "\tqemu - build Dasharo for QEMU Q35"
echo -e "\tqemu_full - build Dasharo for QEMU Q35 with all menus available"
}

SDKVER="2023-11-24_2731fa619b"


function build_optiplex_9010 {
DEFCONFIG="configs/config.dell_optiplex_9010_sff_uefi_txt"
FW_VERSION=v0.1.0-rc1

docker run --rm -t -u $UID -v $PWD:/home/coreboot/coreboot \
-v $HOME/.ssh:/home/coreboot/.ssh \
-w /home/coreboot/coreboot coreboot/coreboot-sdk:$SDKVER \
/bin/bash -c "make distclean"

cp "${DEFCONFIG}" .config

git submodule update --init --checkout

echo "Building Dasharo compatible with Dell OptiPlex 7010/9010 (version $FW_VERSION)"

docker run --rm -t -u $UID -v $PWD:/home/coreboot/coreboot \
-v $HOME/.ssh:/home/coreboot/.ssh \
-w /home/coreboot/coreboot coreboot/coreboot-sdk:$SDKVER \
/bin/bash -c "make olddefconfig && make -j$(nproc)"

cp build/coreboot.rom ${BOARD}_${FW_VERSION}.rom
if [ $? -eq 0 ]; then
echo "Result binary placed in $PWD/${BOARD}_${FW_VERSION}.rom"
sha256sum ${BOARD}_${FW_VERSION}.rom > ${BOARD}_${FW_VERSION}.rom.sha256
else
echo "Build failed!"
exit 1
fi
}

function build_msi {
DEFCONFIG="configs/config.${BOARD}_$1"
FW_VERSION=$(cat ${DEFCONFIG} | grep CONFIG_LOCALVERSION | cut -d '=' -f 2 | tr -d '"')
Expand Down Expand Up @@ -247,6 +279,10 @@ case "$CMD" in
"apu6" | "APU6" )
build_pcengines "apu6"
;;
"optiplex_9010" | "optiplex_7010" )
BOARD=optiplex_9010
build_optiplex_9010
;;
"qemu" | "QEMU" | "q35" | "Q35" )
build_qemu
;;
Expand Down
45 changes: 45 additions & 0 deletions configs/config.dell_optiplex_9010_sff_uefi
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
CONFIG_USE_OPTION_TABLE=y
CONFIG_USE_BLOBS=y
CONFIG_VENDOR_DELL=y
CONFIG_BOARD_DELL_OPTIPLEX_9010=y
CONFIG_ONBOARD_VGA_IS_PRIMARY=y
# CONFIG_DRIVERS_UART_8250IO is not set
CONFIG_PCIEXP_CLK_PM=y
CONFIG_HAVE_EM100_SUPPORT=y
CONFIG_LOCALVERSION="v0.1.0"
CONFIG_PAYLOAD_EDK2=y
CONFIG_EDK2_BOOTSPLASH_FILE="3rdparty/dasharo-blobs/dasharo/bootsplash.bmp"
CONFIG_EDK2_BOOT_MENU_KEY=0x0011
CONFIG_EDK2_GOP_DRIVER=y
CONFIG_EDK2_REPOSITORY="https://github.com/Dasharo/edk2.git"
CONFIG_EDK2_TAG_OR_REV="origin/rebased"
CONFIG_EDK2_SETUP_MENU_KEY=0x000C
# CONFIG_EDK2_CBMEM_LOGGING=y
CONFIG_EDK2_FOLLOW_BGRT_SPEC=y
CONFIG_EDK2_SD_MMC_TIMEOUT=1000
CONFIG_TPM_MEASURED_BOOT=y
CONFIG_VENDOR_DELL=y
CONFIG_GENERIC_LINEAR_FRAMEBUFFER=y
CONFIG_LINEAR_FRAMEBUFFER=y
CONFIG_TPM2=n
CONFIG_EDK2_SERIAL_SUPPORT=y
CONFIG_EDK2_DASHARO_SERIAL_REDIRECTION_DEFAULT_ENABLE=y
CONFIG_BUILD_IPXE=y
CONFIG_IPXE_ADD_SCRIPT=y
CONFIG_IPXE_SCRIPT="3rdparty/dasharo-blobs/dasharo/dasharo.ipxe"
CONFIG_IPXE_CUSTOM_BUILD_ID="12345678"
CONFIG_IPXE_NO_PROMPT=y
CONFIG_EDK2_ENABLE_IPXE=y
CONFIG_EDK2_IPXE_OPTION_NAME="Network Boot and Utilities"
CONFIG_EDK2_DASHARO_SYSTEM_FEATURES=y
CONFIG_EDK2_DASHARO_SECURITY_OPTIONS=y
CONFIG_EDK2_DASHARO_USB_CONFIG=y
CONFIG_EDK2_DASHARO_CHIPSET_CONFIG=y
CONFIG_EDK2_DASHARO_NETWORK_BOOT_DEFAULT_ENABLE=y
CONFIG_EDK2_PLATFORMS_REPOSITORY="https://github.com/Dasharo/edk2-platforms"
CONFIG_EDK2_USE_EDK2_PLATFORMS=y
CONFIG_EDK2_PLATFORMS_TAG_OR_REV="3323ed481d35096fb6a7eae7b49f35eff00f86cf"
CONFIG_EDK2_SETUP_PASSWORD=y
CONFIG_EDK2_DASHARO_NETWORK_CONFIG=y
CONFIG_FMDFILE="src/mainboard/dell/snb_ivb_workstations/default.fmd"
# CONFIG_IPXE_SERIAL_CONSOLE is not set
48 changes: 48 additions & 0 deletions configs/config.dell_optiplex_9010_sff_uefi_txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
CONFIG_USE_OPTION_TABLE=y
CONFIG_USE_BLOBS=y
CONFIG_VENDOR_DELL=y
CONFIG_BOARD_DELL_OPTIPLEX_9010=y
CONFIG_ONBOARD_VGA_IS_PRIMARY=y
# CONFIG_DRIVERS_UART_8250IO is not set
CONFIG_PCIEXP_CLK_PM=y
CONFIG_HAVE_EM100_SUPPORT=y
CONFIG_LOCALVERSION="v0.1.0"
CONFIG_PAYLOAD_EDK2=y
CONFIG_EDK2_BOOTSPLASH_FILE="3rdparty/dasharo-blobs/dasharo/bootsplash.bmp"
CONFIG_EDK2_BOOT_MENU_KEY=0x0011
CONFIG_EDK2_GOP_DRIVER=y
CONFIG_EDK2_REPOSITORY="https://github.com/Dasharo/edk2.git"
CONFIG_EDK2_TAG_OR_REV="origin/rebased"
CONFIG_EDK2_SETUP_MENU_KEY=0x000C
# CONFIG_EDK2_CBMEM_LOGGING=y
CONFIG_EDK2_FOLLOW_BGRT_SPEC=y
CONFIG_EDK2_SD_MMC_TIMEOUT=1000
CONFIG_TPM_MEASURED_BOOT=y
CONFIG_VENDOR_DELL=y
CONFIG_GENERIC_LINEAR_FRAMEBUFFER=y
CONFIG_LINEAR_FRAMEBUFFER=y
CONFIG_TPM2=n
CONFIG_EDK2_SERIAL_SUPPORT=y
CONFIG_EDK2_DASHARO_SERIAL_REDIRECTION_DEFAULT_ENABLE=y
CONFIG_BUILD_IPXE=y
CONFIG_IPXE_ADD_SCRIPT=y
CONFIG_IPXE_SCRIPT="3rdparty/dasharo-blobs/dasharo/dasharo.ipxe"
CONFIG_IPXE_CUSTOM_BUILD_ID="12345678"
CONFIG_IPXE_NO_PROMPT=y
CONFIG_EDK2_ENABLE_IPXE=y
CONFIG_EDK2_IPXE_OPTION_NAME="Network Boot and Utilities"
CONFIG_EDK2_DASHARO_SYSTEM_FEATURES=y
CONFIG_EDK2_DASHARO_SECURITY_OPTIONS=y
CONFIG_EDK2_DASHARO_USB_CONFIG=y
CONFIG_EDK2_DASHARO_CHIPSET_CONFIG=y
CONFIG_EDK2_DASHARO_NETWORK_BOOT_DEFAULT_ENABLE=y
CONFIG_EDK2_PLATFORMS_REPOSITORY="https://github.com/Dasharo/edk2-platforms"
CONFIG_EDK2_USE_EDK2_PLATFORMS=y
CONFIG_EDK2_PLATFORMS_TAG_OR_REV="3323ed481d35096fb6a7eae7b49f35eff00f86cf"
CONFIG_EDK2_SETUP_PASSWORD=y
CONFIG_EDK2_DASHARO_NETWORK_CONFIG=y
CONFIG_INTEL_TXT=y
CONFIG_INTEL_TXT_BDR_VERSION=4
CONFIG_INTEL_TXT_LOGGING=y
CONFIG_FMDFILE="src/mainboard/dell/snb_ivb_workstations/default.fmd"
# CONFIG_IPXE_SERIAL_CONSOLE is not set
19 changes: 19 additions & 0 deletions src/mainboard/dell/snb_ivb_workstations/default.fmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FLASH@0xff400000 12M {
SI_ALL 6M {
SI_DESC 4K
SI_GBE 16K
SI_ME
}
UNUSED 2M
SI_BIOS 4M {
MISC_RW 384K {
SMMSTORE(PRESERVE) 256K
RW_MRC_CACHE 64K
RW_ELOG(PRESERVE) 64K
}
WP_RO {
FMAP 2K
COREBOOT(CBFS)
}
}
}
4 changes: 2 additions & 2 deletions src/security/intel/txt/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ bool intel_txt_prepare_txt_env(void)
break;
}
}

#if CONFIG(TPM2)
miczyg1 marked this conversation as resolved.
Show resolved Hide resolved
if (tlcl_get_family() == TPM_2) {
/*
* We can't do SCHECK without the mandatory TPM indices present,
Expand All @@ -610,7 +610,7 @@ bool intel_txt_prepare_txt_env(void)
if (check_tpm2_indices())
return true;
}

#endif
/* Need to park all APs. */
if (CONFIG(PARALLEL_MP_AP_WORK))
mp_park_aps();
Expand Down
1 change: 1 addition & 0 deletions src/security/intel/txt/romstage.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#endif
#if CONFIG(SOUTHBRIDGE_INTEL_COMMON_PMBASE)
#include <southbridge/intel/common/pmbase.h>
#include <southbridge/intel/common/pmutil.h>
#endif
#include <timer.h>
#include <types.h>
Expand Down
Loading