cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
307 Views
Registered: ‎11-07-2019

Video mem2mem on custom zcu106-like board

I am trying to implement a video processing pipeline using a custom zcu106-like board containing an UltraScale+ MPSoC 5EV.  I've been following the Wiki post located at:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/80674831/Mem+2+Mem+VPSS-CSC+Composite+device

...and my current hardware design is shown in the image.

Screenshot from 2020-06-02 13-15-04.png

The relevant portion of the resulting device tree is included below:

		v_frmbuf_rd@a0000000 {
			#dma-cells = <0x1>;
			clock-names = "ap_clk";
			clocks = <0x25>;
			compatible = "xlnx,axi-frmbuf-rd-v2.1";
			interrupt-names = "interrupt";
			interrupt-parent = <0x4>;
			interrupts = <0x0 0x59 0x4>;
			reg = <0x0 0xa0000000 0x0 0x10000>;
			reset-gpios = <0x14 0x78 0x1>;
			xlnx,dma-addr-width = <0x20>;
			xlnx,dma-align = <0x10>;
			xlnx,max-height = <0x870>;
			xlnx,max-width = <0xf00>;
			xlnx,pixels-per-clock = <0x2>;
			xlnx,s-axi-ctrl-addr-width = <0x7>;
			xlnx,s-axi-ctrl-data-width = <0x20>;
			xlnx,vid-formats = "rgb888", "bgr888", "nv16", "yuyv";
			xlnx,video-width = <0x8>;
			phandle = <0x28>;
		};

		v_frmbuf_wr@a0040000 {
			#dma-cells = <0x1>;
			clock-names = "ap_clk";
			clocks = <0x25>;
			compatible = "xlnx,axi-frmbuf-wr-v2.1";
			interrupt-names = "interrupt";
			interrupt-parent = <0x4>;
			interrupts = <0x0 0x5a 0x4>;
			reg = <0x0 0xa0040000 0x0 0x10000>;
			reset-gpios = <0x14 0x7a 0x1>;
			xlnx,dma-addr-width = <0x20>;
			xlnx,dma-align = <0x10>;
			xlnx,max-height = <0x870>;
			xlnx,max-width = <0xf00>;
			xlnx,pixels-per-clock = <0x2>;
			xlnx,s-axi-ctrl-addr-width = <0x7>;
			xlnx,s-axi-ctrl-data-width = <0x20>;
			xlnx,vid-formats = "rgb888", "bgr888", "nv16", "yuyv";
			xlnx,video-width = <0x8>;
			phandle = <0x29>;
		};

		v_proc_ss@a0010000 {
			clock-names = "aclk";
			clocks = <0x25>;
			compatible = "xlnx,v-vpss-csc";
			reg = <0x0 0xa0010000 0x0 0x10000>;
			reset-gpios = <0x14 0x79 0x1>;
			xlnx,colorspace-support = <0x0>;
			xlnx,csc-enable-window = "true";
			xlnx,max-height = <0x870>;
			xlnx,max-width = <0xf00>;
			xlnx,num-video-components = <0x3>;
			xlnx,samples-per-clk = <0x2>;
			xlnx,topology = <0x3>;
			xlnx,use-uram = <0x0>;
			xlnx,video-width = <0x8>;

			ports {
				#address-cells = <0x1>;
				#size-cells = <0x0>;

				port@0 {
					reg = <0x0>;
					xlnx,video-format = <0x2>;
					xlnx,video-width = <0x8>;

					endpoint {
						remote-endpoint = <0x26>;
						phandle = <0x2b>;
					};
				};

				port@1 {
					reg = <0x1>;
					xlnx,video-format = <0x2>;
					xlnx,video-width = <0x8>;

					endpoint {
						remote-endpoint = <0x27>;
						phandle = <0x2a>;
					};
				};
			};
		};

	video_m2m {
		compatible = "xlnx,mem2mem";
		dmas = <0x28 0x0 0x29 0x0>;
		dma-names = "tx", "rx";

		ports {
			#address-cells = <0x1>;
			#size-cells = <0x0>;

			port@0 {
				reg = <0x0>;
				direction = "input";

				endpoint {
					remote-endpoint = <0x2a>;
					phandle = <0x27>;
				};
			};

			port@1 {
				reg = <0x1>;
				direction = "output";

				endpoint {
					remote-endpoint = <0x2b>;
					phandle = <0x26>;
				};
			};
		};

The Linux kernel takes an OOPS during bootup and is shown below:

[   12.046525] xilinx-mem2mem video_m2m: mem2mem device registered
[   12.052678] xilinx-mem2mem video_m2m: Entity type for entity a0010000.v_proc_ss was not initialized!
[   12.061836] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
[   12.070613] Mem abort info:
[   12.073403]   ESR = 0x96000045
[   12.076450]   Exception class = DABT (current EL), IL = 32 bits
[   12.082361]   SET = 0, FnV = 0
[   12.085407]   EA = 0, S1PTW = 0
[   12.088541] Data abort info:
[   12.091413]   ISV = 0, ISS = 0x00000045
[   12.095238]   CM = 0, WnR = 1
[   12.098193] [0000000000000000] user address but active_mm is swapper
[   12.104541] Internal error: Oops: 96000045 [#1] SMP
[   12.109404] Modules linked in:
[   12.112454] CPU: 1 PID: 17 Comm: kworker/1:0 Not tainted 4.19.0-xilinx-v2019.1 #1
[   12.119926] Hardware name: xlnx,zynqmp (DT)
[   12.124111] Workqueue: events deferred_probe_work_func
[   12.129240] pstate: 40000005 (nZcv daif -PAN -UAO)
[   12.134026] pc : media_add_link+0x38/0x48
[   12.138024] lr : media_add_link+0x24/0x48
[   12.142023] sp : ffffff80091c39e0
[   12.145321] x29: ffffff80091c39e0 x28: ffffffc07fef4a58
[   12.150626] x27: ffffffc010b44c18 x26: ffffffc07fef4460
[   12.155929] x25: ffffffc010b44db0 x24: ffffffc010b44c18
[   12.161233] x23: 0000000000000001 x22: 0000000000000000
[   12.166536] x21: 0000000000000038 x20: ffffffc06d2dcf80
[   12.171840] x19: ffffffc06ccd9068 x18: 0000000000000010
[   12.177143] x17: 0000000000000000 x16: 0000000000000000
[   12.182447] x15: ffffffffffffffff x14: 0000000000000000
[   12.187750] x13: 0000000000000000 x12: 0000000000000000
[   12.193054] x11: 0000000000000018 x10: ffffff80090a1f40
[   12.198357] x9 : 0000000000000000 x8 : ffffffc06d2dcf80
[   12.203661] x7 : 0000000000000000 x6 : 000000000000003f
[   12.208964] x5 : 0000000000000040 x4 : 0000000000000000
[   12.214268] x3 : ffffffc06d2dcf00 x2 : ffffffc06d2dcf20
[   12.219571] x1 : 0000000000000000 x0 : ffffffc06d2dcf00
[   12.224877] Process kworker/1:0 (pid: 17, stack limit = 0x(____ptrval____))
[   12.231828] Call trace:
[   12.234269]  media_add_link+0x38/0x48
[   12.237922]  media_create_pad_link+0xa4/0x160
[   12.242274]  xvip_graph_notify_complete+0x2c8/0x4f8
[   12.247143]  v4l2_async_notifier_try_complete.part.3+0x44/0x60
[   12.252966]  v4l2_async_register_subdev+0xf8/0x1c0
[   12.257749]  xcsc_probe+0x494/0x5e8
[   12.261229]  platform_drv_probe+0x50/0xa0
[   12.265231]  really_probe+0x1c8/0x280
[   12.268885]  driver_probe_device+0x54/0xe8
[   12.272973]  __device_attach_driver+0xb8/0xe8
[   12.277322]  bus_for_each_drv+0x78/0xc8
[   12.281150]  __device_attach+0xd4/0x130
[   12.284978]  device_initial_probe+0x10/0x18
[   12.289152]  bus_probe_device+0x90/0x98
[   12.292981]  deferred_probe_work_func+0x6c/0xa0
[   12.297505]  process_one_work+0x1e4/0x340
[   12.301503]  worker_thread+0x248/0x488
[   12.305247]  kthread+0x124/0x128
[   12.308467]  ret_from_fork+0x10/0x18
[   12.312035] Code: f9400661 91008002 f9000662 a9020413 (f9000022)
[   12.318119] ---[ end trace 41f68fd8f3de722b ]---

The mem2mem driver will initialize if I remove the VPSS IP from the design but when I add any video IP between the frmbuf_rd and frmbuf_wr, the oops occurs.  It seems, looking at the call trace, that the error happens while trying to add the media device but have no idea why.

Are there any ideas why the oops is occurring and what I might do to get past the issue?

I decided to replicate the design shown in the Wiki to ensure the system will work in a known working state but my desired pipeline should include the IP as shown below:

frmbuf_rd => sensor_demosaic => gamma_lut => vpss_csc => vpss_scaler => frmbuf_wr

This pipeline is a perfect candidate for the mem2mem driver if I can get it to work.

Thanks for you help in advance!

0 Kudos
0 Replies