18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright 2004-2007, 2010-2015 Freescale Semiconductor, Inc. 48c2ecf20Sopenharmony_ci * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de) 58c2ecf20Sopenharmony_ci */ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#ifndef __ASM_ARCH_MXC_H__ 88c2ecf20Sopenharmony_ci#define __ASM_ARCH_MXC_H__ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#include <linux/types.h> 118c2ecf20Sopenharmony_ci#include <soc/imx/cpu.h> 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci#ifndef __ASM_ARCH_MXC_HARDWARE_H__ 148c2ecf20Sopenharmony_ci#error "Do not include directly." 158c2ecf20Sopenharmony_ci#endif 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#define IMX_DDR_TYPE_LPDDR2 1 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__ 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci#ifdef CONFIG_SOC_IMX6SL 228c2ecf20Sopenharmony_cistatic inline bool cpu_is_imx6sl(void) 238c2ecf20Sopenharmony_ci{ 248c2ecf20Sopenharmony_ci return __mxc_cpu_type == MXC_CPU_IMX6SL; 258c2ecf20Sopenharmony_ci} 268c2ecf20Sopenharmony_ci#else 278c2ecf20Sopenharmony_cistatic inline bool cpu_is_imx6sl(void) 288c2ecf20Sopenharmony_ci{ 298c2ecf20Sopenharmony_ci return false; 308c2ecf20Sopenharmony_ci} 318c2ecf20Sopenharmony_ci#endif 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_cistatic inline bool cpu_is_imx6dl(void) 348c2ecf20Sopenharmony_ci{ 358c2ecf20Sopenharmony_ci return __mxc_cpu_type == MXC_CPU_IMX6DL; 368c2ecf20Sopenharmony_ci} 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_cistatic inline bool cpu_is_imx6sx(void) 398c2ecf20Sopenharmony_ci{ 408c2ecf20Sopenharmony_ci return __mxc_cpu_type == MXC_CPU_IMX6SX; 418c2ecf20Sopenharmony_ci} 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_cistatic inline bool cpu_is_imx6ul(void) 448c2ecf20Sopenharmony_ci{ 458c2ecf20Sopenharmony_ci return __mxc_cpu_type == MXC_CPU_IMX6UL; 468c2ecf20Sopenharmony_ci} 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_cistatic inline bool cpu_is_imx6ull(void) 498c2ecf20Sopenharmony_ci{ 508c2ecf20Sopenharmony_ci return __mxc_cpu_type == MXC_CPU_IMX6ULL; 518c2ecf20Sopenharmony_ci} 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_cistatic inline bool cpu_is_imx6ulz(void) 548c2ecf20Sopenharmony_ci{ 558c2ecf20Sopenharmony_ci return __mxc_cpu_type == MXC_CPU_IMX6ULZ; 568c2ecf20Sopenharmony_ci} 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_cistatic inline bool cpu_is_imx6sll(void) 598c2ecf20Sopenharmony_ci{ 608c2ecf20Sopenharmony_ci return __mxc_cpu_type == MXC_CPU_IMX6SLL; 618c2ecf20Sopenharmony_ci} 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_cistatic inline bool cpu_is_imx6q(void) 648c2ecf20Sopenharmony_ci{ 658c2ecf20Sopenharmony_ci return __mxc_cpu_type == MXC_CPU_IMX6Q; 668c2ecf20Sopenharmony_ci} 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_cistatic inline bool cpu_is_imx7d(void) 698c2ecf20Sopenharmony_ci{ 708c2ecf20Sopenharmony_ci return __mxc_cpu_type == MXC_CPU_IMX7D; 718c2ecf20Sopenharmony_ci} 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_cistruct cpu_op { 748c2ecf20Sopenharmony_ci u32 cpu_rate; 758c2ecf20Sopenharmony_ci}; 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ciint tzic_enable_wake(void); 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ciextern struct cpu_op *(*get_cpu_op)(int *op); 808c2ecf20Sopenharmony_ci#endif 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_ci#define imx_readl readl_relaxed 838c2ecf20Sopenharmony_ci#define imx_readw readw_relaxed 848c2ecf20Sopenharmony_ci#define imx_writel writel_relaxed 858c2ecf20Sopenharmony_ci#define imx_writew writew_relaxed 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ci#endif /* __ASM_ARCH_MXC_H__ */ 88