]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: tegra: remove a conditional for CSITE rate
authorStephen Warren <swarren@nvidia.com>
Fri, 24 Jan 2014 19:46:10 +0000 (12:46 -0700)
committerTom Warren <twarren@nvidia.com>
Mon, 3 Feb 2014 16:46:46 +0000 (09:46 -0700)
There's already an SoC-specific conditional in cpu.h to determine the
PLLP rate. Define the CSITE clock rate inside the same conditional, so
that we can remove a conditional from clock_enable_coresight(). This
means one less place to update the code for new SoCs.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
arch/arm/cpu/arm720t/tegra-common/cpu.c
arch/arm/cpu/arm720t/tegra-common/cpu.h

index 322ce10d6fe3f2688816405191bd9ad98c3da3f2..d62bb9e370e0d4007e28c5ce1063182388b1090c 100644 (file)
@@ -315,7 +315,6 @@ void reset_A9_cpu(int reset)
 void clock_enable_coresight(int enable)
 {
        u32 rst, src = 2;
-       int soc_type;
 
        debug("clock_enable_coresight entry\n");
        clock_set_enable(PERIPH_ID_CORESIGHT, enable);
@@ -328,16 +327,7 @@ void clock_enable_coresight(int enable)
                 * Clock divider request would setup CSITE clock as 144MHz
                 * for PLLP base 216MHz and 204MHz for PLLP base 408MHz
                 */
-
-               soc_type = tegra_get_chip();
-               if (soc_type == CHIPID_TEGRA30 || soc_type == CHIPID_TEGRA114)
-                       src = CLK_DIVIDER(NVBL_PLLP_KHZ, 204000);
-               else if (soc_type == CHIPID_TEGRA20)
-                       src = CLK_DIVIDER(NVBL_PLLP_KHZ, 144000);
-               else
-                       printf("%s: Unknown SoC type %X!\n",
-                                __func__, soc_type);
-
+               src = CLK_DIVIDER(NVBL_PLLP_KHZ, CSITE_KHZ);
                clock_ll_set_source_divisor(PERIPH_ID_CSI, 0, src);
 
                /* Unlock the CPU CoreSight interfaces */
index 60412c7f87eb3e2109e79ed474cb18f4f7fa99c6..d1520ce2cc885712951328ea0f658e00287ff290 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010-2011
+ * (C) Copyright 2010-2014
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:    GPL-2.0+
 #define IO_STABILIZATION_DELAY (1000)
 
 #if defined(CONFIG_TEGRA20)
-#define NVBL_PLLP_KHZ  (216000)
+#define NVBL_PLLP_KHZ  216000
+#define CSITE_KHZ      144000
 #elif defined(CONFIG_TEGRA30) || defined(CONFIG_TEGRA114)
-#define NVBL_PLLP_KHZ  (408000)
+#define NVBL_PLLP_KHZ  408000
+#define CSITE_KHZ      204000
 #else
 #error "Unknown Tegra chip!"
 #endif