Skip to contentSkip to conversation

Anbernic RGxx3 Bootloader Fixes

PATCH Superseded Chris Morgan 3 participants 10 messages Sep 16, 2024 – Oct 4, 2024 Arm (32-bit)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Anbernic RGxx3 Bootloader Fixes

From: Chris Morgan <[email protected]>

Update the Anbernic RGxx3 "device" to use upstream device-trees, add logic to detect a different vdd_cpu regulator, and implement a fix to allow the panel auto-detection to run when using mainline A-TF.

Note that *Linux* still cannot use mainline A-TF because of the missing SCMI clock and reset functionality, but this patch series at least ensures that this board can once Linux is ready.

Chris Morgan (3):
board: rockchip: Convert Anbernic RGxx3 to OF_UPSTREAM
board: rockchip: Add vdd_cpu reg fixup for RGXX3 Series
board: rockchip: Fix panel detection for mainline A-TF

 .../dts/rk3566-anbernic-rg353p-u-boot.dtsi    |  34 ++
 .../arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi |  52 ---
 arch/arm/dts/rk3566-anbernic-rgxx3.dts        |  28 --
 board/anbernic/rgxx3_rk3566/MAINTAINERS       |   4 +-
 board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c    | 372 +++++++++++++++---
 configs/anbernic-rgxx3-rk3566_defconfig       |  12 +-
 6 files changed, 354 insertions(+), 148 deletions(-)
 create mode 100644 arch/arm/dts/rk3566-anbernic-rg353p-u-boot.dtsi
 delete mode 100644 arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi
 delete mode 100644 arch/arm/dts/rk3566-anbernic-rgxx3.dts
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/3 board: rockchip: Convert Anbernic RGxx3 to OF_UPSTREAM

From: Chris Morgan <[email protected]>

Refactor the board detection logic (again) to make it compatible with the upstream device-trees, and switch to OF_UPSTREAM.

Now the device boots with the device-tree for the 353P, and then loads the correct device tree (of 10) in the later stages of SPL.

---
 .../dts/rk3566-anbernic-rg353p-u-boot.dtsi    |  34 +++
 .../arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi |  52 -----
 arch/arm/dts/rk3566-anbernic-rgxx3.dts        |  28 ---
 board/anbernic/rgxx3_rk3566/MAINTAINERS       |   4 +-
 board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c    | 214 +++++++++++++-----
 configs/anbernic-rgxx3-rk3566_defconfig       |  10 +-
 6 files changed, 195 insertions(+), 147 deletions(-)
 create mode 100644 arch/arm/dts/rk3566-anbernic-rg353p-u-boot.dtsi
 delete mode 100644 arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi
 delete mode 100644 arch/arm/dts/rk3566-anbernic-rgxx3.dts
arch/arm/dts/rk3566-anbernic-rg353p-u-boot.dtsi new file +34 -0
new file mode 100644
index 00000000000..fa3fbe6c810
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+#include "rk356x-u-boot.dtsi"
+
+/ {
+	chosen {
+		u-boot,spl-boot-order = &sdmmc0, &sdhci;
+	};
+
+	/*
+	 * Adding fixed regulator to work around driver regulator
+	 * requirements. Note that the correct regulator is on by
+	 * default at boot and that saradc regulator gets corrected
+	 * when proper device-tree is loaded.
+	 */
+	vcc_1v8_dummy: vcc-1v8-dummy {
+		bootph-pre-ram;
+		bootph-some-ram;
+		compatible = "regulator-fixed";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-name = "vcc_1v8_dummy";
+		status = "okay";
+	};
+};
+
+&saradc {
+	bootph-pre-ram;
+	bootph-some-ram;
+	vref-supply = <&vcc_1v8_dummy>;
+	status = "okay";
+};
arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi deleted +0 -52

52 lines not on this page · raw message

arch/arm/dts/rk3566-anbernic-rgxx3.dts deleted +0 -28
deleted file mode 100644
index c393c8d07af..00000000000
@@ -1,28 +0,0 @@
-// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
-
-/dts-v1/;
-
-#include "rk3566-anbernic-rgxx3.dtsi"
-
-/ {
-
-/*
- * Note this is a pseudo-model that doesn't exist in mainline Linux.
- * This model is used for all RGXX3 devices and the board.c file will
- * set the correct dtb name for loading mainline Linux automatically.
- */
-	model = "RGXX3";
-	compatible = "anbernic,rg-arc-d", "anbernic,rg-arc-s",
-		     "anbernic,rg353m", "anbernic,rg353p",
-		     "anbernic,rg353ps", "anbernic,rg353v",
-		     "anbernic,rg353vs", "anbernic,rg503",
-		     "powkiddy,rgb10max3", "powkiddy,rgb30",
-		     "powkiddy,rk2023", "rockchip,rk3566";
-};
-
-&cru {
-	assigned-clocks = <&pmucru CLK_RTC_32K>, <&cru PLL_GPLL>,
-			  <&pmucru PLL_PPLL>, <&cru PLL_VPLL>;
-	assigned-clock-rates = <32768>, <1200000000>,
-			       <200000000>, <241500000>;
-};
board/anbernic/rgxx3_rk3566/MAINTAINERS +1 -3
index 7970e5a4aad..75a1e8076ca 100644
@@ -4,6 +4,4 @@ S:	Maintained
 F:	board/anbernic/rgxx3_rk3566
 F:	include/configs/anbernic-rgxx3-rk3566.h
 F:	configs/anbernic-rgxx3-rk3566_defconfig
