MIPI port from EdgeV to VIM3L issue

Hi!
I’m having trouble porting a working MIPI DTS code from EdgeV to VIM3L (both using ubuntu desktop).

Have tried every parameter in the dts with no success…

please see the attached image where I ran the cube example in /usr/share/arm/opengles_20/cube

Same MIPI init, and sync parameters but the image gets completely broken

I need help ASAP for a demo, thank you! @numbqq @Frank @Gouwa @RDFTKV

Why you need to port? The MIPI is already supported for VIM3L.

I’m not porting the driver, I’m “porting” the dts parameters… that’s what I meant… SAME parameters, but it does not work on VIM3L.

What LCD? Khadas TS050 or your own LCD?

Own lcd… the parameters and code are the same in edgev and vim3l dts, it should work the same

Maybe not. There maybe some little difference.

What’s the resolution of you LCD? Can you share your LCD configuration?

Sure, 720p

VIM3L

EDGE V

EDGE V

@quatro Can you apply this patch to u-boot and try again?

diff --git a/board/khadas/configs/kvim3l.h b/board/khadas/configs/kvim3l.h
index 94d8b9a..57c0020 100644
--- a/board/khadas/configs/kvim3l.h
+++ b/board/khadas/configs/kvim3l.h
@@ -111,8 +111,8 @@
         "display_color_bg=0\0" \
         "dtb_mem_addr=0x1000000\0" \
         "fb_addr=0x3d800000\0" \
-        "fb_width=1920\0" \
-        "fb_height=1080\0" \
+        "fb_width=1280\0" \
+        "fb_height=720\0" \
         "frac_rate_policy=1\0" \
         "sdr2hdr=2\0" \
         "hdmi_read_edid=1\0" \
@@ -256,10 +256,6 @@
                 "hdmitx get_preferred_mode;"\
                 "hdmitx edid;"\
                 "hdmitx hpd;"\
-                "if test ${lcd_exist} = 1 && test ${outputmode} = panel; then "\
-                    "setenv fb_width 1088;"\
-                    "setenv fb_height 1920;"\
-                "fi;"\
                 "osd open;"\
                 "osd clear;"\
                 "if load mmc 0:2 ${loadaddr} /usr/share/fenix/logo/logo.bmp || load mmc 1:2 ${loadaddr} /usr/share/fenix/logo/logo.bmp || load mmc 1:5 ${loadaddr} /usr/share/fenix/logo/logo.bmp; then "\
