From: Bjorn Helgaas <helgaas@kernel.org>
To: Claudiu <claudiu.beznea@tuxon.dev>
Cc: bhelgaas@google.com, lpieralisi@kernel.org, kw@linux.com,
manivannan.sadhasivam@linaro.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be,
magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org,
p.zabel@pengutronix.de, linux-pci@vger.kernel.org,
linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
john.madieu.xa@bp.renesas.com,
Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Subject: Re: [PATCH v2 4/8] PCI: rzg3s-host: Add Initial PCIe Host Driver for Renesas RZ/G3S SoC
Date: Thu, 5 Jun 2025 17:57:30 -0500 [thread overview]
Message-ID: <20250605225730.GA625963@bhelgaas> (raw)
In-Reply-To: <20250530111917.1495023-5-claudiu.beznea.uj@bp.renesas.com>
On Fri, May 30, 2025 at 02:19:13PM +0300, Claudiu wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> The Renesas RZ/G3S features a PCIe IP that complies with the PCI Express
> Base Specification 4.0 and supports speeds of up to 5 GT/s. It functions
> only as a root complex, with a single-lane (x1) configuration. The
> controller includes Type 1 configuration registers, as well as IP
> specific registers (called AXI registers) required for various adjustments.
> +/* Timeouts */
> +#define RZG3S_REQ_ISSUE_TIMEOUT_US 2500
> +#define RZG3S_LTSSM_STATE_TIMEOUT_US 1000
> +#define RZG3S_LS_CHANGE_TIMEOUT_US 1000
> +#define RZG3S_LINK_UP_TIMEOUT_US 500000
Are any of these timeouts related to values in the PCIe spec? If so,
use #defines from drivers/pci/pci.h, or add a new one if needed.
If they come from the RZ/G3S spec, can you include citations?
> +static int rzg3s_pcie_host_init(struct rzg3s_pcie_host *host, bool probe)
> +{
> + u32 val;
> + int ret;
> +
> + /* Initialize the PCIe related registers */
> + ret = rzg3s_pcie_config_init(host);
> + if (ret)
> + return ret;
> +
> + /* Initialize the interrupts */
> + rzg3s_pcie_irq_init(host);
> +
> + ret = reset_control_bulk_deassert(host->data->num_cfg_resets,
> + host->cfg_resets);
> + if (ret)
> + return ret;
> +
> + /* Wait for link up */
> + ret = readl_poll_timeout(host->axi + RZG3S_PCI_PCSTAT1, val,
> + !(val & RZG3S_PCI_PCSTAT1_DL_DOWN_STS), 5000,
> + RZG3S_LINK_UP_TIMEOUT_US);
Where do we wait for PCIE_T_RRS_READY_MS before pci_host_probe()
starts issuing config requests to enumerate devices?
> + if (ret) {
> + reset_control_bulk_assert(host->data->num_cfg_resets,
> + host->cfg_resets);
> + return ret;
> + }
> +
> + val = readl(host->axi + RZG3S_PCI_PCSTAT2);
> + dev_info(host->dev, "PCIe link status [0x%x]\n", val);
> +
> + val = FIELD_GET(RZG3S_PCI_PCSTAT2_STATE_RX_DETECT, val);
> + dev_info(host->dev, "PCIe x%d: link up\n", hweight32(val));
> +
> + if (probe) {
> + ret = devm_add_action_or_reset(host->dev,
> + rzg3s_pcie_cfg_resets_action,
> + host);
> + }
> +
> + return ret;
> +}
> + * According to the RZ/G3S HW manual (Rev.1.10, section
> + * 34.3.1.71 AXI Window Mask (Lower) Registers) HW expects first
> + * 12 LSB bits to be 0xfff. Extract 1 from size for this.
s/Extract/Subtract/
> + */
> + size = roundup_pow_of_two(size) - 1;
next prev parent reply other threads:[~2025-06-05 22:59 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-30 11:19 [PATCH v2 0/8] PCI: rzg3s-host: Add PCIe driver for Renesas RZ/G3S SoC Claudiu
2025-05-30 11:19 ` [PATCH v2 1/8] soc: renesas: rz-sysc: Add syscon/regmap support Claudiu
2025-05-30 11:19 ` [PATCH v2 2/8] clk: renesas: r9a08g045: Add clocks, resets and power domain support for the PCIe Claudiu
2025-05-30 11:19 ` [PATCH v2 3/8] dt-bindings: PCI: renesas,r9a08g045s33-pcie: Add documentation for the PCIe IP on Renesas RZ/G3S Claudiu
2025-06-05 22:13 ` Rob Herring (Arm)
2025-06-17 17:04 ` Manivannan Sadhasivam
2025-05-30 11:19 ` [PATCH v2 4/8] PCI: rzg3s-host: Add Initial PCIe Host Driver for Renesas RZ/G3S SoC Claudiu
2025-06-02 16:18 ` Ilpo Järvinen
2025-06-05 10:37 ` Claudiu Beznea
2025-06-05 7:47 ` kernel test robot
2025-06-05 8:09 ` kernel test robot
2025-06-05 22:57 ` Bjorn Helgaas [this message]
2025-06-06 9:12 ` Claudiu Beznea
2025-06-18 17:42 ` Manivannan Sadhasivam
2025-06-20 19:35 ` Manivannan Sadhasivam
2025-06-25 13:08 ` Claudiu Beznea
2025-06-25 13:07 ` Claudiu Beznea
2025-06-25 17:54 ` Bjorn Helgaas
2025-05-30 11:19 ` [PATCH v2 5/8] arm64: dts: renesas: r9a08g045s33: Add PCIe node Claudiu
2025-05-30 11:19 ` [PATCH v2 6/8] arm64: dts: renesas: rzg3s-smarc-som: Update dma-ranges for PCIe Claudiu
2025-05-30 11:19 ` [PATCH v2 7/8] arm64: dts: renesas: rzg3s-smarc: Enable PCIe Claudiu
2025-05-30 11:19 ` [PATCH v2 8/8] arm64: defconfig: Enable PCIe for the Renesas RZ/G3S SoC Claudiu
2025-06-02 7:16 ` [PATCH v2 0/8] PCI: rzg3s-host: Add PCIe driver for " Wolfram Sang
2025-07-15 14:46 ` Bjorn Helgaas
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=20250605225730.GA625963@bhelgaas \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=claudiu.beznea.uj@bp.renesas.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=john.madieu.xa@bp.renesas.com \
--cc=krzk+dt@kernel.org \
--cc=kw@linux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=magnus.damm@gmail.com \
--cc=manivannan.sadhasivam@linaro.org \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.