Guest User

451_x1000_EROSQ_V3_LCD_New_Display_GC9A01_Type.diff

a guest
Jul 21st, 2024
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 6.66 KB | Source Code | 0 0
  1. --- a/firmware/target/mips/ingenic_x1000/erosqnative/lcd-erosqnative.c.orig 2024-06-16 10:27:59.251598558 +0200
  2. +++ b/firmware/target/mips/ingenic_x1000/erosqnative/lcd-erosqnative.c  2024-06-21 10:50:28.715569271 +0200
  3. @@ -26,9 +26,139 @@
  4.  #include "gpio-x1000.h"
  5.  #include "system.h"
  6.  
  7. +//#define LCD_TYPE_GC9A01 1 /* Now defined in configure for 248|erosqnative_v3 */
  8. +
  9.  /* for reference on these command/data hex values, see the mipi dcs lcd spec.  *
  10.   * Not everything here is there, but all the standard stuff is.                */
  11.  
  12. +/* New Display Eroq 2.1 / Hifiwalker 1.7+ / Surfans v3.2, unknown Controller  *
  13. + * (partially GC9A01 register compatible)                                     *
  14. + *   https://espruino.microcosm.app/api/v1/files/ \                           *
  15. + *   9dc1b976d621a2ab3854312cce862c4a9a50dc1b.html#GC9A01 ,                   *
  16. + *   https://www.buydisplay.com/download/ic/GC9A01A.pdf ,                     *
  17. + *   https://lcddisplay.co/wp-content/uploads/2023/02/GC9A01.pdf              *
  18. + * Init sequence From 'EROS Q (c口)_V2.1_20231209固件.zip'                  *
  19. + * update.upt/.iso -> In 'uboot.bin' at 0x52da0-0x5305f                       *
  20. + *  http://www.eroshifi.com/download/firmware/122.html                        */
  21. +
  22. +#ifdef LCD_TYPE_GC9A01
  23. +static const uint32_t erosqnative_lcd_cmd_enable[] = {
  24. +
  25. +    /* Unlock EXTC? */
  26. +    LCD_INSTR_CMD,      0xfe, // Inter Register Enable1
  27. +    LCD_INSTR_CMD,      0xef, // Inter Register Enable2
  28. +
  29. +    LCD_INSTR_CMD,      0x36, // Memory Access Control
  30. +/* Bit7 1:vertical flip   0:no vertical flip
  31. +   Bit6 1:horizontal flip 0:no horizontal flip
  32. +   Bit3 1:BGR 0:RGB */
  33. +    LCD_INSTR_DAT,      0x90,
  34. +    /* Pixel Format Set */
  35. +    LCD_INSTR_CMD,      0x3a,
  36. +    LCD_INSTR_DAT,      0x55, /* Rockbox uses 16pp, OF specified 18 bpp */
  37. +
  38. +    LCD_INSTR_CMD,      0x84, // ?? (undocumented)
  39. +    LCD_INSTR_DAT,      0x04,
  40. +    LCD_INSTR_CMD,      0x86, // ??
  41. +    LCD_INSTR_DAT,      0xfb,
  42. +    LCD_INSTR_CMD,      0x87, // ??
  43. +    LCD_INSTR_DAT,      0x79,
  44. +    LCD_INSTR_CMD,      0x89, // ??
  45. +    LCD_INSTR_DAT,      0x0b,
  46. +    LCD_INSTR_CMD,      0x8a, // ??
  47. +    LCD_INSTR_DAT,      0x20,
  48. +    LCD_INSTR_CMD,      0x8b, // ??
  49. +    LCD_INSTR_DAT,      0x80,
  50. +    LCD_INSTR_CMD,      0x8d, // ??
  51. +    LCD_INSTR_DAT,      0x3b,
  52. +    LCD_INSTR_CMD,      0x8e, // ??
  53. +    LCD_INSTR_DAT,      0xcf,
  54. +
  55. +    LCD_INSTR_CMD,      0xec, // Charge Pump Frequent Control
  56. +    LCD_INSTR_DAT,      0x33,
  57. +    LCD_INSTR_DAT,      0x02,
  58. +    LCD_INSTR_DAT,      0x4c,
  59. +
  60. +    LCD_INSTR_CMD,      0x98, // ?? (undocumented)
  61. +    LCD_INSTR_DAT,      0x3e,
  62. +    LCD_INSTR_CMD,      0x9c, // ??
  63. +    LCD_INSTR_DAT,      0x4b,
  64. +    LCD_INSTR_CMD,      0x99, // ??
  65. +    LCD_INSTR_DAT,      0x3e,
  66. +    LCD_INSTR_CMD,      0x9d, // ??
  67. +    LCD_INSTR_DAT,      0x4b,
  68. +    LCD_INSTR_CMD,      0x9b, // ??
  69. +    LCD_INSTR_DAT,      0x55,
  70. +
  71. +    LCD_INSTR_CMD,      0xe8, // Frame Rate
  72. +    LCD_INSTR_DAT,      0x11,
  73. +    LCD_INSTR_DAT,      0x00,
  74. +
  75. +    LCD_INSTR_CMD,      0xff, // ?? (Adafruit & Co lib.  C:0xFF, D:0x60, D:0x01, D:0x04)
  76. +    LCD_INSTR_DAT,      0x62, // LCD_INSTR_DAT, 0x01, LCD_INSTR_DAT, 0x04,
  77. +    LCD_INSTR_CMD,      0xc3, // Vreg1a voltage Control
  78. +    LCD_INSTR_DAT,      0x20,
  79. +    LCD_INSTR_CMD,      0xc4, // Vreg1b voltage Control
  80. +    LCD_INSTR_DAT,      0x03,
  81. +    LCD_INSTR_CMD,      0xc9, // Vreg2a voltage Control
  82. +    LCD_INSTR_DAT,      0x2a,
  83. +
  84. +    LCD_INSTR_CMD,      0xf0, // SET_GAMMA1
  85. +    LCD_INSTR_DAT,      0x4a,
  86. +    LCD_INSTR_DAT,      0x10,
  87. +    LCD_INSTR_DAT,      0x0a,
  88. +    LCD_INSTR_DAT,      0x0a,
  89. +    LCD_INSTR_DAT,      0x26,
  90. +    LCD_INSTR_DAT,      0x39,
  91. +
  92. +    LCD_INSTR_CMD,      0xf2, // SET_GAMMA3
  93. +    LCD_INSTR_DAT,      0x4a,
  94. +    LCD_INSTR_DAT,      0x10,
  95. +    LCD_INSTR_DAT,      0x0a,
  96. +    LCD_INSTR_DAT,      0x0a,
  97. +    LCD_INSTR_DAT,      0x26,
  98. +    LCD_INSTR_DAT,      0x39,
  99. +
  100. +    LCD_INSTR_CMD,      0xf1, // SET_GAMMA2
  101. +    LCD_INSTR_DAT,      0x50,
  102. +    LCD_INSTR_DAT,      0x8f,
  103. +    LCD_INSTR_DAT,      0xaf,
  104. +    LCD_INSTR_DAT,      0x3b,
  105. +    LCD_INSTR_DAT,      0x3f,
  106. +    LCD_INSTR_DAT,      0x7f,
  107. +
  108. +    LCD_INSTR_CMD,      0xf3, // SET_GAMMA4
  109. +    LCD_INSTR_DAT,      0x50,
  110. +    LCD_INSTR_DAT,      0x8f,
  111. +    LCD_INSTR_DAT,      0xaf,
  112. +    LCD_INSTR_DAT,      0x3b,
  113. +    LCD_INSTR_DAT,      0x3f,
  114. +    LCD_INSTR_DAT,      0x7f,
  115. +
  116. +    LCD_INSTR_CMD,      0xba, // TE Control
  117. +    LCD_INSTR_DAT,      0x0a,
  118. +
  119. +#ifdef BOOTLOADER
  120. +    LCD_INSTR_CMD,      0x35, // Tearing Effect Line ON
  121. +    LCD_INSTR_DAT,      0x00,
  122. +#endif
  123. +
  124. +    LCD_INSTR_CMD,      0x21, /* Invert */
  125. +
  126. +    /* Lock EXTC? */
  127. +    LCD_INSTR_CMD,      0xfe, // Inter Register Enable1
  128. +    LCD_INSTR_CMD,      0xee,
  129. +
  130. +    /* Exit Sleep */
  131. +    LCD_INSTR_CMD,      0x11,
  132. +    LCD_INSTR_UDELAY,   120000,
  133. +    /* Display On */
  134. +    LCD_INSTR_CMD,      0x29,
  135. +    LCD_INSTR_UDELAY,   20000,
  136. +    LCD_INSTR_END,
  137. +};
  138. +#else
  139. +/* Original Display / Hifiwalker -1.5 / Surfans -2.7 */
  140.  static const uint32_t erosqnative_lcd_cmd_enable[] = {
  141.      /* Set EXTC? */
  142.      LCD_INSTR_CMD,      0xc8,
  143. @@ -101,6 +220,7 @@
  144.      LCD_INSTR_UDELAY,   20000,
  145.      LCD_INSTR_END,
  146.  };
  147. +#endif
  148.  
  149.  static const uint32_t erosqnative_lcd_of_compat_cmd[] = {
  150.      /* Pixel Format Set */
  151.  
  152. --- a/tools/configure   2024-06-16 15:38:01.000000000 +0200
  153. +++ b/tools/configure   2024-06-21 18:02:51.068247559 +02000
  154. @@ -1676,6 +1676,8 @@
  155.   ==AIGO==                 244) M3K Linux
  156.   245) Eros Q / K          246) M3K baremetal     ==Shanling==
  157.   247) Eros Q / K native                          260) Q1
  158. + 248) Eros Q / K native v3
  159. +      (GC9A01 LCD Controller)
  160.  EOF
  161.  
  162.    buildfor=`input`;
  163. @@ -4192,6 +4194,32 @@
  164.      t_model="erosqnative"
  165.      ;;
  166.  
  167. +    248|erosqnative_v3)
  168. +    target_id=116
  169. +    modelname="erosqnative"
  170. +    target="EROS_QN"
  171. +    memory=32
  172. +    mipsr2elcc
  173. +    appextra="recorder:gui"
  174. +    plugins="yes"
  175. +    tool="$rootdir/tools/scramble -add=erosqnative "
  176. +    boottool="$rootdir/tools/mkspl-x1000 -type=nand -ppb=2 -bpp=2 "
  177. +    output="rockbox.erosq"
  178. +    bootoutput="bootloader.erosq"
  179. +    sysfontbl="16-Terminus"
  180. +    # toolset is the tools within the tools directory that we build for
  181. +    # this particular target.
  182. +    toolset="$x1000tools"
  183. +    bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
  184. +    bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
  185. +    # architecture, manufacturer and model for the target-tree build
  186. +    t_cpu="mips"
  187. +    t_manufacturer="ingenic_x1000"
  188. +    t_model="erosqnative"
  189. +    GCCOPTS="$GCCOPTS -DLCD_TYPE_GC9A01=1"
  190. +    ;;
  191. +
  192. +
  193.     *)
  194.      echo "Please select a supported target platform!"
  195.      exit 7
  196.  
Add Comment
Please, Sign In to add comment