There is a zynq processor and custom IP, interconnection between these two are through AXI interconnect bridge. I have created devicetree.dtb file..Now next step is to transfer data through AXI. I get to know we can do it through UIO method but dont know how to start.
I have done some changes in .dtb file and UIO0 has been created in /dev/uio0. There is also two mapping shown in /sys/class/uio/maps/mapo/map1.
This is my .dtb file
PL.dts
{
amba_pl: amba_pl {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
ranges ;
mod_ip_0: mod_ip@43c00000 {
compatible = "dmen-uio";
reg = <0x43c00000 0x10000 0x7aa00000 0x10000>;
xlnx,s00-axi-addr-width = <0x4>;
xlnx,s00-axi-data-width = <0x20>;
xlnx,s01-axi-addr-width = <0xa>;
xlnx,s01-axi-aruser-width = <0x1>;
xlnx,s01-axi-awuser-width = <0x1>;
xlnx,s01-axi-buser-width = <0x1>;
xlnx,s01-axi-data-width = <0x20>;
xlnx,s01-axi-id-width = <0xc>;
xlnx,s01-axi-ruser-width = <0x1>;
xlnx,s01-axi-wuser-width = <0x1>;
};
};
};
C coding:
ad9361_uio_fd = open(AD9361_UIO_DEV, O_RDWR);
printf("hi");
if(ad9361_uio_fd < 1)
{
printf("%s: Can't open ad9361_uio device\n\r", __func__);
return;
}
FILE *fp;
uint32_t mem_size=0x10000;
uint32_t mem_addr=0x43c00000;
fp = fopen ("/sys/class/uio/uio0/maps/map0/size","r");
fscanf(fp,"0x%0x", &mem_size);
fclose(fp);
fp = fopen ("/sys/class/uio/uio0/maps/map0/addr","r");
fscanf(fp,"0x%0x", &mem_addr);
fclose(fp);
FILE *fs;
uint32_t mem_size_1=0x10000;
uint32_t mem_addr_1=0x7aa00000;
fs = fopen ("/sys/class/uio/uio0/maps/map1/size","r");
fscanf(fs,"0x%0x", &mem_size_1);
fclose(fs);
fs = fopen ("/sys/class/uio/uio0/maps/map1/addr","r");
fscanf(fs,"0x%0x", &mem_addr_1);
fclose(fs);
I am stuck at this point. what will be the next step??
Thanks
Shivangi