From patchwork Wed Sep 25 13:45:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Rui X-Patchwork-Id: 11160719 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 DE51914DB for ; Wed, 25 Sep 2019 13:45:34 +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 C60BE20640 for ; Wed, 25 Sep 2019 13:45:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C60BE20640 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 2E7186EBBE; Wed, 25 Sep 2019 13:45:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-eopbgr730045.outbound.protection.outlook.com [40.107.73.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id CDA6C6EBB7; Wed, 25 Sep 2019 13:45:27 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H9YKVNF3/8Ch+2eeimpvCHOT3JUGyw/yGOVB4gEimuHtPsFOM0TjhNMCGp50qpcuT8rFpzTedMp4/GfkN4YCzYpI7F6/3EYGZk9OO6vp6HbR9zdZI9dYeg+K9OMLsDDiEIc+rGWPbHBcLZDAIyZo/RWDOMT0IYv5LleB3d6gAu32UTKwTYkAUR3Rjsj9b8PKwfrf1lEbRjd6yTiOLwt9wsi30+HW5BvEiRDP2a0Kix2shGMyCCV4KlYSGDiMVuFjNUTZho/DzPzK6fbUbSF/vICHdmbPBX1AnL2xC/WYM3tisRy6Mu2iQhPQugiO5RYwRV9YMCPrujbGQ0Q2MNWgRw== 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=ORh+HQfGnoQgV/s05BaIvbWy8dpPyfxfMeqcyHF0oFzcJpCoOhY/nHKHfoJ8aKz+j9x7FTATUa7iQjgrNBLwrs2mBf17Z9YX4hqLIc6X70AbIKliRhwya+WvBZFHvOewHBBvK2xr7HnWzoQyprurCmqXocYiD+0ZFsxyZnOKjdWEscaIpO+hYGwWLVmWkQKT5t+CwKU9rr53jzOp9ESSsbP/bFo3swKdGQK59Gp/Sw8N3QvHaxaUAZULKAlJmVpmgwpClxuo1u1T0+5RWS1rx9AOLMpYVedjZU3l7L2D5LXddFRdri7hbyf87RrrGpTO+5PulQWCKDKi2slnSYcDXA== 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 MN2PR12MB4304.namprd12.prod.outlook.com (10.255.224.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2284.20; Wed, 25 Sep 2019 13:45:25 +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.2305.016; Wed, 25 Sep 2019 13:45:25 +0000 From: "Huang, Ray" To: "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "Deucher, Alexander" Subject: [PATCH v2 05/11] drm/amdgpu: add amdgpu_tmz data structure Thread-Topic: [PATCH v2 05/11] drm/amdgpu: add amdgpu_tmz data structure Thread-Index: AQHVc6d7W+4CEWlNOkuX2UYHluHGbw== Date: Wed, 25 Sep 2019 13:45:24 +0000 Message-ID: <1569419090-5304-6-git-send-email-ray.huang@amd.com> References: <1569419090-5304-1-git-send-email-ray.huang@amd.com> In-Reply-To: <1569419090-5304-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: HK2PR02CA0186.apcprd02.prod.outlook.com (2603:1096:201:21::22) 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: 352831ed-8727-4dc6-06d2-08d741be9df2 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600167)(711020)(4605104)(1401327)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:MN2PR12MB4304; x-ms-traffictypediagnostic: MN2PR12MB4304: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 01713B2841 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(136003)(376002)(346002)(396003)(366004)(189003)(199004)(86362001)(8936002)(305945005)(2501003)(50226002)(6636002)(14444005)(256004)(6486002)(6116002)(3846002)(6436002)(6512007)(2906002)(4326008)(66066001)(102836004)(26005)(186003)(52116002)(76176011)(486006)(476003)(2616005)(11346002)(66946007)(66476007)(66556008)(64756008)(66446008)(446003)(99286004)(5660300002)(81156014)(6506007)(81166006)(450100002)(25786009)(36756003)(316002)(478600001)(386003)(8676002)(71190400001)(71200400001)(110136005)(54906003)(7736002)(14454004); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR12MB4304; H:MN2PR12MB3309.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: 5zje9vq7LLaxvGsbLan6sbFPyBjRfW/wUpq1PcBJqyyQ+zrYqqvJaN3aXXlQv88/TRuWbLTqvyGL23gUNConCS+IT3JsC1HygUHvs30+ZLV8zhKOWF8V4o+XY/zIpkNpBYdGpucLraacI1DUgGG7s3Y6I0ky7LMFwpNh1lYaZyzthLq43yruVWhgPnAEFFgxXGbDxbHvrsH29aE0fONlCtpJjKDllSJnlPX0UFrfr6OAIBDkKTFR3yNDGkTVl2dwcBzt/WZ/GUi0HNkbE3iR+gK8QoEXXbJm/QS2tmtixMoROiPb/x1pSNOeGvT1UtWQ7dOWg249pqP/KcZNsUzu1FXrWv9j2P3hy8LBfh4NAWWu76oZ67UjtT+JqVznUu9KRzxlw7enaHzXEaQbsprU49nJCzQhO636A0v9TOmUBU0= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 352831ed-8727-4dc6-06d2-08d741be9df2 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2019 13:45:25.0227 (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: BB2scM7MQBXPsRF/qcyfL+Y3PAZDbL4TtxKWx/K+OVfUgPvQ3MRbdyHDzWpbyV+5weGNkkmv0BVRASekEstubw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4304 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=Ca4+o3vFUXuUkBA8/TWRskTXIUOFJwU5kkr7BuEWmOUB0lqTG49XonlBzPgX/44KlvNwrpuNBGH4Tzoi90NwDVeDbybfbbOIDEw0uV/6hN2pVbeNOPcVY+OE5GAc9/QH4M9tPl/4pwzKl9PQLDKysVyZQVVJM79WWZgGtoqo++g= 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