[PATCH 6/6] DONOTMERGE: For testing only

Aniket Limaye a-limaye at ti.com
Thu Oct 17 08:29:13 CEST 2024


From: Reid Tonking <reidt at ti.com>

This just provides some useful print outs and the proper config to
test the functionality. For J7200 boards that do not have efuse
burned in, the hardcoded 760000 is needed in the vd_data, since
it would be populated otherwise

Signed-off-by: Reid Tonking <reidt at ti.com>
Signed-off-by: Aniket Limaye <a-limaye at ti.com>
---
 arch/arm/mach-k3/j721e/j721e_init.c | 9 +++++++++
 configs/j7200_evm_r5_defconfig      | 2 +-
 drivers/misc/k3_avs.c               | 4 +++-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-k3/j721e/j721e_init.c b/arch/arm/mach-k3/j721e/j721e_init.c
index 0620759c36c..19865f7dd40 100644
--- a/arch/arm/mach-k3/j721e/j721e_init.c
+++ b/arch/arm/mach-k3/j721e/j721e_init.c
@@ -152,6 +152,8 @@ int fix_freq(const void *fdt)
 {
 		int node, ret;
 		u32 opp_low_freq[3];
+		int len;
+		const u32 *reg;
 
 		node = fdt_node_offset_by_compatible(fdt, -1, "ti,am654-rproc");
 			if (node < 0) {
@@ -159,6 +161,11 @@ int fix_freq(const void *fdt)
 				return node;
 			}
 
+		/* check freqs */
+		reg = fdt_getprop(fdt, node, "assigned-clock-rates", &len);
+		printf("OPP_NOM: arm_clk:%d | gtc_clk:%d | msmc_clk:%d\n",
+				fdt32_to_cpu(reg[0]), fdt32_to_cpu(reg[1]), fdt32_to_cpu(reg[2]));
+
 		/* j7200 opp low values according to data sheet */
 		opp_low_freq[0] = cpu_to_fdt32(1000000000); /* 202-2 -> A72SS0_CORE0_0_ARM_CLK */
 		opp_low_freq[1] = cpu_to_fdt32(200000000); /* 61-1 -> GTC0_GTC_CLK */
@@ -170,6 +177,8 @@ int fix_freq(const void *fdt)
 				printf("%s: Can not set value\n", __func__);
 				return ret;
 			}
+		printf("OPP_LOW: arm_clk:%d | gtc_clk:%d | msmc_clk:%d\n",
+				fdt32_to_cpu(opp_low_freq[0]), fdt32_to_cpu(opp_low_freq[1]), fdt32_to_cpu(opp_low_freq[2]));
 
 		return 0;
 }
diff --git a/configs/j7200_evm_r5_defconfig b/configs/j7200_evm_r5_defconfig
index 7d43d8d702a..6fdf34c9644 100644
--- a/configs/j7200_evm_r5_defconfig
+++ b/configs/j7200_evm_r5_defconfig
@@ -103,7 +103,7 @@ CONFIG_K3_SEC_PROXY=y
 CONFIG_FS_LOADER=y
 CONFIG_SPL_FS_LOADER=y
 CONFIG_K3_AVS0=y
-# CONFIG_K3_OPP_LOW is not set
+CONFIG_K3_OPP_LOW=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_SPL_MMC_HS400_SUPPORT=y
 CONFIG_MMC_SDHCI=y
diff --git a/drivers/misc/k3_avs.c b/drivers/misc/k3_avs.c
index 932b355a5c1..e93aa267d51 100644
--- a/drivers/misc/k3_avs.c
+++ b/drivers/misc/k3_avs.c
@@ -121,6 +121,8 @@ static int k3_avs_program_voltage(struct k3_avs_privdata *priv,
 	if (!vd->supply)
 		return -ENODEV;
 
+  printf("Program voltage: opp_id:%d | opp_volt:%d\n", opp_id, volt);
+
 	if (!volt) {
 		dev_err(priv->dev, "Fuse is not set for selected opp %d\n", opp_id);
 		return -EINVAL;
@@ -532,7 +534,7 @@ static struct vd_data j721e_vd_data[] = {
 		.clk_id = 2, /* ARM clock */
 		.opps = {
 			[AM6_OPP_LOW] = {
-				.volt = 0, /* voltage TBD after OPP fuse reading */
+				.volt = 760000, /* voltage TBD after OPP fuse reading */
 				.freq = 1000000000,
 			},
 			[AM6_OPP_NOM] = {
-- 
2.34.1



More information about the U-Boot mailing list