Hello Patrick Georgi, Martin Roth, Furquan Shaikh,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/49190
to review the following change.
Change subject: cbfstool: Use flock() when accessing CBFS files
......................................................................
cbfstool: Use flock() when accessing CBFS files
Trying to do multiple operations on the same CBFS image at the same time
likely leads to data corruption. For this reason, add BSD advisory file
locking (flock()) to cbfstool (and ifittool which is using the same file
I/O library), so that only one process will operate on the same file at
the same time and the others will wait in line. This should help resolve
parallel build issues with the INTERMEDIATE target on certain platforms.
Unfortunately, some platforms use the INTERMEDIATE target to do a direct
dd into the CBFS image. This should generally be discouraged and future
platforms should aim to clearly deliminate regions that need to be
written directly by platform scripts with custom FMAP sections, so that
they can be written with `cbfstool write`. For the time being, update
the legacy platforms that do this with explicit calls to the `flock`
utility.
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Change-Id: I022468f6957415ae68a7a7e70428ae6f82d23b06
---
M src/ec/hp/kbc1126/Makefile.inc
M src/soc/amd/stoneyridge/Makefile.inc
M src/southbridge/amd/pi/hudson/Makefile.inc
M src/southbridge/intel/common/firmware/Makefile.inc
M util/cbfstool/partitioned_file.c
5 files changed, 8 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/49190/1
diff --git a/src/ec/hp/kbc1126/Makefile.inc b/src/ec/hp/kbc1126/Makefile.inc
index 43e5d3f..d767bad 100644
--- a/src/ec/hp/kbc1126/Makefile.inc
+++ b/src/ec/hp/kbc1126/Makefile.inc
@@ -22,7 +22,7 @@
printf " Building kbc1126_ec_insert.\n"
$(MAKE) -C util/kbc1126
printf " KBC1126 Inserting KBC1126 firmware blobs.\n"
- $(KBC1126_EC_INSERT) $(obj)/coreboot.pre \
+ flock $< $(KBC1126_EC_INSERT) $(obj)/coreboot.pre \
$(CONFIG_KBC1126_FW1_OFFSET) $(CONFIG_KBC1126_FW2_OFFSET)
endif
diff --git a/src/soc/amd/stoneyridge/Makefile.inc b/src/soc/amd/stoneyridge/Makefile.inc
index 969f512..2ad0730 100644
--- a/src/soc/amd/stoneyridge/Makefile.inc
+++ b/src/soc/amd/stoneyridge/Makefile.inc
@@ -172,7 +172,7 @@
add_amdfw: $(obj)/coreboot.pre $(obj)/amdfw.rom
printf " DD Adding AMD Firmware at ROM offset 0x%x\n" \
"$(STONEYRIDGE_FWM_ROM_POSITION)"
- dd if=$(obj)/amdfw.rom \
+ flock $< dd if=$(obj)/amdfw.rom \
of=$(obj)/coreboot.pre conv=notrunc bs=1 \
seek=$(STONEYRIDGE_FWM_ROM_POSITION) >/dev/null 2>&1
diff --git a/src/southbridge/amd/pi/hudson/Makefile.inc b/src/southbridge/amd/pi/hudson/Makefile.inc
index 215a5a1..5eac024 100644
--- a/src/southbridge/amd/pi/hudson/Makefile.inc
+++ b/src/southbridge/amd/pi/hudson/Makefile.inc
@@ -162,7 +162,7 @@
add_amdfw: $(obj)/coreboot.pre $(obj)/amdfw.rom
printf " DD Adding AMD Firmware\n"
- dd if=$(obj)/amdfw.rom \
+ flock $< dd if=$(obj)/amdfw.rom \
of=$(obj)/coreboot.pre conv=notrunc bs=1 seek=131072 >/dev/null 2>&1
else # ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y)
diff --git a/src/southbridge/intel/common/firmware/Makefile.inc b/src/southbridge/intel/common/firmware/Makefile.inc
index 516cd4d..588c663 100644
--- a/src/southbridge/intel/common/firmware/Makefile.inc
+++ b/src/southbridge/intel/common/firmware/Makefile.inc
@@ -35,7 +35,7 @@
endif
add_intel_firmware: $(obj)/coreboot.pre $(IFDTOOL)
printf " DD Adding Intel Firmware Descriptor\n"
- dd if=$(IFD_BIN_PATH) \
+ flock $< dd if=$(IFD_BIN_PATH) \
of=$(obj)/coreboot.pre conv=notrunc >/dev/null 2>&1
ifeq ($(CONFIG_VALIDATE_INTEL_DESCRIPTOR),y)
$(objutil)/ifdtool/ifdtool \
diff --git a/util/cbfstool/partitioned_file.c b/util/cbfstool/partitioned_file.c
index b6d4f1b..6e75600 100644
--- a/util/cbfstool/partitioned_file.c
+++ b/util/cbfstool/partitioned_file.c
@@ -8,6 +8,7 @@
#include <assert.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/file.h>
struct partitioned_file {
struct fmap *fmap;
@@ -57,7 +58,7 @@
access_mode = write_access ? "rb+" : "rb";
file->stream = fopen(filename, access_mode);
- if (!file->stream) {
+ if (!file->stream || flock(fileno(file->stream), LOCK_EX)) {
perror(filename);
partitioned_file_close(file);
return NULL;
@@ -78,7 +79,7 @@
}
file->stream = fopen(filename, "wb");
- if (!file->stream) {
+ if (!file->stream || flock(fileno(file->stream), LOCK_EX)) {
perror(filename);
free(file);
return NULL;
@@ -268,6 +269,7 @@
file->fmap = NULL;
buffer_delete(&file->buffer);
if (file->stream) {
+ flock(fileno(file->stream), LOCK_UN);
fclose(file->stream);
file->stream = NULL;
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/49190
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I022468f6957415ae68a7a7e70428ae6f82d23b06
Gerrit-Change-Number: 49190
Gerrit-PatchSet: 1
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
Attention is currently required from: Felix Friedlander, Martin Roth, Stefan Reinauer.
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/49233 )
Change subject: payloads/external/tianocore/Kconfig: elaborate help for TIANOCORE_BOOTSPLASH_FILE
......................................................................
Patch Set 1:
(3 comments)
Commit Message:
https://review.coreboot.org/c/coreboot/+/49233/comment/1764cafe_0aecb8b4
PS1, Line 7: payloads/external/tianocore/Kconfig: elaborate help for TIANOCORE_BOOTSPLASH_FILE
The prefix does not need to be the path (often it can be used though). Some suggestions:
1. payloads/tianocore/Kconfig: Extend help for bootsplash file
2. tianocore: Extend Kconfig help for bootsplash file
3. payloads/tianocore/Kconfig: Add detail on how bootsplash is used in OS
File payloads/external/tianocore/Kconfig:
https://review.coreboot.org/c/coreboot/+/49233/comment/ae76ac5a_3111c1bd
PS1, Line 100: and will be displayed slightly above the centre of
: the screen,
I do not understand this. Do you mean, a log should be placed above the centre of the screen so the OS spinner and text does not overlay with it?
https://review.coreboot.org/c/coreboot/+/49233/comment/9f607acd_d1914788
PS1, Line 102: than your display.
If you have it handy, it’d be great if you put the URL to the specification here too.
--
To view, visit https://review.coreboot.org/c/coreboot/+/49233
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib4c6666bb0e49369fe8fe2ae3dc12c023f668da0
Gerrit-Change-Number: 49233
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Friedlander <felix(a)ffetc.net>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Felix Friedlander <felix(a)ffetc.net>
Gerrit-Attention: Martin Roth <martinroth(a)google.com>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Comment-Date: Fri, 08 Jan 2021 08:02:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Karthik Ramasubramanian has submitted this change. ( https://review.coreboot.org/c/coreboot/+/49134 )
Change subject: mb/google/dedede: Enable "FastPkgCRampDisable" upd for noise mitigation
......................................................................
mb/google/dedede: Enable "FastPkgCRampDisable" upd for noise mitigation
As part of acoustic noise mitigation calibration, we need to enable
FastPkgCRampDisable upd along with slew rate = 1. This values has been
derived based on noise calibration done.
Please refer document 575216 for procedure.
BUG=None
BRANCH=dedede
TEST=correct value has been programmed and slew rate measurement
is correct on scope.
Change-Id: Ie42c8ab647ff42fa043b6f717a9834f9b9c551f6
Signed-off-by: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/49134
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Furquan Shaikh <furquan(a)google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub(a)google.com>
Reviewed-by: Evan Green <evgreen(a)chromium.org>
---
M src/mainboard/google/dedede/variants/drawcia/overridetree.cb
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
build bot (Jenkins): Verified
Furquan Shaikh: Looks good to me, approved
Evan Green: Looks good to me, approved
Karthik Ramasubramanian: Looks good to me, approved
diff --git a/src/mainboard/google/dedede/variants/drawcia/overridetree.cb b/src/mainboard/google/dedede/variants/drawcia/overridetree.cb
index e09dbe8..5959343 100644
--- a/src/mainboard/google/dedede/variants/drawcia/overridetree.cb
+++ b/src/mainboard/google/dedede/variants/drawcia/overridetree.cb
@@ -67,7 +67,8 @@
# Enable Acoustic noise mitigation and set slew rate to 1/4
# Rest of the parameters are 0 by default.
register "AcousticNoiseMitigation" = "1"
- register "SlowSlewRate" = "1"
+ register "SlowSlewRate" = "SlewRateFastBy4"
+ register "FastPkgCRampDisable" = "1"
device domain 0 on
device pci 05.0 on # IPU - MIPI Camera
--
To view, visit https://review.coreboot.org/c/coreboot/+/49134
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie42c8ab647ff42fa043b6f717a9834f9b9c551f6
Gerrit-Change-Number: 49134
Gerrit-PatchSet: 8
Gerrit-Owner: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-Reviewer: Divagar Mohandass <divagar.mohandass(a)intel.com>
Gerrit-Reviewer: Evan Green <evgreen(a)chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Ronak Kanabar <ronak.kanabar(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-CC: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: merged
Attention is currently required from: Maulik V Vaghela.
Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/49134 )
Change subject: mb/google/dedede: Enable "FastPkgCRampDisable" upd for noise mitigation
......................................................................
Patch Set 7:
(1 comment)
Commit Message:
https://review.coreboot.org/c/coreboot/+/49134/comment/2d2fe991_7ffb6809
PS5, Line 17: correct value has been programmed and slew rate measurement
: is correct on scope.
> I am waiting for ODM to confirm if this fixes the issue on their side as well. […]
Ack. ODM informed that it may take a while for the acoustic lab to test the noise. The waveform is as expected. So will submit the CL.
--
To view, visit https://review.coreboot.org/c/coreboot/+/49134
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie42c8ab647ff42fa043b6f717a9834f9b9c551f6
Gerrit-Change-Number: 49134
Gerrit-PatchSet: 7
Gerrit-Owner: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-Reviewer: Divagar Mohandass <divagar.mohandass(a)intel.com>
Gerrit-Reviewer: Evan Green <evgreen(a)chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Ronak Kanabar <ronak.kanabar(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-CC: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Attention: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-Comment-Date: Fri, 08 Jan 2021 07:41:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Furquan Shaikh <furquan(a)google.com>
Comment-In-Reply-To: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-MessageType: comment
Maulik V Vaghela has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/49187 )
Change subject: soc/intel/jasperlake: Update acoustic noise related parameters
......................................................................
soc/intel/jasperlake: Update acoustic noise related parameters
We need to fill Acoustic noise mitigation related UPDs only in
case when acoustic noise mitigation is enabled. This will also
clarify the user that they need to enable Acoustic noise
mitigation while using this config in mainboard.
BUG=None
BRANCH=dedede
TEST=Check that UPD values are getting filled correctly.
Change-Id: I0cf4ccfced13b0d32b3d20713eace63e66945332
Signed-off-by: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
---
M src/soc/intel/jasperlake/fsp_params.c
1 file changed, 9 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/87/49187/1
diff --git a/src/soc/intel/jasperlake/fsp_params.c b/src/soc/intel/jasperlake/fsp_params.c
index c03e9dd..0ccc461 100644
--- a/src/soc/intel/jasperlake/fsp_params.c
+++ b/src/soc/intel/jasperlake/fsp_params.c
@@ -237,12 +237,16 @@
config->PchPmPwrCycDur);
/* Fill Acoustic noise mitigation related configuration */
- params->FastPkgCRampDisable[0] = config->FastPkgCRampDisable;
- params->SlowSlewRate[0] = config->SlowSlewRate;
+
params->AcousticNoiseMitigation = config->AcousticNoiseMitigation;
- params->PreWake = config->PreWake;
- params->RampUp = config->RampUp;
- params->RampDown = config->RampDown;
+
+ if (params->AcousticNoiseMitigation) {
+ params->FastPkgCRampDisable[0] = config->FastPkgCRampDisable;
+ params->SlowSlewRate[0] = config->SlowSlewRate;
+ params->PreWake = config->PreWake;
+ params->RampUp = config->RampUp;
+ params->RampDown = config->RampDown;
+ }
/* Override/Fill FSP Silicon Param for mainboard */
mainboard_silicon_init_params(params);
--
To view, visit https://review.coreboot.org/c/coreboot/+/49187
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I0cf4ccfced13b0d32b3d20713eace63e66945332
Gerrit-Change-Number: 49187
Gerrit-PatchSet: 1
Gerrit-Owner: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
Attention is currently required from: Henry Sun, Karthik Ramasubramanian.
Stanley Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/49220 )
Change subject: drivers/i2c/sx9324: Add more register
......................................................................
Patch Set 3:
(1 comment)
Commit Message:
https://review.coreboot.org/c/coreboot/+/49220/comment/d9c65eea_59a5b782
PS1, Line 9: Export registers that driver is looking for.
> Can you please mention what registers are being added and what is the purpose of those registers.
Done
--
To view, visit https://review.coreboot.org/c/coreboot/+/49220
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3cee84a5658fecf55d2d8b8621879588ffe0158d
Gerrit-Change-Number: 49220
Gerrit-PatchSet: 3
Gerrit-Owner: Stanley Wu <stanley1.wu(a)lcfc.corp-partner.google.com>
Gerrit-Reviewer: Henry Sun <henrysun(a)google.com>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Allen Cheng <allen.cheng(a)lcfc.corp-partner.google.com>
Gerrit-CC: Jerry2 Huang <jerry2.huang(a)lcfc.corp-partner.google.com>
Gerrit-CC: Kevin Chang <kevin.chang(a)lcfc.corp-partner.google.com>
Gerrit-CC: Rasheed Hsueh <rasheed.hsueh(a)lcfc.corp-partner.google.com>
Gerrit-CC: Sunshine Chao <sunshine.chao(a)lcfc.corp-partner.google.com>
Gerrit-Attention: Henry Sun <henrysun(a)google.com>
Gerrit-Attention: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Comment-Date: Fri, 08 Jan 2021 07:25:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-MessageType: comment