blob: c3f046efa872e88236489c7884e1742207a7e56a [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 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +020016 * SPDX-License-Identifier: GPL-2.0+
Sergey Kubushyne8f39122007-08-10 20:26:18 +020017 *
Sergey Kubushyne8f39122007-08-10 20:26:18 +020018 * Modifications:
19 * ver. 1.0: Sep 2005, TI PSP Team - Created EMAC version for uBoot.
Sergey Kubushyne8f39122007-08-10 20:26:18 +020020 */
21
22#ifndef _DM644X_EMAC_H_
23#define _DM644X_EMAC_H_
24
25#include <asm/arch/hardware.h>
26
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040027#ifdef CONFIG_SOC_DM365
28#define EMAC_BASE_ADDR (0x01d07000)
29#define EMAC_WRAPPER_BASE_ADDR (0x01d0a000)
30#define EMAC_WRAPPER_RAM_ADDR (0x01d08000)
31#define EMAC_MDIO_BASE_ADDR (0x01d0b000)
Nick Thompsond5ee6f62009-12-18 13:33:07 +000032#define DAVINCI_EMAC_VERSION2
33#elif defined(CONFIG_SOC_DA8XX)
34#define EMAC_BASE_ADDR DAVINCI_EMAC_CNTRL_REGS_BASE
35#define EMAC_WRAPPER_BASE_ADDR DAVINCI_EMAC_WRAPPER_CNTRL_REGS_BASE
36#define EMAC_WRAPPER_RAM_ADDR DAVINCI_EMAC_WRAPPER_RAM_BASE
37#define EMAC_MDIO_BASE_ADDR DAVINCI_MDIO_CNTRL_REGS_BASE
38#define DAVINCI_EMAC_VERSION2
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040039#else
Sergey Kubushyne8f39122007-08-10 20:26:18 +020040#define EMAC_BASE_ADDR (0x01c80000)
41#define EMAC_WRAPPER_BASE_ADDR (0x01c81000)
42#define EMAC_WRAPPER_RAM_ADDR (0x01c82000)
43#define EMAC_MDIO_BASE_ADDR (0x01c84000)
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040044#endif
Sergey Kubushyne8f39122007-08-10 20:26:18 +020045
Sandeep Paulraj310baca2009-09-18 17:30:05 -040046#ifdef CONFIG_SOC_DM646X
Nick Thompsond5ee6f62009-12-18 13:33:07 +000047#define DAVINCI_EMAC_VERSION2
48#define DAVINCI_EMAC_GIG_ENABLE
49#endif
50
51#ifdef CONFIG_SOC_DM646X
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040052/* MDIO module input frequency */
53#define EMAC_MDIO_BUS_FREQ 76500000
54/* MDIO clock output frequency */
55#define EMAC_MDIO_CLOCK_FREQ 2500000 /* 2.5 MHz */
56#elif defined(CONFIG_SOC_DM365)
57/* MDIO module input frequency */
58#define EMAC_MDIO_BUS_FREQ 121500000
59/* MDIO clock output frequency */
60#define EMAC_MDIO_CLOCK_FREQ 2200000 /* 2.2 MHz */
Nick Thompsond5ee6f62009-12-18 13:33:07 +000061#elif defined(CONFIG_SOC_DA8XX)
62/* MDIO module input frequency */
63#define EMAC_MDIO_BUS_FREQ clk_get(DAVINCI_MDIO_CLKID)
64/* MDIO clock output frequency */
65#define EMAC_MDIO_CLOCK_FREQ 2000000 /* 2.0 MHz */
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040066#else
Sergey Kubushyne8f39122007-08-10 20:26:18 +020067/* MDIO module input frequency */
68#define EMAC_MDIO_BUS_FREQ 99000000 /* PLL/6 - 99 MHz */
69/* MDIO clock output frequency */
70#define EMAC_MDIO_CLOCK_FREQ 2000000 /* 2.0 MHz */
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040071#endif
72
Heiko Schochera1a218e2011-09-18 19:49:25 +000073#define PHY_KSZ8873 (0x00221450)
74int ksz8873_is_phy_connected(int phy_addr);
75int ksz8873_get_link_speed(int phy_addr);
76int ksz8873_init_phy(int phy_addr);
77int ksz8873_auto_negotiate(int phy_addr);
78
Sergey Kubushyne8f39122007-08-10 20:26:18 +020079#define PHY_LXT972 (0x001378e2)
80int lxt972_is_phy_connected(int phy_addr);
81int lxt972_get_link_speed(int phy_addr);
82int lxt972_init_phy(int phy_addr);
83int lxt972_auto_negotiate(int phy_addr);
84
85#define PHY_DP83848 (0x20005c90)
86int dp83848_is_phy_connected(int phy_addr);
87int dp83848_get_link_speed(int phy_addr);
88int dp83848_init_phy(int phy_addr);
89int dp83848_auto_negotiate(int phy_addr);
90
Sandeep Paulraj3c86e5e2010-12-28 15:43:16 -050091#define PHY_ET1011C (0x282f013)
92int et1011c_get_link_speed(int phy_addr);
93
Sergey Kubushyne8f39122007-08-10 20:26:18 +020094#endif /* _DM644X_EMAC_H_ */