devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Stanimir Varbanov <svarbanov@suse.de>
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rpi-kernel@lists.infradead.org, linux-pci@vger.kernel.org,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Jim Quinlan <jim2101024@gmail.com>,
	Nicolas Saenz Julienne <nsaenz@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	kw@linux.com, Philipp Zabel <p.zabel@pengutronix.de>,
	Andrea della Porta <andrea.porta@suse.com>,
	Phil Elwell <phil@raspberrypi.com>,
	Jonathan Bell <jonathan@raspberrypi.com>
Subject: Re: [PATCH 5/7] PCI: brcmstb: add phy_controllable flag
Date: Wed, 26 Jun 2024 10:27:12 -0500	[thread overview]
Message-ID: <20240626152712.GA1467478@bhelgaas> (raw)
In-Reply-To: <20240626104544.14233-6-svarbanov@suse.de>

Match the capitalization of the subject line, s/add/Add/ as in
previous patch.

On Wed, Jun 26, 2024 at 01:45:42PM +0300, Stanimir Varbanov wrote:
> Not all PCIe can control the phy block, add a flag
> in config structure to take that fact into account.
> 
> Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
> ---
>  drivers/pci/controller/pcie-brcmstb.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
> index 4ca509502336..ff8e5e672ff0 100644
> --- a/drivers/pci/controller/pcie-brcmstb.c
> +++ b/drivers/pci/controller/pcie-brcmstb.c
> @@ -224,6 +224,7 @@ enum pcie_type {
>  struct pcie_cfg_data {
>  	const int *offsets;
>  	const enum pcie_type type;
> +	bool phy_controllable;
>  	void (*perst_set)(struct brcm_pcie *pcie, u32 val);
>  	void (*bridge_sw_init_set)(struct brcm_pcie *pcie, u32 val);
>  };
> @@ -1301,11 +1302,17 @@ static int brcm_phy_cntl(struct brcm_pcie *pcie, const int start)
>  
>  static inline int brcm_phy_start(struct brcm_pcie *pcie)
>  {
> +	if (!pcie->cfg->phy_controllable)
> +		return 0;
> +
>  	return pcie->rescal ? brcm_phy_cntl(pcie, 1) : 0;
>  }
>  
>  static inline int brcm_phy_stop(struct brcm_pcie *pcie)
>  {
> +	if (!pcie->cfg->phy_controllable)
> +		return 0;
> +
>  	return pcie->rescal ? brcm_phy_cntl(pcie, 0) : 0;
>  }
>  
> @@ -1498,6 +1505,7 @@ static const int pcie_offsets_bmips_7425[] = {
>  static const struct pcie_cfg_data generic_cfg = {
>  	.offsets	= pcie_offsets,
>  	.type		= GENERIC,
> +	.phy_controllable = true,
>  	.perst_set	= brcm_pcie_perst_set_generic,
>  	.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
>  };
> @@ -1505,6 +1513,7 @@ static const struct pcie_cfg_data generic_cfg = {
>  static const struct pcie_cfg_data bcm7425_cfg = {
>  	.offsets	= pcie_offsets_bmips_7425,
>  	.type		= BCM7425,
> +	.phy_controllable = true,
>  	.perst_set	= brcm_pcie_perst_set_generic,
>  	.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
>  };
> @@ -1512,6 +1521,7 @@ static const struct pcie_cfg_data bcm7425_cfg = {
>  static const struct pcie_cfg_data bcm7435_cfg = {
>  	.offsets	= pcie_offsets,
>  	.type		= BCM7435,
> +	.phy_controllable = true,
>  	.perst_set	= brcm_pcie_perst_set_generic,
>  	.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
>  };
> @@ -1519,6 +1529,7 @@ static const struct pcie_cfg_data bcm7435_cfg = {
>  static const struct pcie_cfg_data bcm4908_cfg = {
>  	.offsets	= pcie_offsets,
>  	.type		= BCM4908,
> +	.phy_controllable = true,
>  	.perst_set	= brcm_pcie_perst_set_4908,
>  	.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
>  };
> @@ -1532,6 +1543,7 @@ static const int pcie_offset_bcm7278[] = {
>  static const struct pcie_cfg_data bcm7278_cfg = {
>  	.offsets	= pcie_offset_bcm7278,
>  	.type		= BCM7278,
> +	.phy_controllable = true,
>  	.perst_set	= brcm_pcie_perst_set_7278,
>  	.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_7278,
>  };
> @@ -1539,6 +1551,7 @@ static const struct pcie_cfg_data bcm7278_cfg = {
>  static const struct pcie_cfg_data bcm2711_cfg = {
>  	.offsets	= pcie_offsets,
>  	.type		= BCM2711,
> +	.phy_controllable = true,
>  	.perst_set	= brcm_pcie_perst_set_generic,
>  	.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
>  };
> -- 
> 2.43.0
> 

  reply	other threads:[~2024-06-26 15:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-26 10:45 [PATCH 0/7] Add PCIe support for bcm2712 Stanimir Varbanov
2024-06-26 10:45 ` [PATCH 1/7] dt-bindings: interrupt-controller: Add bcm2712 MSI-X DT bindings Stanimir Varbanov
2024-06-26 11:31   ` Florian Fainelli
2024-07-02  9:39     ` Stanimir Varbanov
2024-06-26 11:35   ` Florian Fainelli
2024-07-02  9:58     ` Stanimir Varbanov
2024-06-28 22:05   ` Rob Herring
2024-07-19 16:22     ` Stanimir Varbanov
2024-06-26 10:45 ` [PATCH 2/7] dt-bindings: PCI: brcmstb: Update bindings for PCIe on bcm2712 Stanimir Varbanov
2024-06-28 22:06   ` Rob Herring (Arm)
2024-06-26 10:45 ` [PATCH 3/7] irqchip: Add Broadcom bcm2712 MSI-X interrupt controller Stanimir Varbanov
2024-06-27 12:12   ` Thomas Gleixner
2024-07-18 15:54     ` Stanimir Varbanov
2024-06-26 10:45 ` [PATCH 4/7] PCI: brcmstb: Reuse config structure Stanimir Varbanov
2024-06-26 10:45 ` [PATCH 5/7] PCI: brcmstb: add phy_controllable flag Stanimir Varbanov
2024-06-26 15:27   ` Bjorn Helgaas [this message]
2024-06-26 10:45 ` [PATCH 6/7] PCI: brcmstb: Add bcm2712 support Stanimir Varbanov
2024-06-26 10:45 ` [PATCH 7/7] arm64: dts: broadcom: bcm2712: Add PCIe DT nodes Stanimir Varbanov
2024-06-26 11:28   ` Florian Fainelli
2024-06-26 11:31 ` [PATCH 0/7] Add PCIe support for bcm2712 Florian Fainelli
2024-07-02 10:05   ` Stanimir Varbanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240626152712.GA1467478@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=andrea.porta@suse.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bhelgaas@google.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=jim2101024@gmail.com \
    --cc=jonathan@raspberrypi.com \
    --cc=krzk+dt@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=lpieralisi@kernel.org \
    --cc=nsaenz@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=phil@raspberrypi.com \
    --cc=robh@kernel.org \
    --cc=svarbanov@suse.de \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).