Nick Vaccaro has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add SPD_PART_NUMBER_IN_CBI Kconfig option ......................................................................
vendorcode/google: add SPD_PART_NUMBER_IN_CBI Kconfig option
Add SPD_PART_NUMBER_IN_CBI Kconfig option to declare whether the SPD Module Part Number (memory part name) is stored in the CBI.
BUG=b:168724473 TEST="emerge-volteer coreboot chromeos-bootimage", flash and boot volteer to kernel and verify that the BIOS log shows a part name when logging SPD information:
SPD: module part number is K4U6E3S4AA-MGCL
I also built coreboot for hatch and dedede and verified that the build succeeds without error.
Change-Id: I0d393efd0fc731daa70d3990e5b69865be99b78b Signed-off-by: Nick Vaccaro nvaccaro@google.com --- M src/mainboard/google/dedede/Kconfig M src/mainboard/google/hatch/Kconfig M src/mainboard/google/volteer/Kconfig M src/vendorcode/google/chromeos/Kconfig 4 files changed, 10 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/45635/1
diff --git a/src/mainboard/google/dedede/Kconfig b/src/mainboard/google/dedede/Kconfig index 79c2995..bc01ab9 100644 --- a/src/mainboard/google/dedede/Kconfig +++ b/src/mainboard/google/dedede/Kconfig @@ -37,6 +37,7 @@ bool default y select CHROMEOS_CSE_BOARD_RESET_OVERRIDE + select CHROMEOS_DRAM_PART_NUMBER_IN_CBI select EC_GOOGLE_CHROMEEC_SWITCHES select GBB_FLAG_FORCE_DEV_SWITCH_ON select GBB_FLAG_FORCE_DEV_BOOT_USB diff --git a/src/mainboard/google/hatch/Kconfig b/src/mainboard/google/hatch/Kconfig index ca310ed..44259a4 100644 --- a/src/mainboard/google/hatch/Kconfig +++ b/src/mainboard/google/hatch/Kconfig @@ -47,6 +47,7 @@ config CHROMEOS bool default y + select CHROMEOS_DRAM_PART_NUMBER_IN_CBI if !ROMSTAGE_SPD_SMBUS select EC_GOOGLE_CHROMEEC_SWITCHES select GBB_FLAG_FORCE_DEV_SWITCH_ON select GBB_FLAG_FORCE_DEV_BOOT_USB diff --git a/src/mainboard/google/volteer/Kconfig b/src/mainboard/google/volteer/Kconfig index d2880bf..34d34d0 100644 --- a/src/mainboard/google/volteer/Kconfig +++ b/src/mainboard/google/volteer/Kconfig @@ -35,6 +35,7 @@ bool default y select CHROMEOS_CSE_BOARD_RESET_OVERRIDE if SOC_INTEL_CSE_LITE_SKU + select CHROMEOS_DRAM_PART_NUMBER_IN_CBI select EC_GOOGLE_CHROMEEC_SWITCHES select GBB_FLAG_FORCE_DEV_SWITCH_ON select GBB_FLAG_FORCE_DEV_BOOT_USB diff --git a/src/vendorcode/google/chromeos/Kconfig b/src/vendorcode/google/chromeos/Kconfig index 0528d00..3b335a4 100644 --- a/src/vendorcode/google/chromeos/Kconfig +++ b/src/vendorcode/google/chromeos/Kconfig @@ -103,5 +103,12 @@ does not understand the new cr50 strap config (applicable only to boards using strap config 0xe). Enabling this config will help to override the default global reset.
+config CHROMEOS_DRAM_PART_NUMBER_IN_CBI + def_bool y + depends on EC_GOOGLE_CHROMEEC + help + Some boards declare the DRAM part number in the CBI instead of the SPD. This option + allows those boards to declare that their DRAM part number is stored in the CBI. + endif # CHROMEOS endmenu
Nick Vaccaro has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add SPD_PART_NUMBER_IN_CBI Kconfig option ......................................................................
Patch Set 6:
This is now ready for review.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add SPD_PART_NUMBER_IN_CBI Kconfig option ......................................................................
Patch Set 6:
Thanks for splitting the changes into multiple CLs Nick. I think the organization needs to be slightly different.
CL1: Add weak definition of mainboard_get_dram_part_num (Already done) CL2: Make changes in vendorcode/google/chromeos to provide mainboard_get_dram_part_num() definition using a newly added Kconfig CL3: Change mainboards to select the new Kconfig and drop their implementation of mainboard_get_dram_part_num() CL4: Update spd_bin.c to use mainboard_get_dram_part_num() if implemented
Nick Vaccaro has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add SPD_PART_NUMBER_IN_CBI Kconfig option ......................................................................
Patch Set 9:
Patch Set 6:
Thanks for splitting the changes into multiple CLs Nick. I think the organization needs to be slightly different.
CL1: Add weak definition of mainboard_get_dram_part_num (Already done) CL2: Make changes in vendorcode/google/chromeos to provide mainboard_get_dram_part_num() definition using a newly added Kconfig CL3: Change mainboards to select the new Kconfig and drop their implementation of mainboard_get_dram_part_num() CL4: Update spd_bin.c to use mainboard_get_dram_part_num() if implemented
I'll work on that next.
Nick Vaccaro has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add SPD_PART_NUMBER_IN_CBI Kconfig option ......................................................................
Patch Set 16:
Patch Set 6:
Thanks for splitting the changes into multiple CLs Nick. I think the organization needs to be slightly different.
CL1: Add weak definition of mainboard_get_dram_part_num (Already done) CL2: Make changes in vendorcode/google/chromeos to provide mainboard_get_dram_part_num() definition using a newly added Kconfig CL3: Change mainboards to select the new Kconfig and drop their implementation of mainboard_get_dram_part_num() CL4: Update spd_bin.c to use mainboard_get_dram_part_num() if implement
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45635
to look at the new patch set (#17).
Change subject: vendorcode/google: add SPD_PART_NUMBER_IN_CBI Kconfig option ......................................................................
vendorcode/google: add SPD_PART_NUMBER_IN_CBI Kconfig option
Add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option to declare whether the SPD Module Part Number (memory part name) is stored in the CBI.
Move mainboard_get_dram_part_num() into src/vendor/google/chromeos to allow mainboards to use it without having to duplicate that code by enabling the CHROMEOS_DRAM_PART_NUMBER_IN_CBI config option.
BUG=b:168724473 TEST="emerge-volteer coreboot chromeos-bootimage" and verify it builds.
Change-Id: I0d393efd0fc731daa70d3990e5b69865be99b78b Signed-off-by: Nick Vaccaro nvaccaro@google.com --- M src/vendorcode/google/chromeos/Kconfig 1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/45635/17
Nick Vaccaro has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add SPD_PART_NUMBER_IN_CBI Kconfig option ......................................................................
Patch Set 17:
There's not much to this CL anymore. I included the mainboard_get_dram_part_num() as part of this CL, but that was going to snowball into changing all of the prototypes and calling code, so it didn't seem to make sense here. Instead, I added it with the "consolidate strong..." CL.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add SPD_PART_NUMBER_IN_CBI Kconfig option ......................................................................
Patch Set 17:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45635/17/src/vendorcode/google/chro... File src/vendorcode/google/chromeos/Kconfig:
https://review.coreboot.org/c/coreboot/+/45635/17/src/vendorcode/google/chro... PS17, Line 107: y This should not be set to 'y' by default. We should let the mainboard select it only if required.
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45635
to look at the new patch set (#18).
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option
Add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option to declare whether the SPD Module Part Number (memory part name) is stored in the CBI.
Move mainboard_get_dram_part_num() into src/vendor/google/chromeos to allow mainboards to use it without having to duplicate that code by enabling the CHROMEOS_DRAM_PART_NUMBER_IN_CBI config option.
For now, CHROMEOS_DRAM_PART_NUMBER_IN_CBI defaults to "n", but will change to defaulting to "y" in a subsequent CL that fixes the multiple instances of mainboard_get_dram_part_num() issue that is exposed when CHROMEOS_DRAM_PART_NUMBER_IN_CBI option is enabled.
BUG=b:169789558, b:168724473 TEST="emerge-volteer coreboot && emerge-hatch coreboot && emerge-dedede coreboot emerge-nocturne coreboot" and verify it builds.
Change-Id: I0d393efd0fc731daa70d3990e5b69865be99b78b Signed-off-by: Nick Vaccaro nvaccaro@google.com --- M src/vendorcode/google/chromeos/Kconfig M src/vendorcode/google/chromeos/Makefile.inc A src/vendorcode/google/chromeos/dram_part_num_override.c 3 files changed, 26 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/45635/18
Nick Vaccaro has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
Patch Set 18:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45635/17/src/vendorcode/google/chro... File src/vendorcode/google/chromeos/Kconfig:
https://review.coreboot.org/c/coreboot/+/45635/17/src/vendorcode/google/chro... PS17, Line 107: y
This should not be set to 'y' by default. We should let the mainboard select it only if required.
Isn't storing DRAM part number in the CBI a POR for chromeos devices? If so, why would we not want to default to y, and just let any chromebooks that go against the norm of storing dram part number in CBI to override the behavior by setting it to "n" in their Kconfig?
I set it to "n" currently to avoid compile issues that require changes that don't really belong in this CL, but as I stated in the checkin comment, my intent is to change it to "y" in a subsequent (next) CL that uses this new Kconfig option to use the common version of mainboard_get_dram_part_num. Is this not the right approach / is storing part num in CBI not standard practice for chromebooks going forward?
Nick Vaccaro has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
Patch Set 18:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45635/17/src/vendorcode/google/chro... File src/vendorcode/google/chromeos/Kconfig:
https://review.coreboot.org/c/coreboot/+/45635/17/src/vendorcode/google/chro... PS17, Line 107: y
Isn't storing DRAM part number in the CBI a POR for chromeos devices? If so, why would we not want […]
I can see how opting in might be better/safer than opting out, even if storing name in CBI is standard practice for current devices.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
Patch Set 18:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45635/17/src/vendorcode/google/chro... File src/vendorcode/google/chromeos/Kconfig:
https://review.coreboot.org/c/coreboot/+/45635/17/src/vendorcode/google/chro... PS17, Line 107: y
If so, why would we not want to default to y, and just let any chromebooks that go against the norm of storing dram part number in CBI to override the behavior by setting it to "n" in their Kconfig?
Couple of reasons: 1. We support both MD(memory down) and SODIMM configurations. In the latter case, we don't really store DRAM part number in CBI. You can add "default y if HAVE_SPD_IN_CBFS" to ensure that this gets enabled for only those mainboards that have SPD in CBFS. But, we still have older boards which probably did not have DRAM part number in CBI.
2. If the mainboard really needs to provide its own implementation of this function for some reason. Example: CBI DRAM part number supported only after a certain build, etc. It provides flexibility to those boards.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
Patch Set 18:
(3 comments)
https://review.coreboot.org/c/coreboot/+/45635/18//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/45635/18//COMMIT_MSG@16 PS18, Line 16: but will : change to defaulting to "y" This is not really correct as mentioned on earlier patchset.
https://review.coreboot.org/c/coreboot/+/45635/18/src/vendorcode/google/chro... File src/vendorcode/google/chromeos/dram_part_num_override.c:
https://review.coreboot.org/c/coreboot/+/45635/18/src/vendorcode/google/chro... PS18, Line 10: I think we should have a check to ensure that we don't make a call to EC every time mainboard_get_dram_part_num() is called. Maybe add a flag that indicates that we already have the part number read and return early?
https://review.coreboot.org/c/coreboot/+/45635/18/src/vendorcode/google/chro... PS18, Line 12: sizeof(part_num_store)) < 0) { nit: this probably fits on the previous line?
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45635
to look at the new patch set (#19).
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option
Add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option to declare whether the SPD Module Part Number (memory part name) is stored in the CBI.
Move mainboard_get_dram_part_num() into src/vendor/google/chromeos to allow mainboards to use it without having to duplicate that code by enabling the CHROMEOS_DRAM_PART_NUMBER_IN_CBI config option.
BUG=b:169789558, b:168724473 TEST="emerge-volteer coreboot && emerge-hatch coreboot && emerge-dedede coreboot emerge-nocturne coreboot" and verify it builds.
Change-Id: I0d393efd0fc731daa70d3990e5b69865be99b78b Signed-off-by: Nick Vaccaro nvaccaro@google.com --- M src/vendorcode/google/chromeos/Kconfig M src/vendorcode/google/chromeos/Makefile.inc A src/vendorcode/google/chromeos/dram_part_num_override.c 3 files changed, 40 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/45635/19
Nick Vaccaro has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
Patch Set 19:
(4 comments)
https://review.coreboot.org/c/coreboot/+/45635/18//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/45635/18//COMMIT_MSG@16 PS18, Line 16: but will : change to defaulting to "y"
This is not really correct as mentioned on earlier patchset.
Done
https://review.coreboot.org/c/coreboot/+/45635/17/src/vendorcode/google/chro... File src/vendorcode/google/chromeos/Kconfig:
https://review.coreboot.org/c/coreboot/+/45635/17/src/vendorcode/google/chro... PS17, Line 107: y
If so, why would we not want to default to y, and just let any chromebooks that go against the nor […]
Thanks for the explanation, makes perfect sense.
https://review.coreboot.org/c/coreboot/+/45635/18/src/vendorcode/google/chro... File src/vendorcode/google/chromeos/dram_part_num_override.c:
https://review.coreboot.org/c/coreboot/+/45635/18/src/vendorcode/google/chro... PS18, Line 10:
I think we should have a check to ensure that we don't make a call to EC every time mainboard_get_dr […]
Done
https://review.coreboot.org/c/coreboot/+/45635/18/src/vendorcode/google/chro... PS18, Line 12: sizeof(part_num_store)) < 0) {
nit: this probably fits on the previous line?
Ack
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45635
to look at the new patch set (#20).
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option
Add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option to declare whether the SPD Module Part Number (memory part name) is stored in the CBI.
Move mainboard_get_dram_part_num() into src/vendor/google/chromeos to allow mainboards to use it without having to duplicate that code by enabling the CHROMEOS_DRAM_PART_NUMBER_IN_CBI config option.
BUG=b:169789558, b:168724473 TEST="emerge-volteer coreboot && emerge-hatch coreboot && emerge-dedede coreboot && emerge-nocturne coreboot" and verify it builds.
Change-Id: I0d393efd0fc731daa70d3990e5b69865be99b78b Signed-off-by: Nick Vaccaro nvaccaro@google.com --- M src/vendorcode/google/chromeos/Kconfig M src/vendorcode/google/chromeos/Makefile.inc A src/vendorcode/google/chromeos/dram_part_num_override.c 3 files changed, 40 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/45635/20
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45635
to look at the new patch set (#21).
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option
Add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option to declare whether the SPD Module Part Number (memory part name) is stored in the CBI.
Move mainboard_get_dram_part_num() into src/vendor/google/chromeos to allow mainboards to use it without having to duplicate that code by enabling the CHROMEOS_DRAM_PART_NUMBER_IN_CBI config option.
BUG=b:169789558, b:168724473 TEST="emerge-volteer coreboot && emerge-hatch coreboot && emerge-dedede coreboot && emerge-nocturne coreboot" and verify it builds.
Change-Id: I0d393efd0fc731daa70d3990e5b69865be99b78b Signed-off-by: Nick Vaccaro nvaccaro@google.com --- M src/vendorcode/google/chromeos/Kconfig M src/vendorcode/google/chromeos/Makefile.inc A src/vendorcode/google/chromeos/dram_part_num_override.c 3 files changed, 40 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/45635/21
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
Patch Set 21: Code-Review+1
(3 comments)
https://review.coreboot.org/c/coreboot/+/45635/21/src/vendorcode/google/chro... File src/vendorcode/google/chromeos/dram_part_num_override.c:
https://review.coreboot.org/c/coreboot/+/45635/21/src/vendorcode/google/chro... PS21, Line 11: UNINITIALIZED nit: I think the names can be a little more descriptive. You can probably use the same ones as done by hatch: https://review.coreboot.org/cgit/coreboot.git/tree/src/mainboard/google/hatc...
static enum { PART_NUM_NOT_READ, PART_NUM_AVAILABLE, PART_NUM_NOT_IN_CBI, } part_num_state = PART_NUM_NOT_READ;
https://review.coreboot.org/c/coreboot/+/45635/21/src/vendorcode/google/chro... PS21, Line 15: int Use the enum type?
static enum { ... } ec_checked;
https://review.coreboot.org/c/coreboot/+/45635/21/src/vendorcode/google/chro... PS21, Line 26: printk Is it intentional that this error will be printed every time mainboard_get_dram_part_num() is called? Probably okay to do it just the first time?
Nick Vaccaro has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
Patch Set 21:
(3 comments)
https://review.coreboot.org/c/coreboot/+/45635/21/src/vendorcode/google/chro... File src/vendorcode/google/chromeos/dram_part_num_override.c:
https://review.coreboot.org/c/coreboot/+/45635/21/src/vendorcode/google/chro... PS21, Line 11: UNINITIALIZED
nit: I think the names can be a little more descriptive. […]
Done
https://review.coreboot.org/c/coreboot/+/45635/21/src/vendorcode/google/chro... PS21, Line 15: int
Use the enum type? […]
Done
https://review.coreboot.org/c/coreboot/+/45635/21/src/vendorcode/google/chro... PS21, Line 26: printk
Is it intentional that this error will be printed every time mainboard_get_dram_part_num() is called […]
Yes, that was the initial behavior of routines that didn't have an ec checked status. I'll change it to only log once given you think that's sufficient.
Hello build bot (Jenkins), Furquan Shaikh, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45635
to look at the new patch set (#22).
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option
Add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option to declare whether the SPD Module Part Number (memory part name) is stored in the CBI.
Move mainboard_get_dram_part_num() into src/vendor/google/chromeos to allow mainboards to use it without having to duplicate that code by enabling the CHROMEOS_DRAM_PART_NUMBER_IN_CBI config option.
BUG=b:169789558, b:168724473 TEST="emerge-volteer coreboot && emerge-hatch coreboot && emerge-dedede coreboot && emerge-nocturne coreboot" and verify it builds.
Change-Id: I0d393efd0fc731daa70d3990e5b69865be99b78b Signed-off-by: Nick Vaccaro nvaccaro@google.com --- M src/vendorcode/google/chromeos/Kconfig M src/vendorcode/google/chromeos/Makefile.inc A src/vendorcode/google/chromeos/dram_part_num_override.c 3 files changed, 39 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/45635/22
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
Patch Set 22:
(2 comments)
https://review.coreboot.org/c/coreboot/+/45635/22/src/vendorcode/google/chro... File src/vendorcode/google/chromeos/dram_part_num_override.c:
https://review.coreboot.org/c/coreboot/+/45635/22/src/vendorcode/google/chro... PS22, Line 19: printk(BIOS_ERR, : "ERROR: Couldn't obtain DRAM part number from CBI\n"); : part_num_state = PART_NUM_NOT_IN_CBI; These need to be put inside braces. Also, since `if` block is using braces, you will need it for the `else` block as well (Coreboot coding guidelines).
https://review.coreboot.org/c/coreboot/+/45635/22/src/vendorcode/google/chro... PS22, Line 23: ; Extra semicolon.
Hello build bot (Jenkins), Furquan Shaikh, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45635
to look at the new patch set (#23).
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option
Add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option to declare whether the SPD Module Part Number (memory part name) is stored in the CBI.
Move mainboard_get_dram_part_num() into src/vendor/google/chromeos to allow mainboards to use it without having to duplicate that code by enabling the CHROMEOS_DRAM_PART_NUMBER_IN_CBI config option.
BUG=b:169789558, b:168724473 TEST="emerge-volteer coreboot && emerge-hatch coreboot && emerge-dedede coreboot && emerge-nocturne coreboot" and verify it builds.
Change-Id: I0d393efd0fc731daa70d3990e5b69865be99b78b Signed-off-by: Nick Vaccaro nvaccaro@google.com --- M src/vendorcode/google/chromeos/Kconfig M src/vendorcode/google/chromeos/Makefile.inc A src/vendorcode/google/chromeos/dram_part_num_override.c 3 files changed, 40 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/45635/23
Nick Vaccaro has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
Patch Set 23:
(2 comments)
https://review.coreboot.org/c/coreboot/+/45635/22/src/vendorcode/google/chro... File src/vendorcode/google/chromeos/dram_part_num_override.c:
https://review.coreboot.org/c/coreboot/+/45635/22/src/vendorcode/google/chro... PS22, Line 19: printk(BIOS_ERR, : "ERROR: Couldn't obtain DRAM part number from CBI\n"); : part_num_state = PART_NUM_NOT_IN_CBI;
These need to be put inside braces. […]
Sorry, this was an oversight. Looks like a rebase --continue resolution gone bad. I think I need to stop working once I get too tired and stop trying to push a little further as I'm missing details I shouldn't be missing (I should have checked/verified the CL uploads were as expected prior to calling it a night).
https://review.coreboot.org/c/coreboot/+/45635/22/src/vendorcode/google/chro... PS22, Line 23: ;
Extra semicolon.
Done
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
Patch Set 23: Code-Review+2
Nick Vaccaro has submitted this change. ( https://review.coreboot.org/c/coreboot/+/45635 )
Change subject: vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option ......................................................................
vendorcode/google: add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option
Add CHROMEOS_DRAM_PART_NUMBER_IN_CBI Kconfig option to declare whether the SPD Module Part Number (memory part name) is stored in the CBI.
Move mainboard_get_dram_part_num() into src/vendor/google/chromeos to allow mainboards to use it without having to duplicate that code by enabling the CHROMEOS_DRAM_PART_NUMBER_IN_CBI config option.
BUG=b:169789558, b:168724473 TEST="emerge-volteer coreboot && emerge-hatch coreboot && emerge-dedede coreboot && emerge-nocturne coreboot" and verify it builds.
Change-Id: I0d393efd0fc731daa70d3990e5b69865be99b78b Signed-off-by: Nick Vaccaro nvaccaro@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/45635 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Furquan Shaikh furquan@google.com --- M src/vendorcode/google/chromeos/Kconfig M src/vendorcode/google/chromeos/Makefile.inc A src/vendorcode/google/chromeos/dram_part_num_override.c 3 files changed, 40 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved
diff --git a/src/vendorcode/google/chromeos/Kconfig b/src/vendorcode/google/chromeos/Kconfig index 0528d00..9ed24a9 100644 --- a/src/vendorcode/google/chromeos/Kconfig +++ b/src/vendorcode/google/chromeos/Kconfig @@ -103,5 +103,12 @@ does not understand the new cr50 strap config (applicable only to boards using strap config 0xe). Enabling this config will help to override the default global reset.
+config CHROMEOS_DRAM_PART_NUMBER_IN_CBI + def_bool n + depends on EC_GOOGLE_CHROMEEC + help + Some boards declare the DRAM part number in the CBI instead of the SPD. This option + allows those boards to declare that their DRAM part number is stored in the CBI. + endif # CHROMEOS endmenu diff --git a/src/vendorcode/google/chromeos/Makefile.inc b/src/vendorcode/google/chromeos/Makefile.inc index e17236d..fb11e11 100644 --- a/src/vendorcode/google/chromeos/Makefile.inc +++ b/src/vendorcode/google/chromeos/Makefile.inc @@ -16,3 +16,5 @@ verstage-y += watchdog.c romstage-y += watchdog.c ramstage-y += watchdog.c + +romstage-$(CONFIG_CHROMEOS_DRAM_PART_NUMBER_IN_CBI) += dram_part_num_override.c diff --git a/src/vendorcode/google/chromeos/dram_part_num_override.c b/src/vendorcode/google/chromeos/dram_part_num_override.c new file mode 100644 index 0000000..d624e13 --- /dev/null +++ b/src/vendorcode/google/chromeos/dram_part_num_override.c @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <console/console.h> +#include <ec/google/chromeec/ec.h> +#include <memory_info.h> + +const char *mainboard_get_dram_part_num(void) +{ + static char part_num_store[DIMM_INFO_PART_NUMBER_SIZE]; + static enum { + PART_NUM_NOT_READ, + PART_NUM_AVAILABLE, + PART_NUM_NOT_IN_CBI, + } part_num_state = PART_NUM_NOT_READ; + + if (part_num_state == PART_NUM_NOT_READ) { + if (google_chromeec_cbi_get_dram_part_num(part_num_store, + sizeof(part_num_store)) < 0) { + printk(BIOS_ERR, + "ERROR: Couldn't obtain DRAM part number from CBI\n"); + part_num_state = PART_NUM_NOT_IN_CBI; + } else { + part_num_state = PART_NUM_AVAILABLE; + } + } + + if (part_num_state == PART_NUM_NOT_IN_CBI) + return NULL; + + return part_num_store; +}