diff --git a/drivers/display/lcd/lcd_tablet/lcd_tablet.c b/drivers/display/lcd/lcd_tablet/lcd_tablet.c
index e82adcf..df3ad0d 100644
--- a/drivers/display/lcd/lcd_tablet/lcd_tablet.c
+++ b/drivers/display/lcd/lcd_tablet/lcd_tablet.c
@@ -179,7 +179,7 @@ static int lcd_config_load_from_dts(char *dt_addr, struct lcd_config_s *pconf)
                LCDERR("failed to get basic_setting\n");
                return -1;
        } else {
-               pconf->lcd_basic.h_active = be32_to_cpup((u32*)propdata) == 1088 ? 1080 : be32_to_cpup((u32*)propdata);
+               pconf->lcd_basic.h_active = be32_to_cpup((u32*)propdata);
                pconf->lcd_basic.v_active = be32_to_cpup((((u32*)propdata)+1));
                pconf->lcd_basic.h_period = be32_to_cpup((((u32*)propdata)+2));
                pconf->lcd_basic.v_period = be32_to_cpup((((u32*)propdata)+3));

After update u-boot, you need to revert the u-boot env:

kvim3l#env default -a
kvim3l#saveenv 
kvim3l#reset

I have applied the patch, and rebuild the image, how do I run:

?

Thanks!

If you rebuild the whole image, you don’t need to do this. Just burn the new image you buuild.

perfect… it is building right now… is there any way to just update the uboot part?

Yes,

$ make uboot
$ make uboot-deb

You will get the u-boot debian package in: build/images/debs/0.8.2/VIM3L/linux-u-boot-vim3l-vendor_0.8.2-2015.01_arm64.deb

Copy it to the borad and install it:

$ sudo dpkg -i linux-u-boot-vim3l-vendor_0.8.2-2015.01_arm64.deb
$ sync
$ sudo reboot
2 Likes

perfect! apparently I’m on version 0.7

Just for reference, you can find the package in your own folder.

Installed deb, sync and rebooted… but it is still showing the same glitch

Can you show the result of fw_printenv command ?

Here:

~# fw_printenv

EnableSelinux=permissive

Irq_check_en=0

active_slot=normal

baudrate=115200

bcb_cmd=get_avb_mode;get_valid_slot;

board_defined_bootup=bootup_D3

boot_part=boot

bootargs=root=LABEL=ROOTFS rootflags=data=writeback rw rootfstype=ext4 console=tty0 console=ttyS0,115200n8 no_console_suspend consoleblank=0 fsck.repair=yes net.ifnames=0 logo=osd0,loaded,0x3d800000 vout=panel,enable hdmitx=,444,8bit hdmimode=1080p60hz cvbsmode=576cvbs osd_reverse=0 video_reverse=0 jtag=disable androidboot.hardware=amlogic reboot_mode=uboot_updated ddr_size= androidboot.serialno=1234567890 mac=c8:63:14:70:4d:8c androidboot.mac=c8:63:14:70:4d:8c hwver=VIM3.V12 androidboot.rpmb_state=0

bootcmd=run storeboot

bootdelay=1

chiprev=C

cmdline_keys=if keyman init 0x1234; then if keyman read usid ${loadaddr} str; then setenv bootargs ${bootargs} androidboot.serialno=${usid};setenv serial ${usid};else setenv bootargs ${bootargs} androidboot.serialno=1234567890;setenv serial 1234567890;fi;kbi ethmac;setenv bootargs ${bootargs} mac=${eth_mac} androidboot.mac=${eth_mac};if keyman read deviceid ${loadaddr} str; then setenv bootargs ${bootargs} androidboot.deviceid=${deviceid};fi;fi;

colorattribute=444,8bit

cvbs_drv=0

cvbsmode=576cvbs

display_bpp=24

display_color_bg=0

display_color_fg=0xffff

display_color_index=24

display_height=1280

display_layer=osd0

display_width=720

dtb_mem_addr=0x1000000

eth_mac=c8:63:14:70:4d:8c

ethact=dwmac.ff3f0000

ethaddr=02:00:00:10:24:01

factory_reset_poweroff_protect=echo wipe_data=${wipe_data}; echo wipe_cache=${wipe_cache};if test ${wipe_data} = failed; then run init_display; run storeargs;if mmcinfo; then run recovery_from_sdcard;fi;if usb start 0; then run recovery_from_udisk;fi;run recovery_from_flash;fi; if test ${wipe_cache} = failed; then run init_display; run storeargs;if mmcinfo; then run recovery_from_sdcard;fi;if usb start 0; then run recovery_from_udisk;fi;run recovery_from_flash;fi;

fan_stop=i2c mw 0x18 0x88 0

fb_addr=0x3d800000

fb_height=720

fb_width=1280

fdt_high=0x20000000

firstboot=1

frac_rate_policy=1

fs_type=rootfstype=ext4

gatewayip=192.168.1.1

hdmi_read_edid=1

hdmimode=1080p60hz

hostname=KVIM3L

hwver=VIM3.V12

init_display=get_rebootmode;echo reboot_mode:::: ${reboot_mode};if test ${reboot_mode} = quiescent; then setenv reboot_mode_android quiescent;run storeargs;setenv bootargs ${bootargs} androidboot.quiescent=1;osd open;osd clear;else setenv reboot_mode_android normal;run storeargs;hdmitx get_preferred_mode;hdmitx edid;hdmitx hpd;osd open;osd clear;if load mmc 0:2 ${loadaddr} /usr/share/fenix/logo/logo.bmp || load mmc 1:2 ${loadaddr} /usr/share/fenix/logo/logo.bmp || load mmc 1:5 ${loadaddr} /usr/share/fenix/logo/logo.bmp; then bmp display ${loadaddr};bmp scale;vout output ${outputmode};vpp hdrpkt;fi;fi;

initargs=root=LABEL=ROOTFS rootflags=data=writeback rw rootfstype=ext4 console=tty0 console=ttyS0,115200n8 no_console_suspend consoleblank=0 fsck.repair=yes net.ifnames=0

initrd_high=7f800000

ipaddr=192.168.1.200

irremote_update=if irkey 2500000 0xe31cfb04 0xb748fb04; then echo read irkey ok!; if itest ${irkey_value} == 0xe31cfb04; then run update;else if itest ${irkey_value} == 0xb748fb04; then run update;

fi;fi;fi;

jtag=disable

lcd_ctrl=0x00000083

lcd_exist=1

loadaddr=1080000

lock=10001000

maxcpus=4

netmask=255.255.255.0

osd_reverse=0

otg_device=1

outputmode=panel

panel_type=lcd_0

port_mode=0

port_mode_change=fdt addr ${dtb_mem_addr}; kbi portmode r;if test ${port_mode} = 0; then fdt set /usb3phy@ffe09080 status okay;fdt set /pcieA@fc000000 status disable;else fdt set /usb3phy@ffe09080 status disable;fdt set /pcieA@fc000000 status okay;fi;

preboot=run upgrade_check;run init_display;run storeargs;run upgrade_key;run vim3_check;run uboot_update_check;run wol_init;run port_mode_change;forceupdate;run fan_stop;

reboot_mode=uboot_updated

reboot_mode_android=normal

recovery_from_flash=get_valid_slot;echo active_slot: ${active_slot};if test ${active_slot} = normal; then setenv bootargs ${bootargs} aml_dt=${aml_dt} recovery_part={recovery_part} recovery_offset={recovery_offset};if imgread kernel ${recovery_part} ${loadaddr} ${recovery_offset}; then wipeisb; bootm ${loadaddr}; fi;else setenv bootargs ${bootargs} aml_dt=${aml_dt} recovery_part=${boot_part} recovery_offset=${recovery_offset};if imgread kernel ${boot_part} ${loadaddr}; then bootm ${loadaddr}; fi;fi;

recovery_from_sdcard=if fatload mmc 0 ${loadaddr} aml_autoscript; then autoscr ${loadaddr}; fi;if fatload mmc 0 ${loadaddr} recovery.img; then if fatload mmc 0 ${dtb_mem_addr} dtb.img; then echo sd dtb.img loaded; fi;wipeisb; bootm ${loadaddr};fi;

recovery_from_udisk=if fatload usb 0 ${loadaddr} aml_autoscript; then autoscr ${loadaddr}; fi;if fatload usb 0 ${loadaddr} recovery.img; then if fatload usb 0 ${dtb_mem_addr} dtb.img; then echo udisk dtb.img loaded; fi;wipeisb; bootm ${loadaddr};fi;

recovery_offset=0

recovery_part=recovery

rpmb_state=0

sdc_burning=sdc_burn ${sdcburncfg}

sdcburncfg=aml_sdc_burn.ini

sdr2hdr=2

serial=1234567890

serverip=192.168.1.230

stderr=serial

stdin=serial

stdout=serial

storeargs=setenv bootargs ${initargs} logo=${display_layer},loaded,${fb_addr} vout=${outputmode},enable hdmitx=${cecconfig},${colorattribute} hdmimode=${hdmimode} cvbsmode=${cvbsmode} osd_reverse=${osd_reverse} video_reverse=${video_reverse} jtag=${jtag}; setenv bootargs ${bootargs} androidboot.hardware=amlogic reboot_mode=${reboot_mode} ddr_size=${ddr_size};run cmdline_keys;

storeboot=kbi resetflag 0;boot_cooling;cfgload;if load mmc 0:1 1020000 s905_autoscript || load mmc 1:1 1020000 s905_autoscript || load mmc 1:5 1020000 /boot/s905_autoscript; then autoscr 1020000; fi;ext4load mmc 1:5 1080000 zImage;ext4load mmc 1:5 10000000 uInitrd;ext4load mmc 1:5 20000000 dtb.img;booti 1080000 10000000 20000000;for p in 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15 16 17 18; do if fatload mmc 1:${p} ${loadaddr} aml_autoscript; then autoscr ${loadaddr}; fi; done;run update;

switch_bootmode=get_rebootmode;if test ${reboot_mode} = factory_reset; then setenv reboot_mode_android normal;run storeargs;run recovery_from_flash;else if test ${reboot_mode} = update; then setenv reboot_mode_android normal;run storeargs;run update;else if test ${reboot_mode} = quiescent; then setenv reboot_mode_android quiescent;run storeargs;setenv bootargs ${bootargs} androidboot.quiescent=1;else if test ${reboot_mode} = cold_boot; then setenv reboot_mode_android normal;run storeargs;else if test ${reboot_mode} = fastboot; then setenv reboot_mode_android normal;run storeargs;fastboot;fi;fi;fi;fi;fi;

try_auto_burn=update 700 750;

uboot_update_check=get_rebootmode;print reboot_mode;if test ${reboot_mode} = uboot_updated; then echo u-boot updated, pass to kernel…;saveenv;else if test -e mmc 1:5 /usr/lib/u-boot/.UBOOT-NEED-UPDATE; then echo New u-boot found!Try to upgrade u-boot…;if load mmc 1:5 1080000 /usr/lib/u-boot/u-boot.bin; then store rom_write 1080000 0 $filesize;store erase partition env;echo u-boot upgrade done, reboot…;reboot uboot_updated;fi;fi;fi;

update=run usb_burning; run sdc_burning; if mmcinfo; then run recovery_from_sdcard;fi;if usb start 0; then run recovery_from_udisk;fi;run recovery_from_flash;

updateu=tftp 1080000 u-boot.bin;mmc dev 1;store rom_write 1080000 0 ${filesize}

upgrade_check=echo upgrade_step=${upgrade_step}; if itest ${upgrade_step} == 3; then run init_display; run storeargs; run update;else fi;

upgrade_key=if gpio input GPIOAO_7; then echo detect upgrade key;gpio set GPIOAO_4;run fan_stop;run update;fi;

upgrade_step=0

usb_burning=update 1000

video_reverse=0

vim3_check=kbi hwver; if test ${hwver} != Unknow; then echo Product checking: pass! Hardware version: ${hwver};else echo Product checking: fail!; sleep 5; reboot;fi;setenv bootargs ${bootargs} hwver=${hwver};

wipe_cache=successful

wipe_data=successful

wol_init=kbi init;kbi powerstate;kbi trigger wol r;setenv bootargs ${bootargs} wol_enable=${wol_enable};if test ${power_state} = 1; then kbi trigger wol w 1;kbi poweroff;fi;