blob: 05b97144d342512db6019230d3f0925e4ede47c1 [file] [log] [blame]
Kevin Hilmanac7b75b2009-05-07 06:19:40 -07001/*
2 * TI DaVinci EMAC platform support
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * 2007 (c) Deep Root Systems, LLC. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
Sriramakrishnan8ee2bf92009-11-19 15:58:25 +053011#ifndef _LINUX_DAVINCI_EMAC_H
12#define _LINUX_DAVINCI_EMAC_H
Kevin Hilmanac7b75b2009-05-07 06:19:40 -070013
14#include <linux/if_ether.h>
Andrew Lunnbec3c112016-02-26 20:59:24 +010015#include <linux/nvmem-consumer.h>
Kevin Hilmanac7b75b2009-05-07 06:19:40 -070016
Cyril Chemparathyf20136e2010-09-15 10:11:21 -040017struct mdio_platform_data {
18 unsigned long bus_freq;
19};
20
Kevin Hilmanac7b75b2009-05-07 06:19:40 -070021struct emac_platform_data {
22 char mac_addr[ETH_ALEN];
23 u32 ctrl_reg_offset;
24 u32 ctrl_mod_reg_offset;
25 u32 ctrl_ram_offset;
Sriramakrishnanad021ae2009-11-19 15:58:27 +053026 u32 hw_ram_addr;
Kevin Hilmanac7b75b2009-05-07 06:19:40 -070027 u32 ctrl_ram_size;
Cyril Chemparathy5d69e002010-09-15 10:11:24 -040028
29 /*
30 * phy_id can be one of the following:
31 * - NULL : use the first phy on the bus,
32 * - "" : force to 100/full, no mdio control
33 * - "<bus>:<addr>" : use the specified bus and phy
34 */
35 const char *phy_id;
36
Kevin Hilmanac7b75b2009-05-07 06:19:40 -070037 u8 rmii_en;
38 u8 version;
Sriram6a1fef62011-03-22 02:31:03 +000039 bool no_bd_ram;
Sriramakrishnan01a9af32009-11-19 15:58:26 +053040 void (*interrupt_enable) (void);
41 void (*interrupt_disable) (void);
Kevin Hilmanac7b75b2009-05-07 06:19:40 -070042};
43
44enum {
45 EMAC_VERSION_1, /* DM644x */
46 EMAC_VERSION_2, /* DM646x */
47};
Mark A. Greerb14dc0f2009-04-15 12:41:27 -070048
Andrew Lunnbec3c112016-02-26 20:59:24 +010049void davinci_get_mac_addr(struct nvmem_device *nvmem, void *context);
Kevin Hilmanac7b75b2009-05-07 06:19:40 -070050#endif