blob: fe2d0f5abfcc245d7cbf7d8611ff549894863276 [file] [log] [blame]
Thomas Gleixner16216332019-05-19 15:51:31 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Quinn Jensen52c543f2007-07-09 22:06:53 +01002/*
Anson Huang5739b912015-05-08 01:35:55 +08003 * Copyright 2004-2007, 2010-2015 Freescale Semiconductor, Inc.
Juergen Beisertd0f349f2008-07-05 10:02:50 +02004 * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
Quinn Jensen52c543f2007-07-09 22:06:53 +01005 */
6
7#ifndef __ASM_ARCH_MXC_H__
8#define __ASM_ARCH_MXC_H__
9
Yong Shen64f102b2010-10-21 21:18:59 +080010#include <linux/types.h>
Peng Fanf72130c2020-05-20 13:51:28 +080011#include <soc/imx/cpu.h>
Yong Shen64f102b2010-10-21 21:18:59 +080012
Quinn Jensen52c543f2007-07-09 22:06:53 +010013#ifndef __ASM_ARCH_MXC_HARDWARE_H__
14#error "Do not include directly."
15#endif
16
Anson Huangec336b22014-09-17 11:11:45 +080017#define IMX_DDR_TYPE_LPDDR2 1
18
Sascha Hauer198016e2009-02-06 15:38:22 +010019#ifndef __ASSEMBLY__
Robert Schwebeld2db9aa2008-04-02 10:29:30 +010020
Arnd Bergmanna82eb092014-07-03 16:22:54 +020021#ifdef CONFIG_SOC_IMX6SL
Shawn Guo9ba64fe2013-10-17 10:07:09 +080022static inline bool cpu_is_imx6sl(void)
23{
24 return __mxc_cpu_type == MXC_CPU_IMX6SL;
25}
Arnd Bergmanna82eb092014-07-03 16:22:54 +020026#else
27static inline bool cpu_is_imx6sl(void)
28{
29 return false;
30}
31#endif
Shawn Guo9ba64fe2013-10-17 10:07:09 +080032
Shawn Guo3c03a2f2013-04-01 22:13:32 +080033static inline bool cpu_is_imx6dl(void)
34{
35 return __mxc_cpu_type == MXC_CPU_IMX6DL;
36}
37
Shawn Guod9654dc2014-05-13 21:46:16 +080038static inline bool cpu_is_imx6sx(void)
39{
40 return __mxc_cpu_type == MXC_CPU_IMX6SX;
41}
42
Frank Li022d0712015-07-10 02:09:41 +080043static inline bool cpu_is_imx6ul(void)
44{
45 return __mxc_cpu_type == MXC_CPU_IMX6UL;
46}
47
Leonard Crestezb3ea5752017-06-06 20:50:42 +030048static inline bool cpu_is_imx6ull(void)
49{
50 return __mxc_cpu_type == MXC_CPU_IMX6ULL;
51}
52
Anson Huangc90dec02018-09-30 11:32:26 +080053static inline bool cpu_is_imx6ulz(void)
54{
55 return __mxc_cpu_type == MXC_CPU_IMX6ULZ;
56}
57
Bai Pingdee5dee2018-03-08 17:34:55 +080058static inline bool cpu_is_imx6sll(void)
59{
60 return __mxc_cpu_type == MXC_CPU_IMX6SLL;
61}
62
Shawn Guo3c03a2f2013-04-01 22:13:32 +080063static inline bool cpu_is_imx6q(void)
64{
65 return __mxc_cpu_type == MXC_CPU_IMX6Q;
66}
Yong Shen64f102b2010-10-21 21:18:59 +080067
Anson Huang5739b912015-05-08 01:35:55 +080068static inline bool cpu_is_imx7d(void)
69{
70 return __mxc_cpu_type == MXC_CPU_IMX7D;
71}
72
Yong Shen64f102b2010-10-21 21:18:59 +080073struct cpu_op {
74 u32 cpu_rate;
75};
76
Hui Wang010dc8a2011-10-09 17:42:15 +080077int tzic_enable_wake(void);
Dinh Nguyen0adf8822011-03-21 16:30:37 -050078
Yong Shen64f102b2010-10-21 21:18:59 +080079extern struct cpu_op *(*get_cpu_op)(int *op);
80#endif
81
Johannes Bergc5531382016-01-27 17:59:35 +010082#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 Schwebelf304fc42008-03-28 10:59:08 +010087#endif /* __ASM_ARCH_MXC_H__ */