Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would be possible to get cedrus running on v3s? #33

Open
wolfallein opened this issue Jul 16, 2020 · 0 comments
Open

Would be possible to get cedrus running on v3s? #33

wolfallein opened this issue Jul 16, 2020 · 0 comments

Comments

@wolfallein
Copy link

Hello,

I'm wondering about the possibility to have Cedrus working on v3s.

Although Allwinner market v3s as a video encoder/decoder soc, I'm not sure if it would be practically useful since it only has 64 MB, maybe in a very specific use case.

Would be at least fun to have it 😄

I added this code to arch/arm/boot/dts/sun8i-v3s.dtsi that I copied from a33 dts.

                syscon: syscon@1c00000 {
                       compatible = "allwinner,sun8i-v3s-system-controller",
                                "syscon";
                        reg = <0x01c00000 0x1000>;
                        #address-cells = <1>;
                        #size-cells = <1>;
                        ranges;

                        sram_c: sram@1d00000 {
                                compatible = "mmio-sram";
                                reg = <0x01d00000 0x80000>;
                                #address-cells = <1>;
                                #size-cells = <1>;
                                ranges = <0 0x01d00000 0x80000>;

                                ve_sram: sram-section@0 {
                                        compatible = "allwinner,sun8i-a23-sram-c1",
                                                        "allwinner,sun4i-a10-sram-c1";
                                        reg = <0x000000 0x80000>;
                                };
                        };
                };

                video-codec@1c0e000 {
                        compatible = "allwinner,sun8i-a33-video-engine";
                        reg = <0x01c0e000 0x1000>;
                        clocks = <&ccu CLK_BUS_VE>, <&ccu CLK_VE>,
                                <&ccu CLK_DRAM_VE>;
                        clock-names = "ahb", "mod", "ram";
                        resets = <&ccu RST_BUS_VE>;
                        interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
                        allwinner,sram = <&ve_sram 1>;
                        status = "okay";
                };

and loaded the module, but I'm having the following kernel crash:

root@localhost:~# modprobe sunxi_cedrus
[  125.342252] sunxi_cedrus: module is from the staging directory, the quality is unknown, you have be
en warned.
[  125.367169] 8<--- cut here ---
[  125.371563] Unable to handle kernel NULL pointer dereference at virtual address 0000001a
[  125.382247] pgd = 0d0a49fc
[  125.386243] [0000001a] *pgd=00000000
[  125.391070] Internal error: Oops: 5 [#1] SMP ARM
[  125.396900] Modules linked in: sunxi_cedrus(C+) videobuf2_dma_contig v4l2_mem2mem videobuf2_memops 
videobuf2_v4l2 videobuf2_common tca8418_keypad matrix_keymap usb_f_ecm g_ether usb_f_rndis u_ether lib
composite
[  125.419538] CPU: 0 PID: 266 Comm: modprobe Tainted: G         C        5.8.0-rc4-licheepi-zero+ #10
[  125.431192] Hardware name: Allwinner sun8i Family
[  125.437215] PC is at __of_find_property+0xc/0x60
[  125.443117] LR is at of_find_property+0x34/0x50
[  125.448912] pc : [<c05df874>]    lr : [<c05df8fc>]    psr: 200b0093
[  125.456473] sp : c1fd3bc0  ip : 0000326c  fp : 00000000
[  125.462991] r10: 0000000f  r9 : c0978090  r8 : c1fd3be8
[  125.469538] r7 : c0978090  r6 : 00000002  r5 : 400b0013  r4 : c0c85cf8
[  125.477449] r3 : c0c85cf8  r2 : c1fd3be8  r1 : c0978090  r0 : 00000002
[  125.485400] Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
[  125.495377] Control: 10c5387d  Table: 41d7406a  DAC: 00000051
[  125.502557] Process modprobe (pid: 266, stack limit = 0xd3991463)
[  125.510076] Stack: (0xc1fd3bc0 to 0xc1fd4000)
[  125.515823] 3bc0: c0c85cf8 400b0013 00000002 c05df8fc 00000000 c1fd3c18 00000000 00000002
[  125.526901] 3be0: 00000000 c05dfd40 c299c840 c0c04ec8 c1fd3c32 00000000 00000000 c1fd3c5c
[  125.538137] 3c00: c34b2800 c34b2810 c299c898 c05e1258 00000000 c029d498 00000000 00000000
[  125.549371] 3c20: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 c0c04ec8
[  125.560651] 3c40: 00000000 c34b2810 bf0521f0 c05e133c 00000000 c1fd3c5c 0338d000 c0c04ec8
[  125.572063] 3c60: c2bfc240 00000000 c34af400 bf04df38 c34af414 00000016 00000000 c016eb38
[  125.583620] 3c80: 00000000 c1202bc0 bf04df38 00000016 c34b2810 00000000 c1202bc0 00000000
[  125.595288] 3ca0: 00000016 c0c04ec8 c34aeb00 c05e83a4 00000000 c299c840 bf0521f0 c34b2800
[  125.607112] 3cc0: c34b2810 c299c898 0000000f bf04e324 00000000 c34aeb00 c299c840 c34b2810
[  125.619003] 3ce0: c299c840 c34b2810 bf0516d0 bf04d2ec c093c55c c34b2810 00000000 c34b2810
[  125.630949] 3d00: bf053014 c0c83470 00000000 bf053014 0000000f c048adcc c34b2810 c0c83468
[  125.642990] 3d20: 00000000 c0c83470 00000000 c0488ec0 c34b2810 bf053014 bf053014 c0c30d50
[  125.655041] 3d40: bf053188 c2bfc080 bf053140 c0489134 c34b2810 00000000 bf053014 c048932c
[  125.667075] 3d60: 00000000 bf053014 c34b2810 c048938c 00000000 bf053014 c0489334 c0487234
[  125.679110] 3d80: c3408f6c c3408f58 c34a0634 c0c04ec8 bf053014 c1202380 00000000 c0488258
[  125.691163] 3da0: bf0525b4 00000001 bf053014 bf053014 bf056000 ffffe000 00000000 c0489c0c
[  125.703198] 3dc0: c0c4ae80 bf056000 ffffe000 c0101710 c0c45640 00210d00 c0c45380 c2a58300
[  125.715249] 3de0: c3f4bb00 c3401e40 c2a58340 c3f4bb00 c3401e40 8040003e bf053188 c021cd1c
[  125.727300] 3e00: 00000001 c2a58300 c3f4bb00 c3401e40 c01a1ae4 bf053188 bf053140 c0c04ec8
[  125.739351] 3e20: 00000002 bf053140 c2bfc140 00000002 00000002 c019f908 c2bfc040 00000002
[  125.751402] 3e40: c1fd3f40 c2bfc040 00000002 c01a1aec bf05314c 00007fff bf053140 c019ebb4
[  125.763438] 3e60: bf053320 00000000 c0803038 c09188e0 bf05314c bf05aa18 bf053254 c0918838
[  125.775490] 3e80: c0918890 c1fd3f38 00000000 c022720c 00000000 00000000 00000000 ffffe000
[  125.787525] 3ea0: 00000000 00000000 00000000 00000000 00000000 00000000 6e72656b 00006c65
[  125.799560] 3ec0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  125.811596] 3ee0: 00000000 00000000 00000000 00000000 00000000 c0c04ec8 7fffffff 00000000
[  125.823633] 3f00: 00000008 004c0afc 0000017b c0100264 c1fd2000 0000017b 00000000 c01a2118
[  125.835670] 3f20: 7fffffff 00000000 00000004 000000c0 00000000 c4062000 0000a064 00000000
[  125.847707] 3f40: c406758f c4067740 c4062000 0000a064 c406ba9c c406b92c c4069230 00007000
[  125.859744] 3f60: 000074c0 0000493c 000079fe 00000000 00000000 00000000 0000492c 00000022
[  125.871779] 3f80: 00000023 00000018 00000000 00000012 00000000 c0c04ec8 004c28b0 00000000
[  125.883831] 3fa0: 1b213700 c0100060 004c28b0 00000000 00000008 004c0afc 00000000 004c2390
[  125.895867] 3fc0: 004c28b0 00000000 1b213700 0000017b 004d51f8 004d4090 004d5190 00000000
[  125.907902] 3fe0: bea908b0 bea908a0 004b85e5 b6ceb9a2 40010030 00000008 00000000 00000000
[  125.919968] [<c05df874>] (__of_find_property) from [<c05df8fc>] (of_find_property+0x34/0x50)
[  125.932276] [<c05df8fc>] (of_find_property) from [<c05dfd40>] (of_phandle_iterator_init+0x5c/0xcc)
[  125.945112] [<c05dfd40>] (of_phandle_iterator_init) from [<c05e1258>] (__of_parse_phandle_with_args
+0x44/0xec)
[  125.959000] [<c05e1258>] (__of_parse_phandle_with_args) from [<c05e133c>] (of_parse_phandle+0x3c/0x
74)
[  125.972195] [<c05e133c>] (of_parse_phandle) from [<c05e83a4>] (of_reserved_mem_device_init_by_idx+0
x34/0x170)
[  125.986033] [<c05e83a4>] (of_reserved_mem_device_init_by_idx) from [<bf04e324>] (cedrus_hw_probe+0x
98/0x284 [sunxi_cedrus])
[  126.001112] [<bf04e324>] (cedrus_hw_probe [sunxi_cedrus]) from [<bf04d2ec>] (cedrus_probe+0xc4/0x2d
0 [sunxi_cedrus])
[  126.015564] [<bf04d2ec>] (cedrus_probe [sunxi_cedrus]) from [<c048adcc>] (platform_drv_probe+0x48/0
x98)
[  126.028867] [<c048adcc>] (platform_drv_probe) from [<c0488ec0>] (really_probe+0x1e0/0x348)
[  126.041024] [<c0488ec0>] (really_probe) from [<c0489134>] (driver_probe_device+0x5c/0xb4)
[  126.053089] [<c0489134>] (driver_probe_device) from [<c048932c>] (device_driver_attach+0x58/0x60)
[  126.065857] [<c048932c>] (device_driver_attach) from [<c048938c>] (__driver_attach+0x58/0xcc)
[  126.078273] [<c048938c>] (__driver_attach) from [<c0487234>] (bus_for_each_dev+0x78/0xc0)
[  126.090338] [<c0487234>] (bus_for_each_dev) from [<c0488258>] (bus_add_driver+0x15c/0x1e0)
[  126.102492] [<c0488258>] (bus_add_driver) from [<c0489c0c>] (driver_register+0x74/0x108)
[  126.114466] [<c0489c0c>] (driver_register) from [<c0101710>] (do_one_initcall+0x58/0x1c4)
[  126.126527] [<c0101710>] (do_one_initcall) from [<c019f908>] (do_init_module+0x5c/0x224)
[  126.138495] [<c019f908>] (do_init_module) from [<c01a1aec>] (load_module+0x1f1c/0x22f8)
[  126.150375] [<c01a1aec>] (load_module) from [<c01a2118>] (sys_finit_module+0xd0/0xe8)
[  126.162076] [<c01a2118>] (sys_finit_module) from [<c0100060>] (ret_fast_syscall+0x0/0x54)
[  126.174124] Exception stack(0xc1fd3fa8 to 0xc1fd3ff0)
[  126.181104] 3fa0:                   004c28b0 00000000 00000008 004c0afc 00000000 004c2390
[  126.193064] 3fc0: 004c28b0 00000000 1b213700 0000017b 004d51f8 004d4090 004d5190 00000000
[  126.204998] 3fe0: bea908b0 bea908a0 004b85e5 b6ceb9a2
[  126.211921] Code: e8bd8070 e3500000 e92d4070 0a000012 (e5904018) 
[  126.219868] ---[ end trace 56a5212a986fddcc ]---
Segmentation fault

and the module doesn't load.
How could I track the source of this problem?

Looking in the memory mapping of the v3s, it seems that the video engine (VE) should be in the same address as the other SOC, bur SRAM C seems to be in a different place, and much smaller. Also, it is not clear that this space can be used by the video engine.

V3S:

image

A10:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant