fpga_manager_gen5.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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_GEN5_H_
  7. #define _FPGA_MANAGER_GEN5_H_
  8. #define FPGAMGRREGS_STAT_MODE_MASK 0x7
  9. #define FPGAMGRREGS_STAT_MSEL_MASK 0xf8
  10. #define FPGAMGRREGS_STAT_MSEL_LSB 3
  11. #define FPGAMGRREGS_CTRL_CFGWDTH_MASK BIT(9)
  12. #define FPGAMGRREGS_CTRL_AXICFGEN_MASK BIT(8)
  13. #define FPGAMGRREGS_CTRL_NCONFIGPULL_MASK BIT(2)
  14. #define FPGAMGRREGS_CTRL_NCE_MASK BIT(1)
  15. #define FPGAMGRREGS_CTRL_EN_MASK BIT(0)
  16. #define FPGAMGRREGS_CTRL_CDRATIO_LSB 6
  17. #define FPGAMGRREGS_MON_GPIO_EXT_PORTA_CRC_MASK BIT(3)
  18. #define FPGAMGRREGS_MON_GPIO_EXT_PORTA_ID_MASK BIT(2)
  19. #define FPGAMGRREGS_MON_GPIO_EXT_PORTA_CD_MASK BIT(1)
  20. #define FPGAMGRREGS_MON_GPIO_EXT_PORTA_NS_MASK BIT(0)
  21. /* FPGA Mode */
  22. #define FPGAMGRREGS_MODE_FPGAOFF 0x0
  23. #define FPGAMGRREGS_MODE_RESETPHASE 0x1
  24. #define FPGAMGRREGS_MODE_CFGPHASE 0x2
  25. #define FPGAMGRREGS_MODE_INITPHASE 0x3
  26. #define FPGAMGRREGS_MODE_USERMODE 0x4
  27. #define FPGAMGRREGS_MODE_UNKNOWN 0x5
  28. #ifndef __ASSEMBLY__
  29. struct socfpga_fpga_manager {
  30. /* FPGA Manager Module */
  31. u32 stat; /* 0x00 */
  32. u32 ctrl;
  33. u32 dclkcnt;
  34. u32 dclkstat;
  35. u32 gpo; /* 0x10 */
  36. u32 gpi;
  37. u32 misci; /* 0x18 */
  38. u32 _pad_0x1c_0x82c[517];
  39. /* Configuration Monitor (MON) Registers */
  40. u32 gpio_inten; /* 0x830 */
  41. u32 gpio_intmask;
  42. u32 gpio_inttype_level;
  43. u32 gpio_int_polarity;
  44. u32 gpio_intstatus; /* 0x840 */
  45. u32 gpio_raw_intstatus;
  46. u32 _pad_0x848;
  47. u32 gpio_porta_eoi;
  48. u32 gpio_ext_porta; /* 0x850 */
  49. u32 _pad_0x854_0x85c[3];
  50. u32 gpio_1s_sync; /* 0x860 */
  51. u32 _pad_0x864_0x868[2];
  52. u32 gpio_ver_id_code;
  53. u32 gpio_config_reg2; /* 0x870 */
  54. u32 gpio_config_reg1;
  55. };
  56. #endif /* __ASSEMBLY__ */
  57. #endif /* _FPGA_MANAGER_GEN5_H_ */