From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6AE8C4338F for ; Sat, 24 Jul 2021 04:13:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7813060E52 for ; Sat, 24 Jul 2021 04:13:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7813060E52 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6CRNqV57ZD3MtYl2cYStToJA8SHmvVa9+Sv8/d9Fiuo=; b=Xe8kUUVrm9Y8xG GL5M7Pl4Lsf+9CtHG3YQukf+TUvBtmUjkdlWbkCpBVYKlapdT7G+p+IHBNEji2e2kiYogjyUHcBTT vdLx0oKvcWky5j6uhCFI65GeJJLsSyp5XTAXRhTvJPHKhzU9gWPs3EO12E0wBYhO7/OXJBkRckhA0 3vh7XkMsKBm1BrTVpLomJasFVwJpPeB8XlcNeKDJTqKA/JHDQ1we/4BIXUSfNJt+ZyQBWP4RooF+v Jnx8xdRkyaJwgMTDD4jlSyhyrZgcEZw5WGm0WpanrALOpqlOBYyZ08ZFwcdgTif9VDu0nJgBorY2L PHMB0e5hHEVCW26vJ/CA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m791C-006g9H-9T; Sat, 24 Jul 2021 04:12:06 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m7918-006g87-N6 for linux-arm-kernel@lists.infradead.org; Sat, 24 Jul 2021 04:12:04 +0000 Received: by mail-pl1-x636.google.com with SMTP id u8so5539698plr.1 for ; Fri, 23 Jul 2021 21:12:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=hUphzkjUs+f4n/CtLJYGpw/KLAKzYjnMeedmlil2VfU=; b=zTJH4iNYY4OUanJzT20qn/k2Y3F7vryjGfoUP8T44ogvs/tbifGEMY8h92eSXNX79z drsWuep/h7XBbGu3TOJ5aAMylJhOHGZgNCoffJn5naPY94gNxUp6YbNj4a6FV+Bq6YF/ cih62d1jmupILuZyU2u/sQed37mBAe//xyFWp/N4qy0oBjqDp9w5N3THpSmK6CMYx1HW 1xpPcZdXB+b5Vjo3BTseCh0qU8Eng7QVRBu9u7S3j4KZFTfGgRy0+iLGoRJP+0e3KODF tgqobbIMhJ/zhfyHjS41YJCtoBIQsvjpGoPvQr8MOw2o0pcM5pa8nhP3o6dRc1tdrHbT iE4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hUphzkjUs+f4n/CtLJYGpw/KLAKzYjnMeedmlil2VfU=; b=DxPv4wWgy7rdaERLqeKsgPsrSSO+iQVNs2dhiptgaq/6BZR9BHB7E8nrLhWV0/8xlu Iwnt+a0+ozrMParTvk6Brj/98kFQfnvRFrCWglH4eScJu0HOCDDUYvYved4IO8FEPHfG dW/Skb/HYmy2ohZB3M9T/LeO48MK54Hj8zDhZdwCvITXarXJRqC/hXrpMwoNdktF6DS7 g5Gom5KrEUiazIuC19LpEbiFX3qWbfqVaxHxV0/r/XC7vzqaA/urfoNgMKDnt1h1KXDP RI6EGkuOS65GggJdYyo96sKN7dA9kHRw/uo9r+3OIuuGdSFkD1lPpiePEtDLz09GZg4e cHEw== X-Gm-Message-State: AOAM530WS2OpNJ9D+HJWxNNVPDFAvRpREgJJjsOoTRvsFf2eFEBsAnEo Bs+uyGCv9EABRlnjsZNoexQA X-Google-Smtp-Source: ABdhPJyF8KwnLqCkSTt9iDq9FhsyJmhA8Jj9Zs+eo6AdGTjl2rCUNhFYnLMiGShGiRUHgcl8UBEiwQ== X-Received: by 2002:a63:a01:: with SMTP id 1mr7721060pgk.360.1627099921090; Fri, 23 Jul 2021 21:12:01 -0700 (PDT) Received: from thinkpad ([2409:4072:6d0b:3004:b3d2:21bb:b6c1:27fa]) by smtp.gmail.com with ESMTPSA id b1sm7319151pjn.11.2021.07.23.21.11.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jul 2021 21:11:59 -0700 (PDT) Date: Sat, 24 Jul 2021 09:41:50 +0530 From: Manivannan Sadhasivam To: Mauro Carvalho Chehab Cc: Vinod Koul , Bjorn Helgaas , Rob Herring , linuxarm@huawei.com, mauro.chehab@huawei.com, Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Binghui Wang , Lorenzo Pieralisi , Rob Herring , Wei Xu , Xiaowei Song , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [PATCH v7 08/10] arm64: dts: HiSilicon: Add support for HiKey 970 PCIe controller hardware Message-ID: <20210724041150.GA4053@thinkpad> References: <20210722133628.GC4446@workstation> <20210723085318.243f155f@coco.lan> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210723085318.243f155f@coco.lan> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210723_211202_806675_C3E62474 X-CRM114-Status: GOOD ( 25.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jul 23, 2021 at 08:53:18AM +0200, Mauro Carvalho Chehab wrote: > Em Thu, 22 Jul 2021 19:06:28 +0530 > Manivannan Sadhasivam escreveu: > > > On Wed, Jul 21, 2021 at 10:39:10AM +0200, Mauro Carvalho Chehab wrote: > > > From: Manivannan Sadhasivam > > > > > > Add DTS bindings for the HiKey 970 board's PCIe hardware. > > > > > > Co-developed-by: Mauro Carvalho Chehab > > > Signed-off-by: Manivannan Sadhasivam > > > Signed-off-by: Mauro Carvalho Chehab > > > --- > > > arch/arm64/boot/dts/hisilicon/hi3670.dtsi | 71 +++++++++++++++++++ > > > .../boot/dts/hisilicon/hikey970-pmic.dtsi | 1 - > > > drivers/pci/controller/dwc/pcie-kirin.c | 12 ---- > > > 3 files changed, 71 insertions(+), 13 deletions(-) > > > > > > diff --git a/arch/arm64/boot/dts/hisilicon/hi3670.dtsi b/arch/arm64/boot/dts/hisilicon/hi3670.dtsi > > > index 1f228612192c..6dfcfcfeedae 100644 > > > --- a/arch/arm64/boot/dts/hisilicon/hi3670.dtsi > > > +++ b/arch/arm64/boot/dts/hisilicon/hi3670.dtsi > > > @@ -177,6 +177,12 @@ sctrl: sctrl@fff0a000 { > > > #clock-cells = <1>; > > > }; > > > > > > + pmctrl: pmctrl@fff31000 { > > > + compatible = "hisilicon,hi3670-pmctrl", "syscon"; > > > + reg = <0x0 0xfff31000 0x0 0x1000>; > > > + #clock-cells = <1>; > > > + }; > > > + > > > > Irrelevant change to this patch. > > Huh? > > This is used by PCIe PHY, as part of the power on procedures: > > +static int hi3670_pcie_noc_power(struct hi3670_pcie_phy *phy, bool enable) > +{ > + struct device *dev = phy->dev; > + u32 time = 100; > + unsigned int val = NOC_PW_MASK; > + int rst; > + > + if (enable) > + val = NOC_PW_MASK | NOC_PW_SET_BIT; > + else > + val = NOC_PW_MASK; > + rst = enable ? 1 : 0; > + > + regmap_write(phy->pmctrl, NOC_POWER_IDLEREQ_1, val); > > Ah... you're hardcoding the syscon compatible in driver. Sorry missed that. But if these syscon nodes are independent memory regions or belong to non PCI/PHY memory map, you could've fetched the reference through a DT property along with the offset then used it in driver. Like, pcie_phy: pcie-phy@fc000000 { ... hisilicon,noc-power-regs = <&pmctrl 0x38c>; hisilicon,sctrl-cmos-regs = <&sctrl 0x60>; ... }; The benefit of doing this way is, if the pmctrl, sctrl register layout changes in future, you can handle it without any issues. > > > > > > iomcu: iomcu@ffd7e000 { > > > compatible = "hisilicon,hi3670-iomcu", "syscon"; > > > reg = <0x0 0xffd7e000 0x0 0x1000>; > > > @@ -660,6 +666,71 @@ gpio28: gpio@fff1d000 { > > > clock-names = "apb_pclk"; > > > }; > > > > > > > [...] > > > > > + #interrupt-cells = <1>; > > > + interrupts = <0 283 4>; > > > > Use the DT flag for interrupts instead of hardcoded value > > Do you mean like this? > > interrupts = <0 283 IRQ_TYPE_LEVEL_HIGH>; > yes but you could also use, interrupts = ; Thanks, Mani _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel