Skip to content
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

add OpenAMP driver #83754

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

add OpenAMP driver #83754

wants to merge 3 commits into from

Conversation

mausys
Copy link
Contributor

@mausys mausys commented Jan 9, 2025

This pull request supersedes #79605. Only the RPMSG VirtIO-Device with the resource table is supported at the moment, but this is just a proof of concept.
The DTS for the rpmsg-virtio-device would look something like this:

chosen {. 
    ...
    openamp,resource-table = &rsc_tbl;
  };  
...
  mbox: mbox@40060000 {
...
  };

  vdev0vring0: memory@1400 {
    compatible= "zephyr,memory-region";
    zephyr,memory-region = "vdev0vring0";
    reg = <0x1400 0x2000>;
  };

  vdev0vring1: memory@3400 {
    compatible= "zephyr,memory-region";
    zephyr,memory-region = "vdev0vring1";
    reg = <0x3400 0x2000>;
  };

  vdev0buffer: memory@5400 {
    compatible= "zephyr,memory-region";
    zephyr,memory-region = "vdev0buffer";
    reg = <0x5400 0x8000>;
  };  

...

openamp {
    rsc_tbl: resource_table {
      compatible = "openamp,resource-table";
      carveouts = <&vdev0vring0 &vdev0vring1 &vdev0buffer>;
      vdevs = <&vdev0>;
    };

    vrings {
      #address-cells = <1>;
      #size-cells = <0>;

      vdev0_tx: vring@0 {
        compatible = "openamp,vring";
        #vring-cells = <0>;
        notify-id = <0>;
        memory-region = <&vdev0vring0>;
        num-buffers = <8>;
        mboxes = <&mbox 0>;
        reg = <0>;
      };

      vdev0_rx: vring@1 {
        compatible = "openamp,vring";
        #vring-cells = <0>;
        notify-id = <1>;
        memory-region = <&vdev0vring1>;
        num-buffers = <8>;
        mboxes = <&mbox 1>;
        reg = <1>;
      };
    };

    vdevs {
      #address-cells = <1>;
      #size-cells = <0>;

      vdev0: vdev@0 {
        compatible = "openamp,rpmsg-virtio-device";
        #address-cells = <1>;
        #size-cells = <0>;
        vrings = <&vdev0_tx &vdev0_rx>;
        vring-names = "tx", "rx";
        memory-region = <&vdev0buffer>;
        reg = <0>;
      };
    };
  };

Thoughts?

@JarmouniA JarmouniA added area: AMP Asymmetric Multi-processing (AMP) area: Open AMP labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: AMP Asymmetric Multi-processing (AMP) area: Open AMP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants