fpga_manager_gen5.h 1.8 KB

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