From patchwork Wed Apr 22 13:07:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 185692 Delivered-To: patch@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp749834ilf; Wed, 22 Apr 2020 06:21:46 -0700 (PDT) X-Google-Smtp-Source: APiQypKcfd9HnBw3zOKS12uSTKX+RuwGOqdwWtQ5BJJHzzbYdJXJTorPEQQI4MK0wlCWZLgqusjc X-Received: by 2002:ad4:548b:: with SMTP id q11mr24464144qvy.129.1587561706790; Wed, 22 Apr 2020 06:21:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587561706; cv=none; d=google.com; s=arc-20160816; b=dxaWExrBjc2nJ4XSEJKtiAj9q1/Kndfn1Gbx7CYw0bHZv4ZvUwDt6xVI5oxmlzEcK6 03o0KAdMrlrU3RDJ92lpY/Km1jbPdGina0WpmOrRg2z8VJOV8uKEIwYLQ/9ooIr+UUnn 8M6xedwDnmuCNPH2ga+TgoK3se9+43XSAhJFVGTZaySIxPO7LzOLAzeBalrOLFH/vVA0 30Lds0aVINmXr6TtZza1VskTT+n/6OXSJOSevYP536r8v1CnC5ujn934MhtVpO3H7xks uFM+cyUWYAQJVmGMNTgrSNOmiVkH+46iFwTeIOHYDC/dhb9jYSAJxji1nkM8ZJee2zCX 4IZw== 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=gPyv6GKjQYuumQwDy0Zbk4FJLRJiznTbr7kAayBXHTQ=; b=MTjdIBpXrWf8B2TgplddyX+lxpuxs99JRgBHRXVjMcnk3KGpNivKmZ1Mue59RRo0b8 b/wcobvtPVSQcnB6H0D9HyCARylfMqYuoAq3Aao+I7HC/I9vL/JoryaCr6dVx+c+Kqsn tfGHOdE6a+1kVzZJMrt/5+PbXt0j77Sxr+8WAn8saYd5tULlqfuPdJNITOvYwNn2uFvo aXI9zom+KZqsE0KNbYXAx/hfO59SfTTIA4rO896zmRAOBx10ooXpRz6jup+VnkS/R4mK y2H6ITWjAhuvphHle0emctwnmiZaDGSsEWQ5SKbPLr717Dr7ubybX9N/OpQoXo8mtgt4 Y4Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qju0864v; 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 v17si661174qvq.118.2020.04.22.06.21.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Apr 2020 06:21:46 -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=qju0864v; 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]:50472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRFJy-0006eg-As for patch@linaro.org; Wed, 22 Apr 2020 09:21:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47096) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRF6L-00043N-2P for qemu-devel@nongnu.org; Wed, 22 Apr 2020 09:07:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRF6I-0004Jz-SD for qemu-devel@nongnu.org; Wed, 22 Apr 2020 09:07:40 -0400 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]:39016) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRF6I-0004DA-9w for qemu-devel@nongnu.org; Wed, 22 Apr 2020 09:07:38 -0400 Received: by mail-lj1-x244.google.com with SMTP id u6so2189797ljl.6 for ; Wed, 22 Apr 2020 06:07: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=gPyv6GKjQYuumQwDy0Zbk4FJLRJiznTbr7kAayBXHTQ=; b=qju0864vBOrjbCqF0MyqJopoPEZNqy91x32J0DkdohwDOKJXIdpLBGCWwDI22fzrgu d88z2REHE9wp6khs0HiSZKBtXANqWyUu2Hs9psbDd8k4ZxGKy8zQTeX/YzjSZLAJzYee EZ0yaD/eZBq885Zo0Vja6EMqiemoCHZH9adtz+CnTB0K47hNGpreAf0TjhHOfGE06YLr JGpRLbVHjBKAOu6HH28kwSkJO9jF7kDGaQWoZpxFPCws7qIUZHlQb8Imz1yGFuSrDeYf YUf7JXBpYmbUtd+rQKe/sHadpVSfa3fBfaFcAyA0BWpjJCo6puVrjItAVwaXiXl703Gn egTw== 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=gPyv6GKjQYuumQwDy0Zbk4FJLRJiznTbr7kAayBXHTQ=; b=kYgywx8kywtfqmYOHknAWkyKA8VuOUlBVD/G90daI4blKLVkUL9ZWt4KqwJWK7cWRl fJmPuCzdcCb5xiL/R6uhgjUZMdI0zFHO3c3HlgKboypRDBtmH5Kd2iO/bYv9omn3Rr+Z fgwHv8+KSxPAWxsDydXLU0z73/8vJyFoXjTGuQHAlFWnRf9d+tsE1yuyEKg7IkLby93U uh7HP+OGWNLfrPxBYVx2y6oO+kAkWwqtTAzpHwZabQxJ3pEsL7b7p+AVyYqHpsmMsOxi KflOrLYcUSSVhJ/HWhjo1N0tOQCn8TL0mWsFE2MtFJuhMOmBuAOq/dMFN7ZtPIBNfuv9 bAWg== X-Gm-Message-State: AGi0Pub1Mfq3PTje0dMkCpbq7+pjEAU5PfWr203wnl3nMWEoXl/s4PJN grcZtKrRC7pUt0sui7t1Y2s51vZBpDI= X-Received: by 2002:a2e:9048:: with SMTP id n8mr5298695ljg.122.1587560854725; Wed, 22 Apr 2020 06:07:34 -0700 (PDT) Received: from localhost.localdomain ([176.59.41.106]) by smtp.gmail.com with ESMTPSA id u13sm4516564lji.27.2020.04.22.06.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2020 06:07:34 -0700 (PDT) From: Maxim Uvarov To: qemu-devel@nongnu.org Subject: [PATCHv2] add optee dts entry for secure machine Date: Wed, 22 Apr 2020 16:07:24 +0300 Message-Id: <20200422130724.3581-1-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.17.1 Received-SPF: pass client-ip=2a00:1450:4864:20::244; envelope-from=maxim.uvarov@linaro.org; helo=mail-lj1-x244.google.com X-detected-operating-system: by eggs.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::244 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 --- v2: added method. hw/arm/virt.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) -- 2.17.1 diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 656b008..c937a82 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1335,6 +1335,23 @@ 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"); + qemu_fdt_setprop_string(vms->fdt, optee, "method", "smc"); + + g_free(optee); + g_free(firmware); +} + static void create_secure_ram(VirtMachineState *vms, MemoryRegion *secure_sysmem) { @@ -1720,6 +1737,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);