Commit d9ba8f9e authored by Mugunthan V N's avatar Mugunthan V N Committed by David S. Miller

driver: net: ethernet: cpsw: dual emac interface implementation

The CPSW switch can act as Dual EMAC by segregating the switch ports
using VLAN and port VLAN as per the TRM description in
14.3.2.10.2 Dual Mac Mode

Following CPSW components will be common for both the interfaces.
* Interrupt source is common for both eth interfaces
* Interrupt pacing is common for both interfaces
* Hardware statistics is common for all the ports
* CPDMA is common for both eth interface
* CPTS is common for both the interface and it should not be enabled on
  both the interface as timestamping information doesn't contain port
  information.

Constrains
* Reserved VID of One port should not be used in other interface which will
  enable switching functionality
* Same VID must not be used in both the interface which will enable switching
  functionality
Signed-off-by: default avatarMugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9232b16d
...@@ -24,6 +24,8 @@ Required properties: ...@@ -24,6 +24,8 @@ Required properties:
Optional properties: Optional properties:
- ti,hwmods : Must be "cpgmac0" - ti,hwmods : Must be "cpgmac0"
- no_bd_ram : Must be 0 or 1 - no_bd_ram : Must be 0 or 1
- dual_emac : Specifies Switch to act as Dual EMAC
- dual_emac_res_vlan : Specifies VID to be used to segregate the ports
Note: "ti,hwmods" field is used to fetch the base address and irq Note: "ti,hwmods" field is used to fetch the base address and irq
resources from TI, omap hwmod data base during device registration. resources from TI, omap hwmod data base during device registration.
......
This diff is collapsed.
...@@ -21,6 +21,8 @@ struct cpsw_slave_data { ...@@ -21,6 +21,8 @@ struct cpsw_slave_data {
char phy_id[MII_BUS_ID_SIZE]; char phy_id[MII_BUS_ID_SIZE];
int phy_if; int phy_if;
u8 mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
u16 dual_emac_res_vlan; /* Reserved VLAN for DualEMAC */
}; };
struct cpsw_platform_data { struct cpsw_platform_data {
...@@ -36,6 +38,7 @@ struct cpsw_platform_data { ...@@ -36,6 +38,7 @@ struct cpsw_platform_data {
u32 rx_descs; /* Number of Rx Descriptios */ u32 rx_descs; /* Number of Rx Descriptios */
u32 mac_control; /* Mac control register */ u32 mac_control; /* Mac control register */
u16 default_vlan; /* Def VLAN for ALE lookup in VLAN aware mode*/ u16 default_vlan; /* Def VLAN for ALE lookup in VLAN aware mode*/
bool dual_emac; /* Enable Dual EMAC mode */
}; };
#endif /* __CPSW_H__ */ #endif /* __CPSW_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment