2010-02-05 14:11:27 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2000-2003
|
|
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
|
|
|
|
* TsiChung Liew (Tsi-Chung.Liew@freescale.com)
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2010-02-05 14:11:27 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <asm/arch/imx-regs.h>
|
2010-03-05 16:54:37 +00:00
|
|
|
#include <asm/arch/clock.h>
|
2010-02-05 14:11:27 +00:00
|
|
|
|
2010-12-21 01:27:51 +00:00
|
|
|
#ifdef CONFIG_FSL_ESDHC
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
#endif
|
|
|
|
|
2010-02-05 14:11:27 +00:00
|
|
|
int get_clocks(void)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_FSL_ESDHC
|
2012-06-14 03:44:33 +00:00
|
|
|
#ifdef CONFIG_FSL_USDHC
|
2012-09-27 10:24:37 +00:00
|
|
|
#if CONFIG_SYS_FSL_ESDHC_ADDR == USDHC2_BASE_ADDR
|
2012-12-13 20:49:05 +00:00
|
|
|
gd->arch.sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
|
2012-09-27 10:24:37 +00:00
|
|
|
#elif CONFIG_SYS_FSL_ESDHC_ADDR == USDHC3_BASE_ADDR
|
2012-12-13 20:49:05 +00:00
|
|
|
gd->arch.sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
|
2012-09-27 10:24:37 +00:00
|
|
|
#elif CONFIG_SYS_FSL_ESDHC_ADDR == USDHC4_BASE_ADDR
|
2012-12-13 20:49:05 +00:00
|
|
|
gd->arch.sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK);
|
2012-09-27 10:24:37 +00:00
|
|
|
#else
|
2012-12-13 20:49:05 +00:00
|
|
|
gd->arch.sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
|
2012-09-27 10:24:37 +00:00
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#if CONFIG_SYS_FSL_ESDHC_ADDR == MMC_SDHC2_BASE_ADDR
|
2012-12-13 20:49:05 +00:00
|
|
|
gd->arch.sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
|
2012-09-27 10:24:37 +00:00
|
|
|
#elif CONFIG_SYS_FSL_ESDHC_ADDR == MMC_SDHC3_BASE_ADDR
|
2012-12-13 20:49:05 +00:00
|
|
|
gd->arch.sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
|
2012-09-27 10:24:37 +00:00
|
|
|
#elif CONFIG_SYS_FSL_ESDHC_ADDR == MMC_SDHC4_BASE_ADDR
|
2012-12-13 20:49:05 +00:00
|
|
|
gd->arch.sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK);
|
2012-06-14 03:44:33 +00:00
|
|
|
#else
|
2012-12-13 20:49:05 +00:00
|
|
|
gd->arch.sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
|
2012-09-27 10:24:37 +00:00
|
|
|
#endif
|
2012-06-14 03:44:33 +00:00
|
|
|
#endif
|
2010-02-05 14:11:27 +00:00
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|