Lines Matching +full:port +full:- +full:mapping +full:- +full:mode
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Marvell 88E6xxx Ethernet switch single-chip definition
28 /* PVT limits for 4-bit port and 5-bit switch */
110 * enum mv88e6xxx_edsa_support - Ethertype DSA tag support level
115 * empirical data shows that this mode
149 * ports 2-4 are not routet to pins.
152 /* Multi-chip Addressing Mode.
154 * when it is non-zero, and use indirect access to internal registers.
157 /* Dual-chip Addressing Mode
175 * port 0, 1 means internal PHYs range starts at port 1, etc
224 /* Port index */
262 enum mv88e6xxx_policy_mapping mapping; member
266 int port; member
277 int port; member
354 /* Handles automatic disabling and re-enabling of the PHY
424 /* Per-port timestamping resources. */
427 /* Array of port structures. */
460 int (*irl_init_all)(struct mv88e6xxx_chip *chip, int port);
496 int (*port_set_rgmii_delay)(struct mv88e6xxx_chip *chip, int port,
497 phy_interface_t mode);
501 #define LINK_UNFORCED -2
503 /* Port's MAC link state
507 int (*port_set_link)(struct mv88e6xxx_chip *chip, int port, int link);
509 /* Synchronise the port link state with that of the SERDES
511 int (*port_sync_link)(struct mv88e6xxx_chip *chip, int port, unsigned int mode, bool isup);
517 int (*port_set_pause)(struct mv88e6xxx_chip *chip, int port,
520 #define SPEED_UNFORCED -2
521 #define DUPLEX_UNFORCED -2
523 /* Port's MAC speed (in Mbps) and MAC duplex mode
531 int (*port_set_speed_duplex)(struct mv88e6xxx_chip *chip, int port,
534 /* What interface mode should be used for maximum speed? */
536 int port);
538 int (*port_tag_remap)(struct mv88e6xxx_chip *chip, int port);
540 int (*port_set_policy)(struct mv88e6xxx_chip *chip, int port,
541 enum mv88e6xxx_policy_mapping mapping,
544 int (*port_set_frame_mode)(struct mv88e6xxx_chip *chip, int port,
545 enum mv88e6xxx_frame_mode mode);
546 int (*port_set_ucast_flood)(struct mv88e6xxx_chip *chip, int port,
548 int (*port_set_mcast_flood)(struct mv88e6xxx_chip *chip, int port,
550 int (*port_set_ether_type)(struct mv88e6xxx_chip *chip, int port,
552 int (*port_set_jumbo_size)(struct mv88e6xxx_chip *chip, int port,
555 int (*port_egress_rate_limiting)(struct mv88e6xxx_chip *chip, int port);
556 int (*port_pause_limit)(struct mv88e6xxx_chip *chip, int port, u8 in,
558 int (*port_disable_learn_limit)(struct mv88e6xxx_chip *chip, int port);
559 int (*port_disable_pri_override)(struct mv88e6xxx_chip *chip, int port);
560 int (*port_setup_message_port)(struct mv88e6xxx_chip *chip, int port);
562 /* CMODE control what PHY mode the MAC will use, eg. SGMII, RGMII, etc.
565 int (*port_set_cmode)(struct mv88e6xxx_chip *chip, int port,
566 phy_interface_t mode);
567 int (*port_get_cmode)(struct mv88e6xxx_chip *chip, int port, u8 *cmode);
569 /* Some devices have a per port register indicating what is
570 * the upstream port this port should forward to.
572 int (*port_set_upstream_port)(struct mv88e6xxx_chip *chip, int port,
575 /* Snapshot the statistics for a port. The statistics can then
578 int (*stats_snapshot)(struct mv88e6xxx_chip *chip, int port);
580 /* Set the histogram mode for statistics, when the control registers
588 size_t (*stats_get_stat)(struct mv88e6xxx_chip *chip, int port,
591 int (*set_cpu_port)(struct mv88e6xxx_chip *chip, int port);
594 int port);
599 int (*set_cascade_port)(struct mv88e6xxx_chip *chip, int port);
605 /* SERDES lane mapping */
606 int (*serdes_get_lane)(struct mv88e6xxx_chip *chip, int port);
610 int port);
613 int (*serdes_get_sset_count)(struct mv88e6xxx_chip *chip, int port);
614 int (*serdes_get_strings)(struct mv88e6xxx_chip *chip, int port,
616 size_t (*serdes_get_stats)(struct mv88e6xxx_chip *chip, int port,
620 int (*serdes_get_regs_len)(struct mv88e6xxx_chip *chip, int port);
621 void (*serdes_get_regs)(struct mv88e6xxx_chip *chip, int port,
625 int (*serdes_set_tx_amplitude)(struct mv88e6xxx_chip *chip, int port,
657 void (*phylink_get_caps)(struct mv88e6xxx_chip *chip, int port,
694 /* Access port-scoped Precision Time Protocol registers */
695 int (*port_ptp_read)(struct mv88e6xxx_chip *chip, int port, int addr,
697 int (*port_ptp_write)(struct mv88e6xxx_chip *chip, int port, int addr,
718 int (*port_enable)(struct mv88e6xxx_chip *chip, int port);
719 int (*port_disable)(struct mv88e6xxx_chip *chip, int port);
722 int (*set_ptp_cpu_port)(struct mv88e6xxx_chip *chip, int port);
735 int (*pcs_init)(struct mv88e6xxx_chip *chip, int port);
736 void (*pcs_teardown)(struct mv88e6xxx_chip *chip, int port);
737 struct phylink_pcs *(*pcs_select)(struct mv88e6xxx_chip *chip, int port,
738 phy_interface_t mode);
744 return chip->info->max_sid > 0 && in mv88e6xxx_has_stu()
745 chip->info->ops->stu_loadpurge && in mv88e6xxx_has_stu()
746 chip->info->ops->stu_getnext; in mv88e6xxx_has_stu()
751 return chip->info->pvt; in mv88e6xxx_has_pvt()
756 return !!chip->info->global2_addr; in mv88e6xxx_has_lag()
761 return chip->info->num_databases; in mv88e6xxx_num_databases()
766 return chip->info->num_macs; in mv88e6xxx_num_macs()
771 return chip->info->num_ports; in mv88e6xxx_num_ports()
776 return chip->info->max_vid; in mv88e6xxx_max_vid()
781 return chip->info->max_sid; in mv88e6xxx_max_sid()
786 return GENMASK((s32)mv88e6xxx_num_ports(chip) - 1, 0); in mv88e6xxx_port_mask()
791 return chip->info->num_gpio; in mv88e6xxx_num_gpio()
794 static inline bool mv88e6xxx_is_invalid_port(struct mv88e6xxx_chip *chip, int port) in mv88e6xxx_is_invalid_port() argument
796 return (chip->info->invalid_port_mask & BIT(port)) != 0; in mv88e6xxx_is_invalid_port()
800 int port, bool mab) in mv88e6xxx_port_set_mab() argument
802 chip->ports[port].mab = mab; in mv88e6xxx_port_set_mab()
815 mutex_lock(&chip->reg_lock); in mv88e6xxx_reg_lock()
820 mutex_unlock(&chip->reg_lock); in mv88e6xxx_reg_unlock()