Robert Heller Posted October 23, 2020 Posted October 23, 2020 I am trying to get an OV5640 camera module to work on a Banana Pi M64 (Allwinner A64). I am running Armbian 20.08.13 Focal with Linux 5.8.16-sunxi64. I have loaded the kernel sources, updated the config to include the ov5640 kernel driver module and updated the device tree, sun50i-a64-bananapi-m64.dts file by copying and adjusting the camera overlay code from sun50i-a64-pinetab.dts, but it is not working: gollumm64% v4l2-ctl --list-devices cedrus (platform:cedrus): /dev/video0 /dev/media0 gollumm64% v4l2-ctl -d 0 --list-formats --list-ctrls Codec Controls mpeg_2_slice_parameters 0x009909fa (unknown): type=103 flags=has-payload mpeg_2_quantization_matrices 0x009909fb (unknown): type=104 flags=has-payload h264_sequence_parameter_set 0x00990ce8 (unknown): type=110 flags=has-payload h264_picture_parameter_set 0x00990ce9 (unknown): type=111 flags=has-payload h264_scaling_matrix 0x00990cea (unknown): type=112 flags=has-payload h264_slice_parameters 0x00990ceb (unknown): type=113 flags=has-payload h264_decode_parameters 0x00990cec (unknown): type=114 flags=has-payload h264_decode_mode 0x00990ced (menu) : min=0 max=0 default=0 value=0 h264_start_code 0x00990cee (menu) : min=0 max=0 default=0 value=0 hevc_sequence_parameter_set 0x00990cf0 (unknown): type=120 flags=has-payload hevc_picture_parameter_set 0x00990cf1 (unknown): type=121 flags=has-payload hevc_slice_parameters 0x00990cf2 (unknown): type=122 flags=has-payload hevc_decode_mode 0x00990cf7 (menu) : min=0 max=0 default=0 value=0 hevc_start_code 0x00990cf8 (menu) : min=0 max=0 default=0 value=0 ioctl: VIDIOC_ENUM_FMT Type: Video Capture [0]: 'ST12' (Sunxi Tiled NV12 Format, compressed) [1]: 'NV12' (Y/CbCr 4:2:0) gollumm64% media-ctl --device /dev/media0 -p Media controller API version 5.8.16 Media device information ------------------------ driver cedrus model cedrus serial bus info platform:cedrus hw revision 0x0 driver version 5.8.16 Device topology - entity 1: cedrus-source (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video0 pad0: Source -> "cedrus-proc":0 [ENABLED,IMMUTABLE] - entity 3: cedrus-proc (2 pads, 2 links) type Node subtype Unknown flags 0 pad0: Sink <- "cedrus-source":0 [ENABLED,IMMUTABLE] pad1: Source -> "cedrus-sink":0 [ENABLED,IMMUTABLE] - entity 6: cedrus-sink (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video0 pad0: Sink <- "cedrus-proc":1 [ENABLED,IMMUTABLE] This is the dts code I added to sun50i-a64-bananapi-m64.dts: i2c-csi { compatible = "i2c-gpio"; sda-gpios = <&pio 4 13 GPIO_ACTIVE_HIGH>; /* PE13 */ scl-gpios = <&pio 4 12 GPIO_ACTIVE_HIGH>; /* PE12 */ i2c-gpio,delay-us = <5>; #address-cells = <1>; #size-cells = <0>; ov5640: camera@3c { compatible = "ovti,ov5640"; reg = <0x3c>; pinctrl-names = "default"; pinctrl-0 = <&csi_mclk_pin>; clocks = <&ccu CLK_CSI_MCLK>; clock-names = "xclk"; AVDD-supply = <®_dldo3>; DOVDD-supply = <®_aldo1>; DVDD-supply = <®_eldo3>; reset-gpios = <&pio 4 16 GPIO_ACTIVE_LOW>; /* PE16 */ powerdown-gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */ port { ov5640_ep: endpoint { remote-endpoint = <&csi_ep>; bus-width = <8>; hsync-active = <1>; /* Active high */ vsync-active = <0>; /* Active low */ data-active = <1>; /* Active high */ pclk-sample = <1>; /* Rising */ }; }; }; }; &csi { status = "okay"; port { #address-cells = <1>; #size-cells = <0>; csi_ep: endpoint { remote-endpoint = <&ov5640_ep>; bus-width = <8>; hsync-active = <1>; /* Active high */ vsync-active = <0>; /* Active low */ data-active = <1>; /* Active high */ pclk-sample = <1>; /* Rising */ }; }; }; What am I missing?
Robert Heller Posted October 24, 2020 Author Posted October 24, 2020 (edited) U-Boot SPL 2020.04-armbian (Jun 14 2020 - 23:09:55 +0200) DRAM: 2048 MiB Trying to boot from MMC1 NOTICE: BL31: v2.3(debug):635912f-dirty NOTICE: BL31: Built : 23:09:46, Jun 14 2020 NOTICE: BL31: Detected Allwinner A64/H64/R18 SoC (1689) NOTICE: BL31: Found U-Boot DTB at 0x4095f08, model: BananaPi-M64 INFO: ARM GICv2 driver initialized INFO: Configuring SPC Controller INFO: PMIC: Probing AXP803 on RSB INFO: PMIC: Enabling DRIVEVBUS INFO: PMIC: dcdc1 voltage: 3.300V INFO: PMIC: dcdc5 voltage: 1.500V INFO: PMIC: dcdc6 voltage: 1.100V INFO: PMIC: dldo1 voltage: 3.300V INFO: PMIC: dldo2 voltage: 3.300V INFO: PMIC: Enabling DC SW INFO: BL31: Platform setup done INFO: BL31: Initializing runtime services INFO: BL31: cortex_a53: CPU workaround for 843419 was applied INFO: BL31: cortex_a53: CPU workaround for 855873 was applied NOTICE: PSCI: System suspend is unavailable INFO: BL31: Preparing for EL3 exit to normal world INFO: Entry point address = 0x4a000000 INFO: SPSR = 0x3c9 U-Boot 2020.04-armbian (Jun 14 2020 - 23:09:55 +0200) Allwinner Technology CPU: Allwinner A64 (SUN50I) Model: BananaPi-M64 DRAM: 2 GiB MMC: Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c10000' mmc@1c0f000: 0, mmc@1c10000: 2, mmc@1c11000: 1 Loading Environment from FAT... Unable to use mmc 1:1... In: serial@1c28000 Out: serial@1c28000 Err: serial@1c28000 Allwinner mUSB OTG (Peripheral) Net: phy interface7 eth0: ethernet@1c30000 Warning: usb_ether using MAC address from ROM , eth1: usb_ether starting USB... Bus usb@1c1a000: USB EHCI 1.00 Bus usb@1c1a400: USB OHCI 1.0 Bus usb@1c1b000: USB EHCI 1.00 Bus usb@1c1b400: USB OHCI 1.0 scanning bus usb@1c1a000 for devices... 1 USB Device(s) found scanning bus usb@1c1a400 for devices... 1 USB Device(s) found scanning bus usb@1c1b000 for devices... 5 USB Device(s) found scanning bus usb@1c1b400 for devices... 1 USB Device(s) found scanning usb for storage devices... 1 Storage Device(s) found Autoboot in 1 seconds, press <Space> to stop switch to partitions #0, OK mmc0 is current device Scanning mmc 0:1... Found U-Boot script /boot/boot.scr 3033 bytes read in 3 ms (987.3 KiB/s) ## Executing script at 4fc00000 U-boot loaded from SD Boot script loaded from mmc 161 bytes read in 2 ms (78.1 KiB/s) 42343 bytes read in 7 ms (5.8 MiB/s) 3821 bytes read in 8 ms (465.8 KiB/s) Applying kernel provided DT fixup script (sun50i-a64-fixup.scr) ## Executing script at 44000000 14625977 bytes read in 702 ms (19.9 MiB/s) 21194760 bytes read in 1016 ms (19.9 MiB/s) ## Loading init Ramdisk from Legacy Image at 4fe00000 ... Image Name: uInitrd Image Type: AArch64 Linux RAMDisk Image (gzip compressed) Data Size: 14625913 Bytes = 13.9 MiB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK ## Flattened Device Tree blob at 4fa00000 Booting using the fdt blob at 0x4fa00000 Loading Ramdisk to 4920d000, end 49fffc79 ... OK Loading Device Tree to 000000004919a000, end 000000004920cfff ... OK Starting kernel ... [ 13.134122] sd 0:0:0:0: [sda] No Caching mode page found [ 13.187487] sd 0:0:0:0: [sda] Assuming drive cache: write through [ 26.058058] Bluetooth: hci0: Frame reassembly failed (-84) [ 28.064882] Bluetooth: hci0: command 0x0c14 tx timeout [ 36.064869] Bluetooth: hci0: BCM: Reading local name failed (-110) [ 110.753461] systemd[1]: Failed to start Armbian memory supported logging. Armbian 20.08.13 Focal ttyS0 gollumm64 login: The above is the UBoot output captured from the serial console. Below is the output from dmesg. [ 3.592301] ehci-platform 1c1b000.usb: irq 22, io mem 0x01c1b000 [ 3.605164] ehci-platform 1c1b000.usb: USB 2.0 started, EHCI 1.00 [ 3.605447] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.08 [ 3.605457] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 3.605463] usb usb3: Product: EHCI Host Controller [ 3.605469] usb usb3: Manufacturer: Linux 5.8.16-sunxi64-OV5640RPH++ ehci_hcd [ 3.605475] usb usb3: SerialNumber: 1c1b000.usb [ 3.606117] hub 3-0:1.0: USB hub found [ 3.606161] hub 3-0:1.0: 1 port detected [ 3.607195] ohci-platform 1c1b400.usb: Generic Platform OHCI controller [ 3.607227] ohci-platform 1c1b400.usb: new USB bus registered, assigned bus number 4 [ 3.607377] ohci-platform 1c1b400.usb: irq 23, io mem 0x01c1b400 [ 3.661305] mc: Linux media interface: v0.10 [ 3.669209] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 5.08 [ 3.669223] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 3.669230] usb usb4: Product: Generic Platform OHCI controller [ 3.669237] usb usb4: Manufacturer: Linux 5.8.16-sunxi64-OV5640RPH++ ohci_hcd [ 3.669243] usb usb4: SerialNumber: 1c1b400.usb [ 3.669958] hub 4-0:1.0: USB hub found [ 3.669999] hub 4-0:1.0: 1 port detected [ 3.671469] usb_phy_generic usb_phy_generic.3.auto: supply vcc not found, using dummy regulator [ 3.672596] musb-hdrc musb-hdrc.4.auto: MUSB HDRC host driver [ 3.672633] musb-hdrc musb-hdrc.4.auto: new USB bus registered, assigned bus number 5 [ 3.672811] phy id_det change to device [ 3.673733] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.08 [ 3.673746] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 3.673753] usb usb5: Product: MUSB HDRC host driver [ 3.673759] usb usb5: Manufacturer: Linux 5.8.16-sunxi64-OV5640RPH++ musb-hcd [ 3.673766] usb usb5: SerialNumber: musb-hdrc.4.auto [ 3.674468] hub 5-0:1.0: USB hub found [ 3.674513] hub 5-0:1.0: 1 port detected [ 3.674992] videodev: Linux video capture interface: v2.00 [ 3.940934] usb 3-1: new high-speed USB device number 2 using ehci-platform [ 4.101735] usb 3-1: New USB device found, idVendor=1a40, idProduct=0101, bcdDevice= 1.11 [ 4.101744] usb 3-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 4.101751] usb 3-1: Product: USB 2.0 Hub [ 4.102548] hub 3-1:1.0: USB hub found [ 4.102723] hub 3-1:1.0: 4 ports detected [ 4.241767] EXT4-fs (md0): mounted filesystem with ordered data mode. Opts: (null) [ 4.508913] usb 3-1.4: new full-speed USB device number 3 using ehci-platform [ 4.742855] usb 3-1.4: New USB device found, idVendor=0a05, idProduct=7211, bcdDevice= 1.00 [ 4.742869] usb 3-1.4: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 4.742876] usb 3-1.4: Product: USB2.0 HUB [ 4.743583] hub 3-1.4:1.0: USB hub found [ 4.743707] hub 3-1.4:1.0: 4 ports detected [ 5.085389] usb 3-1.4: USB disconnect, device number 3 [ 5.104962] usb 3-1.4-port1: attempt power cycle [ 5.395662] systemd[1]: systemd 245.4-4ubuntu3.2 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid) [ 5.396314] systemd[1]: Detected architecture arm64. [ 5.432127] systemd[1]: Set hostname to <gollumm64>. [ 5.554701] dw-apb-uart 1c28000.serial: forbid DMA for kernel console [ 5.628892] usb 3-1.4: new full-speed USB device number 8 using ehci-platform [ 5.842884] usb 3-1.4: New USB device found, idVendor=0a05, idProduct=7211, bcdDevice= 1.00 [ 5.842898] usb 3-1.4: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 5.842906] usb 3-1.4: Product: USB2.0 HUB [ 5.843599] hub 3-1.4:1.0: USB hub found [ 5.843735] hub 3-1.4:1.0: 4 ports detected [ 6.105038] random: lvmconfig: uninitialized urandom read (4 bytes read) [ 6.189414] usb 3-1.4: USB disconnect, device number 8 [ 6.208932] usb 3-1.4-port1: attempt power cycle [ 6.452518] systemd[1]: /lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly. [ 6.724884] usb 3-1.4: new full-speed USB device number 13 using ehci-platform [ 6.841003] random: systemd: uninitialized urandom read (16 bytes read) [ 6.844995] systemd[1]: Created slice system-modprobe.slice. [ 6.845778] random: systemd: uninitialized urandom read (16 bytes read) [ 6.847152] systemd[1]: Created slice system-postfix.slice. [ 6.849093] systemd[1]: Created slice system-serial\x2dgetty.slice. [ 6.851444] systemd[1]: Created slice system-systemd\x2dfsck.slice. [ 6.853269] systemd[1]: Created slice User and Session Slice. [ 6.854128] systemd[1]: Started Forward Password Requests to Wall Directory Watch. [ 6.855571] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point. [ 6.856502] systemd[1]: Reached target User and Group Name Lookups. [ 6.857013] systemd[1]: Reached target Remote File Systems. [ 6.857406] systemd[1]: Reached target Slices. [ 6.857801] systemd[1]: Reached target Swap. [ 6.858183] systemd[1]: Reached target System Time Set. [ 6.858981] systemd[1]: Listening on Device-mapper event daemon FIFOs. [ 6.859969] systemd[1]: Listening on LVM2 poll daemon socket. [ 6.860813] systemd[1]: Listening on Syslog Socket. [ 6.861951] systemd[1]: Listening on fsck to fsckd communication Socket. [ 6.862649] systemd[1]: Listening on initctl Compatibility Named Pipe. [ 6.864094] systemd[1]: Listening on Journal Audit Socket. [ 6.865041] systemd[1]: Listening on Journal Socket (/dev/log). [ 6.866052] systemd[1]: Listening on Journal Socket. [ 6.867086] systemd[1]: Listening on udev Control Socket. [ 6.867878] systemd[1]: Listening on udev Kernel Socket. [ 6.873503] systemd[1]: Mounting Huge Pages File System... [ 6.879650] systemd[1]: Mounting POSIX Message Queue File System... [ 6.886548] systemd[1]: Mounting Kernel Debug File System... [ 6.887971] systemd[1]: Condition check resulted in Kernel Trace File System being skipped. [ 6.894410] systemd[1]: Starting Availability of block devices... [ 6.904018] systemd[1]: Starting Restore / save the current clock... [ 6.911495] systemd[1]: Starting Set the console keyboard layout... [ 6.918113] systemd[1]: Starting Create list of static device nodes for the current kernel... [ 6.924677] systemd[1]: Starting Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling... [ 6.925898] systemd[1]: Condition check resulted in Load Kernel Module drm being skipped. [ 6.932432] systemd[1]: Started Nameserver information manager. [ 6.934465] systemd[1]: Reached target Network (Pre). [ 6.939465] systemd[1]: Condition check resulted in Set Up Additional Binary Formats being skipped. [ 6.939714] systemd[1]: Condition check resulted in File System Check on Root Device being skipped. [ 6.950745] systemd[1]: Starting Load Kernel Modules... [ 6.959251] systemd[1]: Starting Remount Root and Kernel File Systems... [ 6.959913] usb 3-1.4: New USB device found, idVendor=0a05, idProduct=7211, bcdDevice= 1.00 [ 6.959923] usb 3-1.4: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 6.959930] usb 3-1.4: Product: USB2.0 HUB [ 6.961231] hub 3-1.4:1.0: USB hub found [ 6.961471] hub 3-1.4:1.0: 4 ports detected [ 6.970182] systemd[1]: Starting udev Coldplug all Devices... [ 6.980969] systemd[1]: Mounted Huge Pages File System. [ 6.982633] systemd[1]: Mounted POSIX Message Queue File System. [ 6.984209] systemd[1]: Mounted Kernel Debug File System. [ 6.988195] systemd[1]: Finished Availability of block devices. [ 6.992257] systemd[1]: Finished Restore / save the current clock. [ 6.996665] systemd[1]: Finished Create list of static device nodes for the current kernel. [ 7.054648] EXT4-fs (md0): re-mounted. Opts: commit=600,errors=remount-ro [ 7.064584] systemd[1]: Finished Remount Root and Kernel File Systems. [ 7.095754] systemd[1]: Condition check resulted in Rebuild Hardware Database being skipped. [ 7.096014] systemd[1]: Condition check resulted in Platform Persistent Storage Archival being skipped. [ 7.100917] systemd[1]: Starting Load/Save Random Seed... [ 7.107264] systemd[1]: Starting Create System Users... [ 7.144467] g_serial gadget: Gadget Serial v2.4 [ 7.144478] g_serial gadget: g_serial ready [ 7.152109] systemd[1]: Finished Load Kernel Modules. [ 7.154307] systemd[1]: Condition check resulted in FUSE Control File System being skipped. [ 7.163794] systemd[1]: Mounting Kernel Configuration File System... [ 7.170817] systemd[1]: Starting Apply Kernel Variables... [ 7.175097] systemd[1]: Finished Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling. [ 7.196410] systemd[1]: Mounted Kernel Configuration File System. [ 7.218634] systemd[1]: Finished Create System Users. [ 7.231751] systemd[1]: Starting Create Static Device Nodes in /dev... [ 7.263519] systemd[1]: Finished Apply Kernel Variables. [ 7.305433] usb 3-1.4: USB disconnect, device number 13 [ 7.310443] systemd[1]: Finished Create Static Device Nodes in /dev. [ 7.323735] systemd[1]: Starting udev Kernel Device Manager... [ 7.325068] usb 3-1.4-port1: attempt power cycle [ 7.413255] systemd[1]: Finished udev Coldplug all Devices. [ 7.435457] systemd[1]: Starting Helper to synchronize boot up for ifupdown... [ 7.445720] systemd[1]: Finished Set the console keyboard layout. [ 7.454547] systemd[1]: Reached target Local File Systems (Pre). [ 7.467955] systemd[1]: Mounting /tmp... [ 7.479467] systemd[1]: Finished Helper to synchronize boot up for ifupdown. [ 7.492450] systemd[1]: Mounted /tmp. [ 7.689100] systemd[1]: Started udev Kernel Device Manager. [ 7.697648] systemd[1]: Condition check resulted in Show Plymouth Boot Screen being skipped. [ 7.698253] systemd[1]: Started Dispatch Password Requests to Console Directory Watch. [ 7.705977] systemd[1]: Condition check resulted in Forward Password Requests to Plymouth Directory Watch being skipped. [ 7.706139] systemd[1]: Reached target Local Encrypted Volumes. [ 7.840965] usb 3-1.4: new full-speed USB device number 18 using ehci-platform [ 7.979191] ------------[ cut here ]------------ [ 7.981942] WARNING: CPU: 3 PID: 32 at drivers/clocksource/arm_arch_timer.c:364 sun50i_a64_read_cntpct_el0+0x30/0x38 [ 7.983949] Modules linked in: cpufreq_dt usb_f_acm u_serial g_serial libcomposite ov5640 v4l2_fwnode videodev mc pinctrl_axp209 axp20x_usb_power industrialio realtek dwmac_sun8i mdio_mux i2c_mv64xxx i2c_gpio [ 7.986966] CPU: 3 PID: 32 Comm: kworker/3:1 Not tainted 5.8.16-sunxi64-OV5640RPH++ #22 [ 7.988921] Hardware name: BananaPi-M64 (DT) [ 7.991195] Workqueue: events dbs_work_handler [ 7.993346] pstate: 80000005 (Nzcv daif -PAN -UAO BTYPE=--) [ 7.995502] pc : sun50i_a64_read_cntpct_el0+0x30/0x38 [ 7.997636] lr : arch_counter_get_cntpct_stable+0x3c/0x80 [ 7.999603] sp : ffff8000115cb9c0 [ 8.001699] x29: ffff8000115cb9c0 x28: ffff000070e22c00 [ 8.003777] x27: ffff0000714b9100 x26: ffff000070e22e68 [ 8.005838] x25: ffff00007209a028 x24: 0000000000000000 [ 8.007987] x23: 0000000000000001 x22: ffff8000115cbb10 [ 8.010084] x21: 0000000000000000 x20: 0000000000000018 [ 8.012131] x19: ffff8000113e4000 [ 8.014164] hrtimer: interrupt took 27155375 ns [ 8.016089] x18: ffff8000115cb9b8 [ 8.018084] x17: 0000000000000004 x16: 0000000000000001 [ 8.020241] x15: 0000000000000018 x14: 0000000000000002 [ 8.022301] x13: 0000000000000001 x12: 0000000000000001 [ 8.024341] x11: 0000000000000005 x10: 0000000000000021 [ 8.026444] x9 : 0000000044aa2000 x8 : ffff8000113b19e8 [ 8.028568] x7 : 0000000000000000 x6 : 00000000112a8800 [ 8.030651] x5 : 0000000000000010 x4 : 0000000000000012 [ 8.032699] x3 : 0000000000000050 x2 : 000000001a0e0b91 [ 8.034748] x1 : 0000000000000000 x0 : 000000001a0e0b97 [ 8.036900] Call trace: [ 8.039073] sun50i_a64_read_cntpct_el0+0x30/0x38 [ 8.041157] __delay+0x24/0xa8 [ 8.043214] __udelay+0x2c/0x38 [ 8.045349] ccu_mux_notifier_cb+0x64/0xa0 [ 8.047445] notifier_call_chain+0x54/0x98 [ 8.049469] __srcu_notifier_call_chain+0x58/0x98 [ 8.051492] srcu_notifier_call_chain+0x18/0x28 [ 8.053559] __clk_notify+0x88/0xd0 [ 8.055620] clk_propagate_rate_change+0xc4/0xd8 [ 8.057823] clk_core_set_rate_nolock+0x114/0x200 [ 8.059931] clk_set_rate+0x38/0xa8 [ 8.062033] dev_pm_opp_set_rate+0x268/0x620 [ 8.064158] set_target+0x40/0x88 [cpufreq_dt] [ 8.066268] __cpufreq_driver_target+0x2cc/0x670 [ 8.068430] od_dbs_update+0x140/0x1a0 [ 8.070593] dbs_work_handler+0x40/0x80 [ 8.072676] process_one_work+0x1c4/0x388 [ 8.074801] worker_thread+0x14c/0x4c8 [ 8.076901] kthread+0xf8/0x128 [ 8.078996] ret_from_fork+0x10/0x30 [ 8.081000] ---[ end trace 756d8c018e73db8f ]--- [ 8.183187] usb 3-1.4: New USB device found, idVendor=0a05, idProduct=7211, bcdDevice= 1.00 [ 8.183198] usb 3-1.4: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 8.183203] usb 3-1.4: Product: USB2.0 HUB [ 8.183964] hub 3-1.4:1.0: USB hub found [ 8.184170] hub 3-1.4:1.0: 4 ports detected [ 8.284903] sun8i-ce 1c15000.crypto: Set mod clock to 300000000 (300 Mhz) from 24000000 (24 Mhz) [ 8.294538] sun8i-ce 1c15000.crypto: will run requests pump with realtime priority [ 8.294774] sun8i-ce 1c15000.crypto: will run requests pump with realtime priority [ 8.294879] sun8i-ce 1c15000.crypto: will run requests pump with realtime priority [ 8.294959] sun8i-ce 1c15000.crypto: will run requests pump with realtime priority [ 8.295045] sun8i-ce 1c15000.crypto: Register cbc(aes) [ 8.295184] sun8i-ce 1c15000.crypto: Register ecb(aes) [ 8.295283] sun8i-ce 1c15000.crypto: Register cbc(des3_ede) [ 8.295359] sun8i-ce 1c15000.crypto: Register ecb(des3_ede) [ 8.297870] sun8i-ce 1c15000.crypto: CryptoEngine Die ID 0 [ 8.402361] systemd[1]: Found device /dev/ttyS0. [ 8.481320] axp20x-battery-power-supply axp20x-battery-power-supply: DMA mask not set [ 8.487536] sunxi_cedrus: module is from the staging directory, the quality is unknown, you have been warned. [ 8.492766] axp20x-ac-power-supply axp20x-ac-power-supply: DMA mask not set [ 8.493312] cedrus 1c0e000.video-codec: Device registered as /dev/video0 [ 8.494214] asoc-simple-card sound: sun8i-codec-aif1 <-> 1c22c00.dai mapping ok [ 8.501786] input: sun50i-a64-audio Headphone Jack as /devices/platform/sound/sound/card0/input1 [ 8.529465] usb 3-1.4: USB disconnect, device number 18 [ 8.542711] cfg80211: Loading compiled-in X.509 certificates for regulatory database [ 8.544013] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7' [ 8.548952] usb 3-1.4-port1: attempt power cycle [ 8.669308] axp20x-adc axp813-adc: DMA mask not set [ 8.694220] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1 [ 8.700794] Bluetooth: Core ver 2.22 [ 8.701001] NET: Registered protocol family 31 [ 8.701006] Bluetooth: HCI device and connection manager initialized [ 8.701028] Bluetooth: HCI socket layer initialized [ 8.701036] Bluetooth: L2CAP socket layer initialized [ 8.701056] Bluetooth: SCO socket layer initialized [ 8.754142] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43430-sdio.sinovoip,bananapi-m64.txt failed with error -2 [ 8.837298] Bluetooth: HCI UART driver ver 2.3 [ 8.837310] Bluetooth: HCI UART protocol H4 registered [ 8.837313] Bluetooth: HCI UART protocol BCSP registered [ 8.837501] Bluetooth: HCI UART protocol LL registered [ 8.837505] Bluetooth: HCI UART protocol ATH3K registered [ 8.837554] Bluetooth: HCI UART protocol Three-wire (H5) registered [ 8.837753] Bluetooth: HCI UART protocol Intel registered [ 8.837928] Bluetooth: HCI UART protocol Broadcom registered [ 8.837968] Bluetooth: HCI UART protocol QCA registered [ 8.837971] Bluetooth: HCI UART protocol AG6XX registered [ 8.838005] Bluetooth: HCI UART protocol Marvell registered [ 8.883017] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1 [ 8.883141] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available [ 8.884595] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Mar 30 2016 11:30:56 version 7.45.77.h8.4 FWID 01-ee8a6268 [ 8.910825] systemd[1]: Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch. [ 8.934640] systemd[1]: Condition check resulted in FUSE Control File System being skipped. [ 8.935015] systemd[1]: Condition check resulted in Kernel Trace File System being skipped. [ 8.935332] systemd[1]: Condition check resulted in Show Plymouth Boot Screen being skipped. [ 8.935428] systemd[1]: Condition check resulted in Forward Password Requests to Plymouth Directory Watch being skipped. [ 8.938235] systemd[1]: Condition check resulted in Set Up Additional Binary Formats being skipped. [ 8.938413] systemd[1]: Condition check resulted in File System Check on Root Device being skipped. [ 8.938620] systemd[1]: Condition check resulted in Rebuild Hardware Database being skipped. [ 8.938750] systemd[1]: Condition check resulted in Platform Persistent Storage Archival being skipped. [ 8.945887] systemd[1]: Starting Load/Save RF Kill Switch Status... [ 8.957148] dw-apb-uart 1c28400.serial: failed to request DMA [ 9.064411] systemd[1]: Started Load/Save RF Kill Switch Status. [ 9.064986] usb 3-1.4: new full-speed USB device number 23 using ehci-platform [ 9.135379] systemd[1]: Condition check resulted in FUSE Control File System being skipped. [ 9.135815] systemd[1]: Condition check resulted in Kernel Trace File System being skipped. [ 9.141351] systemd[1]: Started MD array monitor. [ 9.149304] systemd[1]: Condition check resulted in Show Plymouth Boot Screen being skipped. [ 9.149465] systemd[1]: Condition check resulted in Forward Password Requests to Plymouth Directory Watch being skipped. [ 9.149804] systemd[1]: Condition check resulted in Set Up Additional Binary Formats being skipped. [ 9.149917] systemd[1]: Condition check resulted in File System Check on Root Device being skipped. [ 9.150105] systemd[1]: Condition check resulted in Rebuild Hardware Database being skipped. [ 9.150234] systemd[1]: Condition check resulted in Platform Persistent Storage Archival being skipped. [ 9.201154] Bluetooth: hci0: BCM: chip id 94 [ 9.203355] Bluetooth: hci0: BCM: features 0x2e [ 9.226415] Bluetooth: hci0: BCM43430A1 [ 9.226430] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0000 [ 9.265467] Bluetooth: hci0: BCM43430A1 'brcm/BCM43430A1.hcd' Patch [ 9.282825] usb 3-1.4: New USB device found, idVendor=0a05, idProduct=7211, bcdDevice= 1.00 [ 9.282836] usb 3-1.4: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 9.282841] usb 3-1.4: Product: USB2.0 HUB [ 9.283562] hub 3-1.4:1.0: USB hub found [ 9.283681] hub 3-1.4:1.0: 4 ports detected [ 9.284895] random: crng init done [ 9.284901] random: 7 urandom warning(s) missed due to ratelimiting [ 9.698010] systemd[1]: Finished Load/Save Random Seed. [ 10.141820] usb 3-1.4.1: new low-speed USB device number 24 using ehci-platform [ 10.602820] usb 3-1.4.1: New USB device found, idVendor=2a7a, idProduct=6a21, bcdDevice= 0.01 [ 10.602827] usb 3-1.4.1: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 10.602833] usb 3-1.4.1: Product: CASUE USB KB [ 10.608759] input: CASUE USB KB as /devices/platform/soc/1c1b000.usb/usb3/3-1/3-1.4/3-1.4.1/3-1.4.1:1.0/0003:2A7A:6A21.0001/input/input2 [ 10.885935] hid-generic 0003:2A7A:6A21.0001: input,hidraw0: USB HID v1.10 Keyboard [CASUE USB KB] on usb-1c1b000.usb-1.4.1/input0 [ 11.155011] input: CASUE USB KB Consumer Control as /devices/platform/soc/1c1b000.usb/usb3/3-1/3-1.4/3-1.4.1/3-1.4.1:1.1/0003:2A7A:6A21.0002/input/input3 [ 11.322905] input: CASUE USB KB System Control as /devices/platform/soc/1c1b000.usb/usb3/3-1/3-1.4/3-1.4.1/3-1.4.1:1.1/0003:2A7A:6A21.0002/input/input4 [ 11.323138] hid-generic 0003:2A7A:6A21.0002: input,hidraw1: USB HID v1.10 Device [CASUE USB KB] on usb-1c1b000.usb-1.4.1/input1 [ 11.807767] usb 3-1.4.2: new full-speed USB device number 25 using ehci-platform [ 12.057319] usb 3-1.4.2: not running at top speed; connect to a high speed hub [ 12.058679] usb 3-1.4.2: New USB device found, idVendor=152d, idProduct=2329, bcdDevice= 1.00 [ 12.058691] usb 3-1.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=5 [ 12.058696] usb 3-1.4.2: Product: USB to ATA/ATAPI bridge [ 12.058700] usb 3-1.4.2: Manufacturer: JMicron [ 12.058705] usb 3-1.4.2: SerialNumber: 153510A117BB [ 12.059789] usb-storage 3-1.4.2:1.0: USB Mass Storage device detected [ 12.060069] usb-storage 3-1.4.2:1.0: Quirks match for vid 152d pid 2329: 8020 [ 12.060146] scsi host0: usb-storage 3-1.4.2:1.0 [ 12.540017] usb 3-1.4.3: new low-speed USB device number 26 using ehci-platform [ 12.649120] usbcore: registered new interface driver uas [ 13.129497] scsi 0:0:0:0: Direct-Access Micron_M 500DC_MTFDDAK480 0144 PQ: 0 ANSI: 2 CCS [ 13.130036] sd 0:0:0:0: Attached scsi generic sg0 type 0 [ 13.130988] sd 0:0:0:0: [sda] 937703088 512-byte logical blocks: (480 GB/447 GiB) [ 13.132064] usb 3-1.4.3: New USB device found, idVendor=046d, idProduct=c077, bcdDevice=72.00 [ 13.132071] usb 3-1.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 13.132077] usb 3-1.4.3: Product: USB Optical Mouse [ 13.132081] usb 3-1.4.3: Manufacturer: Logitech [ 13.132580] sd 0:0:0:0: [sda] Write Protect is off [ 13.132589] sd 0:0:0:0: [sda] Mode Sense: 28 00 00 00 [ 13.134122] sd 0:0:0:0: [sda] No Caching mode page found [ 13.135789] input: Logitech USB Optical Mouse as /devices/platform/soc/1c1b000.usb/usb3/3-1/3-1.4/3-1.4.3/3-1.4.3:1.0/0003:046D:C077.0003/input/input5 [ 13.187487] sd 0:0:0:0: [sda] Assuming drive cache: write through [ 13.245596] hid-generic 0003:046D:C077.0003: input,hidraw2: USB HID v1.11 Mouse [Logitech USB Optical Mouse] on usb-1c1b000.usb-1.4.3/input0 [ 13.667127] sda: sda1 sda2 [ 13.728601] sd 0:0:0:0: [sda] Attached SCSI disk [ 14.528147] systemd[1]: systemd-rfkill.service: Succeeded. [ 22.556139] md: recovery of RAID array md0 [ 22.564340] systemd[1]: Created slice system-lvm2\x2dpvscan.slice. [ 22.569100] systemd[1]: Starting LVM event activation on device 8:2... [ 26.058058] Bluetooth: hci0: Frame reassembly failed (-84) [ 26.058061] Bluetooth: hci0: Received unexpected HCI Event 00000000 [ 26.591753] device-mapper: ioctl: 4.42.0-ioctl (2020-02-27) initialised: dm-devel@redhat.com [ 28.064882] Bluetooth: hci0: command 0x0c14 tx timeout [ 33.790750] usb0-vbus: disabling [ 36.064869] Bluetooth: hci0: BCM: Reading local name failed (-110) [ 45.502681] systemd[1]: Found device /dev/disk/by-label/home. [ 45.514981] systemd[1]: Found device /dev/disk/by-label/mp3s. [ 45.524893] systemd[1]: Starting File System Check on /dev/disk/by-label/home... [ 45.534888] systemd[1]: Starting File System Check on /dev/disk/by-label/mp3s... [ 45.601709] systemd[1]: Started File System Check Daemon to report status. [ 47.193702] systemd[1]: Found device /dev/disk/by-label/scratch. [ 47.203572] systemd[1]: Starting File System Check on /dev/disk/by-label/scratch... [ 47.672156] systemd[1]: Finished LVM event activation on device 8:2. [ 65.629212] systemd[1]: Finished File System Check on /dev/disk/by-label/mp3s. [ 65.718438] systemd[1]: Mounting /mp3s... [ 66.568008] systemd[1]: Finished File System Check on /dev/disk/by-label/scratch. [ 66.654679] systemd[1]: Mounting /scratch... [ 68.829038] EXT4-fs (dm-1): mounted filesystem with ordered data mode. Opts: (null) [ 68.883903] systemd[1]: Mounted /mp3s. [ 69.163649] systemd[1]: Finished File System Check on /dev/disk/by-label/home. [ 69.317208] systemd[1]: Mounting /home... [ 71.023193] EXT4-fs (dm-2): mounted filesystem with ordered data mode. Opts: (null) [ 71.029113] systemd[1]: Mounted /scratch. [ 73.116362] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null) [ 73.122561] systemd[1]: Mounted /home. [ 73.177656] systemd[1]: Reached target Local File Systems. [ 73.339724] systemd[1]: Starting Armbian ZRAM config... [ 73.350104] systemd[1]: Starting Set console font and keymap... [ 73.361252] systemd[1]: Starting Raise network interfaces... [ 73.372819] systemd[1]: Starting Tell Plymouth To Write Out Runtime Data... [ 73.379164] systemd[1]: Condition check resulted in Store a System Token in an EFI Variable being skipped. [ 73.379338] systemd[1]: Condition check resulted in Commit a transient machine-id on disk being skipped. [ 73.382235] systemd[1]: Finished Set console font and keymap. [ 73.886501] systemd[1]: plymouth-read-write.service: Succeeded. [ 73.888025] systemd[1]: Finished Tell Plymouth To Write Out Runtime Data. [ 75.762285] zram: Added device: zram0 [ 75.762823] zram: Added device: zram1 [ 75.763469] zram: Added device: zram2 [ 75.861813] systemd[1]: Finished Raise network interfaces. [ 76.066493] zram1: detected capacity change from 0 to 1009672192 [ 76.849275] Adding 986004k swap on /dev/zram1. Priority:5 extents:1 across:986004k SSFS [ 78.040505] zram0: detected capacity change from 0 to 52428800 [ 78.432105] systemd[1]: Finished Armbian ZRAM config. [ 78.442600] systemd[1]: Starting Armbian memory supported logging... [ 79.079584] EXT4-fs (zram0): mounted filesystem without journal. Opts: discard [ 79.079620] ext4 filesystem being mounted at /var/log supports timestamps until 2038 (0x7fffffff) [ 99.252057] systemd[1]: systemd-fsckd.service: Succeeded. [ 108.527120] systemd[1]: armbian-ramlog.service: start operation timed out. Terminating. [ 108.528363] systemd[1]: armbian-ramlog.service: Main process exited, code=killed, status=15/TERM [ 110.751870] systemd[1]: armbian-ramlog.service: Failed with result 'timeout'. [ 110.753461] systemd[1]: Failed to start Armbian memory supported logging. [ 110.777956] systemd[1]: Starting Journal Service... [ 111.254976] systemd[1]: Started Journal Service. [ 111.296719] systemd-journald[793]: Received client request to flush runtime journal. [ 115.879538] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 115.879549] Bluetooth: BNEP filters: protocol multicast [ 115.879572] Bluetooth: BNEP socket layer initialized [ 119.669306] dwmac-sun8i 1c30000.ethernet eth0: PHY [stmmac-0:01] driver [RTL8211E Gigabit Ethernet] (irq=POLL) [ 119.672641] dwmac-sun8i 1c30000.ethernet eth0: No Safety Features support found [ 119.672661] dwmac-sun8i 1c30000.ethernet eth0: No MAC Management Counters available [ 119.672669] dwmac-sun8i 1c30000.ethernet eth0: PTP not supported by HW [ 119.672684] dwmac-sun8i 1c30000.ethernet eth0: configuring for phy/rgmii link mode [ 121.311207] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready [ 123.777846] dwmac-sun8i 1c30000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off [ 123.777885] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [31780.950262] md: md0: recovery done. Edited October 24, 2020 by Robert Heller Finish up the post.
@lex Posted October 24, 2020 Posted October 24, 2020 I think the OV5640 was not probed. I did not see anything wrong with the dts. Review your kernel config for i2c bit-bang. It must be enabled.
Robert Heller Posted October 26, 2020 Author Posted October 26, 2020 On 10/24/2020 at 7:36 PM, @lex said: I think the OV5640 was not probed. I did not see anything wrong with the dts. Review your kernel config for i2c bit-bang. It must be enabled. OK, I changed CONFIG_I2C_GPIO from module (m) to built in (y): gollumm64% cat /boot/config-`uname -r` | grep I2C | grep GPIO CONFIG_I2C_ARB_GPIO_CHALLENGE=m CONFIG_I2C_MUX_GPIO=m CONFIG_I2C_CBUS_GPIO=m CONFIG_I2C_GPIO=y # CONFIG_I2C_GPIO_FAULT_INJECTOR is not set # I2C GPIO expanders # end of I2C GPIO expanders No change.
@lex Posted October 27, 2020 Posted October 27, 2020 Changing from 'm' to 'y' would not make a difference, so the problem is somewhere else. You should see this: [ 3.999211] i2c-gpio i2c-csi: using lines 141 (SDA) and 140 (SCL) Try this change: sda-gpios = <&pio 4 13 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN|GPIO_PULL_UP)>; /* CSI0-SDA: PE13 */ scl-gpios = <&pio 4 12 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN|GPIO_PULL_UP)>; /* CSI0-SCK: PE12 */
Robert Heller Posted October 27, 2020 Author Posted October 27, 2020 gollumm64% ls -1 /sys/bus/i2c/devices/*/name /sys/bus/i2c/devices/0-003c/name /sys/bus/i2c/devices/i2c-0/name /sys/bus/i2c/devices/i2c-1/name /sys/bus/i2c/devices/i2c-2/name gollumm64% cat /sys/bus/i2c/devices/*/name ov5640 i2c-csi DesignWare HDMI mv64xxx_i2c adapter gollumm64% ls -1 /sys/bus/i2c/devices/*/i2c-dev/*/name /sys/bus/i2c/devices/i2c-0/i2c-dev/i2c-0/name /sys/bus/i2c/devices/i2c-1/i2c-dev/i2c-1/name /sys/bus/i2c/devices/i2c-2/i2c-dev/i2c-2/name gollumm64% cat /sys/bus/i2c/devices/*/i2c-dev/*/name i2c-csi DesignWare HDMI mv64xxx_i2c adapter OK, still no luck. I looked for the I2C files under /sys and it looks like the ov5640 is seen, but I don't know if that actually means anything.
@lex Posted October 28, 2020 Posted October 28, 2020 can you print the output of: lsmod|grep ov ov5640 28672 1 v4l2_fwnode 20480 2 ov5640,sun6i_csi videodev 163840 7 ov5640,v4l2_fwnode,sunxi_cedrus,videobuf2_common,sun6i_csi,v4l2_mem2mem,videobuf2_v4l2 mc 28672 7 ov5640,sunxi_cedrus,videobuf2_common,videodev,sun6i_csi,v4l2_mem2mem,videobuf2_v4l2 This is valid if ov5640 is enabled with 'm'
Robert Heller Posted October 29, 2020 Author Posted October 29, 2020 gollumm64% lsmod | grep ov overlay 126976 3 ov5640 32768 0 v4l2_fwnode 28672 1 ov5640 videodev 258048 6 sunxi_cedrus,v4l2_fwnode,ov5640,videobuf2_v4l2,videobuf2_common,v4l2_mem2mem mc 57344 6 sunxi_cedrus,videodev,ov5640,videobuf2_v4l2,videobuf2_common,v4l2_mem2mem
Robert Heller Posted October 30, 2020 Author Posted October 30, 2020 OK, got the sun6i_csi module built, now the addition /dev files are there, but running cheese raises an error: Script started on 2020-10-29 19:29:03-04:00 [TERM="xterm" TTY="/dev/pts/0" COLUMNS="80" LINES="33"] heller has logged on pts/0 from 192.168.250.5 at 29-Oct-2020 19:19. gollumm64% dmesg | grep sun6i-csi [ 40.914900] sun6i-csi 1cb0000.csi: creating ov5640 0-003c:0 -> sun6i-csi:0 link [ 234.073723] sun6i-csi 1cb0000.csi: Wrong width or height 4800x3840 (640x480 expected) [ 235.308627] sun6i-csi 1cb0000.csi: dma_alloc_coherent of size 27648000 failed [ 358.830527] sun6i-csi 1cb0000.csi: Wrong width or height 4800x3840 (640x480 expected) [ 360.066890] sun6i-csi 1cb0000.csi: dma_alloc_coherent of size 27648000 failed gollumm64% v4l2-ctl --list-devices cedrus (platform:cedrus): /dev/video0 /dev/media0 sun6i-csi (platform:csi): /dev/video1 Allwinner Video Capture Device (platform:sun6i-csi): /dev/media1 gollumm64% v4l2-ctl -d 0 --list-formats --list-ctrls Codec Controls mpeg_2_slice_parameters 0x009909fa (unknown): type=103 flags=has-payload mpeg_2_quantization_matrices 0x009909fb (unknown): type=104 flags=has-payload h264_sequence_parameter_set 0x00990ce8 (unknown): type=110 flags=has-payload h264_picture_parameter_set 0x00990ce9 (unknown): type=111 flags=has-payload h264_scaling_matrix 0x00990cea (unknown): type=112 flags=has-payload h264_slice_parameters 0x00990ceb (unknown): type=113 flags=has-payload h264_decode_parameters 0x00990cec (unknown): type=114 flags=has-payload h264_decode_mode 0x00990ced (menu) : min=0 max=0 default=0 value=0 h264_start_code 0x00990cee (menu) : min=0 max=0 default=0 value=0 hevc_sequence_parameter_set 0x00990cf0 (unknown): type=120 flags=has-payload hevc_picture_parameter_set 0x00990cf1 (unknown): type=121 flags=has-payload hevc_slice_parameters 0x00990cf2 (unknown): type=122 flags=has-payload hevc_decode_mode 0x00990cf7 (menu) : min=0 max=0 default=0 value=0 hevc_start_code 0x00990cf8 (menu) : min=0 max=0 default=0 value=0 ioctl: VIDIOC_ENUM_FMT Type: Video Capture [0]: 'ST12' (Sunxi Tiled NV12 Format, compressed) [1]: 'NV12' (Y/CbCr 4:2:0) gollumm64% v4l2-ctl -d 1 --list-formats --list-ctrls ioctl: VIDIOC_ENUM_FMT Type: Video Capture [0]: 'BA81' (8-bit Bayer BGBG/GRGR) [1]: 'GBRG' (8-bit Bayer GBGB/RGRG) [2]: 'GRBG' (8-bit Bayer GRGR/BGBG) [3]: 'RGGB' (8-bit Bayer RGRG/GBGB) [4]: 'BG10' (10-bit Bayer BGBG/GRGR) [5]: 'GB10' (10-bit Bayer GBGB/RGRG) [6]: 'BA10' (10-bit Bayer GRGR/BGBG) [7]: 'RG10' (10-bit Bayer RGRG/GBGB) [8]: 'BG12' (12-bit Bayer BGBG/GRGR) [9]: 'GB12' (12-bit Bayer GBGB/RGRG) [10]: 'BA12' (12-bit Bayer GRGR/BGBG) [11]: 'RG12' (12-bit Bayer RGRG/GBGB) [12]: 'YUYV' (YUYV 4:2:2) [13]: 'YVYU' (YVYU 4:2:2) [14]: 'UYVY' (UYVY 4:2:2) [15]: 'VYUY' (VYUY 4:2:2) [16]: 'RGBP' (16-bit RGB 5-6-5) [17]: 'RGBO' (16-bit A/XRGB 1-5-5-5) [18]: 'HM12' (YUV 4:2:0 (16x16 Macroblocks)) [19]: 'NV12' (Y/CbCr 4:2:0) [20]: 'NV21' (Y/CrCb 4:2:0) [21]: 'YU12' (Planar YUV 4:2:0) [22]: 'YV12' (Planar YVU 4:2:0) [23]: 'NV16' (Y/CbCr 4:2:2) [24]: 'NV61' (Y/CrCb 4:2:2) [25]: '422P' (Planar YUV 4:2:2) [26]: 'RGBP' (16-bit RGB 5-6-5) [27]: 'RGBR' (16-bit RGB 5-6-5 BE) [28]: 'JPEG' (JFIF JPEG, compressed) gollumm64% media-ctl --device /dev/media0 -p Media controller API version 5.8.16 Media device information ------------------------ driver cedrus model cedrus serial bus info platform:cedrus hw revision 0x0 driver version 5.8.16 Device topology - entity 1: cedrus-source (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video0 pad0: Source -> "cedrus-proc":0 [ENABLED,IMMUTABLE] - entity 3: cedrus-proc (2 pads, 2 links) type Node subtype Unknown flags 0 pad0: Sink <- "cedrus-source":0 [ENABLED,IMMUTABLE] pad1: Source -> "cedrus-sink":0 [ENABLED,IMMUTABLE] - entity 6: cedrus-sink (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video0 pad0: Sink <- "cedrus-proc":1 [ENABLED,IMMUTABLE] gollumm64% media-ctl --device /dev/media1 -p Media controller API version 5.8.16 Media device information ------------------------ driver sun6i-csi model Allwinner Video Capture Device serial bus info hw revision 0x0 driver version 5.8.16 Device topology - entity 1: sun6i-csi (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video1 pad0: Sink <- "ov5640 0-003c":0 [ENABLED] - entity 5: ov5640 0-003c (1 pad, 1 link) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev0 pad0: Source [fmt:UYVY8_2X8/640x480@1/30 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] -> "sun6i-csi":0 [ENABLED] gollumm64% lsmod|grep ov overlay 126976 3 ov5640 32768 1 v4l2_fwnode 28672 2 ov5640,sun6i_csi videodev 258048 7 sunxi_cedrus,v4l2_fwnode,ov5640,videobuf2_v4l2,sun6i_csi,videobuf2_common,v4l2_mem2mem mc 57344 7 sunxi_cedrus,videodev,ov5640,videobuf2_v4l2,sun6i_csi,videobuf2_common,v4l2_mem2mem gollumm64% ^Dexit Script done on 2020-10-29 19:30:29-04:00 [COMMAND_EXIT_CODE="0"] I am also including the output from v4l2-ctl and media-ctl and lsmod for completeness. Also: what do I need to do to be able to post more than one post per day on this forum? Having to wait 24 hours between replies is tiresome.
@lex Posted October 30, 2020 Posted October 30, 2020 You need to tell v4l2 some info prior to capture images. Capture Images: https://github.com/avafinger/fswebcam#mainline-kernel-support I think is possible to grab images with 'Cheese' but you need to instruct Cheese to use the previous Image size set with media-ctl.
Robert Heller Posted October 30, 2020 Author Posted October 30, 2020 31 minutes ago, @lex said: You need to tell v4l2 some info prior to capture images. Capture Images: https://github.com/avafinger/fswebcam#mainline-kernel-support I think is possible to grab images with 'Cheese' but you need to instruct Cheese to use the previous Image size set with media-ctl. I don't understand how to format the command line for media-ctl. There doesn't appear to be a man page for it and the example from the (scant) documentation for fswebcam does not match what I have.
@lex Posted October 30, 2020 Posted October 30, 2020 media-ctl --device /dev/media1 --set-v4l2 '"ov5640 0-003c":0[fmt:YUYV8_2X8/1280x720]' From the topology (your case): --device /dev/media1 => this is your media for the OV5640 '"ov5640 0-003c":0[fmt:YUYV8_2X8/1280x720]' | +--> sink '"ov5640 0-003c":0[fmt:YUYV8_2X8/1280x720]' +-> :YUYV8_2X8 --> image format = YUV420P = YU12 '"ov5640 0-003c":0[fmt:YUYV8_2X8/1280x720]' +-> 1280x720] -> frame size ( sensor available frame sizes ) Modified fswebcam ./fswebcam --displayfps 1 -S 30 -d /dev/video1 -r 1280x720 -p YUV420P - > /tmp/cam_1280x720_yuv420p.jpg -displayfps 1 => print FPS -S 30 => grab at least 30 frames -d /dev/video1 => your device node -p YUV420P => frame format The boring and tedious part is documentation, that's the reason is scarce...
Robert Heller Posted October 30, 2020 Author Posted October 30, 2020 Thanks! I was able to grab a picture!
Robert Heller Posted October 30, 2020 Author Posted October 30, 2020 7 hours ago, @lex said: media-ctl --device /dev/media1 --set-v4l2 '"ov5640 0-003c":0[fmt:YUYV8_2X8/1280x720]' From the topology (your case): --device /dev/media1 => this is your media for the OV5640 '"ov5640 0-003c":0[fmt:YUYV8_2X8/1280x720]' | +--> sink '"ov5640 0-003c":0[fmt:YUYV8_2X8/1280x720]' +-> :YUYV8_2X8 --> image format = YUV420P = YU12 '"ov5640 0-003c":0[fmt:YUYV8_2X8/1280x720]' +-> 1280x720] -> frame size ( sensor available frame sizes ) Modified fswebcam ./fswebcam --displayfps 1 -S 30 -d /dev/video1 -r 1280x720 -p YUV420P - > /tmp/cam_1280x720_yuv420p.jpg -displayfps 1 => print FPS -S 30 => grab at least 30 frames -d /dev/video1 => your device node -p YUV420P => frame format The boring and tedious part is documentation, that's the reason is scarce... I have a couple of questions: Exactly how is the Image Format and Image Size information get decoded from the output of 19 hours ago, Robert Heller said: v4l2-ctl -d 0 --list-formats --list-ctrls and 19 hours ago, Robert Heller said: media-ctl --device /dev/media1 -p into the command line arguments to media-ctl and fswebcam, and how do I make the settings "stick" for programs like cheese and chromium (the latter so I can use programs / sites like Zoom and GoToMeeting and Google Hangouts -- eg video conferencing, etc.)?
@lex Posted October 30, 2020 Posted October 30, 2020 I am not sure if I can give you a direct and correct answer without resorting to reading the code "sun6i_csi". The format can be inferred from there. A good reading: https://linuxtv.org/downloads/presentations/summit_jun_2010/20100614-v4l2_summit-media.pdf https://linuxtv.org/downloads/v4l-dvb-apis-new/userspace-api/v4l/v4l2.html I don't use Zoom or GoToMetting, but basically any of these program to work must use the frame size and image format (yuv) set in media-ctl, if they try to get sensor capabilities and choose any one different from what you have set with media-ctl it won't work.
Levent Erenler Posted October 31, 2020 Posted October 31, 2020 I try to enable CSI Camera for pine64 A64+ Mainline Kernel (5.8x) config "CONFIG_VIDEO_SUN6I_CSI=m" NOT located in the kernel config file. And I try to add this line to /build/userpatches/linux-sunxi64-current.config and recompile. Unfortunately my compiled konfig file doesnt contain CONFIG_VIDEO_SUN6I_CSI, i try to find it in KKonfig menu but i coult not locate in the menu. Could anyone help? thank you.
Robert Heller Posted October 31, 2020 Author Posted October 31, 2020 3 hours ago, Levent Erenler said: I try to enable CSI Camera for pine64 A64+ Mainline Kernel (5.8x) config "CONFIG_VIDEO_SUN6I_CSI=m" NOT located in the kernel config file. And I try to add this line to /build/userpatches/linux-sunxi64-current.config and recompile. Unfortunately my compiled konfig file doesnt contain CONFIG_VIDEO_SUN6I_CSI, i try to find it in KKonfig menu but i coult not locate in the menu. Could anyone help? thank you. You need to enable "V4L platform devices" under Device Drivers > Multimedia support > Media drivers, then under "V4L platform devices" you want "Allwinner V3s Camera Sensor Interface driver" enabled as M.
Levent Erenler Posted October 31, 2020 Posted October 31, 2020 Yes i did it, unfortunatelly stuck editing dts file. could you give me a start point to use customized dts. I found dtb file under "/build/cache/sources/linux-mainline/orange-pi-5.8/arch/arm64/boot/dts/allwinner/ " but how could i customize dts before compile the kernel, i dont understand. I mean, how to attach customized dts. Thanks for your help.
Robert Heller Posted October 31, 2020 Author Posted October 31, 2020 2 minutes ago, Levent Erenler said: Yes i did it, unfortunatelly stuck editing dts file. could you give me a start point to use customized dts. I found dtb file under "/build/cache/sources/linux-mainline/orange-pi-5.8/arch/arm64/boot/dts/allwinner/ " but how could i customize dts before compile the kernel, i dont understand. Thanks for your help. I found a .dts file that was similar to my board and copy and pasted the parts relating to the camera to the dts file for mine, and then recompiled the dts to a dtb with "make dtbs" and then installed it using "make dtbs_install". Do you have the schematic for your board? That should show you which GPIO pins are used for the camera, so you can make the necessary changes to the device tree code you copied.
Levent Erenler Posted October 31, 2020 Posted October 31, 2020 Actually i am working on pine64 a64+ , i try to enable ov5640. i thought, i could fix with pinetab csi settings as you mention at above.
Robert Heller Posted October 31, 2020 Author Posted October 31, 2020 1 hour ago, Levent Erenler said: Actually i am working on pine64 a64+ , i try to enable ov5640. i thought, i could fix with pinetab csi settings as you mention at above. OK, make sure that the ov5640 module is also enabled.
Levent Erenler Posted November 3, 2020 Posted November 3, 2020 On 10/31/2020 at 7:40 PM, Robert Heller said: OK, make sure that the ov5640 module is also enabled. Hi, I am working more than 4 days but no luck, could you share your dts and config file. I dont understand whats wrong. i get "ov5640 1-004c: ov5640_init_slave_id: failed with -6" error Thank you root@pine64:~# dmesg |grep ov5640 [ 5.692745] sun6i-csi 1cb0000.csi: creating ov5640 1-004c:0 -> sun6i-csi:0 link [ 5.966763] ov5640 1-004c: ov5640_init_slave_id: failed with -6 [ 595.120402] ov5640 1-004c: ov5640_init_slave_id: failed with -6 root@pine64:~# v4l2-ctl --list-devices cedrus (platform:cedrus): /dev/video0 root@pine64:~# lsmod | grep ov ov5640 32768 1 v4l2_fwnode 28672 2 ov5640,sun6i_csi videodev 258048 7 sunxi_cedrus,v4l2_fwnode,ov5640,videobuf2_v4l2,sun6i_csi,videobuf2_common,v4l2_mem2mem mc 57344 7 sunxi_cedrus,videodev,ov5640,videobuf2_v4l2,sun6i_csi,videobuf2_common,v4l2_mem2mem
Robert Heller Posted November 3, 2020 Author Posted November 3, 2020 A fragment of my DTS is elsewhere in this thread. Note: it is for a Banana Pi M64, which is probably different from your Pine64. I got my working properly by refering to the schematic diagram I have for the Banana Pi M64. You need to get the schematic diagram for your Pine64, so you know exactly which GPIO pines are wired to the CSI connector, then you can be sure that the DTS file properly sets up the correct GPIO pins to the correct functions.
Levent Erenler Posted November 3, 2020 Posted November 3, 2020 1 hour ago, Robert Heller said: A fragment of my DTS is elsewhere in this thread. Note: it is for a Banana Pi M64, which is probably different from your Pine64. I got my working properly by refering to the schematic diagram I have for the Banana Pi M64. You need to get the schematic diagram for your Pine64, so you know exactly which GPIO pines are wired to the CSI connector, then you can be sure that the DTS file properly sets up the correct GPIO pins to the correct functions. Thanks for fast reply,First I changed them according to schematic and i checked, gpios are correct, if there was an issue on my camera or not connectted, could i see device wiith "v4l2-ctl --list-devices" ? Maybe there is a problem on camera hardware. Thank you
@lex Posted November 3, 2020 Posted November 3, 2020 2 hours ago, Levent Erenler said: i get "ov5640 1-004c: ov5640_init_slave_id: failed with -6" error This error is: /* No such device or address */ You should double-check: 1. Is your sensor OV5640? 2. Check the connector, some are reversed 180º which is the case for BPI and Orange Pi. There is a Thread about it, 3 years old a think.
Levent Erenler Posted November 3, 2020 Posted November 3, 2020 3 minutes ago, @lex said: This error is: /* No such device or address */ You should double-check: 1. Is your sensor OV5640? 2. Check the connector, some are reversed 180º which is the case for BPI and Orange Pi. There is a Thread about it, 3 years old a think. yes sensor is ov5640 and not reversed maybe there was a hardware issue, i dont know, i ordered a new one. Btw i have a reversed one (BP camera). I double check everything but no luck. May i ask is ov5640 works without any issue with a64 (pine64) or could you advise any camera ? i need 30 fps 640x480 to process with opencv. Thank you
@lex Posted November 4, 2020 Posted November 4, 2020 2 hours ago, Levent Erenler said: k is ov5640 works without any issue with a64 (pine64) Yes, it works fine, but be careful with mainline kernel AVDD / DOVDD / DVDD supply, i have burned out 6 sensors with the wrong settings. Search the forum for OV5640, i have advised one with ~130º lens if i remembered correctly. I would buy 2 or 3 from different sources (or different models) since you are not sure what you will get.
Levent Erenler Posted November 16, 2020 Posted November 16, 2020 Thank you @@lex i got my new OV5640 camera and working with 5.9.x Cpu usage around %70 with opencv V4l2 capture fmt:UYVY8_2X8/640x480@30FPS and %60 with JPEG_1X8/640x480@30FPS. It is higher than i expect. i thought csi camera uses GPU to grab image. Usb ov5640 cpu usage around %25 with similar settings. is it normal? Do you have any idea. Thank you.
Recommended Posts