Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6458763pxv; Thu, 29 Jul 2021 15:30:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmERO7WShx2YwjTT2YIS8/eRrVqtwT2H4xVQci2YTKQfC1koVpAqqmDyK/GUP9HhiOC+UU X-Received: by 2002:a92:d344:: with SMTP id a4mr4877289ilh.230.1627597834223; Thu, 29 Jul 2021 15:30:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627597834; cv=none; d=google.com; s=arc-20160816; b=RsFMcI3Hvc72K0wdgLDKK41epqr2QS7WA9aHfGEenCEr7HYyYqAZgu12A7DAWwtXcA U8qExDTrAL+tHLHwuO4Qc/jKYpmy0j0pKhiI7+5M2p2r1IiK5SnNKxbsoVZoslU681CH TFTvHVIcA0xksz6OFpukAQawXehUFxyeRyMPAxz+TLbfI5HcLLaXeFBkrqPAehA9U+MY zbIjLAzsfw93hsevXA2vVF77Xc4JTr84ozOTPrmULQnwsEy5H/5Gd04NQTNI3DD5HfHW lkpnxzraaT3RVZAy+rHGv4JXTsXC8fJeuUHINvh4ET/9556oIQHXU+1PdQ98Q/njdzJr 8zZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=kYTFRbaoPn8gb8vvRddMxfBMGL7ZnMjh/Bp9ovbHeMs=; b=m7NfZXTh3xglIp9m0wAhqKe8I0kPX1KttpWAoGWYaW7uETfVfm7jU+ew+K2g5QmdwF KyK4EVHUQLm/FdQUkbqHxgD+KxGTchiqP+5+kbbmuTkZy/7S8anxYlesJb6YJ6FBcbg8 d5Ada5MS3BQwdEYDH4TmpEQmTXvsFqJseA2Jdrv+F6NIamKrq4AeESvP53c+roAEb0yT po2SE99c/fPRu2NOoVcp4S9/DZzMeeSQRtH9g2xXOcTJkbOEHb/TNtLGFsV7UMTfwGSm 0Y+rx/pewGO14HDhOyq4EX8uOCACPUucTr3ZcNBvh9NMn2k9J4n1elgaNf/krFIY1mn6 PJzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ow5YnxaX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay7si4775293jab.36.2021.07.29.15.30.22; Thu, 29 Jul 2021 15:30:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ow5YnxaX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232855AbhG2W3a (ORCPT + 99 others); Thu, 29 Jul 2021 18:29:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:54314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229944AbhG2W3X (ORCPT ); Thu, 29 Jul 2021 18:29:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1982360720; Thu, 29 Jul 2021 22:29:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627597759; bh=Z5vs1zoSqEBxxqhhSmMqcsfe2C7l5EM32gjPdmoyxEM=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=ow5YnxaXbEOrfH4JYT2y1RMAesCkN/7tbE/AmLKSds8GczI0Z2cjX8NvoAD0tI9zl 5It9feOWMTsxvab3SeVe0xCOyamkWOKwr8fDgv21ShbrHrv/Z8LoEP03gHi2ZdyeSS iiUkZSHEMh/r+ZgR24Bd3OxC4SCNsIH8PfONyr8yPoUM9s6AOm28pumoOJDUkLuBAp 8gxh3ZxZ6e8poQNmcPJLRm5B1L6YAuKA821nTVolYIdrBTwNGo8hCT/p6lz4KuN/3i iaFnBo60imEzrzTWVnOj2hkdx/3lV87l+H+Czbg6cuwMyDWojb9mCrlyYJ4FZIgh8Z P/U6AJk1KXKag== Date: Thu, 29 Jul 2021 17:29:17 -0500 From: Bjorn Helgaas To: Tim Harvey Cc: Richard Zhu , Lucas Stach , Bjorn Helgaas , Rob Herring , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Lorenzo Pieralisi Subject: Re: [PATCH 3/6] PCI: imx6: add IMX8MM support Message-ID: <20210729222917.GA998237@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210723204958.7186-4-tharvey@gateworks.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Capitalize first letter of subject to match history: PCI: imx6: Add IMX8MM support On Fri, Jul 23, 2021 at 01:49:55PM -0700, Tim Harvey wrote: > Add IMX8MM support to the existing driver which shares most > functionality with the IMX8MM. > > Signed-off-by: Tim Harvey > --- > drivers/pci/controller/dwc/pci-imx6.c | 103 +++++++++++++++++++++++++- > 1 file changed, 102 insertions(+), 1 deletion(-) > + case IMX8MM: > + offset = imx6_pcie_grp_offset(imx6_pcie); > + > + dev_info(imx6_pcie->pci->dev, "%s REF_CLK is used!.\n", > + imx6_pcie->ext_osc ? "EXT" : "PLL"); > + if (imx6_pcie->ext_osc) { > + regmap_update_bits(imx6_pcie->iomuxc_gpr, offset, > + IMX8MQ_GPR_PCIE_REF_USE_PAD, 0); > + regmap_update_bits(imx6_pcie->iomuxc_gpr, offset, > + IMX8MM_GPR_PCIE_REF_CLK_SEL, > + IMX8MM_GPR_PCIE_REF_CLK_SEL); > + regmap_update_bits(imx6_pcie->iomuxc_gpr, offset, > + IMX8MM_GPR_PCIE_AUX_EN, > + IMX8MM_GPR_PCIE_AUX_EN); > + regmap_update_bits(imx6_pcie->iomuxc_gpr, offset, > + IMX8MM_GPR_PCIE_POWER_OFF, 0); > + regmap_update_bits(imx6_pcie->iomuxc_gpr, offset, > + IMX8MM_GPR_PCIE_SSC_EN, 0); > + regmap_update_bits(imx6_pcie->iomuxc_gpr, offset, > + IMX8MM_GPR_PCIE_REF_CLK_SEL, > + IMX8MM_GPR_PCIE_REF_CLK_EXT); > + udelay(100); > + /* Do the PHY common block reset */ > + regmap_update_bits(imx6_pcie->iomuxc_gpr, offset, > + IMX8MM_GPR_PCIE_CMN_RST, > + IMX8MM_GPR_PCIE_CMN_RST); > + udelay(200); > + } else { > + /* Configure the internal PLL as REF clock */ > + regmap_update_bits(imx6_pcie->iomuxc_gpr, offset, > + IMX8MQ_GPR_PCIE_REF_USE_PAD, 0); > + regmap_update_bits(imx6_pcie->iomuxc_gpr, offset, > + IMX8MM_GPR_PCIE_REF_CLK_SEL, > + IMX8MM_GPR_PCIE_REF_CLK_SEL); > + regmap_update_bits(imx6_pcie->iomuxc_gpr, offset, > + IMX8MM_GPR_PCIE_AUX_EN, > + IMX8MM_GPR_PCIE_AUX_EN); > + regmap_update_bits(imx6_pcie->iomuxc_gpr, offset, > + IMX8MM_GPR_PCIE_POWER_OFF, 0); > + regmap_update_bits(imx6_pcie->iomuxc_gpr, offset, > + IMX8MM_GPR_PCIE_SSC_EN, 0); Seems like all the above is common to both cases? If so, it's a shame to repeat it because it makes it hard to see what's different. > + regmap_update_bits(imx6_pcie->iomuxc_gpr, offset, > + IMX8MM_GPR_PCIE_REF_CLK_SEL, > + IMX8MM_GPR_PCIE_REF_CLK_PLL); > + udelay(100); > + /* Configure the PHY */ > + writel(PCIE_PHY_CMN_REG62_PLL_CLK_OUT, > + imx6_pcie->phy_base + PCIE_PHY_CMN_REG62); > + writel(PCIE_PHY_CMN_REG64_AUX_RX_TX_TERM, > + imx6_pcie->phy_base + PCIE_PHY_CMN_REG64); > + /* Do the PHY common block reset */ > + regmap_update_bits(imx6_pcie->iomuxc_gpr, offset, > + IMX8MM_GPR_PCIE_CMN_RST, > + IMX8MM_GPR_PCIE_CMN_RST); > + udelay(200); > + } > + /* > + * In order to pass the compliance tests. > + * Configure the TRSV regiser of iMX8MM PCIe PHY. The "In order to ..." line isn't quite a sentence. Maybe it should be joined with the second line? s/regiser/register/ ? > + */ > + writel(PCIE_PHY_TRSV_REG5_GEN1_DEEMP, > + imx6_pcie->phy_base + PCIE_PHY_TRSV_REG5); > + /* check for EXT osc */ Since you have a comment here, it would be useful to spell out "osc" for newbies like me. I assume it's short for "oscillator"? > + imx6_pcie->ext_osc = of_property_read_bool(node, "fsl,ext-osc");