I don't have experience in Petalinux. I have Zynq ultrascale+ board and I want to use i2c on MIO40 and MIO41 pins. In the Vivado project I configured i2c on these pins. I want to have 4 slaves peripheral with address 0x49, 0x6d, 0x50, 0x19. Could someone help me with how to do it? I want to use the i2c cadence driver.
If you want to use directly through the userspace, you'll simply use the i2c-dev character device driver from Linux. There is a package of tools called "i2c-tools" as well that you can add to your PetaLinux image that makes it super easy to use this interface directly from the terminal.
If you want to use devices via their own kernel space device drivers (either existing drivers or you want to write your own), then you will need to add the individual devices as device tree children nodes of the i2c instance node you want to use.