05-31-2018 06:06 PM
I have a design for the MicroZed-7020 board, running PetaLinux 2018.1. One of the IP's I use in my design is a copy of the Xilinx AXI UART 16550 IP that I hacked to add RS485 support. The IP itself is working fine, but by default it shows up in the device tree generated by PetaLinux as a bare-bones node with none of the fields that PetaLinux somehow magically gives to an axi_uart_16550 IP, like the proper compatible string, interrupts, etc. I can add these fields manually, but this feels kind of fragile.
My IP has no differences from the standard axi_uart_16550 IP that Linux needs to know about. Is there some way to tell PetaLinux to just treat my IP as if it were an axi_uart_16550 IP? I found the file /opt/petalinux/tools/hsm/data/embeddedsw/XilinxProcessorIPLib/drivers/uartns550_v3_5/data/uartns550.mdd, which has a line specifying that it supports the axi_uart16550 device, so I tried adding my IP name there, but it didn't seem to help. I don't understand how all the device-tree magic for standard IP's happens, so I'm not really sure where to even look for a place to hook into it. Any guidance would be appreciated.
06-01-2018 07:58 AM - edited 06-01-2018 07:59 AM
06-01-2018 09:40 AM
Thanks @shustik, sorry I should have been more clear. When I said I was adding the fields manually, I meant in the system-user.dtsi file.
The file I'm wondering about is <project dir>/components/plnx_workspace/device_tree/device_tree/pl.dtsi, which automatically shows up when I build my project. If I have, for example, an AXI UART 16550 standard IP in my PL design, then that file has a fully-populated entry for the AXI UART 16550 instance, with the right clock, interrupts, etc already set. For my modified UART IP, a node does also show up in that file, but it doesn't have any of that stuff. Is there a way to trick PetaLinux into populating that node like it does for the standard UART IP?
06-08-2018 09:20 AM
In case it helps someone else, the way I fixed this was simply to change the name of my modified IP. Originally I called it "axi_uart_16550_rs485" because that was more descriptive. But when I changed it to "axi_uart_16550", then PetaLinux seems to treat it like the standard one and populate the device tree node the same.
Specifically, I'm talking about the Vivado Package IP window, select "Identification" in the list of Packaging Steps on the left, and then set the "Name:" field in the right-hand part of the window. Surprisingly, it doesn't seem to matter what vendor and library you set - PetaLinux seems to go off the name alone, not the full VLNV.
The corollary to this is, don't name your IP the same as any standard one if you *don't* want PetaLinux to treat it like the standard one!
06-08-2018 11:12 AM - edited 06-11-2018 01:58 AM
The dtg will look for your ip in its repo to create node. So unless you create this, it would know what to do with your custom node.
06-11-2018 01:58 AM
Im not aware of any documents for this. However, you can take an example driver (axi gpio for example), and use this as reference.
The HSI API are discussed here: