cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
efecanicoz
Visitor
Visitor
1,444 Views
Registered: ‎06-30-2020

Activating frame buffer in petalinux

Hi all,

I'm trying to use the "framebuffer read" interface via petalinux to create a fb device and to drive my lcd panel over lvds (panel is running on bare metal).

 

What i've done so far is:

I've tried to correct the generated dts entry for framebuffer_read block (reset-gpios entity was missing) like below:

	v_frmbuf_rd_0: v_frmbuf_rd@43c00000 {
		#dma-cells = <1>;
		clock-names = "ap_clk";
		clocks = <&misc_clk_0>;
		compatible = "xlnx,v-frmbuf-rd-2.1", "xlnx,axi-frmbuf-rd-v2.1";
		reset-gpios = <&axi_gpio_0 0 0 1>;
		interrupt-names = "interrupt";
		interrupt-parent = <&intc>;
		interrupts = <0 29 4>;
		reg = <0x43c00000 0x20000>;
		xlnx,dma-addr-width = <32>;
		xlnx,dma-align = <16>;
		xlnx,max-height = <2160>;
		xlnx,max-width = <3840>;
		xlnx,pixels-per-clock = <2>;
		xlnx,s-axi-ctrl-addr-width = <0x7>;
		xlnx,s-axi-ctrl-data-width = <0x20>;
		xlnx,vid-formats = "rgb888", "xbgr8888", "xrgb8888", "bgr888";
		xlnx,video-width = <8>;
	};

As i see on dmesg the framebuffer driver is successfully loaded

[08:35:01:807] dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330␍␊
[08:35:01:820] dma-pl330 f8003000.dmac: ⇥ DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16␍␊
[08:35:01:820] xilinx-frmbuf 43c00000.v_frmbuf_rd: Xilinx AXI frmbuf DMA_MEM_TO_DEV␍␊
[08:35:01:837] xilinx-frmbuf 43c00000.v_frmbuf_rd: Xilinx AXI FrameBuffer Engine Driver Probed!!␍␊

but still there is no /dev/fb0.

 

In some examples i saw that simple-framebuffer node is added to device tree so I've tried to add a basic one but no change in dmesg log. Looks like simple-framebuffer module is not loaded.

	lvds_fb: framebuffer@1817000 {
		compatible = "simple-framebuffer";
		reg = <0x1817000 (1920 * 1080 * 3)>;
		width = <1920>;
		height = <1080>;
		stride = <(1920 * 3)>;
		format = "rgb888";
		status = "okay";
	};

I've also enabled Xilinx frame buffer support (CONFIG_FB_XILINX) option in kernel configuration.

 

But i still have no clue why /dev/fb0 is not existing.

Board: Zynq7015
Tool versions: All 2018.3

0 Kudos
12 Replies
watari
Teacher
Teacher
1,437 Views
Registered: ‎06-16-2013

Hi @efecanicoz 

 

Would you share the following result ?

 

$ ls /sys/devices/platform/amba_pl@0

$ modetest

$ udevadm info -a /dev/fb0

 

Best regards,

0 Kudos
efecanicoz
Visitor
Visitor
1,418 Views
Registered: ‎06-30-2020

Hi @watari 

 

There is no amba_pl directory under ls /sys/devices/platform.

[12:04:55:452] root@test1:~# modetest␍␊
[12:05:19:722] trying to open device 'i915'...failed␍␊
[12:05:19:722] trying to open device 'amdgpu'...failed␍␊
[12:05:19:727] trying to open device 'radeon'...failed␍␊
[12:05:19:727] trying to open device 'nouveau'...failed␍␊
[12:05:19:735] trying to open device 'vmwgfx'...failed␍␊
[12:05:19:746] trying to open device 'omapdrm'...failed␍␊
[12:05:19:746] trying to open device 'exynos'...failed␍␊
[12:05:19:746] trying to open device 'tilcdc'...failed␍␊
[12:05:19:756] trying to open device 'msm'...failed␍␊
[12:05:19:756] trying to open device 'sti'...failed␍␊
[12:05:19:756] trying to open device 'tegra'...failed␍␊
[12:05:19:766] trying to open device 'imx-drm'...failed␍␊
[12:05:19:766] trying to open device 'rockchip'...failed␍␊
[12:05:19:766] trying to open device 'atmel-hlcdc'...failed␍␊
[12:05:19:777] trying to open device 'fsl-dcu-drm'...failed␍␊
[12:05:19:777] trying to open device 'vc4'...failed␍␊
[12:05:19:777] trying to open device 'virtio_gpu'...failed␍␊
[12:05:19:787] trying to open device 'mediatek'...failed␍␊
[12:05:19:787] trying to open device 'meson'...failed␍␊
[12:05:19:787] trying to open device 'pl111'...failed␍␊
[12:05:19:822] root@test1:~# udevadm info -a /dev/fb0␍␊
[12:05:44:752] Unknown device, absolute path in /dev/ or /sys expected.␍␊

 

 

 

