Hello everyone,
I’m currently trying to integrate the ADRV9001/2(wiki.analog.com/.../adrv9001) with a ZC702 board(www.xilinx.com/.../ek-z7-zc702-g.html) using PetaLinux 2023.2 and the 2023_R2 branch of meta-adi. Below are the main steps I followed so far:
1) Project Setup:
- Created a PetaLinux 2023.2 project for ZC702.
- Added the Analog Devices Yocto layer (meta-adi) to the project, following the instructions in the meta-adi-xilinx repository (github.com/.../meta-adi-xilinx).
- Used an XSA (hardware design) also generated from /projects/common/zc702 and additionally adrv9001/common/ in Vivado 2023_2.
2) Device Tree Configuration:
- Since there is no built-in ZC702 template in meta-adi for the ADRV9002, I started with
KERNEL_DTB = "zynq-zed-adv7511-adrv9002-rx2tx2"
in petalinuxbsp.conf.
- I then edited the zynq-zed-adv7511-adrv9002-rx2tx2.dts file’s includes (shown as diff):
- #include "zynq-zed.dtsi" - #include "zynq-zed-adv7511.dtsi" + #include "zynq-zc702.dtsi" + #include "zynq-zc702-adv7511.dtsi" #include "zynq-adrv9002-rx2tx2.dtsi"
The kernel sees the ADRV9002 driver (it is visible in menuconfig), but the boot process crashes right after loading the Linux kernel.
My goal is to make ADRV9002 appear as an IIO device so that I can interact with it using the IIO Oscilloscope.
Here are my questions:
1) What might I be missing or doing incorrectly when switching from the ZED-based device tree to the ZC702-based device tree? Are there additional patches, clock configurations, or pin muxing settings required for ZC702 that I haven’t accounted for?
2) Could someone provide a step-by-step guide or best practices on how to properly integrate the ADRV9002 driver into the ZC702 device tree and ensure that it is recognized as an IIO device?
3) Are there any known hardware constraints (e.g., SPI bus, clock routing, etc.) or kernel configuration details (e.g., specific defconfig fragments) that are crucial for the ADRV9002 to function on ZC702? Last but not least, the log in the boot process is attached.
U-Boot 2023.01 (Sep 21 2023 - 11:02:37 +0000) CPU: Zynq 7z020 Silicon: v3.1 Model: Xilinx Zynq ZED DRAM: ECC disabled 512 MiB Core: 35 devices, 17 uclasses, devicetree: board Flash: 0 Bytes NAND: 0 MiB MMC: mmc@e0100000: 0 Loading Environment from FAT... *** Error - No Valid Environment Area found *** Warning - bad env area, using default environment In: serial@e0001000 Out: serial@e0001000 Err: serial@e0001000 Net: Could not get PHY for eth0: addr 0 No ethernet found. Hit any key to stop autoboot: 0 switch to partitions #0, OK mmc0 is current device Scanning mmc 0:1... Found U-Boot script /boot.scr 3473 bytes read in 13 ms (260.7 KiB/s) ## Executing script at 03000000 Trying to load boot images from mmc0 8470784 bytes read in 475 ms (17 MiB/s) ## Loading kernel from FIT Image at 10000000 ... Using 'conf-system-top.dtb' configuration Verifying Hash Integrity ... OK Trying 'kernel-1' kernel subimage Description: Linux kernel Type: Kernel Image Compression: uncompressed Data Start: 0x10000108 Data Size: 8441872 Bytes = 8.1 MiB Architecture: ARM OS: Linux Load Address: 0x00200000 Entry Point: 0x00200000 Hash algo: sha256 Hash value: 266f7a8a6255cb117cec3b2de1fcfb54b95aa914623d7db6cb65e777c5e51383 Verifying Hash Integrity ... sha256+ OK ## Loading fdt from FIT Image at 10000000 ... Using 'conf-system-top.dtb' configuration Verifying Hash Integrity ... OK Trying 'fdt-system-top.dtb' fdt subimage Description: Flattened Device Tree blob Type: Flat Device Tree Compression: uncompressed Data Start: 0x1080d224 Data Size: 26997 Bytes = 26.4 KiB Architecture: ARM Hash algo: sha256 Hash value: 4107a73dd5b04591bffa47dc0b93511e46005d66911d59342cd69e80fda3c365 Verifying Hash Integrity ... sha256+ OK Booting using the fdt blob at 0x1080d224 Working FDT set to 1080d224 Could not get PHY for eth0: addr 0 Could not get PHY for eth0: addr 0 Loading Kernel Image Loading Device Tree to 1eac4000, end 1eacd974 ... OK Working FDT set to 1eac4000 Starting kernel ... Booting Linux on physical CPU 0x0 Linux version 6.1.70adi-v2023.2 (oe-user@oe-host) (arm-xilinx-linux-gnueabi-gcc (GCC) 12.2.0, GNU ld (GNU Binutils) 2.39.0.20220819) #1 SMP PREEMPT Wed Jan 8 08:42:31 UTC 2025 CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache OF: fdt: Machine model: Xilinx Zynq ZED earlycon: cdns0 at MMIO 0xe0001000 (options '115200n8') printk: bootconsole [cdns0] enabled Memory policy: Data cache writealloc cma: Reserved 128 MiB at 0x16800000 Zone ranges: Normal [mem 0x0000000000000000-0x000000001fffffff] HighMem empty Movable zone start for each node Early memory node ranges node 0: [mem 0x0000000000000000-0x000000001fffffff] Initmem setup node 0 [mem 0x0000000000000000-0x000000001fffffff] percpu: Embedded 11 pages/cpu s14420 r8192 d22444 u45056 Built 1 zonelists, mobility grouping on. Total pages: 130048 Kernel command line: console=ttyPS0,115200 earlycon root=/dev/mmcblk0p2 ro rootwait Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear) Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear) mem auto-init: stack:all(zero), heap alloc:off, heap free:off Memory: 361888K/524288K available (12288K kernel code, 819K rwdata, 10388K rodata, 1024K init, 469K bss, 31328K reserved, 131072K cma-reserved, 0K highmem) rcu: Preemptible hierarchical RCU implementation. rcu: RCU event tracing is enabled. rcu: RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2. rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies. rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2 NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 efuse mapped to (ptrval) slcr mapped to (ptrval) L2C: platform modifies aux control register: 0x72360000 -> 0x72760000 L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000 L2C-310 erratum 769419 enabled L2C-310 enabling early BRESP for Cortex-A9 L2C-310 full line of zeros enabled for Cortex-A9 L2C-310 ID prefetch enabled, offset 1 lines L2C-310 dynamic clock gating enabled, standby mode enabled L2C-310 cache controller enabled, 8 ways, 512 kB L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001 rcu: srcu_init: Setting srcu_struct sizes based on contention. zynq_clock_init: clkc starts at (ptrval) Zynq clock init sched_clock: 64 bits at 167MHz, resolution 6ns, wraps every 4398046511103ns clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x26703d7dd8, max_idle_ns: 440795208065 ns Switching to timer-based delay loop, resolution 6ns clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns timer #0 at (ptrval), irq=25 Console: colour dummy device 80x30 Calibrating delay loop (skipped), value calculated using timer frequency.. 333.33 BogoMIPS (lpj=1666666) CPU: Testing write buffer coherency: ok CPU0: Spectre v2: using BPIALL workaround pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) CPU0: thread -1, cpu 0, socket 0, mpidr 80000000 Setting up static identity map for 0x100000 - 0x100060 rcu: Hierarchical SRCU implementation. rcu: Max phase no-delay instances is 1000. smp: Bringing up secondary CPUs ... CPU1: thread -1, cpu 1, socket 0, mpidr 80000001 CPU1: Spectre v2: using BPIALL workaround smp: Brought up 1 node, 2 CPUs SMP: Total of 2 processors activated (666.66 BogoMIPS). CPU: All CPU(s) started in SVC mode. devtmpfs: initialized VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4 clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns futex hash table entries: 512 (order: 3, 32768 bytes, linear) pinctrl core: initialized pinctrl subsystem NET: Registered PF_NETLINK/PF_ROUTE protocol family DMA: preallocated 256 KiB pool for atomic coherent allocations thermal_sys: Registered thermal governor 'step_wise' cpuidle: using governor ladder platform axi: Fixed dependency cycle(s) with /axi/interrupt-controller@f8f01000 amba f8801000.etb: Fixed dependency cycle(s) with /replicator/out-ports/port@1/endpoint amba f8803000.tpiu: Fixed dependency cycle(s) with /replicator/out-ports/port@0/endpoint amba f8804000.funnel: Fixed dependency cycle(s) with /replicator/in-ports/port/endpoint amba f889c000.ptm: Fixed dependency cycle(s) with /axi/funnel@f8804000/in-ports/port@0/endpoint amba f889d000.ptm: Fixed dependency cycle(s) with /axi/funnel@f8804000/in-ports/port@1/endpoint hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers. hw-breakpoint: maximum watchpoint size is 4 bytes. e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 27, base_baud = 3125000) is a xuartps printk: console [ttyPS0] enabled printk: console [ttyPS0] enabled printk: bootconsole [cdns0] disabled printk: bootconsole [cdns0] disabled SCSI subsystem initialized usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb mc: Linux media interface: v0.10 videodev: Linux video capture interface: v2.00 pps_core: LinuxPPS API ver. 1 registered pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it> PTP clock support registered jesd204: found 0 devices and 0 topologies FPGA manager framework Advanced Linux Sound Architecture Driver Initialized. clocksource: Switched to clocksource arm_global_timer NET: Registered PF_INET protocol family IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear) tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear) Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear) TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear) TCP bind hash table entries: 4096 (order: 4, 65536 bytes, linear) TCP: Hash tables configured (established 4096 bind 4096) UDP hash table entries: 256 (order: 1, 8192 bytes, linear) UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear) NET: Registered PF_UNIX/PF_LOCAL protocol family RPC: Registered named UNIX socket transport module. RPC: Registered udp transport module. RPC: Registered tcp transport module. RPC: Registered tcp NFSv4.1 backchannel transport module. armv7-pmu f8891000.pmu: hw perfevents: no interrupt-affinity property, guessing. hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available workingset: timestamp_bits=30 max_order=17 bucket_order=0 NFS: Registering the id_resolver key type Key type id_resolver registered Key type id_legacy registered nfs4filelayout_init: NFSv4 File Layout Driver Registering... nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering... fuse: init (API version 7.37) io scheduler mq-deadline registered io scheduler kyber registered zynq-pinctrl 700.pinctrl: zynq pinctrl initialized dma-pl330 f8003000.dma-controller: Loaded driver for PL330 DMAC-241330 dma-pl330 f8003000.dma-controller: DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16 brd: module loaded loop: module loaded Registered mathworks_ip class SPI driver spidev has no spi_device_id for adi,swspi spi-nor spi1.0: SPI-NOR-UniqueID 100000237020412400270039040317375b spi-nor spi1.0: n25q128a11 (16384 Kbytes) 5 fixed-partitions partitions found on MTD device spi1.0 Creating 5 MTD partitions on "spi1.0": 0x000000000000-0x000000500000 : "boot" 0x000000500000-0x000000520000 : "bootenv" 0x000000520000-0x000000540000 : "config" 0x000000540000-0x000000fc0000 : "image" 0x000000fc0000-0x000001000000 : "spare" MACsec IEEE 802.1AE tun: Universal TUN/TAP device driver, 1.6 macb e000b000.ethernet: invalid hw address, using random mdio_bus e000b000.ethernet-ffffffff: MDIO device at address 0 is missing. macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 45 (52:f0:9c:bf:b0:39) usbcore: registered new interface driver asix usbcore: registered new interface driver ax88179_178a usbcore: registered new interface driver cdc_ether usbcore: registered new interface driver net1080 usbcore: registered new interface driver cdc_subset usbcore: registered new interface driver zaurus usbcore: registered new interface driver cdc_ncm usbcore: registered new interface driver r8153_ecm usbcore: registered new interface driver uas usbcore: registered new interface driver usb-storage usbcore: registered new interface driver usbserial_generic usbserial: USB Serial support registered for generic usbcore: registered new interface driver ftdi_sio usbserial: USB Serial support registered for FTDI USB Serial Device usbcore: registered new interface driver upd78f0730 usbserial: USB Serial support registered for upd78f0730 ULPI transceiver vendor/product ID 0x0424/0x0007 Found SMSC USB3320 ULPI transceiver. ULPI integrity check: passed. ci_hdrc ci_hdrc.0: EHCI Host Controller ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1 ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00 usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.01 usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 usb usb1: Product: EHCI Host Controller usb usb1: Manufacturer: Linux 6.1.70adi-v2023.2 ehci_hcd usb usb1: SerialNumber: ci_hdrc.0 hub 1-0:1.0: USB hub found hub 1-0:1.0: 1 port detected SPI driver ads7846 has no spi_device_id for ti,tsc2046 SPI driver ads7846 has no spi_device_id for ti,ads7843 SPI driver ads7846 has no spi_device_id for ti,ads7845 SPI driver ads7846 has no spi_device_id for ti,ads7873 i2c_dev: i2c /dev entries driver i2c 0-0039: Fixed dependency cycle(s) with /fpga-axi@0/axi_hdmi@70e00000/port/endpoint adv7511 0-0039: supply avdd not found, using dummy regulator adv7511 0-0039: supply dvdd not found, using dummy regulator adv7511 0-0039: supply pvdd not found, using dummy regulator adv7511 0-0039: supply bgvdd not found, using dummy regulator adv7511 0-0039: supply dvdd-3v not found, using dummy regulator adv7511: probe of 0-0039 failed with error -5 8<--- cut here --- Unhandled fault: imprecise external abort (0x406) at 0x00000000 [00000000] *pgd=00000000 Internal error: : 406 [#1] PREEMPT SMP ARM Modules linked in: CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.1.70adi-v2023.2 #1 Hardware name: Xilinx Zynq Platform PC is at xiic_i2c_probe+0x250/0x3f4 LR is at arm_heavy_mb+0x1c/0x38 pc : [<c06a8070>] lr : [<c01135dc>] psr: 60000013 sp : e0819e08 ip : 00000000 fp : c1fbb840 r10: c2415058 r9 : 00000000 r8 : 00000000 r7 : c1d5b810 r6 : c1d5b800 r5 : e09a0100 r4 : c2415040 r3 : dec0de1c r2 : 00000730 r1 : 00000000 r0 : 00000000 Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none Control: 18c5387d Table: 0000404a DAC: 00000051 Register r0 information: NULL pointer Register r1 information: NULL pointer Register r2 information: non-paged memory Register r3 information: non-slab/vmalloc memory Register r4 information: slab kmalloc-1k start c2415000 pointer offset 64 size 1024 Register r5 information: 0-page vmalloc region starting at 0xe09a0000 allocated at __devm_ioremap_resource+0x168/0x1dc Register r6 information: slab kmalloc-1k start c1d5b800 pointer offset 0 size 1024 Register r7 information: slab kmalloc-1k start c1d5b800 pointer offset 16 size 1024 Register r8 information: NULL pointer Register r9 information: NULL pointer Register r10 information: slab kmalloc-1k start c2415000 pointer offset 88 size 1024 Register r11 information: slab kmalloc-64 start c1fbb840 pointer offset 0 size 64 Register r12 information: NULL pointer Process swapper/0 (pid: 1, stack limit = 0x(ptrval)) Stack: (0xe0819e08 to 0xe081a000) 9e00: 00002000 c1d527c0 c2415040 24945212 c16b5650 00000000 9e20: c1d5b810 c1941028 00000000 c241d938 c183e834 c184a860 00000000 c051e7e8 9e40: c1d5b810 00000000 c1941028 c051c180 c1d5b810 c1941028 c1d5b810 00000000 9e60: c241d938 c051c42c 60000013 c183e834 c19e8fbc c1941028 c1d5b810 00000000 9e80: c241d938 c051c570 c1d5b810 c1941028 c1d5b854 c19352b0 c241d938 c051cc4c 9ea0: 00000000 c1941028 c051cbbc c051a2d4 e0819ed0 c1c1cd58 c1d55a34 24945212 9ec0: c1941028 c241d900 00000000 c051b69c c1618b88 00000000 c1941028 00000000 9ee0: 00000006 00000000 c19cd000 c051d6d0 c18227a8 c1c49140 00000006 c0101954 9f00: 00000000 c1724578 c1d04fb3 00000000 00000000 00000000 00000000 00000000 9f20: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9f40: 00000000 00000000 00000000 24945212 c1d04f80 0000012f c1d04f80 00000006 9f60: c19cd000 c183e854 c183e834 c18012f0 00000006 00000006 00000000 c18004d0 9f80: c1903ec0 c0c8af60 00000000 00000000 00000000 00000000 00000000 c0c8af78 9fa0: 00000000 c0c8af60 00000000 c010014c 00000000 00000000 00000000 00000000 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 xiic_i2c_probe from platform_probe+0x5c/0xb0 platform_probe from really_probe+0xc8/0x2ec really_probe from __driver_probe_device+0x88/0x19c __driver_probe_device from driver_probe_device+0x30/0x104 driver_probe_device from __driver_attach+0x90/0x174 __driver_attach from bus_for_each_dev+0x7c/0xc4 bus_for_each_dev from bus_add_driver+0x164/0x1f0 bus_add_driver from driver_register+0x88/0x11c driver_register from do_one_initcall+0x58/0x23c do_one_initcall from kernel_init_freeable+0x194/0x1f0 kernel_init_freeable from kernel_init+0x18/0x12c kernel_init from ret_from_fork+0x14/0x28 Exception stack(0xe0819fb0 to 0xe0819ff8) 9fa0: 00000000 00000000 00000000 00000000 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 Code: e5943004 e5933104 16bf3f33 f57ff04f (e3130080) ---[ end trace 0000000000000000 ]--- note: swapper/0[1] exited with irqs disabled Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b CPU1: stopping CPU: 1 PID: 0 Comm: swapper/1 Tainted: G D 6.1.70adi-v2023.2 #1 Hardware name: Xilinx Zynq Platform unwind_backtrace from show_stack+0x10/0x14 show_stack from dump_stack_lvl+0x40/0x4c dump_stack_lvl from do_handle_IPI+0x118/0x140 do_handle_IPI from ipi_handler+0x18/0x20 ipi_handler from handle_percpu_devid_irq+0x78/0x134 handle_percpu_devid_irq from generic_handle_domain_irq+0x28/0x38 generic_handle_domain_irq from gic_handle_irq+0x74/0x88 gic_handle_irq from generic_handle_arch_irq+0x34/0x44 generic_handle_arch_irq from call_with_stack+0x18/0x20 call_with_stack from __irq_svc+0x98/0xc8 Exception stack(0xe0849f50 to 0xe0849f98) 9f40: 00000005 00000000 000010c1 c0116780 9f60: c1c51240 c1903f10 00000001 c1903f58 c184df18 c1903f60 00000000 00000000 9f80: e0849f88 e0849fa0 c0107778 c010777c 60000113 ffffffff __irq_svc from arch_cpu_idle+0x38/0x3c arch_cpu_idle from default_idle_call+0x24/0x34 default_idle_call from do_idle+0x1c4/0x258 do_idle from cpu_startup_entry+0x28/0x2c cpu_startup_entry from secondary_start_kernel+0x11c/0x120 secondary_start_kernel from 0x1016e0 ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---
removed an attachment
[edited by: codeCrafter at 1:29 PM (GMT -5) on 22 Jan 2025]