cpld.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright 2015 Freescale Semiconductor
  4. */
  5. #ifndef __CPLD_H__
  6. #define __CPLD_H__
  7. /*
  8. * CPLD register set of LS1043ARDB board-specific.
  9. */
  10. struct cpld_data {
  11. u8 cpld_ver; /* 0x0 - CPLD Major Revision Register */
  12. u8 cpld_ver_sub; /* 0x1 - CPLD Minor Revision Register */
  13. u8 pcba_ver; /* 0x2 - PCBA Revision Register */
  14. u8 system_rst; /* 0x3 - system reset register */
  15. u8 soft_mux_on; /* 0x4 - Switch Control Enable Register */
  16. u8 cfg_rcw_src1; /* 0x5 - Reset config word 1 */
  17. u8 cfg_rcw_src2; /* 0x6 - Reset config word 1 */
  18. u8 vbank; /* 0x7 - Flash bank selection Control */
  19. u8 sysclk_sel; /* 0x8 - */
  20. u8 uart_sel; /* 0x9 - */
  21. u8 sd1refclk_sel; /* 0xA - */
  22. u8 tdmclk_mux_sel; /* 0xB - */
  23. u8 sdhc_spics_sel; /* 0xC - */
  24. u8 status_led; /* 0xD - */
  25. u8 global_rst; /* 0xE - */
  26. };
  27. u8 cpld_read(unsigned int reg);
  28. void cpld_write(unsigned int reg, u8 value);
  29. void cpld_rev_bit(unsigned char *value);
  30. #define CPLD_READ(reg) cpld_read(offsetof(struct cpld_data, reg))
  31. #define CPLD_WRITE(reg, value) \
  32. cpld_write(offsetof(struct cpld_data, reg), value)
  33. /* CPLD on IFC */
  34. #define CPLD_SW_MUX_BANK_SEL 0x40
  35. #define CPLD_BANK_SEL_MASK 0x07
  36. #define CPLD_BANK_SEL_ALTBANK 0x04
  37. #define CPLD_CFG_RCW_SRC_NOR 0x025
  38. #define CPLD_CFG_RCW_SRC_NAND 0x106
  39. #define CPLD_CFG_RCW_SRC_SD 0x040
  40. #endif