Jump to content

Possible to get Jammy (5.15 kernel) to use DSI/TP display


dkebler

Recommended Posts

I've got jammy running but I have a dsi display for the board and I'd like that to work (well the tp port too) with jammy.   Looking at armbian config I see no setting for it.    I know the display works fine as if I load an aryufan android image it works as it is set to use DSI by default.

 

Does this kernel know about the DSI port?   Do I have to build a custom kernel?  If not then what boot env line will get it going?

 

Link to comment
Share on other sites

Still trying to get this to work.  

 

I did see that the kernel config has enabled it.   So apparently that kernel module is loaded.

 

`CONFIG_DRM_MIPI_DSI=y`

 

but

 `CONFIG_DRM_PANEL_DSI_CM=m` 

is a loadable module

 

The two DSI modules that that be loaded are apparently

 

`cat /lib/modules/$(uname -r)/modules.builtin | grep dsi`

 

 

kernel/drivers/gpu/drm/drm_mipi_dsi.ko
kernel/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.ko


`

 

so I added those to /etc/modules

 

dw_mipi_dsi
drm_mipi_dsi

 

 

but on reboot they are not listed by 

lsmod.| grep dsi

 

 

So am I barking up the right tree?   How come these built-in modules won't load in this way?

 

 

Edited by dkebler
Link to comment
Share on other sites

ok so I try to load the module manually and get

 

 modprobe --first-time drm_mipi_dsi
modprobe: ERROR: could not insert 'drm_mipi_dsi': Module already in kernel


so it's already in the kernel so WHY is the DSI device not recognized and loaded  (its not listed with lsmod)

 

IF it's auto detected in order to load well the cable to the lcd is connected and it was working with android.

Link to comment
Share on other sites

Actually, this easy. Because I found main line kernel support this display panel since linux 6.0,touch https://github.com/torvalds/linux/blob/4fe89d07dcc2804c8b562f6c7896a45643d34b2f/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi#L582,lcd https://github.com/torvalds/linux/blob/4fe89d07dcc2804c8b562f6c7896a45643d34b2f/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi#L629

 

If use linux 5.15, you need copy upper 2 section dts and enable touch,lcd as overlay.

If use linux 6.0 and latter,you just enable touch,lcd  as overlay.

Link to comment
Share on other sites

For 5.15 Kernel. 

There are no dtsi files in the image in order to insert and compile. 

Can I just compile the entire 6.0 dtsi you pointed to and replace that dtb completely or will that break things?

Otherwise i guess I have to go grab the dtsi for 5.15 and edit as you say and then compile.

 

Alternatively I could upgrade the entire kernel to 6.0 but again don't know if that will break things.

 

What did you do?

Link to comment
Share on other sites

I wrote up a little script to deal with includes before running dtc  per https://stackoverflow.com/a/36298460/4695378

 

First I tried just remaking the dtb file with the unchanged  rk3399-rockpro64.dtsi  

 

but throws an error in the rk3399.dtsi dependency file 

 

Error: rk3399.dtsi:15.1-2 syntax error
FATAL ERROR: Unable to parse input tree
 

I did nothing but copy that file so not understanding why there is a syntax error in a file that was NOT changed.

 

Anyway, stuck at this point with idea of making a new rk3399-rockpro64.dtb   

 

I see some armbian images are now shipping the 6 kernel but not the  rock64pro ones :(.  Even if they did I think I still have to make the dtb file as the dtsi file has those as  status "disabled" instead of "okay"

 

So how does one compile a one off dtb file from dtsi  that has dtsi dependencies cause I seem to be missing something here.  

 

 

Quote

 

SRC=/usr/src/linux-source-5.15.80-rockchip64

ARCH=arm64

DIR=$SRC/arch/$ARCH/boot/dts

SOC=rockchip

INCLUDE=$SRC/include

CHIP=rk3399

DEV=$CHIP-rockpro64

DEP1=$CHIP

DEP2=$CHIP-opp

DST=$DEV.dtb

cp $DIR/$SOC/$DEP1.dtsi $DEP1.dtsi.tmp

cp $DIR/$SOC/$DEP2.dtsi $DEP2.dtsi.tmp

cp $DIR/$SOC/$DEV.dtsi $DEV.dtsi.tmp

cpp -nostdinc -I $INCLUDE -undef -x assembler-with-cpp $DEP1.dtsi.tmp > $DEP1.dtsi

cpp -nostdinc -I $INCLUDE -undef -x assembler-with-cpp $DEP2.dtsi.tmp > $DEP2.dtsi

cpp -nostdinc -I $INCLUDE -undef -x assembler-with-cpp $DEV.dtsi.tmp > $DEV.dtsi

dtc -O dtb -b 0 -o $DST $DEV.dtsi

 

 

Link to comment
Share on other sites

OKE I got my script issue resolved needed to use the dts file and only need to precompile it not the other files.  My new version of the script is below 

 

Was able to compile with the changes you suggested but had to add also the backlight and avdd stanzas.  Not sure if they are needed?

 

So I booted and the hdmi goes blank but then the panel does not come up (super sad).

So I went back and removed the avdd-supply and backlight but that did not help.

 

So definitely suck now.  Hopefully the hardware if functioning.  I have no way to tell.  

 

I guess I should try the 6.0 kernel but all the current armbian images for rockpro64 are using 5.15 and I have no experience compiling a kernel and I don't think armbian-config will upgrade across major releases.

 

 

mipi_panel: panel@0 {
		compatible = "feiyang,fy07024di26a30d";
		reg = <0>;
		avdd-supply = <&avdd>;
		backlight = <&backlight>;
		dvdd-supply = <&vcc3v3_s0>;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;

				mipi_in_panel: endpoint {
					remote-endpoint = <&mipi_out_panel>;
				};
			};
		};
	};

 

 

#!/bin/bash
SRC=/usr/src/linux-source-5.15.80-rockchip64
ARCH=arm64
DIR=$SRC/arch/$ARCH/boot/dts
SOC=rockchip
INCLUDE=$SRC/include
CHIP=rk3399
DEV=$CHIP-rockpro64
DEP1=$CHIP
DEP2=$CHIP-opp
DST=$DEV.dtb
cp $DIR/$SOC/$DEP1.dtsi .
cp $DIR/$SOC/$DEP2.dtsi .
# cp $DIR/$SOC/$DEV.dtsi . 
cp $DEV.dtsi.edits  $DEV.dtsi
cp $DIR/$SOC/$DEV.dts $DEV.dts.tmp
cpp -nostdinc -I $INCLUDE -undef -x assembler-with-cpp $DEV.dts.tmp > $DEV.dts
dtc -O dtb -b 0 -o $DST $DEV.dts

 

 

Link to comment
Share on other sites

If you need help @ me  please else I don't recive notify and my time zone is GMT+8.

https://www.armbian.com/rockpro64/ at the bottom Rolling weekly releases has linux 6.1 image .

Of course,I suggest you use a sdcard as test first if you use emmc now.

I don't have a rockpro64, only have nanopct4 and orangepi4 as rk3399 board. But I guess it has same way that they also use rk3399.

 

1. I suppose you use linux kernel 6.x at rockpro64 and swtich user to root, create pine64-lcd.dts and put below content:

/dts-v1/;
/plugin/;

/ {
  compatible = "rockchip,rk3399";
	
  fragment@0 {
    target=<&backlight>;
    __overlay__ {
      status = "okay";
    };
  };
  
  fragment@1 {
    target=<&touch>;
    __overlay__ {
      status = "okay";
    };
  };
  
  fragment@2 {
    target=<&mipi_dsi>;
    __overlay__ {
      status = "okay";
    };
  }; 
  
  fragment@3 {
    target=<&vopl>;
    __overlay__ {
      status = "okay";
    };
  };

  fragment@4 {
    target=<&vopl_mmu>;
    __overlay__ {
      status = "okay";
    };
  };
  
  fragment@5 {
    target=<&vopb>;
    __overlay__ {
      status = "okay";
    };
  };

  fragment@6 {
    target=<&vopb_mmu>;
    __overlay__ {
      status = "okay";
    };
  };
};

 

2. exec below command, then reboot.

armbian-add-overlay pine64-lcd.dts

 

Link to comment
Share on other sites

@iamdrq

 

[SOLVED]

 

That worked including touch!  I downloaded the sid image and added the dts file.  I didn't know that armbian had a overlay add command.  Plus I don't know enough about kernels and overlays to come up with that dts file so  THX!

 

As I look at that code I now see that's a way to enable (okay) a stanza/device in an existing dtb module without having to recompile it.  So I have learned something!

 

My goal was to set up home assistant on this board but since I had the touch screen I bought originally for running android (now images of that are way old)  I wanted to also set up a minimal X and load a browser in kiosk mode pointing to the home assistant page.   Now with your help I can do that!   Eventually when 6 kernel ends up in stable release I can switch to that.

 

again THX.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines