[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Xen Passthrough in ARM ZCU104


  • To: "xen-users@xxxxxxxxxxxxxxxxxxxx" <xen-users@xxxxxxxxxxxxxxxxxxxx>
  • From: "Luna Mejia, Maria Jose" <Maria.Jose.Luna.Mejia@xxxxxxxxxxxxxxxxx>
  • Date: Wed, 1 Feb 2023 16:27:46 +0000
  • Accept-language: en-US, de-DE
  • Delivery-date: Wed, 01 Feb 2023 16:28:51 +0000
  • Ironport-data: A9a23:u4RQ/a/eJ08rVaZbZiciDrUDSHiTJUtcMsCJ2f8bNWPcYEJGY0x3z 2JJCGDUMquMYGfwKopxb4iwpE8C75HRzNU3GwdoqihEQiMRo6IpJzg2wmQcn8+2BpeeJK6yx 5xGMrEsFOhtEjmG4E7F3oHJ9RFUzbuPSqf3FNnKMyVwQR4MYCo6gHqPocZg6mJTqYX/UlzlV e/a+ZWFYwf/g2csaAr41orawP9RlKSq0N8nlgFmDRx7lAe2v2UYCpsZOZawIxPQKmWDNrfnL wpr5OjRElLxp3/BOPv8+lrIWhFirorpAOS7oiE+t55OIvR1jndaPq4TbJLwYKrM4tmDt4gZJ N5l7fRcReq1V0HBsLx1bvVWL81xFYt60r/fPGSQi8qO9RTAbWvLwelCBXhjaOX0+s4vaY1P3 fEdKXUQchXawe+zwfS1SuYqislLwMvDZd5E/CA+i2GIS69+GPgvQI2SjTNc9DI5nMFHW/TZf MdfbSdpZVLFbh9OM38aDZN4kv2hm3//dDNVshSZqMLb5kCPlFQrjeK2a7I5fPSwZeNeoXi7v FmavGXAHA0qJYaZmByKpyfEaujn2HmTtJgpPK218Lt3m1CJ3UQXCQYKTh2rrP+hkEm8VtlDb UsO9UITQbMa8UWqSpz4QxTg+TiJux9aVcBZDus67w+A0OzY7m51G1Q5c9KIU/R+3OdeeNDg/ gHhcwrBVW034o6GA2mQ7KmVpj6UMC0YZz1KLywdQAdPp5GprIgvh1idBpxuAYykvO3TQDvQ+ jGtqDRhprMxic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P8gnECN9 6Eg4O90bra9LiIK5bEyD46Bz7kLVRSYPyp4TOp8+L8SV3TpEN1oNeNi92jqEi+VG8H3zA==
  • Ironport-hdrordr: A9a23:gV11/KodkIJnZ+1C4CNQab4aV5seL9V00zEX/kB9WHVpm5Oj+P xGzc526farslsssSkb6Kq90dq7MA7hHP9OkP4s1NKZMjUO11HYSr2KgbGSoAEIXheOjdK1tp 0QBZSWaueAdGSS5PySiGLTcrYdKZu8gdiVbI/lvjRQpGpRGsRdBnJCe2Gm+zpNNW177PQCZf ihDqkunUvkRZxJBf7LQUXsOoD41p/2vaOjRSRDKw8s6QGIgz/twqX9CQKk0hAXVC4K6as+8E De+jaJr5mLgrWe8FvxxmXT55NZlJ/K0d1YHvGBjcATN3HFlhuoXoJ8QLeP1QpF6N1HqWxa2+ UkkS1Qcvib2EmhMl1dZiGdlDUI5QxeoUMKD2Xoz0cL7/aJBQ7SQPAx+b6xOiGplHbIFusMkN MM44vejesSMfqIplWC2/HYEx5tjUa6unwkjKoaiGFeS5IXbPtLoZUY5149KuZ1IMvW0vFULA BVNrCo2B97SyLoU5mChBgf/DWFZAVCIiu7
  • Ironport-sdr: 63da9304_pgZ71hwYkA47A3VsxKWVWaN3T9L7zwCZHTTcrXY11uVviAI kWxUJzo1TR5UtbPD6SG4wyie5doxRGVk3AN2Qhg==
  • List-id: Xen user discussion <xen-users.lists.xenproject.org>
  • Thread-index: Adk2VzEVCvlgMc4EQ9qPdv3BpyxRww==
  • Thread-topic: Xen Passthrough in ARM ZCU104

I will give more information about my problem when trying to passthrough gpio.

 

On the Dom0 device tree I have added xen,passthrough to gpio@ff0a0000:

               gpio {

                              compatible = "xlnx,zynqmp-gpio-modepin";

                              gpio-controller;

                              #gpio-cells = <0x02>;

                              phandle = <0x20>;

                                             };

 

gpio@ff0a0000 {

               #gpio-cells = < 0x02 >;

               #interrupt-cells = < 0x02 >;

               clocks = < 0x03 0x1f >;

               compatible = "xlnx,zynqmp-gpio-1.0";

               emio-gpio-width = < 0x20 >;

               gpio-controller;

               gpio-mask-high = < 0x00 >;

               gpio-mask-low = < 0x5600 >;

               interrupt-controller;

               interrupt-parent = < 0x04 >;

               interrupts = < 0x00 0x10 0x04 >;

               phandle = < 0x14 >;

               power-domains = < 0x0c 0x2e >;

               reg = < 0x00 0xff0a0000 0x00 0x1000 >;

               status = "okay";

               xen,passthrough;

};

 

Then on the domU config file I put the following:

name = "guest"

# Rootfs and Image

kernel = "Image"

ramdisk = "rootfs.cpio.gz"

extra = "console=hvc0 rdinit=/sbin/init root=/dev/ram0"

memory = 800

vcpus = 1

vif=[ 'bridge=xenbr0' ]

 

dtdev = [ '/axi/gpio@ff0a0000' ]                # but I don’t know if it should be “/proc/device-tree/axi/gpio@ff0a0000” or if I should put this at all since I already put xen, passthrough before

device_tree = "partial_device_tree.dtb"

 

And the partial device_tree.dtb:

/dts-v1/;

/ {

    /* #*cells are here to keep DTC happy */

    #address-cells = <2>;

    #size-cells = <2>;

 

    passthrough {

        compatible = "simple-bus";

        ranges;

        #address-cells = <2>;

        #size-cells = <2>;

        gpio@ff0a0000 {

                                             #gpio-cells = < 0x02 >;

                                             #interrupt-cells = < 0x02 >;

                                             clocks = < 0x03 0x1f >;

                                             compatible = "xlnx,zynqmp-gpio-1.0";

                                             emio-gpio-width = < 0x20 >;

                                             gpio-controller;

                                             gpio-mask-high = < 0x00 >;

                                             gpio-mask-low = < 0x5600 >;

                                             interrupt-controller;

                                             interrupt-parent = < 0x04 >;

                                             interrupts = < 0x00 0x10 0x04 >;

                                             phandle = < 0x14 >;

                                             power-domains = < 0x0c 0x2e >;

                                             reg = < 0x00 0xff0a0000 0x00 0x1000 >;

                                             status = "okay";

                              };

    };

};

And when running “xl create -c guest.cfg” I get the following:

Parsing config from guest.cfg

libxl: error: libxl_create.c:1870:libxl__add_dtdevs: Domain 22:xc_assign_dtdevice failed: -1

libxl: error: libxl_create.c:1934:domcreate_attach_devices: Domain 22:unable to add none devices

libxl: error: libxl_domain.c:1183:libxl__destroy_domid: Domain 22:Non-existant domain

libxl: error: libxl_domain.c:1137:domain_destroy_callback: Domain 22:Unable to destroy guest

libxl: error: libxl_domain.c:1064:domain_destroy_cb: Domain 22:Destruction of domain failed

(XEN) XEN_DOMCTL_assign_dt_device: assign "/axi/gpio@ff0a0000" to dom22 failed (-22)

 

Since this error appears, if I take out the dtdev option in the guest.cfg file, then DomU boots and when I am in DomU, if I run the following, I get:

root@zcu104:~# ls /sys/class/gpio/

export       gpiochip508  unexport

root@zcu104:~# ls -l /sys/class/gpio/gpiochip508

lrwxrwxrwx    1 root     root             0 Feb  1 16:18 /sys/class/gpio/gpiochip508 -> ../../devices/platform/passthrough/passthrough:gpio/gpio/gpiochip508

root@zcu104:~# echo 416 > /sys/class/gpio/export

[  115.482333] export_store: invalid GPIO 416

-sh: echo: write error: Invalid argument

 

So I am not able to access pin 416, that I was able to access without the passthrough. Hope someone can help me.

 

>>Hello,

>> 

>>I have problems on implementing passthrough of devices in the ZCU104. I have tried to passthrough a gpio by configuring the device tree in dom0, or changing what is in the domU config file at the moment of creation. Can someone >>tell me what should I change in the device tree, what to add in the config file etc to be able to passthrough two gpios (for example 416 and 417) to my Linux domU? An example on how to do this would be really really helpful

>>For my domU I have an “Image” and a “rootfs.cpio.gz” that I created with Yocto. If more information is needed please let me know.

>> 

>>Regards,

>>Maria


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.