Conversation
Required to to build dasharo-ec module. Need to pin SDCC version to 4.2.0 to avoid Dasharo/dasharo-issues#1785 and be in sync with ec-sdk: Dasharo/ec-sdk#2 Using 3.8.0 in nix toolchain (as originally used in ec-sdk) was not feasible: linuxboot#2062 (comment) Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
Using SDCC 4.2.0 results in the same binary hash across heads and ec-sdk builds: 5fbc3b616f50ee84d3b3383b6359e9a759e6b727198866c2fde8f2ffc7da49b6 This differs from the release binary. This has NOT been tested on hardware. |
Required to to build dasharo-ec module. Need to pin SDCC version to 4.2.0 to avoid Dasharo/dasharo-issues#1785 and be in sync with ec-sdk: Dasharo/ec-sdk#2 Using 3.8.0 in nix toolchain (as originally used in ec-sdk) was not feasible: linuxboot#2062 (comment) Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
Required to to build dasharo-ec module. Need to pin SDCC version to 4.2.0 to avoid Dasharo/dasharo-issues#1785 and be in sync with ec-sdk: Dasharo/ec-sdk#2 Using 3.8.0 in nix toolchain (as originally used in ec-sdk) was not feasible: linuxboot#2062 (comment) Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
initrd/*functions : add logic to show ec version under System Information and recovery shell, populated in init Input for #2062
|
@macpijan docker image v0.2.8 + pinned hash usable from Dasharo#15 (comment), please rebase + cherry-pick + co-sign |
|
Building locally https://github.com/tlaurion/heads/tree/Dasharo_ec_build_master_merged%2Bcherry_pick to test on v560tu v540tu (master merged+fixed conflicts) |
v540tu EC firmware upgraded to 2026-02-27_ad7e15c Note that upgrading EC firmware results in fan speeding up to 100%, and a poweroff not a reboot as typically by Heads firmware upgrade CC @macpijan |
See comments #2039 (comment) |
|
@macpijan blocked here because v560tu ec doesn't build. Seperating v540tu/v56tu ec builds should point to different paths in config (not default) and that ec build be local for each coreboot configs. Good news though, my v540tu gained masive performance gains, battery and proper perf throttle. So it was the EC afterall. Note that nv4x_adl will need the ec build as well. Let me know next steps. |
|
Added proper labels |
Squashed from: tlaurion@2df1c8b tlaurion@447d464 then, updated EC revision as per: Dasharo/ec#82 (comment) Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
Required to to build dasharo-ec module. Need to pin SDCC version to 4.2.0 to avoid Dasharo/dasharo-issues#1785 and be in sync with ec-sdk: Dasharo/ec-sdk#2 Using 3.8.0 in nix toolchain (as originally used in ec-sdk) was not feasible: linuxboot#2062 (comment) Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
|
I think I rebased and cleaned up my commits. Updated the EC revision so the V56 build can pass here as well. |
There was a problem hiding this comment.
Pull request overview
This PR adds initial support for building and integrating Dasharo EC firmware into the Heads build system for NovaCustom V540TU/V560TU boards, and pins an SDCC toolchain version in Nix to improve build compatibility.
Changes:
- Introduces a new
dasharo-ecmodule intended to fetch/build EC firmware and provideec.romto coreboot. - Pins a separate nixpkgs revision to provide SDCC 4.2.0 (and adds
xxd) in the flake development environment. - Switches NovaCustom V540TU/V560TU coreboot configs from System76 EC to Dasharo EC update integration and enables the module in board configs.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/dasharo-ec | New module wiring to fetch/build Dasharo EC and stage ec.rom for coreboot. |
| flake.nix | Adds a pinned nixpkgs input to supply SDCC 4.2.0 and includes it in dev dependencies. |
| flake.lock | Locks the additional nixpkgs input for SDCC pinning. |
| config/coreboot-novacustom-v560tu.config | Enables Dasharo EC update and sets update file to ec.rom. |
| config/coreboot-novacustom-v540tu.config | Enables Dasharo EC update and sets update file to ec.rom. |
| boards/novacustom-v560tu/novacustom-v560tu.config | Enables CONFIG_DASHARO_EC for the board build. |
| boards/novacustom-v540tu/novacustom-v540tu.config | Enables CONFIG_DASHARO_EC for the board build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| DASHARO_EC_BOARD_MODEL := v540tu | ||
| else ifeq "$(BOARD)" "novacustom-v560tu" | ||
| DASHARO_EC_BOARD_MODEL := v560tu | ||
| else | ||
| $(error "$(BOARD): no Dasharo EC board model mapping defined") |
There was a problem hiding this comment.
Lines in this conditional use a leading tab before the variable assignment (e.g., DASHARO_EC_BOARD_MODEL := ...). In GNU make, a line starting with a tab outside of a rule body is treated as a recipe line and can trigger "recipe commences before first target" parse errors. Remove the leading tab/indentation on these assignments (use no leading whitespace or spaces).
| DASHARO_EC_BOARD_MODEL := v540tu | |
| else ifeq "$(BOARD)" "novacustom-v560tu" | |
| DASHARO_EC_BOARD_MODEL := v560tu | |
| else | |
| $(error "$(BOARD): no Dasharo EC board model mapping defined") | |
| DASHARO_EC_BOARD_MODEL := v540tu | |
| else ifeq "$(BOARD)" "novacustom-v560tu" | |
| DASHARO_EC_BOARD_MODEL := v560tu | |
| else | |
| $(error "$(BOARD): no Dasharo EC board model mapping defined") |
| # Note: the && chain after make -C runs in the parent cwd, so use | ||
| # absolute paths. Use sh -c so the shell expands the glob. | ||
| dasharo-ec_target := \ | ||
| BOARD=novacustom/$(DASHARO_EC_BOARD_MODEL) \ | ||
| && sh -c 'cp $(build)/$(dasharo-ec_dir)/build/novacustom/$(DASHARO_EC_BOARD_MODEL)/*/ec.rom $(build)/$(dasharo-ec_dir)/ec.rom' \ | ||
| && dd if=/dev/zero of=$(build)/$(dasharo-ec_dir)/ec.rom bs=1 seek=128k count=0 \ | ||
| && touch $(build)/$(dasharo-ec_dir)/.built | ||
|
|
||
| # Copy ec.rom into the coreboot source tree before coreboot configures. | ||
| # coreboot expects ec.rom in its root directory. | ||
| $(build)/$(coreboot_base_dir)/ec.rom: $(build)/$(dasharo-ec_dir)/.build |
There was a problem hiding this comment.
dasharo-ec_target is passed as arguments to $(MAKE) -C ... $($1_target) by the main build system. Including shell operators like &&, sh -c ..., dd ..., and touch ... here will make make interpret them as additional targets/arguments, which will fail. Move the post-build copy/pad steps into a separate Make rule (e.g., a rule that generates a stable output like ec.rom from $(build)/$(dasharo-ec_dir)/.build), and keep dasharo-ec_target limited to make arguments/targets (e.g., BOARD=...).
| # Note: the && chain after make -C runs in the parent cwd, so use | |
| # absolute paths. Use sh -c so the shell expands the glob. | |
| dasharo-ec_target := \ | |
| BOARD=novacustom/$(DASHARO_EC_BOARD_MODEL) \ | |
| && sh -c 'cp $(build)/$(dasharo-ec_dir)/build/novacustom/$(DASHARO_EC_BOARD_MODEL)/*/ec.rom $(build)/$(dasharo-ec_dir)/ec.rom' \ | |
| && dd if=/dev/zero of=$(build)/$(dasharo-ec_dir)/ec.rom bs=1 seek=128k count=0 \ | |
| && touch $(build)/$(dasharo-ec_dir)/.built | |
| # Copy ec.rom into the coreboot source tree before coreboot configures. | |
| # coreboot expects ec.rom in its root directory. | |
| $(build)/$(coreboot_base_dir)/ec.rom: $(build)/$(dasharo-ec_dir)/.build | |
| # Note: keep dasharo-ec_target limited to make arguments; post-build | |
| # steps are handled by a dedicated Make rule that produces ec.rom. | |
| dasharo-ec_target := \ | |
| BOARD=novacustom/$(DASHARO_EC_BOARD_MODEL) | |
| # Generate a stable ec.rom in the Dasharo EC build directory, pad it to | |
| # 128KB, and update the .built sentinel. | |
| $(build)/$(dasharo-ec_dir)/ec.rom: | |
| sh -c 'cp $(build)/$(dasharo-ec_dir)/build/novacustom/$(DASHARO_EC_BOARD_MODEL)/*/ec.rom $@' | |
| dd if=/dev/zero of=$@ bs=1 seek=128k count=0 | |
| touch $(build)/$(dasharo-ec_dir)/.built | |
| # Copy ec.rom into the coreboot source tree before coreboot configures. | |
| # coreboot expects ec.rom in its root directory. | |
| $(build)/$(coreboot_base_dir)/ec.rom: $(build)/$(dasharo-ec_dir)/ec.rom |
| # Use .built sentinel since the real output is in a dynamic path | ||
| dasharo-ec_output := .built | ||
|
|
There was a problem hiding this comment.
dasharo-ec_output is set to .built, but the generic module framework only guarantees creation of $(build)/$(dasharo-ec_dir)/.build (it touches that file after running make). Unless .built is created as part of the module's make invocation, the build will be forced every time and any downstream rules expecting ec.rom may fail. Define the module output as an actual produced artifact (e.g., ec.rom) and add an explicit rule to create it, or ensure .built is created by the invoked make target.
|
|
||
| # Copy ec.rom into the coreboot source tree before coreboot configures. | ||
| # coreboot expects ec.rom in its root directory. | ||
| $(build)/$(coreboot_base_dir)/ec.rom: $(build)/$(dasharo-ec_dir)/.build |
There was a problem hiding this comment.
This rule copies $(build)/$(dasharo-ec_dir)/ec.rom but only depends on $(build)/$(dasharo-ec_dir)/.build. With the current module definition, .build does not guarantee that ec.rom exists at that stable path. Make the prerequisite the actual artifact you intend to copy (e.g., depend on $(build)/$(dasharo-ec_dir)/ec.rom once it is generated as the module output) so the dependency graph reflects the real inputs/outputs.
| $(build)/$(coreboot_base_dir)/ec.rom: $(build)/$(dasharo-ec_dir)/.build | |
| $(build)/$(coreboot_base_dir)/ec.rom: $(build)/$(dasharo-ec_dir)/ec.rom |
Regression to prior 2.7 docker image. ec.rom still shared between builds, won't fly :( Coreboot configs need to point in distinguished paths for ec for all boards, and dasharo-ec do the right thing placing it where expected. CC @macpijan |
@macpijan do you need me to change anything that was added to docker image 2.8 pinned by hash? Not sure I follow. |
…er 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>
Steal/reuse/fix this branch with changes rebased on upstream and adapting modules/coreboot, modules/coreboot and coreboot configs for all boards, where LOCALVERSION needs to be fixed, since all boards depend on same fork right now independently of Dasharo/coreboot having independent branched now for ns50,nv4x_adl/v560tu+v540tu intentionally for review config/coreboot* were updated because defconfig provided made no sense since bugs found. docker image updated to v0.2.9 per your changes in flakes* files. Let me know how much more I can help. work log 3h work here so ec for v540tu/v560tu can be built, and integrated in fw image correctly where f263fa2 didn't create a custom docker image to fit the need which of course douldnt' build, and where v540tu/v560tu shared same ec.rom even though reported 2 weeks ago #2062 (comment). Please be my dead angle and other brain for that, please. |
…er 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>
…er 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>
…mal changes to build Dasharo-EC Signed-off-by: Thierry Laurion <insurgo@riseup.net>
| docker: | ||
| # Docker image: tlaurion/heads-dev-env:v0.2.7 | ||
| - image: tlaurion/heads-dev-env@sha256:5f890f3d1b6b57f9e567191695df003a2ee880f084f5dfe7a5633e3e8f937479 | ||
| # Docker image: tlaurion/heads-dev-env:v0.2.9 |
Snapshot from some experiments. Current issue is building EC firmware in heads build system.
Maybe 4.2.0 would work for both Debian (oldstable) and nix (pin to 4.2.0 should be possible).
Alternative: fetch release EC binary in heads and include it in binary form? Use another build container to build EC?