blob: 8a17de9054a5c20e3be6930e359b7477035c6111 [file] [log] [blame]
Sergey Kubushyne8f39122007-08-10 20:26:18 +02001/*
2 * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
3 *
4 * Based on:
5 *
6 * ----------------------------------------------------------------------------
7 *
8 * dm644x_emac.h
9 *
10 * TI DaVinci (DM644X) EMAC peripheral driver header for DV-EVM
11 *
12 * Copyright (C) 2005 Texas Instruments.
13 *
14 * ----------------------------------------------------------------------------
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 * ----------------------------------------------------------------------------
30
31 * Modifications:
32 * ver. 1.0: Sep 2005, TI PSP Team - Created EMAC version for uBoot.
33 *
34 */
35
36#ifndef _DM644X_EMAC_H_
37#define _DM644X_EMAC_H_
38
39#include <asm/arch/hardware.h>
40
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040041#ifdef CONFIG_SOC_DM365
42#define EMAC_BASE_ADDR (0x01d07000)
43#define EMAC_WRAPPER_BASE_ADDR (0x01d0a000)
44#define EMAC_WRAPPER_RAM_ADDR (0x01d08000)
45#define EMAC_MDIO_BASE_ADDR (0x01d0b000)
Nick Thompsond5ee6f62009-12-18 13:33:07 +000046#define DAVINCI_EMAC_VERSION2
47#elif defined(CONFIG_SOC_DA8XX)
48#define EMAC_BASE_ADDR DAVINCI_EMAC_CNTRL_REGS_BASE
49#define EMAC_WRAPPER_BASE_ADDR DAVINCI_EMAC_WRAPPER_CNTRL_REGS_BASE
50#define EMAC_WRAPPER_RAM_ADDR DAVINCI_EMAC_WRAPPER_RAM_BASE
51#define EMAC_MDIO_BASE_ADDR DAVINCI_MDIO_CNTRL_REGS_BASE
52#define DAVINCI_EMAC_VERSION2
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040053#else
Sergey Kubushyne8f39122007-08-10 20:26:18 +020054#define EMAC_BASE_ADDR (0x01c80000)
55#define EMAC_WRAPPER_BASE_ADDR (0x01c81000)
56#define EMAC_WRAPPER_RAM_ADDR (0x01c82000)
57#define EMAC_MDIO_BASE_ADDR (0x01c84000)
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040058#endif
Sergey Kubushyne8f39122007-08-10 20:26:18 +020059
Sandeep Paulraj310baca2009-09-18 17:30:05 -040060#ifdef CONFIG_SOC_DM646X
Nick Thompsond5ee6f62009-12-18 13:33:07 +000061#define DAVINCI_EMAC_VERSION2
62#define DAVINCI_EMAC_GIG_ENABLE
63#endif
64
65#ifdef CONFIG_SOC_DM646X
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040066/* MDIO module input frequency */
67#define EMAC_MDIO_BUS_FREQ 76500000
68/* MDIO clock output frequency */
69#define EMAC_MDIO_CLOCK_FREQ 2500000 /* 2.5 MHz */
70#elif defined(CONFIG_SOC_DM365)
71/* MDIO module input frequency */
72#define EMAC_MDIO_BUS_FREQ 121500000
73/* MDIO clock output frequency */
74#define EMAC_MDIO_CLOCK_FREQ 2200000 /* 2.2 MHz */
Nick Thompsond5ee6f62009-12-18 13:33:07 +000075#elif defined(CONFIG_SOC_DA8XX)
76/* MDIO module input frequency */
77#define EMAC_MDIO_BUS_FREQ clk_get(DAVINCI_MDIO_CLKID)
78/* MDIO clock output frequency */
79#define EMAC_MDIO_CLOCK_FREQ 2000000 /* 2.0 MHz */
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040080#else
Sergey Kubushyne8f39122007-08-10 20:26:18 +020081/* MDIO module input frequency */
82#define EMAC_MDIO_BUS_FREQ 99000000 /* PLL/6 - 99 MHz */
83/* MDIO clock output frequency */
84#define EMAC_MDIO_CLOCK_FREQ 2000000 /* 2.0 MHz */
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040085#endif
86
Heiko Schochera1a218e2011-09-18 19:49:25 +000087#define PHY_KSZ8873 (0x00221450)
88int ksz8873_is_phy_connected(int phy_addr);
89int ksz8873_get_link_speed(int phy_addr);
90int ksz8873_init_phy(int phy_addr);
91int ksz8873_auto_negotiate(int phy_addr);
92
Sergey Kubushyne8f39122007-08-10 20:26:18 +020093#define PHY_LXT972 (0x001378e2)
94int lxt972_is_phy_connected(int phy_addr);
95int lxt972_get_link_speed(int phy_addr);
96int lxt972_init_phy(int phy_addr);
97int lxt972_auto_negotiate(int phy_addr);
98
99#define PHY_DP83848 (0x20005c90)
100int dp83848_is_phy_connected(int phy_addr);
101int dp83848_get_link_speed(int phy_addr);
102int dp83848_init_phy(int phy_addr);
103int dp83848_auto_negotiate(int phy_addr);
104
Sandeep Paulraj3c86e5e2010-12-28 15:43:16 -0500105#define PHY_ET1011C (0x282f013)
106int et1011c_get_link_speed(int phy_addr);
107
Sergey Kubushyne8f39122007-08-10 20:26:18 +0200108#endif /* _DM644X_EMAC_H_ */