cpld.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright 2014 Freescale Semiconductor
  4. */
  5. /*
  6. * CPLD register set of T2080RDB board-specific.
  7. */
  8. struct cpld_data {
  9. u8 chip_id1; /* 0x00 - Chip ID1 register */
  10. u8 chip_id2; /* 0x01 - Chip ID2 register */
  11. u8 hw_ver; /* 0x02 - Hardware Revision Register */
  12. u8 sw_ver; /* 0x03 - Software Revision register */
  13. u8 res0[12]; /* 0x04 - 0x0F - not used */
  14. u8 reset_ctl; /* 0x10 - Reset control Register */
  15. u8 flash_csr; /* 0x11 - Flash control and status register */
  16. u8 thermal_csr; /* 0x12 - Thermal control and status register */
  17. u8 led_csr; /* 0x13 - LED control and status register */
  18. u8 sfp_csr; /* 0x14 - SFP+ control and status register */
  19. u8 misc_csr; /* 0x15 - Misc control and status register */
  20. u8 boot_or; /* 0x16 - Boot config override register */
  21. u8 boot_cfg1; /* 0x17 - Boot configuration register 1 */
  22. u8 boot_cfg2; /* 0x18 - Boot configuration register 2 */
  23. } cpld_data_t;
  24. u8 cpld_read(unsigned int reg);
  25. void cpld_write(unsigned int reg, u8 value);
  26. #define CPLD_READ(reg) cpld_read(offsetof(struct cpld_data, reg))
  27. #define CPLD_WRITE(reg, value) \
  28. cpld_write(offsetof(struct cpld_data, reg), value)
  29. /* CPLD on IFC */
  30. #define CPLD_LBMAP_MASK 0x3F
  31. #define CPLD_BANK_SEL_MASK 0x07
  32. #define CPLD_BANK_OVERRIDE 0x40
  33. #define CPLD_LBMAP_ALTBANK 0x44 /* BANK OR | BANK 4 */
  34. #define CPLD_LBMAP_DFLTBANK 0x40 /* BANK OR | BANK 0 */
  35. #define CPLD_LBMAP_RESET 0xFF
  36. #define CPLD_LBMAP_SHIFT 0x03
  37. #define CPLD_BOOT_SEL 0x80
  38. /* RSTCON Register */
  39. #define CPLD_RSTCON_EDC_RST 0x04