mxc.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright 2004-2007, 2010-2015 Freescale Semiconductor, Inc.
  4. * Copyright (C) 2008 Juergen Beisert ([email protected])
  5. */
  6. #ifndef __ASM_ARCH_MXC_H__
  7. #define __ASM_ARCH_MXC_H__
  8. #include <linux/types.h>
  9. #include <soc/imx/cpu.h>
  10. #ifndef __ASM_ARCH_MXC_HARDWARE_H__
  11. #error "Do not include directly."
  12. #endif
  13. #define IMX_DDR_TYPE_LPDDR2 1
  14. #ifndef __ASSEMBLY__
  15. #ifdef CONFIG_SOC_IMX6SL
  16. static inline bool cpu_is_imx6sl(void)
  17. {
  18. return __mxc_cpu_type == MXC_CPU_IMX6SL;
  19. }
  20. #else
  21. static inline bool cpu_is_imx6sl(void)
  22. {
  23. return false;
  24. }
  25. #endif
  26. static inline bool cpu_is_imx6dl(void)
  27. {
  28. return __mxc_cpu_type == MXC_CPU_IMX6DL;
  29. }
  30. static inline bool cpu_is_imx6sx(void)
  31. {
  32. return __mxc_cpu_type == MXC_CPU_IMX6SX;
  33. }
  34. static inline bool cpu_is_imx6ul(void)
  35. {
  36. return __mxc_cpu_type == MXC_CPU_IMX6UL;
  37. }
  38. static inline bool cpu_is_imx6ull(void)
  39. {
  40. return __mxc_cpu_type == MXC_CPU_IMX6ULL;
  41. }
  42. static inline bool cpu_is_imx6ulz(void)
  43. {
  44. return __mxc_cpu_type == MXC_CPU_IMX6ULZ;
  45. }
  46. static inline bool cpu_is_imx6sll(void)
  47. {
  48. return __mxc_cpu_type == MXC_CPU_IMX6SLL;
  49. }
  50. static inline bool cpu_is_imx6q(void)
  51. {
  52. return __mxc_cpu_type == MXC_CPU_IMX6Q;
  53. }
  54. static inline bool cpu_is_imx7d(void)
  55. {
  56. return __mxc_cpu_type == MXC_CPU_IMX7D;
  57. }
  58. struct cpu_op {
  59. u32 cpu_rate;
  60. };
  61. int tzic_enable_wake(void);
  62. extern struct cpu_op *(*get_cpu_op)(int *op);
  63. #endif
  64. #define imx_readl readl_relaxed
  65. #define imx_readw readw_relaxed
  66. #define imx_writel writel_relaxed
  67. #define imx_writew writew_relaxed
  68. #endif /* __ASM_ARCH_MXC_H__ */