MIPI-CSI on iMX8M Mini with ADV7282A-M

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MIPI-CSI on iMX8M Mini with ADV7282A-M

4,383 Views
KubaACO
Contributor I

Hello,

I am trying to run iMX8M Mini with ADV7282A-M chip, but I have some problems with drivers.

For now I'm using these drivers specifically:

ADV7282A-M: /drivers/media/i2c/adv7180.c
MIPI-CSI-2: /drivers/media/platform/mxc/capture/mxc_mipi_csi.c
CSI-BRIDGE: /drivers/media/platform/mxc/capture/mx6s_capture.c

But it looks like this drivers from /media/platform/mxc/ cannot work with ADV driver from /media/i2c/. Is this true?

In dmesg every part separatly looks totaly fine, ADV, MIPI-CSI and CSI-BRIDGE are completly initialized but when I'm trying to use it with "v4l2-ctl --all" there is no capabilities (like resolution 0/0).

 

Driver Info:
	Driver name      : mx6s-csi
	Card type        : i.MX6S_CSI
	Bus info         : platform:32e20000.csi1_bridge
	Driver version   : 5.10.52
	Capabilities     : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format
Priority: 0
Video input : 0 (Camera: ok)
Format Video Capture:
	Width/Height      : 0/0
	Pixel Format      : ''
	Field             : Any
	Bytes per Line    : 0
	Size Image        : 0
	Colorspace        : Default
	Transfer Function : Default (maps to Rec. 709)
	YCbCr/HSV Encoding: Default (maps to ITU-R 601)
	Quantization      : Default (maps to Full Range)
	Flags             : 
Crop Capability Video Capture:
	Bounds      : Left 0, Top 0, Width 0, Height 0
	Default     : Left 0, Top 0, Width 0, Height 0
	Pixel Aspect: 1/1
Selection Video Capture: crop, Left 0, Top 0, Width 0, Height 0, Flags: 
Selection Video Capture: crop_default, Left 0, Top 0, Width 0, Height 0, Flags: 
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 0, Height 0, Flags: 
Selection Video Capture: compose, Left 0, Top 0, Width 0, Height 0, Flags: 
Selection Video Capture: compose_default, Left 0, Top 0, Width 0, Height 0, Flags: 
Selection Video Capture: compose_bounds, Left 0, Top 0, Width 0, Height 0, Flags: 
Selection Video Capture: compose_padded, Left 0, Top 0, Width 0, Height 0, Flags: 
Selection Video Capture: native_size, Left 0, Top 0, Width 0, Height 0, Flags: 

 

Which drivers should I use with these devices?

0 Kudos
15 Replies

4,299 Views
KubaACO
Contributor I

Hi @khang_letruong , 

1) I can't use https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/media/platform/mxc/capture/adv7180... (I really would like to) because this is driver only for iMX6. You can't compile kernel for iMX8M Mini with this driver, because iMX8M Mini don't have IPU (which is necessary for this driver). 

2) I'm sending my Device Tree and Dmesg logs in attachment.

