Angel Pons has submitted this change. ( https://review.coreboot.org/c/coreboot/+/51899 )
Change subject: nb/intel/i945: Refactor `dump_spd_registers` function ......................................................................
nb/intel/i945: Refactor `dump_spd_registers` function
Use the mainboard-provided SPD map and skip unused addresses.
Change-Id: I2b5b71cff290343c1000d5613209049fa9724e3d Signed-off-by: Angel Pons th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/51899 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Michael Niewöhner foss@mniewoehner.de --- M src/northbridge/intel/i945/debug.c M src/northbridge/intel/i945/i945.h M src/northbridge/intel/i945/romstage.c 3 files changed, 10 insertions(+), 9 deletions(-)
Approvals: build bot (Jenkins): Verified Michael Niewöhner: Looks good to me, approved
diff --git a/src/northbridge/intel/i945/debug.c b/src/northbridge/intel/i945/debug.c index db987ca..6073f59 100644 --- a/src/northbridge/intel/i945/debug.c +++ b/src/northbridge/intel/i945/debug.c @@ -57,11 +57,13 @@ } }
-void dump_spd_registers(void) +void dump_spd_registers(u8 spd_map[4]) { - unsigned int device; - device = DIMM0; - while (device <= DIMM3) { + for (unsigned int d = 0; d < 4; d++) { + const unsigned int device = spd_map[d]; + if (device == 0) + continue; + int status = 0; int i; printk(BIOS_DEBUG, "\ndimm %02x", device); @@ -76,7 +78,6 @@ } printk(BIOS_DEBUG, "%02x ", status); } - device++; printk(BIOS_DEBUG, "\n"); } } diff --git a/src/northbridge/intel/i945/i945.h b/src/northbridge/intel/i945/i945.h index fe06afc..d8993ac 100644 --- a/src/northbridge/intel/i945/i945.h +++ b/src/northbridge/intel/i945/i945.h @@ -337,7 +337,7 @@ void print_pci_devices(void); void dump_pci_device(unsigned int dev); void dump_pci_devices(void); -void dump_spd_registers(void); +void dump_spd_registers(u8 spd_map[4]); void sdram_dump_mchbar_registers(void);
u32 decode_igd_memory_size(u32 gms); diff --git a/src/northbridge/intel/i945/romstage.c b/src/northbridge/intel/i945/romstage.c index 248fe14..22eae4e 100644 --- a/src/northbridge/intel/i945/romstage.c +++ b/src/northbridge/intel/i945/romstage.c @@ -48,11 +48,11 @@
mainboard_pre_raminit_config(s3resume);
- if (CONFIG(DEBUG_RAM_SETUP)) - dump_spd_registers(); - mainboard_get_spd_map(spd_map);
+ if (CONFIG(DEBUG_RAM_SETUP)) + dump_spd_registers(spd_map); + sdram_initialize(s3resume ? BOOT_PATH_RESUME : BOOT_PATH_NORMAL, spd_map);
/* This should probably go away. Until now it is required