-F:	arch/arm/dts/rk3566-anbernic-rgxx3.dts
-F:	arch/arm/dts/rk3566-anbernic-rgxx3.dtsi
-F:	arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi
+F:	arch/arm/dts/rk3566-anbernic-rg353p-u-boot.dtsi
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +153 -61

392 lines not on this page · raw message

configs/anbernic-rgxx3-rk3566_defconfig +7 -3
index a03509bf467..f5e5470df8c 100644
@@ -3,7 +3,7 @@ CONFIG_SKIP_LOWLEVEL_INIT=y
 CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SPL_GPIO=y
-CONFIG_DEFAULT_DEVICE_TREE="rk3566-anbernic-rgxx3"
+CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3566-anbernic-rg353p"
 CONFIG_ROCKCHIP_RK3568=y
 CONFIG_ROCKCHIP_RK8XX_DISABLE_BOOT_ON_POWERON=y
 CONFIG_SPL_SERIAL=y
@@ -19,8 +19,10 @@ CONFIG_SPL_LOAD_FIT=y
 CONFIG_LEGACY_IMAGE_FORMAT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-anbernic-rgxx3.dtb"
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-anbernic-rg353p.dtb"
+CONFIG_DISABLE_CONSOLE=y
 # CONFIG_CONSOLE_MUX is not set
+CONFIG_BOARD_TYPES=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_BOARD_RNG_SEED=y
@@ -38,13 +40,14 @@ CONFIG_CMD_MMC=y
 # CONFIG_SPL_DOS_PARTITION is not set
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
-# CONFIG_OF_UPSTREAM is not set
+CONFIG_OF_LIST="rockchip/rk3566-anbernic-rg353p rockchip/rk3566-anbernic-rg353v rockchip/rk3566-anbernic-rg503 rockchip/rk3566-anbernic-rg-arc-d rockchip/rk3566-anbernic-rg353ps rockchip/rk3566-anbernic-rg353vs rockchip/rk3566-anbernic-rg-arc-s rockchip/rk3566-powkiddy-rgb30 rockchip/rk3566-powkiddy-rk2023 rockchip/rk3566-powkiddy-rgb10max3"
 CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 # CONFIG_NET is not set
 CONFIG_SPL_DM_SEQ_ALIAS=y
 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
@@ -70,6 +73,7 @@ CONFIG_SPL_RAM=y
 # CONFIG_RAM_ROCKCHIP_DEBUG is not set
 # CONFIG_RNG_SMCCC_TRNG is not set
 CONFIG_BAUDRATE=1500000
+# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550_MEM32=y
 CONFIG_SYSRESET=y
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/3 board: rockchip: Add vdd_cpu reg fixup for RGXX3 Series

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

Some of the Powkiddy devices switched to using a different vendor for the vdd_cpu regulator. Unfortunately the device does not have a new revision to denote this, so users have no way of knowing in advance.

Add code to detect if a device is present at addresses 0x1c or 0x40 on the i2c0 bus and update the devicetree if needed.

---
 board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 147 +++++++++++++++++++++
 1 file changed, 147 insertions(+)
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +147 -0
index 224019f9ba3..c1d1826fd14 100644
@@ -43,6 +43,7 @@ struct rg3xx_model {
 	const char *board_name;
 	const char *fdtfile;
 	const bool detect_panel;
+	const bool detect_regulator;
 	const bool uart_con;
 };
 
