RK提供的常规的mipi指令,比如0x15 0x39 等等,但是SDK本身不支持0x32命令,需要加入以下补丁:
rk3126补丁如下:
kenel使用:
diff --git a/drivers/video/rockchip/screen/lcd_mipi.c b/drivers/video/rockchip/screen/lcd_mipi.c
index 8eeef57..eba303d6 100755
--- a/drivers/video/rockchip/screen/lcd_mipi.c
+++ b/drivers/video/rockchip/screen/lcd_mipi.c
@@ -166,6 +166,7 @@ static void rk_mipi_screen_cmd_init(struct mipi_screen *screen)
int rk_mipi_screen(void)
{
u8 dcs[16] = {0}, rk_dsi_num;
+ u32 *p,data;
rk_dsi_num = gmipi_screen->mipi_dsi_num;
if (gmipi_screen->screen_init == 0) {
rk_mipi_screen_pwr_enable(gmipi_screen);
@@ -211,6 +212,47 @@ int rk_mipi_screen(void)
if (rk_dsi_num == 2) {
dsi_enable_video_mode(1, 1);
}
+ /* Sending 0x22 command and 0x32 commad */
+ p = ioremap(0x20008150, SZ_4);
+ data = ioread32(p);
+ data |= 0x100000;
+ data &= ~0x10;
+ iowrite32(data, p);
+ printk("mipi reg data1 = %x\n",data);
+ //writel(data, 0x20008150);
+ udelay(20);
+ /* 0x22 command */
+ data |= 0x100000;
+ data |= 0x10;
+ iowrite32(data, p);
+ printk("mipi reg data2 = %x\n",data);
+ // writel(data, 0x20008150);
+ msleep(10);
+ /* 0x32 command */
+ data = ioread32(p);
+ data |= 0x100000;
+ data &= ~0x10;
+ printk("mipi reg data3 = %x\n",data);
+ iowrite32(data, p);
+ udelay(20);
+ iounmap(p);
+ // writel(data,0x20008150);
+
+ msleep(20);
+ dcs[0] = HSDT;
+ dcs[1] = DTYPE_DCS_SWRITE_0P;
+ dcs[2] = dcs_exit_sleep_mode;
+ dsi_send_packet(0, dcs, 3);
+ if (rk_dsi_num == 2)
+ dsi_send_packet(1, dcs, 3);
+
+ msleep(2);
+
+ dcs[0] = HSDT;
+ dcs[1] = DTYPE_DCS_SWRITE_0P;
+ dcs[2] = dcs_set_display_on;
+ dsi_send_packet(0, dcs, 3);
+
} else {
rk_mipi_screen_pwr_enable(gmipi_screen);
UBOOT上使用:
diff --git a/drivers/video/screen/lcd_mipi.c b/drivers/video/screen/lcd_mipi.c
index b9e513c..9146c39 100755
--- a/drivers/video/screen/lcd_mipi.c
+++ b/drivers/video/screen/lcd_mipi.c
@@ -173,6 +173,7 @@ static void rk_mipi_screen_cmd_init(struct mipi_screen *screen)
int rk_mipi_screen(void)
{
+ u32 *p,data;
u8 dcs[16] = {0}, rk_dsi_num;
rk_dsi_num = gmipi_screen->mipi_dsi_num;
if(gmipi_screen->screen_init == 0){
@@ -219,6 +220,29 @@ int rk_mipi_screen(void)
if(rk_dsi_num == 2){
dsi_enable_video_mode(1,1);
}
+ /* Sending 0x22 command and 0x32 commad */
+ // p = ioremap(0xff770418, SZ_4);
+ // data = ioread32(p);
+ data = 0;
+ data |= 0x100000;
+ data &= ~0x10;
+ //iowrite32(data, p);
+ writel(data, 0x20008150);
+ udelay(20);
+ /* 0x22 command */
+ data |= 0x100000;
+ data |= 0x10;
+ //iowrite32(data, p);
+ writel(data, 0x20008150);
+ msleep(10);
+ /* 0x32 command */
+ //data = ioread32(p);
+ data |= 0x100000;
+ data &= ~0x10;
+ //iowrite32(data, p);
+ //iounmap(p);
+ writel(data,0x20008150);
+ msleep(20);
}
else{
rk_mipi_screen_pwr_enable(gmipi_screen);
diff --git a/drivers/video/transmitter/rk32_mipi_dsi.c b/drivers/video/transmitter/rk32_mipi_dsi.c
index 375dfdb..6db1188 100755
--- a/drivers/video/transmitter/rk32_mipi_dsi.c
+++ b/drivers/video/transmitter/rk32_mipi_dsi.c
@@ -986,6 +986,11 @@ static int rk32_mipi_dsi_host_init(struct dsi *dsi)
//rk32_dsi_set_bits(dsi, 0, outvact_lpcmd_time); //byte
//rk32_dsi_set_bits(dsi, 0, invact_lpcmd_time);
+ /* enable send command in low power mode */
+ rk32_dsi_set_bits(dsi, 4, outvact_lpcmd_time);
+ rk32_dsi_set_bits(dsi, 4, invact_lpcmd_time);
+ rk32_dsi_set_bits(dsi, 1, lp_cmd_en);
+
rk32_dsi_set_bits(dsi, 20, phy_hs2lp_time);
rk32_dsi_set_bits(dsi, 16, phy_lp2hs_time);
p>
RK3368 patch as follows:
diff –git a/drivers/video/screen/lcd_mipi.c b/drivers/video/screen/lcd_mipi.c
index 257ea7a.. E8e1c0bf 100755
– a/drivers/video/screen/lcd_mipi.
c + + + b/drivers/video/screen/lcd_mipi c
@ @ + 177-177, 6, 7 @ @ static void rk_mipi_screen_cmd_init (struct mipi_screen * screen)
Int rk_mipi_screen (void)
{
p + u32 * and data;
u8 DCS [16] = {0}, rk_dsi_num;
rk_dsi_num = gmipi_screen – & gt; mipi_dsi_num;
if (gmipi_screen – & gt; Screen_init = = 0) {
@ @ – 223, 6 + 224 @ @ int rk_mipi_screen (void)
if (rk_dsi_num = = 2) {
dsi_enable_video_mode (1, 1);
} +/* Sending 0 x22 command and 0 x32 commad */
+// p = ioremap (0 xff770418, SZ_4);
+ // data = ioread32(p);
+ data = 0;
+ data |= 0x040000;
+ data & amp; = ~0x04;
+// iowrite32 (data, p);
+ writel (data, 0 xff770418);
+ udelay (20);
+/* 0 x22 command */
+ data | = 0 x040000;
+ data |= 0x04;
+// iowrite32 (data, p);
+ writel (data, 0 xff770418);
+ msleep (10);
+/* 0 x32 command */
+// data = ioread32 (p);
+ data |= 0x040000;
+ data & amp; = ~0x04;
+// iowrite32 (data, p);
+// iounmap (p);
+ writel (data, 0 xff770418);
+ msleep (20);
} else {
rk_mipi_screen_pwr_enable (gmipi_screen);
p>
Read More:
- RuntimeError: Expected hidden[0] size (x, x, x), got(x, x, x)
- [Solved] emulator: glteximage2d: got err pre 🙁 0x502 internal 0x1908 format 0x1908 type 0x1401
- CLP: error: getaddrinfo enotfound http://x.x.x.x/
- Apache Groovy——java.lang.NoSuchMethodError: x.x.x: method <init>()V not found
- [-] handler failed to bind to x.x.x.x: Port troubleshooting
- module ‘win32com.gen_py.00020813-0000-0000-C000-000000000046x0x1x9‘ has no attribute ‘CLSIDToClassMa
- A problem occurred configuring project ‘:x x x‘. > java.lang.NullPointerException (no error message)
- 1067 – Invalid default value for ‘sex‘1366 – Incorrect string value: ‘\xE6\x8A\x80\xE6\x9C\xAF…‘ f
- Could not write JSON: write javaBean error, fastjson version x.x.x, class
- OSD deployment failure code (0x00000001) 0x80004005
- Microsoft OLE DB Provider for SQL Server error & #x27;80040e4d & #x27;
- 【PTA:】 Error: class X is public should be declared in a file named X.java
- Unhandled exception at 0x00000000: 0xc0000005: access violation at position 0x0000000000
- Ubuntu18.04 x11vnc failed, report error opening logfile: /var/log/x11vnc.log
- Linux basic command execution error: the solution of command not found
- When docker creates a container command: Error response from daemon: No command specified
- Solution to command line option syntax error. Type command /? For help
- Running program encountered Error:Access violation at 0x**(tried to write to 0x**) program terminated
- Command errored out with exit status 1: python setup.py egg_info Check the logs for full command ou
- SSH Login: RSA host key for 192.168.x.x has changed and you have requested strict checking. Host key