diff options
author | Simon Glass <sjg@chromium.org> | 2015-06-05 14:39:36 -0600 |
---|---|---|
committer | Tom Warren <twarren@nvidia.com> | 2015-06-09 09:56:13 -0700 |
commit | 746dc76b99e44128025d9f18f7a154e2382ed134 (patch) | |
tree | f320bd96c7f8f561d9a689f09b1130c5a30a37d8 /arch/arm/mach-tegra/clock.c | |
parent | 20edd1ac7ae7d081078dd64ffe7a89f48c09fd65 (diff) | |
download | u-boot-746dc76b99e44128025d9f18f7a154e2382ed134.tar.gz u-boot-746dc76b99e44128025d9f18f7a154e2382ed134.tar.bz2 u-boot-746dc76b99e44128025d9f18f7a154e2382ed134.zip |
tegra: clock: Support enabling external clocks
Add a simple function to enable external clocks.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/clock.c')
-rw-r--r-- | arch/arm/mach-tegra/clock.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c index cdd54388c5..590826072b 100644 --- a/arch/arm/mach-tegra/clock.c +++ b/arch/arm/mach-tegra/clock.c @@ -17,11 +17,13 @@ /* Tegra SoC common clock control functions */ #include <common.h> +#include <errno.h> #include <asm/io.h> #include <asm/arch/clock.h> #include <asm/arch/tegra.h> #include <asm/arch-tegra/ap.h> #include <asm/arch-tegra/clk_rst.h> +#include <asm/arch-tegra/pmc.h> #include <asm/arch-tegra/timer.h> #include <div64.h> #include <fdtdec.h> @@ -702,3 +704,18 @@ void tegra30_set_up_pllp(void) set_avp_clock_source(SCLK_SOURCE_PLLP_OUT4); } + +int clock_external_output(int clk_id) +{ + struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE; + + if (clk_id >= 1 && clk_id <= 3) { + setbits_le32(&pmc->pmc_clk_out_cntrl, + 1 << (2 + (clk_id - 1) * 8)); + } else { + printf("%s: Unknown output clock id %d\n", __func__, clk_id); + return -EINVAL; + } + + return 0; +} |