diff --git a/sys/riscv/sifive/fu740_pci_dw.c b/sys/riscv/sifive/fu740_pci_dw.c index fe741f4bb6e..eff23a29498 100644 --- a/sys/riscv/sifive/fu740_pci_dw.c +++ b/sys/riscv/sifive/fu740_pci_dw.c @@ -216,12 +216,6 @@ fupci_phy_init(struct fupci_softc *sc) return (error); } - /* Hold PERST for 100ms as per the PCIe spec */ - DELAY(100); - - /* Deassert PERST_N */ - FUDW_MGMT_WRITE(sc, FUDW_MGMT_PERST_N, 1); - /* Deassert core power-on reset (active low) */ error = gpio_pin_set_active(sc->porst_pin, true); if (error != 0) { @@ -281,6 +275,12 @@ fupci_phy_init(struct fupci_softc *sc) /* Put the controller in Root Complex mode */ FUDW_MGMT_WRITE(sc, FUDW_MGMT_DEVICE_TYPE, FUDW_MGMT_DEVICE_TYPE_RC); + /* Hold PERST for 100ms as per the PCIe spec */ + DELAY(100000); + + /* Deassert PERST_N */ + FUDW_MGMT_WRITE(sc, FUDW_MGMT_PERST_N, 1); + return (0); }