dmesg:

 

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.10.52-lts-5.10.y+g80bc7c9fc589 (oe-user@oe-host) (aarch64-poky-linux-gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.36.1.20210209) #1 SMP PREEMPT Tue Apr 5 23:00:00 UTC 2011
[    0.000000] Machine model: VisionSOM i.MX8MM ACO Custom
[    0.000000] earlycon: ec_imx6q0 at MMIO 0x0000000030a60000 (options '115200')
[    0.000000] printk: bootconsole [ec_imx6q0] enabled
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: created CMA memory pool at 0x0000000078000000, size 640 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] NUMA: No NUMA configuration found
[    0.000000] NUMA: Faking a node at [mem 0x0000000040000000-0x00000000bfffffff]
[    0.000000] NUMA: NODE_DATA [mem 0xbfbd5700-0xbfbd7fff]
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x00000000bfffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x00000000b7ffffff]
[    0.000000]   node   0: [mem 0x00000000b8000000-0x00000000b83fffff]
[    0.000000]   node   0: [mem 0x00000000b8400000-0x00000000bfffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x00000000bfffffff]
[    0.000000] On node 0 totalpages: 524288
[    0.000000]   DMA zone: 8192 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 524288 pages, LIFO batch:63
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.2
[    0.000000] percpu: Embedded 24 pages/cpu s58968 r8192 d31144 u98304
[    0.000000] pcpu-alloc: s58968 r8192 d31144 u98304 alloc=24*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: ARM erratum 845719
[    0.000000] CPU features: detected: GIC system register CPU interface
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 516096
[    0.000000] Policy zone: DMA
[    0.000000] Kernel command line: console=ttymxc3,115200 earlycon=ec_imx6q,0x30a60000,115200 root=/dev/mmcblk2p2 rootwait rw
[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 1369832K/2097152K available (15744K kernel code, 1288K rwdata, 5708K rodata, 3392K init, 1045K bss, 71960K reserved, 655360K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu: 	RCU event tracing is enabled.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[    0.000000] 	Trampoline variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
[    0.000000] GICv3: 128 SPIs implemented
[    0.000000] GICv3: 0 Extended SPIs implemented
[    0.000000] GICv3: Distributor has no Range Selector support
[    0.000000] GICv3: 16 PPIs implemented
[    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000038880000
[    0.000000] ITS: No ITS available, not enabling LPIs
[    0.000000] random: get_random_bytes called from start_kernel+0x320/0x4e4 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 8.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 440795202120 ns
[    0.000003] sched_clock: 56 bits at 8MHz, resolution 125ns, wraps every 2199023255500ns
[    0.008352] Console: colour dummy device 80x25
[    0.012574] Calibrating delay loop (skipped), value calculated using timer frequency.. 16.00 BogoMIPS (lpj=32000)
[    0.022844] pid_max: default: 32768 minimum: 301
[    0.027539] LSM: Security Framework initializing
[    0.032169] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.039560] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.048636] rcu: Hierarchical SRCU implementation.
[    0.052624] EFI services will not be available.
[    0.056975] smp: Bringing up secondary CPUs ...
[    0.061706] Detected VIPT I-cache on CPU1
[    0.061734] GICv3: CPU1: found redistributor 1 region 0:0x00000000388a0000
[    0.061776] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.062178] Detected VIPT I-cache on CPU2
[    0.062197] GICv3: CPU2: found redistributor 2 region 0:0x00000000388c0000
[    0.062224] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.062587] Detected VIPT I-cache on CPU3
[    0.062604] GICv3: CPU3: found redistributor 3 region 0:0x00000000388e0000
[    0.062628] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.062686] smp: Brought up 1 node, 4 CPUs
[    0.117966] SMP: Total of 4 processors activated.
[    0.122685] CPU features: detected: 32-bit EL0 Support
[    0.127858] CPU features: detected: CRC32 instructions
[    0.133009] CPU features: detected: 32-bit EL1 Support
[    0.145871] CPU: All CPU(s) started at EL2
[    0.147151] alternatives: patching kernel code
[    0.152898] devtmpfs: initialized
[    0.160053] KASLR disabled due to lack of seed
[    0.161792] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.171471] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.195498] pinctrl core: initialized pinctrl subsystem
[    0.198392] DMI not present or invalid.
[    0.202164] NET: Registered protocol family 16
[    0.213375] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations
[    0.218621] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.226460] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.233444] audit: initializing netlink subsys (disabled)
[    0.238992] audit: type=2000 audit(0.180:1): state=initialized audit_enabled=0 res=1
[    0.239551] thermal_sys: Registered thermal governor 'step_wise'
[    0.246764] cpuidle: using governor menu
[    0.256929] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.263443] ASID allocator initialised with 65536 entries
[    0.268956] Serial: AMBA PL011 UART driver
[    0.272969] imx mu driver is registered.
[    0.276853] imx rpmsg driver is registered.
[    0.301196] imx8mm-pinctrl 30330000.pinctrl: initialized IMX pinctrl driver
[    0.319859] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[    0.323760] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[    0.330476] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.337214] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    0.344831] cryptd: max_cpu_qlen set to 1000
[    0.350817] ACPI: Interpreter disabled.
[    0.352682] iommu: Default domain type: Translated 
[    0.357141] vgaarb: loaded
[    0.359941] SCSI subsystem initialized
[    0.363629] usbcore: registered new interface driver usbfs
[    0.369005] usbcore: registered new interface driver hub
[    0.374337] usbcore: registered new device driver usb
[    0.380457] mc: Linux media interface: v0.10
[    0.383697] videodev: Linux video capture interface: v2.00
[    0.389224] pps_core: LinuxPPS API ver. 1 registered
[    0.394174] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.403379] PTP clock support registered
[    0.407320] EDAC MC: Ver: 3.0.0
[    0.411252] No BMan portals available!
[    0.414427] QMan: Allocated lookup table at (____ptrval____), entry count 65537
[    0.421791] No QMan portals available!
[    0.425660] No USDPAA memory, no 'fsl,usdpaa-mem' in device-tree
[    0.431638] Advanced Linux Sound Architecture Driver Initialized.
[    0.437836] Bluetooth: Core ver 2.22
[    0.441094] NET: Registered protocol family 31
[    0.445538] Bluetooth: HCI device and connection manager initialized
[    0.451930] Bluetooth: HCI socket layer initialized
[    0.456827] Bluetooth: L2CAP socket layer initialized
[    0.461908] Bluetooth: SCO socket layer initialized
[    0.467439] clocksource: Switched to clocksource arch_sys_counter
[    0.473099] VFS: Disk quotas dquot_6.6.0
[    0.476909] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.483943] pnp: PnP ACPI: disabled
[    0.493240] NET: Registered protocol family 2
[    0.494868] IP idents hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.503069] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear)
[    0.510831] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.518841] TCP bind hash table entries: 16384 (order: 6, 262144 bytes, linear)
[    0.526332] TCP: Hash tables configured (established 16384 bind 16384)
[    0.532742] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear)
[    0.539426] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear)
[    0.546704] NET: Registered protocol family 1
[    0.551277] RPC: Registered named UNIX socket transport module.
[    0.556888] RPC: Registered udp transport module.
[    0.561609] RPC: Registered tcp transport module.
[    0.566332] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.572816] PCI: CLS 0 bytes, default 64
[    0.577379] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available
[    0.585085] kvm [1]: IPA Size Limit: 40 bits
[    0.590062] kvm [1]: GICv3: no GICV resource entry
[    0.593633] kvm [1]: disabling GICv2 emulation
[    0.598110] kvm [1]: GIC system register CPU interface enabled
[    0.604023] kvm [1]: vgic interrupt IRQ9
[    0.608004] kvm [1]: Hyp mode initialized successfully
[    0.616040] Initialise system trusted keyrings
[    0.617757] workingset: timestamp_bits=42 max_order=19 bucket_order=0
[    0.629804] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.633386] NFS: Registering the id_resolver key type
[    0.637915] Key type id_resolver registered
[    0.642083] Key type id_legacy registered
[    0.646179] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.652850] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    0.660302] jffs2: version 2.2. (NAND) \xc2\xa9 2001-2006 Red Hat, Inc.
[    0.666751] 9p: Installing v9fs 9p2000 file system support
[    0.707934] Key type asymmetric registered
[    0.709178] Asymmetric key parser 'x509' registered
[    0.714111] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[    0.721522] io scheduler mq-deadline registered
[    0.726069] io scheduler kyber registered
[    0.732558] EINJ: ACPI disabled.
[    0.741404] imx-sdma 302c0000.dma-controller: Direct firmware load for imx/sdma/sdma-imx7d.bin failed with error -2
[    0.749067] imx-sdma 302c0000.dma-controller: Falling back to sysfs fallback for: imx/sdma/sdma-imx7d.bin
[    0.765963] mxs-dma 33000000.dma-controller: initialized
[    0.769602] Bus freq driver module loaded
[    0.777207] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.782747] 30860000.serial: ttymxc0 at MMIO 0x30860000 (irq = 36, base_baud = 5000000) is a IMX
[    0.789635] serial serial0: tty port ttymxc0 registered
[    0.795242] 30890000.serial: ttymxc1 at MMIO 0x30890000 (irq = 37, base_baud = 1500000) is a IMX
[    0.804153] 30a60000.serial: ttymxc3 at MMIO 0x30a60000 (irq = 41, base_baud = 1500000) is a IMX
[    0.812440] printk: console [ttymxc3] enabled
[    0.821122] printk: bootconsole [ec_imx6q0] disabled
[    0.832942] imx-drm 32c00000.bus:display-subsystem: no available port
[    0.849885] loop: module loaded
[    0.885593] libphy: Fixed MDIO Bus: probed
[    0.890663] tun: Universal TUN/TAP device driver, 1.6
[    0.895878] CAN device driver interface
[    0.900873] pps pps0: new PPS source ptp0
[    0.910270] libphy: fec_enet_mii_bus: probed
[    0.915727] fec 30be0000.ethernet eth0: registered PHC device 0
[    0.922357] Freescale FM module, FMD API version 21.1.0
[    0.927805] Freescale FM Ports module
[    0.931477] fsl_mac: fsl_mac: FSL FMan MAC API based driver
[    0.937175] fsl_dpa: FSL DPAA Ethernet driver
[    0.941625] fsl_advanced: FSL DPAA Advanced drivers:
[    0.946594] fsl_proxy: FSL DPAA Proxy initialization driver
[    0.952254] fsl_oh: FSL FMan Offline Parsing port driver
[    0.958076] VFIO - User Level meta-driver version: 0.3
[    0.964931] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.971469] ehci-pci: EHCI PCI platform driver
[    0.975951] ehci-platform: EHCI generic platform driver
[    0.981695] usbcore: registered new interface driver usb-storage
[    0.990577] snvs_rtc 30370000.snvs:snvs-rtc-lp: registered as rtc0
[    0.996799] snvs_rtc 30370000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01T00:00:00 UTC (0)
[    1.006030] i2c /dev entries driver
[    1.009856] mx6s-csi 32e20000.csi1_bridge: initialising
[    1.015717] mxc_mipi-csi 32e30000.mipi_csi: supply mipi-phy not found, using dummy regulator
[    1.024388] mxc_mipi-csi 32e30000.mipi_csi: mipi csi v4l2 device registered
[    1.031364] CSI: Registered sensor subdevice: mxc_mipi-csi.0
[    1.037046] mxc_mipi-csi 32e30000.mipi_csi: lanes: 1, hs_settle: 0, clk_settle: 0, wclk: 0, freq: 333000000
[    1.047152] Driver for 1-wire Dallas network protocol.
[    1.053860] usbcore: registered new interface driver btusb
[    1.060457] sdhci: Secure Digital Host Controller Interface driver
[    1.066663] sdhci: Copyright(c) Pierre Ossman
[    1.071172] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.077752] mmc1: CQHCI version 5.10
[    1.077927] mmc2: CQHCI version 5.10
[    1.081364] sdhci-esdhc-imx 30b50000.mmc: voltage-ranges unspecified
[    1.084932] sdhci-esdhc-imx 30b60000.mmc: voltage-ranges unspecified
[    1.098144] ledtrig-cpu: registered to indicate activity on CPUs
[    1.104705] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping ....
[    1.111618] usbcore: registered new interface driver usbhid
[    1.117197] usbhid: USB HID core driver
[    1.122895] No fsl,qman node
[    1.125799] Freescale USDPAA process driver
[    1.129869] mmc2: SDHCI controller on 30b60000.mmc [30b60000.mmc] using ADMA
[    1.129997] fsl-usdpaa: no region found
[    1.140877] Freescale USDPAA process IRQ driver
[    1.148812] galcore: clk_get vg clock failed, disable vg!
[    1.154497] Galcore version 6.4.3.p2.336687
[    1.220928] [drm] Initialized vivante 1.0.0 20170808 for 38000000.gpu on minor 0
[    1.230355] hantrodec 0 : module inserted. Major = 236
[    1.236333] hantrodec 1 : module inserted. Major = 236
[    1.236990] mmc2: Command Queue Engine enabled
[    1.242542] hx280enc: module inserted. Major <235>
[    1.245980] mmc2: new HS400 Enhanced strobe MMC card at address 0001
[    1.256264] NET: Registered protocol family 26
[    1.258011] mmcblk2: mmc2:0001 008G30 7.28 GiB 
[    1.262029] NET: Registered protocol family 10
[    1.266240] mmcblk2boot0: mmc2:0001 008G30 partition 1 4.00 MiB
[    1.271310] Segment Routing with IPv6
[    1.276631] mmcblk2boot1: mmc2:0001 008G30 partition 2 4.00 MiB
[    1.280207] NET: Registered protocol family 17
[    1.286540] mmcblk2rpmb: mmc2:0001 008G30 partition 3 4.00 MiB, chardev (237:0)
[    1.290540] can: controller area network core
[    1.299939]  mmcblk2: p1 p2
[    1.302255] NET: Registered protocol family 29
[    1.309451] can: raw protocol
[    1.312431] can: broadcast manager protocol
[    1.316632] can: netlink gateway - max_hops=1
[    1.321843] Bluetooth: RFCOMM TTY layer initialized
[    1.326745] Bluetooth: RFCOMM socket layer initialized
[    1.331904] Bluetooth: RFCOMM ver 1.11
[    1.335665] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    1.340985] Bluetooth: BNEP filters: protocol multicast
[    1.346220] Bluetooth: BNEP socket layer initialized
[    1.351191] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    1.357119] Bluetooth: HIDP socket layer initialized
[    1.362125] 8021q: 802.1Q VLAN Support v1.8
[    1.366333] lib80211: common routines for IEEE802.11 drivers
[    1.371999] lib80211_crypt: registered algorithm 'NULL'
[    1.372003] lib80211_crypt: registered algorithm 'WEP'
[    1.372007] lib80211_crypt: registered algorithm 'CCMP'
[    1.372010] lib80211_crypt: registered algorithm 'TKIP'
[    1.372104] 9pnet: Installing 9P2000 support
[    1.376411] tsn generic netlink module v1 init...
[    1.381205] Key type dns_resolver registered
[    1.386407] registered taskstats version 1
[    1.390521] Loading compiled-in X.509 certificates
[    1.413583] usb_phy_generic usbphynop1: supply vcc not found, using dummy regulator
[    1.421496] usb_phy_generic usbphynop2: supply vcc not found, using dummy regulator
[    1.429592] gpio-142 (scl): enforced open drain please flag it properly in DT/ACPI DSDT/board file
[    1.502540] mxc_mipi-csi 32e30000.mipi_csi: Registered sensor subdevice: adv7180 0-0021
[    1.510566] adv7180 0-0021: chip found @ 0x21 (30a20000.i2c)
[    1.516324] i2c i2c-0: IMX I2C adapter registered
[    1.521531] gpio-148 (scl): enforced open drain please flag it properly in DT/ACPI DSDT/board file
[    1.531741] i2c i2c-3: IMX I2C adapter registered
[    1.536980] SoC: i.MX8MM revision 1.0
[    1.540856] imx-cpufreq-dt imx-cpufreq-dt: cpu speed grade 3 mkt segment 0 supported-hw 0x8 0x1
[    1.552748] mmc1: CQHCI version 5.10
[    1.554117] ALSA device list:
[    1.556387] sdhci-esdhc-imx 30b50000.mmc: voltage-ranges unspecified
[    1.559340]   No soundcards found.
[    1.565752] sdhci-esdhc-imx 30b50000.mmc: allocated mmc-pwrseq
[    1.608527] mmc1: SDHCI controller on 30b50000.mmc [30b50000.mmc] using ADMA
[    1.623285] EXT4-fs (mmcblk2p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.631473] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    1.638667] devtmpfs: mounted
[    1.640530] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    1.642766] Freeing unused kernel memory: 3392K
[    1.651718] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    1.651730] Run /sbin/init as init process
[    1.660964] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    1.661309]   with arguments:
[    1.666795]     /sbin/init
[    1.666797]   with environment:
[    1.666800]     HOME=/
[    1.666803]     TERM=linux
[    1.673917] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    1.683069] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    1.689241] random: fast init done
[    1.697104] mmc1: queuing unknown CIS tuple 0x80 (6 bytes)
[    1.759331] systemd[1]: System time before build time, advancing clock.
[    1.778926] systemd[1]: systemd 247.6+ running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR -SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 -ZSTD -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN -PCRE2 default-hierarchy=hybrid)
[    1.801556] systemd[1]: Detected architecture arm64.
[    1.849194] systemd[1]: Set hostname to <visionsom-8mm-cb>.
[    1.859675] random: systemd: uninitialized urandom read (16 bytes read)
[    1.866356] systemd[1]: Initializing machine ID from random generator.
[    1.906562] mmc1: new high speed SDIO card at address 0001
[    1.925253] systemd-sysv-generator[173]: SysV service '/etc/init.d/halt' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    1.949455] systemd-sysv-generator[173]: SysV service '/etc/init.d/umountfs' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    1.974422] systemd-sysv-generator[173]: SysV service '/etc/init.d/single' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    1.999174] systemd-sysv-generator[173]: SysV service '/etc/init.d/umountnfs.sh' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    2.023717] systemd-sysv-generator[173]: SysV service '/etc/init.d/save-rtc.sh' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    2.048320] systemd-sysv-generator[173]: SysV service '/etc/init.d/reboot' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    2.072341] systemd-sysv-generator[173]: SysV service '/etc/init.d/rc.local' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    2.096677] systemd-sysv-generator[173]: SysV service '/etc/init.d/sendsigs' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    2.408431] systemd[1]: Queued start job for default target Graphical Interface.
[    2.416876] random: systemd: uninitialized urandom read (16 bytes read)
[    2.462504] systemd[1]: Created slice system-getty.slice.
[    2.483594] random: systemd: uninitialized urandom read (16 bytes read)
[    2.491672] systemd[1]: Created slice system-modprobe.slice.
[    2.516989] systemd[1]: Created slice system-serial\x2dgetty.slice.
[    2.540942] systemd[1]: Created slice User and Session Slice.
[    2.564240] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[    2.587749] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    2.611777] systemd[1]: Reached target Paths.
[    2.631935] systemd[1]: Reached target Remote File Systems.
[    2.655957] systemd[1]: Reached target Slices.
[    2.675975] systemd[1]: Reached target Swap.
[    2.700119] systemd[1]: Listening on RPCbind Server Activation Socket.
[    2.724016] systemd[1]: Reached target RPC Port Mapper.
[    2.745508] systemd[1]: Listening on Syslog Socket.
[    2.763824] systemd[1]: Listening on initctl Compatibility Named Pipe.
[    2.788549] systemd[1]: Listening on Journal Audit Socket.
[    2.801300] systemd[1]: Listening on Journal Socket (/dev/log).
[    2.824394] systemd[1]: Listening on Journal Socket.
[    2.844567] systemd[1]: Listening on Network Service Netlink Socket.
[    2.869710] systemd[1]: Listening on udev Control Socket.
[    2.891940] systemd[1]: Listening on udev Kernel Socket.
[    2.904543] systemd[1]: Listening on User Database Manager Socket.
[    2.930998] systemd[1]: Mounting Huge Pages File System...
[    2.955226] systemd[1]: Mounting POSIX Message Queue File System...
[    2.978594] systemd[1]: Mounting Kernel Debug File System...
[    2.996308] systemd[1]: Condition check resulted in Kernel Trace File System being skipped.
[    3.008700] systemd[1]: Mounting Temporary Directory (/tmp)...
[    3.032613] systemd[1]: Starting Create list of static device nodes for the current kernel...
[    3.059099] systemd[1]: Starting Load Kernel Module configfs...
[    3.082724] systemd[1]: Starting Load Kernel Module drm...
[    3.102686] systemd[1]: Starting Load Kernel Module fuse...
[    3.114439] fuse: init (API version 7.32)
[    3.123296] systemd[1]: Starting RPC Bind...
[    3.139731] systemd[1]: Condition check resulted in File System Check on Root Device being skipped.
[    3.149420] systemd[1]: systemd-journald.service: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
[    3.162326] systemd[1]: (This warning is only shown for the first unit using IP firewalling.)
[    3.174974] systemd[1]: Starting Journal Service...
[    3.197525] systemd[1]: Condition check resulted in Load Kernel Modules being skipped.
[    3.208725] systemd[1]: Starting Remount Root and Kernel File Systems...
[    3.226684] EXT4-fs (mmcblk2p2): re-mounted. Opts: (null)
[    3.246936] systemd[1]: Starting Apply Kernel Variables...
[    3.271026] systemd[1]: Starting Coldplug All udev Devices...
[    3.297959] systemd[1]: Started RPC Bind.
[    3.316208] systemd[1]: Started Journal Service.
[    3.581274] systemd-journald[184]: Received client request to flush runtime journal.
[    4.209293] caam-snvs 30370000.caam-snvs: violation handlers armed - init state
[    4.243142] caam 30900000.crypto: Entropy delay = 3200
[    4.248701] caam 30900000.crypto: Entropy delay = 3600
[    4.269440] caam 30900000.crypto: Instantiated RNG4 SH0
[    4.283328] caam 30900000.crypto: Instantiated RNG4 SH1
[    4.289360] caam 30900000.crypto: device ID = 0x0a16040100000000 (Era 9)
[    4.297887] caam 30900000.crypto: job rings = 3, qi = 0
[    4.313095] Bluetooth: HCI UART driver ver 2.3
[    4.314112] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    4.317914] Bluetooth: HCI UART protocol H4 registered
[    4.334044] Bluetooth: HCI UART protocol LL registered
[    4.339981] Bluetooth: HCI UART protocol Three-wire (H5) registered
[    4.344423] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    4.349237] Bluetooth: HCI UART protocol Broadcom registered
[    4.364597] hci_uart_bcm serial0-0: supply vbat not found, using dummy regulator
[    4.372593] hci_uart_bcm serial0-0: supply vddio not found, using dummy regulator
[    4.450410] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    4.459610] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    4.474170] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    4.489424] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    4.736276] Bluetooth: hci0: BCM: chip id 94
[    4.747576] Bluetooth: hci0: BCM: features 0x2e
[    4.752224] imx-sdma 302b0000.dma-controller: firmware found.
[    4.752348] imx-sdma 302b0000.dma-controller: loaded firmware 4.6
[    4.752892] imx-sdma 30bd0000.dma-controller: firmware found.
[    4.771852] imx-sdma 302c0000.dma-controller: firmware found.
[    4.777760] Bluetooth: hci0: BCM43430A1
[    4.781887] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0000
[    4.783632] Bluetooth: hci0: BCM43430A1 'brcm/BCM43430A1.hcd' Patch
[    4.831669] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[    4.847746] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43430-sdio.somlabs,visionsom-imx8mm.txt failed with error -2
[    4.862018] brcmfmac mmc1:0001:1: Falling back to sysfs fallback for: brcm/brcmfmac43430-sdio.somlabs,visionsom-imx8mm.txt
[    5.047818] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[    5.064552] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Jun 13 2018 23:24:39 version 7.45.98.52 (r691997 CY) FWID 01-8b9f8ef5
[    5.184165] caam_jr 30901000.jr: failed to flush job ring 0
[    5.184287] caam_jr: probe of 30901000.jr failed with error -5
[    5.223790] caam algorithms registered in /proc/crypto
[    5.226163] caam 30900000.crypto: caam pkc algorithms registered in /proc/crypto
[    5.226181] caam 30900000.crypto: registering rng-caam
[    5.228017] Device caam-keygen registered
[    5.240221] random: crng init done
[    5.240235] random: 7 urandom warning(s) missed due to ratelimiting
[    5.242543] fsl-jr-uio 30901000.jr: UIO device full name fsl-jr0 initialized
[    5.453477] Bluetooth: hci0: BCM4343WA1 37.4MHz Murata Type-1DX BT4.0-0141
[    5.453494] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0502
[    5.525210] Micrel KSZ8081 or KSZ8091 30be0000.ethernet-1:01: attached PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=30be0000.ethernet-1:01, irq=POLL)
[    6.196050] audit: type=1006 audit(1616581522.436:2): pid=648 uid=0 old-auid=4294967295 auid=0 tty=(none) old-ses=4294967295 ses=1 res=1
[    6.603319] audit: type=1006 audit(1616581522.840:3): pid=642 uid=0 old-auid=4294967295 auid=0 tty=tty7 old-ses=4294967295 ses=2 res=1
[    8.604891] fec 30be0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[    8.612855] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

 


