[U-Boot] [PATCH 12/12] da850: print DDR frequency from u-boot
nagabhushana.netagunte at ti.com
nagabhushana.netagunte at ti.com
Tue Aug 2 17:43:12 CEST 2011
From: Nagabhushana Netagunte <nagabhushana.netagunte at ti.com>
Print DDR frequency when u-boot is coming up. Function
is added in hardware.h to find which PLL clock is used.
Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj at ti.com>
Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte at ti.com>
---
arch/arm/include/asm/arch-davinci/hardware.h | 16 ++++++++++++++--
board/davinci/da8xxevm/da850evm.c | 1 +
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/arch-davinci/hardware.h b/arch/arm/include/asm/arch-davinci/hardware.h
index fda8203..e0473c9 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -35,7 +35,7 @@
#include <config.h>
#include <asm/sizes.h>
-
+#include <asm/io.h>
#define REG(addr) (*(volatile unsigned int *)(addr))
#define REG_P(addr) ((volatile unsigned int *)(addr))
@@ -381,8 +381,14 @@ struct davinci_pllc_regs {
#define DAVINCI_PLLC_DIV_MASK 0x1f
#define ASYNC3 get_async3_src()
-#define PLL1_SYSCLK2 ((1 << 16) | 0x2)
+#define EMIFB get_emifb_src()
+
+#define PLL1_PLLM ((1 << 16) | DAVINCI_PLLM_CLKID)
+#define PLL1_SYSCLK1 ((1 << 16) | 0x1)
+#define PLL1_SYSCLK2 ((1 << 16) | 0x2)
#define DAVINCI_SPI1_CLKID (cpu_is_da830() ? 2 : ASYNC3)
+#define DAVINCI_DDR_CLKID EMIFB
+
/* Clock IDs */
enum davinci_clk_ids {
DAVINCI_SPI0_CLKID = 2,
@@ -486,6 +492,12 @@ static inline int get_async3_src(void)
PLL1_SYSCLK2 : 2;
}
+static inline int get_emifb_src(void)
+{
+ return (readl(&davinci_syscfg_regs->cfgchip3) & 0x80) ?
+ PLL1_PLLM : PLL1_SYSCLK1;
+}
+
#endif /* CONFIG_SOC_DA8XX */
#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index a0b4425..3a4f041 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -507,6 +507,7 @@ int misc_init_r(void)
int ret;
printf("ARM Clock : %d Hz\n", clk_get(DAVINCI_ARM_CLKID));
+ printf("DDR Clock : %d Hz\n", clk_get(DAVINCI_DDR_CLKID)/2);
if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
/* Read Ethernet MAC address from EEPROM */
--
1.6.2.4
More information about the U-Boot
mailing list