Somehow we need 1.50V for the 4GB DDR3 to work reliably. No idea so far why this is though.
Note that we really should call pyra_set_ddr3_voltage() before sdram_init() but the i2c driver is not yet initialized in board_early_init_f().
If somebody wants to play with board_early_init_f(), please note that using it needs CONFIG_BOARD_EARLY_INIT_F enabled too. --- board/goldelico/letux-cortex15/lc15.c | 32 ++++++++++++++++++++++++++++++++ include/palmas.h | 4 ++++ 2 files changed, 36 insertions(+)
diff --git a/board/goldelico/letux-cortex15/lc15.c b/board/goldelico/letux-cortex15/lc15.c --- a/board/goldelico/letux-cortex15/lc15.c +++ b/board/goldelico/letux-cortex15/lc15.c @@ -248,6 +248,37 @@ static void simple_ram_test(void) printf("WARNING: DDR RAM is not working! (%x)\n", v[0]); }
+#ifdef CONFIG_DUAL_RANK_DDR3 +/* + * REVISIT: Somehow the 4GB K4B8G1646D-MYK0 part needs SMPS6 voltage + * set to 1.50V (0x6a) instead of 1.35V (0x5d). Values below 1.50V + * seem to be flakey. + */ +static void pyra_set_ddr3_voltage(void) +{ + int err; + + if (running_from_sdram()) + return; + + err = palmas_i2c_write_u8(TWL603X_CHIP_P1, + SMPS6_VOLTAGE, 0x6a); + if (err) + goto err; + + mdelay(150); + + return; + +err: + printf("%s error: %i\n", __func__, err); +} +#else +static inline void pyra_set_ddr3_voltage(void) +{ +} +#endif + int board_mmc_init(bd_t *bis) { int hard_select = 7; /* gpio to select uSD (0) or eMMC (1) by external hw signal */ @@ -256,6 +287,7 @@ int board_mmc_init(bd_t *bis)
int val; /* is the value of soft_select gpio after processing */
+ pyra_set_ddr3_voltage(); simple_ram_test(); int vers = get_board_version(); #if 1 diff --git a/include/palmas.h b/include/palmas.h --- a/include/palmas.h +++ b/include/palmas.h @@ -60,6 +60,10 @@ /* Request bypass, LDO9 only */ #define LDO9_BYPASS 0x3f
+/* SMPS6_CTRL */ +#define SMPS6_CTRL 0x2c +#define SMPS6_VOLTAGE 0x2f + /* SMPS7_CTRL */ #define SMPS7_CTRL 0x30