Device tree:
Original part in freescale/imx8mm.dtsi:

 

csi1_bridge: csi1_bridge@32e20000 {
    compatible = "fsl,imx8mm-csi", "fsl,imx8mq-csi", "fsl,imx6s-csi";
    reg = <0x32e20000 0x1000>;
    interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
    clocks = <&clk IMX8MM_CLK_DISP_AXI_ROOT>,
        <&clk IMX8MM_CLK_CSI1_ROOT>,
        <&clk IMX8MM_CLK_DISP_APB_ROOT>;
    clock-names = "disp-axi", "csi_mclk", "disp_dcic";
    power-domains = <&dispmix_pd>;
    status = "disabled";
};

mipi_csi_1: mipi_csi@32e30000 {
    compatible = "fsl,imx8mm-mipi-csi";
    reg = <0x32e30000 0x1000>;
    interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
    clock-frequency = <333000000>;
    clocks = <&clk IMX8MM_CLK_CSI1_CORE>,
        <&clk IMX8MM_CLK_CSI1_PHY_REF>,
        <&clk IMX8MM_CLK_DISP_AXI_ROOT>,
        <&clk IMX8MM_CLK_DISP_APB_ROOT>;
    clock-names = "mipi_clk", "phy_clk", "disp_axi", "disp_apb";
    bus-width = <4>;
    power-domains = <&mipi_pd>;
    status = "disabled";
};

 


