Skip to content
Snippets Groups Projects
Commit bb365462 authored by Jens Kuske's avatar Jens Kuske Committed by Hans de Goede
Browse files

sunxi: Fix H3 DRAM DQ read delay configuration


The read delays were set incorrectly, leading to reliability
issues at higher DRAM clock speeds. This commit adjusts this
to match the vendor boot0 behaviour.

Signed-off-by: default avatarJens Kuske <jenskuske@gmail.com>
Tested-by: default avatarSiarhei Siamashka <siarhei.siamashka@gmail.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 23baf66f
No related branches found
No related tags found
No related merge requests found
...@@ -73,10 +73,10 @@ static void mctl_dq_delay(u32 read, u32 write) ...@@ -73,10 +73,10 @@ static void mctl_dq_delay(u32 read, u32 write)
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
val = DATX_IOCR_WRITE_DELAY((write >> (i * 4)) & 0xf) | val = DATX_IOCR_WRITE_DELAY((write >> (i * 4)) & 0xf) |
DATX_IOCR_READ_DELAY((read >> (i * 4)) & 0xf); DATX_IOCR_READ_DELAY(((read >> (i * 4)) & 0xf) * 2);
for (j = DATX_IOCR_DQ(0); j <= DATX_IOCR_DM; j++) for (j = DATX_IOCR_DQ(0); j <= DATX_IOCR_DM; j++)
setbits_le32(&mctl_ctl->datx[i].iocr[j], val); writel(val, &mctl_ctl->datx[i].iocr[j]);
} }
clrbits_le32(&mctl_ctl->pgcr[0], 1 << 26); clrbits_le32(&mctl_ctl->pgcr[0], 1 << 26);
...@@ -85,8 +85,8 @@ static void mctl_dq_delay(u32 read, u32 write) ...@@ -85,8 +85,8 @@ static void mctl_dq_delay(u32 read, u32 write)
val = DATX_IOCR_WRITE_DELAY((write >> (16 + i * 4)) & 0xf) | val = DATX_IOCR_WRITE_DELAY((write >> (16 + i * 4)) & 0xf) |
DATX_IOCR_READ_DELAY((read >> (16 + i * 4)) & 0xf); DATX_IOCR_READ_DELAY((read >> (16 + i * 4)) & 0xf);
setbits_le32(&mctl_ctl->datx[i].iocr[DATX_IOCR_DQS], val); writel(val, &mctl_ctl->datx[i].iocr[DATX_IOCR_DQS]);
setbits_le32(&mctl_ctl->datx[i].iocr[DATX_IOCR_DQSN], val); writel(val, &mctl_ctl->datx[i].iocr[DATX_IOCR_DQSN]);
} }
setbits_le32(&mctl_ctl->pgcr[0], 1 << 26); setbits_le32(&mctl_ctl->pgcr[0], 1 << 26);
...@@ -436,8 +436,8 @@ unsigned long sunxi_dram_init(void) ...@@ -436,8 +436,8 @@ unsigned long sunxi_dram_init(void)
(struct sunxi_mctl_ctl_reg *)SUNXI_DRAM_CTL0_BASE; (struct sunxi_mctl_ctl_reg *)SUNXI_DRAM_CTL0_BASE;
struct dram_para para = { struct dram_para para = {
.read_delays = 0x00007979, .read_delays = 0x00007979, /* dram_tpr12 */
.write_delays = 0x6aaa0000, .write_delays = 0x6aaa0000, /* dram_tpr11 */
.dual_rank = 0, .dual_rank = 0,
.bus_width = 32, .bus_width = 32,
.row_bits = 15, .row_bits = 15,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment