Skip to contentSkip to conversation

arm-bsp/fvp-baser-aemv8r64: add support for virtio-9p

PATCH New Hugo L'Hostis 1 participant 1 message Jul 30, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm-bsp/fvp-baser-aemv8r64: add support for virtio-9p

This patch adds a device tree entry and kernel configs to enable file sharing between the host and the FVP using the virtio P9 device component.

Issue-Id: SCM-2299

Change-Id Icd757e3c6281e5e84985a3caac72e860a4aeee7f
---
 .../documentation/fvp-baser-aemv8r64.md        | 18 ++++++++++++++++++
 .../bsp/arm-platforms/fvp-baser-aemv8r64.scc   |  1 +
 .../bsp/arm-platforms/virtio-9p.cfg            |  4 ++++
 .../bsp/arm-platforms/virtio-9p.scc            |  1 +
 .../fvp-baser-aemv8r64/fvp-baser-aemv8r64.dts  |  6 ++++++
 5 files changed, 30 insertions(+)
 create mode 100644 meta-arm-bsp/recipes-kernel/linux/arm-platforms-kmeta/bsp/arm-platforms/virtio-9p.cfg
 create mode 100644 meta-arm-bsp/recipes-kernel/linux/arm-platforms-kmeta/bsp/arm-platforms/virtio-9p.scc
meta-arm-bsp/documentation/fvp-baser-aemv8r64.md +18 -0
index 53fdca7..166969c 100644
@@ -152,10 +152,28 @@ runfvp script:
 
  - Type ``ctrl+c`` and wait for kas process to finish.
 
+### File sharing between host and fvp
+It is possible to share a directory between the host machine and the fvp using
+the virtio P9 device component included in the kernel. To do so, create a
+directory to be mounted from the host machine:
+
+    mkdir /path/to/host-mount-dir
+
+Then, add the following parameter containing the path to the directory when
+launching the model:
+
+    --parameter 'bp.virtiop9device.root_path=/path/to/host-mount-dir'
+
+Once you are logged into the fvp, the host directory can be mounted in a
+directory on the model using the following command:
+
+    mount -t 9p -o trans=virtio,version=9p2000.L FM /path/to/fvp-mount-dir
+
 Devices supported in the kernel
 -------------------------------
 
 - serial
+- virtio 9p
 - virtio disk
 - virtio network
 - watchdog
meta-arm-bsp/recipes-kernel/linux/arm-platforms-kmeta/bsp/arm-platforms/fvp-baser-aemv8r64.scc +1 -0
index accf146..a8d7967 100644
@@ -1,3 +1,4 @@
 kconf hardware arm64.cfg
 kconf hardware fvp-common-peripherals.cfg
 include cfg/virtio.scc
+include virtio-9p.scc
meta-arm-bsp/recipes-kernel/linux/arm-platforms-kmeta/bsp/arm-platforms/virtio-9p.cfg new file +4 -0
new file mode 100644
index 0000000..c9fefa1
@@ -0,0 +1,4 @@
+CONFIG_NET_9P=y
+CONFIG_NET_9P_VIRTIO=y
+CONFIG_9P_FS=y
+CONFIG_9P_FS_POSIX_ACL=y
meta-arm-bsp/recipes-kernel/linux/arm-platforms-kmeta/bsp/arm-platforms/virtio-9p.scc new file +1 -0
new file mode 100644
index 0000000..33c0465
@@ -0,0 +1 @@
+kconf non-hardware virtio-9p.cfg
meta-arm-bsp/recipes-kernel/linux/files/fvp-baser-aemv8r64/fvp-baser-aemv8r64.dts +6 -0
index 3e552f8..dfc6f7e 100644
@@ -163,6 +163,12 @@
                 interrupts = <0x0 42 0x4>;
         };
 
+        virtio-p9@9c140000{
+                compatible = "virtio,mmio";
+                reg = <0x0 0x9c140000 0x0 0x1000>;
+                interrupts = <0x0 43 0x4>;
+        };
+
         virtio-net@9c150000 {
                 compatible = "virtio,mmio";
                 reg = <0 0x9c150000 0 0x200>;
Signature · 1 line
2.25.1