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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8CECFC49EA1 for ; Wed, 7 Aug 2024 03:05:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type: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=ktkwfuDEJhx5sflfI2OvQPuNv1Een1+08srx34A5940=; b=y8KxjuKZDlQQDfuEAKIFUlF6f+ 7JkIzZabPnLFNfqzJOw9pr90lyoTYfXwvFemSBlwwhtzgmruEoIiWTfQK+77F70wGcgdwmB89a0Er 6xQzaTAVf9vYdxQK+gMvn9cZNDOyYHA89oVqieFP+LlES89TNFthKF28QZz3T4SzdvPDH847Zku3L t1YtKC7TgwvgUvSGc17NaVUXitOOWjWG0oyz5BOiS7S3MG3nlZqoQB66QFm0CNr1k1bP3wSHguWWH ZmLw8W+CW+XgKLkL19Xb7cxn1sklLXxltQbEIazFgx+67b82XlcCGJrElSr14ww4mlvh8iVSAT7Jv gg+xaCSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbWzj-00000003gFo-2IIN; Wed, 07 Aug 2024 03:05:47 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbWzC-00000003gAB-2QL5 for linux-arm-kernel@lists.infradead.org; Wed, 07 Aug 2024 03:05:15 +0000 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-70eae5896bcso1020974b3a.2 for ; Tue, 06 Aug 2024 20:05:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722999914; x=1723604714; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=ktkwfuDEJhx5sflfI2OvQPuNv1Een1+08srx34A5940=; b=so//fT1xMR0M68DaXR3e43AqLNz9K1/PGjJZDxjbjpeicFykM2hT2CjiC7Sxyu+s4X ahWECyqvFNgpA27VJpik1YLrzykdApPRYqbx8H6qLesth6XBTz6onORQEr+kw2Lm9Cko LNWLUrJ1v6jmIItdDFUPYoYgvkC8JJsu9sGkmQgrSHrWNxSLCaguRfQ0R3ZVZUnokUtR wsQEfu4qEeznpMfjofXBbbTGQVs3hAmCbDbanxflkhC9hadVGCGXzzEsMMRR7k+puqK3 UllK0w3ChruS83ctdQGbue0L3y1ZZp5zCvqsVRKpFvwHRNM0mBNL+TKlAEzLZW3hypc1 v3+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722999914; x=1723604714; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ktkwfuDEJhx5sflfI2OvQPuNv1Een1+08srx34A5940=; b=Dc99iAt05kcJbIatrQVmtGjAdyReGAkAickJeJhOchZBKdJZn9UKX3CejRr2dqNRDA ERwQlZdPc04eXszltP7OAz1R+23I6P55a9Qyk+PeFZcwpbDVm/KNF0oLm/sZTdKKOw0Y y5UZ4M509ksrmI3AwKp7JiiAzbZUOA8p/GBLI9YJhIbLBovQBDHhSRHyXo+FwPsOyJj0 XRIIeGFpgflohdrN9oJLne31qlaOJEzbCqv6IZ3FN+fr94JrYueCR+tCgVZz2+CIRguF 2HrSy5dF/FJJhuNaaFUOjPzOTBslFnqgi0GHHBYHT2+yeJyUWJggoVQTbsrz9zKIY2lH qXHQ== X-Forwarded-Encrypted: i=1; AJvYcCV1XSSa9OxTSVt9W5ONAmY5wUYXE6BISgFCUedSnBeEltP4Fv1N/wUy5Ec9dZAGI8ouFqhS1chcImY0563SEdPYyhopmGfPpdjmCWhZU1FeXGxtpVw= X-Gm-Message-State: AOJu0Yx2q3ihvGzMEdyMVfdeKempQZlaVSWqns/1A3YJbgybHHdvejcq cMV1fuycDfb67sADGA288AKtX9rOABxHQXpxbngwm/uSJbIDaoWpXDAJ9UJjCQ== X-Google-Smtp-Source: AGHT+IHeBBB9HZdLy26QExMAW0qOHs0KBnu6vbFxqKF47qSsZ46yR0Ql9vqC7kMPYTC0pjfebwTrUA== X-Received: by 2002:a05:6a00:170b:b0:710:bd4b:8b96 with SMTP id d2e1a72fcca58-710bd4b964emr856276b3a.28.1722999913813; Tue, 06 Aug 2024 20:05:13 -0700 (PDT) Received: from thinkpad ([120.60.72.69]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7b762e9f5cdsm7616512a12.2.2024.08.06.20.05.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 20:05:13 -0700 (PDT) Date: Wed, 7 Aug 2024 08:35:02 +0530 From: Manivannan Sadhasivam To: Jim Quinlan Cc: linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Bjorn Helgaas , Lorenzo Pieralisi , Cyril Brulebois , Stanimir Varbanov , Krzysztof Kozlowski , bcm-kernel-feedback-list@broadcom.com, jim2101024@gmail.com, Florian Fainelli , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , open list Subject: Re: [PATCH v5 08/12] PCI: brcmstb: Don't conflate the reset rescal with phy ctrl Message-ID: <20240807030502.GI3412@thinkpad> References: <20240731222831.14895-1-james.quinlan@broadcom.com> <20240731222831.14895-9-james.quinlan@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240731222831.14895-9-james.quinlan@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240806_200514_646261_30FC3340 X-CRM114-Status: GOOD ( 21.14 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jul 31, 2024 at 06:28:22PM -0400, Jim Quinlan wrote: > Add a "has_phy" field indicating that the internal phy has SW control that > requires configuration. Some previous chips only required the firing of > the "rescal" reset controller. This change requires us to give the 7216 > SoC its own cfg_data structure. > > Signed-off-by: Jim Quinlan Reviewed-by: Manivannan Sadhasivam - Mani > Reviewed-by: Stanimir Varbanov > Reviewed-by: Florian Fainelli > --- > drivers/pci/controller/pcie-brcmstb.c | 17 ++++++++++++++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > > diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c > index 1ae66c639186..4659208ae8da 100644 > --- a/drivers/pci/controller/pcie-brcmstb.c > +++ b/drivers/pci/controller/pcie-brcmstb.c > @@ -222,6 +222,7 @@ enum pcie_type { > struct pcie_cfg_data { > const int *offsets; > const enum pcie_type type; > + const bool has_phy; > void (*perst_set)(struct brcm_pcie *pcie, u32 val); > void (*bridge_sw_init_set)(struct brcm_pcie *pcie, u32 val); > }; > @@ -272,6 +273,7 @@ struct brcm_pcie { > void (*bridge_sw_init_set)(struct brcm_pcie *pcie, u32 val); > struct subdev_regulators *sr; > bool ep_wakeup_capable; > + bool has_phy; > }; > > static inline bool is_bmips(const struct brcm_pcie *pcie) > @@ -1311,12 +1313,12 @@ static int brcm_phy_cntl(struct brcm_pcie *pcie, const int start) > > static inline int brcm_phy_start(struct brcm_pcie *pcie) > { > - return pcie->rescal ? brcm_phy_cntl(pcie, 1) : 0; > + return pcie->has_phy ? brcm_phy_cntl(pcie, 1) : 0; > } > > static inline int brcm_phy_stop(struct brcm_pcie *pcie) > { > - return pcie->rescal ? brcm_phy_cntl(pcie, 0) : 0; > + return pcie->has_phy ? brcm_phy_cntl(pcie, 0) : 0; > } > > static void brcm_pcie_turn_off(struct brcm_pcie *pcie) > @@ -1559,12 +1561,20 @@ static const struct pcie_cfg_data bcm2711_cfg = { > .bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic, > }; > > +static const struct pcie_cfg_data bcm7216_cfg = { > + .offsets = pcie_offset_bcm7278, > + .type = BCM7278, > + .perst_set = brcm_pcie_perst_set_7278, > + .bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_7278, > + .has_phy = true, > +}; > + > static const struct of_device_id brcm_pcie_match[] = { > { .compatible = "brcm,bcm2711-pcie", .data = &bcm2711_cfg }, > { .compatible = "brcm,bcm4908-pcie", .data = &bcm4908_cfg }, > { .compatible = "brcm,bcm7211-pcie", .data = &generic_cfg }, > { .compatible = "brcm,bcm7278-pcie", .data = &bcm7278_cfg }, > - { .compatible = "brcm,bcm7216-pcie", .data = &bcm7278_cfg }, > + { .compatible = "brcm,bcm7216-pcie", .data = &bcm7216_cfg }, > { .compatible = "brcm,bcm7445-pcie", .data = &generic_cfg }, > { .compatible = "brcm,bcm7435-pcie", .data = &bcm7435_cfg }, > { .compatible = "brcm,bcm7425-pcie", .data = &bcm7425_cfg }, > @@ -1612,6 +1622,7 @@ static int brcm_pcie_probe(struct platform_device *pdev) > pcie->type = data->type; > pcie->perst_set = data->perst_set; > pcie->bridge_sw_init_set = data->bridge_sw_init_set; > + pcie->has_phy = data->has_phy; > > pcie->base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(pcie->base)) > -- > 2.17.1 > -- மணிவண்ணன் சதாசிவம்