Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/40820 )
Change subject: mb/google/hatch/romstage_spd_smbus.c: Fix missing DIMM issue ......................................................................
mb/google/hatch/romstage_spd_smbus.c: Fix missing DIMM issue
Since https://review.coreboot.org/c/coreboot/+/40558/13 got merged Puff will not be able to boot up and stop as below log:
``` ... SPD: banks 16, ranks 2, rows 16, columns 10, density 8192 Mb SPD: device width 8 bits, bus width 64 bits SPD: module size is 16384 MB (per channel) ASSERTION ERROR: file 'src/soc/intel/cannonlake/cnl_memcfg_init.c', line 47 ```
BUG=b:155220125 BRANCH=none TEST=none
Change-Id: I5f47c849344951d53fa8c67e779b7c46d632d124 Signed-off-by: Edward O'Callaghan quasisec@google.com --- M src/mainboard/google/hatch/romstage_spd_smbus.c 1 file changed, 15 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/40820/1
diff --git a/src/mainboard/google/hatch/romstage_spd_smbus.c b/src/mainboard/google/hatch/romstage_spd_smbus.c index 4aa37fa..bac5d58 100644 --- a/src/mainboard/google/hatch/romstage_spd_smbus.c +++ b/src/mainboard/google/hatch/romstage_spd_smbus.c @@ -18,15 +18,24 @@
/* Access memory info through SMBUS. */ get_spd_smbus(&blk); - memcfg.spd[0].read_type = READ_SPD_MEMPTR; - memcfg.spd[0].spd_spec.spd_data_ptr_info.spd_data_len = blk.len; - memcfg.spd[0].spd_spec.spd_data_ptr_info.spd_data_ptr = (uintptr_t)blk.spd_array[0]; + + if (blk.spd_array[0] == NULL) { + memcfg.spd[0].read_type = NOT_EXISTING; + } else { + memcfg.spd[0].read_type = READ_SPD_MEMPTR; + memcfg.spd[0].spd_spec.spd_data_ptr_info.spd_data_len = blk.len; + memcfg.spd[0].spd_spec.spd_data_ptr_info.spd_data_ptr = (uintptr_t)blk.spd_array[0]; + }
memcfg.spd[1].read_type = NOT_EXISTING;
- memcfg.spd[2].read_type = READ_SPD_MEMPTR; - memcfg.spd[2].spd_spec.spd_data_ptr_info.spd_data_len = blk.len; - memcfg.spd[2].spd_spec.spd_data_ptr_info.spd_data_ptr = (uintptr_t)blk.spd_array[1]; + if (blk.spd_array[1] == NULL) { + memcfg.spd[2].read_type = NOT_EXISTING; + } else { + memcfg.spd[2].read_type = READ_SPD_MEMPTR; + memcfg.spd[2].spd_spec.spd_data_ptr_info.spd_data_len = blk.len; + memcfg.spd[2].spd_spec.spd_data_ptr_info.spd_data_ptr = (uintptr_t)blk.spd_array[1]; + }
memcfg.spd[3].read_type = NOT_EXISTING; dump_spd_info(&blk);
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40820 )
Change subject: mb/google/hatch/romstage_spd_smbus.c: Fix missing DIMM issue ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/c/coreboot/+/40820/1/src/mainboard/google/hatch/... File src/mainboard/google/hatch/romstage_spd_smbus.c:
https://review.coreboot.org/c/coreboot/+/40820/1/src/mainboard/google/hatch/... PS1, Line 27: memcfg.spd[0].spd_spec.spd_data_ptr_info.spd_data_ptr = (uintptr_t)blk.spd_array[0]; line over 96 characters
https://review.coreboot.org/c/coreboot/+/40820/1/src/mainboard/google/hatch/... PS1, Line 37: memcfg.spd[2].spd_spec.spd_data_ptr_info.spd_data_ptr = (uintptr_t)blk.spd_array[1]; line over 96 characters
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40820 )
Change subject: mb/google/hatch/romstage_spd_smbus.c: Fix missing DIMM issue ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/c/coreboot/+/40820/1/src/mainboard/google/hatch/... File src/mainboard/google/hatch/romstage_spd_smbus.c:
https://review.coreboot.org/c/coreboot/+/40820/1/src/mainboard/google/hatch/... PS1, Line 27: memcfg.spd[0].spd_spec.spd_data_ptr_info.spd_data_ptr = (uintptr_t)blk.spd_array[0];
line over 96 characters
Ack
https://review.coreboot.org/c/coreboot/+/40820/1/src/mainboard/google/hatch/... PS1, Line 37: memcfg.spd[2].spd_spec.spd_data_ptr_info.spd_data_ptr = (uintptr_t)blk.spd_array[1];
line over 96 characters
Ack
Hello build bot (Jenkins), Jamie Chen,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/40820
to look at the new patch set (#2).
Change subject: mb/google/hatch/romstage_spd_smbus.c: Fix missing DIMM issue ......................................................................
mb/google/hatch/romstage_spd_smbus.c: Fix missing DIMM issue
Since `commit 0ee9b14c09c` the SPD array is set to NULL if no DIMM is present. This causes failure due to an unconditional use of `blk.spd_array[i]`, : i={0,1}.
This validates the spd_array is non-NULL before use otherwise it sets the DIMM as not present.
Puff fails boot with the following log:
``` ... SPD: banks 16, ranks 2, rows 16, columns 10, density 8192 Mb SPD: device width 8 bits, bus width 64 bits SPD: module size is 16384 MB (per channel) ASSERTION ERROR: file 'src/soc/intel/cannonlake/cnl_memcfg_init.c', line 47 ```
BUG=b:155220125 BRANCH=none TEST=none
Change-Id: I5f47c849344951d53fa8c67e779b7c46d632d124 Signed-off-by: Edward O'Callaghan quasisec@google.com --- M src/mainboard/google/hatch/romstage_spd_smbus.c 1 file changed, 15 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/40820/2
Jamie Chen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40820 )
Change subject: mb/google/hatch/romstage_spd_smbus.c: Fix missing DIMM issue ......................................................................
Patch Set 2: Code-Review+1
Sam McNally has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40820 )
Change subject: mb/google/hatch/romstage_spd_smbus.c: Fix missing DIMM issue ......................................................................
Patch Set 2: Code-Review+2
EricR Lai has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40820 )
Change subject: mb/google/hatch/romstage_spd_smbus.c: Fix missing DIMM issue ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/40820/2/src/mainboard/google/hatch/... File src/mainboard/google/hatch/romstage_spd_smbus.c:
https://review.coreboot.org/c/coreboot/+/40820/2/src/mainboard/google/hatch/... PS2, Line 15: struct spd_block blk = { this would be good to follow Furquan's patch for TGL. https://review.coreboot.org/c/coreboot/+/39866/15/src/soc/intel/tigerlake/in..., define 4 address and you do with loop for the following things.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40820 )
Change subject: mb/google/hatch/romstage_spd_smbus.c: Fix missing DIMM issue ......................................................................
Patch Set 2: Code-Review+2
Daniel Kurtz has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40820 )
Change subject: mb/google/hatch/romstage_spd_smbus.c: Fix missing DIMM issue ......................................................................
Patch Set 2: Code-Review+2
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40820 )
Change subject: mb/google/hatch/romstage_spd_smbus.c: Fix missing DIMM issue ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/40820/2/src/mainboard/google/hatch/... File src/mainboard/google/hatch/romstage_spd_smbus.c:
https://review.coreboot.org/c/coreboot/+/40820/2/src/mainboard/google/hatch/... PS2, Line 15: struct spd_block blk = {
this would be good to follow Furquan's patch for TGL. https://review.coreboot. […]
Will consider as a follow up, lets un-break boot for now.
Edward O'Callaghan has submitted this change. ( https://review.coreboot.org/c/coreboot/+/40820 )
Change subject: mb/google/hatch/romstage_spd_smbus.c: Fix missing DIMM issue ......................................................................
mb/google/hatch/romstage_spd_smbus.c: Fix missing DIMM issue
Since `commit 0ee9b14c09c` the SPD array is set to NULL if no DIMM is present. This causes failure due to an unconditional use of `blk.spd_array[i]`, : i={0,1}.
This validates the spd_array is non-NULL before use otherwise it sets the DIMM as not present.
Puff fails boot with the following log:
``` ... SPD: banks 16, ranks 2, rows 16, columns 10, density 8192 Mb SPD: device width 8 bits, bus width 64 bits SPD: module size is 16384 MB (per channel) ASSERTION ERROR: file 'src/soc/intel/cannonlake/cnl_memcfg_init.c', line 47 ```
BUG=b:155220125 BRANCH=none TEST=none
Change-Id: I5f47c849344951d53fa8c67e779b7c46d632d124 Signed-off-by: Edward O'Callaghan quasisec@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/40820 Reviewed-by: Jamie Chen jamie.chen@intel.com Reviewed-by: Sam McNally sammc@google.com Reviewed-by: Furquan Shaikh furquan@google.com Reviewed-by: Daniel Kurtz djkurtz@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/google/hatch/romstage_spd_smbus.c 1 file changed, 15 insertions(+), 6 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved Daniel Kurtz: Looks good to me, approved Jamie Chen: Looks good to me, but someone else must approve Sam McNally: Looks good to me, approved
diff --git a/src/mainboard/google/hatch/romstage_spd_smbus.c b/src/mainboard/google/hatch/romstage_spd_smbus.c index 4aa37fa..bac5d58 100644 --- a/src/mainboard/google/hatch/romstage_spd_smbus.c +++ b/src/mainboard/google/hatch/romstage_spd_smbus.c @@ -18,15 +18,24 @@
/* Access memory info through SMBUS. */ get_spd_smbus(&blk); - memcfg.spd[0].read_type = READ_SPD_MEMPTR; - memcfg.spd[0].spd_spec.spd_data_ptr_info.spd_data_len = blk.len; - memcfg.spd[0].spd_spec.spd_data_ptr_info.spd_data_ptr = (uintptr_t)blk.spd_array[0]; + + if (blk.spd_array[0] == NULL) { + memcfg.spd[0].read_type = NOT_EXISTING; + } else { + memcfg.spd[0].read_type = READ_SPD_MEMPTR; + memcfg.spd[0].spd_spec.spd_data_ptr_info.spd_data_len = blk.len; + memcfg.spd[0].spd_spec.spd_data_ptr_info.spd_data_ptr = (uintptr_t)blk.spd_array[0]; + }
memcfg.spd[1].read_type = NOT_EXISTING;
- memcfg.spd[2].read_type = READ_SPD_MEMPTR; - memcfg.spd[2].spd_spec.spd_data_ptr_info.spd_data_len = blk.len; - memcfg.spd[2].spd_spec.spd_data_ptr_info.spd_data_ptr = (uintptr_t)blk.spd_array[1]; + if (blk.spd_array[1] == NULL) { + memcfg.spd[2].read_type = NOT_EXISTING; + } else { + memcfg.spd[2].read_type = READ_SPD_MEMPTR; + memcfg.spd[2].spd_spec.spd_data_ptr_info.spd_data_len = blk.len; + memcfg.spd[2].spd_spec.spd_data_ptr_info.spd_data_ptr = (uintptr_t)blk.spd_array[1]; + }
memcfg.spd[3].read_type = NOT_EXISTING; dump_spd_info(&blk);
9elements QA has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40820 )
Change subject: mb/google/hatch/romstage_spd_smbus.c: Fix missing DIMM issue ......................................................................
Patch Set 3:
Automatic boot test returned (PASS/FAIL/TOTAL): 4/0/4 Emulation targets: "QEMU x86 q35/ich9" using payload TianoCore : SUCCESS : https://lava.9esec.io/r/2846 "QEMU x86 q35/ich9" using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/2845 "QEMU x86 i440fx/piix4" using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/2844 "QEMU AArch64" using payload LinuxBoot_u-root_kexec : SUCCESS : https://lava.9esec.io/r/2843
Please note: This test is under development and might not be accurate at all!