Lines Matching +full:dsp +full:- +full:gpio4
1 // SPDX-License-Identifier: GPL-2.0+
6 * - Only full duplex supported
7 * - Forced speed (AN off) is not supported by hardware (100Mbps)
23 #define EN8811H_MD32_DSP "airoha/EthMD32.DSP.bin"
128 * GPIO5 <-> LED0 On: Link detected, blink Rx/Tx
129 * GPIO4 <-> LED1 On: Link detected at 2500 or 1000 Mbps
130 * GPIO3 <-> LED2 On: Link detected at 2500 or 100 Mbps
400 for (offset = 0; offset < fw->size; offset += 4) { in __air_write_buf()
401 val = get_unaligned_le16(&fw->data[offset + 2]); in __air_write_buf()
406 val = get_unaligned_le16(&fw->data[offset]); in __air_write_buf()
437 /* Because of mdio-lock, may have to wait for multiple loads */ in en8811h_wait_mcu_ready()
444 return -ENODEV; in en8811h_wait_mcu_ready()
452 struct en8811h_priv *priv = phydev->priv; in en8811h_load_firmware()
453 struct device *dev = &phydev->mdio.dev; in en8811h_load_firmware()
497 &priv->firmware_version); in en8811h_load_firmware()
499 priv->firmware_version); in en8811h_load_firmware()
532 struct en8811h_priv *priv = phydev->priv; in air_hw_led_on_set()
536 return -EINVAL; in air_hw_led_on_set()
540 &priv->led[index].state); in air_hw_led_on_set()
543 &priv->led[index].state); in air_hw_led_on_set()
545 changed |= (priv->led[index].rules != 0); in air_hw_led_on_set()
549 priv->led[index].rules = 0; in air_hw_led_on_set()
563 struct en8811h_priv *priv = phydev->priv; in air_hw_led_blink_set()
567 return -EINVAL; in air_hw_led_blink_set()
571 &priv->led[index].state); in air_hw_led_blink_set()
574 &priv->led[index].state); in air_hw_led_blink_set()
576 changed |= (priv->led[index].rules != 0); in air_hw_led_blink_set()
591 struct en8811h_priv *priv = phydev->priv; in air_led_blink_set()
596 return -EINVAL; in air_led_blink_set()
608 /* led-blink set, so switch led-on off */ in air_led_blink_set()
613 /* hw-control is off*/ in air_led_blink_set()
614 if (!!test_bit(AIR_PHY_LED_STATE_FORCE_BLINK, &priv->led[index].state)) in air_led_blink_set()
615 priv->led[index].rules = 0; in air_led_blink_set()
623 struct en8811h_priv *priv = phydev->priv; in air_led_brightness_set()
627 return -EINVAL; in air_led_brightness_set()
629 /* led-on set, so switch led-blink off */ in air_led_brightness_set()
638 /* hw-control is off */ in air_led_brightness_set()
639 if (!!test_bit(AIR_PHY_LED_STATE_FORCE_ON, &priv->led[index].state)) in air_led_brightness_set()
640 priv->led[index].rules = 0; in air_led_brightness_set()
648 struct en8811h_priv *priv = phydev->priv; in air_led_hw_control_get()
651 return -EINVAL; in air_led_hw_control_get()
653 *rules = priv->led[index].rules; in air_led_hw_control_get()
661 struct en8811h_priv *priv = phydev->priv; in air_led_hw_control_set()
666 return -EINVAL; in air_led_hw_control_set()
668 priv->led[index].rules = rules; in air_led_hw_control_set()
700 /* switch hw-control on, so led-on and led-blink are off */ in air_led_hw_control_set()
702 &priv->led[index].state); in air_led_hw_control_set()
704 &priv->led[index].state); in air_led_hw_control_set()
706 priv->led[index].rules = 0; in air_led_hw_control_set()
725 return -EINVAL; in air_led_init()
749 struct en8811h_priv *priv = phydev->priv; in air_leds_init()
781 return -EINVAL; in air_leds_init()
790 air_led_hw_control_set(phydev, i, priv->led[i].rules); in air_leds_init()
800 return -EINVAL; in en8811h_led_hw_is_supported()
804 return -EOPNOTSUPP; in en8811h_led_hw_is_supported()
814 priv = devm_kzalloc(&phydev->mdio.dev, sizeof(struct en8811h_priv), in en8811h_probe()
817 return -ENOMEM; in en8811h_probe()
818 phydev->priv = priv; in en8811h_probe()
825 priv->mcu_needs_restart = false; in en8811h_probe()
827 priv->led[0].rules = AIR_DEFAULT_TRIGGER_LED0; in en8811h_probe()
828 priv->led[1].rules = AIR_DEFAULT_TRIGGER_LED1; in en8811h_probe()
829 priv->led[2].rules = AIR_DEFAULT_TRIGGER_LED2; in en8811h_probe()
832 phydev->c45_ids.mmds_present |= MDIO_DEVS_PMAPMD | MDIO_DEVS_AN; in en8811h_probe()
853 struct en8811h_priv *priv = phydev->priv; in en8811h_config_init()
854 struct device *dev = &phydev->mdio.dev; in en8811h_config_init()
859 if (priv->mcu_needs_restart) { in en8811h_config_init()
865 priv->mcu_needs_restart = true; in en8811h_config_init()
869 * Configures the SerDes for 2500Base-X with rate adaptation in en8811h_config_init()
890 if (device_property_read_bool(dev, "airoha,pnswap-rx")) in en8811h_config_init()
894 if (device_property_read_bool(dev, "airoha,pnswap-tx")) in en8811h_config_init()
918 phydev->supported); in en8811h_get_features()
935 if (phydev->autoneg == AUTONEG_DISABLE) { in en8811h_config_aneg()
937 return -EINVAL; in en8811h_config_aneg()
940 adv = linkmode_adv_to_mii_10gbt_adv_t(phydev->advertising); in en8811h_config_aneg()
954 struct en8811h_priv *priv = phydev->priv; in en8811h_read_status()
962 phydev->master_slave_get = MASTER_SLAVE_CFG_UNSUPPORTED; in en8811h_read_status()
963 phydev->master_slave_state = MASTER_SLAVE_STATE_UNSUPPORTED; in en8811h_read_status()
964 phydev->speed = SPEED_UNKNOWN; in en8811h_read_status()
965 phydev->duplex = DUPLEX_UNKNOWN; in en8811h_read_status()
966 phydev->pause = 0; in en8811h_read_status()
967 phydev->asym_pause = 0; in en8811h_read_status()
968 phydev->rate_matching = RATE_MATCH_PAUSE; in en8811h_read_status()
978 /* Get link partner 2.5GBASE-T ability from vendor register */ in en8811h_read_status()
983 phydev->lp_advertising, in en8811h_read_status()
986 if (phydev->autoneg_complete) in en8811h_read_status()
989 if (!phydev->link) in en8811h_read_status()
998 phydev->speed = SPEED_2500; in en8811h_read_status()
1001 phydev->speed = SPEED_1000; in en8811h_read_status()
1004 phydev->speed = SPEED_100; in en8811h_read_status()
1011 if (priv->firmware_version < 0x24011202) { in en8811h_read_status()
1013 phydev->lp_advertising, in en8811h_read_status()
1014 phydev->speed == SPEED_2500); in en8811h_read_status()
1018 phydev->duplex = DUPLEX_FULL; in en8811h_read_status()