My modifications:

 

&iomuxc {
    pinctrl_i2c1: i2c1grp {
        fsl,pins = <
            MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL                  0x40000083
            MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA                  0x40000083
        >;
    };
};

&csi1_bridge {
	fsl,mipi-mode;
	status = "okay";
	port {
		csi_ep: endpoint {
			remote-endpoint = <&csi_mipi_ep>;
		};
	};
};

&mipi_csi_1 {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	/* Camera 0  MIPI CSI-2 (CSIS0) */
	port@0 {
		reg = <0>;
		mipi_csi0_ep: endpoint {
			remote-endpoint = <&adv728x_mipi1_ep>;
            clock-lanes = <0>;
			data-lanes = <1>;
			// csis-hs-settle = <7>;
			// csis-clk-settle = <0>;
			// csis-wclk;
		};

		csi_mipi_ep: endpoint@2 {
			remote-endpoint = <&csi_ep>;
		};
	};
};

&i2c1 {
    clock-frequency = <100000>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_i2c1>;
    scl-gpios = <&gpio5 14 GPIO_ACTIVE_HIGH>;
    sda-gpios = <&gpio5 15 GPIO_ACTIVE_HIGH>;
    status = "okay";

    adv728x_mipi1: adv728x_mipi1@21 {
        status = "okay";
        compatible = "adi,adv7282-m";
        reg = <0x21>;
        clocks = <&clk IMX8MM_CLK_CLKO1>;
        clock-names = "csi_mclk";
        assigned-clocks = <&clk IMX8MM_CLK_CLKO1>;
        assigned-clock-parents = <&clk IMX8MM_CLK_24M>;
        assigned-clock-rates = <24000000>;
        csi_id = <0>; 
        mclk = <24000000>;
        mclk_source = <0>;
        // mipi_camera = <1>; /* Needed for v4l2 configuration */
        // cvbs = <1>;
        port {
            adv728x_mipi1_ep: endpoint {
                remote-endpoint = <&mipi_csi0_ep>;
                clock-lanes = <0>;
                data-lanes = <1>;
                // link-frequencies = /bits/ 64 <297000000>;
                // mclk-frequency = <12000000>;
            };
        };
    };
};

 

 

