Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752006AbdFTOhk (ORCPT ); Tue, 20 Jun 2017 10:37:40 -0400 Received: from mail-by2nam03on0054.outbound.protection.outlook.com ([104.47.42.54]:11052 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751874AbdFTOhc (ORCPT ); Tue, 20 Jun 2017 10:37:32 -0400 Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=caviumnetworks.com; From: Geetha sowjanya To: will.deacon@arm.com, robin.murphy@arm.com, lorenzo.pieralisi@arm.com, hanjun.guo@linaro.org, sudeep.holla@arm.com, iommu@lists.linux-foundation.org Cc: robert.moore@intel.com, lv.zheng@intel.com, rjw@rjwysocki.net, jcm@redhat.com, linux-kernel@vger.kernel.org, robert.richter@cavium.com, catalin.marinas@arm.com, sgoutham@cavium.com, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, geethasowjanya.akula@gmail.com, devel@acpica.org, linu.cherian@cavium.com, Charles.Garcia-Tobin@arm.com, robh@kernel.org, Geetha Sowjanya Subject: [PATCH v8 1/3] ACPI/IORT: Fixup SMMUv3 resource size for Cavium ThunderX2 SMMUv3 model Date: Tue, 20 Jun 2017 19:47:37 +0530 Message-Id: <1497968259-16390-2-git-send-email-gakula@caviumnetworks.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1497968259-16390-1-git-send-email-gakula@caviumnetworks.com> References: <1497968259-16390-1-git-send-email-gakula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: PN1PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (10.174.144.21) To SN1PR0701MB2031.namprd07.prod.outlook.com (10.163.132.14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 621f21a6-00f6-4a42-cd40-08d4b7e9e198 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:SN1PR0701MB2031; X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB2031;3:3znTMpoCrphIdxQbf35eWHPNNga25mDlZBaXSizGDhySfiL8JVYs3Fea0p5U/SjBquAEQowTiFdPN/bv5g9c/jm0N6V4Ebmm0G16DwUPH/VcDB3d3pElwd3Z3oIWKJwgM3RKVnTiav6xfeFZuTdpmqpx+oW43W5gxCcZtGJvs19QcsGbp+E8bhjA4SsECvCIdkFTEguanCnNOGOohSuokbEXTfONH8yI8Z8aoFTu/hH7tBEk+GeBG3JmsQueFKOOsjjNzOq0Biy5s6LOxCyx8sNcqWpnWk2QBB/eb4UeeUQmu9Q6X7lLh4hyg+VbhS/EhLThlJMyQKBQrYF5bjrAJw==;25:ZrRqueMH5As7VSG7/+n8kRcQYcJ3DQm0M5CI0UqU01/h+aWxTkEuSWFBiZKtucYE8U1hLQ1l1wTBsFU8PcMfNGLSmAMpfd+p0taiekih8M85nyhUBk1B12ULJYACf8VJreJ+1IYLv/REUimXmCqSJLwllxcBw+kefCyv3WG9K9Ftm572UrhaPuSDu3zZJt1DawkEDrFjUu4JYpjp9+s82R9pVgoyF6Oso1fV5RbBXtvOC+1sf+thAHLYfL5logzebM113d8ozGibPfOSP8RlbwzG4hmrq9oI8q+Zrhdo69uv7UP38Lhy2ngIRDLlKD6OoWu5mWop9JR2HCCncKxHRSOiW12FtUQ1XOai9sSTAq0QevLVDtKaYtfQVMzNF5gC1nqkM1GRaUvttsIxy738nDDUHZ8xCqYYRwCStUtRTlTy8nliAD7YKaWlJShmmIxf5E+p3o1FIpSHVQnSb5/7s+2XH/llO4NitxgGRnDwWPU= X-MS-TrafficTypeDiagnostic: SN1PR0701MB2031: X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB2031;31:Pmkqa1LGIby8F0PBXWBWMetRxyrzJhUVNYi8fjGv4tq1hVTUYM4w/d2ycTsRRcM6YPpti4r1p3BY2WaW3Zgw2ZdlJDlsiw35XK13sspW3FckOgvr5fDnPHVxZHxsbYyuFRrz22HjxitQg6X3M+GXVyp2wGw9VUhWiMtT2TkBidSEsx8FDF9r8uOekd3FQmbWONYXoZ+Ki6NpKNsQ1kPRotNfeqP0nWDJh8DvchNKTOY=;20:WfqyNj9W1BLmIb202VctmMW7LsBW8ycYsaJUQqPjfAjYQ5aSqOLlmKkWnQTusi82Do0lJwvYf4Di20uMbSpX84mLL0rvx0YJrxydffubf79AVlxFymUwModwWWmXsk+ot/EcWOI3rY1/PXWVTzvGzdEFcH6oUSDzw94aI6WzcYsfzfE7ejiwwFKsuO8ArN63QPMQC0gnwh/L+rr0EG5682QV6Ju6sFxbVyzrxuzaqjJPunPeocW/Q7MhH8nt2xnWvRl2kIj6yN+z4SWiqHWbOd9nHXf9tDOkD0cg+ztzgHTr8kjB+LQhpbUDkou8aq4D4En8g8TUYm8W6I/5Idf3WYIpk5NXZL+liU/w4Jqbe6vNUkTb8ERB8pAIHIh3Kw/m5EmponVJmlDCnW5wUh5l7S959f4ah8gLic8lV2IBUs0nZC4xO0iqre+g3jRms8GoY9JNFeTaxpZb3W0rKQ4AjIwcl3+5XUBdfVpgjz4hbC6TwITk3wiE0ES2UBbdsX/p/C2ZXTnUbU/hSryn5PCtMGJ57j0wRqOacX5YWVT4WpYIegsU+EWHHK+Wt4/lR+Y5n682RQrSysPUpxQD45STFOlFdW57W7qnDSKQgpLvGos= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(100000703101)(100105400095)(93006095)(3002001)(6041248)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN1PR0701MB2031;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN1PR0701MB2031; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN1PR0701MB2031;4:iO2sEsvtxolrwr2c09yC4VJC034YlTApXkkV1ooP?= =?us-ascii?Q?3QWCn5XXZcvKAyAG0K4UreUiTgRw2hrU41tVHoOX6WRc9UuNSZsto2kZzxdC?= =?us-ascii?Q?tbUVKXzi+x3O9ch9/8lnhhsrB2Iauz1e978hWzTcTTbWthv3GMwHJG0e1slX?= =?us-ascii?Q?59P/LAiTCOjiYOnFWG3zfiFyQpKyyLz9L6gBUuAoFoarv9nW5cBMM18Dli+x?= =?us-ascii?Q?pPIHdS+5qXQJwfTI3Ko3QMm1R6+v36pRtI7k0N8Ew5rxVaNfFFFUoe/e0fTd?= =?us-ascii?Q?I5WnIOe8rc13Yt5Rqy7eb+bq6ltxpInflMkPzvdiozs1AHtavA30b+/c2oSh?= =?us-ascii?Q?L3gzhMNUdsMdTjLNjhLmSyUbgM9Dk8VuCyxge2SC9E65ylfD/v9Pa3vGF8YD?= =?us-ascii?Q?uBWR0C9lrue8IceOop+oQ69VEUUndoKP9uPs4hLPI2TwdiZvGUnoAukxZgsA?= =?us-ascii?Q?+7RZJmtL5V2Ks9+x34iYb5dsRGS1MrzfGmnvprzGkxSh9fu+fP1AxamEEein?= =?us-ascii?Q?WUPRti5fYAIY0TBWzV6ffL1lwngp3dWqEw4Qo/WdgsjtyPh3SXsmqiHEjlDC?= =?us-ascii?Q?SE9+iAXg/jXV9EhEawYoEKKPs1/KSyW4iASSlJgsd5EuZhbpJs6ebXuhRASG?= =?us-ascii?Q?eDmgbu0az6aPrAQSITf67tb4Zhnj7CC2dyjBBgOsDfB/0F/3HC69uaO15ph2?= =?us-ascii?Q?dLj0D6SH+TQlrmb3GOW1KO5ByPN+8B9rt8OWG2aJBOzRmTY7/yj+tIlTbDVK?= =?us-ascii?Q?/lm56mXltagaIPtv7Zb6N8rx53NPNAyEcRhAUsM9oYSjA/tavEB9MRCtpNkc?= =?us-ascii?Q?R1UyM0xfaG2wUnuxk926zKbXvIznbIu+KCAUxtaKUUZB1DbvEUxZkm9epFwk?= =?us-ascii?Q?VC0at3Akmi64A91C1JP7XvCTDOrbbMO1iQkJVVs8bg2Jgqy2lbAXO2v8kmqX?= =?us-ascii?Q?IOR3VsHRv6QBY2IyhwItAMcRpwXxXF2iozIzSGtmqrQSiO1rt6deLIAdnnNO?= =?us-ascii?Q?n4lcwWA36x2F1Y9vGeWqfcK5Gky6QiZqf6vyDGNLAvA18VkeIS5m2Fgd9Rwz?= =?us-ascii?Q?5WuukKV2LSYHb6kEMyVd3/CCDNOFACFhlQvjX6b+x2HyX4rvfM9cIw0jk4RH?= =?us-ascii?Q?cicJcuWWx70=3D?= X-Forefront-PRVS: 03449D5DD1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6069001)(6009001)(39410400002)(39840400002)(39850400002)(39450400003)(39400400002)(4326008)(7416002)(3846002)(6116002)(50226002)(5009440100003)(5660300001)(305945005)(38730400002)(110136004)(107886003)(53936002)(6512007)(6506006)(66066001)(47776003)(81166006)(8676002)(5003940100001)(478600001)(6486002)(2906002)(2950100002)(6666003)(42882006)(48376002)(72206003)(189998001)(33646002)(50466002)(36756003)(50986999)(25786009)(76176999)(42186005)(110426004)(42262002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR0701MB2031;H:localhost.localdomain;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN1PR0701MB2031;23:8inIvqRD9uGORZhuQ8/taEBEmEedorYnKEi/8bs?= =?us-ascii?Q?eogdbWUE8UNhCiGO/dbfCLRMR1qpZ90HUUgV6L4MTHUpGAoV4PAzlg0Sojs7?= =?us-ascii?Q?uj8XgZlD2CLRvBdpjqF95k/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ticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB2031;7:/8ca1dEfpXc2wy1x7PTCn7Jm9ozmjYrpzFw5hL3uT6uG1L97qPeZFubUqcfUvwTDD1AhBDqJf3HINwvD7mm6L+ReHxDyMBldZosCgCSSMaLFMmFl4HhnXIvhT+2MYkGnWcj3HWIh7nRc5u+o+3FJfn94Qz2uqhAW1Z/QQiU41sHSUt62KSjBVveeKDlc9zfODdEt+4JKcq8i7vNqQJMxLn5tRuZDHKJ1+RExi5NSXKwGNFmicl8y9GLBiUxDdrv0JeBB5cvezrzRMKfeQIUqFZl8dbNVTwy21mJbRhKLBssp9kRZ9sdh0Id4hO60tfZ2UlDkTSAl+kU8XuTcnayNJLARY6skTdp0oyk5ymZFwKPEYHUVJRlh74sPXOiTJo5h9VtO8TjWaDGcv/x87Eqww/jHr1+i483qJJtMTRMWc+uqyuqL2Rrpye6LUIzc9XFOY3gJv+wzFTMWFzUjPAYO8q/CzqliZgKuypwmmcA8EhFkysaqJgEXMk5h1QEGumk/er6Dm4oTXpqYyVzVgJ5LXlTlBYADFTI5T2y+mnabqSv+kfan9kduu2VJkh4ijHJQ8lm2F0A8D/LfoBAav9o/pmWwhmM3G/YD+xzcYuKU3R2Aw3SXAcanAh5s9PjWCftXCAIoX1n98GIzd4JEcrTGES5pNJo+vczX1m1nqNGppLEhP7b0xJEzNsAqA8+5y2uQ/gIwWOoPAwEzxEOLY/cPSRhurr6rcUEy4657o+8VRGO+KPnqLTzYYTkQSGwIjef1I3d7tiEgXR2iQ61nVus/6rTuNBg11t4lpcbA2ypy+yY= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2017 14:37:24.0918 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0701MB2031 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1500 Lines: 46 From: Linu Cherian Cavium ThunderX2 implementation doesn't support second page in SMMU register space. Hence, resource size is set as 64k for this model. Signed-off-by: Linu Cherian Signed-off-by: Geetha Sowjanya --- drivers/acpi/arm64/iort.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index c5fecf9..c166f3e 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -828,6 +828,18 @@ static int __init arm_smmu_v3_count_resources(struct acpi_iort_node *node) return num_res; } +static unsigned long arm_smmu_v3_resource_size(struct acpi_iort_smmu_v3 *smmu) +{ + /* + * Override the size, for Cavium ThunderX2 implementation + * which doesn't support the page 1 SMMU register space. + */ + if (smmu->model == ACPI_IORT_SMMU_V3_CAVIUM_CN99XX) + return SZ_64K; + + return SZ_128K; +} + static void __init arm_smmu_v3_init_resources(struct resource *res, struct acpi_iort_node *node) { @@ -838,7 +850,8 @@ static void __init arm_smmu_v3_init_resources(struct resource *res, smmu = (struct acpi_iort_smmu_v3 *)node->node_data; res[num_res].start = smmu->base_address; - res[num_res].end = smmu->base_address + SZ_128K - 1; + res[num_res].end = smmu->base_address + + arm_smmu_v3_resource_size(smmu) - 1; res[num_res].flags = IORESOURCE_MEM; num_res++; -- 1.7.1