sys_proto.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * (C) Copyright 2009
  3. * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #ifndef _SYS_PROTO_H_
  8. #define _SYS_PROTO_H_
  9. #include <asm/imx-common/regs-common.h>
  10. #include <common.h>
  11. #include "../arch-imx/cpu.h"
  12. #define soc_rev() (get_cpu_rev() & 0xFF)
  13. #define is_soc_rev(rev) (soc_rev() == rev)
  14. /* returns MXC_CPU_ value */
  15. #define cpu_type(rev) (((rev) >> 12) & 0xff)
  16. #define soc_type(rev) (((rev) >> 12) & 0xf0)
  17. /* both macros return/take MXC_CPU_ constants */
  18. #define get_cpu_type() (cpu_type(get_cpu_rev()))
  19. #define get_soc_type() (soc_type(get_cpu_rev()))
  20. #define is_cpu_type(cpu) (get_cpu_type() == cpu)
  21. #define is_soc_type(soc) (get_soc_type() == soc)
  22. #define is_mx6() (is_soc_type(MXC_SOC_MX6))
  23. #define is_mx7() (is_soc_type(MXC_SOC_MX7))
  24. #define is_mx6dqp() (is_cpu_type(MXC_CPU_MX6QP) || is_cpu_type(MXC_CPU_MX6DP))
  25. #define is_mx6dq() (is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D))
  26. #define is_mx6sdl() (is_cpu_type(MXC_CPU_MX6SOLO) || is_cpu_type(MXC_CPU_MX6DL))
  27. #define is_mx6sx() (is_cpu_type(MXC_CPU_MX6SX))
  28. #define is_mx6sl() (is_cpu_type(MXC_CPU_MX6SL))
  29. #define is_mx6ul() (is_cpu_type(MXC_CPU_MX6UL))
  30. u32 get_nr_cpus(void);
  31. u32 get_cpu_rev(void);
  32. u32 get_cpu_speed_grade_hz(void);
  33. u32 get_cpu_temp_grade(int *minc, int *maxc);
  34. const char *get_imx_type(u32 imxtype);
  35. u32 imx_ddr_size(void);
  36. void sdelay(unsigned long);
  37. void set_chipselect_size(int const);
  38. void init_aips(void);
  39. void init_src(void);
  40. void imx_set_wdog_powerdown(bool enable);
  41. /*
  42. * Initializes on-chip ethernet controllers.
  43. * to override, implement board_eth_init()
  44. */
  45. int fecmxc_initialize(bd_t *bis);
  46. u32 get_ahb_clk(void);
  47. u32 get_periph_clk(void);
  48. void lcdif_power_down(void);
  49. int mxs_reset_block(struct mxs_register_32 *reg);
  50. int mxs_wait_mask_set(struct mxs_register_32 *reg, u32 mask, u32 timeout);
  51. int mxs_wait_mask_clr(struct mxs_register_32 *reg, u32 mask, u32 timeout);
  52. #endif