From 3a5024df85492ae09c99cce1d2590e0c7546964a Mon Sep 17 00:00:00 2001 From: Hrishabh Rajput Date: Mon, 14 Oct 2024 19:40:00 +0530 Subject: [PATCH] ARM: dts: msm: Add initial devicetree for Kera OEMVM Add initial devicetree files for OEMVM for RUMI platform on Kera SoC. Change-Id: I92019de68818c03dce6c93bba96902b071bb5785 Signed-off-by: Hrishabh Rajput --- qcom/Makefile | 3 +- qcom/kera-oemvm-rumi.dts | 15 +++ qcom/kera-oemvm-rumi.dtsi | 8 ++ qcom/kera-oemvm.dtsi | 218 ++++++++++++++++++++++++++++++++++++++ qcom/platform_map.bzl | 10 +- 5 files changed, 252 insertions(+), 2 deletions(-) create mode 100644 qcom/kera-oemvm-rumi.dts create mode 100644 qcom/kera-oemvm-rumi.dtsi create mode 100644 qcom/kera-oemvm.dtsi diff --git a/qcom/Makefile b/qcom/Makefile index 238d5ca7..bb164de8 100644 --- a/qcom/Makefile +++ b/qcom/Makefile @@ -237,7 +237,8 @@ endif ifeq ($(CONFIG_ARCH_KERA), y) ifeq ($(CONFIG_ARCH_QTI_VM), y) -kera_tuivm-dtb-$(CONFIG_ARCH_QTI_VM) += kera-vm-rumi.dtb +kera_tuivm-dtb-$(CONFIG_ARCH_QTI_VM) += kera-vm-rumi.dtb \ + kera-oemvm-rumi.dtb dtb-y += $(kera_tuivm-dtb-y) endif endif diff --git a/qcom/kera-oemvm-rumi.dts b/qcom/kera-oemvm-rumi.dts new file mode 100644 index 00000000..8d4a30b6 --- /dev/null +++ b/qcom/kera-oemvm-rumi.dts @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "kera-oemvm.dtsi" +#include "kera-oemvm-rumi.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Kera OEMVM RUMI"; + compatible = "qcom,kera-rumi", "qcom,kera", "qcom,rumi"; + qcom,board-id = <15 0>; +}; diff --git a/qcom/kera-oemvm-rumi.dtsi b/qcom/kera-oemvm-rumi.dtsi new file mode 100644 index 00000000..7cb42305 --- /dev/null +++ b/qcom/kera-oemvm-rumi.dtsi @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&arch_timer { + clock-frequency = <500000>; +}; diff --git a/qcom/kera-oemvm.dtsi b/qcom/kera-oemvm.dtsi new file mode 100644 index 00000000..cd6f0bf4 --- /dev/null +++ b/qcom/kera-oemvm.dtsi @@ -0,0 +1,218 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#include + +/ { + #address-cells = <0x2>; + #size-cells = <0x2>; + qcom,msm-id = <659 0x10000>; + interrupt-parent = <&vgic>; + + chosen { + bootargs = "nokaslr log_buf_len=256K console=hvc0 loglevel=8 swiotlb=noforce"; + }; + + 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 Medium C4 latencies */ + compatible = "arm,idle-state"; + status = "disabled"; + }; + + CLUSTER_PWR_DWN: ss3 { /* C4+CL5+SS3 */ + compatible = "arm,idle-state"; + status = "disabled"; + }; + }; + + 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>; + qcom,qtee-config-info = "p=3,9,39,7C,8F,97,159,7F1,CDF;"; + qcom,secdomain-ids = <49>; + qcom,primary-vm-index = <0>; + vm-uri = "vmuid/oemvm"; + vm-guid = "847bfe26-0b12-5728-812a-06103f6bdec0"; + qcom,sensitive; + + vm-attrs = "context-dump", "crash-restart"; + + memory { + #address-cells = <0x2>; + #size-cells = <0x0>; + /* + * IPA address linux image is loaded at. Must be within + * first 1GB due to memory hotplug requirement. + */ + base-address = <0x0 0x88800000 >; + }; + + segments { + config_cpio = <2>; + }; + + vcpus { + config = "/cpus"; + affinity = "proxy"; + affinity-map = <0x0 0x0>; + sched-priority = <0>; /* relative to PVM */ + sched-timeslice = <2000>; /* in ms */ + }; + + interrupts { + config = &vgic; + }; + + vdevices { + generate = "/hypervisor"; + + minidump { + vdevice-type = "minidump"; + push-compatible = "qcom,minidump_rm"; + minidump_allowed; + }; + + rm-rpc { + vdevice-type = "rm-rpc"; + generate = "/hypervisor/qcom,resource-mgr"; + console-dev; + message-size = <0x000000f0>; + 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 = <0x16>; //for persist.img + #address-cells = <0x2>; + base = <0x0 0xFFEFC000>; + }; + }; + + virtio-mmio@1 { + vdevice-type = "virtio-mmio"; + generate = "/virtio-mmio"; + peer-default; + vqs-num = <0x2>; + push-compatible = "virtio,mmio"; + dma-coherent; + dma_base = <0x0 0x4000>; + memory { + qcom,label = <0x13>; //for system.img + #address-cells = <0x2>; + base = <0x0 0xFFF00000>; + }; + }; + + swiotlb-shm { + vdevice-type = "shm"; + generate = "/swiotlb"; + push-compatible = "swiotlb"; + peer-default; + dma_base = <0x0 0x8000>; + memory { + qcom,label = <0x14>; + #address-cells = <0x2>; + base = <0x0 0xFFF04000>; + }; + }; + + vrtc { + vdevice-type = "vrtc-pl031"; + peer-default; + allocate-base; + }; + + }; + }; + + firmware: firmware { + qcom_scm: scm { + compatible = "qcom,scm"; + }; + }; + + 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 0x200000>; /* GICR * 8 */ + }; + + arch_timer: timer { + compatible = "arm,armv8-timer"; + always-on; + interrupts = , + , + , + ; + clock-frequency = <19200000>; + }; + + qcom_smcinvoke { + compatible = "qcom,smcinvoke"; + }; + + qtee_shmbridge { + compatible = "qcom,tee-shared-memory-bridge"; + qcom,custom-bridge-size = <512>; + qcom,support-hypervisor; + }; +}; diff --git a/qcom/platform_map.bzl b/qcom/platform_map.bzl index f47b15e6..a7f9db89 100644 --- a/qcom/platform_map.bzl +++ b/qcom/platform_map.bzl @@ -162,7 +162,7 @@ _platform_map = { {"name": "sunp-vm-hdk.dtb"}, {"name": "sun-vm-rumi.dtb"}, ], - "binary_compatible_with": ["tuna-oemvm"], + "binary_compatible_with": ["tuna-oemvm", "kera-oemvm"], }, "tuna-tuivm": { "dtb_list": [ @@ -213,6 +213,14 @@ _platform_map = { "kera-tuivm": { "dtb_list": [ # keep sorted + {"name": "kera-oemvm-rumi.dtb"}, + {"name": "kera-vm-rumi.dtb"}, + ], + }, + "kera-oemvm": { + "dtb_list": [ + # keep sorted + {"name": "kera-oemvm-rumi.dtb"}, {"name": "kera-vm-rumi.dtb"}, ], },