Skip to contentSkip to conversation

ppc4xx: Allow setting a single SPD EEPROM address for DDR2 DIMMs

PATCH New Felix Radensky 2 participants 2 messages Jan 19, 2010 – Jan 21, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc4xx: Allow setting a single SPD EEPROM address for DDR2 DIMMs

On platforms where SPD EEPROM and another EEPROM have adjacent I2C addresses SPD_EEPROM_ADDRESS should be defined as a single element array, otherwise DDR2 setup code would fail with the following error:

ERROR: Unknown DIMM detected in slot 1

However, fixing SPD_EEPROM_ADDRESS would result in another error:

ERROR: DIMM's DDR1 and DDR2 type can not be mixed.

This happens because initdram() routine does not explicitly initialize dimm_populated array. This patch fixes the problem.

---
 cpu/ppc4xx/44x_spd_ddr2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
cpu/ppc4xx/44x_spd_ddr2.c +1 -1
index f8aa14a..593a286 100644
@@ -426,7 +426,7 @@ phys_size_t initdram(int board_type)
 	unsigned char spd0[MAX_SPD_BYTES];
 	unsigned char spd1[MAX_SPD_BYTES];
 	unsigned char *dimm_spd[MAXDIMMS];
-	unsigned long dimm_populated[MAXDIMMS];
+	unsigned long dimm_populated[MAXDIMMS] = {SDRAM_NONE, SDRAM_NONE};
 	unsigned long num_dimm_banks;		/* on board dimm banks */
 	unsigned long val;
 	ddr_cas_id_t selected_cas = DDR_CAS_5;	/* preset to silence compiler */
Signature · 1 line
1.5.4.3
#1 lore raw

PATCH 1/1 ppc4xx: Allow setting a single SPD EEPROM address for DDR2 DIMMs

Quoted 7 lines · On Tuesday 19 January 2010 20:19:06 Felix Radensky wrote:

On platforms where SPD EEPROM and another EEPROM have adjacent I2C addresses SPD_EEPROM_ADDRESS should be defined as a single element array, otherwise DDR2 setup code would fail with the following error:

ERROR: Unknown DIMM detected in slot 1

Quoted 7 lines

However, fixing SPD_EEPROM_ADDRESS would result in another error:

ERROR: DIMM's DDR1 and DDR2 type can not be mixed.

This happens because initdram() routine does not explicitly initialize dimm_populated array. This patch fixes the problem.

Applied to u-boot-ppc4xx/master. Thanks.

Cheers,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de