Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
John Rigby | 9c14603 | 2010-01-25 23:12:56 -0700 | [diff] [blame] | 2 | /* |
| 3 | * |
| 4 | * (c) 2009 Ilya Yanok, Emcraft Systems <yanok@emcraft.com> |
| 5 | * |
| 6 | * Modified for mx25 by John Rigby <jrigby@gmail.com> |
John Rigby | 9c14603 | 2010-01-25 23:12:56 -0700 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef __ASM_ARCH_CLOCK_H |
| 10 | #define __ASM_ARCH_CLOCK_H |
| 11 | |
Benoît Thébaudeau | d2dd29d | 2012-08-21 11:05:12 +0000 | [diff] [blame] | 12 | #include <common.h> |
| 13 | |
| 14 | #ifdef CONFIG_MX25_HCLK_FREQ |
| 15 | #define MXC_HCLK CONFIG_MX25_HCLK_FREQ |
| 16 | #else |
| 17 | #define MXC_HCLK 24000000 |
| 18 | #endif |
| 19 | |
| 20 | #ifdef CONFIG_MX25_CLK32 |
| 21 | #define MXC_CLK32 CONFIG_MX25_CLK32 |
| 22 | #else |
| 23 | #define MXC_CLK32 32768 |
| 24 | #endif |
| 25 | |
Timo Ketola | 738fa8d | 2012-04-18 22:55:28 +0000 | [diff] [blame] | 26 | enum mxc_clock { |
Benoît Thébaudeau | 05dd78f | 2012-09-27 10:27:28 +0000 | [diff] [blame] | 27 | /* PER clocks (do not change order) */ |
Timo Ketola | 738fa8d | 2012-04-18 22:55:28 +0000 | [diff] [blame] | 28 | MXC_CSI_CLK, |
| 29 | MXC_EPIT_CLK, |
| 30 | MXC_ESAI_CLK, |
| 31 | MXC_ESDHC1_CLK, |
| 32 | MXC_ESDHC2_CLK, |
| 33 | MXC_GPT_CLK, |
| 34 | MXC_I2C_CLK, |
| 35 | MXC_LCDC_CLK, |
| 36 | MXC_NFC_CLK, |
| 37 | MXC_OWIRE_CLK, |
| 38 | MXC_PWM_CLK, |
| 39 | MXC_SIM1_CLK, |
| 40 | MXC_SIM2_CLK, |
| 41 | MXC_SSI1_CLK, |
| 42 | MXC_SSI2_CLK, |
| 43 | MXC_UART_CLK, |
Benoît Thébaudeau | 05dd78f | 2012-09-27 10:27:28 +0000 | [diff] [blame] | 44 | /* Other clocks */ |
Timo Ketola | 738fa8d | 2012-04-18 22:55:28 +0000 | [diff] [blame] | 45 | MXC_ARM_CLK, |
Benoît Thébaudeau | 05dd78f | 2012-09-27 10:27:28 +0000 | [diff] [blame] | 46 | MXC_AHB_CLK, |
| 47 | MXC_IPG_CLK, |
| 48 | MXC_CSPI_CLK, |
Timo Ketola | 738fa8d | 2012-04-18 22:55:28 +0000 | [diff] [blame] | 49 | MXC_FEC_CLK, |
| 50 | MXC_CLK_NUM |
| 51 | }; |
| 52 | |
Benoît Thébaudeau | 9d69424 | 2017-05-03 11:59:05 +0200 | [diff] [blame] | 53 | int imx_set_perclk(enum mxc_clock clk, bool from_upll, unsigned int freq); |
Timo Ketola | 738fa8d | 2012-04-18 22:55:28 +0000 | [diff] [blame] | 54 | unsigned int mxc_get_clock(enum mxc_clock clk); |
John Rigby | 9c14603 | 2010-01-25 23:12:56 -0700 | [diff] [blame] | 55 | |
Benoît Thébaudeau | b3ab139 | 2012-09-27 10:27:57 +0000 | [diff] [blame] | 56 | #define imx_get_uartclk() mxc_get_clock(MXC_UART_CLK) |
| 57 | #define imx_get_fecclk() mxc_get_clock(MXC_FEC_CLK) |
| 58 | |
John Rigby | 9c14603 | 2010-01-25 23:12:56 -0700 | [diff] [blame] | 59 | #endif /* __ASM_ARCH_CLOCK_H */ |