projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net: phy: mscc: factorize part of config function for VSC8584
[oweals/u-boot.git]
/
drivers
/
net
/
phy
/
xilinx_phy.c
diff --git
a/drivers/net/phy/xilinx_phy.c
b/drivers/net/phy/xilinx_phy.c
index 3f80f0495e8d54ff6b74e5e3995e343595eaa9f7..3aa8891efe45c9faa27a4f65acac4a402cd9b110 100644
(file)
--- a/
drivers/net/phy/xilinx_phy.c
+++ b/
drivers/net/phy/xilinx_phy.c
@@
-1,9
+1,8
@@
+// SPDX-License-Identifier: GPL-2.0+
/*
* Xilinx PCS/PMA Core phy driver
*
* Copyright (C) 2015 - 2016 Xilinx, Inc.
/*
* Xilinx PCS/PMA Core phy driver
*
* Copyright (C) 2015 - 2016 Xilinx, Inc.
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#include <config.h>
*/
#include <config.h>
@@
-11,8
+10,6
@@
#include <phy.h>
#include <dm.h>
#include <phy.h>
#include <dm.h>
-DECLARE_GLOBAL_DATA_PTR;
-
#define MII_PHY_STATUS_SPD_MASK 0x0C00
#define MII_PHY_STATUS_FULLDUPLEX 0x1000
#define MII_PHY_STATUS_1000 0x0800
#define MII_PHY_STATUS_SPD_MASK 0x0C00
#define MII_PHY_STATUS_FULLDUPLEX 0x1000
#define MII_PHY_STATUS_1000 0x0800
@@
-102,10
+99,14
@@
static int xilinxphy_startup(struct phy_device *phydev)
static int xilinxphy_of_init(struct phy_device *phydev)
{
u32 phytype;
static int xilinxphy_of_init(struct phy_device *phydev)
{
u32 phytype;
+ ofnode node;
debug("%s\n", __func__);
debug("%s\n", __func__);
- phytype = fdtdec_get_int(gd->fdt_blob, dev_of_offset(phydev->dev),
- "phy-type", -1);
+ node = phy_get_ofnode(phydev);
+ if (!ofnode_valid(node))
+ return -EINVAL;
+
+ phytype = ofnode_read_u32_default(node, "xlnx,phy-type", -1);
if (phytype == XAE_PHY_TYPE_1000BASE_X)
phydev->flags |= XAE_PHY_TYPE_1000BASE_X;
if (phytype == XAE_PHY_TYPE_1000BASE_X)
phydev->flags |= XAE_PHY_TYPE_1000BASE_X;