@@ -69,6 +70,7 @@ static const struct rg3xx_model rg3xx_model_details[] = {
 		/* Device is identical to RG353P. */
 		.fdtfile = DTB_DIR "rk3566-anbernic-rg353p.dtb",
 		.detect_panel = 1,
+		.detect_regulator = 0,
 		.uart_con = 1,
 	},
 	[RG353P] = {
@@ -77,6 +79,7 @@ static const struct rg3xx_model rg3xx_model_details[] = {
 		.board_name = "Anbernic RG353P",
 		.fdtfile = DTB_DIR "rk3566-anbernic-rg353p.dtb",
 		.detect_panel = 1,
+		.detect_regulator = 0,
 		.uart_con = 1,
 	},
 	[RG353V] = {
@@ -85,6 +88,7 @@ static const struct rg3xx_model rg3xx_model_details[] = {
 		.board_name = "Anbernic RG353V",
 		.fdtfile = DTB_DIR "rk3566-anbernic-rg353v.dtb",
 		.detect_panel = 1,
+		.detect_regulator = 0,
 		.uart_con = 1,
 	},
 	[RG503] = {
@@ -93,6 +97,7 @@ static const struct rg3xx_model rg3xx_model_details[] = {
 		.board_name = "Anbernic RG503",
 		.fdtfile = DTB_DIR "rk3566-anbernic-rg503.dtb",
 		.detect_panel = 0,
+		.detect_regulator = 0,
 		.uart_con = 1,
 	},
 	[RGB30] = {
@@ -101,6 +106,7 @@ static const struct rg3xx_model rg3xx_model_details[] = {
 		.board_name = "Powkiddy RGB30",
 		.fdtfile = DTB_DIR "rk3566-powkiddy-rgb30.dtb",
 		.detect_panel = 0,
+		.detect_regulator = 1,
 		.uart_con = 0,
 	},
 	[RK2023] = {
@@ -109,6 +115,7 @@ static const struct rg3xx_model rg3xx_model_details[] = {
 		.board_name = "Powkiddy RK2023",
 		.fdtfile = DTB_DIR "rk3566-powkiddy-rk2023.dtb",
 		.detect_panel = 0,
+		.detect_regulator = 1,
 		.uart_con = 0,
 	},
 	[RGARCD] = {
@@ -117,6 +124,7 @@ static const struct rg3xx_model rg3xx_model_details[] = {
 		.board_name = "Anbernic RG ARC-D",
 		.fdtfile = DTB_DIR "rk3566-anbernic-rg-arc-d.dtb",
 		.detect_panel = 0,
+		.detect_regulator = 0,
 		.uart_con = 1,
 	},
 	[RGB10MAX3] = {
@@ -125,6 +133,7 @@ static const struct rg3xx_model rg3xx_model_details[] = {
 		.board_name = "Powkiddy RGB10MAX3",
 		.fdtfile = DTB_DIR "rk3566-powkiddy-rgb10max3.dtb",
 		.detect_panel = 0,
+		.detect_regulator = 1,
 		.uart_con = 0,
 	},
 	/* Devices with duplicate ADC value */
@@ -134,6 +143,7 @@ static const struct rg3xx_model rg3xx_model_details[] = {
 		.board_name = "Anbernic RG353PS",
 		.fdtfile = DTB_DIR "rk3566-anbernic-rg353ps.dtb",
 		.detect_panel = 1,
+		.detect_regulator = 0,
 		.uart_con = 1,
 	},
 	[RG353VS] = {
@@ -142,6 +152,7 @@ static const struct rg3xx_model rg3xx_model_details[] = {
 		.board_name = "Anbernic RG353VS",
 		.fdtfile = DTB_DIR "rk3566-anbernic-rg353vs.dtb",
 		.detect_panel = 1,
+		.detect_regulator = 0,
 		.uart_con = 1,
 	},
 	[RGARCS] = {
@@ -150,6 +161,7 @@ static const struct rg3xx_model rg3xx_model_details[] = {
 		.board_name = "Anbernic RG ARC-S",
 		.fdtfile = DTB_DIR "rk3566-anbernic-rg-arc-s.dtb",
 		.detect_panel = 0,
+		.detect_regulator = 0,
 		.uart_con = 1,
 	},
 };
@@ -172,6 +184,22 @@ static const struct rg353_panel rg353_panel_details[] = {
 	},
 };
 
+struct powkiddy_regulators {
+	const u8 addr;
+	const char *regulator_compat;
+};
+
+static const struct powkiddy_regulators regulator_details[] = {
+	{
+		.addr = 0x1c,
+		.regulator_compat = "tcs,tcs4525",
+	},
+	{
+		.addr = 0x40,
+		.regulator_compat = "fcs,fan53555",
+	},
+};
+
 /*
  * Start LED very early so user knows device is on. Set color
  * to red.
@@ -361,6 +389,44 @@ int rgxx3_detect_display(void)
 	return 0;
 }
 
+/*
+ * Some of the Powkiddy devices switched the CPU regulator, but users
+ * are not able to determine this by looking at their hardware.
+ * Attempt to auto-detect this situation and fixup the device-tree.
+ */
+int rgxx3_detect_regulator(void)
+{
+	struct udevice *bus;
+	struct udevice *chip;
+	u8 val;
+	int ret;
+
+	/* Get the correct i2c bus (i2c0). */
+	ret = uclass_get_device_by_name(UCLASS_I2C,
+					"i2c@fdd40000", &bus);
+	if (ret)
+		return ret;
+
+	/*
+	 * Check for all vdd_cpu regulators and read an arbitrary
+	 * register to confirm it's present.
+	 */
+	for (int i = 0; i < ARRAY_SIZE(regulator_details); i++) {
+		ret = i2c_get_chip(bus, regulator_details[i].addr,
+				   1, &chip);
+		if (ret)
+			return ret;
+
+		ret = dm_i2c_read(chip, 0, &val, 1);
+		if (!ret) {
+			env_set("vdd_cpu", regulator_details[i].regulator_compat);
+			break;
+		}
+	}
+
+	return 0;
+}
+
 int rgxx3_read_board_id(void)
 {
 	u32 adc_info;
@@ -485,6 +551,16 @@ int rk_board_late_init(void)
 			printf("Failed to detect panel type\n");
 	}
 
+	/*
+	 * Skip vdd_cpu regulator detection if not needed. Warn but
+	 * don't fail for errors in auto-detection of regulator.
+	 */
+	if (rg3xx_model_details[gd->board_type].detect_regulator) {
+		ret = rgxx3_detect_regulator();
+		if (ret)
+			printf("Unable to detect vdd_cpu regulator\n");
+	}
+
 end:
 	/* Turn off red LED and turn on orange LED. */
 	writel(GPIO_WRITEMASK(GPIO_C7 | GPIO_C6 | GPIO_C5) | GPIO_C6,
@@ -547,6 +623,71 @@ int rgxx3_panel_fixup(void *blob)
 	return 0;
 }
 
+int rgxx3_regulator_fixup(void *blob)
+{
+	const struct powkiddy_regulators *vdd_cpu = NULL;
+	int node, ret, i;
+	char path[] = "/i2c@fdd40000/regulator@00";
+	char name[] = "regulator@00";
+	char *env;
+
+	env = env_get("vdd_cpu");
+	if (!env) {
+		printf("Can't get vdd_cpu env\n");
+		return -EINVAL;
+	}
+
+	/*
+	 * Find the device we have in our tree, which may or may not
+	 * be present.
+	 */
+	for (i = 0; i < ARRAY_SIZE(regulator_details); i++) {
+		sprintf(path, "/i2c@fdd40000/regulator@%02x",
+			regulator_details[i].addr);
+		node = fdt_path_offset(blob, path);
+		if (node > 0)
+			break;
+
+		printf("Unable to find vdd_cpu\n");
+		return -ENODEV;
+	}
+
+	node = fdt_path_offset(blob, path);
+	if (!(node > 0)) {
+		printf("Can't find the vdd_cpu node\n");
+		return -ENODEV;
+	}
+
+	ret = fdt_node_check_compatible(blob, node, env);
+	if (ret < 0)
+		return -ENODEV;
+
+	/* vdd_cpu regulators match, return 0. */
+	if (!ret)
+		return 0;
+
+	/* Regulators don't match, search by first compatible value. */
+	for (i = 0; i < ARRAY_SIZE(regulator_details); i++) {
+		if (!strcmp(env, regulator_details[i].regulator_compat)) {
+			vdd_cpu = &regulator_details[i];
+			break;
+		}
+	}
+
+	if (!vdd_cpu) {
+		printf("Unable to identify vdd_cpu by compat string\n");
+		return -ENODEV;
+	}
+
+	/* Set the compatible and reg with the auto-detected values */
+	fdt_setprop_string(blob, node, "compatible", vdd_cpu->regulator_compat);
+	fdt_setprop_u32(blob, node, "reg", vdd_cpu->addr);
+	sprintf(name, "regulator@%02x", vdd_cpu->addr);
+	fdt_set_name(blob, node, name);
+
+	return 0;
+}
+
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
 	int ret;
@@ -562,6 +703,12 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 			printf("Unable to update panel compat\n");
 	}
 
+	if (rg3xx_model_details[gd->board_type].detect_regulator) {
+		ret = rgxx3_regulator_fixup(blob);
+		if (ret)
+			printf("Unable to update vdd_cpu compat\n");
+	}
+
 	return 0;
 }
 
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/3 board: rockchip: Fix panel detection for mainline A-TF

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

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.

---
 board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 13 +++++++++++++
 configs/anbernic-rgxx3-rk3566_defconfig    |  2 --
 2 files changed, 13 insertions(+), 2 deletions(-)
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +13 -0
index c1d1826fd14..f4e7c1ab360 100644
@@ -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.
configs/anbernic-rgxx3-rk3566_defconfig +0 -2
index f5e5470df8c..49d3766613e 100644
@@ -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
Signature · 1 line
2.34.1
#4 lore raw

Re: [PATCH 3/3] board: rockchip: Fix panel detection for mainline A-TF

Hi Chris,

Please update the subject with something like "Enable the VO PD before driver access",

and the commit message for the change reason is enough.

and the config is more soc level, I think you can add this to arch_cpu_init() for we don't have a power domain driver.

Quoted 31 lines · Chris Morgan

From: Chris Morgan <[email protected]>

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.

---
  board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 13 +++++++++++++
  configs/anbernic-rgxx3-rk3566_defconfig    |  2 --
  2 files changed, 13 insertions(+), 2 deletions(-)
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +4 -0
index c1d1826fd14..f4e7c1ab360 100644
@@ -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

board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c int rgxx3_detect_display(void) · line 318

Quoted 4 lines
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +1 -0
@@ -311,6 +315,15 @@ int rgxx3_detect_display(void)
  	int i;
  	u8 panel_id[2];
 
+	/* Disable VO power domain power-down */

Disable?

Quoted 16 lines
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +8 -0
+	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.
configs/anbernic-rgxx3-rk3566_defconfig +0 -0
index f5e5470df8c..49d3766613e 100644

configs/anbernic-rgxx3-rk3566_defconfig CONFIG_SPL_REGMAP=y · line 53

Quoted 5 lines
configs/anbernic-rgxx3-rk3566_defconfig +0 -2
@@ -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

This should be a separate patch, and what's the change?

Thanks,

- Kever

Quoted 3 lines
configs/anbernic-rgxx3-rk3566_defconfig +0 -0
  CONFIG_ROCKCHIP_GPIO=y
  CONFIG_SYS_I2C_ROCKCHIP=y
  CONFIG_MISC=y
#5 lore raw

Re: [PATCH 3/3] board: rockchip: Fix panel detection for mainline A-TF

Quoted 9 lines · Kever Yang

Hi Chris,

Please update the subject with something like "Enable the VO PD before driver access",

and the commit message for the change reason is enough.

and the config is more soc level, I think you can add this to arch_cpu_init() for we don't have a power domain driver.

To my knowledge I'm the only board trying to access the video before Linux proper. Do you want me to add this for all rk3568 boards then (from within rk3568.c under arch_cpu_init() as you say)? I'm thinking if I do though I can at least get rid of the memory barrier.

Quoted 27 lines · Chris Morgan
Quoted 25 lines

From: Chris Morgan <[email protected]>

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.

---
  board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 13 +++++++++++++
  configs/anbernic-rgxx3-rk3566_defconfig    |  2 --
  2 files changed, 13 insertions(+), 2 deletions(-)
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +4 -0
index c1d1826fd14..f4e7c1ab360 100644
@@ -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)
+
Quoted 8 lines

board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c int rgxx3_detect_display(void) · line 317

Quoted 7 lines
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +1 -0
  #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 */

Disable?

It's weird verbiage but the data sheet says "Enable power down PD_VO" by writing a 1, so I figure I'm disabling it by writing a 0.

Quoted 15 lines
Quoted 15 lines
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +8 -0
+	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.
configs/anbernic-rgxx3-rk3566_defconfig +0 -0
index f5e5470df8c..49d3766613e 100644
Quoted 10 lines

configs/anbernic-rgxx3-rk3566_defconfig CONFIG_SPL_REGMAP=y · line 53

Quoted 6 lines
configs/anbernic-rgxx3-rk3566_defconfig +0 -2
@@ -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

This should be a separate patch, and what's the change?

Mainline A-TF seems to get angry with U-Boot when these are enabled. By angry I mean it freezes. It's all a related change to allowing mainline A-TF, though I should probably call it out better as a required change. Again I also specify though in the commit message that mainline A-TF still doesn't work with Linux proper because of the missing psci clk and psci reset bits, but at least with this change U-Boot won't be contributing to the problem (for this board).

Quoted 7 lines

Thanks,

- Kever

Quoted 3 lines
configs/anbernic-rgxx3-rk3566_defconfig +0 -0
  CONFIG_ROCKCHIP_GPIO=y
  CONFIG_SYS_I2C_ROCKCHIP=y
  CONFIG_MISC=y

Thank you,
Chris

#6 lore raw

Re: [PATCH 3/3] board: rockchip: Fix panel detection for mainline A-TF

Hi Chris,

Quoted 6 lines · Chris Morgan
Quoted 5 lines · Kever Yang

Hi Chris,

Please update the subject with something like "Enable the VO PD before driver access",

Quoted 7 lines
Quoted 4 lines

and the commit message for the change reason is enough.

and the config is more soc level, I think you can add this to arch_cpu_init() for we don't have a power domain driver.

To my knowledge I'm the only board trying to access the video before Linux proper. Do you want me to add this for all rk3568 boards then (from within rk3568.c under arch_cpu_init() as you say)?

Yes, please move it to rk3568.c in case other board need it.

Quoted 37 lines

I'm thinking
if I do though I can at least get rid of the memory barrier.

Quoted 26 lines · Chris Morgan
Quoted 25 lines

From: Chris Morgan <[email protected]>

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.

---
   board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 13 +++++++++++++
   configs/anbernic-rgxx3-rk3566_defconfig    |  2 --
   2 files changed, 13 insertions(+), 2 deletions(-)
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +4 -0
index c1d1826fd14..f4e7c1ab360 100644
@@ -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)
+
Quoted 8 lines

board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c int rgxx3_detect_display(void) · line 317

Quoted 7 lines
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +1 -0
   #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 */

Disable?

Quoted 2 lines

It's weird verbiage but the data sheet says "Enable power down PD_VO" by writing a 1, so I figure I'm disabling it by writing a 0.

OK, understand now.

To make it simple and clear, could you just say "Enable PD_VO for display"?

Quoted 25 lines
Quoted 15 lines
Quoted 15 lines
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +8 -0
+	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.
configs/anbernic-rgxx3-rk3566_defconfig +0 -1
index f5e5470df8c..49d3766613e 100644
--- a/configs/anbernic-rgxx3-rk3566_defconfig
Quoted 10 lines

configs/anbernic-rgxx3-rk3566_defconfig CONFIG_SPL_REGMAP=y · line 53

Quoted 7 lines

+++ b/configs/anbernic-rgxx3-rk3566_defconfig

configs/anbernic-rgxx3-rk3566_defconfig +0 -2
@@ -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

This should be a separate patch, and what's the change?

Quoted 7 lines

Mainline A-TF seems to get angry with U-Boot when these are enabled. By angry I mean it freezes. It's all a related change to allowing mainline A-TF, though I should probably call it out better as a required change. Again I also specify though in the commit message that mainline A-TF still doesn't work with Linux proper because of the missing psci clk and psci reset bits, but at least with this change U-Boot won't be contributing to the problem (for this board).

The scmi clock is missing on rk3568 mainline A-TF now, but it should return error with something like

NOT SUPPORT instead of hang inside.

Any way, this is a separate change, we don't need it if the ATF supports scmi clock later.

Thanks,

- Kever

Quoted 9 lines
Quoted 7 lines

Thanks,

- Kever

Quoted 3 lines
configs/anbernic-rgxx3-rk3566_defconfig +0 -0
   CONFIG_ROCKCHIP_GPIO=y
   CONFIG_SYS_I2C_ROCKCHIP=y
   CONFIG_MISC=y

Thank you,
Chris

#7 lore raw

Re: [PATCH 3/3] board: rockchip: Fix panel detection for mainline A-TF

Quoted 97 lines · Kever Yang

Hi Chris,

Quoted 6 lines · Chris Morgan
Quoted 5 lines · Kever Yang

Hi Chris,

Please update the subject with something like "Enable the VO PD before driver access",

Quoted 7 lines
Quoted 4 lines

and the commit message for the change reason is enough.

and the config is more soc level, I think you can add this to arch_cpu_init() for we don't have a power domain driver.

To my knowledge I'm the only board trying to access the video before Linux proper. Do you want me to add this for all rk3568 boards then (from within rk3568.c under arch_cpu_init() as you say)?

Yes, please move it to rk3568.c in case other board need it.

Quoted 37 lines

I'm thinking
if I do though I can at least get rid of the memory barrier.

Quoted 26 lines · Chris Morgan
Quoted 25 lines

From: Chris Morgan <[email protected]>

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.

---
   board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 13 +++++++++++++
   configs/anbernic-rgxx3-rk3566_defconfig    |  2 --
   2 files changed, 13 insertions(+), 2 deletions(-)
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +4 -0
index c1d1826fd14..f4e7c1ab360 100644
@@ -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)
+
Quoted 8 lines

board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c int rgxx3_detect_display(void) · line 317

Quoted 7 lines
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +1 -0
   #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 */

Disable?

Quoted 2 lines

It's weird verbiage but the data sheet says "Enable power down PD_VO" by writing a 1, so I figure I'm disabling it by writing a 0.

OK, understand now.

To make it simple and clear, could you just say "Enable PD_VO for display"?

Quoted 25 lines
Quoted 15 lines
Quoted 15 lines
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +8 -0
+	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.
configs/anbernic-rgxx3-rk3566_defconfig +0 -1
index f5e5470df8c..49d3766613e 100644
--- a/configs/anbernic-rgxx3-rk3566_defconfig
Quoted 10 lines

configs/anbernic-rgxx3-rk3566_defconfig CONFIG_SPL_REGMAP=y · line 53

Quoted 7 lines

+++ b/configs/anbernic-rgxx3-rk3566_defconfig

configs/anbernic-rgxx3-rk3566_defconfig +0 -2
@@ -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

This should be a separate patch, and what's the change?

Quoted 7 lines

Mainline A-TF seems to get angry with U-Boot when these are enabled. By angry I mean it freezes. It's all a related change to allowing mainline A-TF, though I should probably call it out better as a required change. Again I also specify though in the commit message that mainline A-TF still doesn't work with Linux proper because of the missing psci clk and psci reset bits, but at least with this change U-Boot won't be contributing to the problem (for this board).

The scmi clock is missing on rk3568 mainline A-TF now, but it should return error with something like

Quoted 8 lines

NOT SUPPORT instead of hang inside.

Any way, this is a separate change, we don't need it if the ATF supports scmi clock later.

Thanks,

- Kever

I'll opt to disable this for now anyway (but in a commit by itself), if that's okay. It makes no difference for booting when using binary A-TF, but it does make a difference when using the *current* mainline A-TF, even if we do get SCMI later.

Thank you,
Chris

Quoted 10 lines
Quoted 10 lines
Quoted 8 lines

Thanks,

- Kever

Quoted 3 lines
configs/anbernic-rgxx3-rk3566_defconfig +0 -0
   CONFIG_ROCKCHIP_GPIO=y
   CONFIG_SYS_I2C_ROCKCHIP=y
   CONFIG_MISC=y

Thank you,
Chris

#8 lore raw

Re: [PATCH 3/3] board: rockchip: Fix panel detection for mainline A-TF

Quoted 100 lines · Chris Morgan
Quoted 99 lines · Kever Yang

Hi Chris,

Quoted 6 lines · Chris Morgan
Quoted 5 lines · Kever Yang

Hi Chris,

Please update the subject with something like "Enable the VO PD before driver access",

Quoted 7 lines
Quoted 4 lines

and the commit message for the change reason is enough.

and the config is more soc level, I think you can add this to arch_cpu_init() for we don't have a power domain driver.

To my knowledge I'm the only board trying to access the video before Linux proper. Do you want me to add this for all rk3568 boards then (from within rk3568.c under arch_cpu_init() as you say)?

Yes, please move it to rk3568.c in case other board need it.

Quoted 37 lines

I'm thinking
if I do though I can at least get rid of the memory barrier.

Quoted 26 lines · Chris Morgan
Quoted 25 lines

From: Chris Morgan <[email protected]>

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.

---
    board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 13 +++++++++++++
    configs/anbernic-rgxx3-rk3566_defconfig    |  2 --
    2 files changed, 13 insertions(+), 2 deletions(-)
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +4 -0
index c1d1826fd14..f4e7c1ab360 100644
@@ -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)
+
Quoted 8 lines

board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c int rgxx3_detect_display(void) · line 317

Quoted 7 lines
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +1 -0
    #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 */

Disable?

Quoted 2 lines

It's weird verbiage but the data sheet says "Enable power down PD_VO" by writing a 1, so I figure I'm disabling it by writing a 0.

OK, understand now.

To make it simple and clear, could you just say "Enable PD_VO for display"?

Quoted 24 lines
Quoted 14 lines
Quoted 14 lines
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +8 -0
+	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.
configs/anbernic-rgxx3-rk3566_defconfig +0 -1
index f5e5470df8c..49d3766613e 100644
--- a/configs/anbernic-rgxx3-rk3566_defconfig
Quoted 10 lines

configs/anbernic-rgxx3-rk3566_defconfig CONFIG_SPL_REGMAP=y · line 53

Quoted 7 lines

+++ b/configs/anbernic-rgxx3-rk3566_defconfig

configs/anbernic-rgxx3-rk3566_defconfig +0 -2
@@ -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

This should be a separate patch, and what's the change?

Quoted 7 lines

Mainline A-TF seems to get angry with U-Boot when these are enabled. By angry I mean it freezes. It's all a related change to allowing mainline A-TF, though I should probably call it out better as a required change. Again I also specify though in the commit message that mainline A-TF still doesn't work with Linux proper because of the missing psci clk and psci reset bits, but at least with this change U-Boot won't be contributing to the problem (for this board).

The scmi clock is missing on rk3568 mainline A-TF now, but it should return error with something like

NOT SUPPORT instead of hang inside.

Any way, this is a separate change, we don't need it if the ATF supports scmi clock later.

Quoted 7 lines
Quoted 3 lines

Thanks,

- Kever

I'll opt to disable this for now anyway (but in a commit by itself), if that's okay. It makes no difference for booting when using binary A-TF, but it does make a difference when using the *current* mainline A-TF, even if we do get SCMI later.

Could you try with below  patch for rk3568 SCMI support:

https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/31265

Thanks,

- Kever

Quoted 13 lines

Thank you,
Chris

Quoted 9 lines
Quoted 9 lines
Quoted 7 lines

Thanks,

- Kever

Quoted 3 lines
configs/anbernic-rgxx3-rk3566_defconfig +0 -0
    CONFIG_ROCKCHIP_GPIO=y
    CONFIG_SYS_I2C_ROCKCHIP=y
    CONFIG_MISC=y

Thank you,
Chris

#9 lore raw

Re: [PATCH 3/3] board: rockchip: Fix panel detection for mainline A-TF

Quoted 105 lines · Kever Yang
Quoted 103 lines · Chris Morgan
Quoted 102 lines · Kever Yang

Hi Chris,

Quoted 6 lines · Chris Morgan
Quoted 5 lines · Kever Yang

Hi Chris,

Please update the subject with something like "Enable the VO PD before driver access",

Quoted 7 lines
Quoted 4 lines

and the commit message for the change reason is enough.

and the config is more soc level, I think you can add this to arch_cpu_init() for we don't have a power domain driver.

To my knowledge I'm the only board trying to access the video before Linux proper. Do you want me to add this for all rk3568 boards then (from within rk3568.c under arch_cpu_init() as you say)?

Yes, please move it to rk3568.c in case other board need it.

Quoted 37 lines

I'm thinking
if I do though I can at least get rid of the memory barrier.

Quoted 26 lines · Chris Morgan
Quoted 25 lines

From: Chris Morgan <[email protected]>

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.

---
    board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 13 +++++++++++++
    configs/anbernic-rgxx3-rk3566_defconfig    |  2 --
    2 files changed, 13 insertions(+), 2 deletions(-)
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +4 -0
index c1d1826fd14..f4e7c1ab360 100644
@@ -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)
+
Quoted 8 lines

board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c int rgxx3_detect_display(void) · line 317

Quoted 7 lines
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +1 -0
    #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 */

Disable?

Quoted 2 lines

It's weird verbiage but the data sheet says "Enable power down PD_VO" by writing a 1, so I figure I'm disabling it by writing a 0.

OK, understand now.

To make it simple and clear, could you just say "Enable PD_VO for display"?

Quoted 24 lines
Quoted 14 lines
Quoted 14 lines
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c +8 -0
+	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.
configs/anbernic-rgxx3-rk3566_defconfig +0 -1
index f5e5470df8c..49d3766613e 100644
--- a/configs/anbernic-rgxx3-rk3566_defconfig
Quoted 10 lines

configs/anbernic-rgxx3-rk3566_defconfig CONFIG_SPL_REGMAP=y · line 53

Quoted 7 lines

+++ b/configs/anbernic-rgxx3-rk3566_defconfig

configs/anbernic-rgxx3-rk3566_defconfig +0 -2
@@ -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

This should be a separate patch, and what's the change?

Quoted 7 lines

Mainline A-TF seems to get angry with U-Boot when these are enabled. By angry I mean it freezes. It's all a related change to allowing mainline A-TF, though I should probably call it out better as a required change. Again I also specify though in the commit message that mainline A-TF still doesn't work with Linux proper because of the missing psci clk and psci reset bits, but at least with this change U-Boot won't be contributing to the problem (for this board).

