Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753238AbdFVMZ7 (ORCPT ); Thu, 22 Jun 2017 08:25:59 -0400 Received: from mail-co1nam03on0075.outbound.protection.outlook.com ([104.47.40.75]:36249 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753202AbdFVMZx (ORCPT ); Thu, 22 Jun 2017 08:25:53 -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 v9 2/3] iommu/arm-smmu-v3: Add workaround for Cavium ThunderX2 erratum #74 Date: Thu, 22 Jun 2017 17:35:37 +0530 Message-Id: <1498133138-20244-3-git-send-email-gakula@caviumnetworks.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1498133138-20244-1-git-send-email-gakula@caviumnetworks.com> References: <1498133138-20244-1-git-send-email-gakula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BM1PR01CA0116.INDPRD01.PROD.OUTLOOK.COM (10.174.208.32) To CY1PR0701MB2026.namprd07.prod.outlook.com (10.163.142.13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9cd1994d-74a6-4c8a-abc5-08d4b969d241 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:CY1PR0701MB2026; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB2026;3:Rct5upVYxCHtmVUYhOHNa/o1iA7nDtn6Z1cqtilGN8oil2LeXsmkS0vJgLGU5DyuOZs8ax55c7S3xS55UMAYLElpyngkhptdGLbhkZ8DZDrDGkFBWyp4SAsx7K909Nhhm1govt5dtxCqudcsqmzt0Qpxr4rjHQPMQQib8L9XmewJIc5MsjFJqoFlUbc6HCM/KKfrIDOzvQnoPv/Ry8xN143rzHHeTGhKnV0nMNgpM+Siu4pdfOWTiY+BjTf27Gh8axGtQ62jZOnmlrvRiYKAtjjUhDz+VN8C4Al9sk6H/GiNebX+Of60TnWJjw/NhR/NU596roYyYTPWNPoe0xZ6FQ== X-MS-TrafficTypeDiagnostic: CY1PR0701MB2026: X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB2026;25:sFCcmE/X4XKIYNdu/pp2NppYZIrL3dAk1uTJxv7MUPyCBrnKM5BtT3KtLRgrQsvLKU0E9REBXXMV88QI6wB+6GP4aIJqM2gqvVq81TIvTaCxEYhk7Yn5FztvKsWXvfmAG9WjJo8dljWOtGpYXhVDRg4dhbWtc1uqALFpU/eO0VO/brihuR1x2Sl01oA5aE5WvRyAHIhgVBc8S8gFf9S5FNasXTlTnGp4xahx/l7ebtzOdLHu4slDGoHXb68PQQYd2kHrD5ydsOHQSvRGl8nxQW4NMxd5AoTabESuQXzYQJjqLHvuq4E0JqqDZZ2zfbTT0/xLljYXjZgdAnnlPveedBgEh++79EcvLc+x9yowf4Gxl9mh6WdM8/iYUVvbsv67IayEZRCvkIlyM5kNPnY4lmfvDIEiV6abgiTuSdwA/Q0utORS3O7472+B4HInjePfNzWm7bwLVr6NV5uQmnLt+gVO4qmw3SOPDVmoj4X9IXk7EwTjRa8He3hzg9DNvkbPO9viCaEhppaVc858RDR7L38cXQhf9s3V/ALFL8rrDEX/ZNeOJWSYF+6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vG/HR9gUnfe0= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB2026;20:7Kxg5EOzR/AE1VkCuK87q7wzyD2Qc/DE8H/tOaptTPnMLlxlqRxSHmE8MQ0rsOSKol5T7yTkdg0RuhtpXHnAl8Q2WRigown+2i9xORvNVF0td2Juj0+AJUGYJURcqA2T/hSdRABnEd9FLxM5aF601xUKhOn8BmHg5d5zXGFioLEZy3oeuzpKnMbqpqvklfqOq2W2pIH6jL01pNAddQm1SO17yXgDPIXC8anZDrxxrWV2HgcldJiBXj34P5O9PXtlmqesD5dn/EuGlz5AKA1q6oeH29lWG3GjhQXiiQG23LqOcmT9oOr0n8pWGnToiPHc4oQHDbBYYSk2MdIXQCUEFH9BXctdQiH2rS5uvHa9ipe6rGLQJwsjofGH3ZtSCOp7CIINdfDs7E50BUf3kdrcn0fDcbYvJDNiyiORPDHPiRp19wFDF9oapFGiKyQyq4O7KFBh7oOUwyKA5Xadh1Bqfeg9WGkR+tpjzfmC4W8y1oL5eE9E4xv4nNtCRZC+5RBYTEVLnYr1C+ITAryIcLVc5sNaeSfRxm3zw4DPhcVqEcBygaKFr+sJ+MZ68yBKIIOrRd/Dr+Aw3xhDwCSgkDnpC0tbHY1Pwgi/MVwhemEpdVk= 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)(5005006)(8121501046)(3002001)(93006095)(100000703101)(100105400095)(10201501046)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR0701MB2026;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR: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=?us-ascii?Q?222+0Ffkk3UFyPj3iImmtje4K069TXL8by8yVkD11hkQBXAwlTAtrnTcqpuf?= =?us-ascii?Q?SN6RfbKHP5wCONajFTt0gnddI+0DsMC/1W7zHxm4IEp7xZMnwUxk+hAR1Ylu?= =?us-ascii?Q?SUDKYzhcSM+zfXhvQkoGZb+OifVdqm1Iw26PgT1GJajV8cce3vGXlIKD2Nwm?= =?us-ascii?Q?EyzBgVG0m4WKEFJ8PrLzAdq0bNoHdB+7zCkQ3UvekK/PVLFWZ3nxsTqu8jcN?= =?us-ascii?Q?nrziTrw4Cy2/V/smq/YUXEhBUhVOcdRMZnUHZPnh/VwVrYQTwzb1nPOb2eAR?= =?us-ascii?Q?YD+Dz4fiu2c=3D?= X-Forefront-PRVS: 03468CBA43 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(39410400002)(39850400002)(39400400002)(39450400003)(39840400002)(6506006)(66066001)(36756003)(47776003)(72206003)(110136004)(7736002)(189998001)(6512007)(3846002)(50226002)(81166006)(5009440100003)(8676002)(38730400002)(53936002)(6116002)(6486002)(6666003)(48376002)(42882006)(76176999)(50986999)(50466002)(33646002)(2950100002)(5003940100001)(2906002)(230783001)(7416002)(4326008)(305945005)(25786009)(5660300001)(478600001)(42186005)(110426004)(42262002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB2026;H:localhost.localdomain;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0701MB2026;23:KCLHg7YL/8Ua0V8odO35la4ICaRHCszoOspvwTn?= =?us-ascii?Q?kH0EaIwPzVhMB52caUHBEp9cM9drciwsUBErjzBRJ8+WHb0oxIAamiqVUdTa?= =?us-ascii?Q?QSB5nvhFY2d31CTIQ+g8jpMbgs82f72ErkdptcXqvyAprjV1uDyM02nfW/Hc?= =?us-ascii?Q?vVa/GYuV/BEKmotUZB4UZxw0pmJCEfR/u73N3Y4tPR25uk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NQmobKaeDqZiFLXdakMsFE0gr6MmYvpfc4F2V?= =?us-ascii?Q?eCCNG5dGYd4gmsAChMHEJB2/PJ29BmzMG?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0701MB2026;6:ud8/plPankVViQuCO4IvJlT2wbP95VqFVFGNLSE4?= =?us-ascii?Q?Yx/3eDVIypRxvVV1FnjOurfpB07frC0q/3Pa1uHuSoCuh80KmPcWYYRWB7i0?= =?us-ascii?Q?a8R+0NiMC6FE0LWanBDdM8vHtw9uVhKxLLtEflUEZxsxyLkp9aWK7syq1fLD?= =?us-ascii?Q?8SiBpvW/POROL1tP/zGSQPy7PWf03pJSlNVGv/OZpGRsmyRz8YtSLTqlN7kk?= =?us-ascii?Q?HX+z7sc3p3v7IVTfxRK/TmmPfgip8OWJzGbla0CtrhGKc1kqrkknvwWXs4XC?= =?us-ascii?Q?l3odzJGoTaWPC3BCsNfSrR/z+SezD6M5gxF75TPKiC5U/Pd03Sk2fzylzrkG?= =?us-ascii?Q?dZ2d4rgWd4b+In59WgJI6CBHnaZOcwbB1HfRpFY0/IcMMZfK0cpWmjgGmydT?= =?us-ascii?Q?k9WEV2gVg7GwDa2tD3zuO8RGA6mLSbs2iY0411F+xCZtsMJLqI2IYhdIFux8?= =?us-ascii?Q?w7vi71ykhuPEwW+35YRnyzLXVQcR1KmIPyELMOJhxYLlslkiehAmJWCbsS7v?= =?us-ascii?Q?4ppuVzCHoBGzxmqL6y6s+g/n7ZLDQmC08bG3gAFnM9bAofZEbqmKpT2Z1h88?= =?us-ascii?Q?hdJT9VfZp3cTDAaORlo09du4RrAOLGVsUTj646MOYpk4CD9EczAFncp4OMwM?= =?us-ascii?Q?CZlD2Hm00HwGV8/ju3MEgMwzV1+9j4xrKXkQm7pl593k2nkYgn4tC81cRE4Q?= =?us-ascii?Q?WL8oelsOFpeV66DFhQiVzk5LMZjaXtk8RDbWI0+8EAR74vLN/ytrHcUqwaT7?= =?us-ascii?Q?MAaWLBIccyPsMTZvSfge2nYNW6ORtMS6dhSMXMADbc6LLTp5pFyQcn1qPr3R?= =?us-ascii?Q?jDvm/3BsqZn8VKNclgxHDMbiTdw8zo8Hhv1X9XaFJr8URzbf5NSX3JgJXdjm?= =?us-ascii?Q?vAk0p3ph8tVIsknh3Qw02V5AgFZeDWz5PKmDT8O46zPD7xPNMJlCqoFd+Jwh?= =?us-ascii?Q?+jRb8QJGzbJZ1ki7hGRkRNsHAKR7GJfYwRFtSlqxNh3lrzMh98cHxpGJB0kN?= =?us-ascii?Q?b3Y=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB2026;5:qE4llO8gklepsQ3HCw4lO+eWPcnu5IPOeXwtMF02Zt3VCK2eLzZAn0Deum/1n4lnxkTXFNmY925/IeC4xOASge2JKYriUyRxAqKcaan8O5N+tXm/MlnIpefGy60WVrxGvvCFJDR0l9dsgDEn0JVqdLP1+uRMelDL6wSVpkqsXOKfPCclPSUg2vKgzB8rrHD21y1eyQdwuRrTyui7xFnRRuES1k+lKzJ2TEhJnvtGE0+O+kfhl2I5jEdT4Tjs87GF+yEQVuLosw9hGia0uq8KZHRcaAbEcB6FZ7fvOFtbACQwF1h/x8pD30LS/KUOWzEeapUm0ZuFiD+8Um4fXIgl+5Vh2n//NE9g6790Y2Z8nfxzxujA/qr0RmElyAg5ftypTKoq/8X9R+kzyqmDlNmylwCwwHzc/LW9GVxu1K03QRApVJoT90NBcC7AtuzDeVDvCUhVrIoWzgr2KRdBf6ZAX4V/4+HgC44QrWA7WuH2MB1bmnBNlbu0iusK6+kLf402;24:6quRXSZ6ne7Ef5H0TeBdlLKZyaGgXv+Vg8WTJjOTd34voplyNyeaV1+B2refhxZmjkzVVqizBYYLPbjbjqibD8qnML8irdXbNXxOjsfjyiE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB2026;7:7bZpW2TOnqma/Ns5aRkmecXwtUNUEzZRYSGXbdbn63toITeDDbkj+tYVvoVqfNmccBNckjjfURhX2ZVsLauHDoX5vgvPmCL2nrKt0JWGKcvUR6YGViX3nVGOGoGtLlFmF9ucjatndNJ7M/R0DYFbVVTnzYhP0FZEMsBjxL9ljuuzN9JxgHeYsCgTjGnVWdifY9NkJ6uknlQCvCVXx5CyVyXC78FtaP0NPqrZBCaQKcDIO8+6B4vj4ViHFU+kAGDNTin8ZdBBeS0HlkvBLmeUEPUFZfzmWZ1x36I6sb6ZrXrK1FPCFe01kxdQ+EcjOOOIJ9MW1wcvIQr6gkv3AAtJpAc2MMutYRwfeHZgzeKvSyx/aQ0BexXRaucVP5Qm6QzO6Yayg7icVH3HCUg+oA8IcYTjdXMa0AowD/LmIhO/qwUfsRQkI1Sl49W0sbHJFQd+dLOWTDrBrVjspxh913LFSB94AjMjAk3oypozdHrFyp40ppwNcjULM66Gw8Qaa5xyiWCVD7oQ3JzWuCvOSnOE6fAHwrQDx/7nSuU38zpP4HbZO6LdEfic+Z6hbbXv1O9FtdsBS4O2B2dSoBNeAzQMIbzPOPvroEMyX/q1rDwTAy0VzgwWwfSIaDnSjL4QpXaTNSBqsAz6aLV5abW/4Vcbgs28zZaPfzdFcbS0XTi0f8NlHidY8APz4Gw7hBRD+iDh2v5IFO3LsLCDYRA/6lcFwYs63IrkLl6EwrDyRjUIcMzR5WN03qcFmt+5xL3C2GOZCghlHVz92QTfc3jOZl0Yqh/nuEWWuqMXsi+N/a3wLb4= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2017 12:25:44.9897 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB2026 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7389 Lines: 199 From: Linu Cherian Cavium ThunderX2 SMMU implementation doesn't support page 1 register space and PAGE0_REGS_ONLY option is enabled as an errata workaround. This option when turned on, replaces all page 1 offsets used for EVTQ_PROD/CONS, PRIQ_PROD/CONS register access with page 0 offsets. SMMU resource size checks are now based on SMMU option PAGE0_REGS_ONLY, since resource size can be either 64k/128k. For this, arm_smmu_device_dt_probe/acpi_probe has been moved before platform_get_resource call, so that SMMU options are set beforehand. Signed-off-by: Linu Cherian Signed-off-by: Geetha Sowjanya --- Documentation/arm64/silicon-errata.txt | 1 + .../devicetree/bindings/iommu/arm,smmu-v3.txt | 6 ++ drivers/iommu/arm-smmu-v3.c | 68 ++++++++++++++----- 3 files changed, 57 insertions(+), 18 deletions(-) diff --git a/Documentation/arm64/silicon-errata.txt b/Documentation/arm64/silicon-errata.txt index 10f2ddd..4693a32 100644 --- a/Documentation/arm64/silicon-errata.txt +++ b/Documentation/arm64/silicon-errata.txt @@ -62,6 +62,7 @@ stable kernels. | Cavium | ThunderX GICv3 | #23154 | CAVIUM_ERRATUM_23154 | | Cavium | ThunderX Core | #27456 | CAVIUM_ERRATUM_27456 | | Cavium | ThunderX SMMUv2 | #27704 | N/A | +| Cavium | ThunderX2 SMMUv3| #74 | N/A | | | | | | | Freescale/NXP | LS2080A/LS1043A | A-008585 | FSL_ERRATUM_A008585 | | | | | | diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt b/Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt index be57550..6ecc48c 100644 --- a/Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt +++ b/Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt @@ -49,6 +49,12 @@ the PCIe specification. - hisilicon,broken-prefetch-cmd : Avoid sending CMD_PREFETCH_* commands to the SMMU. +- cavium,cn9900-broken-page1-regspace + : Replaces all page 1 offsets used for EVTQ_PROD/CONS, + PRIQ_PROD/CONS register access with page 0 offsets. + Set for Cavium ThunderX2 silicon that doesn't support + SMMU page1 register space. + ** Example smmu@2b400000 { diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 380969a..2dea4a9 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -597,6 +597,7 @@ struct arm_smmu_device { u32 features; #define ARM_SMMU_OPT_SKIP_PREFETCH (1 << 0) +#define ARM_SMMU_OPT_PAGE0_REGS_ONLY (1 << 1) u32 options; struct arm_smmu_cmdq cmdq; @@ -663,9 +664,20 @@ struct arm_smmu_option_prop { static struct arm_smmu_option_prop arm_smmu_options[] = { { ARM_SMMU_OPT_SKIP_PREFETCH, "hisilicon,broken-prefetch-cmd" }, + { ARM_SMMU_OPT_PAGE0_REGS_ONLY, "cavium,cn9900-broken-page1-regspace"}, { 0, NULL}, }; +static inline void __iomem *arm_smmu_page1_fixup(unsigned long offset, + struct arm_smmu_device *smmu) +{ + if ((offset > SZ_64K) && + (smmu->options & ARM_SMMU_OPT_PAGE0_REGS_ONLY)) + offset -= SZ_64K; + + return smmu->base + offset; +} + static struct arm_smmu_domain *to_smmu_domain(struct iommu_domain *dom) { return container_of(dom, struct arm_smmu_domain, domain); @@ -1961,8 +1973,8 @@ static int arm_smmu_init_one_queue(struct arm_smmu_device *smmu, return -ENOMEM; } - q->prod_reg = smmu->base + prod_off; - q->cons_reg = smmu->base + cons_off; + q->prod_reg = arm_smmu_page1_fixup(prod_off, smmu); + q->cons_reg = arm_smmu_page1_fixup(cons_off, smmu); q->ent_dwords = dwords; q->q_base = Q_BASE_RWA; @@ -2363,8 +2375,10 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass) /* Event queue */ writeq_relaxed(smmu->evtq.q.q_base, smmu->base + ARM_SMMU_EVTQ_BASE); - writel_relaxed(smmu->evtq.q.prod, smmu->base + ARM_SMMU_EVTQ_PROD); - writel_relaxed(smmu->evtq.q.cons, smmu->base + ARM_SMMU_EVTQ_CONS); + writel_relaxed(smmu->evtq.q.prod, + arm_smmu_page1_fixup(ARM_SMMU_EVTQ_PROD, smmu)); + writel_relaxed(smmu->evtq.q.cons, + arm_smmu_page1_fixup(ARM_SMMU_EVTQ_CONS, smmu)); enables |= CR0_EVTQEN; ret = arm_smmu_write_reg_sync(smmu, enables, ARM_SMMU_CR0, @@ -2379,9 +2393,9 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass) writeq_relaxed(smmu->priq.q.q_base, smmu->base + ARM_SMMU_PRIQ_BASE); writel_relaxed(smmu->priq.q.prod, - smmu->base + ARM_SMMU_PRIQ_PROD); + arm_smmu_page1_fixup(ARM_SMMU_PRIQ_PROD, smmu)); writel_relaxed(smmu->priq.q.cons, - smmu->base + ARM_SMMU_PRIQ_CONS); + arm_smmu_page1_fixup(ARM_SMMU_PRIQ_CONS, smmu)); enables |= CR0_PRIQEN; ret = arm_smmu_write_reg_sync(smmu, enables, ARM_SMMU_CR0, @@ -2605,6 +2619,14 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu) } #ifdef CONFIG_ACPI +static void acpi_smmu_get_options(u32 model, struct arm_smmu_device *smmu) +{ + if (model == ACPI_IORT_SMMU_V3_CAVIUM_CN99XX) + smmu->options |= ARM_SMMU_OPT_PAGE0_REGS_ONLY; + + dev_notice(smmu->dev, "option mask 0x%x\n", smmu->options); +} + static int arm_smmu_device_acpi_probe(struct platform_device *pdev, struct arm_smmu_device *smmu) { @@ -2617,6 +2639,8 @@ static int arm_smmu_device_acpi_probe(struct platform_device *pdev, /* Retrieve SMMUv3 specific data */ iort_smmu = (struct acpi_iort_smmu_v3 *)node->node_data; + acpi_smmu_get_options(iort_smmu->model, smmu); + if (iort_smmu->flags & ACPI_IORT_SMMU_V3_COHACC_OVERRIDE) smmu->features |= ARM_SMMU_FEAT_COHERENCY; @@ -2652,6 +2676,14 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev, return ret; } +static unsigned long arm_smmu_resource_size(struct arm_smmu_device *smmu) +{ + if (smmu->options & ARM_SMMU_OPT_PAGE0_REGS_ONLY) + return SZ_64K; + else + return SZ_128K; +} + static int arm_smmu_device_probe(struct platform_device *pdev) { int irq, ret; @@ -2668,9 +2700,20 @@ static int arm_smmu_device_probe(struct platform_device *pdev) } smmu->dev = dev; + if (dev->of_node) { + ret = arm_smmu_device_dt_probe(pdev, smmu); + } else { + ret = arm_smmu_device_acpi_probe(pdev, smmu); + if (ret == -ENODEV) + return ret; + } + + /* Set bypass mode according to firmware probing result */ + bypass = !!ret; + /* Base address */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (resource_size(res) + 1 < SZ_128K) { + if (resource_size(res) + 1 < arm_smmu_resource_size(smmu)) { dev_err(dev, "MMIO region too small (%pr)\n", res); return -EINVAL; } @@ -2697,17 +2740,6 @@ static int arm_smmu_device_probe(struct platform_device *pdev) if (irq > 0) smmu->gerr_irq = irq; - if (dev->of_node) { - ret = arm_smmu_device_dt_probe(pdev, smmu); - } else { - ret = arm_smmu_device_acpi_probe(pdev, smmu); - if (ret == -ENODEV) - return ret; - } - - /* Set bypass mode according to firmware probing result */ - bypass = !!ret; - /* Probe the h/w */ ret = arm_smmu_device_hw_probe(smmu); if (ret) -- 1.7.1