diff --git a/qcom/Makefile b/qcom/Makefile index e7fa5825..be4cf248 100644 --- a/qcom/Makefile +++ b/qcom/Makefile @@ -210,6 +210,30 @@ dtb-y += $(sun_tuivm-dtb-y) endif endif +ifeq ($(CONFIG_ARCH_TUNA), y) +ifeq ($(CONFIG_ARCH_QTI_VM), y) +tuna_tuivm-dtb-$(CONFIG_ARCH_QTI_VM) += tuna-vm-rumi.dtb \ + tuna-vm-atp.dtb \ + tuna-vm-cdp.dtb \ + tuna-vm-mtp.dtb \ + tuna-vm-mtp-kiwi.dtb \ + tuna-vm-mtp-qmp1000.dtb \ + tuna-vm-qrd.dtb \ + tuna-vm-rcm.dtb \ + tuna-vm-rcm-kiwi.dtb \ + tuna-oemvm-rumi.dtb \ + tuna-oemvm-atp.dtb \ + tuna-oemvm-cdp.dtb \ + tuna-oemvm-mtp.dtb \ + tuna-oemvm-mtp-kiwi.dtb \ + tuna-oemvm-mtp-qmp1000.dtb \ + tuna-oemvm-qrd.dtb \ + tuna-oemvm-rcm.dtb \ + tuna-oemvm-rcm-kiwi.dtb +dtb-y += $(tuna_tuivm-dtb-y) +endif +endif + MONACO_BASE_DTB += monaco.dtb monacop.dtb MONACO_BOARDS += \ diff --git a/qcom/platform_map.bzl b/qcom/platform_map.bzl index 8f1c6ddb..74b784bc 100644 --- a/qcom/platform_map.bzl +++ b/qcom/platform_map.bzl @@ -142,6 +142,7 @@ _platform_map = { {"name": "sunp-vm-hdk.dtb"}, {"name": "sun-vm-rumi.dtb"}, ], + "binary_compatible_with": ["tuna-tuivm"], }, "sun-oemvm": { "dtb_list": [ @@ -161,6 +162,53 @@ _platform_map = { {"name": "sunp-vm-hdk.dtb"}, {"name": "sun-vm-rumi.dtb"}, ], + "binary_compatible_with": ["tuna-oemvm"], + }, + "tuna-tuivm": { + "dtb_list": [ + # keep sorted + {"name": "tuna-oemvm-atp.dtb"}, + {"name": "tuna-oemvm-cdp.dtb"}, + {"name": "tuna-oemvm-mtp.dtb"}, + {"name": "tuna-oemvm-mtp-kiwi.dtb"}, + {"name": "tuna-oemvm-mtp-qmp1000.dtb"}, + {"name": "tuna-oemvm-qrd.dtb"}, + {"name": "tuna-oemvm-rcm.dtb"}, + {"name": "tuna-oemvm-rcm-kiwi.dtb"}, + {"name": "tuna-oemvm-rumi.dtb"}, + {"name": "tuna-vm-atp.dtb"}, + {"name": "tuna-vm-cdp.dtb"}, + {"name": "tuna-vm-mtp.dtb"}, + {"name": "tuna-vm-mtp-kiwi.dtb"}, + {"name": "tuna-vm-mtp-qmp1000.dtb"}, + {"name": "tuna-vm-qrd.dtb"}, + {"name": "tuna-vm-rcm.dtb"}, + {"name": "tuna-vm-rcm-kiwi.dtb"}, + {"name": "tuna-vm-rumi.dtb"}, + ], + }, + "tuna-oemvm": { + "dtb_list": [ + # keep sorted + {"name": "tuna-oemvm-atp.dtb"}, + {"name": "tuna-oemvm-cdp.dtb"}, + {"name": "tuna-oemvm-mtp.dtb"}, + {"name": "tuna-oemvm-mtp-kiwi.dtb"}, + {"name": "tuna-oemvm-mtp-qmp1000.dtb"}, + {"name": "tuna-oemvm-qrd.dtb"}, + {"name": "tuna-oemvm-rcm.dtb"}, + {"name": "tuna-oemvm-rcm-kiwi.dtb"}, + {"name": "tuna-oemvm-rumi.dtb"}, + {"name": "tuna-vm-atp.dtb"}, + {"name": "tuna-vm-cdp.dtb"}, + {"name": "tuna-vm-mtp.dtb"}, + {"name": "tuna-vm-mtp-kiwi.dtb"}, + {"name": "tuna-vm-mtp-qmp1000.dtb"}, + {"name": "tuna-vm-qrd.dtb"}, + {"name": "tuna-vm-rcm.dtb"}, + {"name": "tuna-vm-rcm-kiwi.dtb"}, + {"name": "tuna-vm-rumi.dtb"}, + ], }, "pineapple": { "dtb_list": [ diff --git a/qcom/tuna-oemvm-atp.dts b/qcom/tuna-oemvm-atp.dts new file mode 100644 index 00000000..30c71167 --- /dev/null +++ b/qcom/tuna-oemvm-atp.dts @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "tuna-oemvm.dtsi" +#include "tuna-oemvm-atp.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna OEMVM ATP"; + compatible = "qcom,tuna-atp", "qcom,tuna", "qcom,tunap-atp", "qcom,tunap", + "qcom,atp"; + + qcom,board-id = <33 0>; +}; diff --git a/qcom/tuna-oemvm-atp.dtsi b/qcom/tuna-oemvm-atp.dtsi new file mode 100644 index 00000000..1510613d --- /dev/null +++ b/qcom/tuna-oemvm-atp.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&soc { +}; diff --git a/qcom/tuna-oemvm-cdp.dts b/qcom/tuna-oemvm-cdp.dts new file mode 100644 index 00000000..66a89247 --- /dev/null +++ b/qcom/tuna-oemvm-cdp.dts @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "tuna-oemvm.dtsi" +#include "tuna-oemvm-cdp.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna OEMVM CDP"; + compatible = "qcom,tuna-cdp", "qcom,tuna", "qcom,tunap-cdp", "qcom,tunap", + "qcom,cdp"; + + qcom,board-id = <1 0>; +}; diff --git a/qcom/tuna-oemvm-cdp.dtsi b/qcom/tuna-oemvm-cdp.dtsi new file mode 100644 index 00000000..1510613d --- /dev/null +++ b/qcom/tuna-oemvm-cdp.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&soc { +}; diff --git a/qcom/tuna-oemvm-mtp-kiwi.dts b/qcom/tuna-oemvm-mtp-kiwi.dts new file mode 100644 index 00000000..262ca733 --- /dev/null +++ b/qcom/tuna-oemvm-mtp-kiwi.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "tuna-oemvm.dtsi" +#include "tuna-oemvm-mtp-kiwi.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna OEMVM MTP + kiwi WLAN"; + compatible = "qcom,tuna-mtp", "qcom,tuna", "qcom,tunap-mtp", "qcom,tunap", + "qcom,mtp"; + qcom,board-id = <8 2>; +}; diff --git a/qcom/tuna-oemvm-mtp-kiwi.dtsi b/qcom/tuna-oemvm-mtp-kiwi.dtsi new file mode 100644 index 00000000..1510613d --- /dev/null +++ b/qcom/tuna-oemvm-mtp-kiwi.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&soc { +}; diff --git a/qcom/tuna-oemvm-mtp-qmp1000.dts b/qcom/tuna-oemvm-mtp-qmp1000.dts new file mode 100644 index 00000000..76a8ba06 --- /dev/null +++ b/qcom/tuna-oemvm-mtp-qmp1000.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "tuna-oemvm.dtsi" +#include "tuna-oemvm-mtp-qmp1000.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna OEMVM MTP QMP1000"; + compatible = "qcom,tuna-mtp", "qcom,tuna", "qcom,tunap-mtp", "qcom,tunap", + "qcom,mtp"; + qcom,board-id = <8 1>; +}; diff --git a/qcom/tuna-oemvm-mtp-qmp1000.dtsi b/qcom/tuna-oemvm-mtp-qmp1000.dtsi new file mode 100644 index 00000000..1510613d --- /dev/null +++ b/qcom/tuna-oemvm-mtp-qmp1000.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&soc { +}; diff --git a/qcom/tuna-oemvm-mtp.dts b/qcom/tuna-oemvm-mtp.dts new file mode 100644 index 00000000..76d8cfa0 --- /dev/null +++ b/qcom/tuna-oemvm-mtp.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "tuna-oemvm.dtsi" +#include "tuna-oemvm-mtp.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna OEMVM MTP"; + compatible = "qcom,tuna-mtp", "qcom,tuna", "qcom,tunap-mtp", "qcom,tunap", + "qcom,mtp"; + qcom,board-id = <8 0>; +}; diff --git a/qcom/tuna-oemvm-mtp.dtsi b/qcom/tuna-oemvm-mtp.dtsi new file mode 100644 index 00000000..1510613d --- /dev/null +++ b/qcom/tuna-oemvm-mtp.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&soc { +}; diff --git a/qcom/tuna-oemvm-qrd.dts b/qcom/tuna-oemvm-qrd.dts new file mode 100644 index 00000000..2fc3c353 --- /dev/null +++ b/qcom/tuna-oemvm-qrd.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "tuna-oemvm.dtsi" +#include "tuna-oemvm-qrd.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna OEMVM QRD"; + compatible = "qcom,tuna-qrd", "qcom,tuna", "qcom,tunap-qrd", "qcom,tunap", + "qcom,qrd"; + qcom,board-id = <11 0>; +}; diff --git a/qcom/tuna-oemvm-qrd.dtsi b/qcom/tuna-oemvm-qrd.dtsi new file mode 100644 index 00000000..1510613d --- /dev/null +++ b/qcom/tuna-oemvm-qrd.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&soc { +}; diff --git a/qcom/tuna-oemvm-rcm-kiwi.dts b/qcom/tuna-oemvm-rcm-kiwi.dts new file mode 100644 index 00000000..fda57bf8 --- /dev/null +++ b/qcom/tuna-oemvm-rcm-kiwi.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "tuna-oemvm.dtsi" +#include "tuna-oemvm-rcm-kiwi.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna OEMVM RCM + kiwi WLAN"; + compatible = "qcom,tuna-rcm", "qcom,tuna", "qcom,tunap-rcm", "qcom,tunap", + "qcom,rcm"; + qcom,board-id = <21 1>; +}; diff --git a/qcom/tuna-oemvm-rcm-kiwi.dtsi b/qcom/tuna-oemvm-rcm-kiwi.dtsi new file mode 100644 index 00000000..1510613d --- /dev/null +++ b/qcom/tuna-oemvm-rcm-kiwi.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&soc { +}; diff --git a/qcom/tuna-oemvm-rcm.dts b/qcom/tuna-oemvm-rcm.dts new file mode 100644 index 00000000..07298e6a --- /dev/null +++ b/qcom/tuna-oemvm-rcm.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "tuna-oemvm.dtsi" +#include "tuna-oemvm-rcm.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna OEMVM RCM"; + compatible = "qcom,tuna-rcm", "qcom,tuna", "qcom,tunap-rcm", "qcom,tunap", + "qcom,rcm"; + qcom,board-id = <21 0>; +}; diff --git a/qcom/tuna-oemvm-rcm.dtsi b/qcom/tuna-oemvm-rcm.dtsi new file mode 100644 index 00000000..1510613d --- /dev/null +++ b/qcom/tuna-oemvm-rcm.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&soc { +}; diff --git a/qcom/tuna-oemvm-rumi.dts b/qcom/tuna-oemvm-rumi.dts new file mode 100644 index 00000000..e4658658 --- /dev/null +++ b/qcom/tuna-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 "tuna-oemvm.dtsi" +#include "tuna-oemvm-rumi.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna OEMVM RUMI"; + compatible = "qcom,tuna-rumi", "qcom,tuna", "qcom,rumi"; + qcom,board-id = <15 0>; +}; diff --git a/qcom/tuna-oemvm-rumi.dtsi b/qcom/tuna-oemvm-rumi.dtsi new file mode 100644 index 00000000..7cb42305 --- /dev/null +++ b/qcom/tuna-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/tuna-oemvm.dtsi b/qcom/tuna-oemvm.dtsi new file mode 100644 index 00000000..3bbe6c32 --- /dev/null +++ b/qcom/tuna-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 = <655 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 = <0x5 0x6>; + 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/tuna-vm-atp.dts b/qcom/tuna-vm-atp.dts new file mode 100644 index 00000000..f2552821 --- /dev/null +++ b/qcom/tuna-vm-atp.dts @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "tuna-vm.dtsi" +#include "tuna-vm-atp.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna SVM ATP"; + compatible = "qcom,tuna-atp", "qcom,tuna", "qcom,tunap-atp", "qcom,tunap", + "qcom,atp"; + + qcom,board-id = <33 0>; +}; diff --git a/qcom/tuna-vm-atp.dtsi b/qcom/tuna-vm-atp.dtsi new file mode 100644 index 00000000..1510613d --- /dev/null +++ b/qcom/tuna-vm-atp.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&soc { +}; diff --git a/qcom/tuna-vm-cdp.dts b/qcom/tuna-vm-cdp.dts new file mode 100644 index 00000000..c1918910 --- /dev/null +++ b/qcom/tuna-vm-cdp.dts @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "tuna-vm.dtsi" +#include "tuna-vm-cdp.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna SVM CDP"; + compatible = "qcom,tuna-cdp", "qcom,tuna", "qcom,tunap-cdp", "qcom,tunap", + "qcom,cdp"; + + qcom,board-id = <1 0>; +}; diff --git a/qcom/tuna-vm-cdp.dtsi b/qcom/tuna-vm-cdp.dtsi new file mode 100644 index 00000000..1510613d --- /dev/null +++ b/qcom/tuna-vm-cdp.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&soc { +}; diff --git a/qcom/tuna-vm-mtp-kiwi.dts b/qcom/tuna-vm-mtp-kiwi.dts new file mode 100644 index 00000000..b7e8fbfe --- /dev/null +++ b/qcom/tuna-vm-mtp-kiwi.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "tuna-vm.dtsi" +#include "tuna-vm-mtp-kiwi.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna SVM MTP + kiwi WLAN"; + compatible = "qcom,tuna-mtp", "qcom,tuna", "qcom,tunap-mtp", "qcom,tunap", + "qcom,mtp"; + qcom,board-id = <8 2>; +}; diff --git a/qcom/tuna-vm-mtp-kiwi.dtsi b/qcom/tuna-vm-mtp-kiwi.dtsi new file mode 100644 index 00000000..1510613d --- /dev/null +++ b/qcom/tuna-vm-mtp-kiwi.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&soc { +}; diff --git a/qcom/tuna-vm-mtp-qmp1000.dts b/qcom/tuna-vm-mtp-qmp1000.dts new file mode 100644 index 00000000..c4a703c7 --- /dev/null +++ b/qcom/tuna-vm-mtp-qmp1000.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "tuna-vm.dtsi" +#include "tuna-vm-mtp-qmp1000.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna SVM MTP QMP1000"; + compatible = "qcom,tuna-mtp", "qcom,tuna", "qcom,tunap-mtp", "qcom,tunap", + "qcom,mtp"; + qcom,board-id = <8 1>; +}; diff --git a/qcom/tuna-vm-mtp-qmp1000.dtsi b/qcom/tuna-vm-mtp-qmp1000.dtsi new file mode 100644 index 00000000..1510613d --- /dev/null +++ b/qcom/tuna-vm-mtp-qmp1000.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&soc { +}; diff --git a/qcom/tuna-vm-mtp.dts b/qcom/tuna-vm-mtp.dts new file mode 100644 index 00000000..d9c1e35b --- /dev/null +++ b/qcom/tuna-vm-mtp.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "tuna-vm.dtsi" +#include "tuna-vm-mtp.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna SVM MTP"; + compatible = "qcom,tuna-mtp", "qcom,tuna", "qcom,tunap-mtp", "qcom,tunap", + "qcom,mtp"; + qcom,board-id = <8 0>; +}; diff --git a/qcom/tuna-vm-mtp.dtsi b/qcom/tuna-vm-mtp.dtsi new file mode 100644 index 00000000..1510613d --- /dev/null +++ b/qcom/tuna-vm-mtp.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&soc { +}; diff --git a/qcom/tuna-vm-qrd.dts b/qcom/tuna-vm-qrd.dts new file mode 100644 index 00000000..e6393401 --- /dev/null +++ b/qcom/tuna-vm-qrd.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "tuna-vm.dtsi" +#include "tuna-vm-qrd.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna SVM QRD"; + compatible = "qcom,tuna-qrd", "qcom,tuna", "qcom,tunap-qrd", "qcom,tunap", + "qcom,qrd"; + qcom,board-id = <11 0>; +}; diff --git a/qcom/tuna-vm-qrd.dtsi b/qcom/tuna-vm-qrd.dtsi new file mode 100644 index 00000000..1510613d --- /dev/null +++ b/qcom/tuna-vm-qrd.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&soc { +}; diff --git a/qcom/tuna-vm-rcm-kiwi.dts b/qcom/tuna-vm-rcm-kiwi.dts new file mode 100644 index 00000000..e71f799e --- /dev/null +++ b/qcom/tuna-vm-rcm-kiwi.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "tuna-vm.dtsi" +#include "tuna-vm-rcm-kiwi.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna SVM RCM + kiwi WLAN"; + compatible = "qcom,tuna-rcm", "qcom,tuna", "qcom,tunap-rcm", "qcom,tunap", + "qcom,rcm"; + qcom,board-id = <21 1>; +}; diff --git a/qcom/tuna-vm-rcm-kiwi.dtsi b/qcom/tuna-vm-rcm-kiwi.dtsi new file mode 100644 index 00000000..1510613d --- /dev/null +++ b/qcom/tuna-vm-rcm-kiwi.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&soc { +}; diff --git a/qcom/tuna-vm-rcm.dts b/qcom/tuna-vm-rcm.dts new file mode 100644 index 00000000..e550df1c --- /dev/null +++ b/qcom/tuna-vm-rcm.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/dts-v1/; + +#include "tuna-vm.dtsi" +#include "tuna-vm-rcm.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna SVM RCM"; + compatible = "qcom,tuna-rcm", "qcom,tuna", "qcom,tunap-rcm", "qcom,tunap", + "qcom,rcm"; + qcom,board-id = <21 0>; +}; diff --git a/qcom/tuna-vm-rcm.dtsi b/qcom/tuna-vm-rcm.dtsi new file mode 100644 index 00000000..1510613d --- /dev/null +++ b/qcom/tuna-vm-rcm.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +&soc { +}; diff --git a/qcom/tuna-vm-rumi.dts b/qcom/tuna-vm-rumi.dts new file mode 100644 index 00000000..a15beab4 --- /dev/null +++ b/qcom/tuna-vm-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 "tuna-vm.dtsi" +#include "tuna-vm-rumi.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Tuna SVM RUMI"; + compatible = "qcom,tuna-rumi", "qcom,tuna", "qcom,rumi"; + qcom,board-id = <15 0>; +}; diff --git a/qcom/tuna-vm-rumi.dtsi b/qcom/tuna-vm-rumi.dtsi new file mode 100644 index 00000000..7cb42305 --- /dev/null +++ b/qcom/tuna-vm-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/tuna-vm.dtsi b/qcom/tuna-vm.dtsi new file mode 100644 index 00000000..12ededd4 --- /dev/null +++ b/qcom/tuna-vm.dtsi @@ -0,0 +1,246 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#include +#include + +/ { + #address-cells = <0x2>; + #size-cells = <0x2>; + qcom,msm-id = <681 0x10000>, <655 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,trustedvm"; + qcom,pasid = <0x0 0x1c>; + qcom,qtee-config-info = "p=3,9,C,39,77,78,7C,8F,96,97,C8,FE,10C,11B,159,199,47E,7F1,CDF;"; + qcom,secdomain-ids = <45>; + qcom,primary-vm-index = <0>; + vm-uri = "vmuid/trusted-ui"; + vm-guid = "598085da-c516-5b25-a9c1-927a02819770"; + qcom,sensitive; + + vm-attrs = "context-dump", "crash-restart"; + + /* For LEVM por usecases is QUP1_SE4 and QUP2_SE7. + * QUP1_SE4: GPII5 : IRQ_316 + * QUP2_SE7: GPII5 : IRQ_625 + */ + gic-irq-ranges = <316 316 + 625 625 /* PVM->SVM IRQ transfer */ + 279 279>; + + 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 = <0x5 0x6>; + 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 = <0x11>; //for persist.img + #address-cells = <0x2>; + base = <0x0 0xDA6F8000>; + }; + }; + + 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 = <0x10>; //for system.img + #address-cells = <0x2>; + base = <0x0 0xDA6FC000>; + }; + }; + + virtio-mmio@2 { + vdevice-type = "virtio-mmio"; + patch = "/soc/virtio-mmio"; + peer-default; + vqs-num = <0x3>; + push-compatible = "virtio,mmio"; + dma-coherent; + dma_base = <0x0 0x8000>; + memory { + qcom,label = <0x15>; //for virtio-vsock + #address-cells = <0x2>; + base = <0x0 0xDA700000>; + }; + }; + + swiotlb-shm { + vdevice-type = "shm"; + generate = "/swiotlb"; + push-compatible = "swiotlb"; + peer-default; + dma_base = <0x0 0x14000>; + memory { + qcom,label = <0x12>; + #address-cells = <0x2>; + base = <0x0 0xDA70c000>; + }; + }; + + vrtc { + vdevice-type = "vrtc-pl031"; + peer-default; + allocate-base; + }; + + }; + }; + + firmware: firmware { + qcom_scm: qcom_scm { + compatible = "qcom,scm"; + }; + }; + + soc: soc { }; +}; + +&soc { + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0xffffffff>; + compatible = "simple-bus"; + + virtio-mmio { + wakeup-source; + }; + + 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 = <64>; + qcom,support-hypervisor; + }; +};