2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
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)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2019-12-28 17:44:58 +00:00
|
|
|
#include <clock_legacy.h>
|
2010-02-05 14:11:27 +00:00
|
|
|
#include <asm/arch/imx-regs.h>
|
2010-03-05 16:54:37 +00:00
|
|
|
#include <asm/arch/clock.h>
|
2020-10-31 03:38:53 +00:00
|
|
|
#include <asm/global_data.h>
|
2010-02-05 14:11:27 +00:00
|
|
|
|
2019-06-21 03:42:28 +00:00
|
|
|
#ifdef CONFIG_FSL_ESDHC_IMX
|
2010-12-21 01:27:51 +00:00
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
#endif
|
|
|
|
|
2010-02-05 14:11:27 +00:00
|
|
|
int get_clocks(void)
|
|
|
|
{
|
2019-06-21 03:42:28 +00:00
|
|
|
#ifdef CONFIG_FSL_ESDHC_IMX
|
2012-06-14 03:44:33 +00:00
|
|
|
#ifdef CONFIG_FSL_USDHC
|
2022-10-29 00:27:13 +00:00
|
|
|
#if CFG_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);
|
2022-10-29 00:27:13 +00:00
|
|
|
#elif CFG_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);
|
2022-10-29 00:27:13 +00:00
|
|
|
#elif CFG_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
|
2022-10-29 00:27:13 +00:00
|
|
|
#if CFG_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);
|
2022-10-29 00:27:13 +00:00
|
|
|
#elif CFG_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);
|
2022-10-29 00:27:13 +00:00
|
|
|
#elif CFG_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;
|
|
|
|
}
|