Thomas Gleixner | 1621633 | 2019-05-19 15:51:31 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Quinn Jensen | 52c543f | 2007-07-09 22:06:53 +0100 | [diff] [blame] | 2 | /* |
Anson Huang | 5739b91 | 2015-05-08 01:35:55 +0800 | [diff] [blame] | 3 | * Copyright 2004-2007, 2010-2015 Freescale Semiconductor, Inc. |
Juergen Beisert | d0f349f | 2008-07-05 10:02:50 +0200 | [diff] [blame] | 4 | * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de) |
Quinn Jensen | 52c543f | 2007-07-09 22:06:53 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __ASM_ARCH_MXC_H__ |
| 8 | #define __ASM_ARCH_MXC_H__ |
| 9 | |
Yong Shen | 64f102b | 2010-10-21 21:18:59 +0800 | [diff] [blame] | 10 | #include <linux/types.h> |
Peng Fan | f72130c | 2020-05-20 13:51:28 +0800 | [diff] [blame] | 11 | #include <soc/imx/cpu.h> |
Yong Shen | 64f102b | 2010-10-21 21:18:59 +0800 | [diff] [blame] | 12 | |
Quinn Jensen | 52c543f | 2007-07-09 22:06:53 +0100 | [diff] [blame] | 13 | #ifndef __ASM_ARCH_MXC_HARDWARE_H__ |
| 14 | #error "Do not include directly." |
| 15 | #endif |
| 16 | |
Anson Huang | ec336b2 | 2014-09-17 11:11:45 +0800 | [diff] [blame] | 17 | #define IMX_DDR_TYPE_LPDDR2 1 |
| 18 | |
Sascha Hauer | 198016e | 2009-02-06 15:38:22 +0100 | [diff] [blame] | 19 | #ifndef __ASSEMBLY__ |
Robert Schwebel | d2db9aa | 2008-04-02 10:29:30 +0100 | [diff] [blame] | 20 | |
Arnd Bergmann | a82eb09 | 2014-07-03 16:22:54 +0200 | [diff] [blame] | 21 | #ifdef CONFIG_SOC_IMX6SL |
Shawn Guo | 9ba64fe | 2013-10-17 10:07:09 +0800 | [diff] [blame] | 22 | static inline bool cpu_is_imx6sl(void) |
| 23 | { |
| 24 | return __mxc_cpu_type == MXC_CPU_IMX6SL; |
| 25 | } |
Arnd Bergmann | a82eb09 | 2014-07-03 16:22:54 +0200 | [diff] [blame] | 26 | #else |
| 27 | static inline bool cpu_is_imx6sl(void) |
| 28 | { |
| 29 | return false; |
| 30 | } |
| 31 | #endif |
Shawn Guo | 9ba64fe | 2013-10-17 10:07:09 +0800 | [diff] [blame] | 32 | |
Shawn Guo | 3c03a2f | 2013-04-01 22:13:32 +0800 | [diff] [blame] | 33 | static inline bool cpu_is_imx6dl(void) |
| 34 | { |
| 35 | return __mxc_cpu_type == MXC_CPU_IMX6DL; |
| 36 | } |
| 37 | |
Shawn Guo | d9654dc | 2014-05-13 21:46:16 +0800 | [diff] [blame] | 38 | static inline bool cpu_is_imx6sx(void) |
| 39 | { |
| 40 | return __mxc_cpu_type == MXC_CPU_IMX6SX; |
| 41 | } |
| 42 | |
Frank Li | 022d071 | 2015-07-10 02:09:41 +0800 | [diff] [blame] | 43 | static inline bool cpu_is_imx6ul(void) |
| 44 | { |
| 45 | return __mxc_cpu_type == MXC_CPU_IMX6UL; |
| 46 | } |
| 47 | |
Leonard Crestez | b3ea575 | 2017-06-06 20:50:42 +0300 | [diff] [blame] | 48 | static inline bool cpu_is_imx6ull(void) |
| 49 | { |
| 50 | return __mxc_cpu_type == MXC_CPU_IMX6ULL; |
| 51 | } |
| 52 | |
Anson Huang | c90dec0 | 2018-09-30 11:32:26 +0800 | [diff] [blame] | 53 | static inline bool cpu_is_imx6ulz(void) |
| 54 | { |
| 55 | return __mxc_cpu_type == MXC_CPU_IMX6ULZ; |
| 56 | } |
| 57 | |
Bai Ping | dee5dee | 2018-03-08 17:34:55 +0800 | [diff] [blame] | 58 | static inline bool cpu_is_imx6sll(void) |
| 59 | { |
| 60 | return __mxc_cpu_type == MXC_CPU_IMX6SLL; |
| 61 | } |
| 62 | |
Shawn Guo | 3c03a2f | 2013-04-01 22:13:32 +0800 | [diff] [blame] | 63 | static inline bool cpu_is_imx6q(void) |
| 64 | { |
| 65 | return __mxc_cpu_type == MXC_CPU_IMX6Q; |
| 66 | } |
Yong Shen | 64f102b | 2010-10-21 21:18:59 +0800 | [diff] [blame] | 67 | |
Anson Huang | 5739b91 | 2015-05-08 01:35:55 +0800 | [diff] [blame] | 68 | static inline bool cpu_is_imx7d(void) |
| 69 | { |
| 70 | return __mxc_cpu_type == MXC_CPU_IMX7D; |
| 71 | } |
| 72 | |
Yong Shen | 64f102b | 2010-10-21 21:18:59 +0800 | [diff] [blame] | 73 | struct cpu_op { |
| 74 | u32 cpu_rate; |
| 75 | }; |
| 76 | |
Hui Wang | 010dc8a | 2011-10-09 17:42:15 +0800 | [diff] [blame] | 77 | int tzic_enable_wake(void); |
Dinh Nguyen | 0adf882 | 2011-03-21 16:30:37 -0500 | [diff] [blame] | 78 | |
Yong Shen | 64f102b | 2010-10-21 21:18:59 +0800 | [diff] [blame] | 79 | extern struct cpu_op *(*get_cpu_op)(int *op); |
| 80 | #endif |
| 81 | |
Johannes Berg | c553138 | 2016-01-27 17:59:35 +0100 | [diff] [blame] | 82 | #define imx_readl readl_relaxed |
| 83 | #define imx_readw readw_relaxed |
| 84 | #define imx_writel writel_relaxed |
| 85 | #define imx_writew writew_relaxed |
| 86 | |
Robert Schwebel | f304fc4 | 2008-03-28 10:59:08 +0100 | [diff] [blame] | 87 | #endif /* __ASM_ARCH_MXC_H__ */ |