From 855c427c2db649d7a7a3f41402982b32c530f15a Mon Sep 17 00:00:00 2001 From: Ashish Bhimanpalliwar Date: Wed, 15 Dec 2021 13:40:17 +0530 Subject: [PATCH 1/2] ARM: dts: qcom: Add oemvm support to Waipio Kernel Platform Add oemvm support to Waipio Kernel Platform. Change-Id: I6ed3b3af097d6f1c84c30195b4551f2175774add --- qcom/Makefile | 6 +- qcom/waipio-oemvm-cdp.dts | 10 +++ qcom/waipio-oemvm-cdp.dtsi | 2 + qcom/waipio-oemvm-mtp.dts | 10 +++ qcom/waipio-oemvm-mtp.dtsi | 2 + qcom/waipio-oemvm-qrd.dts | 10 +++ qcom/waipio-oemvm-qrd.dtsi | 2 + qcom/waipio-oemvm-rumi.dts | 10 +++ qcom/waipio-oemvm-rumi.dtsi | 3 + qcom/waipio-oemvm.dtsi | 142 ++++++++++++++++++++++++++++++++++++ qcom/waipio.dtsi | 8 ++ 11 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 qcom/waipio-oemvm-cdp.dts create mode 100644 qcom/waipio-oemvm-cdp.dtsi create mode 100644 qcom/waipio-oemvm-mtp.dts create mode 100644 qcom/waipio-oemvm-mtp.dtsi create mode 100644 qcom/waipio-oemvm-qrd.dts create mode 100644 qcom/waipio-oemvm-qrd.dtsi create mode 100644 qcom/waipio-oemvm-rumi.dts create mode 100644 qcom/waipio-oemvm-rumi.dtsi create mode 100644 qcom/waipio-oemvm.dtsi diff --git a/qcom/Makefile b/qcom/Makefile index c7023ae9..c656730a 100644 --- a/qcom/Makefile +++ b/qcom/Makefile @@ -114,7 +114,11 @@ ifeq ($(CONFIG_ARCH_QTI_VM), y) waipio_tuivm-dtb-$(CONFIG_ARCH_QTI_VM) += waipio-vm-mtp.dtb \ waipio-vm-cdp.dtb \ waipio-vm-qrd.dtb \ - waipio-vm-rumi.dtb + waipio-vm-rumi.dtb \ + waipio-oemvm-cdp.dtb \ + waipio-oemvm-mtp.dtb \ + waipio-oemvm-qrd.dtb \ + waipio-oemvm-rumi.dtb dtb-y += $(waipio_tuivm-dtb-y) endif endif diff --git a/qcom/waipio-oemvm-cdp.dts b/qcom/waipio-oemvm-cdp.dts new file mode 100644 index 00000000..6a6b4a8e --- /dev/null +++ b/qcom/waipio-oemvm-cdp.dts @@ -0,0 +1,10 @@ +/dts-v1/; + +#include "waipio-oemvm.dtsi" +#include "waipio-oemvm-cdp.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Waipio OEMVM CDP"; + compatible = "qcom,waipio-cdp", "qcom,waipio", "qcom,cdp"; + qcom,board-id = <0x10001 0>; +}; diff --git a/qcom/waipio-oemvm-cdp.dtsi b/qcom/waipio-oemvm-cdp.dtsi new file mode 100644 index 00000000..17f1e228 --- /dev/null +++ b/qcom/waipio-oemvm-cdp.dtsi @@ -0,0 +1,2 @@ +&soc { +}; diff --git a/qcom/waipio-oemvm-mtp.dts b/qcom/waipio-oemvm-mtp.dts new file mode 100644 index 00000000..59e9962d --- /dev/null +++ b/qcom/waipio-oemvm-mtp.dts @@ -0,0 +1,10 @@ +/dts-v1/; + +#include "waipio-oemvm.dtsi" +#include "waipio-oemvm-mtp.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Waipio OEMVM MTP"; + compatible = "qcom,waipio-mtp", "qcom,waipio", "qcom,mtp"; + qcom,board-id = <0x10008 0>; +}; diff --git a/qcom/waipio-oemvm-mtp.dtsi b/qcom/waipio-oemvm-mtp.dtsi new file mode 100644 index 00000000..17f1e228 --- /dev/null +++ b/qcom/waipio-oemvm-mtp.dtsi @@ -0,0 +1,2 @@ +&soc { +}; diff --git a/qcom/waipio-oemvm-qrd.dts b/qcom/waipio-oemvm-qrd.dts new file mode 100644 index 00000000..6b99a056 --- /dev/null +++ b/qcom/waipio-oemvm-qrd.dts @@ -0,0 +1,10 @@ +/dts-v1/; + +#include "waipio-oemvm.dtsi" +#include "waipio-oemvm-qrd.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Waipio OEMVM QRD"; + compatible = "qcom,waipio-qrd", "qcom,waipio", "qcom,qrd"; + qcom,board-id = <0x1000B 0>; +}; diff --git a/qcom/waipio-oemvm-qrd.dtsi b/qcom/waipio-oemvm-qrd.dtsi new file mode 100644 index 00000000..17f1e228 --- /dev/null +++ b/qcom/waipio-oemvm-qrd.dtsi @@ -0,0 +1,2 @@ +&soc { +}; diff --git a/qcom/waipio-oemvm-rumi.dts b/qcom/waipio-oemvm-rumi.dts new file mode 100644 index 00000000..fe529e81 --- /dev/null +++ b/qcom/waipio-oemvm-rumi.dts @@ -0,0 +1,10 @@ +/dts-v1/; + +#include "waipio-oemvm.dtsi" +#include "waipio-oemvm-rumi.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Waipio SVM RUMI"; + compatible = "qcom,waipio-rumi", "qcom,waipio", "qcom,rumi"; + qcom,board-id = <15 0>; +}; diff --git a/qcom/waipio-oemvm-rumi.dtsi b/qcom/waipio-oemvm-rumi.dtsi new file mode 100644 index 00000000..2cf87a3d --- /dev/null +++ b/qcom/waipio-oemvm-rumi.dtsi @@ -0,0 +1,3 @@ +&arch_timer { + clock-frequency = <500000>; +}; diff --git a/qcom/waipio-oemvm.dtsi b/qcom/waipio-oemvm.dtsi new file mode 100644 index 00000000..7c8a5df3 --- /dev/null +++ b/qcom/waipio-oemvm.dtsi @@ -0,0 +1,142 @@ +#include +#include +#include + +/ { + #address-cells = <0x2>; + #size-cells = <0x2>; + qcom,msm-id = <457 0x10000>; + interrupt-parent = <&vgic>; + + chosen { + bootargs = "nokaslr log_buf_len=256K root=/dev/ram rw init=/init console=hvc0 loglevel=8"; + }; + + cpus { + #address-cells = <0x2>; + #size-cells = <0x0>; + + CPU0: cpu@0 { + compatible = "arm,armv8"; + reg = <0x0 0x0>; + device_type = "cpu"; + enable-method = "psci"; + cpu-idle-states = <&CPU_PWR_DWN + &CLUSTER_PWR_DWN>; + }; + + CPU1: cpu@100 { + compatible = "arm,armv8"; + reg = <0x0 0x100>; + device_type = "cpu"; + enable-method = "psci"; + cpu-idle-states = <&CPU_PWR_DWN + &CLUSTER_PWR_DWN>; + }; + }; + + idle-states { + CPU_PWR_DWN: c4 { /* Using Gold C4 latencies */ + compatible = "arm,idle-state"; + idle-state-name = "rail-pc"; + entry-latency-us = <369>; + exit-latency-us = <1502>; + min-residency-us = <4488>; + arm,psci-suspend-param = <0x40000004>; + local-timer-stop; + }; + + CLUSTER_PWR_DWN: d4 { /* C4+D4 */ + compatible = "arm,idle-state"; + idle-state-name = "l3-pc"; + entry-latency-us = <584>; + exit-latency-us = <2332>; + min-residency-us = <6118>; + arm,psci-suspend-param = <0x40000044>; + local-timer-stop; + }; + }; + + + qcom,vm-config { + compatible = "qcom,vm-1.0"; + vm-type = "aarch64-guest"; + boot-config = "fdt,unified"; + os-type = "linux"; + kernel-entry-segment = "kernel"; + kernel-entry-offset = <0x0 0x0>; + vendor = "QTI"; + image-name = "qcom,oemvm"; + qcom,pasid = <0x0 0x22>; + + memory { + #address-cells = <0x2>; + #size-cells = <0x0>; + base-address = <0x0 0xbb000000>; + size-min = <0x0 0x5000000>; /* 122 MB */ + }; + + segments { + ramdisk = <2>; /* 8MB */ + }; + + vcpus { + config = "/cpus"; + affinity = "static"; + affinity-map = <0x5 0x6>; + sched-priority = <0>; /* relative to PVM */ + sched-timeslice = <2000>; /* in ms */ + }; + + interrupts { + config = &vgic; + }; + + vdevices { + generate = "/hypervisor"; + rm-rpc { + vdevice-type = "rm-rpc"; + generate = "/hypervisor/qcom,resource-mgr"; + console-dev; + message-size = <0x000000f0>; + queue-depth = <0x00000008>; + qcom,label = <0x1>; + }; + }; + }; + + soc: soc { }; +}; + +&soc { + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0xffffffff>; + compatible = "simple-bus"; + + psci { + compatible = "arm,psci-1.0"; + method = "smc"; + }; + + vgic: interrupt-controller@17100000 { + compatible = "arm,gic-v3"; + interrupt-controller; + #interrupt-cells = <0x3>; + #redistributor-regions = <1>; + redistributor-stride = <0x0 0x40000>; + reg = <0x17100000 0x10000>, /* GICD */ + <0x17180000 0x100000>; /* GICR * 8 */ + }; + + arch_timer: timer { + compatible = "arm,armv8-timer"; + always-on; + interrupts = , + , + , + ; + clock-frequency = <19200000>; + }; + +}; diff --git a/qcom/waipio.dtsi b/qcom/waipio.dtsi index d6474089..5ab9bc6f 100644 --- a/qcom/waipio.dtsi +++ b/qcom/waipio.dtsi @@ -1221,6 +1221,14 @@ memory-region = <&cpusys_vm_mem>; }; + qcom,guestvm_loader@bb000000 { + compatible = "qcom,guestvm-loader"; + qcom,pas-id = <34>; + qcom,vmid = <49>; + qcom,firmware-name = "oemvm"; + memory-region = <&oem_vm_mem>; + }; + tlmm-vm-mem-access { compatible = "qcom,tlmm-vm-mem-access"; qcom,master; From e3e10703eea95e23d0a7c8a76145631ce534ac89 Mon Sep 17 00:00:00 2001 From: Ashish Bhimanpalliwar Date: Wed, 22 Dec 2021 10:11:25 +0530 Subject: [PATCH 2/2] ARM: dts: qcom: Add disk emulation support for kalama and WKP Add disk emulation support for kalama and Waipio Kernel Platform. Change-Id: If19ad2a7d7f4fbf1feb8b8bdc626dc1572e4e497 --- qcom/kalama-oemvm.dtsi | 38 ++++++++++++++++++++++++++++++++++++-- qcom/kalama.dtsi | 26 +++++++++++++++++++++++++- qcom/waipio-oemvm.dtsi | 36 +++++++++++++++++++++++++++++++++++- qcom/waipio.dtsi | 26 +++++++++++++++++++++++++- 4 files changed, 121 insertions(+), 5 deletions(-) diff --git a/qcom/kalama-oemvm.dtsi b/qcom/kalama-oemvm.dtsi index 88853815..e7753af4 100644 --- a/qcom/kalama-oemvm.dtsi +++ b/qcom/kalama-oemvm.dtsi @@ -12,6 +12,12 @@ bootargs = "nokaslr log_buf_len=256K root=/dev/ram rw init=/init console=hvc0 loglevel=8"; }; + reserved_memory: reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + }; + cpus { #address-cells = <0x2>; #size-cells = <0x0>; @@ -74,8 +80,8 @@ memory { #address-cells = <0x2>; #size-cells = <0x0>; - base-address = <0x0 0xf8000000>; - size-min = <0x0 0x5000000>; /* 80 MB */ + base-address = <0x0 0xf8200000>; + size-min = <0x0 0x4efc000>; /* 78 MB */ }; segments { @@ -104,6 +110,34 @@ queue-depth = <0x00000008>; qcom,label = <0x1>; }; + + virtio-mmio@0 { + vdevice-type = "virtio-mmio"; + generate = "/virtio-mmio"; + peer-default; + vqs-num = <0x1>; + push-compatible = "virtio,mmio"; + dma-coherent; + dma_base = <0x0 0x0>; + memory { + qcom,label = <0x13>; + #address-cells = <0x2>; + base = <0x0 0xFFEFC000>; + }; + }; + + swiotlb-shm { + vdevice-type = "shm"; + generate = "/swiotlb"; + push-compatible = "swiotlb"; + peer-default; + dma_base = <0x0 0x4000>; + memory { + qcom,label = <0x14>; + #address-cells = <0x2>; + base = <0x0 0xFFF00000>; + }; + }; }; }; diff --git a/qcom/kalama.dtsi b/qcom/kalama.dtsi index 7495311c..4b0a0702 100644 --- a/qcom/kalama.dtsi +++ b/qcom/kalama.dtsi @@ -565,7 +565,19 @@ oem_vm_mem: oem_vm_region@f8000000 { no-map; - reg = <0x0 0xf8000000 0x0 0x5000000>; + reg = <0x0 0xf8000000 0x0 0x4efc000>; + }; + + oem_vm_vblk0_ring: oem_vm_vblk0_ring@fcefc000 { + no-map; + reg = <0x0 0xfcefc000 0x0 0x4000>; + gunyah-label = <0x13>; + }; + + oem_vm_swiotlb: oem_vm_swiotlb@fcf00000 { + no-map; + reg = <0x0 0xfcf00000 0x0 0x100000>; + gunyah-label = <0x14>; }; hyp_ext_tags_mem: hyp_ext_tags_region@fd000000 { @@ -2940,12 +2952,24 @@ shared-buffers = <&trust_ui_vm_vblk0_ring &trust_ui_vm_swiotlb>; }; + oem_vm: qcom,oem_vm@fcefc000 { + reg = <0xfcefc000 0x104000>; + vm_name = "oemvm"; + shared-buffers = <&oem_vm_vblk0_ring &oem_vm_swiotlb>; + }; + qcom,virtio_backend@0 { compatible = "qcom,virtio_backend"; qcom,vm = <&trust_ui_vm>; qcom,label = <0x11>; }; + qcom,virtio_backend@1 { + compatible = "qcom,virtio_backend"; + qcom,vm = <&oem_vm>; + qcom,label = <0x13>; + }; + llcc_pmu: llcc-pmu@24095000 { compatible = "qcom,llcc-pmu-ver2"; reg = <0x24095000 0x300>; diff --git a/qcom/waipio-oemvm.dtsi b/qcom/waipio-oemvm.dtsi index 7c8a5df3..dcf55808 100644 --- a/qcom/waipio-oemvm.dtsi +++ b/qcom/waipio-oemvm.dtsi @@ -12,6 +12,12 @@ bootargs = "nokaslr log_buf_len=256K root=/dev/ram rw init=/init console=hvc0 loglevel=8"; }; + reserved_memory: reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + }; + cpus { #address-cells = <0x2>; #size-cells = <0x0>; @@ -73,7 +79,7 @@ #address-cells = <0x2>; #size-cells = <0x0>; base-address = <0x0 0xbb000000>; - size-min = <0x0 0x5000000>; /* 122 MB */ + size-min = <0x0 0x4efc000>; /* 78 MB */ }; segments { @@ -102,6 +108,34 @@ queue-depth = <0x00000008>; qcom,label = <0x1>; }; + + virtio-mmio@0 { + vdevice-type = "virtio-mmio"; + generate = "/virtio-mmio"; + peer-default; + vqs-num = <0x1>; + push-compatible = "virtio,mmio"; + dma-coherent; + dma_base = <0x0 0x0>; + memory { + qcom,label = <0x13>; + #address-cells = <0x2>; + base = <0x0 0xFFEFC000>; + }; + }; + + swiotlb-shm { + vdevice-type = "shm"; + generate = "/swiotlb"; + push-compatible = "swiotlb"; + peer-default; + dma_base = <0x0 0x4000>; + memory { + qcom,label = <0x14>; + #address-cells = <0x2>; + base = <0x0 0xFFF00000>; + }; + }; }; }; diff --git a/qcom/waipio.dtsi b/qcom/waipio.dtsi index 5ab9bc6f..d5bbb48c 100644 --- a/qcom/waipio.dtsi +++ b/qcom/waipio.dtsi @@ -498,7 +498,19 @@ oem_vm_mem: oem_vm_region@bb000000 { no-map; - reg = <0x0 0xbb000000 0x0 0x5000000>; + reg = <0x0 0xbb000000 0x0 0x4efc000>; + }; + + oem_vm_vblk0_ring: oem_vm_vblk0_ring@bfefc000 { + no-map; + reg = <0x0 0xbfefc000 0x0 0x4000>; + gunyah-label = <0x13>; + }; + + oem_vm_swiotlb: oem_vm_swiotlb@bff00000 { + no-map; + reg = <0x0 0xbff00000 0x0 0x100000>; + gunyah-label = <0x14>; }; mte_mem: mte_region@c0000000 { @@ -3355,12 +3367,24 @@ shared-buffers = <&trust_ui_vm_vblk0_ring &trust_ui_vm_swiotlb>; }; + oem_vm: qcom,oem_vm@bfefc000 { + reg = <0xbfefc000 0x104000>; + vm_name = "oemvm"; + shared-buffers = <&oem_vm_vblk0_ring &oem_vm_swiotlb>; + }; + qcom,virtio_backend@0 { compatible = "qcom,virtio_backend"; qcom,vm = <&trust_ui_vm>; qcom,label = <0x11>; }; + qcom,virtio_backend@1 { + compatible = "qcom,virtio_backend"; + qcom,vm = <&oem_vm>; + qcom,label = <0x13>; + }; + qcom,msm_gsi { compatible = "qcom,msm_gsi"; };