Lines Matching full:cpsw
39 #include "am65-cpsw-nuss.h"
40 #include "am65-cpsw-switchdev.h"
192 "initializing am65 cpsw nuss version 0x%08X, cpsw version 0x%08X Ports: %u quirks:%08x\n", in am65_cpsw_nuss_get_ver()
2978 static int am65_cpsw_register_notifiers(struct am65_cpsw_common *cpsw) in am65_cpsw_register_notifiers() argument
2982 if (AM65_CPSW_IS_CPSW2G(cpsw) || in am65_cpsw_register_notifiers()
2986 cpsw->am65_cpsw_netdevice_nb.notifier_call = &am65_cpsw_netdevice_event; in am65_cpsw_register_notifiers()
2987 ret = register_netdevice_notifier(&cpsw->am65_cpsw_netdevice_nb); in am65_cpsw_register_notifiers()
2989 dev_err(cpsw->dev, "can't register netdevice notifier\n"); in am65_cpsw_register_notifiers()
2993 ret = am65_cpsw_switchdev_register_notifiers(cpsw); in am65_cpsw_register_notifiers()
2995 unregister_netdevice_notifier(&cpsw->am65_cpsw_netdevice_nb); in am65_cpsw_register_notifiers()
3000 static void am65_cpsw_unregister_notifiers(struct am65_cpsw_common *cpsw) in am65_cpsw_unregister_notifiers() argument
3002 if (AM65_CPSW_IS_CPSW2G(cpsw) || in am65_cpsw_unregister_notifiers()
3006 am65_cpsw_switchdev_unregister_notifiers(cpsw); in am65_cpsw_unregister_notifiers()
3007 unregister_netdevice_notifier(&cpsw->am65_cpsw_netdevice_nb); in am65_cpsw_unregister_notifiers()
3012 static void am65_cpsw_init_stp_ale_entry(struct am65_cpsw_common *cpsw) in am65_cpsw_init_stp_ale_entry() argument
3014 cpsw_ale_add_mcast(cpsw->ale, eth_stp_addr, ALE_PORT_HOST, ALE_SUPER, 0, in am65_cpsw_init_stp_ale_entry()
3086 struct am65_cpsw_common *cpsw = port->common; in am65_cpsw_init_port_switch_ale() local
3089 cpsw_ale_control_set(cpsw->ale, port->port_id, in am65_cpsw_init_port_switch_ale()
3092 cpsw_ale_add_ucast(cpsw->ale, port->ndev->dev_addr, in am65_cpsw_init_port_switch_ale()
3098 cpsw_ale_add_mcast(cpsw->ale, port->ndev->broadcast, in am65_cpsw_init_port_switch_ale()
3104 cpsw_ale_control_set(cpsw->ale, port->port_id, in am65_cpsw_init_port_switch_ale()
3113 struct am65_cpsw_common *cpsw = dl_priv->common; in am65_cpsw_dl_switch_mode_set() local
3118 dev_dbg(cpsw->dev, "%s id:%u\n", __func__, id); in am65_cpsw_dl_switch_mode_set()
3123 if (switch_en == !cpsw->is_emac_mode) in am65_cpsw_dl_switch_mode_set()
3126 if (!switch_en && cpsw->br_members) { in am65_cpsw_dl_switch_mode_set()
3127 dev_err(cpsw->dev, "Remove ports from bridge before disabling switch mode\n"); in am65_cpsw_dl_switch_mode_set()
3133 cpsw->is_emac_mode = !switch_en; in am65_cpsw_dl_switch_mode_set()
3135 for (i = 0; i < cpsw->port_num; i++) { in am65_cpsw_dl_switch_mode_set()
3136 struct net_device *sl_ndev = cpsw->ports[i].ndev; in am65_cpsw_dl_switch_mode_set()
3146 for (i = 0; i < cpsw->port_num; i++) { in am65_cpsw_dl_switch_mode_set()
3147 struct net_device *sl_ndev = cpsw->ports[i].ndev; in am65_cpsw_dl_switch_mode_set()
3155 slave->port_vlan = cpsw->default_vlan; in am65_cpsw_dl_switch_mode_set()
3163 cpsw_ale_control_set(cpsw->ale, 0, ALE_BYPASS, 1); in am65_cpsw_dl_switch_mode_set()
3165 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_CLEAR, 1); in am65_cpsw_dl_switch_mode_set()
3166 cpsw_ale_control_get(cpsw->ale, HOST_PORT_NUM, ALE_AGEOUT); in am65_cpsw_dl_switch_mode_set()
3169 dev_info(cpsw->dev, "Enable switch mode\n"); in am65_cpsw_dl_switch_mode_set()
3171 am65_cpsw_init_host_port_switch(cpsw); in am65_cpsw_dl_switch_mode_set()
3173 for (i = 0; i < cpsw->port_num; i++) { in am65_cpsw_dl_switch_mode_set()
3174 struct net_device *sl_ndev = cpsw->ports[i].ndev; in am65_cpsw_dl_switch_mode_set()
3183 slave->port_vlan = cpsw->default_vlan; in am65_cpsw_dl_switch_mode_set()
3190 dev_info(cpsw->dev, "Disable switch mode\n"); in am65_cpsw_dl_switch_mode_set()
3192 am65_cpsw_init_host_port_emac(cpsw); in am65_cpsw_dl_switch_mode_set()
3194 for (i = 0; i < cpsw->port_num; i++) { in am65_cpsw_dl_switch_mode_set()
3195 struct net_device *sl_ndev = cpsw->ports[i].ndev; in am65_cpsw_dl_switch_mode_set()
3207 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_BYPASS, 0); in am65_cpsw_dl_switch_mode_set()
3459 { .compatible = "ti,am654-cpsw-nuss", .data = &am65x_sr1_0},
3460 { .compatible = "ti,j721e-cpsw-nuss", .data = &j721e_pdata},
3461 { .compatible = "ti,am642-cpsw-nuss", .data = &am64x_cpswxg_pdata},
3772 MODULE_DESCRIPTION("TI AM65 CPSW Ethernet driver");