Skip to content

Commit 555bd9a

Browse files
committed
Changes vs linuxboot#2062 to build EC on top of v0.2.9 nix based docker image independently for v540tu and v560tu (toehr boards missing)
Steal/adapt/reuse as needed to speed things as needed for next feature freeze @macpijan Signed-off-by: Thierry Laurion <insurgo@riseup.net>
1 parent e494475 commit 555bd9a

9 files changed

Lines changed: 62 additions & 10 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,8 @@ docker push "$docker_hub_repo:$docker_version"
460460
new_digest=$(./docker/get_digest.sh -y "$docker_hub_repo:$docker_version" | tail -n1)
461461
prev_digest=$(grep '^[^#]' docker/DOCKER_REPRO_DIGEST | head -n1)
462462
463-
# Update the digest in the repository file
464-
sed -i "s|$prev_digest|$new_digest|" docker/DOCKER_REPRO_DIGEST
463+
# Update the digest in the repository file and CircleCI config
464+
sed -i "s|$prev_digest|$new_digest|" docker/DOCKER_REPRO_DIGEST .circleci/config.yml
465465
466466
# Update the version comment in the repository file
467467
sed -i "s|# Version: .*|# Version: $docker_version|" docker/DOCKER_REPRO_DIGEST

boards/novacustom-v540tu/novacustom-v540tu.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
export CONFIG_COREBOOT=y
1717
export CONFIG_COREBOOT_VERSION=dasharo
18+
export CONFIG_DASHARO_EC=y
1819
export CONFIG_LINUX_VERSION=6.1.8
1920

2021
CONFIG_COREBOOT_CONFIG=config/coreboot-novacustom-v540tu.config

boards/novacustom-v560tu/novacustom-v560tu.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
export CONFIG_COREBOOT=y
1717
export CONFIG_COREBOOT_VERSION=dasharo
18+
export CONFIG_DASHARO_EC=y
1819
export CONFIG_LINUX_VERSION=6.1.8
1920

2021
CONFIG_COREBOOT_CONFIG=config/coreboot-novacustom-v560tu.config

config/coreboot-nitropad-ns50.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# General setup
88
#
9-
CONFIG_LOCALVERSION="novacustom_v56x_mtl_igpu_v1.0.1-rc3"
9+
CONFIG_LOCALVERSION="novacustom_v56x_mtl_igpu_v1.0.1"
1010
CONFIG_CBFS_PREFIX="fallback"
1111
CONFIG_COMPILER_GCC=y
1212
# CONFIG_COMPILER_LLVM_CLANG is not set

config/coreboot-novacustom-nv4x_adl.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# General setup
88
#
9-
CONFIG_LOCALVERSION="v1.8.0-rc4"
9+
CONFIG_LOCALVERSION="novacustom_v56x_mtl_igpu_v1.0.1"
1010
CONFIG_CBFS_PREFIX="fallback"
1111
CONFIG_COMPILER_GCC=y
1212
# CONFIG_COMPILER_LLVM_CLANG is not set

config/coreboot-novacustom-v540tu.config

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# General setup
88
#
9-
CONFIG_LOCALVERSION="v1.0.1-rc3"
9+
CONFIG_LOCALVERSION="novacustom_v56x_mtl_igpu_v1.0.1"
1010
CONFIG_CBFS_PREFIX="fallback"
1111
CONFIG_COMPILER_GCC=y
1212
# CONFIG_COMPILER_LLVM_CLANG is not set
@@ -553,7 +553,8 @@ CONFIG_RCBA_LENGTH=0x4000
553553
#
554554
CONFIG_EC_ACPI=y
555555
CONFIG_EC_DASHARO_EC=y
556-
# CONFIG_EC_DASHARO_EC_UPDATE is not set
556+
CONFIG_EC_DASHARO_EC_UPDATE=y
557+
CONFIG_EC_DASHARO_EC_UPDATE_FILE="@COREBOOT_BUILD_DIR@/ec.rom"
557558

558559
#
559560
# Intel Firmware

config/coreboot-novacustom-v560tu.config

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# General setup
88
#
9-
CONFIG_LOCALVERSION="v1.0.1-rc3"
9+
CONFIG_LOCALVERSION="novacustom_v56x_mtl_igpu_v1.0.1"
1010
CONFIG_CBFS_PREFIX="fallback"
1111
CONFIG_COMPILER_GCC=y
1212
# CONFIG_COMPILER_LLVM_CLANG is not set
@@ -553,7 +553,8 @@ CONFIG_RCBA_LENGTH=0x4000
553553
#
554554
CONFIG_EC_ACPI=y
555555
CONFIG_EC_DASHARO_EC=y
556-
# CONFIG_EC_DASHARO_EC_UPDATE is not set
556+
CONFIG_EC_DASHARO_EC_UPDATE=y
557+
CONFIG_EC_DASHARO_EC_UPDATE_FILE="@COREBOOT_BUILD_DIR@/ec.rom"
557558

558559
#
559560
# Intel Firmware

modules/coreboot

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ifeq "$(CONFIG_COREBOOT)" "y"
22

3-
CONFIG_COREBOOT_ROM ?= coreboot.rom
3+
CONFIG_COREBOOT_ROM ?= coreboot.rom
44
CONFIG_COREBOOT_BOOTBLOCK ?=
55

66
ifeq "$(CONFIG_TARGET_ARCH)" "x86"
@@ -131,6 +131,7 @@ coreboot_dir := $($(coreboot_module)_dir)
131131
coreboot_base_dir := $($(coreboot_module)_base_dir)
132132

133133
$(coreboot_module)_depends += $(if $(CONFIG_PURISM_BLOBS), purism-blobs)
134+
$(coreboot_module)_depends += $(if $(CONFIG_DASHARO_EC), dasharo-ec)
134135

135136
# coreboot builds are specialized on a per-target basis.
136137
# The builds are done in a per-target subdirectory
@@ -167,6 +168,7 @@ $(coreboot_module)_configure := \
167168
sed -i '/^CONFIG_MAINBOARD_SMBIOS_MANUFACTURER/d' $(build)/$(coreboot_dir)/.config; \
168169
echo 'CONFIG_MAINBOARD_SMBIOS_MANUFACTURER="$(CONFIG_COREBOOT_SMBIOS_MANUFACTURER)"' >> $(build)/$(coreboot_dir)/.config; \
169170
fi; \
171+
sed -i 's|@COREBOOT_BUILD_DIR@|$(build)/$(coreboot_dir)|g' "$(build)/$(coreboot_dir)/.config"; \
170172
$(MAKE) olddefconfig \
171173
-C "$(build)/$(coreboot_base_dir)" \
172174
obj="$(build)/$(coreboot_dir)" \
@@ -285,7 +287,7 @@ coreboot.save_in_defconfig_format_in_place:
285287
olddefconfig && \
286288
$(MAKE) \
287289
-C "$(build)/$(coreboot_base_dir)" \
288-
DOTCONFIG="$(build)/$(coreboot_dir)/.config" \
290+
DOTCONFIG="$(build)/$(coreboot_dir)/.config" \
289291
savedefconfig && \
290292
mv "$(build)/$(coreboot_base_dir)/defconfig" "$(pwd)/$(CONFIG_COREBOOT_CONFIG)"
291293

modules/dasharo-ec

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
ifeq "$(CONFIG_DASHARO_EC)" "y"
2+
3+
modules-y += dasharo-ec
4+
5+
dasharo-ec_repo := https://github.com/Dasharo/ec
6+
dasharo-ec_commit_hash := d198b641195e60e13afc17be9464e4f402d1c2fa
7+
8+
# dasharo/ec system76/ec uses slash-separated BOARD paths (src/board/novacustom/v540tu/)
9+
ifeq "$(BOARD)" "novacustom-v540tu"
10+
DASHARO_EC_BOARD_MODEL := novacustom/v540tu
11+
else ifeq "$(BOARD)" "novacustom-v560tu"
12+
DASHARO_EC_BOARD_MODEL := novacustom/v560tu
13+
else
14+
$(error "$(BOARD): no Dasharo EC board model mapping defined")
15+
endif
16+
17+
dasharo-ec_version := $(dasharo-ec_commit_hash)
18+
dasharo-ec_base_dir := dasharo-ec-$(dasharo-ec_version)
19+
dasharo-ec_dir := dasharo-ec-$(dasharo-ec_version)
20+
21+
# definemodule checks that this file exists after _target runs
22+
dasharo-ec_output := .built
23+
24+
# definemodule runs: ( echo "..." ; $(MAKE) -C $(build)/$(dasharo-ec_dir) $(dasharo-ec_target) ) | tee log
25+
# The whole expansion is a subshell, so && is valid shell inside it.
26+
# BOARD=... is passed to the upstream EC Makefile as a variable override.
27+
# Touch .built so definemodule's output sentinel is satisfied.
28+
dasharo-ec_target := \
29+
BOARD=$(DASHARO_EC_BOARD_MODEL) \
30+
&& touch "$(build)/$(dasharo-ec_dir)/.built"
31+
32+
# After dasharo-ec/.build sentinel is touched by definemodule, copy ec.rom into
33+
# the per-board coreboot build dir. The datestamped subdir is matched with glob.
34+
# $(coreboot_dir) = coreboot-dasharo/$(BOARD) — defined in modules/coreboot.
35+
$(build)/$(coreboot_dir)/ec.rom: $(build)/$(dasharo-ec_dir)/.build
36+
$(call do,EC-ROM,$(DASHARO_EC_BOARD_MODEL) -> $(coreboot_dir)/ec.rom, \
37+
mkdir -p "$(build)/$(coreboot_dir)" \
38+
&& sh -c 'cp "$(build)/$(dasharo-ec_dir)/build/$(DASHARO_EC_BOARD_MODEL)"/*/ec.rom \
39+
"$(build)/$(coreboot_dir)/ec.rom"' \
40+
)
41+
42+
# Append ec.rom as prerequisite to coreboot configure without redefining recipe.
43+
# Guarantees coreboot configure runs only after ec.rom is in place.
44+
$(build)/$(coreboot_dir)/.configured: $(build)/$(coreboot_dir)/ec.rom
45+
46+
endif

0 commit comments

Comments
 (0)