#define SJA1105ET_FDB_BIN_SIZE 4 /* The hardware value is in multiples of 10 ms. * The passed parameter is in multiples of 1 ms.
*/ #define SJA1105_AGEING_TIME_MS(ms) ((ms) / 10) #define SJA1105_NUM_L2_POLICERS SJA1110_MAX_L2_POLICING_COUNT
/* Calculated assuming 1Gbps, where the clock has 125 MHz (8 ns period) * To avoid floating point operations, we'll multiply the degrees by 10 * to get a "phase" and get 1 decimal point precision.
*/ #define SJA1105_RGMII_DELAY_PS_TO_PHASE(ps) \
(((ps) * 360) / 800) #define SJA1105_RGMII_DELAY_PHASE_TO_PS(phase) \
((800 * (phase)) / 360) #define SJA1105_RGMII_DELAY_PHASE_TO_HW(phase) \
(((phase) - 738) / 9) #define SJA1105_RGMII_DELAY_PS_TO_HW(ps) \
SJA1105_RGMII_DELAY_PHASE_TO_HW(SJA1105_RGMII_DELAY_PS_TO_PHASE(ps))
/* Valid range in degrees is a value between 73.8 and 101.7 * in 0.9 degree increments
*/ #define SJA1105_RGMII_DELAY_MIN_PS \
SJA1105_RGMII_DELAY_PHASE_TO_PS(738) #define SJA1105_RGMII_DELAY_MAX_PS \
SJA1105_RGMII_DELAY_PHASE_TO_PS(1017)
struct sja1105_info {
u64 device_id; /* Needed for distinction between P and R, and between Q and S * (since the parts with/without SGMII share the same * switch core and device_id)
*/
u64 part_no; /* E/T and P/Q/R/S have partial timestamps of different sizes. * They must be reconstructed on both families anyway to get the full * 64-bit values back.
*/ int ptp_ts_bits; /* Also SPI commands are of different sizes to retrieve * the egress timestamps.
*/ int ptpegr_ts_bytes; int num_cbs_shapers; int max_frame_mem; int num_ports; bool multiple_cascade_ports; /* Every {port, TXQ} has its own CBS shaper */ bool fixed_cbs_mapping; enum dsa_tag_protocol tag_proto; conststruct sja1105_dynamic_table_ops *dyn_ops; conststruct sja1105_table_ops *static_ops; conststruct sja1105_regs *regs; bool can_limit_mcast_flood; int (*reset_cmd)(struct dsa_switch *ds); int (*setup_rgmii_delay)(constvoid *ctx, int port); /* Prototypes from include/net/dsa.h */ int (*fdb_add_cmd)(struct dsa_switch *ds, int port, constunsignedchar *addr, u16 vid); int (*fdb_del_cmd)(struct dsa_switch *ds, int port, constunsignedchar *addr, u16 vid); void (*ptp_cmd_packing)(u8 *buf, struct sja1105_ptp_cmd *cmd, enum packing_op op); bool (*rxtstamp)(struct dsa_switch *ds, int port, struct sk_buff *skb); void (*txtstamp)(struct dsa_switch *ds, int port, struct sk_buff *skb); int (*clocking_setup)(struct sja1105_private *priv); int (*pcs_mdio_read_c45)(struct mii_bus *bus, int phy, int mmd, int reg); int (*pcs_mdio_write_c45)(struct mii_bus *bus, int phy, int mmd, int reg, u16 val); int (*disable_microcontroller)(struct sja1105_private *priv); constchar *name; bool supports_mii[SJA1105_MAX_NUM_PORTS]; bool supports_rmii[SJA1105_MAX_NUM_PORTS]; bool supports_rgmii[SJA1105_MAX_NUM_PORTS]; bool supports_sgmii[SJA1105_MAX_NUM_PORTS]; bool supports_2500basex[SJA1105_MAX_NUM_PORTS]; enum sja1105_internal_phy_t internal_phy[SJA1105_MAX_NUM_PORTS]; const u64 port_speed[SJA1105_SPEED_MAX];
};
int sja1105_static_config_reload(struct sja1105_private *priv, enum sja1105_reset_reason reason); int sja1105_vlan_filtering(struct dsa_switch *ds, int port, bool enabled, struct netlink_ext_ack *extack); void sja1105_frame_memory_partitioning(struct sja1105_private *priv);
/* From sja1105_mdio.c */ int sja1105_mdiobus_register(struct dsa_switch *ds); void sja1105_mdiobus_unregister(struct dsa_switch *ds); int sja1105_pcs_mdio_read_c45(struct mii_bus *bus, int phy, int mmd, int reg); int sja1105_pcs_mdio_write_c45(struct mii_bus *bus, int phy, int mmd, int reg,
u16 val); int sja1110_pcs_mdio_read_c45(struct mii_bus *bus, int phy, int mmd, int reg); int sja1110_pcs_mdio_write_c45(struct mii_bus *bus, int phy, int mmd, int reg,
u16 val);
/* From sja1105_devlink.c */ int sja1105_devlink_setup(struct dsa_switch *ds); void sja1105_devlink_teardown(struct dsa_switch *ds); int sja1105_devlink_info_get(struct dsa_switch *ds, struct devlink_info_req *req, struct netlink_ext_ack *extack);
/* From sja1105_spi.c */ int sja1105_xfer_buf(conststruct sja1105_private *priv,
sja1105_spi_rw_mode_t rw, u64 reg_addr,
u8 *buf, size_t len); int sja1105_xfer_u32(conststruct sja1105_private *priv,
sja1105_spi_rw_mode_t rw, u64 reg_addr, u32 *value, struct ptp_system_timestamp *ptp_sts); int sja1105_xfer_u64(conststruct sja1105_private *priv,
sja1105_spi_rw_mode_t rw, u64 reg_addr, u64 *value, struct ptp_system_timestamp *ptp_sts); int static_config_buf_prepare_for_upload(struct sja1105_private *priv, void *config_buf, int buf_len); int sja1105_static_config_upload(struct sja1105_private *priv); int sja1105_inhibit_tx(conststruct sja1105_private *priv, unsignedlong port_bitmap, bool tx_inhibited);
int sja1105pqrs_setup_rgmii_delay(constvoid *ctx, int port); int sja1110_setup_rgmii_delay(constvoid *ctx, int port); int sja1105_clocking_setup_port(struct sja1105_private *priv, int port); int sja1105_clocking_setup(struct sja1105_private *priv); int sja1110_disable_microcontroller(struct sja1105_private *priv);
/* From sja1105_ethtool.c */ void sja1105_get_ethtool_stats(struct dsa_switch *ds, int port, u64 *data); void sja1105_get_strings(struct dsa_switch *ds, int port,
u32 stringset, u8 *data); int sja1105_get_sset_count(struct dsa_switch *ds, int port, int sset);
/* From sja1105_dynamic_config.c */ int sja1105_dynamic_config_read(struct sja1105_private *priv, enum sja1105_blk_idx blk_idx, int index, void *entry); int sja1105_dynamic_config_write(struct sja1105_private *priv, enum sja1105_blk_idx blk_idx, int index, void *entry, bool keep);
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.