fpga_manager.h 830 B

12345678910111213141516171819202122232425262728293031323334
  1. /* SPDX-License-Identifier: BSD-3-Clause */
  2. /*
  3. * Copyright (C) 2012-2017 Altera Corporation <www.altera.com>
  4. * All rights reserved.
  5. */
  6. #ifndef _FPGA_MANAGER_H_
  7. #define _FPGA_MANAGER_H_
  8. #include <altera.h>
  9. #if defined(CONFIG_TARGET_SOCFPGA_GEN5)
  10. #include <asm/arch/fpga_manager_gen5.h>
  11. #elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
  12. #include <asm/arch/fpga_manager_arria10.h>
  13. #endif
  14. /* FPGA CD Ratio Value */
  15. #define CDRATIO_x1 0x0
  16. #define CDRATIO_x2 0x1
  17. #define CDRATIO_x4 0x2
  18. #define CDRATIO_x8 0x3
  19. #ifndef __ASSEMBLY__
  20. /* Common prototypes */
  21. int fpgamgr_get_mode(void);
  22. int fpgamgr_poll_fpga_ready(void);
  23. void fpgamgr_program_write(const void *rbf_data, size_t rbf_size);
  24. int fpgamgr_test_fpga_ready(void);
  25. int fpgamgr_dclkcnt_set(unsigned long cnt);
  26. #endif /* __ASSEMBLY__ */
  27. #endif /* _FPGA_MANAGER_H_ */