From: Andre Przywara <andre.przywara@arm.com>
To: Philippe Simons <simons.philippe@gmail.com>
Cc: Jagan Teki <jagan@amarulasolutions.com>,
Tom Rini <trini@konsulko.com>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
"Kory Maincent (TI.com)" <kory.maincent@bootlin.com>,
Paul Kocialkowski <contact@paulk.fr>,
Cody Eksal <masterr3c0rd@epochal.quest>,
Samuel Holland <samuel@sholland.org>,
Mikhail Kalashnikov <iuncuim@gmail.com>,
u-boot@lists.denx.de, linux-sunxi <linux-sunxi@lists.linux.dev>
Subject: Re: [PATCH 1/2] sunxi: H616: dram: fix LPDDR3 TPR6 parsing
Date: Mon, 6 Apr 2026 23:35:56 +0200 [thread overview]
Message-ID: <20260406233556.32e31718@ryzen.lan> (raw)
In-Reply-To: <20260405195927.2837914-2-simons.philippe@gmail.com>
On Sun, 5 Apr 2026 21:59:26 +0200
Philippe Simons <simons.philippe@gmail.com> wrote:
Hi Philippe,
thanks for taking care of sending this patch!
> From: Jernej Skrabec <jernej.skrabec@gmail.com>
>
> When a user copies the vendor value of tpr6 into the mainline U-Boot,
> the code parses the tpr6 parameter incorrectly and writes the wrong value.
That sentence is hard to understand unless you know what this value is
about already. What about:
===============
Allwinner's BSP DRAM code uses parameter TPR6, presumably containing
some "Vref" parameter, to encode the values for *all* four supported DRAM
types. The code selects one byte based on the DRAM type used at runtime.
To allow copying DRAM parameters from vendor firmware, we used this value
and its encoding, but wrongly: the proper order of bytes is DDR3, DDR4,
LPDDR3, LPDDR4, from LSB to MSB, cf. the A523 and A133 DRAM code.
Correct the masking for LPDDR3 to fix DRAM operation on some boards
using this DRAM type.
==============
Plus we need the second patch merged into this one, otherwise this
would introduce (an admittedly theoretical) regression.
But the actual changes in both patches looks good to me.
Cheers,
Andre
> Fixes Vref parsing from TPR6. Proper order from LSB to MSB is DDR3, DDR4,
> LPDDR3 and LPDDR4
>
> Fix that.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> [adjusted commit message]
> Signed-off-by: Philippe Simons <simons.philippe@gmail.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;
next prev parent reply other threads:[~2026-04-06 21:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-05 19:59 [PATCH 0/2] Fix LPDDR3 H616 TPR6 parsing Philippe Simons
2026-04-05 19:59 ` [PATCH 1/2] sunxi: H616: dram: fix LPDDR3 " Philippe Simons
2026-04-06 21:35 ` Andre Przywara [this message]
2026-04-05 19:59 ` [PATCH 2/2] sunxi: fix DRAM_SUNXI_TPR6 default value Philippe Simons
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=20260406233556.32e31718@ryzen.lan \
--to=andre.przywara@arm.com \
--cc=contact@paulk.fr \
--cc=iuncuim@gmail.com \
--cc=jagan@amarulasolutions.com \
--cc=jernej.skrabec@gmail.com \
--cc=kory.maincent@bootlin.com \
--cc=linux-sunxi@lists.linux.dev \
--cc=masterr3c0rd@epochal.quest \
--cc=samuel@sholland.org \
--cc=simons.philippe@gmail.com \
--cc=trini@konsulko.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