MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mtk_pcie_phy_mt7628_init

Function mtk_pcie_phy_mt7628_init

freebsd/mips/mediatek/mtk_pcie.c:1038–1064  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1036}
1037
1038static int
1039mtk_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
1066static int
1067mtk_pcie_phy_mt7620_wait_busy(struct mtk_pci_softc *sc)

Callers 1

mtk_pcie_phy_initFunction · 0.85

Calls 5

device_get_softcFunction · 0.85
mtk_sysctl_clr_setFunction · 0.85
mtk_pcie_phy_startFunction · 0.85
DELAYFunction · 0.50

Tested by

no test coverage detected