pmaports/temp/u-boot-pinephone/0001-expose-DRAM-clock-speed.patch
Bobby The Builder ba84cd8d49
temp/u-boot-pinephone: expose ram_freq in device tree (MR 1998)
Query the ram clock:
cat /proc/device-tree/memory/ram_freq
2021-04-05 11:14:17 +02:00

52 lines
1.3 KiB
Diff

From b94ee51a5d818e55b3288d2fa3cbc27837981307 Mon Sep 17 00:00:00 2001
From: Bobby The Builder <bob@najdan.com>
Date: Mon, 29 Mar 2021 16:42:07 -0400
Subject: [PATCH] expose DRAM clock speed
---
common/board_f.c | 6 ++++--
common/main.c | 7 +++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/common/board_f.c b/common/board_f.c
index 9f441c44f1..8e005337e6 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -226,12 +226,14 @@ static int show_dram_config(void)
print_size(gd->bd->bi_dram[i].size, "\n");
#endif
}
- debug("\nDRAM: ");
+ debug("\nDRAM Size: ");
print_size(size, "");
board_add_ram_info(0);
putc('\n');
-
+#if defined(CONFIG_DRAM_CLK)
+ printf("DRAM Clock: %d MHz\n", CONFIG_DRAM_CLK);
+#endif
return 0;
}
diff --git a/common/main.c b/common/main.c
index 4b3cd302c3..1dbb44060d 100644
--- a/common/main.c
+++ b/common/main.c
@@ -45,6 +45,13 @@ void main_loop(void)
if (IS_ENABLED(CONFIG_VERSION_VARIABLE))
env_set("ver", version_string); /* set version variable */
+#if defined(CONFIG_DRAM_CLK)
+ char ram_clk_string[11];
+ sprintf(ram_clk_string, "%d", CONFIG_DRAM_CLK);
+ int ret = env_set("ram_freq", ram_clk_string);
+ printf("Set ram_freq : %s\n", ram_clk_string);
+#endif
+
cli_init();
if (IS_ENABLED(CONFIG_USE_PREBOOT))
--
2.30.2