diff options
author | Jun Nie <jun.nie@linaro.org> | 2018-06-28 16:38:11 +0800 |
---|---|---|
committer | Bryan O'Donoghue <bryan.odonoghue@linaro.org> | 2018-09-04 13:36:22 +0100 |
commit | 14cf32aaa72fabb13f60e85c2a4c8bf9422c22ec (patch) | |
tree | 4e1f33739147fa1aa5d5b49afad98cf51e0d3610 /plat/imx/common/imx_clock.c | |
parent | dcd54e9b4cbe0e771e63f0e53f2d3a59198b48d3 (diff) | |
download | trusted-firmware-a-14cf32aaa72fabb13f60e85c2a4c8bf9422c22ec.tar.gz |
imx: imx_clock: mmc: Add USDHC clock API
This patch adds an API to configure up the base USDHC clocks, taking a
bit-mask of silicon specific bits as an input from a higher layer in order
to direct the necessary clock source.
Signed-off-by: Jun Nie <jun.nie@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Diffstat (limited to 'plat/imx/common/imx_clock.c')
-rw-r--r-- | plat/imx/common/imx_clock.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/plat/imx/common/imx_clock.c b/plat/imx/common/imx_clock.c index 8fb42e3e0c..0a13d4db9f 100644 --- a/plat/imx/common/imx_clock.c +++ b/plat/imx/common/imx_clock.c @@ -82,3 +82,19 @@ void imx_clock_disable_uart(unsigned int uart_id) /* Clear the target */ imx_clock_target_clr(ccm_trgt_id, 0xFFFFFFFF); } + +void imx_clock_enable_usdhc(unsigned int usdhc_id, uint32_t usdhc_clk_en_bits) +{ + unsigned int ccm_trgt_id = CCM_TRT_ID_USDHC1_CLK_ROOT + usdhc_id; + unsigned int ccm_ccgr_id = CCM_CCGR_ID_USBHDC1 + usdhc_id; + + /* Check for error */ + if (usdhc_id > MXC_MAX_USDHC_NUM) + return; + + /* Set target register values */ + imx_clock_target_set(ccm_trgt_id, usdhc_clk_en_bits); + + /* Enable the clock gate */ + imx_clock_gate_enable(ccm_ccgr_id, true); +} |