0 Kudos
watari
Teacher
Teacher
1,385 Views
Registered: ‎06-16-2013

Hi @efecanicoz 

 

Would you share boot log and the following result ?

 

$ ls /dev/

$ ls -lA /sys/

$ ls -lA /sys/devices/

$ ls -lA /sys/devices/platform

$ ls -lA /sys/devices/platform/amba_pl@0

$ ls -lA /proc/device-tree

$ ls -lA /proc/device-tree/amba_pl@0

 

*)

I know you try "ls /sys/devices/platform/amba_pl@0". But would you try it again ?

 

At least, I guess that there are dtb issue and kernel driver issue.

 

Best regards,

0 Kudos
efecanicoz
Visitor
Visitor
1,362 Views
Registered: ‎06-30-2020

Hi @watari 

 

You could find your request below, boot log is attached.

[09:45:50:977] root@test1:~# ls /dev/␍␊
[09:45:53:835] block               ram0                tty19               tty5␍␊
[09:45:53:840] char                ram1                tty2                tty50␍␊
[09:45:53:850] console             ram10               tty20               tty51␍␊
[09:45:53:876] cpu_dma_latency     ram11               tty21               tty52␍␊
[09:45:53:876] disk                ram12               tty22               tty53␍␊
[09:45:53:876] fd                  ram13               tty23               tty54␍␊
[09:45:53:876] full                ram14               tty24               tty55␍␊
[09:45:53:876] gpiochip0           ram15               tty25               tty56␍␊
[09:45:53:904] gpiochip1           ram2                tty26               tty57␍␊
[09:45:53:904] i2c-0               ram3                tty27               tty58␍␊
[09:45:53:904] iio:device0         ram4                tty28               tty59␍␊
[09:45:53:904] initctl             ram5                tty29               tty6␍␊
[09:45:53:904] kmsg                ram6                tty3                tty60␍␊
[09:45:53:932] log                 ram7                tty30               tty61␍␊
[09:45:53:932] loop-control        ram8                tty31               tty62␍␊
[09:45:53:932] loop0               ram9                tty32               tty63␍␊
[09:45:53:932] loop1               random              tty33               tty7␍␊
[09:45:53:945] loop2               shm                 tty34               tty8␍␊
[09:45:53:945] loop3               snd                 tty35               tty9␍␊
[09:45:53:945] loop4               stderr              tty36               ttyPS0␍␊
[09:45:53:956] loop5               stdin               tty37               udev_network_queue␍␊
[09:45:53:956] loop6               stdout              tty38               urandom␍␊
[09:45:53:970] loop7               tty                 tty39               vcs␍␊
[09:45:53:970] mem                 tty0                tty4                vcs1␍␊
[09:45:53:980] memory_bandwidth    tty1                tty40               vcs2␍␊
[09:45:53:990] mmcblk0             tty10               tty41               vcsa␍␊
[09:45:53:990] mmcblk0p1           tty11               tty42               vcsa1␍␊
[09:45:54:004] mtab                tty12               tty43               vcsa2␍␊
[09:45:54:004] network_latency     tty13               tty44               vga_arbiter␍␊
[09:45:54:004] network_throughput  tty14               tty45               watchdog␍␊
[09:45:54:015] null                tty15               tty46               watchdog0␍␊
[09:45:54:015] port                tty16               tty47               zero␍␊
[09:45:54:032] ptmx                tty17               tty48␍␊
[09:45:54:032] pts                 tty18               tty49␍␊
[09:48:13:661] root@test1:~# ls -lA /sys/␍␊
[09:48:15:420] total 0␍␊
[09:48:15:420] drwxr-xr-x    2 root     root             0 Jan  1  1970 block␍␊
[09:48:15:424] drwxr-xr-x   27 root     root             0 Jan  1  1970 bus␍␊
[09:48:15:441] drwxr-xr-x   45 root     root             0 Jan  1  1970 class␍␊
[09:48:15:441] drwxr-xr-x    4 root     root             0 Jan  1  1970 dev␍␊
[09:48:15:441] drwxr-xr-x    9 root     root             0 Jan  1  1970 devices␍␊
[09:48:15:460] drwxr-xr-x    3 root     root             0 Jul 16 09:04 firmware␍␊
[09:48:15:460] drwxr-xr-x    4 root     root             0 Jul 16 09:04 fs␍␊
[09:48:15:460] drwxr-xr-x    5 root     root             0 Jan  1  1970 kernel␍␊
[09:48:15:487] drwxr-xr-x   63 root     root             0 Jan  1  1970 module␍␊
[09:48:15:487] drwxr-xr-x    2 root     root             0 Jul 16 09:04 power␍␊
[09:48:15:503] root@test1:~# ls -lA /sys/devices/␍␊
[09:48:49:010] total 0␍␊
[09:48:49:010] drwxr-xr-x    5 root     root             0 Jan  1  1970 armv7_cortex_a9␍␊
[09:48:49:020] drwxr-xr-x    3 root     root             0 Jan  1  1970 breakpoint␍␊
[09:48:49:034] drwxr-xr-x    8 root     root             0 Jan  1  1970 platform␍␊
[09:48:49:034] drwxr-xr-x    8 root     root             0 Jan  1  1970 soc0␍␊
[09:48:49:034] drwxr-xr-x    3 root     root             0 Jan  1  1970 software␍␊
[09:48:49:046] drwxr-xr-x    7 root     root             0 Jan  1  1970 system␍␊
[09:48:49:046] drwxr-xr-x   13 root     root             0 Jan  1  1970 virtual␍␊
[09:48:49:082] root@test1:~# ls -lA /sys/devices/platform␍␊
[09:49:31:881] total 0␍␊
[09:49:31:881] drwxr-xr-x    4 root     root             0 Jan  1  1970 Fixed MDIO bus.0␍␊
[09:49:31:888] drwxr-xr-x    3 root     root             0 Jan  1  1970 alarmtimer␍␊
[09:49:31:893] drwxr-xr-x    3 root     root             0 Jan  1  1970 cpuidle-zynq.0␍␊
[09:49:31:899] drwxr-xr-x    2 root     root             0 Jul 16 09:05 power␍␊
[09:49:31:904] drwxr-xr-x    4 root     root             0 Jan  1  1970 reg-dummy␍␊
[09:49:31:910] drwxr-xr-x    3 root     root             0 Jan  1  1970 snd-soc-dummy␍␊
[09:49:31:916] -rw-r--r--    1 root     root          4096 Jan  1  1970 uevent␍␊
[09:49:31:943] root@test1:~# ls -lA /sys/devices/platform/amba_pl@0␍␊
[09:49:57:890] ls: /sys/devices/platform/amba_pl@0: No such file or directory␍␊
[09:49:57:913] root@test1:~# ls -lA /proc/device-tree␍␊
[09:50:22:683] lrwxrwxrwx    1 root     root            29 Jul 16 09:06 /proc/device-tree -> /sys/firmware/devicetree/base␍␊
[09:50:22:714] root@test1:~# ls -lA /proc/device-tree/amba_pl@0␍␊
[09:51:04:614] ls: /proc/device-tree/amba_pl@0: No such file or directory␍␊

