Lines Matching +full:sar +full:- +full:threshold
1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2015-2016 Marvell International Ltd.
31 * For CP-110 we have 2 Selector registers "PHY Selectors",
78 } while (data != val && --usec_timout > 0); in polling_with_timeout()
100 * Add SAR (Sample-At-Reset) configuration for the PCIe clock in comphy_pcie_power_up()
101 * direction. SAR code is currently not ported from Marvell in comphy_pcie_power_up()
102 * U-Boot to mainline version. in comphy_pcie_power_up()
104 * SerDes Lane 4/5 got the PCIe ref-clock #1, in comphy_pcie_power_up()
105 * and SerDes Lane 0 got PCIe ref-clock #0 in comphy_pcie_power_up()
126 * we need to configure the clock-source MUX. in comphy_pcie_power_up()
135 debug("stage: RFU configurations - hard reset comphy\n"); in comphy_pcie_power_up()
136 /* RFU configurations - hard reset comphy */ in comphy_pcie_power_up()
156 /* Wait 1ms - until band gap and ref clock ready */ in comphy_pcie_power_up()
184 /* Set PIPE mode interface to PCIe3 - 0x1 & set lane order */ in comphy_pcie_power_up()
194 } else if (lane == (pcie_width - 1)) { in comphy_pcie_power_up()
207 /* TODO: check if pcie clock is output/input - for bringup use input*/ in comphy_pcie_power_up()
211 /* Only if clock is output, configure the clock-source mux */ in comphy_pcie_power_up()
238 /* Set reference frequcency select - 0x2 for 25MHz*/ in comphy_pcie_power_up()
242 /* Set reference frequcency select - 0x0 for 100MHz*/ in comphy_pcie_power_up()
259 * Set the amount of time spent in the LoZ state - set for 0x7 only if in comphy_pcie_power_up()
430 /* Set PLL Charge-pump Current Control */ in comphy_pcie_power_up()
454 * For PCIe by4 or by2 - release from reset only after finish to in comphy_pcie_power_up()
457 if ((pcie_width == 1) || (lane == (pcie_width - 1))) { in comphy_pcie_power_up()
471 * for PCIe by4 or by2 - release from soft reset in comphy_pcie_power_up()
472 * all lanes - can't use read modify write in comphy_pcie_power_up()
482 * for PCIe by4 or by2 - release from soft reset in comphy_pcie_power_up()
508 debug("Read from reg = %p - value = 0x%x\n", in comphy_pcie_power_up()
530 debug("stage: RFU configurations - hard reset comphy\n"); in comphy_usb3_power_up()
531 /* RFU configurations - hard reset comphy */ in comphy_usb3_power_up()
551 /* Wait 1ms - until band gap and ref clock ready */ in comphy_usb3_power_up()
573 /* Set reference clock to come from group 1 - 25Mhz */ in comphy_usb3_power_up()
577 /* Set reference frequcency select - 0x2 */ in comphy_usb3_power_up()
580 /* Set PHY mode to USB - 0x5 */ in comphy_usb3_power_up()
584 /* Set the amount of time spent in the LoZ state - set for 0x7 */ in comphy_usb3_power_up()
588 /* Set max PHY generation setting - 5Gbps */ in comphy_usb3_power_up()
596 /* select de-emphasize 3.5db */ in comphy_usb3_power_up()
607 /* Set Pin DFE_PAT_DIS -> Bit[1]: PIN_DFE_PAT_DIS = 0x0 */ in comphy_usb3_power_up()
625 /* wait 15ms - for comphy calibration done */ in comphy_usb3_power_up()
633 debug("Read from reg = %p - value = 0x%x\n", in comphy_usb3_power_up()
653 int sata_node = -1; /* Set to -1 in order to read the first sata node */ in comphy_sata_power_up()
658 * Assumption - each CP has only one SATA controller in comphy_sata_power_up()
659 * Calling fdt_node_offset_by_compatible first time (with sata_node = -1 in comphy_sata_power_up()
666 gd->fdt_blob, sata_node, "marvell,armada-8k-ahci"); in comphy_sata_power_up()
674 gd->fdt_blob, sata_node, "reg", 0, NULL, true); in comphy_sata_power_up()
682 debug("stage: MAC configuration - power down comphy\n"); in comphy_sata_power_up()
704 debug("stage: RFU configurations - hard reset comphy\n"); in comphy_sata_power_up()
705 /* RFU configurations - hard reset comphy */ in comphy_sata_power_up()
716 /* Set select data width 40Bit - SATA mode only */ in comphy_sata_power_up()
728 /* Wait 1ms - until band gap and ref clock ready */ in comphy_sata_power_up()
733 /* Set reference clock to comes from group 1 - choose 25Mhz */ in comphy_sata_power_up()
744 /* Set max PHY generation setting - 6Gbps */ in comphy_sata_power_up()
844 /* DFE F3-F5 Coefficient Control */ in comphy_sata_power_up()
954 * MAC configuration power up comphy - power up PLL/TX/RX in comphy_sata_power_up()
990 debug("Read from reg = %p - value = 0x%x\n", in comphy_sata_power_up()
1013 debug("stage: RFU configurations - hard reset comphy\n"); in comphy_sgmii_power_up()
1014 /* RFU configurations - hard reset comphy */ in comphy_sgmii_power_up()
1059 /* Wait 1ms - until band gap and ref clock ready */ in comphy_sgmii_power_up()
1089 /* Set analog paramters from ETP(HW) - for now use the default datas */ in comphy_sgmii_power_up()
1096 debug("stage: RFU configurations- Power Up PLL,Tx,Rx\n"); in comphy_sgmii_power_up()
1113 debug("Read from reg = %p - value = 0x%x\n", in comphy_sgmii_power_up()
1132 debug("Read from reg = %p - value = 0x%x\n", sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data); in comphy_sgmii_power_up()
1159 debug("stage: RFU configurations - hard reset comphy\n"); in comphy_sfi_power_up()
1160 /* RFU configurations - hard reset comphy */ in comphy_sfi_power_up()
1198 /* Wait 1ms - until band gap and ref clock ready */ in comphy_sfi_power_up()
1254 /* 0x7-DFE Resolution control */ in comphy_sfi_power_up()
1258 /* 0xd-G1_Setting_0 */ in comphy_sfi_power_up()
1291 /* 0xE-G1_Setting_1 */ in comphy_sfi_power_up()
1313 /* 0xA-DFE_Reg3 */ in comphy_sfi_power_up()
1320 /* 0x111-G1_Setting_4 */ in comphy_sfi_power_up()
1395 debug("stage: RFU configurations- Power Up PLL,Tx,Rx\n"); in comphy_sfi_power_up()
1413 debug("Read from reg = %p - value = 0x%x\n", sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data); in comphy_sfi_power_up()
1432 debug("Read from reg = %p - value = 0x%x\n", in comphy_sfi_power_up()
1460 debug("stage: RFU configurations - hard reset comphy\n"); in comphy_rxauii_power_up()
1461 /* RFU configurations - hard reset comphy */ in comphy_rxauii_power_up()
1511 /* Wait 1ms - until band gap and ref clock ready */ in comphy_rxauii_power_up()
1546 /* 0x7-DFE Resolution control */ in comphy_rxauii_power_up()
1549 /* 0xd-G1_Setting_0 */ in comphy_rxauii_power_up()
1553 /* 0xE-G1_Setting_1 */ in comphy_rxauii_power_up()
1561 /* 0xA-DFE_Reg3 */ in comphy_rxauii_power_up()
1568 /* 0x111-G1_Setting_4 */ in comphy_rxauii_power_up()
1573 debug("stage: RFU configurations- Power Up PLL,Tx,Rx\n"); in comphy_rxauii_power_up()
1591 debug("Read from reg = %p - value = 0x%x\n", in comphy_rxauii_power_up()
1610 debug("Read from reg = %p - value = 0x%x\n", in comphy_rxauii_power_up()
1636 debug("stage: UTMI %d - Power down transceiver (power down Phy), Power down PLL, and SuspendDM\n", in comphy_utmi_power_down()
1647 debug("stage: UTMI %d - Enable Device mode and configure UTMI mux\n", in comphy_utmi_power_down()
1685 /* Feedback Clock Divider Select - 90 for 25Mhz*/ in comphy_utmi_phy_config()
1688 /* Select LPFR - 0x0 for 25Mhz/5=5Mhz*/ in comphy_utmi_phy_config()
1693 /* Impedance Calibration Threshold Setting */ in comphy_utmi_phy_config()
1722 /* Set Control VDAT Reference Voltage - 0.325V */ in comphy_utmi_phy_config()
1725 /* Set Control VSRC Reference Voltage - 0.6V */ in comphy_utmi_phy_config()
1742 debug("stage: UTMI %d - Power up transceiver(Power up Phy), and exit SuspendDM\n", in comphy_utmi_power_up()
1759 debug("Read from reg = %p - value = 0x%x\n", addr, data); in comphy_utmi_power_up()
1768 debug("Read from reg = %p - value = 0x%x\n", addr, data); in comphy_utmi_power_up()
1778 debug("Read from reg = %p - value = 0x%x\n", addr, data); in comphy_utmi_power_up()
1797 * Note: - Power down/up should be once for both UTMI PHYs
1798 * - comphy_dedicated_phys_init call this function if at least there is
1858 * - not muxed SerDes lanes e.g. UTMI PHY
1870 node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, in comphy_dedicated_phys_init()
1871 "marvell,mvebu-utmi-2.6.0"); in comphy_dedicated_phys_init()
1878 gd->fdt_blob, node, "reg", 0, NULL, true); in comphy_dedicated_phys_init()
1888 gd->fdt_blob, node, "reg", 1, NULL, true); in comphy_dedicated_phys_init()
1898 gd->fdt_blob, node, "reg", 2, NULL, true); in comphy_dedicated_phys_init()
1910 gd->fdt_blob, node, "utmi-port", UTMI_PHY_INVALID); in comphy_dedicated_phys_init()
1918 gd->fdt_blob, node, "marvell,mvebu-utmi-2.6.0"); in comphy_dedicated_phys_init()
1936 comphy_max_count = ptr_chip_cfg->comphy_lanes_count; in comphy_mux_cp110_init()
1937 comphy_base_addr = ptr_chip_cfg->comphy_base_addr; in comphy_mux_cp110_init()
1952 ptr_chip_cfg->mux_data = cp110_comphy_phy_mux_data; in comphy_mux_cp110_init()
1956 ptr_chip_cfg->mux_data = cp110_comphy_pipe_mux_data; in comphy_mux_cp110_init()
1977 comphy_max_count = ptr_chip_cfg->comphy_lanes_count; in comphy_cp110_init()
1978 comphy_base_addr = ptr_chip_cfg->comphy_base_addr; in comphy_cp110_init()
1979 hpipe_base_addr = ptr_chip_cfg->hpipe3_base_addr; in comphy_cp110_init()
1984 /* Check if the first 4 lanes configured as By-4 */ in comphy_cp110_init()
1987 if (ptr_comphy_map->type != PHY_TYPE_PEX0) in comphy_cp110_init()
1995 debug("Serdes type = 0x%x\n", ptr_comphy_map->type); in comphy_cp110_init()
2003 switch (ptr_comphy_map->type) { in comphy_cp110_init()
2013 lane, pcie_width, ptr_comphy_map->clk_src, in comphy_cp110_init()
2014 serdes_map->end_point, in comphy_cp110_init()
2023 ptr_chip_cfg->cp_index, in comphy_cp110_init()
2036 if (ptr_comphy_map->speed == PHY_SPEED_INVALID) { in comphy_cp110_init()
2039 ptr_comphy_map->speed = PHY_SPEED_1_25G; in comphy_cp110_init()
2042 lane, ptr_comphy_map->speed, hpipe_base_addr, in comphy_cp110_init()
2048 ptr_comphy_map->speed); in comphy_cp110_init()
2065 ptr_comphy_map->type = PHY_TYPE_UNCONNECTED; in comphy_cp110_init()
2066 pr_err("PLL is not locked - Failed to initialize lane %d\n", in comphy_cp110_init()