From patchwork Wed Sep 11 11:50:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Rui X-Patchwork-Id: 11140981 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8218614ED for ; Wed, 11 Sep 2019 11:50:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6A1BD20CC7 for ; Wed, 11 Sep 2019 11:50:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A1BD20CC7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 78E2E6EAA3; Wed, 11 Sep 2019 11:50:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-eopbgr780052.outbound.protection.outlook.com [40.107.78.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4A70B6EAA1; Wed, 11 Sep 2019 11:50:20 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BX4uOzxh8pup0MxUPKYklwKEm8YHNbe29E6m/gW5yRPT+GaQ/llLBJUwI7kZtaiW4R5XXtJpcy/O+083/5DZJQYlGK8h9XrUOmd7U5PlsF+ure2CxRIWrpzYu5dXeSkMdQtYt1YvZaPnZcaBKd1IiCgKeNMceHaUUK0gr9fIC95TjQy9Vxxxydybfhb2BrxwqdK/BrTVSKr74XPO6C6arIOGjbhVUoLV9m7ur48SmDQ8L/FgwwkKlPm1U6d4+MoKOQlWegCm5I1FE3z8lpDlcENJzpPOMWhUC8CBn3Lsok5XmMKWNwA0GULeAYzCtGd6iPYt5t8FHE+FZIhEZZqJew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cZ1jaQjF39AyHi7EdHAgCUHusSy6xrpliVoWsokXikc=; b=Bku594q7v3vsXk69QEgM1A4mEroz7Fon+CPVHYnPCTAAav4jcAw8LQ3be8ydWr/D0mUIr+3dS8CXEYyZEcMSj+Td5kYtq4Ed13tAMx01VsJTAaDd8Un46USgukBwcp2V5G++3FhLPSPB3zMxnqPDf49ePGImTsFsO5aKLjQhtdYTNUS+a8dMC6PttppVnDMb5hieYItG9CrqrPYfsNCA1EcZ1MrInUOdWcoCpA+H8qarHOZc5vS0tW8QtBZOKlC56xKXKCn3RHZG+cLGItMDjJt2i4KW1M+1PVM545Rr26mXYKj/tFOfWCx0LLpywAYdV7n+90OTZmWCzvbj8taOlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none Received: from MN2PR12MB3309.namprd12.prod.outlook.com (20.179.83.157) by MN2PR12MB3421.namprd12.prod.outlook.com (20.178.243.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2263.17; Wed, 11 Sep 2019 11:50:19 +0000 Received: from MN2PR12MB3309.namprd12.prod.outlook.com ([fe80::e105:cd24:c71d:c38d]) by MN2PR12MB3309.namprd12.prod.outlook.com ([fe80::e105:cd24:c71d:c38d%4]) with mapi id 15.20.2241.022; Wed, 11 Sep 2019 11:50:19 +0000 From: "Huang, Ray" To: "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "Deucher, Alexander" Subject: [PATCH 05/14] drm/amdgpu: add amdgpu_tmz data structure Thread-Topic: [PATCH 05/14] drm/amdgpu: add amdgpu_tmz data structure Thread-Index: AQHVaJcV677oyjSkfkSXSgLTlys4rg== Date: Wed, 11 Sep 2019 11:50:18 +0000 Message-ID: <1568202584-14471-6-git-send-email-ray.huang@amd.com> References: <1568202584-14471-1-git-send-email-ray.huang@amd.com> In-Reply-To: <1568202584-14471-1-git-send-email-ray.huang@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [180.167.199.189] x-clientproxiedby: HK2PR04CA0046.apcprd04.prod.outlook.com (2603:1096:202:14::14) To MN2PR12MB3309.namprd12.prod.outlook.com (2603:10b6:208:106::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6ca843db-d672-4a9e-99ea-08d736ae37e6 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:MN2PR12MB3421; x-ms-traffictypediagnostic: MN2PR12MB3421: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 0157DEB61B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(396003)(39860400002)(136003)(376002)(366004)(199004)(189003)(6436002)(4326008)(25786009)(450100002)(6486002)(486006)(11346002)(446003)(2616005)(305945005)(7736002)(50226002)(8936002)(316002)(110136005)(54906003)(8676002)(6116002)(3846002)(2906002)(81166006)(81156014)(36756003)(14454004)(71190400001)(71200400001)(86362001)(66446008)(478600001)(66476007)(64756008)(66556008)(66946007)(14444005)(256004)(99286004)(53936002)(5660300002)(76176011)(52116002)(6512007)(6636002)(386003)(6506007)(66066001)(102836004)(26005)(186003)(476003)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR12MB3421; H:MN2PR12MB3309.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 62MBWScXgZW+8BZ1wg1y+zLBzXVrw6WngjhIyYXIrhyA/ozdndGrz4MqFswDgtRdTi9/nzB3Zxy8vIf/I17SChi7S3DUO8Spb0DJOb9xNpXGaMzKXvWrTra6Gg8qVM+EftuSIZyHRxcDJHk9RYdVTPSWjLAoMCCSa3m24yt4YpBYW6TQ81HdPpOd2cYwV6yiApJWPJU8OG71+v854zl2HQUW1U1iUCnTriOq1su9Si+obApieGb/7GvH6wjBfZ9LZHlx2lLzCJgNUrr1jQ1g9FkL7BGf2e2XvVNtNZrfdIueUJNY48cwpxS7fYBwIc/uKjqhERJfUzHOW9FfTvwJ+x7828lBN/8BvMgdfAWV0SnPliPunjNrkWhDJLMXgy5R3Qf3NkH+OW+dREcdye4F43xDrhpu5CNTQoX02R3CT1Y= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ca843db-d672-4a9e-99ea-08d736ae37e6 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Sep 2019 11:50:18.8602 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 35HwWp+JrfAgXblwG3GvvI+gjjK9D8qhJ55zr3Ky4XDrxA18o/yWpDMePcRsx4Noz84IOzUeqglyZsWBh8HF/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3421 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cZ1jaQjF39AyHi7EdHAgCUHusSy6xrpliVoWsokXikc=; b=cJqxZza5BCJ109AZRdoqP2lna/cFmpgp9deA3toRDgYEqkBq71onqg5Xk4KoMfJ1odEKAynRPG437/gj0cr/LDqEZ5HRaxcTPtXaiqPNivJ04tEZIG4n0jFYNw81SD3HdVmaLp0KNy3ziN98RhtOYjHgVA0KMqHn65DiHXXK/SU= X-Mailman-Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ray.Huang@amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Tuikov, Luben" , "Huang, Ray" , "Koenig, Christian" , "Liu, Aaron" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This patch to add amdgpu_tmz structure which stores all tmz related fields. Signed-off-by: Huang Rui Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 +++++- drivers/gpu/drm/amd/amdgpu/amdgpu_tmz.h | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_tmz.h diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 930643c..697e8e5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -89,6 +89,7 @@ #include "amdgpu_mes.h" #include "amdgpu_umc.h" #include "amdgpu_mmhub.h" +#include "amdgpu_tmz.h" #define MAX_GPU_INSTANCE 16 @@ -916,6 +917,9 @@ struct amdgpu_device { bool enable_mes; struct amdgpu_mes mes; + /* tmz */ + struct amdgpu_tmz tmz; + struct amdgpu_ip_block ip_blocks[AMDGPU_MAX_IP_NUM]; int num_ip_blocks; struct mutex mn_lock; @@ -927,7 +931,7 @@ struct amdgpu_device { atomic64_t gart_pin_size; /* soc15 register offset based on ip, instance and segment */ - uint32_t *reg_offset[MAX_HWIP][HWIP_MAX_INSTANCE]; + uint32_t *reg_offset[MAX_HWIP][HWIP_MAX_INSTANCE]; const struct amdgpu_df_funcs *df_funcs; const struct amdgpu_mmhub_funcs *mmhub_funcs; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_tmz.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_tmz.h new file mode 100644 index 0000000..24bbbc2 --- /dev/null +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_tmz.h @@ -0,0 +1,36 @@ +/* + * Copyright 2019 Advanced Micro Devices, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef __AMDGPU_TMZ_H__ +#define __AMDGPU_TMZ_H__ + +#include "amdgpu.h" + +/* + * Trust memory zone stuff + */ +struct amdgpu_tmz { + bool enabled; +}; + +#endif