Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Sergey Kubushyn | e8f3912 | 2007-08-10 20:26:18 +0200 | [diff] [blame] | 2 | /* |
| 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 Kubushyn | e8f3912 | 2007-08-10 20:26:18 +0200 | [diff] [blame] | 17 | * Modifications: |
| 18 | * ver. 1.0: Sep 2005, TI PSP Team - Created EMAC version for uBoot. |
Sergey Kubushyn | e8f3912 | 2007-08-10 20:26:18 +0200 | [diff] [blame] | 19 | */ |
| 20 | |
| 21 | #ifndef _DM644X_EMAC_H_ |
| 22 | #define _DM644X_EMAC_H_ |
| 23 | |
| 24 | #include <asm/arch/hardware.h> |
| 25 | |
s-paulraj@ti.com | e338f7e | 2009-05-12 11:45:34 -0400 | [diff] [blame] | 26 | #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 Thompson | d5ee6f6 | 2009-12-18 13:33:07 +0000 | [diff] [blame] | 31 | #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.com | e338f7e | 2009-05-12 11:45:34 -0400 | [diff] [blame] | 38 | #else |
Sergey Kubushyn | e8f3912 | 2007-08-10 20:26:18 +0200 | [diff] [blame] | 39 | #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.com | e338f7e | 2009-05-12 11:45:34 -0400 | [diff] [blame] | 43 | #endif |
Sergey Kubushyn | e8f3912 | 2007-08-10 20:26:18 +0200 | [diff] [blame] | 44 | |
Sandeep Paulraj | 310baca | 2009-09-18 17:30:05 -0400 | [diff] [blame] | 45 | #ifdef CONFIG_SOC_DM646X |
Nick Thompson | d5ee6f6 | 2009-12-18 13:33:07 +0000 | [diff] [blame] | 46 | #define DAVINCI_EMAC_VERSION2 |
| 47 | #define DAVINCI_EMAC_GIG_ENABLE |
| 48 | #endif |
| 49 | |
| 50 | #ifdef CONFIG_SOC_DM646X |
s-paulraj@ti.com | e338f7e | 2009-05-12 11:45:34 -0400 | [diff] [blame] | 51 | /* 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 Thompson | d5ee6f6 | 2009-12-18 13:33:07 +0000 | [diff] [blame] | 60 | #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.com | e338f7e | 2009-05-12 11:45:34 -0400 | [diff] [blame] | 65 | #else |
Sergey Kubushyn | e8f3912 | 2007-08-10 20:26:18 +0200 | [diff] [blame] | 66 | /* 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.com | e338f7e | 2009-05-12 11:45:34 -0400 | [diff] [blame] | 70 | #endif |
| 71 | |
Heiko Schocher | a1a218e | 2011-09-18 19:49:25 +0000 | [diff] [blame] | 72 | #define PHY_KSZ8873 (0x00221450) |
| 73 | int ksz8873_is_phy_connected(int phy_addr); |
| 74 | int ksz8873_get_link_speed(int phy_addr); |
| 75 | int ksz8873_init_phy(int phy_addr); |
| 76 | int ksz8873_auto_negotiate(int phy_addr); |
| 77 | |
Sergey Kubushyn | e8f3912 | 2007-08-10 20:26:18 +0200 | [diff] [blame] | 78 | #define PHY_LXT972 (0x001378e2) |
| 79 | int lxt972_is_phy_connected(int phy_addr); |
| 80 | int lxt972_get_link_speed(int phy_addr); |
| 81 | int lxt972_init_phy(int phy_addr); |
| 82 | int lxt972_auto_negotiate(int phy_addr); |
| 83 | |
| 84 | #define PHY_DP83848 (0x20005c90) |
| 85 | int dp83848_is_phy_connected(int phy_addr); |
| 86 | int dp83848_get_link_speed(int phy_addr); |
| 87 | int dp83848_init_phy(int phy_addr); |
| 88 | int dp83848_auto_negotiate(int phy_addr); |
| 89 | |
Sandeep Paulraj | 3c86e5e | 2010-12-28 15:43:16 -0500 | [diff] [blame] | 90 | #define PHY_ET1011C (0x282f013) |
| 91 | int et1011c_get_link_speed(int phy_addr); |
| 92 | |
Sergey Kubushyn | e8f3912 | 2007-08-10 20:26:18 +0200 | [diff] [blame] | 93 | #endif /* _DM644X_EMAC_H_ */ |