The scmi clock is missing on rk3568 mainline A-TF now, but it should return error with something like

NOT SUPPORT instead of hang inside.

Any way, this is a separate change, we don't need it if the ATF supports scmi clock later.

Thanks,

- Kever

Quoted 8 lines
Quoted 4 lines

I'll opt to disable this for now anyway (but in a commit by itself), if that's okay. It makes no difference for booting when using binary A-TF, but it does make a difference when using the *current* mainline A-TF, even if we do get SCMI later.

Could you try with below  patch for rk3568 SCMI support:

https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/31265

I did. We still need this specific patch to call the panel in U-Boot (so I can detect it and fix-up the device tree). I noted a few issues I identified on that commit; they may or may not be related to the specific commit at hand though since it was the first time I could boot my devices with mainline A-TF.

Thank you,
Chris

Quoted 19 lines

Thanks,

- Kever

Quoted 13 lines

Thank you,
Chris

Quoted 9 lines
Quoted 9 lines
Quoted 7 lines

Thanks,

- Kever

Quoted 3 lines
configs/anbernic-rgxx3-rk3566_defconfig +0 -0
    CONFIG_ROCKCHIP_GPIO=y
    CONFIG_SYS_I2C_ROCKCHIP=y
    CONFIG_MISC=y

Thank you,
Chris