0 Kudos

4,271 Views
khang_letruong
Senior Contributor III

Hi @KubaACO,

Did you make your modification within imx8mm.dtsi or imx8mm-evk.dtsi ?  imx8mm.dtsi should not be modified.

Best Regards,
K.

0 Kudos

4,257 Views
KubaACO
Contributor I

Hi @khang_letruong 

Did you make your modification within imx8mm.dtsi or imx8mm-evk.dtsi ?  imx8mm.dtsi should not be modified.

No, I've created new DT file 'visionsom-8mm-custom.dts' which is directly loaded by U-Boot as the main Device Tree file. This file body is: 

 

/dts-v1/;

#include "freescale/visionsom-8mm.dtsi"
#include "adv7180.dts"
#include "ksz8081.dts"

/ {
    model = "VisionSOM i.MX8MM ACO Custom";
};

 


'imx8mm.dtsi' file is loaded by 'freescale/visionsom-8mm.dtsi' and in the 'adv7180.dts' file are my changes mentioned earlier. 
'freescale/visionsom-8mm.dtsi' is available here: https://github.com/SoMLabs/somlabs-linux-imx/blob/somlabs_imx_5.4.24_2.1.0/arch/arm64/boot/dts/frees... 

I thing that this is working, because adv7180.c driver is loaded - and this is configured in this 'adv7180.dts' file with my changes. 