Bonus:

[09:51:36:226] root@test1:~# ls -l /sys/firmware/devicetree/base/amba_pl␍␊
[09:51:50:734] total 0␍␊
[09:51:50:734] -r--r--r--    1 root     root             4 Jul 16 09:08 #address-cells␍␊
[09:51:50:739] -r--r--r--    1 root     root             4 Jul 16 09:08 #size-cells␍␊
[09:51:50:757] -r--r--r--    1 root     root            11 Jul 16 09:08 compatible␍␊
[09:51:50:757] drwxr-xr-x    2 root     root             0 Jul 16 09:08 gpio@41200000␍␊
[09:51:50:757] drwxr-xr-x    2 root     root             0 Jul 16 09:08 misc_clk_0␍␊
[09:51:50:776] -r--r--r--    1 root     root             8 Jul 16 09:08 name␍␊
[09:51:50:776] -r--r--r--    1 root     root             0 Jul 16 09:08 ranges␍␊
[09:51:50:776] drwxr-xr-x    2 root     root             0 Jul 16 09:08 v_frmbuf_rd@43c00000␍␊
0 Kudos
watari
Teacher
Teacher
1,359 Views
Registered: ‎06-16-2013

Hi @efecanicoz 

 

Got it.

Are you using Zynq ? Not ZynqMPSoC ?

