From patchwork Mon Apr 20 12:16:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 185577 Delivered-To: patch@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp3894316ilf; Mon, 20 Apr 2020 05:17:08 -0700 (PDT) X-Google-Smtp-Source: APiQypKYuQNv6wLz+T+eCtZ4sxcfsUQTJMc4IwC2RREzE2j3nIdcZbyoVv37TDlYL8owQV7ukf// X-Received: by 2002:aed:3edd:: with SMTP id o29mr15685869qtf.149.1587385028629; Mon, 20 Apr 2020 05:17:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587385028; cv=none; d=google.com; s=arc-20160816; b=yw8qNp2ajlJghYLivqlzh0RIgt8Kgonwsy2ztDQrRBw3kX7rVKUbq2sB40Kueg8raK exocPPHssiYBbX7lVOkL+InFDHaF032N6LMlE3K6WqpS0SAUhIWFIhTT8HJuWYHSfwZI UA9TYBkGjXP8yk3YYrMIRYYPQGO67m9A5X0gqJG+e/GN/hIrDCJskeH4mPjrGzF3bbab twSSrnbhfdGjEUYAWuPLtnGbSd/MNgNyC639CTe+DP1vBBejfZ5kcaO8mDbMYbSU5UnP ZkrzOHMKqy1y8Mb327s8XYXqJGPZwBtlyJ7UNgA4FDuSBVaIWZoaciN5kmh6lVZlCiup Tksw== 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=VgV8GqSd3IxjpvmtTIrYBpSHC7ppbGXR/oJ9OGuN7TRIIDpMfRyk9cxzgQUPGFiUVa 1sa/bcg+Tu6+NhIiEQ1iRXxsiTLtLYDVolzbIwOogaPeoM18+m/hKxm3IeuU5wBaiABB iOlFaaLPA2i6DEvWbPE0fGYOPtSRDxv7dHayzWIbTukDAVltJ6YUH6/2CoKaQZVlise9 Zobnj8POj2xGXJgAjYRNVEPYqL8SPZEWmbdhC+90sKBpxrnfSMgj82aR2I+Zo73Wq44w OYhIc0oJWOtaSMDv38QRHEFVIUBIb0i/DG1NLycvCNEa5jb0CRKEbWYNYSjXeX4Twbkw nQsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qk0TXZbU; 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 c68si431618qke.281.2020.04.20.05.17.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Apr 2020 05:17:08 -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=Qk0TXZbU; 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]:34486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQVMK-0000WZ-5z for patch@linaro.org; Mon, 20 Apr 2020 08:17:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45804 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQVMC-0000WP-9T for qemu-devel@nongnu.org; Mon, 20 Apr 2020 08:17:00 -0400 Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQVMB-00076T-D0 for qemu-devel@nongnu.org; Mon, 20 Apr 2020 08:16:59 -0400 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]:44646) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQVMA-00075C-Pj for qemu-devel@nongnu.org; Mon, 20 Apr 2020 08:16:59 -0400 Received: by mail-lf1-x143.google.com with SMTP id 131so7695626lfh.11 for ; Mon, 20 Apr 2020 05:16:58 -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=Qk0TXZbUZRpUsUFf/9N+LWjfMBXED4QR/z1lTbIL5oD1JSogTMJBrxnhNLG99I6xtO l27t1JnH/0NZMAlUPx3WHqW1M9P29vfVx8NIiqZfM3Im7zCvbtN7+gatC8jyE/6LFVqd aV5UMXzlHRRfSQX1xraVVeyqvhyfTjglPMQjD3MUl+qZwz+tdtG8IFuYM/D4SvdnhqDS TRnvGcM8Wy/FFRlZKbFhyb/6cSWPiCyAYYzAhdrcZA7GAfbrCc9+oqdmt5D7+MeeS2Cp ihm4UFv+bCNFWHNDKD3DMb1gfL1PvKpKEcGac/KMNk/6izJttF/izwzJNZMJhsMkoxp7 +0AA== 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=NVbwI9rkLc/2vYPJLFGO/j1jfqj27xTF5nrjiiaJMCGf4q1Yv5kGkAuPDQHrwXn7/W 41kfhHMukGzvuQ9Zbn/tN/eBYR9HQE21EprxoP3WMT1A6NuJSD6PQCgaF9meNPDRffBx mOSQnmEU/hQwBJyEGtd8ZuHye6X5CyNgQuxQi6IKc/909yWMyDebF8lsKNNnC+zPxFWp Uap+cBBt3hR1yRRuTkTPI0Stov56KZpm9tJFqKk0uQTDaYFU2M5HutjfcaDb2cwK8ujn gy3kQorWPr5+MYJ6aseKoV6thrkP53eha2yd2bzSYc89h0nwqqUblofiT2kUZoJjLn2s 87+A== X-Gm-Message-State: AGi0PuZdo2MqzG6d4A4kWxhVgCQfb2Uh0yCXCpcaBfddtFm9+Pk87Zz5 4yIjw1XQNSwIfbuRLg5ENbKVOhQKiic= X-Received: by 2002:a19:f206:: with SMTP id q6mr10732045lfh.85.1587385016408; Mon, 20 Apr 2020 05:16:56 -0700 (PDT) Received: from localhost.localdomain ([176.59.41.106]) by smtp.gmail.com with ESMTPSA id w15sm909249ljd.35.2020.04.20.05.16.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 05:16:55 -0700 (PDT) From: Maxim Uvarov To: qemu-devel@nongnu.org Subject: [PATCH] add optee dts entry for secure machine Date: Mon, 20 Apr 2020 15:16:52 +0300 Message-Id: <20200420121652.16615-1-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.17.1 Received-SPF: pass client-ip=2a00:1450:4864:20::143; envelope-from=maxim.uvarov@linaro.org; helo=mail-lf1-x143.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::143 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);