Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x1000_LCD_8Bit_Data_Tables 'revisited' for cd91c238de + g5877
- These is not intened to make the variables smaller.
- This is intended that the LCD Init Tables entrys are stored as 8Bit entitys vs. 32Bit
- Without this Patch - g5877 lcd-erosqnative.c Dual Model Tables Size:
- (erosqnative_lcd_cmd_enable_v3[] + erosqnative_lcd_cmd_enable_v1[])
- ~1152 Byte allocated as unsigned 32Bit entrys (only 8Bit have meaning)
- With this Patch - g5877 lcd-erosqnative.c Dual Model Tables Size
- ~288 Byte allocated as unsigned 8 Bit entrys.
- (mipsel-elf-objdump -D disassemble and comparison of the File)
- Mips/GCC uses then 'lbu' (Load Byte unsigned 'zero-extended' Mips32 command)
- to access the Entrys
- Saves ~1K in Bootloader and RB Binary (for Tables that are only used 2x in a Power cycle)
- Credit ZappBranigan2972 on forums / F. Jacobsen on the Theme Site
- ---
- --- a/firmware/target/mips/ingenic_x1000/lcd-x1000.h.orig 2024-06-18 11:38:08.040816436 +0200
- +++ b/firmware/target/mips/ingenic_x1000/lcd-x1000.h 2024-06-18 11:38:35.124191578 +0200
- @@ -33,7 +33,7 @@
- #define LCD_INSTR_CMD 0
- #define LCD_INSTR_DAT 1
- -#define LCD_INSTR_UDELAY 2
- +#define LCD_INSTR_MDELAY 2
- #define LCD_INSTR_END 3
- struct lcd_tgt_config {
- @@ -93,7 +93,7 @@
- * - LCD_INSTR_DAT, dat: issue data write of 'dat'
- * - LCD_INSTR_UDELAY, us: call udelay(us)
- */
- -extern void lcd_exec_commands(const uint32_t* cmdseq);
- +extern void lcd_exec_commands(const uint8_t* cmdseq);
- /* Enable/disable the LCD controller.
- *
- --- a/firmware/target/mips/ingenic_x1000/lcd-x1000.c.orig 2024-06-18 11:38:19.486546953 +0200
- +++ b/firmware/target/mips/ingenic_x1000/lcd-x1000.c 2024-06-18 12:05:12.082071560 +0200
- @@ -374,10 +374,10 @@
- #endif
- }
- -void lcd_exec_commands(const uint32_t* cmdseq)
- +void lcd_exec_commands(const uint8_t* cmdseq)
- {
- while(*cmdseq != LCD_INSTR_END) {
- - uint32_t instr = *cmdseq++;
- + uint8_t instr = *cmdseq++;
- uint32_t d = 0;
- switch(instr) {
- case LCD_INSTR_CMD:
- @@ -389,8 +389,8 @@
- lcd_send(d);
- break;
- - case LCD_INSTR_UDELAY:
- - udelay(*cmdseq++);
- + case LCD_INSTR_MDELAY:
- + udelay((*cmdseq++)*1000);
- break;
- default:
- --- a/firmware/target/mips/ingenic_x1000/erosqnative/lcd-erosqnative.c.orig 2024-06-18 12:26:58.623490679 +0200
- +++ b/firmware/target/mips/ingenic_x1000/erosqnative/lcd-erosqnative.c 2024-06-18 12:31:15.322573051 +0200
- @@ -39,7 +39,7 @@
- * Init sequence From 'EROS Q (c口)_V2.1_20231209固件.zip' *
- * update.upt/.iso -> In 'uboot.bin' at 0x52da0-0x5305f *
- * http://www.eroshifi.com/download/firmware/122.html */
- -static const uint32_t erosqnative_lcd_cmd_enable_v3[] = {
- +static const uint8_t erosqnative_lcd_cmd_enable_v3[] = {
- /* Unlock EXTC? */
- LCD_INSTR_CMD, 0xfe, // Inter Register Enable1
- @@ -148,15 +148,15 @@
- /* Exit Sleep */
- LCD_INSTR_CMD, 0x11,
- - LCD_INSTR_UDELAY, 120000,
- + LCD_INSTR_MDELAY, 120, // uint8_t max. 255 (ms)
- /* Display On */
- LCD_INSTR_CMD, 0x29,
- - LCD_INSTR_UDELAY, 20000,
- + LCD_INSTR_MDELAY, 20,
- LCD_INSTR_END,
- };
- /* Original Display / Hifiwalker -1.5 / Surfans -2.7 */
- -static const uint32_t erosqnative_lcd_cmd_enable_v1[] = {
- +static const uint8_t erosqnative_lcd_cmd_enable_v1[] = {
- /* Set EXTC? */
- LCD_INSTR_CMD, 0xc8,
- LCD_INSTR_DAT, 0xff,
- @@ -222,40 +222,40 @@
- LCD_INSTR_DAT, 0x0f,
- /* Exit Sleep */
- LCD_INSTR_CMD, 0x11,
- - LCD_INSTR_UDELAY, 120000,
- + LCD_INSTR_MDELAY, 120,
- /* Display On */
- LCD_INSTR_CMD, 0x29,
- - LCD_INSTR_UDELAY, 20000,
- + LCD_INSTR_MDELAY, 20,
- LCD_INSTR_END,
- };
- -static const uint32_t erosqnative_lcd_of_compat_cmd[] = {
- +static const uint8_t erosqnative_lcd_of_compat_cmd[] = {
- /* Pixel Format Set */
- LCD_INSTR_CMD, 0x3a,
- LCD_INSTR_DAT, 0x66, /* 18 bpp */
- /* Exit Sleep */
- LCD_INSTR_CMD, 0x11,
- - LCD_INSTR_UDELAY, 120000,
- + LCD_INSTR_MDELAY, 120,
- /* Display On */
- LCD_INSTR_CMD, 0x29,
- - LCD_INSTR_UDELAY, 20000,
- + LCD_INSTR_MDELAY, 20,
- LCD_INSTR_END,
- };
- /* sleep and wake copied directly from m3k */
- -static const uint32_t erosqnative_lcd_cmd_sleep[] = {
- +static const uint8_t erosqnative_lcd_cmd_sleep[] = {
- /* Display OFF */
- LCD_INSTR_CMD, 0x28,
- /* Sleep IN */
- LCD_INSTR_CMD, 0x10,
- - LCD_INSTR_UDELAY, 5000,
- + LCD_INSTR_MDELAY, 5,
- LCD_INSTR_END,
- };
- -static const uint32_t erosqnative_lcd_cmd_wake[] = {
- +static const uint8_t erosqnative_lcd_cmd_wake[] = {
- /* Sleep OUT */
- LCD_INSTR_CMD, 0x11,
- - LCD_INSTR_UDELAY, 5000,
- + LCD_INSTR_MDELAY, 5,
- /* Display ON */
- LCD_INSTR_CMD, 0x29,
- LCD_INSTR_END,
- --- a/firmware/target/mips/ingenic_x1000/fiiom3k/lcd-fiiom3k.c.orig 2024-06-25 08:04:30.966090598 +0200
- +++ b/firmware/target/mips/ingenic_x1000/fiiom3k/lcd-fiiom3k.c 2024-06-25 08:07:03.633814997 +0200
- @@ -25,13 +25,13 @@
- #include "gpio-x1000.h"
- #include "system.h"
- -static const uint32_t fiio_lcd_cmd_enable[] = {
- +static const uint8_t fiio_lcd_cmd_enable[] = {
- /* Software reset */
- LCD_INSTR_CMD, 0x01,
- - LCD_INSTR_UDELAY, 120000,
- + LCD_INSTR_MDELAY, 120,
- /* Sleep out */
- LCD_INSTR_CMD, 0x11,
- - LCD_INSTR_UDELAY, 5000,
- + LCD_INSTR_MDELAY, 5,
- /* Memory access order */
- LCD_INSTR_CMD, 0x36,
- LCD_INSTR_DAT, 0x00,
- @@ -127,19 +127,19 @@
- LCD_INSTR_END,
- };
- -static const uint32_t fiio_lcd_cmd_sleep[] = {
- +static const uint8_t fiio_lcd_cmd_sleep[] = {
- /* Display OFF */
- LCD_INSTR_CMD, 0x28,
- /* Sleep IN */
- LCD_INSTR_CMD, 0x10,
- - LCD_INSTR_UDELAY, 5000,
- + LCD_INSTR_MDELAY, 5,
- LCD_INSTR_END,
- };
- -static const uint32_t fiio_lcd_cmd_wake[] = {
- +static const uint8_t fiio_lcd_cmd_wake[] = {
- /* Sleep OUT */
- LCD_INSTR_CMD, 0x11,
- - LCD_INSTR_UDELAY, 5000,
- + LCD_INSTR_MDELAY, 5,
- /* Display ON */
- LCD_INSTR_CMD, 0x29,
- LCD_INSTR_END,
- --- a/firmware/target/mips/ingenic_x1000//shanlingq1/lcd-shanlingq1.c.orig 2024-06-25 08:25:23.439453701 +0200
- +++ b/firmware/target/mips/ingenic_x1000//shanlingq1/lcd-shanlingq1.c 2024-06-25 08:26:30.902062549 +0200
- @@ -27,7 +27,7 @@
- /* LCD controller is probably an RM68090.
- */
- -static const uint32_t q1_lcd_cmd_enable[] = {
- +static const uint8_t q1_lcd_cmd_enable[] = {
- LCD_INSTR_CMD, 0x00,
- LCD_INSTR_CMD, 0xbe,
- LCD_INSTR_DAT, 0xc3,
- @@ -321,7 +321,7 @@
- /* NOTE this sleep mode may not be saving power, but it gets rid of the
- * ghost image that would otherwise remain on the display */
- -static const uint32_t q1_lcd_cmd_sleep[] = {
- +static const uint8_t q1_lcd_cmd_sleep[] = {
- LCD_INSTR_CMD, 0x00,
- LCD_INSTR_CMD, 0x10,
- LCD_INSTR_DAT, 0x00,
- @@ -335,7 +335,7 @@
- LCD_INSTR_END,
- };
- -static const uint32_t q1_lcd_cmd_wake[] = {
- +static const uint8_t q1_lcd_cmd_wake[] = {
- LCD_INSTR_CMD, 0x00,
- LCD_INSTR_CMD, 0x07,
- LCD_INSTR_DAT, 0x01,
Advertisement
Add Comment
Please, Sign In to add comment