sys_proto.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 "../arch-imx/cpu.h"
  11. #define soc_rev() (get_cpu_rev() & 0xFF)
  12. #define is_soc_rev(rev) (soc_rev() - rev)
  13. u32 get_nr_cpus(void);
  14. u32 get_cpu_rev(void);
  15. u32 get_cpu_speed_grade_hz(void);
  16. u32 get_cpu_temp_grade(int *minc, int *maxc);
  17. /* returns MXC_CPU_ value */
  18. #define cpu_type(rev) (((rev) >> 12)&0xff)
  19. /* both macros return/take MXC_CPU_ constants */
  20. #define get_cpu_type() (cpu_type(get_cpu_rev()))
  21. #define is_cpu_type(cpu) (get_cpu_type() == cpu)
  22. const char *get_imx_type(u32 imxtype);
  23. unsigned imx_ddr_size(void);
  24. void set_chipselect_size(int const);
  25. /*
  26. * Initializes on-chip ethernet controllers.
  27. * to override, implement board_eth_init()
  28. */
  29. int fecmxc_initialize(bd_t *bis);
  30. u32 get_ahb_clk(void);
  31. u32 get_periph_clk(void);
  32. int mxs_reset_block(struct mxs_register_32 *reg);
  33. int mxs_wait_mask_set(struct mxs_register_32 *reg,
  34. uint32_t mask,
  35. unsigned int timeout);
  36. int mxs_wait_mask_clr(struct mxs_register_32 *reg,
  37. uint32_t mask,
  38. unsigned int timeout);
  39. #endif