• Home
  • Raw
  • Download

Lines Matching +full:on +full:- +full:chip

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Marvell 88E6xxx Ethernet switch single-chip definition
24 /* PVT limits for 4-bit port and 5-bit switch */
119 * ports 2-4 are not routet to pins.
122 /* Multi-chip Addressing Mode.
124 * when it is non-zero, and use indirect access to internal registers.
127 /* Dual-chip Addressing Mode
129 * allowing two to coexist on the same SMI interface.
169 struct irq_chip chip; member
228 struct mv88e6xxx_chip *chip; member
269 /* The MII bus and the address on the bus that is used to
276 /* Handles automatic disabling and re-enabling of the PHY
346 /* Per-port timestamping resources. */
357 int (*read)(struct mv88e6xxx_chip *chip, int addr, int reg, u16 *val);
358 int (*write)(struct mv88e6xxx_chip *chip, int addr, int reg, u16 val);
363 struct mv88e6xxx_chip *chip; member
372 int (*setup_errata)(struct mv88e6xxx_chip *chip);
374 int (*ieee_pri_map)(struct mv88e6xxx_chip *chip);
375 int (*ip_pri_map)(struct mv88e6xxx_chip *chip);
378 int (*irl_init_all)(struct mv88e6xxx_chip *chip, int port);
380 int (*get_eeprom)(struct mv88e6xxx_chip *chip,
382 int (*set_eeprom)(struct mv88e6xxx_chip *chip,
385 int (*set_switch_mac)(struct mv88e6xxx_chip *chip, u8 *addr);
387 int (*phy_read)(struct mv88e6xxx_chip *chip,
390 int (*phy_write)(struct mv88e6xxx_chip *chip,
395 int (*pot_clear)(struct mv88e6xxx_chip *chip);
398 int (*ppu_enable)(struct mv88e6xxx_chip *chip);
399 int (*ppu_disable)(struct mv88e6xxx_chip *chip);
402 int (*reset)(struct mv88e6xxx_chip *chip);
405 * Add delay on PHY_INTERFACE_MODE_RGMII_*ID, no delay otherwise.
407 int (*port_set_rgmii_delay)(struct mv88e6xxx_chip *chip, int port,
412 #define LINK_UNFORCED -2
418 int (*port_set_link)(struct mv88e6xxx_chip *chip, int port, int link);
424 int (*port_set_pause)(struct mv88e6xxx_chip *chip, int port,
428 #define SPEED_UNFORCED -2
429 #define DUPLEX_UNFORCED -2
433 * Depending on the chip, 10, 100, 200, 1000, 2500, 10000 are valid.
439 int (*port_set_speed_duplex)(struct mv88e6xxx_chip *chip, int port,
445 int (*port_tag_remap)(struct mv88e6xxx_chip *chip, int port);
447 int (*port_set_policy)(struct mv88e6xxx_chip *chip, int port,
451 int (*port_set_frame_mode)(struct mv88e6xxx_chip *chip, int port,
453 int (*port_set_egress_floods)(struct mv88e6xxx_chip *chip, int port,
455 int (*port_set_ether_type)(struct mv88e6xxx_chip *chip, int port,
457 int (*port_set_jumbo_size)(struct mv88e6xxx_chip *chip, int port,
460 int (*port_egress_rate_limiting)(struct mv88e6xxx_chip *chip, int port);
461 int (*port_pause_limit)(struct mv88e6xxx_chip *chip, int port, u8 in,
463 int (*port_disable_learn_limit)(struct mv88e6xxx_chip *chip, int port);
464 int (*port_disable_pri_override)(struct mv88e6xxx_chip *chip, int port);
465 int (*port_setup_message_port)(struct mv88e6xxx_chip *chip, int port);
468 * Some chips allow this to be configured on specific ports.
470 int (*port_set_cmode)(struct mv88e6xxx_chip *chip, int port,
472 int (*port_get_cmode)(struct mv88e6xxx_chip *chip, int port, u8 *cmode);
477 int (*port_set_upstream_port)(struct mv88e6xxx_chip *chip, int port,
483 int (*stats_snapshot)(struct mv88e6xxx_chip *chip, int port);
488 int (*stats_set_histogram)(struct mv88e6xxx_chip *chip);
491 int (*stats_get_sset_count)(struct mv88e6xxx_chip *chip);
492 int (*stats_get_strings)(struct mv88e6xxx_chip *chip, uint8_t *data);
493 int (*stats_get_stats)(struct mv88e6xxx_chip *chip, int port,
495 int (*set_cpu_port)(struct mv88e6xxx_chip *chip, int port);
496 int (*set_egress_port)(struct mv88e6xxx_chip *chip,
503 int (*set_cascade_port)(struct mv88e6xxx_chip *chip, int port);
507 int (*mgmt_rsvd2cpu)(struct mv88e6xxx_chip *chip);
509 /* Power on/off a SERDES interface */
510 int (*serdes_power)(struct mv88e6xxx_chip *chip, int port, u8 lane,
514 u8 (*serdes_get_lane)(struct mv88e6xxx_chip *chip, int port);
516 int (*serdes_pcs_get_state)(struct mv88e6xxx_chip *chip, int port,
518 int (*serdes_pcs_config)(struct mv88e6xxx_chip *chip, int port,
522 int (*serdes_pcs_an_restart)(struct mv88e6xxx_chip *chip, int port,
524 int (*serdes_pcs_link_up)(struct mv88e6xxx_chip *chip, int port,
528 unsigned int (*serdes_irq_mapping)(struct mv88e6xxx_chip *chip,
530 int (*serdes_irq_enable)(struct mv88e6xxx_chip *chip, int port, u8 lane,
532 irqreturn_t (*serdes_irq_status)(struct mv88e6xxx_chip *chip, int port,
536 int (*serdes_get_sset_count)(struct mv88e6xxx_chip *chip, int port);
537 int (*serdes_get_strings)(struct mv88e6xxx_chip *chip, int port,
539 int (*serdes_get_stats)(struct mv88e6xxx_chip *chip, int port,
543 int (*serdes_get_regs_len)(struct mv88e6xxx_chip *chip, int port);
544 void (*serdes_get_regs)(struct mv88e6xxx_chip *chip, int port,
548 int (*atu_get_hash)(struct mv88e6xxx_chip *chip, u8 *hash);
549 int (*atu_set_hash)(struct mv88e6xxx_chip *chip, u8 hash);
552 int (*vtu_getnext)(struct mv88e6xxx_chip *chip,
554 int (*vtu_loadpurge)(struct mv88e6xxx_chip *chip,
564 int (*rmu_disable)(struct mv88e6xxx_chip *chip);
570 void (*phylink_validate)(struct mv88e6xxx_chip *chip, int port,
575 int (*set_max_frame_size)(struct mv88e6xxx_chip *chip, int mtu);
580 int (*irq_action)(struct mv88e6xxx_chip *chip, int irq);
582 int (*irq_setup)(struct mv88e6xxx_chip *chip);
584 void (*irq_free)(struct mv88e6xxx_chip *chip);
588 /* Get/set data on GPIO pin */
589 int (*get_data)(struct mv88e6xxx_chip *chip, unsigned int pin);
590 int (*set_data)(struct mv88e6xxx_chip *chip, unsigned int pin,
594 int (*get_dir)(struct mv88e6xxx_chip *chip, unsigned int pin);
595 int (*set_dir)(struct mv88e6xxx_chip *chip, unsigned int pin,
599 int (*get_pctl)(struct mv88e6xxx_chip *chip, unsigned int pin,
601 int (*set_pctl)(struct mv88e6xxx_chip *chip, unsigned int pin,
606 /* Access port-scoped Precision Time Protocol registers */
607 int (*port_ptp_read)(struct mv88e6xxx_chip *chip, int port, int addr,
609 int (*port_ptp_write)(struct mv88e6xxx_chip *chip, int port, int addr,
613 int (*ptp_read)(struct mv88e6xxx_chip *chip, int addr, u16 *data,
615 int (*ptp_write)(struct mv88e6xxx_chip *chip, int addr, u16 data);
618 int (*tai_read)(struct mv88e6xxx_chip *chip, int addr, u16 *data,
620 int (*tai_write)(struct mv88e6xxx_chip *chip, int addr, u16 data);
626 struct ptp_clock_request *rq, int on);
630 int (*port_enable)(struct mv88e6xxx_chip *chip, int port);
631 int (*port_disable)(struct mv88e6xxx_chip *chip, int port);
632 int (*global_enable)(struct mv88e6xxx_chip *chip);
633 int (*global_disable)(struct mv88e6xxx_chip *chip);
656 static inline bool mv88e6xxx_has_pvt(struct mv88e6xxx_chip *chip) in mv88e6xxx_has_pvt() argument
658 return chip->info->pvt; in mv88e6xxx_has_pvt()
661 static inline unsigned int mv88e6xxx_num_databases(struct mv88e6xxx_chip *chip) in mv88e6xxx_num_databases() argument
663 return chip->info->num_databases; in mv88e6xxx_num_databases()
666 static inline unsigned int mv88e6xxx_num_macs(struct mv88e6xxx_chip *chip) in mv88e6xxx_num_macs() argument
668 return chip->info->num_macs; in mv88e6xxx_num_macs()
671 static inline unsigned int mv88e6xxx_num_ports(struct mv88e6xxx_chip *chip) in mv88e6xxx_num_ports() argument
673 return chip->info->num_ports; in mv88e6xxx_num_ports()
676 static inline u16 mv88e6xxx_port_mask(struct mv88e6xxx_chip *chip) in mv88e6xxx_port_mask() argument
678 return GENMASK((s32)mv88e6xxx_num_ports(chip) - 1, 0); in mv88e6xxx_port_mask()
681 static inline unsigned int mv88e6xxx_num_gpio(struct mv88e6xxx_chip *chip) in mv88e6xxx_num_gpio() argument
683 return chip->info->num_gpio; in mv88e6xxx_num_gpio()
686 static inline bool mv88e6xxx_is_invalid_port(struct mv88e6xxx_chip *chip, int port) in mv88e6xxx_is_invalid_port() argument
688 return (chip->info->invalid_port_mask & BIT(port)) != 0; in mv88e6xxx_is_invalid_port()
691 int mv88e6xxx_read(struct mv88e6xxx_chip *chip, int addr, int reg, u16 *val);
692 int mv88e6xxx_write(struct mv88e6xxx_chip *chip, int addr, int reg, u16 val);
693 int mv88e6xxx_wait_mask(struct mv88e6xxx_chip *chip, int addr, int reg,
695 int mv88e6xxx_wait_bit(struct mv88e6xxx_chip *chip, int addr, int reg,
697 struct mii_bus *mv88e6xxx_default_mdio_bus(struct mv88e6xxx_chip *chip);
699 static inline void mv88e6xxx_reg_lock(struct mv88e6xxx_chip *chip) in mv88e6xxx_reg_lock() argument
701 mutex_lock(&chip->reg_lock); in mv88e6xxx_reg_lock()
704 static inline void mv88e6xxx_reg_unlock(struct mv88e6xxx_chip *chip) in mv88e6xxx_reg_unlock() argument
706 mutex_unlock(&chip->reg_lock); in mv88e6xxx_reg_unlock()
709 int mv88e6xxx_fid_map(struct mv88e6xxx_chip *chip, unsigned long *bitmap);