If yes, would you share whole dts file, if possible ?

If impossible, would you share dtb file ?

Also, would you share boot log, too ?

 

It seems dtb issue.

 

Best regards,

0 Kudos
efecanicoz
Visitor
Visitor
1,350 Views
Registered: ‎06-30-2020

Hi @watari 

 

Yes I'm using Zynq7015, you can find the boot log in attachments of my previous post.

 

I had to redefine v_frmbuf_rd_0 in system-user.dtsi because it doesn't have "reset-gpios" field, which i've connected to axi_gpio block's bank0 bit0.

system-user.dtsi:

/include/ "system-conf.dtsi"
/include/ "pl.dtsi"

&amba_pl {
	v_frmbuf_rd_0: v_frmbuf_rd@43c00000 {
		#dma-cells = <1>;
		clock-names = "ap_clk";
		clocks = <&misc_clk_0>;
		compatible = "xlnx,v-frmbuf-rd-2.1", "xlnx,axi-frmbuf-rd-v2.1";
		reset-gpios = <&axi_gpio_0 0 0 1>;
		interrupt-names = "interrupt";
		interrupt-parent = <&intc>;
		interrupts = <0 29 4>;
		reg = <0x43c00000 0x20000>;
		xlnx,dma-addr-width = <32>;
		xlnx,dma-align = <16>;
		xlnx,max-height = <2160>;
		xlnx,max-width = <3840>;
		xlnx,pixels-per-clock = <2>;
		xlnx,s-axi-ctrl-addr-width = <0x7>;
		xlnx,s-axi-ctrl-data-width = <0x20>;
		xlnx,vid-formats = "rgb888", "xbgr8888", "xrgb8888", "bgr888";
		xlnx,video-width = <8>;
	};
};

pl.dtsi:

/*
 * CAUTION: This file is automatically generated by Xilinx.
 * Version:  
 * Today is: Thu Jul 16 08:57:38 2020
 */


/ {
	amba_pl: amba_pl {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "simple-bus";
		ranges ;
		axi_gpio_0: gpio@41200000 {
			#gpio-cells = <3>;
			clock-names = "s_axi_aclk";
			clocks = <&misc_clk_0>;
			compatible = "xlnx,axi-gpio-2.0", "xlnx,xps-gpio-1.00.a";
			gpio-controller ;
			reg = <0x41200000 0x10000>;
			xlnx,all-inputs = <0x0>;
			xlnx,all-inputs-2 = <0x0>;
			xlnx,all-outputs = <0x1>;
			xlnx,all-outputs-2 = <0x0>;
			xlnx,dout-default = <0x00000000>;
			xlnx,dout-default-2 = <0x00000000>;
			xlnx,gpio-width = <0x1>;
			xlnx,gpio2-width = <0x20>;
			xlnx,interrupt-present = <0x0>;
			xlnx,is-dual = <0x0>;
			xlnx,tri-default = <0xFFFFFFFF>;
			xlnx,tri-default-2 = <0xFFFFFFFF>;
		};
		misc_clk_0: misc_clk_0 {
			#clock-cells = <0>;
			clock-frequency = <70386904>;
			compatible = "fixed-clock";
		};
		v_frmbuf_rd_0: v_frmbuf_rd@43c00000 {
			#dma-cells = <1>;
			clock-names = "ap_clk";
			clocks = <&misc_clk_0>;
			compatible = "xlnx,v-frmbuf-rd-2.1", "xlnx,axi-frmbuf-rd-v2.1";
			interrupt-names = "interrupt";
			interrupt-parent = <&intc>;
			interrupts = <0 29 4>;
			reg = <0x43c00000 0x20000>;
			xlnx,dma-addr-width = <32>;
			xlnx,dma-align = <16>;
			xlnx,max-height = <2160>;
			xlnx,max-width = <3840>;
			xlnx,pixels-per-clock = <2>;
			xlnx,s-axi-ctrl-addr-width = <0x7>;
			xlnx,s-axi-ctrl-data-width = <0x20>;
			xlnx,vid-formats = "rgb888", "xbgr8888", "xrgb8888", "bgr888";
			xlnx,video-width = <8>;
		};
	};
};