0 Kudos

4,346 Views
khang_letruong
Senior Contributor III

Hi again,

And you should enable the debugging message of above driver to see where it was stuck, for example :
- Is the i2c communication successful?
- What /dev/videoX is registered for your driver?
- ...
Best Regards,
Khang.

 

0 Kudos

4,325 Views
KubaACO
Contributor I

Hello @khang_letruong khang_letruong,

This driver (adv7180.c) is working totally fine, it's not a case. Driver is fully probed and loaded, in system DMESG there is a message "adv7180 0-0021: chip found @ 0x21 (30a20000.i2c)".
Also all i2c addresses are successfully initialized (0x21, 0x42, 0x44).
But this driver is not creating any /dev/videoX (it's not supposed to).

The driver which is creating '/dev/video0/' device is:
https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/media/platform/mxc/capture/mx6s_ca...

And it is listed when i'm doing 'v4l2-ctl --all'.... BUT this driver is not "talking" with adv7180.c driver.

I read somewhere that mainline drivers from /drivers/media/i2c/ are not working with drivers from /drivers/media/platform/mxc/ because there are using different V4L2 API. Is this true?

What should I do now?

Thanks

0 Kudos

4,220 Views
khang_letruong
Senior Contributor III

Hi @KubaACO ,

Looking at the entry point of the driver you are using :

static int adv7180_probe(struct i2c_client *client,
                         const struct i2c_device_id *id)
{
        struct adv7180_state *state;
        struct v4l2_subdev *sd;
        int ret;

        /* Check if the adapter supports the needed features */
        if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
                return -EIO;

        v4l_info(client, "chip found @ 0x%02x (%s)\n",
                 client->addr, client->adapter->name);

        state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL);
        if (state == NULL)
                return -ENOMEM;

        state->client = client;
        state->field = V4L2_FIELD_INTERLACED;
        state->chip_info = (struct adv7180_chip_info *)id->driver_data;

        state->pwdn_gpio = devm_gpiod_get_optional(&client->dev, "powerdown",
                                                   GPIOD_OUT_HIGH);
        if (IS_ERR(state->pwdn_gpio)) {
                ret = PTR_ERR(state->pwdn_gpio);
                v4l_err(client, "request for power pin failed: %d\n", ret);
                return ret;
        }

        if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2) {
                state->csi_client = i2c_new_dummy(client->adapter,
                                ADV7180_DEFAULT_CSI_I2C_ADDR);
                if (!state->csi_client)
                        return -ENOMEM;
        }

        if (state->chip_info->flags & ADV7180_FLAG_I2P) {
                state->vpp_client = i2c_new_dummy(client->adapter,
                                ADV7180_DEFAULT_VPP_I2C_ADDR);
                if (!state->vpp_client) {
                        ret = -ENOMEM;
                        goto err_unregister_csi_client;
                }
        }

        state->irq = client->irq;
        mutex_init(&state->mutex);
        state->curr_norm = V4L2_STD_NTSC;
        if (state->chip_info->flags & ADV7180_FLAG_RESET_POWERED)
                state->powered = true;
        else
                state->powered = false;
        state->input = 0;
        sd = &state->sd;
        v4l2_i2c_subdev_init(sd, client, &adv7180_ops);
        sd->flags = V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;

        ret = adv7180_init_controls(state);
        if (ret)
                goto err_unregister_vpp_client;

        state->pad.flags = MEDIA_PAD_FL_SOURCE;
        sd->entity.flags |= MEDIA_ENT_F_ATV_DECODER;
        ret = media_entity_pads_init(&sd->entity, 1, &state->pad);
        if (ret)
                goto err_free_ctrl;

        ret = init_device(state);
        if (ret)
                goto err_media_entity_cleanup;

        if (state->irq) {
                ret = request_threaded_irq(client->irq, NULL, adv7180_irq,
                                           IRQF_ONESHOT | IRQF_TRIGGER_FALLING,
                                           KBUILD_MODNAME, state);
                if (ret)
                        goto err_media_entity_cleanup;
        }

        ret = v4l2_async_register_subdev(sd);
        if (ret)
                goto err_free_irq;

        return 0;

