2019-05-19 16:51:31 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2007-07-10 01:06:53 +04:00
|
|
|
/*
|
2015-05-07 20:35:55 +03:00
|
|
|
* Copyright 2004-2007, 2010-2015 Freescale Semiconductor, Inc.
|
2008-07-05 12:02:50 +04:00
|
|
|
* Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
|
2007-07-10 01:06:53 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ASM_ARCH_MXC_H__
|
|
|
|
#define __ASM_ARCH_MXC_H__
|
|
|
|
|
2010-10-21 17:18:59 +04:00
|
|
|
#include <linux/types.h>
|
2020-05-20 08:51:28 +03:00
|
|
|
#include <soc/imx/cpu.h>
|
2010-10-21 17:18:59 +04:00
|
|
|
|
2007-07-10 01:06:53 +04:00
|
|
|
#ifndef __ASM_ARCH_MXC_HARDWARE_H__
|
|
|
|
#error "Do not include directly."
|
|
|
|
#endif
|
|
|
|
|
2014-09-17 07:11:45 +04:00
|
|
|
#define IMX_DDR_TYPE_LPDDR2 1
|
|
|
|
|
2009-02-06 17:38:22 +03:00
|
|
|
#ifndef __ASSEMBLY__
|
2009-01-26 18:34:52 +03:00
|
|
|
|
2014-07-03 18:22:54 +04:00
|
|
|
#ifdef CONFIG_SOC_IMX6SL
|
2013-10-17 06:07:09 +04:00
|
|
|
static inline bool cpu_is_imx6sl(void)
|
|
|
|
{
|
|
|
|
return __mxc_cpu_type == MXC_CPU_IMX6SL;
|
|
|
|
}
|
2014-07-03 18:22:54 +04:00
|
|
|
#else
|
|
|
|
static inline bool cpu_is_imx6sl(void)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
#endif
|
2013-10-17 06:07:09 +04:00
|
|
|
|
2013-04-01 18:13:32 +04:00
|
|
|
static inline bool cpu_is_imx6dl(void)
|
|
|
|
{
|
|
|
|
return __mxc_cpu_type == MXC_CPU_IMX6DL;
|
|
|
|
}
|
|
|
|
|
2014-05-13 17:46:16 +04:00
|
|
|
static inline bool cpu_is_imx6sx(void)
|
|
|
|
{
|
|
|
|
return __mxc_cpu_type == MXC_CPU_IMX6SX;
|
|
|
|
}
|
|
|
|
|
2015-07-09 21:09:41 +03:00
|
|
|
static inline bool cpu_is_imx6ul(void)
|
|
|
|
{
|
|
|
|
return __mxc_cpu_type == MXC_CPU_IMX6UL;
|
|
|
|
}
|
|
|
|
|
2017-06-06 20:50:42 +03:00
|
|
|
static inline bool cpu_is_imx6ull(void)
|
|
|
|
{
|
|
|
|
return __mxc_cpu_type == MXC_CPU_IMX6ULL;
|
|
|
|
}
|
|
|
|
|
2018-09-30 06:32:26 +03:00
|
|
|
static inline bool cpu_is_imx6ulz(void)
|
|
|
|
{
|
|
|
|
return __mxc_cpu_type == MXC_CPU_IMX6ULZ;
|
|
|
|
}
|
|
|
|
|
2018-03-08 12:34:55 +03:00
|
|
|
static inline bool cpu_is_imx6sll(void)
|
|
|
|
{
|
|
|
|
return __mxc_cpu_type == MXC_CPU_IMX6SLL;
|
|
|
|
}
|
|
|
|
|
2013-04-01 18:13:32 +04:00
|
|
|
static inline bool cpu_is_imx6q(void)
|
|
|
|
{
|
|
|
|
return __mxc_cpu_type == MXC_CPU_IMX6Q;
|
|
|
|
}
|
2010-10-21 17:18:59 +04:00
|
|
|
|
2015-05-07 20:35:55 +03:00
|
|
|
static inline bool cpu_is_imx7d(void)
|
|
|
|
{
|
|
|
|
return __mxc_cpu_type == MXC_CPU_IMX7D;
|
|
|
|
}
|
|
|
|
|
2010-10-21 17:18:59 +04:00
|
|
|
struct cpu_op {
|
|
|
|
u32 cpu_rate;
|
|
|
|
};
|
|
|
|
|
2011-10-09 13:42:15 +04:00
|
|
|
int tzic_enable_wake(void);
|
2011-03-22 00:30:37 +03:00
|
|
|
|
2010-10-21 17:18:59 +04:00
|
|
|
extern struct cpu_op *(*get_cpu_op)(int *op);
|
|
|
|
#endif
|
|
|
|
|
2016-01-27 19:59:35 +03:00
|
|
|
#define imx_readl readl_relaxed
|
|
|
|
#define imx_readw readw_relaxed
|
|
|
|
#define imx_writel writel_relaxed
|
|
|
|
#define imx_writew writew_relaxed
|
|
|
|
|
2008-03-28 12:59:08 +03:00
|
|
|
#endif /* __ASM_ARCH_MXC_H__ */
|