From patchwork Mon Apr 20 11:01:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 185578 Delivered-To: patch@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp3981986ilf; Mon, 20 Apr 2020 06:41:29 -0700 (PDT) X-Google-Smtp-Source: APiQypLbJO0LHGmWMjOguOTpCwi3hlGs8HAOlX26iiabeR3KRKR3AFcJ7Tz6bXrsEXGt60heGymD X-Received: by 2002:ac8:44aa:: with SMTP id a10mr16361500qto.230.1587390089106; Mon, 20 Apr 2020 06:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587390089; cv=none; d=google.com; s=arc-20160816; b=djMMX75qwcbdEaZP1piDrBruCNbHjlV50rUpFYUn+r6OMJH8xmnOO/1qXH4WVHKy1f v847yTjr5/UUjC4fPPcQe1yepNvj55T/5guPphLN537zCAm6Sh3B+PT4hGEz8vxf+8Tf lWNEluR8XeEZITE6UIztspEvibJ2/ljAGzzeB4UFZo43jomg35GZNzBkKNTxMy5IVmpE nAQW5UKU0hpPNhP+MFtUNnNa+hGtGjSPBQxxQLG+1mQJvv5FdkkaefNRK1N8LdtwPnoA MkV5ZLp/JpgItIVK/y005hfSIfUJDUTfxdPMyP1G2UDr8eld60z6ApVJ/0xWlBXl2U4t W2yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=90U7g6QRjcavx5MlRUxgpf0KQqMNtMFsmbd8Sg10FCw=; b=Cque9Pr9LHI01dk97U0qaGte5+P5KTJ579zIeFvzgCNu3HE2gS36qK2pnyMPzR9ZTH tWmAUikfaKSx4MGmPy1jyKNeTHXw5LFybQG/9y+tb+vHGJZKmFpxv9RjGz8HbGie6D2J OU3t6sek2KzRiJzb64sncYUK5uTRxlneyI8K1jEyOzxU/lJNmSZqaxEVCc96SIFGbtUo iIVMJY5Ee4YvooKfCAPRI5hQyJvBUkNh5kWM/xYVqbU3mHNC+ChQAHg1qIvVrVFw3v1V +5l9YdziSm7UZR+S1p2JibvgGCYgM2v1XdkBRc2g5yCeiFdK+TTjgBu3lFgG/xe5QFoL UU2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="em5P/SqA"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q15si568270qtf.321.2020.04.20.06.41.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Apr 2020 06:41:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="em5P/SqA"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQWfw-00005w-Fw for patch@linaro.org; Mon, 20 Apr 2020 09:41:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33214 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQUBI-0001LB-Ow for qemu-devel@nongnu.org; Mon, 20 Apr 2020 07:01:44 -0400 Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQUBG-000752-TB for qemu-devel@nongnu.org; Mon, 20 Apr 2020 07:01:39 -0400 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]:34092) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQUBG-00071s-Gs for qemu-devel@nongnu.org; Mon, 20 Apr 2020 07:01:38 -0400 Received: by mail-lj1-x243.google.com with SMTP id m8so9429821lji.1 for ; Mon, 20 Apr 2020 04:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=90U7g6QRjcavx5MlRUxgpf0KQqMNtMFsmbd8Sg10FCw=; b=em5P/SqA9R+M0f/miql+iu4JbomjBshXY/wqlfYil5vKPIecPGprogSfbVhNG9ZOxQ 1AAA/qW9Pho9CHp0WQfdplM2ky+agN0gsUdGnO3Y67dyuf44hTeMEep/1iXdZ310XysT WJIDmTQmtVCBT8+ezfolgS3NWnd+QkM6jJUjT8BLcMJXIAzOfQmjy2bUj3rRAJB4jbAR 8NmEwDX1NK0vF8vcQudoDf3OlYPMKEMN8EeR2jUuoK5d7GvcPlU4tIB2KobislyugVPp /LhhWBN1mNrX/FraDctEoD6lAbAWznlPSrBkmdSWINATgLfzwLO5R3+JmQrvoKS/IT5n Xy9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=90U7g6QRjcavx5MlRUxgpf0KQqMNtMFsmbd8Sg10FCw=; b=YpVhNlHC9bjsbskFjUHtKo9ve6udH+m1WNOW8LbJ+ScQsYTh7Vm2zy3LOiH3BdtTDA 3S67G9hIhf5f7Xax1xnZ1PG7gvXSU2lwGNgSsrIl9CiJrOcIrwnnY7f2B22+DZ8OH7ST 1uoyZiayNAaeMx/OVBf47Ycnsov+06cZe3BnC9skeqwVxj5OfMgK80id/O60aSfGNUv/ 2wc8paIHZ+M+hYbgvWHJHRsXVr7F9vHulIwv2QMXSv9BM4SfZFbml3Omu+4qxrvtvAlW R0MOkDNnn81wNhafWRarX4ZAx3tO/Rz+BqgM0IUSU6QJUqyZMRTXbDPKNYby/I6Lp9wY 0Nhw== X-Gm-Message-State: AGi0PuYzef1G1MXDHs/tylATD+1oI38ReUOznG1XYfaV2TyUc027uXzC lE9duCahZiP9sML0iUGMUD5+iWJ8qCc= X-Received: by 2002:a2e:95da:: with SMTP id y26mr10066273ljh.26.1587380495767; Mon, 20 Apr 2020 04:01:35 -0700 (PDT) Received: from localhost.localdomain ([176.59.41.106]) by smtp.gmail.com with ESMTPSA id b28sm507531lfo.46.2020.04.20.04.01.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 04:01:35 -0700 (PDT) From: Maxim Uvarov To: qemu-devel@nongnu.org Subject: [PATCH] add optee dts entry for secure machine Date: Mon, 20 Apr 2020 14:01:26 +0300 Message-Id: <20200420110126.12693-1-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.17.1 Received-SPF: pass client-ip=2a00:1450:4864:20::243; envelope-from=maxim.uvarov@linaro.org; helo=mail-lj1-x243.google.com X-detected-operating-system: by eggs1p.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::243 X-Mailman-Approved-At: Mon, 20 Apr 2020 09:36:03 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxim Uvarov Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Add optee compatible string for dtb to force linux to boot optee module. Signed-off-by: Maxim Uvarov --- hw/arm/virt.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.17.1 diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 656b008..7d712f3 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1335,6 +1335,22 @@ static void create_platform_bus(VirtMachineState *vms) sysbus_mmio_get_region(s, 0)); } +static void create_secure_tee(VirtMachineState *vms) +{ + char *firmware; + char *optee; + + firmware = g_strdup_printf("/firmware"); + qemu_fdt_add_subnode(vms->fdt, firmware); + + optee = g_strdup_printf("/firmware/optee"); + qemu_fdt_add_subnode(vms->fdt, optee); + qemu_fdt_setprop_string(vms->fdt, optee, "compatible", "linaro,optee-tz"); + + g_free(optee); + g_free(firmware); +} + static void create_secure_ram(VirtMachineState *vms, MemoryRegion *secure_sysmem) { @@ -1720,6 +1736,7 @@ static void machvirt_init(MachineState *machine) if (vms->secure) { create_secure_ram(vms, secure_sysmem); create_uart(vms, VIRT_SECURE_UART, secure_sysmem, serial_hd(1)); + create_secure_tee(vms); } vms->highmem_ecam &= vms->highmem && (!firmware_loaded || aarch64);