err_free_irq:
        if (state->irq > 0)
                free_irq(client->irq, state);
err_media_entity_cleanup:
        media_entity_cleanup(&sd->entity);
err_free_ctrl:
        adv7180_exit_controls(state);
err_unregister_vpp_client:
        if (state->chip_info->flags & ADV7180_FLAG_I2P)
                i2c_unregister_device(state->vpp_client);
err_unregister_csi_client:
        if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
                i2c_unregister_device(state->csi_client);
        mutex_destroy(&state->mutex);
        return ret;
}

 

It's still early to make the following conclusion :

This driver (adv7180.c) is working totally fine, it's not a case. Driver is fully probed and loaded, in system DMESG there is a message "adv7180 0-0021: chip found @ 0x21 (30a20000.i2c)".
Also all i2c addresses are successfully initialized (0x21, 0x42, 0x44).

I would suggest you to put an info message to make sure that your driver has been successfully probed (adv7180_probe() returns 0):

        ret = v4l2_async_register_subdev(sd);
        if (ret)
                goto err_free_irq;

         v4l_info(client, "Driver for adv7282-m successfully probed\n", client->addr);
        return 0;

- Otherwise, add an error message (v4l_error(...) ) for each return different than 0.

I would guess that the I2C communication from the iM8M Mini SoC to the adv7282-m has not been established yet.

Regards,
K.

0 Kudos

4,211 Views
KubaACO
Contributor I

Hello @khang_letruong 

First of all - Thank you so much for trying to help me! I hope we can find a solution together.

Unfortunately - there is some mistake. adv7180.c driver which I'm using is:
https://github.com/Freescale/linux-fslc/blob/5.10-2.1.x-imx/drivers/media/i2c/adv7180.c and in this driver function 'adv7180_probe()' is different from the one you are quoting.

As You can see in this driver: 

v4l_info(client, "chip found @ 0x%02x (%s)\n",
		 client->addr, client->adapter->name);

this log is printed at the very end of the probe function so I assume all this function is working correctly.

What do You think about it? 

PS Could You give me a link to driver file which You are quoting? 

0 Kudos

4,205 Views
khang_letruong
Senior Contributor III

