PCI: rockchip: dw: Request perst IO as output-low state

Requesting perst# as high and then drive it low makes some
buggy devices fail to work properly, for instance Biwin SSD.
It's not mandatory to have a high-low transition for perst#
before powering up. So we request it as output-low state directly
and remove redundant code.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: Ib62954f8dccc8a21dd06e7a582263bcf62995f29
This commit is contained in:
Shawn Lin
2021-08-12 09:19:31 +08:00
committed by Tao Huang
parent ce93adb4e4
commit af2d7e096b

View File

@@ -818,8 +818,16 @@ static int rk_pcie_resource_get(struct platform_device *pdev,
if (IS_ERR(rk_pcie->apb_base))
return PTR_ERR(rk_pcie->apb_base);
/*
* Rest the device before enabling power because some of the
* platforms may use external refclk input with the some power
* rail connect to 100MHz OSC chip. So once the power is up for
* the slot and the refclk is available, which isn't quite follow
* the spec. We should make sure it is in reset state before
* everthing's ready.
*/
rk_pcie->rst_gpio = devm_gpiod_get_optional(&pdev->dev, "reset",
GPIOD_OUT_HIGH);
GPIOD_OUT_LOW);
if (IS_ERR(rk_pcie->rst_gpio)) {
dev_err(&pdev->dev, "invalid reset-gpios property in node\n");
return PTR_ERR(rk_pcie->rst_gpio);
@@ -1285,16 +1293,6 @@ static int rk_pcie_really_probe(void *p)
dev_info(dev, "no vpcie3v3 regulator found\n");
}
/*
* Rest the device before enabling power because some of the
* platforms may use external refclk input with the some power
* rail connect to 100MHz OSC chip. So once the power is up for
* the slot and the refclk is available, which isn't quite follow
* the spec. We should make sure it is in reset state before
* everthing's ready.
*/
gpiod_set_value_cansleep(rk_pcie->rst_gpio, 0);
ret = rk_pcie_enable_power(rk_pcie);
if (ret)
return ret;