From c0230de68b523684a20fd37bbfbc5be2de06c492 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philip=20M=C3=BCller?= <philm@manjaro.org>
Date: Fri, 22 Jul 2022 07:53:48 +0200
Subject: [PATCH] [pkg-upd] 2022.07-2 - enable 400 MHz training for DDR4 RAMs

---
 PKGBUILD | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/PKGBUILD b/PKGBUILD
index 7914bad..636ee74 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,8 +6,8 @@
 
 pkgname=uboot-pinephonepro
 pkgver=2022.07
-pkgrel=1
-epoch=4
+pkgrel=2
+epoch=5
 _tfaver=2.7.0
 pkgdesc="U-Boot for Pine64 PinePhone Pro"
 arch=('aarch64')
@@ -28,7 +28,7 @@ source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver/rc/-rc}.tar.bz2"
         "2001-mmc-sdhci-allow-disabling-sdma-in-spl.patch"
         "2002-ram-rk3399-Fix-.set_rate_index-error-handling.patch"
         "2003-ram-rk3399-Fix-faulty-frequency-change-reports.patch"
-        #"2004-ram-rk3399-Conduct-memory-training-at-400MHz.patch"
+        "2004-ram-rk3399-Conduct-memory-training-at-400MHz.patch"
         "3001-pinephone-pro-Remove-cargo-culted-iodomain-config.patch"
         "3002-pine64-pinephonePro-SPI-support.patch"
         "boot.txt"
@@ -45,6 +45,7 @@ sha256sums=('92b08eb49c24da14c1adbf70a71ae8f37cc53eeb4230e859ad8b6733d13dcf5e'
             '7014c3f1ada93536787a4ce30b484dfe651c339391bd46869c61933825a0edcc'
             '8ac90e3f4b7c58d1092d6c21c7650dfa9019729bc94baa7a105df397c12c02a9'
             'b7efb8295351e3c358babc65b622cf52bd3adc2d1e97f11324f3f85e03af2101'
+            'bffd549a4ac34a3ff43839d344609305dcea0b05e061854cb3b26325e6b23053'
             '29fb86661c0229fa115c490aea0425d498f0c53c05551d6d2abba048e17eb01a'
             '72bef2b7c69e63e219fc74ae887cf0c36a89fb203e0381285cd2b66d035c4b68'
             '12311da7e1a8d7bf19ddf78568e58da0888b0ca89e937aecccae4d896d20b7e2'
@@ -113,6 +114,9 @@ build() {
 
   update_config 'CONFIG_IDENT_STRING' '" Manjaro Linux ARM"'
   update_config 'CONFIG_BOOTDELAY' '0'
+  
+  # Some DDR4 RAMs need training at 400 MHz to successfully boot
+  update_config 'CONFIG_RAM_RK3399_LPDDR4' 'y'
 
   # Try a couple of SPI tweaks;  if actually needed, these options
   # will be propely moved to a PinePhone Pro configuration patch later
-- 
GitLab