Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Stefano Babic | 1c2b3ac | 2011-01-20 07:49:52 +0000 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2011 |
| 4 | * Stefano Babic, DENX Software Engineering, sbabic@denx.de. |
Stefano Babic | 1c2b3ac | 2011-01-20 07:49:52 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __ASM_ARCH_CLOCK_H |
| 8 | #define __ASM_ARCH_CLOCK_H |
| 9 | |
Benoît Thébaudeau | e452834 | 2012-08-21 11:07:20 +0000 | [diff] [blame] | 10 | #include <common.h> |
| 11 | |
| 12 | #ifdef CONFIG_MX35_HCLK_FREQ |
| 13 | #define MXC_HCLK CONFIG_MX35_HCLK_FREQ |
| 14 | #else |
| 15 | #define MXC_HCLK 24000000 |
| 16 | #endif |
| 17 | |
| 18 | #ifdef CONFIG_MX35_CLK32 |
| 19 | #define MXC_CLK32 CONFIG_MX35_CLK32 |
| 20 | #else |
| 21 | #define MXC_CLK32 32768 |
| 22 | #endif |
| 23 | |
Stefano Babic | 1c2b3ac | 2011-01-20 07:49:52 +0000 | [diff] [blame] | 24 | enum mxc_clock { |
Benoît Thébaudeau | efc9187 | 2012-08-14 10:32:21 +0000 | [diff] [blame] | 25 | MXC_ARM_CLK, |
Stefano Babic | 1c2b3ac | 2011-01-20 07:49:52 +0000 | [diff] [blame] | 26 | MXC_AHB_CLK, |
| 27 | MXC_IPG_CLK, |
| 28 | MXC_IPG_PERCLK, |
| 29 | MXC_UART_CLK, |
Benoît Thébaudeau | 8eae569 | 2012-09-27 10:26:02 +0000 | [diff] [blame] | 30 | MXC_ESDHC1_CLK, |
| 31 | MXC_ESDHC2_CLK, |
| 32 | MXC_ESDHC3_CLK, |
Stefano Babic | 1c2b3ac | 2011-01-20 07:49:52 +0000 | [diff] [blame] | 33 | MXC_USB_CLK, |
| 34 | MXC_CSPI_CLK, |
| 35 | MXC_FEC_CLK, |
Matthias Weisser | 99ba342 | 2012-09-24 02:46:53 +0000 | [diff] [blame] | 36 | MXC_I2C_CLK, |
Stefano Babic | 1c2b3ac | 2011-01-20 07:49:52 +0000 | [diff] [blame] | 37 | }; |
| 38 | |
Benoît Thébaudeau | efc9187 | 2012-08-14 10:32:21 +0000 | [diff] [blame] | 39 | enum mxc_main_clock { |
| 40 | CPU_CLK, |
| 41 | AHB_CLK, |
| 42 | IPG_CLK, |
| 43 | IPG_PER_CLK, |
| 44 | NFC_CLK, |
| 45 | USB_CLK, |
| 46 | HSP_CLK, |
| 47 | }; |
| 48 | |
| 49 | enum mxc_peri_clock { |
| 50 | UART1_BAUD, |
| 51 | UART2_BAUD, |
| 52 | UART3_BAUD, |
| 53 | SSI1_BAUD, |
| 54 | SSI2_BAUD, |
| 55 | CSI_BAUD, |
| 56 | MSHC_CLK, |
| 57 | ESDHC1_CLK, |
| 58 | ESDHC2_CLK, |
| 59 | ESDHC3_CLK, |
| 60 | SPDIF_CLK, |
| 61 | SPI1_CLK, |
| 62 | SPI2_CLK, |
| 63 | }; |
| 64 | |
Stefano Babic | 1c2b3ac | 2011-01-20 07:49:52 +0000 | [diff] [blame] | 65 | u32 imx_get_uartclk(void); |
| 66 | u32 imx_get_fecclk(void); |
| 67 | unsigned int mxc_get_clock(enum mxc_clock clk); |
| 68 | |
| 69 | #endif /* __ASM_ARCH_CLOCK_H */ |