summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJernej Skrabec <[email protected]>2026-04-05 21:59:26 +0200
committerAndre Przywara <[email protected]>2026-04-30 23:31:03 +0200
commit5a24cc0740e1afcca830dd83d9f1062034fff2d6 (patch)
treebf82efd7ec461ef2a7afa74aac9fbf81ff5c1f5d
parent9d3bbc99b9038fa64dda92f97e0c29e4808694ec (diff)
sunxi: H616: dram: fix LPDDR3 TPR6 parsing
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 <[email protected]> Reported-by: Philippe Simons <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Reviewed-by: Paul Kocialkowski <[email protected]>
-rw-r--r--arch/arm/mach-sunxi/dram_sun50i_h616.c2
1 files changed, 1 insertions, 1 deletions
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;