blob: b08d06dd2472810c54763c3cd4c9663f134cfd97 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Sergey Kubushyne8f39122007-08-10 20:26:18 +02002/*
3 * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
4 *
5 * Based on:
6 *
7 * ----------------------------------------------------------------------------
8 *
9 * dm644x_emac.h
10 *
11 * TI DaVinci (DM644X) EMAC peripheral driver header for DV-EVM
12 *
13 * Copyright (C) 2005 Texas Instruments.
14 *
15 * ----------------------------------------------------------------------------
16 *
Sergey Kubushyne8f39122007-08-10 20:26:18 +020017 * Modifications:
18 * ver. 1.0: Sep 2005, TI PSP Team - Created EMAC version for uBoot.
Sergey Kubushyne8f39122007-08-10 20:26:18 +020019 */
20
21#ifndef _DM644X_EMAC_H_
22#define _DM644X_EMAC_H_
23
24#include <asm/arch/hardware.h>
25
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040026#ifdef CONFIG_SOC_DM365
27#define EMAC_BASE_ADDR (0x01d07000)
28#define EMAC_WRAPPER_BASE_ADDR (0x01d0a000)
29#define EMAC_WRAPPER_RAM_ADDR (0x01d08000)
30#define EMAC_MDIO_BASE_ADDR (0x01d0b000)
Nick Thompsond5ee6f62009-12-18 13:33:07 +000031#define DAVINCI_EMAC_VERSION2
32#elif defined(CONFIG_SOC_DA8XX)
33#define EMAC_BASE_ADDR DAVINCI_EMAC_CNTRL_REGS_BASE
34#define EMAC_WRAPPER_BASE_ADDR DAVINCI_EMAC_WRAPPER_CNTRL_REGS_BASE
35#define EMAC_WRAPPER_RAM_ADDR DAVINCI_EMAC_WRAPPER_RAM_BASE
36#define EMAC_MDIO_BASE_ADDR DAVINCI_MDIO_CNTRL_REGS_BASE
37#define DAVINCI_EMAC_VERSION2
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040038#else
Sergey Kubushyne8f39122007-08-10 20:26:18 +020039#define EMAC_BASE_ADDR (0x01c80000)
40#define EMAC_WRAPPER_BASE_ADDR (0x01c81000)
41#define EMAC_WRAPPER_RAM_ADDR (0x01c82000)
42#define EMAC_MDIO_BASE_ADDR (0x01c84000)
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040043#endif
Sergey Kubushyne8f39122007-08-10 20:26:18 +020044
Sandeep Paulraj310baca2009-09-18 17:30:05 -040045#ifdef CONFIG_SOC_DM646X
Nick Thompsond5ee6f62009-12-18 13:33:07 +000046#define DAVINCI_EMAC_VERSION2
47#define DAVINCI_EMAC_GIG_ENABLE
48#endif
49
50#ifdef CONFIG_SOC_DM646X
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040051/* MDIO module input frequency */
52#define EMAC_MDIO_BUS_FREQ 76500000
53/* MDIO clock output frequency */
54#define EMAC_MDIO_CLOCK_FREQ 2500000 /* 2.5 MHz */
55#elif defined(CONFIG_SOC_DM365)
56/* MDIO module input frequency */
57#define EMAC_MDIO_BUS_FREQ 121500000
58/* MDIO clock output frequency */
59#define EMAC_MDIO_CLOCK_FREQ 2200000 /* 2.2 MHz */
Nick Thompsond5ee6f62009-12-18 13:33:07 +000060#elif defined(CONFIG_SOC_DA8XX)
61/* MDIO module input frequency */
62#define EMAC_MDIO_BUS_FREQ clk_get(DAVINCI_MDIO_CLKID)
63/* MDIO clock output frequency */
64#define EMAC_MDIO_CLOCK_FREQ 2000000 /* 2.0 MHz */
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040065#else
Sergey Kubushyne8f39122007-08-10 20:26:18 +020066/* MDIO module input frequency */
67#define EMAC_MDIO_BUS_FREQ 99000000 /* PLL/6 - 99 MHz */
68/* MDIO clock output frequency */
69#define EMAC_MDIO_CLOCK_FREQ 2000000 /* 2.0 MHz */
s-paulraj@ti.come338f7e2009-05-12 11:45:34 -040070#endif
71
Heiko Schochera1a218e2011-09-18 19:49:25 +000072#define PHY_KSZ8873 (0x00221450)
73int ksz8873_is_phy_connected(int phy_addr);
74int ksz8873_get_link_speed(int phy_addr);
75int ksz8873_init_phy(int phy_addr);
76int ksz8873_auto_negotiate(int phy_addr);
77
Sergey Kubushyne8f39122007-08-10 20:26:18 +020078#define PHY_LXT972 (0x001378e2)
79int lxt972_is_phy_connected(int phy_addr);
80int lxt972_get_link_speed(int phy_addr);
81int lxt972_init_phy(int phy_addr);
82int lxt972_auto_negotiate(int phy_addr);
83
84#define PHY_DP83848 (0x20005c90)
85int dp83848_is_phy_connected(int phy_addr);
86int dp83848_get_link_speed(int phy_addr);
87int dp83848_init_phy(int phy_addr);
88int dp83848_auto_negotiate(int phy_addr);
89
Sandeep Paulraj3c86e5e2010-12-28 15:43:16 -050090#define PHY_ET1011C (0x282f013)
91int et1011c_get_link_speed(int phy_addr);
92
Sergey Kubushyne8f39122007-08-10 20:26:18 +020093#endif /* _DM644X_EMAC_H_ */