-
将uboot-board.dts的lcd注释掉,colorbar不在闪屏。
-
lcd_gpio_0、lcd_gpio_1、lcd_gpio_2、lcd_gpio_3,依旧没能初始化。原因未知。
目前显示效果如下:
以下是完整的patch, 在tina v2.0验证成功。
Index: tina-d1-h/device/config/chips/d1-h/configs/nezha/linux-5.4/board.dts
===================================================================
--- tina-d1-h.orig/device/config/chips/d1-h/configs/nezha/linux-5.4/board.dts
+++ tina-d1-h/device/config/chips/d1-h/configs/nezha/linux-5.4/board.dts
@@ -15,7 +15,6 @@
aliases {
dsp0 = &dsp0;
dsp0_gpio_int= &dsp0_gpio_int;
- gmac0 = &gmac0;
};
dsp0: dsp0 {
@@ -31,7 +30,7 @@
reg_vdd_cpu: vdd-cpu {
compatible = "sunxi-pwm-regulator";
- pwms = <&pwm 0 5000 1>;
+ pwms = <&pwm 0 5000 0>;
regulator-name = "vdd_cpu";
regulator-min-microvolt = <810000>;
regulator-max-microvolt = <1160000>;
@@ -47,7 +46,15 @@
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-enable-ramp-delay = <1000>;
- gpio = <&pio PD 19 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
+ reg_3v3: vdd_3v3 {
+ compatible = "regulator-fixed";
+ regulator-name = "vdd_3v3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-enable-ramp-delay = <1000>;
enable-active-high;
};
};
@@ -58,8 +65,7 @@
&pio {
sdc0_pins_a: sdc0@0 {
- allwinner,pins = "PF0", "PF1", "PF2",
- "PF3", "PF4", "PF5";
+ allwinner,pins = "PF0", "PF1", "PF2", "PF3", "PF4", "PF5";
allwinner,function = "sdc0";
allwinner,muxsel = <2>;
allwinner,drive = <3>;
@@ -74,8 +80,7 @@
sdc0_pins_b: sdc0@1 {
- pins = "PF0", "PF1", "PF2",
- "PF3", "PF4", "PF5";
+ pins = "PF0", "PF1", "PF2", "PF3", "PF4", "PF5";
function = "sdc0";
drive-strength = <30>;
bias-pull-up;
@@ -83,8 +88,7 @@
};
sdc0_pins_c: sdc0@2 {
- pins = "PF0", "PF1", "PF2",
- "PF3", "PF4", "PF5";
+ pins = "PF0", "PF1", "PF2", "PF3", "PF4", "PF5";
function = "gpio_in";
};
@@ -97,8 +101,7 @@
};
sdc0_pins_e: sdc0@4 {
- pins = "PF0", "PF1", "PF3",
- "PF5";
+ pins = "PF0", "PF1", "PF3", "PF5";
function = "jtag";
drive-strength = <10>;
bias-pull-up;
@@ -106,36 +109,31 @@
sdc1_pins_a: sdc1@0 {
- pins = "PG0", "PG1", "PG2",
- "PG3", "PG4", "PG5";
+ pins = "PG0", "PG1", "PG2", "PG3", "PG4", "PG5";
function = "sdc1";
drive-strength = <30>;
bias-pull-up;
};
sdc1_pins_b: sdc1@1 {
- pins = "PG0", "PG1", "PG2",
- "PG3", "PG4", "PG5";
+ pins = "PG0", "PG1", "PG2", "PG3", "PG4", "PG5";
function = "gpio_in";
};
sdc2_pins_a: sdc2@0 {
- allwinner,pins = "PC2", "PC3", "PC4",
- "PC5", "PC6", "PC7";
+ allwinner,pins = "PC2", "PC3", "PC4", "PC5", "PC6", "PC7";
allwinner,function = "sdc2";
allwinner,muxsel = <3>;
allwinner,drive = <3>;
allwinner,pull = <1>;
- pins = "PC2", "PC3", "PC4",
- "PC5", "PC6", "PC7";
+ pins = "PC2", "PC3", "PC4", "PC5", "PC6", "PC7";
function = "sdc2";
drive-strength = <30>;
bias-pull-up;
};
sdc2_pins_b: sdc2@1 {
- pins = "PC2", "PC3", "PC4",
- "PC5", "PC6", "PC7";
+ pins = "PC2", "PC3", "PC4", "PC5", "PC6", "PC7";
function = "gpio_in";
};
@@ -234,62 +232,42 @@
gmac_pins_a: gmac@0 {
pins = "PE0", "PE1", "PE2", "PE3",
- "PE4", "PE5", "PE6", "PE7",
- "PE8", "PE9", "PE10", "PE11",
- "PE12", "PE13", "PE14", "PE15";
+ "PE4", "PE5", "PE6", "PE7",
+ "PE8", "PE9";
function = "gmac0";
- muxsel = <8>; /* for uboot driver */
drive-strength = <10>;
};
gmac_pins_b: gmac@1 {
pins = "PE0", "PE1", "PE2", "PE3",
- "PE4", "PE5", "PE6", "PE7",
- "PE8", "PE9", "PE10", "PE11",
- "PE12", "PE13", "PE14", "PE15";
+ "PE4", "PE5", "PE6", "PE7",
+ "PE8", "PE9";
function = "gpio_in";
};
dmic_pins_a: dmic@0 {
/* DMIC_PIN: CLK, DATA0, DATA1, DATA2 */
- pins = "PE17", "PB11", "PB10", "PD17";
+ pins = "PE17", "PB11";
function = "dmic";
drive-strength = <20>;
bias-disable;
};
dmic_pins_b: dmic@1 {
- pins = "PE17", "PB11", "PB10", "PD17";
+ pins = "PE17", "PB11";
function = "io_disabled";
drive-strength = <20>;
bias-disable;
};
daudio0_pins_a: daudio0@0 {
- /* MCLK, BCLK, LRCK */
- pins = "PE17", "PE16", "PE15";
+ pins = "PE17", "PE16", "PE15", "PE14", "PE13";
function = "i2s0";
drive-strength = <20>;
bias-disable;
};
- daudio0_pins_b: daudio0@1 {
- /* DIN0 */
- pins = "PE14";
- function = "i2s0_din";
- drive-strength = <20>;
- bias-disable;
- };
-
- daudio0_pins_c: daudio0@2 {
- /* DOUT0 */
- pins = "PE13";
- function = "i2s0_dout";
- drive-strength = <20>;
- bias-disable;
- };
-
- daudio0_pins_d: daudio0_sleep@0 {
+ daudio0_pins_b: daudio0_sleep@0 {
pins = "PE17", "PE16", "PE15", "PE14", "PE13";
function = "io_disabled";
drive-strength = <20>;
@@ -297,30 +275,13 @@
};
daudio1_pins_a: daudio1@0 {
- /* MCLK, LRCK, BCLK */
- pins = "PG11", "PG12", "PG13";
+ pins = "PG11", "PG12", "PG13", "PG14", "PG15";
function = "i2s1";
drive-strength = <20>;
bias-disable;
};
- daudio1_pins_b: daudio1@1 {
- /* DIN0 */
- pins = "PG14";
- function = "i2s1_din";
- drive-strength = <20>;
- bias-disable;
- };
-
- daudio1_pins_c: daudio1@2 {
- /* DOUT0 */
- pins = "PG15";
- function = "i2s1_dout";
- drive-strength = <20>;
- bias-disable;
- };
-
- daudio1_pins_d: daudio1_sleep@0 {
+ daudio1_pins_b: daudio1_sleep@0 {
pins = "PG11", "PG12", "PG13", "PG14", "PG15";
function = "io_disabled";
drive-strength = <20>;
@@ -374,7 +335,7 @@
};
spi0_pins_a: spi0@0 {
- pins = "PC2", "PC4", "PC5"; /* clk, mosi, miso */
+ pins = "PC2", "PC4", "PC5","PC7", "PC6"; /*clk mosi miso hold wp*/
function = "spi0";
muxsel = <2>;
drive-strength = <10>;
@@ -385,7 +346,7 @@
function = "spi0";
muxsel = <2>;
drive-strength = <10>;
- bias-pull-up; /* cs, hold, wp should be pulled up */
+ bias-pull-up; /* only CS should be pulled up */
};
spi0_pins_c: spi0@2 {
@@ -396,16 +357,16 @@
};
spi1_pins_a: spi1@0 {
- pins = "PD11", "PD12", "PD13"; /* clk, mosi, miso */
+ pins = "PD11", "PD12", "PD13","PD14", "PD15"; /*clk mosi miso hold wp*/
function = "spi1";
drive-strength = <10>;
};
spi1_pins_b: spi1@1 {
- pins = "PD10", "PD14", "PD15";
+ pins = "PD10";
function = "spi1";
drive-strength = <10>;
- bias-pull-up; /* cs, hold, wp should be pulled up */
+ bias-pull-up; // only CS should be pulled up
};
spi1_pins_c: spi1@2 {
@@ -447,9 +408,9 @@
pwm2_pin_b: pwm2@1 {
pins = "PD18";
- function = "gpio_out";
+ function = "gpio_in";
};
-/*
+
pwm7_pin_a: pwm7@0 {
pins = "PD22";
function = "pwm7";
@@ -461,7 +422,6 @@
pins = "PD22";
function = "gpio_in";
};
-*/
s_cir0_pins_a: s_cir@0 {
pins = "PB12";
@@ -486,6 +446,45 @@
pins = "PB0";
function = "gpio_in";
};
+
+ rgb18_20_pins_a: rgb18_20@0 {
+ pins = "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", \
+ "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", \
+ "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", \
+ "PD18", "PD19", "PD20", "PD21";
+ function = "lcd0";
+ drive-strength = <20>;
+ bias-disable;
+ };
+
+ rgb18_20_pins_b: rgb18_20@1 {
+ pins = "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", \
+ "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", \
+ "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", \
+ "PD18", "PD19", "PD20", "PD21";
+ function = "io_disabled";
+ bias-disable;
+ };
+
+ rgb18_10_pins_a: rgb18_10@0 {
+ pins = "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", \
+ "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", \
+ "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", \
+ "PD18", "PD19", "PD20", "PD21";
+ function = "lcd0";
+ drive-strength = <10>;
+ bias-disable;
+ };
+
+ rgb18_10_pins_b: rgb18_10@1 {
+ pins = "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", \
+ "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", \
+ "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", \
+ "PD18", "PD19", "PD20", "PD21";
+ function = "io_disabled";
+ bias-disable;
+ };
+
};
&uart0 {
@@ -510,11 +509,11 @@
};
&uart3 {
- compatible = "allwinner,sun20iw1-dsp-uart";
+ /*compatible = "allwinner,sun20iw1-dsp-uart";*/
pinctrl-names = "default", "sleep";
pinctrl-0 = <&uart3_pins_a>;
pinctrl-1 = <&uart3_pins_a>;
- status = "okay";
+ status = "disabled";
};
&soc {
@@ -557,12 +556,12 @@
compatible = "allwinner,sunxi-rfkill";
chip_en;
power_en;
- pinctrl-0 = <&wlan_pins_a>;
- pinctrl-names = "default";
status = "okay";
wlan: wlan@0 {
compatible = "allwinner,sunxi-wlan";
+ pinctrl-0 = <&wlan_pins_a>;
+ pinctrl-names = "default";
clock-names = "32k-fanout1";
clocks = <&ccu CLK_FANOUT1_OUT>;
wlan_busnum = <0x1>;
@@ -578,6 +577,8 @@
bt: bt@0 {
compatible = "allwinner,sunxi-bt";
+ pinctrl-0 = <&wlan_pins_a>;
+ pinctrl-names = "default";
clock-names = "32k-fanout1";
clocks = <&ccu CLK_FANOUT1_OUT>;
/*bt_power_num = <0x01>;*/
@@ -590,13 +591,13 @@
};
};
- btlpm: btlpm@0 {
+ /*btlpm: btlpm@0 {
compatible = "allwinner,sunxi-btlpm";
uart_index = <0x1>;
bt_wake = <&pio PG 16 GPIO_ACTIVE_HIGH>;
bt_hostwake = <&pio PG 17 GPIO_ACTIVE_HIGH>;
status = "okay";
- };
+ };*/
addr_mgt: addr_mgt@0 {
compatible = "allwinner,sunxi-addr_mgt";
@@ -750,7 +751,7 @@ tvd_row*tvd_column is the total tvd chan
mic2gain = <0x13>;
mic3gain = <0x13>;
/* ADC/DAC DRC/HPF func enabled */
- /* 0x1:DAP_HP_EN; 0x2:DAP_SPK_EN; 0x3:DAP_HPSPK_EN */
+ /* 0x1:DAP_HP_EN; 0x2:DAP_SPK_EN; 0x3:DAP_HPSPK_EN */
adcdrc_cfg = <0x0>;
adchpf_cfg = <0x1>;
dacdrc_cfg = <0x0>;
@@ -826,8 +827,8 @@ tvd_row*tvd_column is the total tvd chan
pcm_lrck_period = <0x80>;
slot_width_select = <0x20>;
pinctrl-names = "default", "sleep";
- pinctrl-0 = <&daudio0_pins_a &daudio0_pins_b &daudio0_pins_c>;
- pinctrl-1 = <&daudio0_pins_d>;
+ pinctrl-0 = <&daudio0_pins_a>;
+ pinctrl-1 = <&daudio0_pins_b>;
pinctrl_used = <0x0>;
status = "disabled";
};
@@ -853,18 +854,18 @@ tvd_row*tvd_column is the total tvd chan
};
&daudio1 {
- mclk_div = <0x01>;
- frametype = <0x00>;
- tdm_config = <0x01>;
- sign_extend = <0x00>;
- msb_lsb_first = <0x00>;
- pcm_lrck_period = <0x80>;
+ mclk_div = <0x01>;
+ frametype = <0x00>;
+ tdm_config = <0x01>;
+ sign_extend = <0x00>;
+ msb_lsb_first = <0x00>;
+ pcm_lrck_period = <0x80>;
slot_width_select = <0x20>;
- pinctrl-names = "default", "sleep";
- pinctrl-0 = <&daudio1_pins_a &daudio1_pins_b &daudio1_pins_c>;
- pinctrl-1 = <&daudio1_pins_d>;
- pinctrl_used = <0x0>;
- status = "disabled";
+ pinctrl-names = "default", "sleep";
+ pinctrl-0 = <&daudio1_pins_a>;
+ pinctrl-1 = <&daudio1_pins_b>;
+ pinctrl_used = <0x0>;
+ status = "disabled";
};
&sounddaudio1 {
@@ -930,12 +931,10 @@ tvd_row*tvd_column is the total tvd chan
*/
&usbc0 {
device_type = "usbc0";
- usb_port_type = <0x2>;
+ usb_port_type = <0x0>;
usb_detect_type = <0x1>;
usb_detect_mode = <0>;
- usb_id_gpio = <&pio PD 21 GPIO_ACTIVE_HIGH>;
enable-active-high;
- usb_det_vbus_gpio = <&pio PD 20 GPIO_ACTIVE_HIGH>;
usb_wakeup_suspend = <0>;
usb_serial_unique = <0>;
usb_serial_number = "20080411";
@@ -997,43 +996,20 @@ tvd_row*tvd_column is the total tvd chan
dma-names = "tx", "rx";
status = "okay";
- /* pcf8574-usage:
- * only use gpio0~7, 0 means PP0.
- * pin set:
- * gpios = <&pcf8574 0 GPIO_ACTIVE_LOW>;
- * interrupt set:
- * interrupt-parent = <&pcf8574>;
- * interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
- */
- pcf8574: gpio@38 {
- compatible = "nxp,pcf8574";
- reg = <0x38>;
- gpio_base = <2020>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupt-cells = <2>;
- interrupt-parent = <&pio>;
- interrupts = <PB 2 IRQ_TYPE_EDGE_FALLING>;
+ focaltech@48{
+ compatible = "focaltech,fts";
status = "okay";
+ reg = <0x48>;
+ interrupt-parent = <&pio>;
+ interrupts = <PG 14 IRQ_TYPE_LEVEL_LOW>;
+ focaltech,reset-gpio = <&pio PG 15 GPIO_ACTIVE_HIGH>;
+ focaltech,irq-gpio = <&pio PG 14 IRQ_TYPE_LEVEL_LOW>;
+ focaltech,max-touch-number = <2>;
+ focaltech,display-coords = <0 0 480 480>;
+ focaltech,reg_vdd = <®_3v3>;
+ focaltech,reg_avdd = <®_3v3>;
};
- ctp@14 {
- compatible = "allwinner,goodix";
- device_type = "ctp";
- reg = <0x14>;
- status = "disabled";
- ctp_name = "gt9xxnew_ts";
- ctp_twi_id = <0x2>;
- ctp_twi_addr = <0x14>;
- ctp_screen_max_x = <0x320>;
- ctp_screen_max_y = <0x500>;
- ctp_revert_x_flag = <0x0>;
- ctp_revert_y_flag = <0x1>;
- ctp_exchange_x_y_flag = <0x0>;
- ctp_int_port = <&pio PG 14 GPIO_ACTIVE_HIGH>;
- ctp_wakeup = <&pio PG 15 GPIO_ACTIVE_HIGH>;
- };
};
&twi3 {
@@ -1045,14 +1021,12 @@ tvd_row*tvd_column is the total tvd chan
};
&gmac0 {
- phy-mode = "rgmii";
+ phy-mode = "rmii";
use_ephy25m = <1>;
pinctrl-0 = <&gmac_pins_a>;
pinctrl-1 = <&gmac_pins_b>;
pinctrl-names = "default", "sleep";
phy-rst = <&pio PE 16 GPIO_ACTIVE_HIGH>;
- tx-delay = <3>; /*2~4*/
- rx-delay = <0>;
status = "okay";
};
@@ -1064,7 +1038,7 @@ tvd_row*tvd_column is the total tvd chan
/*spi-supply = <®_dcdc1>;*/
spi_slave_mode = <0>;
spi0_cs_number = <1>;
- spi0_cs_bitmap = <1>;
+ spi0_cs_bitmap = <1>;
status = "disabled";
spi-nand@0 {
@@ -1083,21 +1057,9 @@ tvd_row*tvd_column is the total tvd chan
pinctrl-1 = <&spi1_pins_c>;
pinctrl-names = "default", "sleep";
spi_slave_mode = <0>;
- spi1_cs_number = <1>;
- spi1_cs_bitmap = <1>;
- spi_dbi_enable = <1>;
status = "disabled";
spi_board1@0 {
- device_type = "spi-dbi";
- compatible = "sunxi,spidbi";
- spi-max-frequency = <0x5f5e100>;
- reg = <0x0>;
- spi-rx-bus-width = <0x4>;
- spi-tx-bus-width = <0x4>;
- status = "okay";
- };
- /* spi_board1@0 {
device_type = "spi_board1";
compatible = "rohm,dh2228fv";
spi-max-frequency = <0x5f5e100>;
@@ -1105,7 +1067,7 @@ tvd_row*tvd_column is the total tvd chan
spi-rx-bus-width = <0x4>;
spi-tx-bus-width = <0x4>;
status = "disabled";
- }; */
+ };
};
&ledc {
@@ -1279,55 +1241,54 @@ pull up or pull down(default 0), driver
;For lvds0: use lvds0_pins_a and lvds0_pins_b instead
;----------------------------------------------------------------------------------*/
&lcd0 {
- lcd_used = <1>;
+ lcd_used = <1>;
+ lcd_driver_name = "st7701s_rgb";
+
+ lcd_if = <0>;
+ lcd_hv_if = <0>;
- lcd_driver_name = "tft08006";
- lcd_backlight = <100>;
- lcd_if = <4>;
-
- lcd_x = <800>;
- lcd_y = <1280>;
- lcd_width = <52>;
- lcd_height = <52>;
- lcd_dclk_freq = <70>;
-
- lcd_pwm_used = <1>;
- lcd_pwm_ch = <2>;
- lcd_pwm_freq = <1000>;
- lcd_pwm_pol = <0>;
- lcd_pwm_max_limit = <255>;
-
- lcd_hbp = <32>;
- lcd_ht = <868>;
- lcd_hspw = <4>;
- lcd_vbp = <12>;
- lcd_vt = <1311>;
- lcd_vspw = <4>;
-
- lcd_dsi_if = <0>;
- lcd_dsi_lane = <4>;
- lcd_lvds_if = <0>;
- lcd_lvds_colordepth = <0>;
- lcd_lvds_mode = <0>;
- lcd_frm = <0>;
- lcd_hv_clk_phase = <0>;
- lcd_hv_sync_polarity= <0>;
- lcd_io_phase = <0x0000>;
- lcd_gamma_en = <0>;
- lcd_bright_curve_en = <0>;
- lcd_cmap_en = <0>;
- lcd_fsync_en = <0>;
- lcd_fsync_act_time = <1000>;
- lcd_fsync_dis_time = <1000>;
- lcd_fsync_pol = <0>;
-
- deu_mode = <0>;
- lcdgamma4iep = <22>;
- smart_color = <90>;
-
- lcd_gpio_0 = <&pio PG 13 GPIO_ACTIVE_HIGH>;
- pinctrl-0 = <&dsi4lane_pins_a>;
- pinctrl-1 = <&dsi4lane_pins_b>;
+ lcd_width = <70>;
+ lcd_height = <72>;
+ lcd_x = <480>;
+ lcd_y = <480>;
+ lcd_dclk_freq = <19>;
+ lcd_hbp = <60>;
+ lcd_ht = <612>;
+ lcd_hspw = <12>;
+ lcd_vbp = <18>;
+ lcd_vt = <520>;
+ lcd_vspw = <4>;
+
+ lcd_backlight = <50>;
+ lcd_pwm_used = <1>;
+ lcd_pwm_ch = <7>;
+ lcd_pwm_freq = <20000>;
+ lcd_pwm_pol = <1>;
+ lcd_bright_curve_en = <0>;
+
+ lcd_frm = <1>;
+ lcd_io_phase = <0x0000>;
+ lcd_gamma_en = <0>;
+ lcd_cmap_en = <0>;
+ lcd_hv_clk_phase = <0>;
+ lcd_hv_sync_polarity = <0>;
+ lcd_rb_swap = <0>;
+
+ lcd_power = "vcc-lcd";
+ lcd_pin_power = "vcc-pd";
+ lcd_gpio_0 = <&pio PG 13 GPIO_ACTIVE_HIGH>;
+ lcd_gpio_1 = <&pio PE 14 GPIO_ACTIVE_HIGH>;
+ lcd_gpio_2 = <&pio PE 12 GPIO_ACTIVE_HIGH>;
+ lcd_gpio_3 = <&pio PE 15 GPIO_ACTIVE_HIGH>;
+ /*
+ lcd_gpio_0 = <&pio PG 13 1 1 1 1>;
+ lcd_gpio_1 = <&pio PE 14 1 1 1 1>;
+ lcd_gpio_2 = <&pio PE 12 1 1 1 1>;
+ lcd_gpio_3 = <&pio PE 15 1 1 1 1>;
+ */
+ pinctrl-0 = <&rgb18_pins_a>;
+ pinctrl-1 = <&rgb18_pins_b>;
+ status = "okay";
};
&hdmi {
@@ -1357,14 +1318,12 @@ pull up or pull down(default 0), driver
status = "okay";
};
-/*
&pwm7 {
pinctrl-names = "active", "sleep";
pinctrl-0 = <&pwm7_pin_a>;
pinctrl-1 = <&pwm7_pin_b>;
status = "okay";
};
-*/
&rtp {
allwinner,tp-sensitive-adjust = <0xf>;
@@ -1400,60 +1359,3 @@ pull up or pull down(default 0), driver
pinctrl-1 = <&ir1_pins_b>;
status = "disabled";
};
-
-/* &lcd_fb0 {
- lcd_used = <1>;
- lcd_driver_name = "kld35512";
- lcd_if = <1>;
- lcd_dbi_if = <4>;
- lcd_data_speed = <60>;
- lcd_spi_bus_num = <1>;
- lcd_x = <320>;
- lcd_y = <480>;
- lcd_pixel_fmt = <10>;
- lcd_dbi_fmt = <2>;
- lcd_rgb_order = <0>;
- lcd_width = <60>;
- lcd_height = <95>;
- lcd_pwm_used = <1>;
- lcd_pwm_ch = <7>;
- lcd_pwm_freq = <5000>;
- lcd_pwm_pol = <1>;
- lcd_frm = <1>;
- lcd_gamma_en = <1>;
- fb_buffer_num = <2>;
- lcd_backlight = <100>;
- lcd_fps = <40>;
- lcd_dbi_te = <1>;
- lcd_dbi_clk_mode = <1>;
- lcd_gpio_0 = <&pio PC 0 GPIO_ACTIVE_HIGH>;
- status = "okay";
-}; */
-
-/* &lcd_fb0 {
- lcd_used = <1>;
- lcd_driver_name = "kld2844b";
- lcd_if = <1>;
- lcd_dbi_if = <4>;
- lcd_data_speed = <60>;
- lcd_spi_bus_num = <1>;
- lcd_x = <240>;
- lcd_y = <320>;
- lcd_width = <60>;
- lcd_height = <95>;
- lcd_pwm_used = <1>;
- lcd_pwm_ch = <7>;
- lcd_pwm_freq = <5000>;
- lcd_pwm_pol = <0>;
- lcd_pixel_fmt = <0>;
- lcd_dbi_fmt = <3>;
- lcd_rgb_order = <0>;
- lcd_frm = <1>;
- lcd_gamma_en = <1>;
- fb_buffer_num = <2>;
- lcd_backlight = <100>;
- lcd_dbi_te = <1>;
- lcd_fps = <60>;
- lcd_gpio_0 = <&pio PC 0 GPIO_ACTIVE_HIGH>;
- status = "okay";
-}; */
Index: tina-d1-h/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/Makefile
===================================================================
--- tina-d1-h.orig/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/Makefile
+++ tina-d1-h/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/Makefile
@@ -45,6 +45,7 @@ disp-$(CONFIG_LCD_SUPPORT_LH219WQ1) += l
disp-$(CONFIG_LCD_SUPPORT_ST7789V) += lcd/st7789v.o
disp-$(CONFIG_LCD_SUPPORT_ST7796S) += lcd/st7796s.o
disp-$(CONFIG_LCD_SUPPORT_ST7701S) += lcd/st7701s.o
+disp-$(CONFIG_LCD_SUPPORT_ST7701S_RGB) += lcd/st7701s_rgb.o
disp-$(CONFIG_LCD_SUPPORT_WTL096601G03) += lcd/wtl096601g03.o
disp-$(CONFIG_LCD_SUPPORT_T30P106) += lcd/t30p106.o
disp-$(CONFIG_LCD_SUPPORT_TO20T20000) += lcd/to20t20000.o
Index: tina-d1-h/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/lcd/Kconfig
===================================================================
--- tina-d1-h.orig/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/lcd/Kconfig
+++ tina-d1-h/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/lcd/Kconfig
@@ -103,6 +103,12 @@ config LCD_SUPPORT_ST7701S
---help---
If you want to support ST7701S panel for display driver, select it.
+config LCD_SUPPORT_ST7701S_RGB
+ bool "LCD support ST7701S RGB panel"
+ default n
+ ---help---
+ If you want to support ST7701S_RGB panel for display driver, select it.
+
config LCD_SUPPORT_T30P106
bool "LCD support T30P106 panel"
default n
@@ -210,4 +216,3 @@ config LCD_SUPPORT_K080_IM2HYL802R_800X1
default y
---help---
If you want to support K080_IM2HYL802R_800X1280 panel for display driver, select it.
-
Index: tina-d1-h/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/lcd/panels.c
===================================================================
--- tina-d1-h.orig/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/lcd/panels.c
+++ tina-d1-h/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/lcd/panels.c
@@ -80,6 +80,9 @@ struct __lcd_panel *panel_array[] = {
#ifdef CONFIG_LCD_SUPPORT_ST7701S
&st7701s_panel,
#endif
+#ifdef CONFIG_LCD_SUPPORT_ST7701S_RGB
+ &st7701s_rgb_panel,
+#endif
#ifdef CONFIG_LCD_SUPPORT_T30P106
&t30p106_panel,
#endif
@@ -136,6 +139,7 @@ void lcd_set_panel_funs(void)
int i;
for (i = 0; panel_array[i] != NULL; i++) {
+ printk("panel name: %s\n", panel_array[i]->name);
sunxi_lcd_set_panel_funs(panel_array[i]->name,
&panel_array[i]->func);
}
Index: tina-d1-h/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/lcd/panels.h
===================================================================
--- tina-d1-h.orig/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/lcd/panels.h
+++ tina-d1-h/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/lcd/panels.h
@@ -125,6 +125,9 @@ extern struct __lcd_panel st7796s_panel;
#ifdef CONFIG_LCD_SUPPORT_ST7701S
extern struct __lcd_panel st7701s_panel;
#endif
+#ifdef CONFIG_LCD_SUPPORT_ST7701S_RGB
+extern struct __lcd_panel st7701s_rgb_panel;
+#endif
#ifdef CONFIG_LCD_SUPPORT_T30P106
extern struct __lcd_panel t30p106_panel;
#endif
Index: tina-d1-h/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/lcd/st7701s_rgb.c
===================================================================
--- /dev/null
+++ tina-d1-h/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/lcd/st7701s_rgb.c
@@ -0,0 +1,517 @@
+/*
+ * drivers/video/fbdev/sunxi/disp2/disp/lcd/st7701s_rgb.c
+ *
+ * Copyright (c) 2018-2021 Allwinnertech Co., Ltd.
+ * Author: zepan <zepan@sipeed.com>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+&lcd0 {
+ lcd_used = <1>;
+
+ lcd_driver_name = "st7701s_rgb";
+ lcd_backlight = <100>;
+ lcd_if = <2>;
+
+ lcd_x = <480>;
+ lcd_y = <480>;
+ lcd_width = <70>;
+ lcd_height = <72>;
+ lcd_dclk_freq = <30>;
+
+ lcd_pwm_used = <1>;
+ lcd_pwm_ch = <7>;
+ lcd_pwm_freq = <19000>;
+ lcd_pwm_pol = <0>;
+ lcd_pwm_max_limit = <255>;
+
+ lcd_hbp = <60>;
+ lcd_ht = <612>;
+ lcd_hspw = <12>;
+ lcd_vbp = <18>;
+ lcd_vt = <520>;
+ lcd_vspw = <4>;
+
+ lcd_dsi_if = <0>;
+ lcd_dsi_lane = <4>;
+ lcd_lvds_if = <0>;
+ lcd_lvds_colordepth = <0>;
+ lcd_lvds_mode = <0>;
+ lcd_frm = <0>;
+ lcd_hv_clk_phase = <0>;
+ lcd_hv_sync_polarity= <0>;
+ lcd_io_phase = <0x0000>;
+ lcd_gamma_en = <0>;
+ lcd_bright_curve_en = <0>;
+ lcd_cmap_en = <0>;
+ lcd_fsync_en = <0>;
+ lcd_fsync_act_time = <1000>;
+ lcd_fsync_dis_time = <1000>;
+ lcd_fsync_pol = <0>;
+
+ deu_mode = <0>;
+ lcdgamma4iep = <22>;
+ smart_color = <90>;
+
+ lcd_gpio_0 = <&pio PG 13 GPIO_ACTIVE_HIGH>;RST
+ lcd_gpio_1 = <&pio PE 14 GPIO_ACTIVE_HIGH>;CS
+ lcd_gpio_2 = <&pio PE 12 GPIO_ACTIVE_HIGH>;SDA
+ lcd_gpio_3 = <&pio PE 15 GPIO_ACTIVE_HIGH>;SCK
+ pinctrl-0 = <&rgb18_pins_a>;
+ pinctrl-1 = <&rgb18_pins_b>;
+};
+ */
+#include "st7701s_rgb.h"
+#include "default_panel.h"
+
+//s32 sunxi_lcd_gpio_set_value(u32 screen_id, u32 io_index, u32 value)
+
+#define st7701s_spi_scl_1 sunxi_lcd_gpio_set_value(0, 3, 1)
+#define st7701s_spi_scl_0 sunxi_lcd_gpio_set_value(0, 3, 0)
+#define st7701s_spi_sdi_1 sunxi_lcd_gpio_set_value(0, 2, 1)
+#define st7701s_spi_sdi_0 sunxi_lcd_gpio_set_value(0, 2, 0)
+#define st7701s_spi_cs_1 sunxi_lcd_gpio_set_value(0, 1, 1)
+#define st7701s_spi_cs_0 sunxi_lcd_gpio_set_value(0, 1, 0)
+#define st7701s_spi_reset_1 sunxi_lcd_gpio_set_value(0, 0, 1)
+#define st7701s_spi_reset_0 sunxi_lcd_gpio_set_value(0, 0, 0)
+
+static void LCD_power_on(u32 sel);
+static void LCD_power_off(u32 sel);
+static void LCD_bl_open(u32 sel);
+static void LCD_bl_close(u32 sel);
+
+static void LCD_panel_init(u32 sel);
+static void LCD_panel_exit(u32 sel);
+
+static void LCD_cfg_panel_info(struct panel_extend_para *info)
+{
+ u32 i = 0, j = 0;
+ u32 items;
+ u8 lcd_gamma_tbl[][2] = {
+ /* {input value, corrected value} */
+ {0, 0},
+ {15, 15},
+ {30, 30},
+ {45, 45},
+ {60, 60},
+ {75, 75},
+ {90, 90},
+ {105, 105},
+ {120, 120},
+ {135, 135},
+ {150, 150},
+ {165, 165},
+ {180, 180},
+ {195, 195},
+ {210, 210},
+ {225, 225},
+ {240, 240},
+ {255, 255},
+ };
+
+ u32 lcd_cmap_tbl[2][3][4] = {
+ {
+ {LCD_CMAP_G0, LCD_CMAP_B1, LCD_CMAP_G2, LCD_CMAP_B3},
+ {LCD_CMAP_B0, LCD_CMAP_R1, LCD_CMAP_B2, LCD_CMAP_R3},
+ {LCD_CMAP_R0, LCD_CMAP_G1, LCD_CMAP_R2, LCD_CMAP_G3},
+ },
+ {
+ {LCD_CMAP_B3, LCD_CMAP_G2, LCD_CMAP_B1, LCD_CMAP_G0},
+ {LCD_CMAP_R3, LCD_CMAP_B2, LCD_CMAP_R1, LCD_CMAP_B0},
+ {LCD_CMAP_G3, LCD_CMAP_R2, LCD_CMAP_G1, LCD_CMAP_R0},
+ },
+ };
+
+ items = sizeof(lcd_gamma_tbl) / 2;
+ for (i = 0; i < items - 1; i++) {
+ u32 num = lcd_gamma_tbl[i + 1][0] - lcd_gamma_tbl[i][0];
+
+ for (j = 0; j < num; j++) {
+ u32 value = 0;
+
+ value = lcd_gamma_tbl[i][1] + ((lcd_gamma_tbl[i + 1][1] - lcd_gamma_tbl[i][1]) * j) / num;
+ info->lcd_gamma_tbl[lcd_gamma_tbl[i][0] + j] = (value << 16) + (value << 8) + value;
+ }
+ }
+ info->lcd_gamma_tbl[255] = (lcd_gamma_tbl[items - 1][1] << 16) + (lcd_gamma_tbl[items - 1][1] << 8) + lcd_gamma_tbl[items - 1][1];
+
+ memcpy(info->lcd_cmap_tbl, lcd_cmap_tbl, sizeof(lcd_cmap_tbl));
+}
+
+static s32 LCD_open_flow(u32 sel)
+{
+ printk("=====================LCD_open_flow\n");
+ /* open lcd power, and delay 50ms */
+ LCD_OPEN_FUNC(sel, LCD_power_on, 20);
+ /* open lcd power, than delay 200ms */
+ LCD_OPEN_FUNC(sel, LCD_panel_init, 20);
+ /* open lcd controller, and delay 100ms */
+ LCD_OPEN_FUNC(sel, sunxi_lcd_tcon_enable, 100);
+ /* open lcd backlight, and delay 0ms */
+ LCD_OPEN_FUNC(sel, LCD_bl_open, 0);
+
+ return 0;
+}
+
+static s32 LCD_close_flow(u32 sel)
+{
+ /* close lcd backlight, and delay 0ms */
+ LCD_CLOSE_FUNC(sel, LCD_bl_close, 0);
+ /* close lcd controller, and delay 0ms */
+ LCD_CLOSE_FUNC(sel, sunxi_lcd_tcon_disable, 0);
+ /* open lcd power, than delay 200ms */
+ LCD_CLOSE_FUNC(sel, LCD_panel_exit, 200);
+ /* close lcd power, and delay 500ms */
+ LCD_CLOSE_FUNC(sel, LCD_power_off, 500);
+
+ return 0;
+}
+
+static void LCD_power_on(u32 sel)
+{
+ printk("=====================LCD_power_on\n");
+ /* config lcd_power pin to open lcd power0 */
+ sunxi_lcd_power_enable(sel, 0);
+ sunxi_lcd_pin_cfg(sel, 1);
+
+}
+
+static void LCD_power_off(u32 sel)
+{
+ sunxi_lcd_pin_cfg(sel, 0);
+ /* config lcd_power pin to close lcd power0 */
+ sunxi_lcd_power_disable(sel, 0);
+}
+
+static void LCD_bl_open(u32 sel)
+{
+ printk("=====================LCD_bl_open\n");
+ sunxi_lcd_pwm_enable(sel);
+ sunxi_lcd_backlight_enable(sel);
+}
+
+static void LCD_bl_close(u32 sel)
+{
+ /* config lcd_bl_en pin to close lcd backlight */
+ sunxi_lcd_backlight_disable(sel);
+ sunxi_lcd_pwm_disable(sel);
+}
+
+//three line 9bit mode
+static void LCD_WRITE_DATA(u32 value)
+{
+ u32 i;
+ st7701s_spi_cs_0;
+ st7701s_spi_sdi_1;
+ st7701s_spi_scl_0;
+ sunxi_lcd_delay_us(10);
+ st7701s_spi_scl_1;
+ for (i = 0; i < 8; i++) {
+ sunxi_lcd_delay_us(10);
+ if (value & 0x80)
+ st7701s_spi_sdi_1;
+ else
+ st7701s_spi_sdi_0;
+ value <<= 1;
+ sunxi_lcd_delay_us(10);
+ st7701s_spi_scl_0;
+ st7701s_spi_scl_1;
+ }
+ sunxi_lcd_delay_us(10);
+ st7701s_spi_cs_1;
+}
+
+static void LCD_WRITE_COMMAND(u32 value)
+{
+ u32 i;
+ st7701s_spi_cs_0;
+ st7701s_spi_sdi_0;
+ st7701s_spi_scl_0;
+ sunxi_lcd_delay_us(10);
+ st7701s_spi_scl_1;
+ for (i = 0; i < 8; i++) {
+ sunxi_lcd_delay_us(10);
+ if (value & 0x80)
+ st7701s_spi_sdi_1;
+ else
+ st7701s_spi_sdi_0;
+ st7701s_spi_scl_0;
+ sunxi_lcd_delay_us(10);
+ st7701s_spi_scl_1;
+ value <<= 1;
+ }
+ sunxi_lcd_delay_us(10);
+ st7701s_spi_cs_1;
+}
+
+
+static void LCD_panel_init(u32 sel)
+{
+ printk("=====================LCD_panel_init\n");
+ LCD_WRITE_COMMAND(0xFF);
+ LCD_WRITE_DATA(0x77);
+ LCD_WRITE_DATA(0x01);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x10);
+
+ LCD_WRITE_COMMAND(0xC0);
+ LCD_WRITE_DATA(0x3B);
+ LCD_WRITE_DATA(0x00);
+
+ LCD_WRITE_COMMAND(0xC1);
+ LCD_WRITE_DATA(0x0D);
+ LCD_WRITE_DATA(0x02);
+
+ LCD_WRITE_COMMAND(0xC2);
+ LCD_WRITE_DATA(0x21);
+ LCD_WRITE_DATA(0x08);
+
+ // RGB Interface Setting
+ // LCD_WRITE_COMMAND(0xC3);
+ // LCD_WRITE_DATA(0x02);
+
+ LCD_WRITE_COMMAND(0xCD);
+ LCD_WRITE_DATA(0x18);//0F 08-OK D0-D18
+
+ LCD_WRITE_COMMAND(0xB0);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x11);
+ LCD_WRITE_DATA(0x18);
+ LCD_WRITE_DATA(0x0E);
+ LCD_WRITE_DATA(0x11);
+ LCD_WRITE_DATA(0x06);
+ LCD_WRITE_DATA(0x07);
+ LCD_WRITE_DATA(0x08);
+ LCD_WRITE_DATA(0x07);
+ LCD_WRITE_DATA(0x22);
+ LCD_WRITE_DATA(0x04);
+ LCD_WRITE_DATA(0x12);
+ LCD_WRITE_DATA(0x0F);
+ LCD_WRITE_DATA(0xAA);
+ LCD_WRITE_DATA(0x31);
+ LCD_WRITE_DATA(0x18);
+
+ LCD_WRITE_COMMAND(0xB1);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x11);
+ LCD_WRITE_DATA(0x19);
+ LCD_WRITE_DATA(0x0E);
+ LCD_WRITE_DATA(0x12);
+ LCD_WRITE_DATA(0x07);
+ LCD_WRITE_DATA(0x08);
+ LCD_WRITE_DATA(0x08);
+ LCD_WRITE_DATA(0x08);
+ LCD_WRITE_DATA(0x22);
+ LCD_WRITE_DATA(0x04);
+ LCD_WRITE_DATA(0x11);
+ LCD_WRITE_DATA(0x11);
+ LCD_WRITE_DATA(0xA9);
+ LCD_WRITE_DATA(0x32);
+ LCD_WRITE_DATA(0x18);
+
+ LCD_WRITE_COMMAND(0xFF);
+ LCD_WRITE_DATA(0x77);
+ LCD_WRITE_DATA(0x01);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x11);
+
+ LCD_WRITE_COMMAND(0xB0);
+ LCD_WRITE_DATA(0x60);
+
+ LCD_WRITE_COMMAND(0xB1);
+ LCD_WRITE_DATA(0x30);
+
+ LCD_WRITE_COMMAND(0xB2);
+ LCD_WRITE_DATA(0x87);
+
+ LCD_WRITE_COMMAND(0xB3);
+ LCD_WRITE_DATA(0x80);
+
+ LCD_WRITE_COMMAND(0xB5);
+ LCD_WRITE_DATA(0x49);
+
+ LCD_WRITE_COMMAND(0xB7);
+ LCD_WRITE_DATA(0x85);
+
+ LCD_WRITE_COMMAND(0xB8);
+ LCD_WRITE_DATA(0x21);
+
+ LCD_WRITE_COMMAND(0xC1);
+ LCD_WRITE_DATA(0x78);
+
+ LCD_WRITE_COMMAND(0xC2);
+ LCD_WRITE_DATA(0x78);
+ sunxi_lcd_delay_ms(20);
+
+ LCD_WRITE_COMMAND(0xE0);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x1B);
+ LCD_WRITE_DATA(0x02);
+
+ LCD_WRITE_COMMAND(0xE1);
+ LCD_WRITE_DATA(0x08);
+ LCD_WRITE_DATA(0xA0);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x07);
+ LCD_WRITE_DATA(0xA0);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x44);
+ LCD_WRITE_DATA(0x44);
+
+ LCD_WRITE_COMMAND(0xE2);
+ LCD_WRITE_DATA(0x11);
+ LCD_WRITE_DATA(0x11);
+ LCD_WRITE_DATA(0x44);
+ LCD_WRITE_DATA(0x44);
+ LCD_WRITE_DATA(0xED);
+ LCD_WRITE_DATA(0xA0);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0xEC);
+ LCD_WRITE_DATA(0xA0);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x00);
+
+ LCD_WRITE_COMMAND(0xE3);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x11);
+ LCD_WRITE_DATA(0x11);
+
+ LCD_WRITE_COMMAND(0xE4);
+ LCD_WRITE_DATA(0x44);
+ LCD_WRITE_DATA(0x44);
+
+ LCD_WRITE_COMMAND(0xE5);
+ LCD_WRITE_DATA(0x0A);
+ LCD_WRITE_DATA(0xE9);
+ LCD_WRITE_DATA(0xD8);
+ LCD_WRITE_DATA(0xA0);
+ LCD_WRITE_DATA(0x0C);
+ LCD_WRITE_DATA(0xEB);
+ LCD_WRITE_DATA(0xD8);
+ LCD_WRITE_DATA(0xA0);
+ LCD_WRITE_DATA(0x0E);
+ LCD_WRITE_DATA(0xED);
+ LCD_WRITE_DATA(0xD8);
+ LCD_WRITE_DATA(0xA0);
+ LCD_WRITE_DATA(0x10);
+ LCD_WRITE_DATA(0xEF);
+ LCD_WRITE_DATA(0xD8);
+ LCD_WRITE_DATA(0xA0);
+
+ LCD_WRITE_COMMAND(0xE6);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x11);
+ LCD_WRITE_DATA(0x11);
+
+ LCD_WRITE_COMMAND(0xE7);
+ LCD_WRITE_DATA(0x44);
+ LCD_WRITE_DATA(0x44);
+
+ LCD_WRITE_COMMAND(0xE8);
+ LCD_WRITE_DATA(0x09);
+ LCD_WRITE_DATA(0xE8);
+ LCD_WRITE_DATA(0xD8);
+ LCD_WRITE_DATA(0xA0);
+ LCD_WRITE_DATA(0x0B);
+ LCD_WRITE_DATA(0xEA);
+ LCD_WRITE_DATA(0xD8);
+ LCD_WRITE_DATA(0xA0);
+ LCD_WRITE_DATA(0x0D);
+ LCD_WRITE_DATA(0xEC);
+ LCD_WRITE_DATA(0xD8);
+ LCD_WRITE_DATA(0xA0);
+ LCD_WRITE_DATA(0x0F);
+ LCD_WRITE_DATA(0xEE);
+ LCD_WRITE_DATA(0xD8);
+ LCD_WRITE_DATA(0xA0);
+
+ LCD_WRITE_COMMAND(0xEB);
+ LCD_WRITE_DATA(0x02);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0xE4);
+ LCD_WRITE_DATA(0xE4);
+ LCD_WRITE_DATA(0x88);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x40);
+
+ LCD_WRITE_COMMAND(0xEC);
+ LCD_WRITE_DATA(0x3C);
+ LCD_WRITE_DATA(0x00);
+
+ LCD_WRITE_COMMAND(0xED);
+ LCD_WRITE_DATA(0xAB);
+ LCD_WRITE_DATA(0x89);
+ LCD_WRITE_DATA(0x76);
+ LCD_WRITE_DATA(0x54);
+ LCD_WRITE_DATA(0x02);
+ LCD_WRITE_DATA(0xFF);
+ LCD_WRITE_DATA(0xFF);
+ LCD_WRITE_DATA(0xFF);
+ LCD_WRITE_DATA(0xFF);
+ LCD_WRITE_DATA(0xFF);
+ LCD_WRITE_DATA(0xFF);
+ LCD_WRITE_DATA(0x20);
+ LCD_WRITE_DATA(0x45);
+ LCD_WRITE_DATA(0x67);
+ LCD_WRITE_DATA(0x98);
+ LCD_WRITE_DATA(0xBA);
+
+ LCD_WRITE_COMMAND(0xFF);
+ LCD_WRITE_DATA(0x77);
+ LCD_WRITE_DATA(0x01);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x00);
+ LCD_WRITE_DATA(0x00);
+
+ LCD_WRITE_COMMAND(0x3A);
+ LCD_WRITE_DATA(0x66);
+
+ LCD_WRITE_COMMAND(0x36);
+ LCD_WRITE_DATA(0x00);
+
+ LCD_WRITE_COMMAND(0x21);
+
+ LCD_WRITE_COMMAND(0x11);
+ sunxi_lcd_delay_ms(120);
+
+ LCD_WRITE_COMMAND(0x29);
+ sunxi_lcd_delay_ms(20);
+ return;
+}
+
+static void LCD_panel_exit(u32 sel)
+{
+ return;
+}
+
+/* sel: 0:lcd0; 1:lcd1 */
+static s32 LCD_user_defined_func(u32 sel, u32 para1, u32 para2, u32 para3)
+{
+ return 0;
+}
+
+struct __lcd_panel st7701s_rgb_panel = {
+ /* panel driver name, must mach the lcd_drv_name in sys_config.fex */
+ .name = "st7701s_rgb",
+ .func = {
+ .cfg_panel_info = LCD_cfg_panel_info,
+ .cfg_open_flow = LCD_open_flow,
+ .cfg_close_flow = LCD_close_flow,
+ .lcd_user_defined_func = LCD_user_defined_func,
+ },
+};
\ No newline at end of file
Index: tina-d1-h/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/lcd/st7701s_rgb.h
===================================================================
--- /dev/null
+++ tina-d1-h/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/lcd/st7701s_rgb.h
@@ -0,0 +1,18 @@
+/*
+ * Allwinner SoCs display driver.
+ *
+ * Copyright (C) 2021 Sipeed.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ST7701S_RGB_PANEL_H__
+#define __ST7701S_RGB_PANEL_H__
+
+#include "panels.h"
+
+extern struct __lcd_panel st7701s_rgb_panel;
+
+#endif
\ No newline at end of file
Index: tina-d1-h/device/config/chips/d1-h/configs/nezha/linux-5.4/config-5.4
===================================================================
--- tina-d1-h.orig/device/config/chips/d1-h/configs/nezha/linux-5.4/config-5.4
+++ tina-d1-h/device/config/chips/d1-h/configs/nezha/linux-5.4/config-5.4
@@ -2517,6 +2517,7 @@ CONFIG_LCD_SUPPORT_HE0801A068=y
# CONFIG_LCD_SUPPORT_ST7789V is not set
# CONFIG_LCD_SUPPORT_ST7796S is not set
# CONFIG_LCD_SUPPORT_ST7701S is not set
+CONFIG_LCD_SUPPORT_ST7701S_RGB=y
# CONFIG_LCD_SUPPORT_T30P106 is not set
# CONFIG_LCD_SUPPORT_TO20T20000 is not set
# CONFIG_LCD_SUPPORT_FRD450H40014 is not set
Index: tina-d1-h/device/config/chips/d1-h/configs/nezha/uboot-board.dts
===================================================================
--- tina-d1-h.orig/device/config/chips/d1-h/configs/nezha/uboot-board.dts
+++ tina-d1-h/device/config/chips/d1-h/configs/nezha/uboot-board.dts
@@ -42,7 +42,7 @@
&pwm2_pin_b {
pins = "PD18";
muxsel = <0>;
- function = "gpio_out";
+ function = "gpio_in";
};
&pwm2 {
@@ -260,57 +260,50 @@
/* dcdc1-supply = <®_dcdc1>;*/
};
+/*
&lcd0 {
- lcd_used = <1>;
+ lcd_used = <1>;
+ lcd_driver_name = "st7701s_rgb";
- lcd_driver_name = "tft08006";
- lcd_backlight = <100>;
- lcd_if = <4>;
-
- lcd_x = <800>;
- lcd_y = <1280>;
- lcd_width = <52>;
- lcd_height = <52>;
- lcd_dclk_freq = <70>;
-
- lcd_pwm_used = <1>;
- lcd_pwm_ch = <2>;
- lcd_pwm_freq = <1000>;
- lcd_pwm_pol = <0>;
- lcd_pwm_max_limit = <255>;
-
- lcd_hbp = <32>;
- lcd_ht = <868>;
- lcd_hspw = <4>;
- lcd_vbp = <12>;
- lcd_vt = <1311>;
- lcd_vspw = <4>;
-
- lcd_dsi_if = <0>;
- lcd_dsi_lane = <4>;
- lcd_lvds_if = <0>;
- lcd_lvds_colordepth = <0>;
- lcd_lvds_mode = <0>;
- lcd_frm = <0>;
- lcd_hv_clk_phase = <0>;
- lcd_hv_sync_polarity= <0>;
- lcd_io_phase = <0x0000>;
- lcd_gamma_en = <0>;
+ lcd_if = <0>;
+ lcd_hv_if = <0>;
+
+ lcd_width = <70>;
+ lcd_height = <72>;
+ lcd_x = <480>;
+ lcd_y = <480>;
+ lcd_dclk_freq = <19>;
+ lcd_hbp = <60>;
+ lcd_ht = <612>;
+ lcd_hspw = <12>;
+ lcd_vbp = <18>;
+ lcd_vt = <520>;
+ lcd_vspw = <4>;
+
+ lcd_backlight = <50>;
+ lcd_pwm_used = <1>;
+ lcd_pwm_ch = <7>;
+ lcd_pwm_freq = <20000>;
+ lcd_pwm_pol = <1>;
lcd_bright_curve_en = <0>;
- lcd_cmap_en = <0>;
- lcd_fsync_en = <0>;
- lcd_fsync_act_time = <1000>;
- lcd_fsync_dis_time = <1000>;
- lcd_fsync_pol = <0>;
-
- deu_mode = <0>;
- lcdgamma4iep = <22>;
- smart_color = <90>;
-
- lcd_gpio_0 = <&pio PG 13 GPIO_ACTIVE_HIGH>;
- pinctrl-0 = <&dsi4lane_pins_a>;
- pinctrl-1 = <&dsi4lane_pins_b>;
+
+ lcd_frm = <1>;
+ lcd_io_phase = <0x0000>;
+ lcd_gamma_en = <0>;
+ lcd_cmap_en = <0>;
+ lcd_hv_clk_phase= <0>;
+ lcd_hv_sync_polarity= <0>;
+
+ lcd_power = "vcc-lcd";
+ lcd_pin_power = "vcc-pd";
+ lcd_gpio_0 = <&pio PG 13 GPIO_ACTIVE_HIGH>;
+ lcd_gpio_1 = <&pio PE 14 GPIO_ACTIVE_HIGH>;
+ lcd_gpio_2 = <&pio PE 12 GPIO_ACTIVE_HIGH>;
+ lcd_gpio_3 = <&pio PE 15 GPIO_ACTIVE_HIGH>;
+ pinctrl-0 = <&rgb18_pins_a>;
+ pinctrl-1 = <&rgb18_pins_b>;
};
+*/
&hdmi {
hdmi_used = <1>;
请使用quilt应用该patch