From patchwork Mon Dec 4 22:22:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 120613 Delivered-To: patch@linaro.org Received: by 10.80.152.193 with SMTP id j59csp1434768edb; Mon, 4 Dec 2017 14:23:36 -0800 (PST) X-Google-Smtp-Source: AGs4zMaFVoEqTheewwUVOHWNw3UL6PzNdwzStM1vqHhwN/BDkDng5wgQWnUv0HM3aGF1Xt2e82q6 X-Received: by 10.84.240.196 with SMTP id l4mr3724418plt.140.1512426216375; Mon, 04 Dec 2017 14:23:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512426216; cv=none; d=google.com; s=arc-20160816; b=NE2igpPgMfD4nDVuWNZPeAtK6Aa8Xn88MbIx5/SwmeLkZc3giuhr7AmfmvMTIINU4G houu045wTybFQyDrUB9xz9Npaf5F7BHdtkXD60ECnZ4kCRzr/MjtxhYeoI8VHWxtPVjH qutGnQwLCINeZ2H8lS3trBkulRQkdfWtLX52k4c9ohHZQX50S5mpB3Sf6qSYfAXfXGYs nbela7U24n92Ly+Rjd22ntA9Hu5N0wK6kVsLX1sIThunm8xgWdf5OpVGk190kPw98j8/ O4UoaDN3FbqQggSAsKIgd4R5FgxmO2g9wUf51oRFjPjkYpzQciIuyI3SzeHcH2dcG3wW 4sng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=+PhiudVXnDPoN5r6DQFb+QxokFCW4unFJbC/Cj5fP/M=; b=EdTBLAAa/8LFQxWJwi/MEQU9vZWDqUKacPdTCddUQ26esyBmhRapDDx5MbVfpBRuN5 81Mvc5EDQ9R0/hUQCYgzkqdzw9vk6V4hJ7X+O2Ep4aZmixUfFDGXI5RlLyPJZkttBreX 9xFGx1UF3URH8KWnjJZhk4bXzW07erfanGt8NBSfMsY4LusYo11vPOzlxypc/zfZbCs3 M26Dicn9ZFOYo0SdeONGLz3uphvRZ62Sw3Mb9lM88DATLkjX+vsZsoApD/baQeIqzffN y4xhyLccWMcPI8MN11jKrVkTsqs/4eykvtGkcN0SN4HDdq+7vdeBy3b4PySa6h7o6fCz T+lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=aX8mjDI4; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id b8si9994271pgv.728.2017.12.04.14.23.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Dec 2017 14:23:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=aX8mjDI4; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5FD102035624F; Mon, 4 Dec 2017 14:18:52 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::244; helo=mail-wm0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 90A1020356241 for ; Mon, 4 Dec 2017 14:18:51 -0800 (PST) Received: by mail-wm0-x244.google.com with SMTP id l141so8627341wmg.1 for ; Mon, 04 Dec 2017 14:23:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lh62q1GJoX4dAAA+Cj33PlDM1oIZs7fZ7FNKJUVUm+k=; b=aX8mjDI4XHKFShb2hYjpta8d5ZhZtbJ53cpDvsvagEuuk5cTEJZl2hfHAN52FKMn4Z s6PgfkhJeeZKhyaG9c+NsGIQ2T1iQdDGJKyHWMmFegh6ACC+Q+8nrrK3CQq3+n7UEZiA gXJPa/uh6qtRMAbWno9Dx4pnvWxlEKmBKekvU= 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:in-reply-to :references; bh=lh62q1GJoX4dAAA+Cj33PlDM1oIZs7fZ7FNKJUVUm+k=; b=gFkgfkgcmS5zFjc7JarZkehjHln4LT/eY6/1ktm/0XMH6yfdLI/7+WGRKvXwXf590+ a+6mHjNYySaAlft8p4nmFVfI0KNt+4x0PhdP79lsJfUH4SS3rgN8ANFHBWEuyYt7Zlf6 MVbKjpAB1TsqWllJnJ6B7LuJWE478ci8QeiIUXQdYkHR/JvIPoBbhFwxSSJBuSoJrG3A aGlh/I0p4lZDH33qQ4jY+cr3eZ9NyL18KFhJHZxBv813eDnyFSu+upzUvMkhz+dMGG97 ng4WiZbsP9B8uj3q5oEVQzAfdeHVsQbBdbqJ6FAbWXphgNxCnP8TIgNoKBoIBxjs4mqX CtfQ== X-Gm-Message-State: AKGB3mL2PTi6av8w/0RGAEld0MLXJ9UHdwGjW680bkV/uZdeLarseXeU OVVLNMovXChhF6ddJGvfS1S1pexr5/M= X-Received: by 10.28.0.6 with SMTP id 6mr8291839wma.109.1512426200147; Mon, 04 Dec 2017 14:23:20 -0800 (PST) Received: from localhost.localdomain ([105.150.171.234]) by smtp.gmail.com with ESMTPSA id x133sm5667961wmd.44.2017.12.04.14.23.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Dec 2017 14:23:19 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 4 Dec 2017 22:22:42 +0000 Message-Id: <20171204222243.15950-13-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171204222243.15950-1-ard.biesheuvel@linaro.org> References: <20171204222243.15950-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 12/13] ArmPlatformPkg: remove unused ArmTrustZone driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" This driver is no longer used anywhere so remove it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by-if-no-comments-by-15-Dec: Leif Lindholm --- ArmPlatformPkg/Drivers/ArmTrustZone/ArmTrustZone.c | 113 -------------------- ArmPlatformPkg/Drivers/ArmTrustZone/ArmTrustZone.inf | 33 ------ ArmPlatformPkg/Include/Drivers/ArmTrustzone.h | 105 ------------------ 3 files changed, 251 deletions(-) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPlatformPkg/Drivers/ArmTrustZone/ArmTrustZone.c b/ArmPlatformPkg/Drivers/ArmTrustZone/ArmTrustZone.c deleted file mode 100644 index 1f002198e552..000000000000 --- a/ArmPlatformPkg/Drivers/ArmTrustZone/ArmTrustZone.c +++ /dev/null @@ -1,113 +0,0 @@ -/** @file -* -* Copyright (c) 2011-2012, ARM Limited. All rights reserved. -* -* This program and the accompanying materials -* are licensed and made available under the terms and conditions of the BSD License -* which accompanies this distribution. The full text of the license may be found at -* http://opensource.org/licenses/bsd-license.php -* -* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -* -**/ - -#include -#include - -#include - -#define TZPC_DECPROT0_STATUS_REG 0x800 -#define TZPC_DECPROT0_SET_REG 0x804 -#define TZPC_DECPROT0_CLEAR_REG 0x808 - -#define TZASC_CONFIGURATION_REG 0x000 -#define TZASC_REGIONS_REG 0x100 -#define TZASC_REGION0_LOW_ADDRESS_REG 0x100 -#define TZASC_REGION0_HIGH_ADDRESS_REG 0x104 -#define TZASC_REGION0_ATTRIBUTES 0x108 - -/** - FIXME: Need documentation -**/ -EFI_STATUS -TZPCSetDecProtBits ( - IN UINTN TzpcBase, - IN UINTN TzpcId, - IN UINTN Bits - ) -{ - if (TzpcId > TZPC_DECPROT_MAX) { - return EFI_INVALID_PARAMETER; - } - - MmioWrite32 ((UINTN)TzpcBase + TZPC_DECPROT0_SET_REG + (TzpcId * 0x0C), Bits); - - return EFI_SUCCESS; -} - -/** - FIXME: Need documentation -**/ -EFI_STATUS -TZPCClearDecProtBits ( - IN UINTN TzpcBase, - IN UINTN TzpcId, - IN UINTN Bits - ) -{ - if (TzpcId> TZPC_DECPROT_MAX) { - return EFI_INVALID_PARAMETER; - } - - MmioWrite32 ((UINTN)TzpcBase + TZPC_DECPROT0_CLEAR_REG + (TzpcId * 0x0C), Bits); - - return EFI_SUCCESS; -} - -/** - FIXME: Need documentation -**/ -UINT32 -TZASCGetNumRegions ( - IN UINTN TzascBase - ) -{ - return (MmioRead32 ((UINTN)TzascBase + TZASC_CONFIGURATION_REG) & 0xF); -} - -/** - FIXME: Need documentation -**/ -EFI_STATUS -TZASCSetRegion ( - IN INTN TzascBase, - IN UINTN RegionId, - IN UINTN Enabled, - IN UINTN LowAddress, - IN UINTN HighAddress, - IN UINTN Size, - IN UINTN Security, - IN UINTN SubregionDisableMask - ) -{ - UINT32* Region; - UINT32 RegionAttributes; - - if (RegionId > TZASCGetNumRegions(TzascBase)) { - return EFI_INVALID_PARAMETER; - } - - RegionAttributes = TZASC_REGION_ATTR_SECURITY(Security) | - TZASC_REGION_ATTR_SUBREG_DISABLE(SubregionDisableMask) | - TZASC_REGION_ATTR_SIZE(Size) | - TZASC_REGION_ATTR_ENABLE(Enabled); - - Region = (UINT32*)((UINTN)TzascBase + TZASC_REGIONS_REG + (RegionId * 0x10)); - - MmioWrite32((UINTN)(Region), TZASC_REGION_SETUP_LO_ADDR(LowAddress)); - MmioWrite32((UINTN)(Region+1), HighAddress); - MmioWrite32((UINTN)(Region+2), RegionAttributes); - - return EFI_SUCCESS; -} diff --git a/ArmPlatformPkg/Drivers/ArmTrustZone/ArmTrustZone.inf b/ArmPlatformPkg/Drivers/ArmTrustZone/ArmTrustZone.inf deleted file mode 100644 index 6f90589a5b90..000000000000 --- a/ArmPlatformPkg/Drivers/ArmTrustZone/ArmTrustZone.inf +++ /dev/null @@ -1,33 +0,0 @@ -#/* @file -# Copyright (c) 2011-2012, ARM Limited. All rights reserved. -# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#*/ - -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = ArmTrustZoneLib - FILE_GUID = 5962d040-8b8a-11df-9a71-0002a5d5c51b - MODULE_TYPE = BASE - VERSION_STRING = 1.0 - LIBRARY_CLASS = ArmTrustZoneLib - - -[Sources.common] - ArmTrustZone.c - -[Packages] - MdePkg/MdePkg.dec - ArmPkg/ArmPkg.dec - ArmPlatformPkg/ArmPlatformPkg.dec - -[LibraryClasses] - BaseLib - IoLib diff --git a/ArmPlatformPkg/Include/Drivers/ArmTrustzone.h b/ArmPlatformPkg/Include/Drivers/ArmTrustzone.h deleted file mode 100644 index 827b5cd568c1..000000000000 --- a/ArmPlatformPkg/Include/Drivers/ArmTrustzone.h +++ /dev/null @@ -1,105 +0,0 @@ -/** @file -* -* Copyright (c) 2011-2012, ARM Limited. All rights reserved. -* -* This program and the accompanying materials -* are licensed and made available under the terms and conditions of the BSD License -* which accompanies this distribution. The full text of the license may be found at -* http://opensource.org/licenses/bsd-license.php -* -* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -* -**/ - -#ifndef __ARM_TRUSTZONE_H__ -#define __ARM_TRUSTZONE_H__ - -#include - -// Setup TZ Protection Controller -#define TZPC_DECPROT_0 0 -#define TZPC_DECPROT_1 1 -#define TZPC_DECPROT_2 2 -#define TZPC_DECPROT_MAX 2 - -/** - FIXME: Need documentation -**/ -EFI_STATUS -TZPCSetDecProtBits ( - IN UINTN TzpcBase, - IN UINTN TzpcId, - IN UINTN Bits - ); - -/** - FIXME: Need documentation -**/ -EFI_STATUS -TZPCClearDecProtBits ( - IN UINTN TzpcBase, - IN UINTN TzpcId, - IN UINTN Bits - ); - -// Setup TZ Address Space Controller -#define TZASC_REGION_ENABLED 1 -#define TZASC_REGION_DISABLED 0 -#define TZASC_REGION_SIZE_32KB 0xE -#define TZASC_REGION_SIZE_64KB 0xF -#define TZASC_REGION_SIZE_128KB 0x10 -#define TZASC_REGION_SIZE_256KB 0x11 -#define TZASC_REGION_SIZE_512KB 0x12 -#define TZASC_REGION_SIZE_1MB 0x13 -#define TZASC_REGION_SIZE_2MB 0x14 -#define TZASC_REGION_SIZE_4MB 0x15 -#define TZASC_REGION_SIZE_8MB 0x16 -#define TZASC_REGION_SIZE_16MB 0x17 -#define TZASC_REGION_SIZE_32MB 0x18 -#define TZASC_REGION_SIZE_64MB 0x19 -#define TZASC_REGION_SIZE_128MB 0x1A -#define TZASC_REGION_SIZE_256MB 0x1B -#define TZASC_REGION_SIZE_512MB 0x1C -#define TZASC_REGION_SIZE_1GB 0x1D -#define TZASC_REGION_SIZE_2GB 0x1E -#define TZASC_REGION_SIZE_4GB 0x1F -#define TZASC_REGION_SECURITY_SR (1 << 3) -#define TZASC_REGION_SECURITY_SW (1 << 2) -#define TZASC_REGION_SECURITY_SRW (TZASC_REGION_SECURITY_SR|TZASC_REGION_SECURITY_SW) -#define TZASC_REGION_SECURITY_NSR (1 << 1) -#define TZASC_REGION_SECURITY_NSW 1 -#define TZASC_REGION_SECURITY_NSRW (TZASC_REGION_SECURITY_NSR|TZASC_REGION_SECURITY_NSW) - -/* Some useful masks */ -#define TZASC_REGION_SETUP_LO_ADDR_MASK 0xFFFF8000 - -#define TZASC_REGION_ATTR_SECURITY_MASK 0xF -#define TZASC_REGION_ATTR_SUBREG_DIS_MASK 0xFF -#define TZASC_REGION_ATTR_SIZE_MASK 0x3F -#define TZASC_REGION_ATTR_EN_MASK 0x1 - -#define TZASC_REGION_SETUP_LO_ADDR(x) ((x) & TZASC_REGION_SETUP_LO_ADDR_MASK) - -#define TZASC_REGION_ATTR_SECURITY(x) (((x) & TZASC_REGION_ATTR_SECURITY_MASK) << 28) -#define TZASC_REGION_ATTR_SUBREG_DISABLE(x) \ - (((x) & TZASC_REGION_ATTR_SUBREG_DIS_MASK) << 8) -#define TZASC_REGION_ATTR_SIZE(x) (((x) & TZASC_REGION_ATTR_SIZE_MASK) << 1) -#define TZASC_REGION_ATTR_ENABLE(x) ((x) & TZASC_REGION_ATTR_EN_MASK) - -/** - FIXME: Need documentation -**/ -EFI_STATUS -TZASCSetRegion ( - IN INTN TzascBase, - IN UINTN RegionId, - IN UINTN Enabled, - IN UINTN LowAddress, - IN UINTN HighAddress, - IN UINTN Size, - IN UINTN Security, - IN UINTN SubregionDisableMask - ); - -#endif