From patchwork Wed Mar 20 08:31:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 1058931 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SfAzNtQz"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="tCFcVg/w"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44PNS41Ml9z9sNJ for ; Wed, 20 Mar 2019 19:31:32 +1100 (AEDT) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=jedCqEpapQJeHagZ1TVHT623RTDLuF5wSY4Knxj2Hi8=; b=SfAzNtQzvY/tkN VOVIxld8A+pcSzvZ2goJnPT6Rl5tNyClrA5ep14a+vcvv7IsHabu7gLVEdRwD/VtZu4b5PaP5EqMr g5/YWK+GE+G8jCiDZJLk8ilA0iPdy0KU9LkL1wuwj4l8VodfFfDdduCn8jkHYlCWd/2JQwcmApVAw 5Y1iXZ2Mk65lGUJ4OO0y6bjv4ozxeb6f3PrD73ALkKC5et8qUNWTbWr25EFpx1v8RBN73ppqJP7zc ToDBFiArA/2vHbd73T2/SqMK0L2xsqLhAJFQOBbbotgrNFRczxtyX3hgtQSEb3kC4Y+0mFJURWlin xZvBm9lG3cefxLKjXbkA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6WdD-0006NQ-Uo; Wed, 20 Mar 2019 08:31:27 +0000 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6Wd9-0006MM-Qs for linux-arm-kernel@lists.infradead.org; Wed, 20 Mar 2019 08:31:25 +0000 Received: by mail-oi1-x242.google.com with SMTP id e22so1148507oiy.0 for ; Wed, 20 Mar 2019 01:31:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=L/t7ijf9ey/1rUgx6swGc/ZJCfH3ZpxRkYd1HfGBRrw=; b=tCFcVg/w9oU+vqz1HjqYUztEuejVM340ryCK8ujnOP4RQQtCR8TYFd0pgxJMqjnRuJ Ft3NQrEhbAS2BMfjJ1gRC+l54gfNnc3G36QSiCkYwOeISin2+UVTw9G+rZ5Xx25foMxO OcWZzn9WxciTZQmo4dXAgjgl/HkZmN+o6tp78kAITM9jUCs7aItcgbxdCYjfDzLScihT Y4Ri2ZRdZ+smKmpenbpALz9mKw8OAdLwhOx9fXpVsORuF1mIfvFeHwSpj4LJx/eCYQGP rwCw2kRXCNUZqfm2mJZfikH3D2oyniApwzPetcdSCuFw0fL81k5czjUIuinUQsCmT9+1 5E3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=L/t7ijf9ey/1rUgx6swGc/ZJCfH3ZpxRkYd1HfGBRrw=; b=IxX8oQ9vyBwFOCWd69JUFxao6oSyJkHaTttftrWYzvoI1exYxnWfTUnzoOhjiqWmJ9 JcE8LaGiZ6wC6vIC192peyaRhmLa8ulUNmnBiY6sJjO2ztUdwQ7v3LTOxdsFAK+0XW9v sQumuAoIYr0Gj7DmEDC3ak5mNlDruMXDq/1gxtDGQVjbMWzvHO9RP645CGwUj74AskU7 Sue+RjzIzWt6a9Q9/AhmgVaZYAxHbXlUbI4UD7fNrah83yERTTPVHG3t7AdDVc57DJdE 4HzyE/X1JAjD6rHUhh4bRzT4rQlIQ1tFTMdfdolrbuUHdXg9JfkDHrJPBMl9nFnRbrVj lVDg== X-Gm-Message-State: APjAAAUtGqT6D+sGOQmWAvImnrcLUEbwm1YWDuNZesn4m8IjtA0IPpIs oll99Ls7BSTdc/6MP3jGbYZtq0dKBNc= X-Google-Smtp-Source: APXvYqztkHQvuvCUcWBOlzcHRqQirwPlf2/NFq/tGqYSPmV5tjSrDDbmKjmPIfDD+E79PpuJgf0sRA== X-Received: by 2002:aca:abce:: with SMTP id u197mr4430167oie.67.1553070682333; Wed, 20 Mar 2019 01:31:22 -0700 (PDT) Received: from localhost.localdomain (li808-42.members.linode.com. [104.237.132.42]) by smtp.gmail.com with ESMTPSA id u201sm534704oiu.2.2019.03.20.01.31.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Mar 2019 01:31:21 -0700 (PDT) From: Leo Yan To: Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi , Rob Herring , Mark Rutland , Robin Murphy , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm64: dts: juno: Enable smmu_pcie for Juno r1/r2 Date: Wed, 20 Mar 2019 16:31:05 +0800 Message-Id: <20190320083105.8954-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190320_013123_879611_A3FFB669 X-CRM114-Status: GOOD ( 12.15 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Yan Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Though PCIe controller has been enabled on Juno r1/r2, but it misses to enable its connected SMMU. From the testing, even without set this SMMU status property to 'okay', the PCIe NIC device still works well. Since the SMMU is not enabled in DT binding and its iommu_groups is not created properly, finally this prevents to enable vfio-pci for NIC device with KVM. After reviewing the code in dts, Juno r1/r2 both have enabled PCIe controller but Juno r0 board (in juno.dts) doesn't contain PCIe controller; hence this patch only change SMMU status property to 'okay' for Juno r1/r2 dts files for the sake of only enabling it for Juno r1/r2 and avoiding touching Juno r0. Committer testing on Juno r2: Before: root@debian:~# tree /sys/kernel/iommu_groups/ /sys/kernel/iommu_groups/ ├── 0 │   ├── devices │   │   ├── 7ffb0000.ohci -> ../../../../devices/platform/7ffb0000.ohci │   │   └── 7ffc0000.ehci -> ../../../../devices/platform/7ffc0000.ehci │   ├── reserved_regions │   └── type └── 1 ├── devices │   └── 20070000.etr -> ../../../../devices/platform/20070000.etr ├── reserved_regions └── type 7 directories, 4 files After: root@debian:~# tree /sys/kernel/iommu_groups/ /sys/kernel/iommu_groups/ ├── 0 │   ├── devices │   │   ├── 0000:00:00.0 -> ../../../../devices/platform/40000000.pcie/pci0000:00/0000:00:00.0 │   │   ├── 0000:01:00.0 -> ../../../../devices/platform/40000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0 │   │   ├── 0000:02:01.0 -> ../../../../devices/platform/40000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:01.0 │   │   ├── 0000:02:02.0 -> ../../../../devices/platform/40000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:02.0 │   │   ├── 0000:02:03.0 -> ../../../../devices/platform/40000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:03.0 │   │   ├── 0000:02:0c.0 -> ../../../../devices/platform/40000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:0c.0 │   │   ├── 0000:02:10.0 -> ../../../../devices/platform/40000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:10.0 │   │   ├── 0000:02:1f.0 -> ../../../../devices/platform/40000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:1f.0 │   │   ├── 0000:03:00.0 -> ../../../../devices/platform/40000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:01.0/0000:03:00.0 │   │   └── 0000:08:00.0 -> ../../../../devices/platform/40000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:1f.0/0000:08:00.0 │   ├── reserved_regions │   └── type ├── 1 │   ├── devices │   │   ├── 7ffb0000.ohci -> ../../../../devices/platform/7ffb0000.ohci │   │   └── 7ffc0000.ehci -> ../../../../devices/platform/7ffc0000.ehci │   ├── reserved_regions │   └── type └── 2 ├── devices │   └── 20070000.etr -> ../../../../devices/platform/20070000.etr ├── reserved_regions └── type 19 directories, 6 files Signed-off-by: Leo Yan --- arch/arm64/boot/dts/arm/juno-r1.dts | 4 ++++ arch/arm64/boot/dts/arm/juno-r2.dts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/arm/juno-r1.dts b/arch/arm64/boot/dts/arm/juno-r1.dts index b2b7ced633cf..67e161a6272a 100644 --- a/arch/arm64/boot/dts/arm/juno-r1.dts +++ b/arch/arm64/boot/dts/arm/juno-r1.dts @@ -226,6 +226,10 @@ status = "okay"; }; +&smmu_pcie { + status = "okay"; +}; + &pcie_ctlr { status = "okay"; }; diff --git a/arch/arm64/boot/dts/arm/juno-r2.dts b/arch/arm64/boot/dts/arm/juno-r2.dts index ab77adb4f3c2..0e1c5c814b01 100644 --- a/arch/arm64/boot/dts/arm/juno-r2.dts +++ b/arch/arm64/boot/dts/arm/juno-r2.dts @@ -226,6 +226,10 @@ status = "okay"; }; +&smmu_pcie { + status = "okay"; +}; + &pcie_ctlr { status = "okay"; };