blob: cf1d30bfdcf7660177d27b648d873c217cacfc70 [file] [log] [blame]
Cyril Chemparathy2b629972012-07-24 12:22:16 +00001/*
2 * CPSW Ethernet Switch Driver
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef _CPSW_H_
17#define _CPSW_H_
18
19struct cpsw_slave_data {
20 u32 slave_reg_ofs;
21 u32 sliver_reg_ofs;
Mugunthan V N9c653aa2014-02-18 07:31:52 -050022 int phy_addr;
Cyril Chemparathy2b629972012-07-24 12:22:16 +000023 int phy_if;
24};
25
26enum {
27 CPSW_CTRL_VERSION_1 = 0,
28 CPSW_CTRL_VERSION_2 /* am33xx like devices */
29};
30
31struct cpsw_platform_data {
32 u32 mdio_base;
33 u32 cpsw_base;
Mugunthan V N4cc77892015-09-07 14:22:21 +053034 u32 mac_id;
35 u32 gmii_sel;
Cyril Chemparathy2b629972012-07-24 12:22:16 +000036 int mdio_div;
37 int channels; /* number of cpdma channels (symmetric) */
38 u32 cpdma_reg_ofs; /* cpdma register offset */
39 int slaves; /* number of slave cpgmac ports */
40 u32 ale_reg_ofs; /* address lookup engine reg offset */
41 int ale_entries; /* ale table size */
42 u32 host_port_reg_ofs; /* cpdma host port registers */
43 u32 hw_stats_reg_ofs; /* cpsw hw stats counters */
Mugunthan V N2bf36ac2013-07-08 16:04:37 +053044 u32 bd_ram_ofs; /* Buffer Descriptor RAM offset */
Cyril Chemparathy2b629972012-07-24 12:22:16 +000045 u32 mac_control;
46 struct cpsw_slave_data *slave_data;
47 void (*control)(int enabled);
48 u32 host_port_num;
Mugunthan V N7a022752014-05-22 14:37:10 +053049 u32 active_slave;
Cyril Chemparathy2b629972012-07-24 12:22:16 +000050 u8 version;
51};
52
53int cpsw_register(struct cpsw_platform_data *data);
54
55#endif /* _CPSW_H_ */