Skip to content

Commit

Permalink
Add video driver name and parameters to kernel (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiopex authored Dec 28, 2023
1 parent 6c11efd commit c1cfb1c
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions drivers/video/sunxi/sunxi_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static uint8_t readID(void) {
env_set("CONSOLE_VIDEO", "r61520fb.ko");
env_set("CONSOLE_PARAMETERS", "version=1 lowcurrent=1");
env_set("FORCE_VERSION", "bittboy2x_v1");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=1 miyoo_kbd.miyoo_layout=3 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=1");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=1 miyoo_kbd.miyoo_layout=3 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=1 miyoo-video.driver='r61520fb version=1 lowcurrent=1'");
writeScreenReg = 0x2c;
madctlCmd = 0xe0;
invert = 0x20;
Expand All @@ -203,7 +203,7 @@ static uint8_t readID(void) {
env_set("CONSOLE_VIDEO", "st7789sfb.ko");
env_set("CONSOLE_PARAMETERS", "flip=1 lowcurrent=1");
env_set("FORCE_VERSION", "bittboy2x_v2");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=1 miyoo_kbd.miyoo_layout=3 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=1 miyoo_kbd.miyoo_layout=3 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2 miyoo-video.driver='st7789sfb flip=1 lowcurrent=1'");
writeScreenReg = 0x2c;
madctlCmd = 0x70;
invert = 0x20;
Expand All @@ -213,7 +213,7 @@ static uint8_t readID(void) {
env_set("CONSOLE_VIDEO", "st7789sfb.ko");
env_set("CONSOLE_PARAMETERS", "flip=1 lowcurrent=1");
env_set("FORCE_VERSION", "bittboy3.5");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=7 miyoo_kbd.miyoo_layout=3 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=7 miyoo_kbd.miyoo_layout=3 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2 miyoo-video.driver='st7789sfb flip=1 lowcurrent=1'");
writeScreenReg = 0x2c;
madctlCmd = 0x70;
invert = 0x20;
Expand All @@ -223,7 +223,7 @@ static uint8_t readID(void) {
env_set("CONSOLE_VIDEO", "r61520fb.ko");
env_set("CONSOLE_PARAMETERS", "version=1 flip=1 invert=1 lowcurrent=1");
env_set("FORCE_VERSION", "m3_r61520");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=3 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=2 miyoo-battery.use_charge_status=1");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=3 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=2 miyoo-battery.use_charge_status=1 miyoo-video.driver='r61520fb version=1 flip=1 invert=1 lowcurrent=1'");
writeScreenReg = 0x2c;
madctlCmd = 0x38;
invert = 0x21;
Expand All @@ -233,39 +233,39 @@ static uint8_t readID(void) {
env_set("CONSOLE_VIDEO", "rm68090fb.ko");
env_set("CONSOLE_PARAMETERS", "");
env_set("FORCE_VERSION", "m3_rm68090");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=3 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=2 miyoo-battery.use_charge_status=1");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=3 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=2 miyoo-battery.use_charge_status=1 miyoo-video.driver='rm68090fb'");
writeScreenReg = 0x22;
return 5;
}
if (console_variant && !strcmp(console_variant, "m3_hx8347d")) {
env_set("CONSOLE_VIDEO", "hx8347dfb.ko");
env_set("CONSOLE_PARAMETERS", "");
env_set("FORCE_VERSION", "m3_hx8347d");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=3 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=2 miyoo-battery.use_charge_status=1");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=3 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=2 miyoo-battery.use_charge_status=1 miyoo-video.driver='hx8347dfb'");
writeScreenReg = 0x22;
return 6;
}
if (console_variant && !strcmp(console_variant, "m3_gc9306")) {
env_set("CONSOLE_VIDEO", "gc9306fb.ko");
env_set("CONSOLE_PARAMETERS", "");
env_set("FORCE_VERSION", "m3_gc9306");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=3 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=2 miyoo-battery.use_charge_status=1");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=3 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=2 miyoo-battery.use_charge_status=1 miyoo-video.driver='gc9306fb'");
writeScreenReg = 0x2c;
return 4;
}
if (console_variant && !strcmp(console_variant, "xyc_gc9306")) {
env_set("CONSOLE_VIDEO", "gc9306fb.ko");
env_set("CONSOLE_PARAMETERS", "");
env_set("FORCE_VERSION", "xyc_gc9306");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=4 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=3");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=4 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=3 miyoo-video.driver='gc9306fb'");
writeScreenReg = 0x2c;
return 4;
}
if (console_variant && !strcmp(console_variant, "pocketgo")) {
env_set("CONSOLE_VIDEO", "st7789sfb.ko");
env_set("CONSOLE_PARAMETERS", "lowcurrent=1");
env_set("FORCE_VERSION", "pocketgo");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=2 miyoo_kbd.miyoo_layout=1 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=2 miyoo_kbd.miyoo_layout=1 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2 miyoo-video.driver='st7789sfb lowcurrent=1'");
writeScreenReg = 0x2c;
madctlCmd = 0xB0;
invert = 0x20;
Expand All @@ -275,7 +275,7 @@ static uint8_t readID(void) {
env_set("CONSOLE_VIDEO", "st7789sTEfb.ko");
env_set("CONSOLE_PARAMETERS", "");
env_set("FORCE_VERSION", "pocketgo_TE");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=2 miyoo_kbd.miyoo_layout=1 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=2 miyoo_kbd.miyoo_layout=1 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2 miyoo-video.driver='st7789sTEfb'");
writeScreenReg = 0x2c;
madctlCmd = 0xB0;
invert = 0x20;
Expand All @@ -288,7 +288,7 @@ static uint8_t readID(void) {
env_set("FORCE_VERSION", "q20");
else
env_set("FORCE_VERSION", "q90");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=6 miyoo_kbd.miyoo_layout=1 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=6 miyoo_kbd.miyoo_layout=1 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2 miyoo-video.driver='st7789sfb lowcurrent=1'");
writeScreenReg = 0x2c;
madctlCmd = 0xB0;
invert = 0x20;
Expand All @@ -298,7 +298,7 @@ static uint8_t readID(void) {
env_set("CONSOLE_VIDEO", "st7789sfb.ko");
env_set("CONSOLE_PARAMETERS", "lowcurrent=1");
env_set("FORCE_VERSION", "v90");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=5 miyoo_kbd.miyoo_layout=1 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=5 miyoo_kbd.miyoo_layout=1 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2 miyoo-video.driver='st7789sfb lowcurrent=1'");
writeScreenReg = 0x2c;
madctlCmd = 0xB0;
invert = 0x20;
Expand All @@ -324,7 +324,7 @@ static uint8_t readID(void) {
env_set("CONSOLE_VIDEO", "rm68090fb.ko");
env_set("CONSOLE_PARAMETERS", "");
env_set("DETECTED_VERSION", "RM68090 controller");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=3 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=2 miyoo-battery.use_charge_status=1");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=3 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=2 miyoo-battery.use_charge_status=1 miyoo-video.driver='rm68090fb'");
writeScreenReg = 0x22;
return 5;
}
Expand All @@ -350,7 +350,7 @@ static uint8_t readID(void) {
env_set("CONSOLE_VIDEO", "r61520fb.ko");
env_set("CONSOLE_PARAMETERS", "version=1 lowcurrent=1");
env_set("DETECTED_VERSION", "R61520 controller");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=1 miyoo_kbd.miyoo_layout=1 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=1");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=1 miyoo_kbd.miyoo_layout=1 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=1 miyoo-video.driver='r61520fb version=1 lowcurrent=1'");
madctlCmd = 0xe0;
invert = 0x20;
writeScreenReg = 0x2c;
Expand All @@ -364,7 +364,7 @@ static uint8_t readID(void) {
env_set("CONSOLE_VIDEO", "r61520fb.ko");
env_set("CONSOLE_PARAMETERS", "version=1 lowcurrent=1");
env_set("DETECTED_VERSION", "bittboy2x_v1 r61520fb controller");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=1 miyoo_kbd.miyoo_layout=3 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=1");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=1 miyoo_kbd.miyoo_layout=3 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=1 miyoo-video.driver='r61520fb version=1 lowcurrent=1'");
return 1;
}
miyoo_ver = 2;
Expand All @@ -373,14 +373,14 @@ static uint8_t readID(void) {
env_set("DETECTED_VERSION", "bittboy3.5/bittboy2x_v2 ST7789S controller");
env_set("CONSOLE_PARAMETERS", "lowcurrent=1 flip=1");
if (!strcmp(console_variant, "bittboy3"))
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=7 miyoo_kbd.miyoo_layout=3 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=7 miyoo_kbd.miyoo_layout=3 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2 miyoo-video.driver='st7789sfb lowcurrent=1 flip=1'");
else
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=1 miyoo_kbd.miyoo_layout=3 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=1 miyoo_kbd.miyoo_layout=3 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2 miyoo-video.driver='st7789sfb lowcurrent=1 flip=1'");
} else {
madctlCmd = 0xB0;
env_set("DETECTED_VERSION", "V90/Q90/Q20/PocketGo ST7789S controller");
env_set("CONSOLE_PARAMETERS", "lowcurrent=1");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=2 miyoo_kbd.miyoo_layout=1 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=2 miyoo_kbd.miyoo_layout=1 miyoo.miyoo_snd=1 pwm-suniv.motor_ver=2 miyoo-video.driver='st7789sfb lowcurrent=1'");
}
invert = 0x20;
writeScreenReg = 0x2c;
Expand All @@ -391,7 +391,7 @@ static uint8_t readID(void) {
env_set("CONSOLE_VIDEO", "r61520fb.ko");
env_set("CONSOLE_PARAMETERS", "version=3");
env_set("DETECTED_VERSION", "R61505W controller");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=2 miyoo_kbd.miyoo_layout=1 miyoo.miyoo_snd=1");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=2 miyoo_kbd.miyoo_layout=1 miyoo.miyoo_snd=1 miyoo-video.driver='r61520fb version=3'");
madctlCmd = 0xB0;
invert = 0x20;
writeScreenReg = 0x2c;
Expand All @@ -402,17 +402,17 @@ static uint8_t readID(void) {
env_set("CONSOLE_PARAMETERS", "");
env_set("DETECTED_VERSION", "GC9306/GC9305 controller from gc9306fb");
if (!strcmp(console_variant, "xyc"))
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=4 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=3");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=4 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=3 miyoo-video.driver='gc9306fb'");
else
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=3 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=2 miyoo-battery.use_charge_status=1");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=3 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=2 miyoo-battery.use_charge_status=1 miyoo-video.driver='gc9306fb'");
writeScreenReg = 0x2c;
return 4;
}
if ((ver[0] == 0x00) && (ver[1] == 0x98) && (ver[2] == 0x51) && (ver[3] == 0x01)) { // SUP M3 unknown controller Works with R61520.
env_set("CONSOLE_VIDEO", "r61520fb.ko");
env_set("CONSOLE_PARAMETERS", "version=1 flip=1 invert=1 lowcurrent=1");
env_set("DETECTED_VERSION", "SUP M3 unknown controller Works with R61520");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=3 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=2 miyoo-battery.use_charge_status=1");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=3 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=2 miyoo-battery.use_charge_status=1 miyoo-video.driver='r61520fb version=1 flip=1 invert=1 lowcurrent=1'");
madctlCmd = 0x38;
invert = 0x21;
writeScreenReg = 0x2c;
Expand All @@ -422,15 +422,15 @@ static uint8_t readID(void) {
env_set("CONSOLE_VIDEO", "hx8347dfb.ko");
env_set("CONSOLE_PARAMETERS", "");
env_set("DETECTED_VERSION", "HX8347-D controller");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=3 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=2 miyoo-battery.use_charge_status=1");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=3 miyoo_kbd.miyoo_layout=4 miyoo.miyoo_snd=2 miyoo-battery.use_charge_status=1 miyoo-video.driver='hx8347dfb'");
writeScreenReg = 0x22;
return 6;
}

env_set("CONSOLE_VIDEO", "r61520fb.ko");
env_set("CONSOLE_PARAMETERS", "debug=1");
env_set("DETECTED_VERSION", "UNKNOWN");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=1 miyoo_kbd.miyoo_layout=1 miyoo.miyoo_snd=1");
env_set("bootcmd_args", "setenv bootargs ${bootargs} miyoo_kbd.miyoo_ver=1 miyoo_kbd.miyoo_layout=1 miyoo.miyoo_snd=1 miyoo-video.driver='r61520fb debug=1'");
writeScreenReg = 0x2c;
madctlCmd = 0xe0;
invert = 0x20;
Expand Down

0 comments on commit c1cfb1c

Please sign in to comment.