Do you need other dts files too ?

0 Kudos
watari
Teacher
Teacher
1,270 Views
Registered: ‎06-16-2013

Hi @efecanicoz 

 

I'd like to make sure whole boot sequence to investigate the route cause.

There are helpful information in this boot log.

Would you share it, if possible ?

 

At least, I guess it seems initialize drm issue during boot sequence.

 

Best regards,

0 Kudos
efecanicoz
Visitor
Visitor
1,245 Views
Registered: ‎06-30-2020

Hi @watari 

I assume you are asking dmesg log I'm attaching it to this post. I'm also attaching kernel and rootfs configs. Maybe I misconfigured or not enabled a requried module.

0 Kudos
watari
Teacher
Teacher
1,235 Views
Registered: ‎06-16-2013

Hi @efecanicoz 

 

>I assume you are asking dmesg log I'm attaching it to this post.

 

I confirmed them and at least, I'm sure that there is not any drm path in your linux.

So, I just ask you the following to resolve this issue.

 

- Do you have a plan to use DRM/KMS to display stream to LCD panel in your system ?

- Who draw video data into frame buffer ? By CPU ? or other device ?

 

BTW, if my understanding (what you want to do) is correct, I suggest you the followings.

 

- Reserve memory as frame buffer

- Draw data by CPU or your own designed GPU or transfer video data via dma from main memory.

- Use Ex. AXI4Stream to output video IP and other related IP to output video data with CRTC (ex VTC) to LCD panel

 

Best regards,

0 Kudos
efecanicoz
Visitor
Visitor
1,229 Views
Registered: ‎06-30-2020

Hi @watari 

 

It would be good to have a drm in system to have more generic approach. Not sure how to do it though, need to search it.

 

Currently i'm solely trying to prove that i could drive my lcd display with petalinux on zynq7000 device. I was thinking as the standard way to have this is having a device listed under /dev so i could feed it to gstreamer to stream a video on it.

 

If i understand correctly your suggestion is driving video dma manually am i correct ?

0 Kudos
watari
Teacher
Teacher
1,219 Views
Registered: ‎06-16-2013

Hi @efecanicoz 

 

OK.

I share helpful information to implement fbdev as drm driver to drive lcd panel.

Refer the following URLs.

 

https://www.kernel.org/doc/html/v5.4/gpu/pl111.html

https://github.com/Xilinx/linux-xlnx/search?q=lcd&unscoped_q=lcd

 

I hope this helps.

 

Best regards,

0 Kudos
ksloatdesignlinx
Explorer
Explorer
1,193 Views
Registered: ‎02-24-2020

Simply adding a framebuffer read node is not sufficient to create a Linux display. You need to create a complete pipeline. As you see, your framebuffer read node is getting probed, but that needs to be linked to other driver components in device tree to create a pipeline. The modern way to do this is using the DRM/KMS system which Xilinx readily supports through its various display IP drivers:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842520/Xilinx+DRM+KMS+driver

In your case, I would probably recommend using pl-disp (which will create a xilinx DRM pipeline), but you will also need to implement or use some type of encoder/connector in order for the pipeline to create the emulated /dev/fb device.

So your complete pipeline of driver pieces would look something like:

frmbuf_rd -> pl-disp -> encoder -> connector

https://github.com/Xilinx/linux-xlnx/blob/master/Documentation/devicetree/bindings/display/xlnx/xlnx%2Cpl-disp.txt

Ken Sloat - Embedded Software Engineer
https://www.designlinxhs.com
0 Kudos