ast_reg.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /* SPDX-License-Identifier: MIT */
  2. #ifndef __AST_REG_H__
  3. #define __AST_REG_H__
  4. #include <linux/bits.h>
  5. /*
  6. * Modesetting
  7. */
  8. #define AST_IO_MM_OFFSET (0x380)
  9. #define AST_IO_MM_LENGTH (128)
  10. #define AST_IO_VGAARI_W (0x40)
  11. #define AST_IO_VGAMR_W (0x42)
  12. #define AST_IO_VGAMR_R (0x4c)
  13. #define AST_IO_VGAMR_IOSEL BIT(0)
  14. #define AST_IO_VGAER (0x43)
  15. #define AST_IO_VGAER_VGA_ENABLE BIT(0)
  16. #define AST_IO_VGASRI (0x44)
  17. #define AST_IO_VGASR1_SD BIT(5)
  18. #define AST_IO_VGADRR (0x47)
  19. #define AST_IO_VGADWR (0x48)
  20. #define AST_IO_VGAPDR (0x49)
  21. #define AST_IO_VGAGRI (0x4E)
  22. #define AST_IO_VGACRI (0x54)
  23. #define AST_IO_VGACR80_PASSWORD (0xa8)
  24. #define AST_IO_VGACRA1_VGAIO_DISABLED BIT(1)
  25. #define AST_IO_VGACRA1_MMIO_ENABLED BIT(2)
  26. #define AST_IO_VGACRB6_HSYNC_OFF BIT(0)
  27. #define AST_IO_VGACRB6_VSYNC_OFF BIT(1)
  28. #define AST_IO_VGACRCB_HWC_16BPP BIT(0) /* set: ARGB4444, cleared: 2bpp palette */
  29. #define AST_IO_VGACRCB_HWC_ENABLED BIT(1)
  30. #define AST_IO_VGACRD1_MCU_FW_EXECUTING BIT(5)
  31. #define AST_IO_VGACRD7_EDID_VALID_FLAG BIT(0)
  32. #define AST_IO_VGACRDC_LINK_SUCCESS BIT(0)
  33. #define AST_IO_VGACRDF_HPD BIT(0)
  34. #define AST_IO_VGACRE5_EDID_READ_DONE BIT(0)
  35. #define AST_IO_VGAIR1_R (0x5A)
  36. #define AST_IO_VGAIR1_VREFRESH BIT(3)
  37. /*
  38. * Display Transmitter Type
  39. */
  40. #define TX_TYPE_MASK GENMASK(3, 1)
  41. #define NO_TX (0 << 1)
  42. #define ITE66121_VBIOS_TX (1 << 1)
  43. #define SI164_VBIOS_TX (2 << 1)
  44. #define CH7003_VBIOS_TX (3 << 1)
  45. #define DP501_VBIOS_TX (4 << 1)
  46. #define ANX9807_VBIOS_TX (5 << 1)
  47. #define TX_FW_EMBEDDED_FW_TX (6 << 1)
  48. #define ASTDP_DPMCU_TX (7 << 1)
  49. #define AST_VRAM_INIT_STATUS_MASK GENMASK(7, 6)
  50. //#define AST_VRAM_INIT_BY_BMC BIT(7)
  51. //#define AST_VRAM_INIT_READY BIT(6)
  52. /*
  53. * AST DisplayPort
  54. */
  55. /* Define for Soc scratched reg used on ASTDP */
  56. #define AST_DP_PHY_SLEEP BIT(4)
  57. #define AST_DP_VIDEO_ENABLE BIT(0)
  58. /*
  59. * CRDF[b4]: Mirror of AST_DP_VIDEO_ENABLE
  60. * Precondition: A. ~AST_DP_PHY_SLEEP &&
  61. * B. DP_HPD &&
  62. * C. DP_LINK_SUCCESS
  63. */
  64. #define ASTDP_MIRROR_VIDEO_ENABLE BIT(4)
  65. /*
  66. * ASTDP setmode registers:
  67. * CRE0[7:0]: MISC0 ((0x00: 18-bpp) or (0x20: 24-bpp)
  68. * CRE1[7:0]: MISC1 (default: 0x00)
  69. * CRE2[7:0]: video format index (0x00 ~ 0x20 or 0x40 ~ 0x50)
  70. */
  71. #define ASTDP_MISC0_24bpp BIT(5)
  72. #define ASTDP_MISC1 0
  73. #define ASTDP_AND_CLEAR_MASK 0x00
  74. #endif