xref: /rk3399_rockchip-uboot/include/cpsw.h (revision 2bf36ac638ab2db9f0295aa47064976eeebf80c1)
12b62997cSCyril Chemparathy /*
22b62997cSCyril Chemparathy  * CPSW Ethernet Switch Driver
32b62997cSCyril Chemparathy  *
42b62997cSCyril Chemparathy  * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
52b62997cSCyril Chemparathy  *
62b62997cSCyril Chemparathy  * This program is free software; you can redistribute it and/or
72b62997cSCyril Chemparathy  * modify it under the terms of the GNU General Public License as
82b62997cSCyril Chemparathy  * published by the Free Software Foundation version 2.
92b62997cSCyril Chemparathy  *
102b62997cSCyril Chemparathy  * This program is distributed "as is" WITHOUT ANY WARRANTY of any
112b62997cSCyril Chemparathy  * kind, whether express or implied; without even the implied warranty
122b62997cSCyril Chemparathy  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
132b62997cSCyril Chemparathy  * GNU General Public License for more details.
142b62997cSCyril Chemparathy  */
152b62997cSCyril Chemparathy 
162b62997cSCyril Chemparathy #ifndef _CPSW_H_
172b62997cSCyril Chemparathy #define _CPSW_H_
182b62997cSCyril Chemparathy 
192b62997cSCyril Chemparathy struct cpsw_slave_data {
202b62997cSCyril Chemparathy 	u32		slave_reg_ofs;
212b62997cSCyril Chemparathy 	u32		sliver_reg_ofs;
222b62997cSCyril Chemparathy 	int		phy_id;
232b62997cSCyril Chemparathy 	int		phy_if;
242b62997cSCyril Chemparathy };
252b62997cSCyril Chemparathy 
262b62997cSCyril Chemparathy enum {
272b62997cSCyril Chemparathy 	CPSW_CTRL_VERSION_1 = 0,
282b62997cSCyril Chemparathy 	CPSW_CTRL_VERSION_2	/* am33xx like devices */
292b62997cSCyril Chemparathy };
302b62997cSCyril Chemparathy 
312b62997cSCyril Chemparathy struct cpsw_platform_data {
322b62997cSCyril Chemparathy 	u32	mdio_base;
332b62997cSCyril Chemparathy 	u32	cpsw_base;
342b62997cSCyril Chemparathy 	int	mdio_div;
352b62997cSCyril Chemparathy 	int	channels;	/* number of cpdma channels (symmetric)	*/
362b62997cSCyril Chemparathy 	u32	cpdma_reg_ofs;	/* cpdma register offset		*/
372b62997cSCyril Chemparathy 	int	slaves;		/* number of slave cpgmac ports		*/
382b62997cSCyril Chemparathy 	u32	ale_reg_ofs;	/* address lookup engine reg offset	*/
392b62997cSCyril Chemparathy 	int	ale_entries;	/* ale table size			*/
402b62997cSCyril Chemparathy 	u32	host_port_reg_ofs;	/* cpdma host port registers	*/
412b62997cSCyril Chemparathy 	u32	hw_stats_reg_ofs;	/* cpsw hw stats counters	*/
42*2bf36ac6SMugunthan V N 	u32	bd_ram_ofs;		/* Buffer Descriptor RAM offset */
432b62997cSCyril Chemparathy 	u32	mac_control;
442b62997cSCyril Chemparathy 	struct cpsw_slave_data	*slave_data;
452b62997cSCyril Chemparathy 	void	(*control)(int enabled);
462b62997cSCyril Chemparathy 	u32	host_port_num;
472b62997cSCyril Chemparathy 	u8	version;
482b62997cSCyril Chemparathy };
492b62997cSCyril Chemparathy 
502b62997cSCyril Chemparathy int cpsw_register(struct cpsw_platform_data *data);
512b62997cSCyril Chemparathy 
522b62997cSCyril Chemparathy #endif /* _CPSW_H_  */
53