From patchwork Mon May 22 15:06:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Murphy X-Patchwork-Id: 9740939 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4D0D26034C for ; Mon, 22 May 2017 16:03:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E44C280B0 for ; Mon, 22 May 2017 16:03:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32E2D28698; Mon, 22 May 2017 16:03:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C9903280B0 for ; Mon, 22 May 2017 16:03:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=0bU1LqS55BPG4Dv+TKcJbVOm7DFjVlCA1hflYUSAqY8=; b=L/iMG2jv0O8et54R+GCXbafuTw JeQq8ky0+9XoGyAtiRvls7ihX3Xh7BnxMnfjE7XGvDf6mLGotWQjutNLQwAKfn4Lg3KkK+svgGcE/ +1j8+abIYYauavwdBDLoIQ4dfqjXOWLfmgVWA2O/v6CkxNJY8QtRZNvckkfNvDqCGsGZeg2UQSYBp QbLyRqzZ3KRi9yq8FHJ+EGxlM6TuCkLsBKWOsYkZy8D5ndAiUMjP7EVa+2ZJbP2MkGgvFPCaq7jRa /YOk7K+q3dpGxlC1qytQM0ebsoTwv9JXzHjT85BL8co+earsJLcVYF5CWHnSyVLlQfHFeARrJT6Zt +TDqc9jw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dCpny-0000q5-KR; Mon, 22 May 2017 16:03:34 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dCpnw-0000pF-LP for linux-arm-kernel@bombadil.infradead.org; Mon, 22 May 2017 16:03:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yXo81AdbysyNVnNXOI8/bkDYzBvI7kUSWfd1vvjcU9s=; b=c+RE+YxGO9AdIBZLo6zpLvB0o 0on0k42ymRo5hFezb/5XWTcsURMcsM2T+o7Qj7sV8/koi+15kZ0Qw1kEylrXKwEkZ1v5RFxM2tLT1 3SULngqGiIxfPphPCaESELFGGfRklFVdpgmTVRDaNQ4c/rQntqI49EMyTaEZnPY8ILOofQ/TBi1Ml a+DNF2AdsgTEiNTY1vk9je933AOJHgWHFk8BA1pvqkcnUx2SchtXu4K5eEQl9p6gEg9sfUHVFJRq0 OuVvvzH0NMnUwct9+cE+AikTqRPoIfDnLsYJcU1EnHgoW3Zf16cxVaVItOU8is6aBNRqm9vHx0elK e6tRTEABQ==; Received: from foss.arm.com ([217.140.101.70]) by merlin.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dCovY-0000Do-GT for linux-arm-kernel@lists.infradead.org; Mon, 22 May 2017 15:07:21 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C922F1435; Mon, 22 May 2017 08:07:00 -0700 (PDT) Received: from e110467-lin.cambridge.arm.com (e110467-lin.cambridge.arm.com [10.1.210.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 860BD3F53D; Mon, 22 May 2017 08:06:58 -0700 (PDT) From: Robin Murphy To: will.deacon@arm.com, joro@8bytes.org Subject: [PATCH v2 2/2] iommu/arm-smmu: Plumb in new ACPI identifiers Date: Mon, 22 May 2017 16:06:38 +0100 Message-Id: X-Mailer: git-send-email 2.12.2.dirty In-Reply-To: <11ef7d28c535c01d42b7b3c8e632934f0e0f1048.1495459319.git.robin.murphy@arm.com> References: <11ef7d28c535c01d42b7b3c8e632934f0e0f1048.1495459319.git.robin.murphy@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170522_110720_671651_294C4BF1 X-CRM114-Status: UNSURE ( 8.47 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lorenzo.pieralisi@arm.com, gabriele.paoloni@huawei.com, gakula@caviumnetworks.com, shameerali.kolothum.thodi@huawei.com, rrichter@cavium.com, linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org, hanjun.guo@linaro.org, linu.cherian@cavium.com, stable@vger.kernel.org, john.garry@huawei.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Revision C of IORT now allows us to identify ARM MMU-401 and the Cavium ThunderX implementation. Wire them up so that we can probe these models once firmware starts using the new codes, and so that the appropriate features and quirks get enabled when we do. For the sake of backports and mitigating sychronisation problems with the ACPICA headers, we'll carry a backup copy of the new definitions locally for the short term to make life simpler. CC: stable@vger.kernel.org # 4.10 Acked-by: Robert Richter Tested-by: Robert Richter Signed-off-by: Robin Murphy --- v2: Add local backup definitions This is ready to go regardless of patch 1. The stable backport is in likely anticipation of machines with updated firmware paired with stable distro kernels, which would be unable to recognise and probe the SMMU otherwise. Robin. drivers/iommu/arm-smmu.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 7ec30b08b3bd..79b9bb7d4783 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -312,6 +312,14 @@ enum arm_smmu_implementation { CAVIUM_SMMUV2, }; +/* Until ACPICA headers cover IORT rev. C */ +#ifndef ACPI_IORT_SMMU_CORELINK_MMU401 +#define ACPI_IORT_SMMU_CORELINK_MMU401 0x4 +#endif +#ifndef ACPI_IORT_SMMU_CAVIUM_SMMUV2 +#define ACPI_IORT_SMMU_CAVIUM_SMMUV2 0x5 +#endif + struct arm_smmu_s2cr { struct iommu_group *group; int count; @@ -2073,6 +2081,10 @@ static int acpi_smmu_get_data(u32 model, struct arm_smmu_device *smmu) smmu->version = ARM_SMMU_V1; smmu->model = GENERIC_SMMU; break; + case ACPI_IORT_SMMU_CORELINK_MMU401: + smmu->version = ARM_SMMU_V1_64K; + smmu->model = GENERIC_SMMU; + break; case ACPI_IORT_SMMU_V2: smmu->version = ARM_SMMU_V2; smmu->model = GENERIC_SMMU; @@ -2081,6 +2093,10 @@ static int acpi_smmu_get_data(u32 model, struct arm_smmu_device *smmu) smmu->version = ARM_SMMU_V2; smmu->model = ARM_MMU500; break; + case ACPI_IORT_SMMU_CAVIUM_SMMUV2: + smmu->version = ARM_SMMU_V2; + smmu->model = CAVIUM_SMMUV2; + break; default: ret = -ENODEV; }