cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
468 Views
Registered: ‎11-09-2013

Xilinx AXI GPIO Kernel Hang / Not Working Zynq UltraScale+ (REPOST)

My previous version of this has been stuck in your spam filter, reposting:

Hi all

I have been struggling for the past several hours getting a simple design with AXI GPIO on the UltraScale+ (Ultra96 board) running. The kernel hangs early in boot, usually after reporting the console has been enabled. In working boots (more on that later), the following message is the fpga-region manager.

I have several combinations of errors that I cause that seem to stem from a mis-configuration of the AXI GPIO device-tree entry. When I specify the full entry, as such:

 

axi_gpio_0: gpio@a0000000 {
		#gpio-cells = <2>;
		clock-names = "s_axi_aclk";
		clocks = <&zynqmp_clk 71>;
		compatible = "xlnx,axi-gpio-2.0", "xlnx,xps-gpio-1.00.a";
		gpio-controller ;
		reg = <0x0 0xa0000000 0x0 0x1000>;
		xlnx,all-inputs = <0x0>;
		xlnx,all-inputs-2 = <0x0>;
		xlnx,all-outputs = <0x0>;
		xlnx,all-outputs-2 = <0x0>;
		xlnx,dout-default = <0x00000000>;
		xlnx,dout-default-2 = <0x00000000>;
		xlnx,gpio-width = <0xc>;
		xlnx,gpio2-width = <0xc>;
		xlnx,interrupt-present = <0x0>;
		xlnx,is-dual = <0x1>;
		xlnx,tri-default = <0xFFFFFFFF>;
		xlnx,tri-default-2 = <0xFFFFFFFF>;
	};

	axi_gpio_1: gpio@a0001000 {
		#gpio-cells = <3>;
		clock-names = "s_axi_aclk";
		clocks = <&zynqmp_clk 71>;
		compatible = "xlnx,axi-gpio-2.0", "xlnx,xps-gpio-1.00.a";
		gpio-controller ;
		reg = <0x0 0xa0001000 0x0 0x1000>;
		xlnx,all-inputs = <0x0>;
		xlnx,all-inputs-2 = <0x0>;
		xlnx,all-outputs = <0x0>;
		xlnx,all-outputs-2 = <0x0>;
		xlnx,dout-default = <0x00000000>;
		xlnx,dout-default-2 = <0x00000000>;
		xlnx,gpio-width = <0x2>;
		xlnx,gpio2-width = <0x20>;
		xlnx,interrupt-present = <0x0>;
		xlnx,is-dual = <0x0>;
		xlnx,tri-default = <0xFFFFFFFF>;
		xlnx,tri-default-2 = <0xFFFFFFFF>;
		};

 

 

The kernel will hang, and I will see errors related to the GPIO as such:

 

1.298262] xilinx-gpio a0000000.gpio: Input clock not found
[ 1.298314] xilinx-gpio a0001000.gpio: Input clock not found


Things I have tried over the past 6-7 hours:

 

Things I have tried over the past 6-7 hours:

  • Passing clk_ignore_unused on every boot in bootargs
  • Verified in psu_init.c that PL0 clock configuration was not getting clobbered
  • Using v2019.1 Git tags of everything. Using stock DTSI + Common Clock Framework DTSI
  • trying a fixed clock definition in device-tree, kernel still hangs
  • Checking debugfs kernel output on clocks, can't make sense of it to see if PL0 is actually active
  • If I remove clock-names, but keep clocks, the kernel will boot and the GPIO peripherals will not work, again reporting an input clock error.
  • If I keep clock-names, but remove clocks entry, the kernel will boot and the GPIO peripheral will not work, again reporting an input clock error
  • Have tried placing the PL stuff inside a separate amba_pl entry, like the DTG does
  • Tried feeding the device-tree entries for axi_gpio with other clocks like LPD_LSCLK
  • Have built FSBL, U-Boot, PMU all from source
  • Software Version: Vivado 2019.1

The PL just has two axi_gpio instances in it, so I'm really disheartened at why this is being so painful to work with. I have not managed to get a configuration where I can talk to the peripherals in Linux.

I was suspecting perhaps the PL clocks are getting turned off, but I am using the CCF and I see all fabric clocks as "okay" in the DTS. The GPIO drivers seem to load very early in the kernel, long before the platform management drivers; could that be why it is breaking?

Threads I have found / read:

  • removed due to spam filter triggering (please fix that)

