-
-
Notifications
You must be signed in to change notification settings - Fork 206
Ec build #2062
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
base: master
Are you sure you want to change the base?
Ec build #2062
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,50 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ifeq "$(CONFIG_DASHARO_EC)" "y" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| modules-y += dasharo-ec | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dasharo-ec_repo := https://github.com/Dasharo/ec | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dasharo-ec_commit_hash := d198b641195e60e13afc17be9464e4f402d1c2fa | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Map BOARD to the EC board model | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ifeq "$(BOARD)" "novacustom-v540tu" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+10
to
+14
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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") |
Copilot
AI
Mar 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Copilot
AI
Mar 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot
AI
Mar 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this coreboot config switched to support EC SYNC feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkopec this is the only new config we need to switch here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that is enough. If the path option is not specified, the code will look for ec.rom in the root of the coreboot directory.