| 1036 | } |
| 1037 | |
| 1038 | static int |
| 1039 | mtk_pcie_phy_mt7628_init(device_t dev) |
| 1040 | { |
| 1041 | struct mtk_pci_softc *sc = device_get_softc(dev); |
| 1042 | |
| 1043 | /* Set PCIe reset to normal mode */ |
| 1044 | mtk_sysctl_clr_set(SYSCTL_GPIOMODE, MT7628_PERST_GPIO_MODE, |
| 1045 | MT7628_PERST); |
| 1046 | |
| 1047 | /* Start the PHY */ |
| 1048 | if (mtk_pcie_phy_start(dev)) |
| 1049 | return (ENXIO); |
| 1050 | |
| 1051 | /* Give it a chance to sink in */ |
| 1052 | DELAY(100000); |
| 1053 | |
| 1054 | /* Setup the PHY */ |
| 1055 | mtk_pcie_phy_mt7628_setup(sc, 0x9000); |
| 1056 | |
| 1057 | /* Deassert PCIe device reset */ |
| 1058 | MT_CLR_SET32(sc, MTK_PCI_PCICFG, MTK_PCI_RESET, 0); |
| 1059 | |
| 1060 | /* Set number of slots supported */ |
| 1061 | sc->num_slots = 1; |
| 1062 | |
| 1063 | return (0); |
| 1064 | } |
| 1065 | |
| 1066 | static int |
| 1067 | mtk_pcie_phy_mt7620_wait_busy(struct mtk_pci_softc *sc) |
no test coverage detected