summaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/arch-tegra2/clk_rst.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-02-03 15:13:54 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-03-29 08:12:50 +0200
commit2e33559f3d4f111f969a7e0da29a264f41bae86a (patch)
tree0bdd226335a9230f04edb79f7a2042665a8603b0 /arch/arm/include/asm/arch-tegra2/clk_rst.h
parentc67822704b73dcfb86debf4c25151e43309af844 (diff)
downloadtalos-obmc-uboot-2e33559f3d4f111f969a7e0da29a264f41bae86a.tar.gz
talos-obmc-uboot-2e33559f3d4f111f969a7e0da29a264f41bae86a.zip
tegra: Enhance clock support to handle 16-bit clock divisors
I2C ports have a 16-bit clock divisor. Add code to handle this special case so that I2C speeds below 150KHz are supported. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'arch/arm/include/asm/arch-tegra2/clk_rst.h')
-rw-r--r--arch/arm/include/asm/arch-tegra2/clk_rst.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/arm/include/asm/arch-tegra2/clk_rst.h b/arch/arm/include/asm/arch-tegra2/clk_rst.h
index 0b6e004fbc..415e420012 100644
--- a/arch/arm/include/asm/arch-tegra2/clk_rst.h
+++ b/arch/arm/include/asm/arch-tegra2/clk_rst.h
@@ -125,9 +125,15 @@ struct clk_rst_ctlr {
#define OSC_FREQ_SHIFT 30
#define OSC_FREQ_MASK (3U << OSC_FREQ_SHIFT)
-/* CLK_RST_CONTROLLER_CLK_SOURCE_x_OUT_0 */
+/*
+ * CLK_RST_CONTROLLER_CLK_SOURCE_x_OUT_0 - the mask here is normally 8 bits
+ * but can be 16. We could use knowledge we have to restrict the mask in
+ * the 8-bit cases (the divider_bits value returned by
+ * get_periph_clock_source()) but it does not seem worth it since the code
+ * already checks the ranges of values it is writing, in clk_get_divider().
+ */
#define OUT_CLK_DIVISOR_SHIFT 0
-#define OUT_CLK_DIVISOR_MASK (255 << OUT_CLK_DIVISOR_SHIFT)
+#define OUT_CLK_DIVISOR_MASK (0xffff << OUT_CLK_DIVISOR_SHIFT)
#define OUT_CLK_SOURCE_SHIFT 30
#define OUT_CLK_SOURCE_MASK (3U << OUT_CLK_SOURCE_SHIFT)
OpenPOWER on IntegriCloud