1*2b62997cSCyril Chemparathy /* 2*2b62997cSCyril Chemparathy * CPSW Ethernet Switch Driver 3*2b62997cSCyril Chemparathy * 4*2b62997cSCyril Chemparathy * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ 5*2b62997cSCyril Chemparathy * 6*2b62997cSCyril Chemparathy * This program is free software; you can redistribute it and/or 7*2b62997cSCyril Chemparathy * modify it under the terms of the GNU General Public License as 8*2b62997cSCyril Chemparathy * published by the Free Software Foundation version 2. 9*2b62997cSCyril Chemparathy * 10*2b62997cSCyril Chemparathy * This program is distributed "as is" WITHOUT ANY WARRANTY of any 11*2b62997cSCyril Chemparathy * kind, whether express or implied; without even the implied warranty 12*2b62997cSCyril Chemparathy * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13*2b62997cSCyril Chemparathy * GNU General Public License for more details. 14*2b62997cSCyril Chemparathy */ 15*2b62997cSCyril Chemparathy 16*2b62997cSCyril Chemparathy #ifndef _CPSW_H_ 17*2b62997cSCyril Chemparathy #define _CPSW_H_ 18*2b62997cSCyril Chemparathy 19*2b62997cSCyril Chemparathy struct cpsw_slave_data { 20*2b62997cSCyril Chemparathy u32 slave_reg_ofs; 21*2b62997cSCyril Chemparathy u32 sliver_reg_ofs; 22*2b62997cSCyril Chemparathy int phy_id; 23*2b62997cSCyril Chemparathy int phy_if; 24*2b62997cSCyril Chemparathy }; 25*2b62997cSCyril Chemparathy 26*2b62997cSCyril Chemparathy enum { 27*2b62997cSCyril Chemparathy CPSW_CTRL_VERSION_1 = 0, 28*2b62997cSCyril Chemparathy CPSW_CTRL_VERSION_2 /* am33xx like devices */ 29*2b62997cSCyril Chemparathy }; 30*2b62997cSCyril Chemparathy 31*2b62997cSCyril Chemparathy struct cpsw_platform_data { 32*2b62997cSCyril Chemparathy u32 mdio_base; 33*2b62997cSCyril Chemparathy u32 cpsw_base; 34*2b62997cSCyril Chemparathy int mdio_div; 35*2b62997cSCyril Chemparathy int channels; /* number of cpdma channels (symmetric) */ 36*2b62997cSCyril Chemparathy u32 cpdma_reg_ofs; /* cpdma register offset */ 37*2b62997cSCyril Chemparathy int slaves; /* number of slave cpgmac ports */ 38*2b62997cSCyril Chemparathy u32 ale_reg_ofs; /* address lookup engine reg offset */ 39*2b62997cSCyril Chemparathy int ale_entries; /* ale table size */ 40*2b62997cSCyril Chemparathy u32 host_port_reg_ofs; /* cpdma host port registers */ 41*2b62997cSCyril Chemparathy u32 hw_stats_reg_ofs; /* cpsw hw stats counters */ 42*2b62997cSCyril Chemparathy u32 mac_control; 43*2b62997cSCyril Chemparathy struct cpsw_slave_data *slave_data; 44*2b62997cSCyril Chemparathy void (*control)(int enabled); 45*2b62997cSCyril Chemparathy u32 host_port_num; 46*2b62997cSCyril Chemparathy u8 version; 47*2b62997cSCyril Chemparathy }; 48*2b62997cSCyril Chemparathy 49*2b62997cSCyril Chemparathy int cpsw_register(struct cpsw_platform_data *data); 50*2b62997cSCyril Chemparathy 51*2b62997cSCyril Chemparathy #endif /* _CPSW_H_ */ 52