Hi @KubaACO ,

What do You think about it?

Sorry for the confusion. I took it from a very old version, I switched to that version to check how I did implement my own driver for iMX8M Mini before as you said : 

1) I can't use https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/media/platform/mxc/capture/adv7180... (I really would like to) because this is driver only for iMX6. You can't compile kernel for iMX8M Mini with this driver, because iMX8M Mini don't have IPU (which is necessary for this driver).

And, I put my own driver to the same location as the ov5640_mipi_v2.c under drivers/media/platform/mxc/capture/ in which there's another adv7180.c driver developed / maintained by Freescale/NXP while the drivers/media/i2c/adv7180.c is upstream and developed by Analog Devices, its maker.

Regards,
K.

Tags (1)
0 Kudos

4,201 Views
KubaACO
Contributor I

@khang_letruong 

Ok, sorry but i'm not quite understand:

And, I put my own driver to the same location as the ov5640_mipi_v2.c under drivers/media/platform/mxc/capture/ in which there's another adv7180.cdriver developed / maintained by Freescale/NXP while the drivers/media/i2c/adv7180.c is upstream and developed by Analog Devices, its maker.

So You wrote Your own driver to the ADV7180 (or similar)? And with this driver it is all working fine? 

0 Kudos

4,140 Views
khang_letruong
Senior Contributor III

Hi @KubaACO,

So You wrote Your own driver to the ADV7180 (or similar)? And with this driver it is all working fine?

I meant the location of custom driver for iMX 8M Mini could be under drivers/media/platform/mxc/capture/ if it was a completely new one. I did develop/port custom driver(s) for iMX 8M Mini and place under the mentioned location : https://community.nxp.com/t5/i-MX-Processors/Custom-camera-driver-adaptation-on-iMX8M-Mini/m-p/10907...

Effectively, the one maintained by Freescale/NXP (https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/media/platform/mxc/capture/adv7180... is an older one (it mainly supports adv7180) and has dependency on IPU (in menuconfig). 

The upstream driver developed/maintained by Analog-Devices (https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/media/i2c/adv7180.c?h=lf-5.10.y) seems more generic and supports wider range of decoders (including one with MIPI-CSI2 outputs). I have also successfully used this driver for ADV7280-M in another platform (Nvidia Jeson) with small adaptation.

Btw, I tested the later on the EVK and with the ADV7280-M :

 

root@imx8mmevk:~# dmesg | grep adv7180
[    6.827569] mxc_mipi-csi 32e30000.mipi_csi: Registered sensor subdevice: adv7180 2-0021
[    6.843251] adv7180 2-0021: chip found @ 0x21 (30a40000.i2c)

 

I think that the /dev/video0 is always there as it is populated by the presence of csi-bridge node :

 

root@imx8mmevk:~# v4l2-ctl --list-devices
i.MX6S_CSI (platform:32e20000.csi1_bridge):
        /dev/video0

vsi_v4l2dec (platform:vsi_v4l2dec):
        /dev/video2

vsi_v4l2enc (platform:vsi_v4l2enc):
        /dev/video1

 

and if the mipi-csi interface is well configured (number of lanes, hs-settle, clk-settle, ...) as well as well connected to the output of the decoder, you could obtain the image data :

 

 

root@imx8mmevk:~# v4l2-ctl --list-formats-ext -d /dev/video0
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'UYVY' (UYVY 4:2:2)
                Size: Discrete 720x576
                        Interval: Discrete 0.033s (29.970 fps)

 

I believe that at this step, the ADV728x-M is ready to send data out on its MIPI-CSI interface. The rest would be to adapt the capture driver (mxc_mipi_csi.c, mx6s_capture.c) on the SoC side to receive the output data format of the decoder correctly.

Best Regards,
K.

0 Kudos

4,355 Views
KubaACO
Contributor I

Bump...

0 Kudos

4,370 Views
KubaACO
Contributor I

Hello, 

Really none of you can help me and tell me which drivers work together?

0 Kudos

4,349 Views
khang_letruong
Senior Contributor III

Hi @KubaACO,

I would say this one : https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/media/i2c/adv7180.c?h=lf-5.10.y , seeing the list of supported devices include yours :

#ifdef CONFIG_OF
static const struct of_device_id adv7180_of_id[] = {
	{ .compatible = "adi,adv7180", },
	{ .compatible = "adi,adv7180cp", },
	{ .compatible = "adi,adv7180st", },
	{ .compatible = "adi,adv7182", },
	{ .compatible = "adi,adv7280", },
	{ .compatible = "adi,adv7280-m", },
	{ .compatible = "adi,adv7281", },
	{ .compatible = "adi,adv7281-m", },
	{ .compatible = "adi,adv7281-ma", },
	{ .compatible = "adi,adv7282", },
	{ .compatible = "adi,adv7282-m", },
	{ },
};

MODULE_DEVICE_TABLE(of, adv7180_of_id);
#endif

 

But it might requires certain tuning depending on the input video format (PAL/NTSC) as well.

Best regards,
Khang.

 

0 Kudos

4,318 Views
khang_letruong
Senior Contributor III

Hi @KubaACO ,

But this driver is not creating any /dev/videoX (it's not supposed to).

Is it possible to share you device-tree and more log (dmesg), please ?

Best regards,

K.

 

0 Kudos

4,313 Views
khang_letruong
Senior Contributor III

Hi @KubaACO ,

There's another driver probably in your expected location : https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/media/platform/mxc/capture/adv7180...

/* This function attaches this structure to the /dev/video0 device.
	 * The pointer in priv points to the adv7180_data structure here.*/
	adv7180_int_device.priv = &adv7180_data;
	ret = v4l2_int_device_register(&adv7180_int_device);

You can also give it a try.

Best Regards,
K.

0 Kudos