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