@iamdrq hello bro, have you test mipi dsi on nanopc-t4 kernel v6.1? I use this patch apply in friendlyarm offical kernel v6.1 https://github.com/friendlyarm/kernel-rockchip, but no display and backlight is ok, display well in friendlyarm offical kernel v4.19. Could you help me test mipi dsi on nanopc-t4 in armbian with linux v6.1? My linux v6.1.y repo is https://github.com/JackHuang021/kernel-nanopct4
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* FriendlyElec NanoPC-T4 board mipi dis device tree source
*/
#include <dt-bindings/display/drm_mipi_dsi.h>
/ {
backlight: backlight {
compatible = "pwm-backlight";
pwms = <&pwm0 0 25000 0>;
brightness-levels = <
0 20 20 20 20 20 20 20
21 21 21 21 21 21 21 21
22 22 22 22 22 22 22 22
23 23 23 23 23 23 23 23
24 24 24 24 24 24 24 24
25 25 25 25 25 25 25 25
26 26 26 26 26 26 26 26
27 27 27 27 27 27 27 27
28 28 28 28 28 28 28 28
29 29 29 29 29 29 29 29
30 30 30 30 30 30 30 30
31 31 31 31 31 31 31 31
32 32 32 32 32 32 32 32
33 33 33 33 33 33 33 33
34 34 34 34 34 34 34 34
35 35 35 35 35 35 35 35
36 36 36 36 36 36 36 36
37 37 37 37 37 37 37 37
38 38 38 38 38 38 38 38
39 39 39 39 39 39 39 39
40 40 40 40 40 40 40 40
41 41 41 41 41 41 41 41
42 42 42 42 42 42 42 42
43 43 43 43 43 43 43 43
44 44 44 44 44 44 44 44
45 45 45 45 45 45 45 45
46 46 46 46 46 46 46 46
47 47 47 47 47 47 47 47
48 48 48 48 48 48 48 48
49 49 49 49 49 49 49 49
50 50 50 50 50 50 50 50
51 51 51 51 51 51 51 51
256
>;
default-brightness-level = <50>;
};
};
&i2c4 {
status = "okay";
ts@5d {
pinctrl-0 = <&touch_int_gpio>;
compatible = "goodix,gt9xx";
reg = <0x5d>;
tp-size = <911>;
max-x = <720>;
max-y = <1280>;
touch-gpio = <&gpio1 RK_PC4 IRQ_TYPE_LEVEL_LOW>;
reset-gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
};
};
&mipi_in_vopl {
status = "okay";
};
&mipi_in_vopb {
status = "disabled";
};
&hdmi_in_vopb {
status = "okay";
};
&hdmi_in_vopl {
status = "disabled";
};
&mipi_dsi {
status = "okay";
rockchip,lane-rate = <580>; //(720+8+8+16)*(1280+8+8+16)*60*3*8/3,+100mhz
dsi_panel: panel@0 {
status = "okay";
compatible = "panel-dsi-simple";
reset-gpios = <&gpio4 RK_PD6 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&dsi_rst_gpio>;
reg = <0>;
backlight = <&backlight>;
reset-delay-ms = <200>;
enable-delay-ms = <100>;
prepare-delay-ms = <20>;
unprepare-delay-ms = <20>;
disable-delay-ms = <20>;
init-delay-ms = <120>;
dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
dsi,format = <MIPI_DSI_FMT_RGB888>;
dsi,lanes = <3>;
width-mm = <74>;
height-mm = <132>;
panel-init-sequence = [
// init code
// Set EXTC
39 00 04 B9 FF 83 94
// Set MIPI
39 00 03 BA 72 83
// Set Power HX5186 Mode
39 00 10 B1 6C 15 15 24 E4 11 F1 80 E4 97 23 80 C0 D2 58
// Set Display
39 00 0C B2 00 64 10 07 22 1C 08 08 1C 4D 00
// Set CYC
39 00 0D B4 00 FF 03 5A 03 5A 03 5A 01 6A 30 6A
// Set VDC
15 00 02 BC 07
// Set Power ption HX5186 Mode
39 00 04 BF 41 0E 01
// Set D3
39 00 1F D3 00 06 00 40 07 08 00 32 10 07 00 07 54 15 0F 05 04 02 12 10 05 07 33 33 0B 0B 37 10 07 07
// Set GIP,Forward
39 00 2D D5 04 05 06 07 00 01 02 03 20 21 22 23 18 18 18 18 18 18 18 18 19 19 18 18 18 18 1B 1B 1A 1A 18 18 18 18 18 18 18 18 18 18 18 18 18 18
// Set D6,Backward
39 00 2D D6 03 02 01 00 07 06 05 04 23 22 21 20 18 18 18 18 18 18 58 58 18 18 19 19 18 18 1B 1B 1A 1A 18 18 18 18 18 18 18 18 18 18 18 18 18 18
// Set Panel
15 00 02 CC 09 // 08: invert RGB
// Set VCOM
39 00 03 B6 51 51
// Set Gamma
39 00 2B E0 00 10 16 2D 33 3F 23 3E 07 0B 0D 17 0E 12 14 12 13 06 11 13 18 00 0F 16 2E 33 3F 23 3D 07 0B 0D 18 0F 12 14 12 14 07 11 12 17
// Set C0
39 00 03 C0 30 14
// Set TCON ption
39 00 05 C7 00 C0 40 C0
// Set SAP_L ption
15 00 02 DF 87
// Set SETOFFSET
15 00 02 D2 66
//
15 78 02 11 00
15 28 02 29 00
];
panel-exit-sequence = [
//05 00 01 28
//05 00 01 10
];
disp_timings: display-timings {
native-mode = <&dsi_timing0>;
dsi_timing0: timing0 {
clock-frequency = <59197440>;// (720+8+8+16)*(1280+8+8+16)*60
hactive = <720>;
hfront-porch = <8>;
hback-porch = <8>;
hsync-len = <16>;
vactive = <1280>;
vfront-porch = <8>;
vback-porch = <8>;
vsync-len = <16>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
swap-rb = <0>;
swap-rg = <0>;
swap-gb = <0>;
};
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
panel_in_dsi: endpoint {
remote-endpoint = <&dsi_out_panel>;
};
};
};
};
ports {
#address-cells = <1>;
#size-cells = <0>;
mipi_out: port@1 {
reg = <1>;
dsi_out_panel: endpoint {
remote-endpoint = <&panel_in_dsi>;
};
};
};
};
&pinctrl {
dsi {
dsi_rst_gpio: dsi-rst-gpio {
rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
};
touch_int_gpio: touch-int-gpio {
rockchip,pins = <1 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
};