summaryrefslogtreecommitdiff
path: root/arch/arm/mach-davinci/ksz8873.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.m@jp.panasonic.com>2015-02-20 17:04:05 +0900
committerTom Rini <trini@ti.com>2015-02-21 08:23:51 -0500
commit601fbec7cf815bc2b26ba2546ac5e8501fc7edae (patch)
tree61c83cdadd3499fcbcf63feb39064ef4130afe3e /arch/arm/mach-davinci/ksz8873.c
parent09f455dca74973ef5e42311162c8dff7e83d44a2 (diff)
downloadu-boot-imx-601fbec7cf815bc2b26ba2546ac5e8501fc7edae.zip
u-boot-imx-601fbec7cf815bc2b26ba2546ac5e8501fc7edae.tar.gz
u-boot-imx-601fbec7cf815bc2b26ba2546ac5e8501fc7edae.tar.bz2
ARM: davinci: move SoC sources to mach-davinci
Move arch/arm/cpu/arm926ejs/davinci/* -> arch/arm/mach-davinci/* Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Tom Rini <trini@ti.com>
Diffstat (limited to 'arch/arm/mach-davinci/ksz8873.c')
-rw-r--r--arch/arm/mach-davinci/ksz8873.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/ksz8873.c b/arch/arm/mach-davinci/ksz8873.c
new file mode 100644
index 0000000..75af135
--- /dev/null
+++ b/arch/arm/mach-davinci/ksz8873.c
@@ -0,0 +1,53 @@
+/*
+ * Micrel KSZ8873 PHY Driver for TI DaVinci
+ * (TMS320DM644x) based boards.
+ *
+ * Copyright (C) 2011 Heiko Schocher <hsdenx.de>
+ *
+ * based on:
+ * National Semiconductor DP83848 PHY Driver for TI DaVinci
+ * (TMS320DM644x) based boards.
+ *
+ * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
+ *
+ * --------------------------------------------------------
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <miiphy.h>
+#include <net.h>
+#include <asm/arch/emac_defs.h>
+#include <asm/io.h>
+#include "../../../drivers/net/davinci_emac.h"
+
+int ksz8873_is_phy_connected(int phy_addr)
+{
+ u_int16_t dummy;
+
+ return davinci_eth_phy_read(phy_addr, MII_PHYSID1, &dummy);
+}
+
+int ksz8873_get_link_speed(int phy_addr)
+{
+ emac_regs *emac = (emac_regs *)EMAC_BASE_ADDR;
+
+ /* we always have a link to the switch, 100 FD */
+ writel((EMAC_MACCONTROL_MIIEN_ENABLE |
+ EMAC_MACCONTROL_FULLDUPLEX_ENABLE),
+ &emac->MACCONTROL);
+ return 1;
+}
+
+
+int ksz8873_init_phy(int phy_addr)
+{
+ return 1;
+}
+
+
+int ksz8873_auto_negotiate(int phy_addr)
+{
+ return dp83848_get_link_speed(phy_addr);
+}