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: 160654 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp7483jan; Wed, 20 Mar 2019 01:31:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSB3/RFamuuZ+IzHUypmBRt/oGEXdpBWC9+P0AIHZTChV2YgA0Cpd9U8vvgYYi0hrwYFGC X-Received: by 2002:a17:902:8e82:: with SMTP id bg2mr6753263plb.217.1553070685674; Wed, 20 Mar 2019 01:31:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553070685; cv=none; d=google.com; s=arc-20160816; b=QmswW8aYKJVOghaiax5GA9nsi+njtmr7R0j2dxLZ028bBq8FCNOBZVBzbFcg3719T7 eAHTUhxGFLiAWG1IJnd+Hd8qAfH24qTaz/LFXISEy7VebaCeblDgtwIksEzl2Q7ePiMi +qqDl702mF0yJ2lfKlSL3o4pbI8y46GKMZiGCS/1WG1uARnn5C2VourhL1607d/a2kqm OJnwV/urrnrPOXADO0ls1hAD/p0177cg0I7fqrw8YA59mENKNtVQvs+eg+WaZlCYi9jG gQyInc5XlsKc6nGHT5/QWDE54Me5nrDiFf1nOlZYQpuNbv9jgFhnV9RNup+v1VgPEop3 qBOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=L/t7ijf9ey/1rUgx6swGc/ZJCfH3ZpxRkYd1HfGBRrw=; b=hUv0Nk3OfXjNU08yj7bNnsuewvOOjX2niygSP4BBdSzbhQd/i3iiH79k3QhLakkKDl msg/PLYttAk2TgPeLcwgM9kgR06qIsqQL6MPhpqnvHwAaGQExeuTr1hVFOlrlfU0wt/V j9JrhRmIqluhQLW5w8Hwkyg1pewcX4+UBC+NG76ogvzajeiXeYns3+QcaSlC5I9yLgRe TT98aDv7+9XvQ6KmRk9IVPrgGyR4nykYEHhStO3ZUbRPY1WkZWRBUrEDP7mI91QxPm/T UjCnoPEXFjMi7suUcWJblFWRV/YshqQ1Xzyz2Wlf9FbqAi1EMI0HJFcxFgBabmyFGVHy ZzyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="tCFcVg/w"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k29si1163925pgb.267.2019.03.20.01.31.25; Wed, 20 Mar 2019 01:31:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="tCFcVg/w"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727169AbfCTIbY (ORCPT + 31 others); Wed, 20 Mar 2019 04:31:24 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:42280 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726438AbfCTIbX (ORCPT ); Wed, 20 Mar 2019 04:31:23 -0400 Received: by mail-oi1-f195.google.com with SMTP id w139so1110466oie.9 for ; Wed, 20 Mar 2019 01:31:22 -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=kWr//rpDTPtKO0E+F7XRRLdbWLbgA8rpahdDkOyDeQy1dQY23YK0bbpspoWlHZsCIc Qgafya5/X9fYVmVYT9bGRNPk01gD7JULoJn32xr0nTS2aoDrrHADMMxALLq8+SfyzRM+ ytBpD6/PRgQzCAZakcdeduQw9/7sPUviE4ANilIbpfUY2wvGQ1kVlGBmew8OSSK6e17o iqDSItlh5rJINLQp1ec6t07hw368/CBwk0mWc4fFCZptoLPBqz02nk4rdH79kwBkW9D9 NvFvuGUM7x72Nxw61xZSngo+qb5LvXvIli2IHbWezhR62AQZXEGatF8tjrXlGpS/MJPR m83Q== X-Gm-Message-State: APjAAAUXdeWcyAvRCKKC6htICilNDRYu/Q0aIBX0ywmYUfm5+UFjzzQR ScPUpI5W+4IVN4Q3xzj84gQfEw== 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 Cc: Leo Yan 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(+) -- 2.17.1 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"; };