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)
|
|
|
|
*
|
|
|
|
* See file CREDITS for list of people who contributed to this
|
|
|
|
* project.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#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;
|
|
|
|
}
|