diff options
| author | Hal Feng <[email protected]> | 2025-10-24 16:59:29 +0800 |
|---|---|---|
| committer | Leo Yu-Chi Liang <[email protected]> | 2026-03-17 01:36:57 +0800 |
| commit | a10587939bcc7d9325dbe24cde335a65887f9377 (patch) | |
| tree | 378120ae5bd6c7086fc486f5795e273711c4a2bc /drivers/pci | |
| parent | ab4f610debf2cb179174b043c14710c6f407a411 (diff) | |
pcie: starfive: Add a optional power gpio support
Get and enable a optional power gpio. This feature is ported
from the jh7110 pcie driver in Linux. VisionFive 2 Lite needs
this gpio to enable the PCI bus device (M.2 M-Key) power.
Signed-off-by: Hal Feng <[email protected]>
Diffstat (limited to 'drivers/pci')
| -rw-r--r-- | drivers/pci/pcie_starfive_jh7110.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pci/pcie_starfive_jh7110.c b/drivers/pci/pcie_starfive_jh7110.c index 761e64be58a..88a2bf84538 100644 --- a/drivers/pci/pcie_starfive_jh7110.c +++ b/drivers/pci/pcie_starfive_jh7110.c @@ -42,6 +42,7 @@ struct starfive_pcie { struct pcie_plda plda; struct clk_bulk clks; struct reset_ctl_bulk rsts; + struct gpio_desc power_gpio; struct gpio_desc reset_gpio; struct regmap *regmap; unsigned int stg_pcie_base; @@ -181,6 +182,10 @@ static int starfive_pcie_parse_dt(struct udevice *dev) dev_err(dev, "reset-gpio is not valid\n"); return -EINVAL; } + + gpio_request_by_name(dev, "enable-gpios", 0, &priv->power_gpio, + GPIOD_IS_OUT); + return 0; } @@ -202,6 +207,9 @@ static int starfive_pcie_init_port(struct udevice *dev) goto err_deassert_clk; } + if (dm_gpio_is_valid(&priv->power_gpio)) + dm_gpio_set_value(&priv->power_gpio, 1); + dm_gpio_set_value(&priv->reset_gpio, 1); /* Disable physical functions except #0 */ for (i = 1; i < PLDA_FUNC_NUM; i++) { |
