]> git.sur5r.net Git - u-boot/commitdiff
DaVinci DA8xx: replace magic number for DDR speed
authorLaurence Withers <lwithers@guralp.com>
Mon, 30 Jul 2012 23:30:36 +0000 (23:30 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Sat, 1 Sep 2012 12:58:14 +0000 (14:58 +0200)
Replace a magic number for the DDR2/mDDR PHY clock ID with a proper
definition. In addition, don't request this clock ID on DA830 hardware,
which does not have a DDR2/mDDR PHY (or associated PLL controller).

Signed-off-by: Laurence Withers <lwithers@guralp.com>
Cc: Tom Rini <trini@ti.com>
Cc: Prabhakar Lad <prabhakar.csengg@gmail.com>
arch/arm/cpu/arm926ejs/davinci/cpu.c
arch/arm/include/asm/arch-davinci/hardware.h

index 6cb857aef52a504c4b3b15789058dd56c8a70f33..41201d0a4fc61831a5aab00ce63b45702556b5a3 100644 (file)
@@ -194,7 +194,8 @@ int set_cpu_clk_info(void)
 #ifdef CONFIG_SOC_DA8XX
        gd->bd->bi_arm_freq = clk_get(DAVINCI_ARM_CLKID) / 1000000;
        /* DDR PHY uses an x2 input clock */
-       gd->bd->bi_ddr_freq = clk_get(0x10001) / 1000000;
+       gd->bd->bi_ddr_freq = cpu_is_da830() ? 0 :
+                               (clk_get(DAVINCI_DDR_CLKID) / 1000000);
 #else
 
        unsigned int pllbase = DAVINCI_PLL_CNTRL0_BASE;
index 674c52922fe30e56673ba44cfb9994d302c1080a..5267973127c9dcde8e388a6074e84eb660b30631 100644 (file)
@@ -459,10 +459,12 @@ enum davinci_clk_ids {
        DAVINCI_PLL0_SYSCLK2                    = DAVINCI_PLLC0_FLAG | 2,
        DAVINCI_PLL0_SYSCLK4                    = DAVINCI_PLLC0_FLAG | 4,
        DAVINCI_PLL0_SYSCLK6                    = DAVINCI_PLLC0_FLAG | 6,
+       DAVINCI_PLL1_SYSCLK1                    = DAVINCI_PLLC1_FLAG | 1,
        DAVINCI_PLL1_SYSCLK2                    = DAVINCI_PLLC1_FLAG | 2,
 
        /* map peripherals to clock IDs */
        DAVINCI_ARM_CLKID                       = DAVINCI_PLL0_SYSCLK6,
+       DAVINCI_DDR_CLKID                       = DAVINCI_PLL1_SYSCLK1,
        DAVINCI_MDIO_CLKID                      = DAVINCI_PLL0_SYSCLK4,
        DAVINCI_MMC_CLKID                       = DAVINCI_PLL0_SYSCLK2,
        DAVINCI_SPI0_CLKID                      = DAVINCI_PLL0_SYSCLK2,