Received: by 10.223.185.116 with SMTP id b49csp3348952wrg; Tue, 13 Feb 2018 00:59:00 -0800 (PST) X-Google-Smtp-Source: AH8x224X4fdkSVaUiwjUrxflr/gLOgo2SjcCrQgdoJi8emxQ+QcXyIkC71Uaw+Bt+PvAMObCeH6Z X-Received: by 10.98.162.25 with SMTP id m25mr542322pff.136.1518512340681; Tue, 13 Feb 2018 00:59:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518512340; cv=none; d=google.com; s=arc-20160816; b=KxLMy6byZksSVYcFrpQgbUOb1fW48VC885FSTlb3vDF3lfSIUfIsCzs617jB342Jaw dHxXRTH3xvMTudHqF7Q+vG+Y4bNcgRkRCiWrzpHNSfZUEaExPvIdTPgFV2TQH4u+IQrf pLBATYxOKTl3ndx0SfnjoH/8zbZtFbwftCY8cTGV8cEfYY/z7nlenfJuSBYB/fUy5TO3 bhTKLRJHQx2CIXj0rE1lN6Rpj5mjL6MjLVbOG/1qH4EFWcXnlJPzFiWr0aEYCaHmFJsw 30+UYOI0SG6r3TE16CDuSXthIsbeelaTB8cxr4nIGrEMpBvHDtv/xpae7T1BBD5PSHp/ 29JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=0qT+pJFENveoS64OQ+4AucXg8dUaEogmXcGuNKfZ4rY=; b=JLBS28hLQ+c8IvtfIzTVP9d2dXWRq9yrfVCXpKN20FQiJomSVHYOl7JEUaQS6dKzs4 PqWOg/FMT3IG0jn6gMITzd3UR7JPoce+JXCaDOYcRY6pdh/q+O4uQKQtewJFcPVza+Ma 1nz9byfc4T7xXgw0eQfvwAnGs5lxe55SfhbW74x1sNVEnQvNjCIHZjYfbXvg6Dy03yH1 WrV6njxj4NQKDEG9PaAHLx2+P8b0x0KxupNzXVMrObVuii+CHDMyByOAWlGcUI9xT2Z6 CIr4aiE8QeYMD0Dwj8PxtmqnpD9nHysXyPP10dVT7phfITDRCiagm0W2q6UaAAd9SrSY 0b3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OqNAunNb; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k72si978190pge.131.2018.02.13.00.58.45; Tue, 13 Feb 2018 00:59:00 -0800 (PST) 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=@chromium.org header.s=google header.b=OqNAunNb; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933819AbeBMI6G (ORCPT + 99 others); Tue, 13 Feb 2018 03:58:06 -0500 Received: from mail-ua0-f195.google.com ([209.85.217.195]:34467 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933748AbeBMI6D (ORCPT ); Tue, 13 Feb 2018 03:58:03 -0500 Received: by mail-ua0-f195.google.com with SMTP id g5so11149795uac.1 for ; Tue, 13 Feb 2018 00:58:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0qT+pJFENveoS64OQ+4AucXg8dUaEogmXcGuNKfZ4rY=; b=OqNAunNbVLJrj+5DwVsulYoVOQ8q2tekYJdvr6Dv1OfFXqV5diLCXNOWj2bXsIixMD JAFzbnYYt9nyOlNVcn/maVsNzXDuInXVS1e69VeWiTU/Mqp9jHHs7fdHj7dkJJxchADs ITOXDXqUUnzZbOV9v4r14Hf16CjYoG8XwyqpY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0qT+pJFENveoS64OQ+4AucXg8dUaEogmXcGuNKfZ4rY=; b=WcvTd6xJYFV2nV9UXsN7laLRPn6pmnofckyj33dz/kV4sRDrvg9ZkK75Q/44pve4GU ef3Q0+aNdyVg9H7gFOls9TH8KsPoet/+l9deXveInV6pA1p6QK0EPUOOhKcbiz54xsta p2hb94g8//o0r8YzGrNpZhVa/ReQ5KZb438gYk6sUBa0l5K2kE81f/WwQ5ci75oQt+09 xkhLd1JhXNIkIMzNitQaqHIxCqGZeTRt2Qr7z8uT2/WZkhPgfTrUsd37cCTmiRWawuTj WHpZMPhleCaL5yUo1zoa5Fj5u3ghznX8HbwVkbu+DppA3eDy+Me7OlskKYUD4EwuJUUv 5rzA== X-Gm-Message-State: APf1xPB+eZ9dRBVphxF+vlnogNCvCm+vN5duMzoC4b8UdRXzJsC+n9GY W+Hm4zQA2LdJOloecXnq9W1H1KYdI/o= X-Received: by 10.159.38.109 with SMTP id 100mr422916uag.9.1518512282378; Tue, 13 Feb 2018 00:58:02 -0800 (PST) Received: from mail-ua0-f182.google.com (mail-ua0-f182.google.com. [209.85.217.182]) by smtp.gmail.com with ESMTPSA id b192sm3833368vkd.14.2018.02.13.00.58.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Feb 2018 00:58:01 -0800 (PST) Received: by mail-ua0-f182.google.com with SMTP id i5so11129367uai.10 for ; Tue, 13 Feb 2018 00:58:00 -0800 (PST) X-Received: by 10.176.77.152 with SMTP id s24mr457152uag.163.1518512280352; Tue, 13 Feb 2018 00:58:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.0.68 with HTTP; Tue, 13 Feb 2018 00:57:39 -0800 (PST) In-Reply-To: <1518173826-11759-1-git-send-email-vivek.gautam@codeaurora.org> References: <1517999482-17317-6-git-send-email-vivek.gautam@codeaurora.org> <1518173826-11759-1-git-send-email-vivek.gautam@codeaurora.org> From: Tomasz Figa Date: Tue, 13 Feb 2018 17:57:39 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 5/6] iommu/arm-smmu: Add support for qcom,smmu-v2 variant To: Vivek Gautam , Rob Herring Cc: "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Mark Rutland , "Rafael J. Wysocki" , Robin Murphy , Will Deacon , Rob Clark , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel , freedreno@lists.freedesktop.org, David Airlie , Greg KH , sboyd@codeaurora.org, linux-arm-msm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vivek, Thanks for the patch. Please see my comments inline. On Fri, Feb 9, 2018 at 7:57 PM, Vivek Gautam wrote: > qcom,smmu-v2 is an arm,smmu-v2 implementation with specific > clock and power requirements. This smmu core is used with > multiple masters on msm8996, viz. mdss, video, etc. > Add bindings for the same. > > Signed-off-by: Vivek Gautam > Reviewed-by: Rob Herring > --- > > Changes in v8: > - Added the missing IOMMU_OF_DECLARE declaration for "qcom,smmu-v2" > > .../devicetree/bindings/iommu/arm,smmu.txt | 43 ++++++++++++++++++++++ > drivers/iommu/arm-smmu.c | 14 +++++++ > 2 files changed, 57 insertions(+) > > diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.txt b/Documentation/devicetree/bindings/iommu/arm,smmu.txt > index 8a6ffce12af5..169222ae2706 100644 > --- a/Documentation/devicetree/bindings/iommu/arm,smmu.txt > +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.txt > @@ -17,10 +17,19 @@ conditions. > "arm,mmu-401" > "arm,mmu-500" > "cavium,smmu-v2" > + "qcom,-smmu-v2", "qcom,smmu-v2" > > depending on the particular implementation and/or the > version of the architecture implemented. > > + A number of Qcom SoCs use qcom,smmu-v2 version of the IP. > + "qcom,-smmu-v2" represents a soc specific compatible > + string that should be present along with the "qcom,smmu-v2" > + to facilitate SoC specific clocks/power connections and to > + address specific bug fixes. > + An example string would be - > + "qcom,msm8996-smmu-v2", "qcom,smmu-v2". Hmm, I remember that for and similar wildcards we required explicitly listing allowed values. Rob, has it changed since I stumbled upon such thing last time (or I just got it wrong before)? > + > - reg : Base address and size of the SMMU. > > - #global-interrupts : The number of global interrupts exposed by the > @@ -71,6 +80,23 @@ conditions. > or using stream matching with #iommu-cells = <2>, and > may be ignored if present in such cases. > > +- clock-names: Should be "bus", and "iface" for "qcom,smmu-v2" > + implementation. > + > + "bus" clock for "qcom,smmu-v2" is required for downstream > + bus access and for the smmu ptw. > + > + "iface" clock is required to access smmu's registers through > + the TCU's programming interface. nit: Could we have it in a bit more structured way? E.g. - clock-names: List of names of clocks input to the device. The required list depends on particular implementation and is as follows: - for "qcom,smmu-v2": - "bus": clock required for downstream bus access and for the smmu ptw, - "iface": clock required to access smmu's registers through the TCU's programming interface. - unspecified for other implementations. (+/- wrapping) > + > +- clocks: Phandles for respective clocks described by clock-names. Phandle is just a pointer to another node. Clocks are however specified using a phandle and a number of arguments, depending on the clock controller. I'd change it to: - clocks: Specifiers for all clocks listed in the clock-names property, as per generic clock bindings. > + > +- power-domains: Phandles to SMMU's power domain specifier. This is > + required even if SMMU belongs to the master's power > + domain, as the SMMU will have to be enabled and > + accessed before master gets enabled and linked to its > + SMMU. From DT point of view, the relationship of SMMU belonging to a master device doesn't exist. The power-domains property needs to be properly specified for all devices within power domains represented in DT, with an exception of the case when the parent-child relationship is explicitly stated in DT by child devices being represented by child nodes of the parent device node. - power-domains: Specifiers for power domains required to be powered on for the SMMU to operate, as per generic power domain bindings. Best regards, Tomasz