A kernel hung run:

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 4.19.0 (movax@whistler) (gcc version 8.2.0 (GCC)) #1 SMP Wed Jun 26 22:19:26 PDT 2019
[    0.000000] Machine model: Warhol ZCU100 RevC
[    0.000000] earlycon: cdns0 at MMIO 0x00000000ff010000 (options '115200n8')
[    0.000000] bootconsole [cdns0] enabled
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 256 MiB at 0x0000000070000000
[    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.1
[    0.000000] random: get_random_bytes called from start_kernel+0x94/0x3f8 with crng_init=0
[    0.000000] percpu: Embedded 22 pages/cpu @(____ptrval____) s52504 r8192 d29416 u90112
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: enabling workaround for ARM erratum 845719
[    0.000000] Speculative Store Bypass Disable mitigation not required
[    0.000000] CPU features: detected: Kernel page table isolation (KPTI)
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 517120
[    0.000000] Kernel command line: earlycon clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait
[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.000000] Memory: 1785040K/2097152K available (10428K kernel code, 618K rwdata, 5212K rodata, 768K init, 305K bss, 49968K reserved, 262144K cma-reserved)
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    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] GIC: Adjusting CPU interface base to 0x00000000f902f000
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] arch_timer: cp15 timer(s) running at 100.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x171024e7e0, max_idle_ns: 440795205315 ns
[    0.000004] sched_clock: 56 bits at 100MHz, resolution 10ns, wraps every 4398046511100ns
[    0.008339] Console: colour dummy device 80x25
[    0.012462] console [tty0] enabled
[    0.015827] bootconsole [cdns0] disabled
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 4.19.0 (movax@whistler) (gcc version 8.2.0 (GCC)) #1 SMP Wed Jun 26 22:19:26 PDT 2019
[    0.000000] Machine model: Warhol ZCU100 RevC
[    0.000000] earlycon: cdns0 at MMIO 0x00000000ff010000 (options '115200n8')
[    0.000000] bootconsole [cdns0] enabled
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 256 MiB at 0x0000000070000000
[    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.1
[    0.000000] random: get_random_bytes called from start_kernel+0x94/0x3f8 with crng_init=0
[    0.000000] percpu: Embedded 22 pages/cpu @(____ptrval____) s52504 r8192 d29416 u90112
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: enabling workaround for ARM erratum 845719
[    0.000000] Speculative Store Bypass Disable mitigation not required
[    0.000000] CPU features: detected: Kernel page table isolation (KPTI)
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 517120
[    0.000000] Kernel command line: earlycon clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait
[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.000000] Memory: 1785040K/2097152K available (10428K kernel code, 618K rwdata, 5212K rodata, 768K init, 305K bss, 49968K reserved, 262144K cma-reserved)
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    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] GIC: Adjusting CPU interface base to 0x00000000f902f000
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] arch_timer: cp15 timer(s) running at 100.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x171024e7e0, max_idle_ns: 440795205315 ns
[    0.000004] sched_clock: 56 bits at 100MHz, resolution 10ns, wraps every 4398046511100ns
[    0.008339] Console: colour dummy device 80x25
[    0.012462] console [tty0] enabled
[    0.015827] bootconsole [cdns0] disabled
[    0.019742] Calibrating delay loop (skipped), value calculated using timer frequency.. 200.00 BogoMIPS (lpj=400000)
[    0.019757] pid_max: default: 32768 minimum: 301
[    0.019884] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.019902] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.020784] ASID allocator initialised with 32768 entries
[    0.020845] rcu: Hierarchical SRCU implementation.
[    0.021164] EFI services will not be available.
[    0.021307] smp: Bringing up secondary CPUs ...
[    0.021632] Detected VIPT I-cache on CPU1
[    0.021671] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.022019] Detected VIPT I-cache on CPU2
[    0.022040] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.022355] Detected VIPT I-cache on CPU3
[    0.022375] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.022420] smp: Brought up 1 node, 4 CPUs
[    0.022453] SMP: Total of 4 processors activated.
[    0.022462] CPU features: detected: 32-bit EL0 Support
[    0.024885] CPU: All CPU(s) started at EL2
[    0.024903] alternatives: patching kernel code
[    0.026173] devtmpfs: initialized
[    0.030567] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.030596] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.036874] xor: measuring software checksum speed
[    0.076994]    8regs     :  2375.000 MB/sec
[    0.117023]    8regs_prefetch:  2052.000 MB/sec
[    0.157055]    32regs    :  2725.000 MB/sec
[    0.197087]    32regs_prefetch:  2309.000 MB/sec
[    0.197095] xor: using function: 32regs (2725.000 MB/sec)
[    0.197113] pinctrl core: initialized pinctrl subsystem
[    0.197964] NET: Registered protocol family 16
[    0.198320] audit: initializing netlink subsys (disabled)
[    0.198396] audit: type=2000 audit(0.188:1): state=initialized audit_enabled=0 res=1
[    0.198871] cpuidle: using governor menu
[    0.199014] vdso: 2 pages (1 code @ (____ptrval____), 1 data @ (____ptrval____))
[    0.199028] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.199924] DMA: preallocated 256 KiB pool for atomic allocations
[    0.212465] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.277252] raid6: int64x1  gen()   446 MB/s
[    0.345339] raid6: int64x1  xor()   487 MB/s
[    0.413350] raid6: int64x2  gen()   680 MB/s
[    0.481427] raid6: int64x2  xor()   602 MB/s
[    0.549451] raid6: int64x4  gen()   981 MB/s
[    0.617512] raid6: int64x4  xor()   735 MB/s
[    0.685569] raid6: int64x8  gen()  1183 MB/s
[    0.753613] raid6: int64x8  xor()   790 MB/s
[    0.821730] raid6: neonx1   gen()   736 MB/s
[    0.889738] raid6: neonx1   xor()   880 MB/s
[    0.957778] raid6: neonx2   gen()  1128 MB/s
[    1.025836] raid6: neonx2   xor()  1174 MB/s
[    1.093893] raid6: neonx4   gen()  1486 MB/s
[    1.161927] raid6: neonx4   xor()  1419 MB/s
[    1.229986] raid6: neonx8   gen()  1541 MB/s
[    1.298044] raid6: neonx8   xor()  1460 MB/s
[    1.298052] raid6: using algorithm neonx8 gen() 1541 MB/s
[    1.298060] raid6: .... xor() 1460 MB/s, rmw enabled
[    1.298068] raid6: using neon recovery algorithm
[    1.298262] xilinx-gpio a0000000.gpio: Input clock not found
[    1.298314] xilinx-gpio a0001000.gpio: Input clock not found
[    1.299184] SCSI subsystem initialized
[    1.299420] usbcore: registered new interface driver usbfs
[    1.299464] usbcore: registered new interface driver hub
[    1.299507] usbcore: registered new device driver usb
[    1.299588] media: Linux media interface: v0.10
[    1.299622] videodev: Linux video capture interface: v2.00
[    1.299655] pps_core: LinuxPPS API ver. 1 registered
[    1.299664] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    1.299687] PTP clock support registered
[    1.299723] EDAC MC: Ver: 3.0.0
[    1.300178] zynqmp-ipi-mbox mailbox@ff990400: Probed ZynqMP IPI Mailbox driver.
[    1.300426] FPGA manager framework
[    1.300596] Advanced Linux Sound Architecture Driver Initialized.
[    1.301328] clocksource: Switched to clocksource arch_sys_counter
[    1.301427] VFS: Disk quotas dquot_6.6.0
[    1.301480] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    1.307287] NET: Registered protocol family 2
[    1.307725] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes)
[    1.307760] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[    1.307875] TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
[    1.308205] TCP: Hash tables configured (established 16384 bind 16384)
[    1.308300] UDP hash table entries: 1024 (order: 3, 32768 bytes)
[    1.308345] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
[    1.308484] NET: Registered protocol family 1
[    1.308745] RPC: Registered named UNIX socket transport module.
[    1.308755] RPC: Registered udp transport module.
[    1.308762] RPC: Registered tcp transport module.
[    1.308769] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.309713] hw perfevents: no interrupt-affinity property for /pmu, guessing.
[    1.309885] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available
[    1.310860] Initialise system trusted keyrings
[    1.310959] workingset: timestamp_bits=62 max_order=19 bucket_order=0
[    1.311736] NFS: Registering the id_resolver key type
[    1.311754] Key type id_resolver registered
[    1.311762] Key type id_legacy registered
[    1.311776] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.311798] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    2.394171] NET: Registered protocol family 38
[    2.452363] Key type asymmetric registered
[    2.452373] Asymmetric key parser 'x509' registered
[    2.452428] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    2.452442] io scheduler noop registered
[    2.452450] io scheduler deadline registered
[    2.452492] io scheduler cfq registered (default)
[    2.452502] io scheduler mq-deadline registered
[    2.452510] io scheduler kyber registered
[    2.483482] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    2.486852] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    2.492057] brd: module loaded
[    2.496948] loop: module loaded
[    2.497919] mtdoops: mtd device (mtddev=name/number) must be supplied
[    2.499461] libphy: Fixed MDIO Bus: probed
[    2.500963] tun: Universal TUN/TAP device driver, 1.6
[    2.501168] CAN device driver interface
[    2.501182] sja1000 CAN netdevice driver
[    2.502135] usbcore: registered new interface driver asix
[    2.502180] usbcore: registered new interface driver ax88179_178a
[    2.502217] usbcore: registered new interface driver cdc_ether
[    2.502249] usbcore: registered new interface driver net1080
[    2.502282] usbcore: registered new interface driver cdc_subset
[    2.502314] usbcore: registered new interface driver zaurus
[    2.502361] usbcore: registered new interface driver cdc_ncm
[    2.503157] usbcore: registered new interface driver uas
[    2.503204] usbcore: registered new interface driver usb-storage
[    2.503901] rtc_zynqmp ffa60000.rtc: rtc core: registered ffa60000.rtc as rtc0
[    2.503969] i2c /dev entries driver
[    2.505482] usbcore: registered new interface driver uvcvideo
[    2.505495] USB Video Class driver (1.1.1)
[    2.506243] EDAC MC: ECC not enabled
[    2.506410] EDAC DEVICE0: Giving out device to module zynqmp-ocm-edac controller zynqmp_ocm: DEV ff960000.memory-controller (INTERRUPT)
[    2.507243] sdhci: Secure Digital Host Controller Interface driver
[    2.507254] sdhci: Copyright(c) Pierre Ossman
[    2.507261] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.507657] ledtrig-cpu: registered to indicate activity on CPUs
[    2.507714] zynqmp_firmware_probe Platform Management API v1.1
[    2.507725] zynqmp_firmware_probe Trustzone version v1.0
[    2.510768] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: zynqmp pinctrl initialized
[    2.533019] zynqmp_clk_mux_get_parent() getparent failed for clock: lpd_wdt, ret = -22
[    2.533621] alg: No test for xilinx-zynqmp-aes (zynqmp-aes)
[    2.533645] zynqmp_aes zynqmp_aes: AES Successfully Registered
[    2.533645]
[    2.533832] alg: No test for xilinx-keccak-384 (zynqmp-keccak-384)
[    2.534003] alg: No test for xilinx-zynqmp-rsa (zynqmp-rsa)
[    2.534247] usbcore: registered new interface driver usbhid
[    2.534256] usbhid: USB HID core driver
[    2.536235] fpga_manager fpga0: Xilinx ZynqMP FPGA Manager registered
[    2.536644] usbcore: registered new interface driver snd-usb-audio
[    2.537596] pktgen: Packet Generator for packet performance testing. Version: 2.75
[    2.538068] Initializing XFRM netlink socket
[    2.538168] NET: Registered protocol family 10
[    2.538633] Segment Routing with IPv6
[    2.538741] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    2.539143] NET: Registered protocol family 17
[    2.539161] NET: Registered protocol family 15
[    2.539183] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    2.539243] can: controller area network core (rev 20170425 abi 9)
[    2.539284] NET: Registered protocol family 29
[    2.539294] can: raw protocol (rev 20170425)
[    2.539302] can: broadcast manager protocol (rev 20170425 t)
[    2.539313] can: netlink gateway (rev 20170425) max_hops=1
[    2.539449] 9pnet: Installing 9P2000 support
[    2.539477] Key type dns_resolver registered
[    2.539972] registered taskstats version 1
[    2.539981] Loading compiled-in X.509 certificates
[    2.540362] Btrfs loaded, crc32c=crc32c-generic
[    2.548322] ff000000.serial: ttyPS1 at MMIO 0xff000000 (irq = 24, base_baud = 6249999) is a xuartps
[    2.548521] serial serial0: tty port ttyPS0 registered
[    2.548942] ff010000.serial: ttyPS0 at MMIO 0xff010000 (irq = 25, base_baud = 6249999) is a xuartps
[    3.665748] console [ttyPS0] enabled
0 Kudos
1 Reply
Highlighted
Explorer
Explorer
466 Views
Registered: ‎11-09-2013

Maybe this will avoid the spam filter, these are resources I tried:

 

https://forums.xilinx.com/t5/Embedded-Linux/Make-devices-compatible-with-generic-uio-by-their-type/td-p/869811
https://forums.xilinx.com/t5/Embedded-Linux/bootconsole-cdns0-disabled-2018-1-sdcard-booting/td-p/878809
https://forums.xilinx.com/t5/AXI-Infrastructure/AXIS-GPIO-on-ZYNQ-Ultrascale-hangs-when-reading-and-writing/td-p/938564
https://forums.xilinx.com/t5/Embedded-Linux/AXI-read-hangs/td-p/762508
https://forums.xilinx.com/t5/Other-FPGA-Architectures/axi-gpio-broken-in-Petalinux-2018-1/td-p/886206
https://forums.xilinx.com/t5/Embedded-Linux/Enabling-PL-Clocks-in-Zynq-MPSoC/td-p/824893
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842336/DTG+Common+clock+framework?view=blog
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841636/Common+Clock+Framework
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842482/Device+Tree+Tips




0 Kudos