From: Andre Przywara <andre.przywara@arm.com>
To: u-boot@lists.denx.de
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>,
Philippe Simons <simons.philippe@gmail.com>,
Paul Kocialkowski <paulk@sys-base.io>,
linux-sunxi@lists.linux.dev,
Mikhail Kalashnikov <iuncuim@gmail.com>,
Cody Eksal <masterr3c0rd@epochal.quest>
Subject: [PATCH v3 1/2] sunxi: H616: dram: fix LPDDR3 TPR6 parsing
Date: Mon, 27 Apr 2026 15:58:18 +0200 [thread overview]
Message-ID: <20260427135819.2577234-2-andre.przywara@arm.com> (raw)
In-Reply-To: <20260427135819.2577234-1-andre.przywara@arm.com>
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Allwinner's DRAM initialisation code defines a parameter named TPR6,
presumably containing some "Vref" parameter, but containing values for
*all* DRAM types. The runtime code selects one byte based on the DRAM
type used.
This selection code was wrong for LPDDR3, the value is encoded in
bits [23:16], not [15:8]. Fix that in the code, which also aligns it
with the very similar code for the A133 and A523.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reported-by: Philippe Simons <simons.philippe@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
---
arch/arm/mach-sunxi/dram_sun50i_h616.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-sunxi/dram_sun50i_h616.c b/arch/arm/mach-sunxi/dram_sun50i_h616.c
index 3345c9b8e82..42a0550e015 100644
--- a/arch/arm/mach-sunxi/dram_sun50i_h616.c
+++ b/arch/arm/mach-sunxi/dram_sun50i_h616.c
@@ -975,7 +975,7 @@ static bool mctl_phy_init(const struct dram_para *para,
val = para->tpr6 & 0xff;
break;
case SUNXI_DRAM_TYPE_LPDDR3:
- val = para->tpr6 >> 8 & 0xff;
+ val = para->tpr6 >> 16 & 0xff;
break;
case SUNXI_DRAM_TYPE_LPDDR4:
val = para->tpr6 >> 24 & 0xff;
--
2.43.0
next prev parent reply other threads:[~2026-04-27 13:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 13:58 [PATCH v3 0/2] sunxi: H616: DRAM: Fix TPR6 parameter parsing Andre Przywara
2026-04-27 13:58 ` Andre Przywara [this message]
2026-04-28 9:41 ` [PATCH v3 1/2] sunxi: H616: dram: fix LPDDR3 TPR6 parsing Paul Kocialkowski
2026-04-27 13:58 ` [PATCH v3 2/2] sunxi: H616: dram: drop default TPR6 Kconfig value Andre Przywara
2026-04-27 18:42 ` Jernej Škrabec
2026-04-28 9:49 ` Paul Kocialkowski
2026-04-28 17:39 ` Paul Kocialkowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260427135819.2577234-2-andre.przywara@arm.com \
--to=andre.przywara@arm.com \
--cc=iuncuim@gmail.com \
--cc=jernej.skrabec@gmail.com \
--cc=linux-sunxi@lists.linux.dev \
--cc=masterr3c0rd@epochal.quest \
--cc=paulk@sys-base.io \
--cc=simons.philippe@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox