Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/sunxi Enable phy-supply if present
details: https://anonhg.NetBSD.org/src/rev/c9cc3587f14b
branches: trunk
changeset: 999289:c9cc3587f14b
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Mon May 27 23:27:26 2019 +0000
description:
Enable phy-supply if present
diffstat:
sys/arch/arm/sunxi/sunxi_gmac.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diffs (40 lines):
diff -r 4d42676bdf9f -r c9cc3587f14b sys/arch/arm/sunxi/sunxi_gmac.c
--- a/sys/arch/arm/sunxi/sunxi_gmac.c Mon May 27 23:27:14 2019 +0000
+++ b/sys/arch/arm/sunxi/sunxi_gmac.c Mon May 27 23:27:26 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_gmac.c,v 1.3 2019/02/23 17:18:38 martin Exp $ */
+/* $NetBSD: sunxi_gmac.c,v 1.4 2019/05/27 23:27:26 jmcneill Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_gmac.c,v 1.3 2019/02/23 17:18:38 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_gmac.c,v 1.4 2019/05/27 23:27:26 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -108,6 +108,7 @@
const int phandle = faa->faa_phandle;
struct clk *clk_gmac, *clk_gmac_tx;
struct fdtbus_reset *rst_gmac;
+ struct fdtbus_regulator *reg_phy;
const char *phy_mode;
char intrstr[128];
bus_addr_t addr;
@@ -145,6 +146,13 @@
aprint_error(": missing 'phy-mode' property\n");
return;
}
+
+ reg_phy = fdtbus_regulator_acquire(phandle, "phy-supply");
+ if (reg_phy != NULL && fdtbus_regulator_enable(reg_phy) != 0) {
+ aprint_error(": couldn't enable PHY regualtor\n");
+ return;
+ }
+
if (strcmp(phy_mode, "mii") == 0) {
if (clk_set_rate(clk_gmac_tx, GMAC_TX_RATE_MII) != 0) {
aprint_error(": failed to set TX clock rate (MII)\n");
Home |
Main Index |
Thread Index |
Old Index