sys_proto.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. #define is_mx6ull() (is_cpu_type(MXC_CPU_MX6ULL))
  31. u32 get_nr_cpus(void);
  32. u32 get_cpu_rev(void);
  33. u32 get_cpu_speed_grade_hz(void);
  34. u32 get_cpu_temp_grade(int *minc, int *maxc);
  35. const char *get_imx_type(u32 imxtype);
  36. u32 imx_ddr_size(void);
  37. void sdelay(unsigned long);
  38. void set_chipselect_size(int const);
  39. void init_aips(void);
  40. void init_src(void);
  41. void imx_set_wdog_powerdown(bool enable);
  42. /*
  43. * Initializes on-chip ethernet controllers.
  44. * to override, implement board_eth_init()
  45. */
  46. int fecmxc_initialize(bd_t *bis);
  47. u32 get_ahb_clk(void);
  48. u32 get_periph_clk(void);
  49. void lcdif_power_down(void);
  50. int mxs_reset_block(struct mxs_register_32 *reg);
  51. int mxs_wait_mask_set(struct mxs_register_32 *reg, u32 mask, u32 timeout);
  52. int mxs_wait_mask_clr(struct mxs_register_32 *reg, u32 mask, u32 timeout);
  53. #endif