From: Chris Morgan <macroalpha82@gmail.com>
To: u-boot@lists.denx.de
Cc: sjg@chromium.org, jernej.skrabec@gmail.com,
neil.armstrong@linaro.org, hdegoede@redhat.com,
andre.przywara@arm.com, jagan@amarulasolutions.com,
trini@konsulko.com, ryan@testtoast.com, iuncuim@gmail.com,
sumit.garg@linaro.org, Chris Morgan <macromorgan@hotmail.com>
Subject: [PATCH V3 3/9] sunxi: H616: DRAM: Adjust configuration procedure
Date: Fri, 30 Aug 2024 10:55:08 -0500 [thread overview]
Message-ID: <20240830155514.481410-4-macroalpha82@gmail.com> (raw)
In-Reply-To: <20240830155514.481410-1-macroalpha82@gmail.com>
From: Jernej Skrabec <jernej.skrabec@gmail.com>
When comparing configuration procedure to vendor driver, I noticed that
one command was out of order and that some delays were missing.
Fix that.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Tested-by: Chris Morgan <macromorgan@hotmail.com>
---
arch/arm/mach-sunxi/dram_sun50i_h616.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-sunxi/dram_sun50i_h616.c b/arch/arm/mach-sunxi/dram_sun50i_h616.c
index 52f7799173..35405915e9 100644
--- a/arch/arm/mach-sunxi/dram_sun50i_h616.c
+++ b/arch/arm/mach-sunxi/dram_sun50i_h616.c
@@ -1014,12 +1014,16 @@ static bool mctl_phy_init(const struct dram_para *para,
clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 0x14c, 0xe0, 0x20);
}
+ clrbits_le32(&mctl_com->unk_0x500, 0x200);
+ udelay(1);
+
clrbits_le32(SUNXI_DRAM_PHY0_BASE + 0x14c, 8);
mctl_await_completion((u32 *)(SUNXI_DRAM_PHY0_BASE + 0x180), 4, 4);
+ udelay(1000);
+
writel(0x37, SUNXI_DRAM_PHY0_BASE + 0x58);
- clrbits_le32(&mctl_com->unk_0x500, 0x200);
writel(0, &mctl_ctl->swctl);
setbits_le32(&mctl_ctl->dfimisc, 1);
@@ -1038,6 +1042,8 @@ static bool mctl_phy_init(const struct dram_para *para,
mctl_await_completion(&mctl_ctl->swstat, 1, 1);
mctl_await_completion(&mctl_ctl->statr, 3, 1);
+ udelay(200);
+
writel(0, &mctl_ctl->swctl);
clrbits_le32(&mctl_ctl->dfimisc, 1);
@@ -1281,8 +1287,10 @@ static bool mctl_ctrl_init(const struct dram_para *para,
setbits_le32(&mctl_ctl->clken, BIT(8));
clrsetbits_le32(&mctl_com->unk_0x500, BIT(24), 0x300);
+ udelay(1);
/* this write seems to enable PHY MMIO region */
setbits_le32(&mctl_com->unk_0x500, BIT(24));
+ udelay(1);
if (!mctl_phy_init(para, config))
return false;
--
2.34.1
next prev parent reply other threads:[~2024-08-30 15:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-30 15:55 [PATCH V3 0/9] Add Anbernic RG35XX-2024 Chris Morgan
2024-08-30 15:55 ` [PATCH V3 1/9] sunxi: H616: dram: LPDDR4: adjust settings Chris Morgan
2024-08-30 15:55 ` [PATCH V3 2/9] sunxi: H616: DRAM: Add alternative pin mapping Chris Morgan
2024-08-30 15:55 ` Chris Morgan [this message]
2024-08-30 15:55 ` [PATCH V3 4/9] sunxi: H616: DRAM: Adjust size scan procedure Chris Morgan
2024-08-30 15:55 ` [PATCH V3 5/9] sunxi: H616: dram: Update mbus priorities Chris Morgan
2024-09-02 22:36 ` Andre Przywara
2024-08-30 15:55 ` [PATCH V3 6/9] sunxi: Correct TPR6 parameter for H616 DRAM driver Chris Morgan
2024-09-02 22:35 ` Andre Przywara
2024-08-30 15:55 ` [PATCH V3 7/9] arm64: dts: allwinner: h616: Add r_i2c pinctrl nodes Chris Morgan
2024-09-04 4:32 ` Sumit Garg
2024-09-04 9:11 ` Andre Przywara
2024-08-30 15:55 ` [PATCH V3 8/9] arm64: dts: allwinner: h616: Change RG35XX PMIC to r_i2c Chris Morgan
2024-08-30 15:55 ` [PATCH V3 9/9] sunxi: Add support for Anbernic RG35XX-2024 Chris Morgan
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=20240830155514.481410-4-macroalpha82@gmail.com \
--to=macroalpha82@gmail.com \
--cc=andre.przywara@arm.com \
--cc=hdegoede@redhat.com \
--cc=iuncuim@gmail.com \
--cc=jagan@amarulasolutions.com \
--cc=jernej.skrabec@gmail.com \
--cc=macromorgan@hotmail.com \
--cc=neil.armstrong@linaro.org \
--cc=ryan@testtoast.com \
--cc=sjg@chromium.org \
--cc=sumit.garg@linaro.org \
--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