mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 21:51:31 +00:00
net: zynq_gem: Dont enable SGMII and PCS selection
Dont enable SGMII and PCS selection if internal PCS/PMA is not used, by getting the info about internal/external PCS/PMA usage from dt property "is-internal-phy". Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
parent
b8d4497f99
commit
dd12a27ce2
1 changed files with 10 additions and 1 deletions
|
@ -182,6 +182,7 @@ struct zynq_gem_priv {
|
||||||
int phy_of_handle;
|
int phy_of_handle;
|
||||||
struct mii_dev *bus;
|
struct mii_dev *bus;
|
||||||
struct clk clk;
|
struct clk clk;
|
||||||
|
bool int_pcs;
|
||||||
};
|
};
|
||||||
|
|
||||||
static u32 phy_setup_op(struct zynq_gem_priv *priv, u32 phy_addr, u32 regnum,
|
static u32 phy_setup_op(struct zynq_gem_priv *priv, u32 phy_addr, u32 regnum,
|
||||||
|
@ -425,7 +426,12 @@ static int zynq_gem_init(struct udevice *dev)
|
||||||
|
|
||||||
nwconfig = ZYNQ_GEM_NWCFG_INIT;
|
nwconfig = ZYNQ_GEM_NWCFG_INIT;
|
||||||
|
|
||||||
if (priv->interface == PHY_INTERFACE_MODE_SGMII) {
|
/*
|
||||||
|
* Set SGMII enable PCS selection only if internal PCS/PMA
|
||||||
|
* core is used and interface is SGMII.
|
||||||
|
*/
|
||||||
|
if (priv->interface == PHY_INTERFACE_MODE_SGMII &&
|
||||||
|
priv->int_pcs) {
|
||||||
nwconfig |= ZYNQ_GEM_NWCFG_SGMII_ENBL |
|
nwconfig |= ZYNQ_GEM_NWCFG_SGMII_ENBL |
|
||||||
ZYNQ_GEM_NWCFG_PCS_SEL;
|
ZYNQ_GEM_NWCFG_PCS_SEL;
|
||||||
#ifdef CONFIG_ARM64
|
#ifdef CONFIG_ARM64
|
||||||
|
@ -697,6 +703,9 @@ static int zynq_gem_ofdata_to_platdata(struct udevice *dev)
|
||||||
}
|
}
|
||||||
priv->interface = pdata->phy_interface;
|
priv->interface = pdata->phy_interface;
|
||||||
|
|
||||||
|
priv->int_pcs = fdtdec_get_bool(gd->fdt_blob, node,
|
||||||
|
"is-internal-pcspma");
|
||||||
|
|
||||||
printf("ZYNQ GEM: %lx, phyaddr %x, interface %s\n", (ulong)priv->iobase,
|
printf("ZYNQ GEM: %lx, phyaddr %x, interface %s\n", (ulong)priv->iobase,
|
||||||
priv->phyaddr, phy_string_for_interface(priv->interface));
|
priv->phyaddr, phy_string_for_interface(priv->interface));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue