From: Florian Fainelli <f.fainelli@gmail.com>
To: Robert Hancock <hancock@sedsystems.ca>,
netdev@vger.kernel.org, Heiner Kallweit <hkallweit1@gmail.com>,
Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH net-next] net: phy: xilinx: add Xilinx PHY driver
Date: Fri, 31 May 2019 14:11:21 -0700 [thread overview]
Message-ID: <a03619fb-95f3-e663-f219-a219744c73ef@gmail.com> (raw)
In-Reply-To: <1559330150-30099-1-git-send-email-hancock@sedsystems.ca>
On 5/31/19 12:15 PM, Robert Hancock wrote:
> This adds a driver for the PHY device implemented in the Xilinx PCS/PMA
> Core logic. Aside from being a generic gigabit PHY, it includes an
> important register setting to disable the PHY isolation bit, which is
> required for the PHY to operate in 1000BaseX mode.
>
> This version is a simplified version of the GPL 2+ version from the
> Xilinx kernel tree.
>
> Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
> ---
> drivers/net/phy/Kconfig | 6 +++++
> drivers/net/phy/Makefile | 1 +
> drivers/net/phy/xilinx_phy.c | 60 ++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 67 insertions(+)
> create mode 100644 drivers/net/phy/xilinx_phy.c
>
> diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
> index db5645b..101c794 100644
> --- a/drivers/net/phy/Kconfig
> +++ b/drivers/net/phy/Kconfig
> @@ -462,6 +462,12 @@ config VITESSE_PHY
> ---help---
> Currently supports the vsc8244
>
> +config XILINX_PHY
> + tristate "Drivers for Xilinx PHYs"
> + help
> + This module provides a driver for the PHY implemented in the
> + Xilinx PCS/PMA Core.
> +
> config XILINX_GMII2RGMII
> tristate "Xilinx GMII2RGMII converter driver"
> ---help---
> diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
> index bac339e..f71359d 100644
> --- a/drivers/net/phy/Makefile
> +++ b/drivers/net/phy/Makefile
> @@ -92,3 +92,4 @@ obj-$(CONFIG_STE10XP) += ste10Xp.o
> obj-$(CONFIG_TERANETICS_PHY) += teranetics.o
> obj-$(CONFIG_VITESSE_PHY) += vitesse.o
> obj-$(CONFIG_XILINX_GMII2RGMII) += xilinx_gmii2rgmii.o
> +obj-$(CONFIG_XILINX_PHY) += xilinx_phy.o
> diff --git a/drivers/net/phy/xilinx_phy.c b/drivers/net/phy/xilinx_phy.c
> new file mode 100644
> index 0000000..2d468c7
> --- /dev/null
> +++ b/drivers/net/phy/xilinx_phy.c
> @@ -0,0 +1,60 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/* Xilinx PCS/PMA Core phy driver
> + *
> + * Copyright (C) 2019 SED Systems, a division of Calian Ltd.
> + *
> + * Based upon Xilinx version of this driver:
> + * Copyright (C) 2015 Xilinx, Inc.
> + *
> + * Description:
> + * This driver is developed for PCS/PMA Core.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/mii.h>
> +#include <linux/phy.h>
> +
> +/* Mask used for ID comparisons */
> +#define XILINX_PHY_ID_MASK 0xfffffff0
> +
> +/* Known PHY IDs */
> +#define XILINX_PHY_ID 0x01740c00
> +
> +#define XPCSPMA_PHY_CTRL_ISOLATE_DISABLE 0xFBFF
> +
> +static int xilinxphy_config_init(struct phy_device *phydev)
> +{
> + int temp;
> +
> + temp = phy_read(phydev, MII_BMCR);
> + temp &= XPCSPMA_PHY_CTRL_ISOLATE_DISABLE;
> + phy_write(phydev, MII_BMCR, temp);
The PHY library takes care of clearing the BMCR_ISOLATE bit, is not that
working for you?
--
Florian
prev parent reply other threads:[~2019-05-31 21:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-31 19:15 [PATCH net-next] net: phy: xilinx: add Xilinx PHY driver Robert Hancock
2019-05-31 19:15 ` [PATCH net-next] net: phy: Ensure scheduled work is cancelled during removal Robert Hancock
2019-05-31 20:54 ` Andrew Lunn
2019-05-31 21:26 ` Heiner Kallweit
2019-06-01 3:22 ` hancock
2019-06-01 15:46 ` Andrew Lunn
2019-05-31 20:52 ` [PATCH net-next] net: phy: xilinx: add Xilinx PHY driver Andrew Lunn
2019-05-31 21:11 ` Florian Fainelli [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a03619fb-95f3-e663-f219-a219744c73ef@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=hancock@sedsystems.ca \
--cc=hkallweit1@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).