From: Chris Morgan <macroalpha82@gmail.com>
To: u-boot@lists.denx.de
Cc: jonas@kwiboo.se, trini@konsulko.com, kever.yang@rock-chips.com,
philipp.tomsich@vrull.eu, sjg@chromium.org, dsimic@manjaro.org,
quentin.schulz@cherry.de, Chris Morgan <macromorgan@hotmail.com>
Subject: [PATCH 3/3] board: rockchip: Fix panel detection for mainline A-TF
Date: Mon, 16 Sep 2024 16:01:37 -0500 [thread overview]
Message-ID: <20240916210137.182493-4-macroalpha82@gmail.com> (raw)
In-Reply-To: <20240916210137.182493-1-macroalpha82@gmail.com>
From: Chris Morgan <macromorgan@hotmail.com>
The current panel detection logic crashes when the device boots with
mainline A-TF, causing a reboot loop. It turns out mainline A-TF
doesn't enable the VO power domain like the BSP A-TF did.
Set the VO domain on and use a memory barrier to ensure it is powered
up before we attempt to do the panel detection.
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 13 +++++++++++++
configs/anbernic-rgxx3-rk3566_defconfig | 2 --
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
index c1d1826fd14..f4e7c1ab360 100644
--- a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
+++ b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
@@ -22,6 +22,10 @@
DECLARE_GLOBAL_DATA_PTR;
+#define PMU_BASE_ADDR 0xfdd90000
+#define PMU_PWR_GATE_SFTCON 0xa0
+#define PMU_PD_VO_DWN_ENA BIT(7)
+
#define GPIO0_BASE 0xfdd60000
#define GPIO4_BASE 0xfe770000
#define GPIO_SWPORT_DR_L 0x0000
@@ -311,6 +315,15 @@ int rgxx3_detect_display(void)
int i;
u8 panel_id[2];
+ /* Disable VO power domain power-down */
+ writel((PMU_PD_VO_DWN_ENA << 16),
+ PMU_BASE_ADDR + PMU_PWR_GATE_SFTCON);
+ /*
+ * System will crash if the power domain isn't enabled before
+ * we start trying to talk to the DSI panel.
+ */
+ wmb();
+
/*
* Take panel out of reset status.
* Set GPIO4_A0 to output.
diff --git a/configs/anbernic-rgxx3-rk3566_defconfig b/configs/anbernic-rgxx3-rk3566_defconfig
index f5e5470df8c..49d3766613e 100644
--- a/configs/anbernic-rgxx3-rk3566_defconfig
+++ b/configs/anbernic-rgxx3-rk3566_defconfig
@@ -49,8 +49,6 @@ CONFIG_SPL_REGMAP=y
CONFIG_SPL_SYSCON=y
CONFIG_SPL_ADC=y
CONFIG_SPL_CLK=y
-CONFIG_ARM_SMCCC_FEATURES=y
-CONFIG_SCMI_FIRMWARE=y
CONFIG_ROCKCHIP_GPIO=y
CONFIG_SYS_I2C_ROCKCHIP=y
CONFIG_MISC=y
--
2.34.1
next prev parent reply other threads:[~2024-09-16 21:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-16 21:01 [PATCH 0/3] Anbernic RGxx3 Bootloader Fixes Chris Morgan
2024-09-16 21:01 ` [PATCH 1/3] board: rockchip: Convert Anbernic RGxx3 to OF_UPSTREAM Chris Morgan
2024-09-16 21:01 ` [PATCH 2/3] board: rockchip: Add vdd_cpu reg fixup for RGXX3 Series Chris Morgan
2024-09-16 21:01 ` Chris Morgan [this message]
2024-09-18 3:06 ` [PATCH 3/3] board: rockchip: Fix panel detection for mainline A-TF Kever Yang
2024-09-18 13:38 ` Chris Morgan
2024-09-19 1:48 ` Kever Yang
2024-09-19 13:15 ` Chris Morgan
2024-09-30 8:59 ` Kever Yang
2024-10-04 21:21 ` 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=20240916210137.182493-4-macroalpha82@gmail.com \
--to=macroalpha82@gmail.com \
--cc=dsimic@manjaro.org \
--cc=jonas@kwiboo.se \
--cc=kever.yang@rock-chips.com \
--cc=macromorgan@hotmail.com \
--cc=philipp.tomsich@vrull.eu \
--cc=quentin.schulz@cherry.de \
--cc=sjg@chromium.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