-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rfsoc.c and xrfclk_example_app.c: Incorrect Linux gpio ID passed to XRFClk_Init() for GPIO to control the SPI SDO Mux on the CLK104 #284
Comments
Yes, Linux assignes arbitrary index to gpio device and can vary for different IP design. |
The issue exists using the factory evaluation build for the ZCU216. Why would you not default the value to the value in the factory evaluation design for each board? The main issue is that this error exists in the factory rftool included wtihin the ZCU216 BSP included in the Zynq UltraScale+ RFSoC Gen 3 RF Data Converter Evaluation Tool v2022.2. In particular rfsoc.c. |
Thanks for reporting. We acknowledge it as a bug. We will fix in the next release. |
I struggled with the GPIO settings for quite a while, so I'm sharing my discoveries in the hope it helps someone else. While it isn't clear at all how the GPIO is setup from the I found
Next I had to find out which
With all this info, I changed the call to Hope this helps, and if there's a better or more accurate way to do this, please update this thread. |
Hi, The method mentioned in the comment by @joeisnotfromthewoods is correct. Linux assigns arbitrary index to gpio device and it can vary with IP design. The gpio number in the argument of XRFClk_Init() function is wrong in rfsoc.c. This is fixed in 2024.1 release. To solve the problem in previous releases or any custom design we can use the below steps. The below example is taken from 2023.2 evaltool factory release. The steps are exactly same as mentioned by @joeisnotfromthewoods. Step 1: Find the GPIO address from the device tree label
Step 2: Find the number to which the gpio is mapped by Linux from the gpio address
For evaltool factory releases from 2021.1 to 2023.2, the gpio number is 481 for zcu216 and 489 for zcu208. Regards, |
Thanks for the feedback Anish. One question though, where is |
Hi, The evaluation tool can be downloaded from https://www.xilinx.com/products/silicon-devices/soc/rfsoc.html#resources The file rfsoc.c is part of rftool application. Rftool is a C based application running in the Linux user layer of the board. The LabVIEW evaltool gui communicates from host PC with Rftool in the board. Regards, |
你好,我在zcu208板子上运行rfclk的测试程序时,产生了如下报错: 通过查找代码发现是 然而我的/dev下没有i2c-20这个设备,我使用ls -la /dev/i2c*命令查看后,i2c的设备只有如下信息: 我查看xilinx内核的arch/arm64/boot/dts/xilinx/目录下的zynqmp-zcu208-revA.dts 文件,发现在&i2c1节点下有clk104的子节点,
}; 我认为我需要在设备树中添加i2c和CLK104的相关配置,但是 /* CLK104_SDA */这个应该如何填写呢?它与pl.dtsi文件中的axi_gpio_spi_mux设备节点有关吗?axi_gpio_spi_mux节点的内容如下: axi_gpio_spi_mux: gpio@a0040000 { |
@jieerxxxx You have the same issue we reported to xilinx for both zcu111 and zcu208 with Vivado 2024.1 and Petalinux 2024.1 update. For some unknown reason, the i2c-20 bridge is not enable while both i2c-0 and i2c1 enable. Thus rfsoc clk104 module could not initialized and failed detecting i2c-20 bridge. I downgrade the design to Vivado 2023.2 and Petalinux 2023.2, and the project runs clk104 as the i2c-20 is enable again in petalinux. |
@jieerxxxx I may found the root cause of missing i2c-xxx, from missing bsp hardware specific device-tree if petalinux is not build correctly. Go to your petalinux folder, and view system-top.dts that generated by Xilinx petalinux. The system device-tree should have zcu208-reva.dtsi included. In my case of 2024.1, even though I used generated petalinux with zcu208 bsp, sdt-gen build process expected zcu2-8-reva included in the sdt-gen while XSCT build would automatically included board specific parameter from bsp.
If your build is missing the board specific parameter "zcu208-reva", here is how you should build your project from BSP; tthis command is assumed BSP from 2023.2, rename it to your BSP version: $ petalinux-create -t project -n MYPROJECT -s xilinx-zcu208-v2023.2-10140544.bsp Without board specific parameter, your ZCU208 petalinux build is missing the i2c-bridge while i2c-0/1/2 sda ports are enable:
|
My 2024.1 clk104 application failed in XRFCLK_Init() during the third check spi init(). I debugged and all the i2c ports and bridges are correct. The gpio is updated in vitis code for the 2024.1 bsp petalinux build to gpio ID=512. What should I debug further? My system project:
|
@NghiSpectrohm |
@NghiSpectrohm |
This thread is a duplicate of the thread #252 |
For the ZCU216, the Linux gpio id passed to XRFClk_Init() is incorrect on line 276 of rfsoc.c
ret = XRFClk_Init(485);
, is incorrect. The same applies to line 142 of xrfclk_example_app.c that passes gpio486,XRFClk_Init(486);
. This causes RfclkReadReg commands from the RF Evaluation GUI to return an incorrect value because the SPI SDO mux is not properly controlled. It is possible that the Linux gpio specified for the ZCU208 might also be incorrect. In the Vivado block design of the GEN3 RF Evaluation for the ZCU216, the axi_gpio_spi_mux block is assigned a base address of 0x00_A020_5000. The gpiochip corresponding to this base address is gpiochip481 (see below).xilinx-zcu216-20222:~$ cat /sys/class/gpio/gpiochip481/label a0205000.gpio
For the ZCU216, both files should be corrected to
XRFClk_Init(481);
to enable proper control the SPI SDO Mux on the CLK104 to enable valid register reads of the PLLs on the CLK104.The text was updated successfully, but these errors were encountered: