Skip to contentSkip to conversation

i2c/smbus_eeprom: Add minimum write recovery time for DDR2

PATCH In review BALATON Zoltan 2 participants 5 messages Oct 8, 2025 – Oct 20, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c/smbus_eeprom: Add minimum write recovery time for DDR2

This is needed for newer u-boot-sam460ex versions to pass the DRAM setup.

---
 hw/i2c/smbus_eeprom.c | 1 +
 1 file changed, 1 insertion(+)
hw/i2c/smbus_eeprom.c +1 -0
index 0a1088fbb0..26e211b31a 100644
@@ -288,6 +288,7 @@ uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t ram_size)
     spd[33] = 8;    /* addr/cmd hold time */
     spd[34] = 20;   /* data input setup time */
     spd[35] = 8;    /* data input hold time */
+    spd[36] = (type == DDR2 ? 13 << 2 : 0); /* min. write recovery time */
 
     /* checksum */
     for (i = 0; i < 63; i++) {
Signature · 1 line
2.41.3
#1 lore raw
Quoted 4 lines · BALATON Zoltan

This is needed for newer u-boot-sam460ex versions to pass the DRAM setup.

Ping? Will somebody review and merge this?

Regards,
BALATON Zoltan

Quoted 17 lines

---
hw/i2c/smbus_eeprom.c | 1 +

1 file changed, 1 insertion(+)
hw/i2c/smbus_eeprom.c +1 -0
index 0a1088fbb0..26e211b31a 100644
@@ -288,6 +288,7 @@ uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t ram_size)
    spd[33] = 8;    /* addr/cmd hold time */
    spd[34] = 20;   /* data input setup time */
    spd[35] = 8;    /* data input hold time */
+    spd[36] = (type == DDR2 ? 13 << 2 : 0); /* min. write recovery time */
 
    /* checksum */
    for (i = 0; i < 63; i++) {
Reviewed-by on v1 1/1
#2 lore raw
In reply to BALATON Zoltan
Quoted 13 lines · BALATON Zoltan

This is needed for newer u-boot-sam460ex versions to pass the DRAM setup.

---
  hw/i2c/smbus_eeprom.c | 1 +
  1 file changed, 1 insertion(+)
hw/i2c/smbus_eeprom.c +0 -0
index 0a1088fbb0..26e211b31a 100644

hw/i2c/smbus_eeprom.c uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t ram_size) · line 291

Quoted 4 lines
hw/i2c/smbus_eeprom.c +1 -0
@@ -288,6 +288,7 @@ uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t ram_size)
      spd[33] = 8;    /* addr/cmd hold time */
      spd[34] = 20;   /* data input setup time */
      spd[35] = 8;    /* data input hold time */
+    spd[36] = (type == DDR2 ? 13 << 2 : 0); /* min. write recovery time */

We are adapting DDR2 values on a method written for SDR/DDR[1]. Better would be to split and correctly document each format, using proper values.

Anyhow, for this patch:

#3 lore raw
Quoted 9 lines · Philippe Mathieu-Daudé
Quoted 8 lines · BALATON Zoltan

This is needed for newer u-boot-sam460ex versions to pass the DRAM setup.

---
  hw/i2c/smbus_eeprom.c | 1 +
  1 file changed, 1 insertion(+)
Quoted 14 lines

hw/i2c/smbus_eeprom.c uint8_t *spd_data_generate(enum sdram_type type, · line 292

Quoted 10 lines
hw/i2c/smbus_eeprom.c +1 -0
index 0a1088fbb0..26e211b31a 100644
@@ -288,6 +288,7 @@ uint8_t *spd_data_generate(enum sdram_type type, 
 ram_addr_t ram_size)
      spd[33] = 8;    /* addr/cmd hold time */
      spd[34] = 20;   /* data input setup time */
      spd[35] = 8;    /* data input hold time */
+    spd[36] = (type == DDR2 ? 13 << 2 : 0); /* min. write recovery time */

We are adapting DDR2 values on a method written for SDR/DDR[1]. Better would be to split and correctly document each format, using proper values.

I plan to add separate function for DDR3 which is different from these (Bernhard had a patch for that which we can adopt but I haven't got to that yet). Maybe a split could be considered then but these formats up to DDR2 are quite similar with a lot of common values and only a few differences to have them in a single function. As a documentation better consult something else, e.g. wikipedia has a good summary.

Quoted 2 lines

Anyhow, for this patch:

Thank you,
BALATON Zoltan