/* * Set the LTSSM Detect Quiet state min. delay to 2ms.
*/
ltssm_control_cap = cdns_pcie_readl(pcie, CDNS_PCIE_LTSSM_CONTROL_CAP);
ltssm_control_cap = ((ltssm_control_cap &
~CDNS_PCIE_DETECT_QUIET_MIN_DELAY_MASK) |
CDNS_PCIE_DETECT_QUIET_MIN_DELAY(delay));
/* Set the PCIe header descriptor */ if (is_io)
desc0 = CDNS_PCIE_AT_OB_REGION_DESC0_TYPE_IO; else
desc0 = CDNS_PCIE_AT_OB_REGION_DESC0_TYPE_MEM;
desc1 = 0;
/* * Whatever Bit [23] is set or not inside DESC0 register of the outbound * PCIe descriptor, the PCI function number must be set into * Bits [26:24] of DESC0 anyway. * * In Root Complex mode, the function number is always 0 but in Endpoint * mode, the PCIe controller may support more than one function. This * function number needs to be set properly into the outbound PCIe * descriptor. * * Besides, setting Bit [23] is mandatory when in Root Complex mode: * then the driver must provide the bus, resp. device, number in * Bits [7:0] of DESC1, resp. Bits[31:27] of DESC0. Like the function * number, the device number is always 0 in Root Complex mode. * * However when in Endpoint mode, we can clear Bit [23] of DESC0, hence * the PCIe controller will use the captured values for the bus and * device numbers.
*/ if (pcie->is_rc) { /* The device and function numbers are always 0. */
desc0 |= CDNS_PCIE_AT_OB_REGION_DESC0_HARDCODED_RID |
CDNS_PCIE_AT_OB_REGION_DESC0_DEVFN(0);
desc1 |= CDNS_PCIE_AT_OB_REGION_DESC1_BUS(busnr);
} else { /* * Use captured values for bus and device numbers but still * need to set the function number.
*/
desc0 |= CDNS_PCIE_AT_OB_REGION_DESC0_DEVFN(fn);
}
int cdns_pcie_init_phy(struct device *dev, struct cdns_pcie *pcie)
{ struct device_node *np = dev->of_node; int phy_count; struct phy **phy; struct device_link **link; int i; int ret; constchar *name;
phy_count = of_property_count_strings(np, "phy-names"); if (phy_count < 1) {
dev_info(dev, "no \"phy-names\" property found; PHY will not be initialized\n");
pcie->phy_count = 0; return 0;
}
phy = devm_kcalloc(dev, phy_count, sizeof(*phy), GFP_KERNEL); if (!phy) return -ENOMEM;
link = devm_kcalloc(dev, phy_count, sizeof(*link), GFP_KERNEL); if (!link) return -ENOMEM;
for (i = 0; i < phy_count; i++) {
of_property_read_string_index(np, "phy-names", i, &name);
phy[i] = devm_phy_get(dev, name); if (IS_ERR(phy[i])) {
ret = PTR_ERR(phy[i]); goto err_phy;
}
link[i] = device_link_add(dev, &phy[i]->dev, DL_FLAG_STATELESS); if (!link[i]) {
devm_phy_put(dev, phy[i]);
ret = -EINVAL; goto err_phy;
}
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.26Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.