From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Marco Felsch <m.felsch@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH 1/7] ARM: boards: make use of MDIO_MMD register defines
Date: Mon, 10 Jul 2023 11:55:05 +0200 [thread overview]
Message-ID: <c1a55baa-1284-4201-3a25-00e9e6a615c9@pengutronix.de> (raw)
In-Reply-To: <20230710063653.660040-1-m.felsch@pengutronix.de>
On 10.07.23 08:36, Marco Felsch wrote:
> Make use of the register definition instead of having magic numbers. No
> functional change.
>
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> arch/arm/boards/datamodul-edm-qmx6/board.c | 7 ++++---
> arch/arm/boards/embest-marsboard/board.c | 7 ++++---
> arch/arm/boards/terasic-de0-nano-soc/board.c | 7 ++++---
> arch/arm/boards/terasic-de10-nano/board.c | 7 ++++---
> arch/arm/boards/tqma6x/board.c | 7 ++++---
> 5 files changed, 20 insertions(+), 15 deletions(-)
>
> diff --git a/arch/arm/boards/datamodul-edm-qmx6/board.c b/arch/arm/boards/datamodul-edm-qmx6/board.c
> index 9adb3ee0f8..366b64d35a 100644
> --- a/arch/arm/boards/datamodul-edm-qmx6/board.c
> +++ b/arch/arm/boards/datamodul-edm-qmx6/board.c
> @@ -11,6 +11,7 @@
> #include <gpio.h>
> #include <of.h>
>
> +#include <linux/mdio.h>
> #include <linux/micrel_phy.h>
> #include <mfd/stmpe-i2c.h>
>
> @@ -48,9 +49,9 @@ static int ksz9031rn_phy_fixup(struct phy_device *dev)
> * min rx data delay, max rx/tx clock delay,
> * min rx/tx control delay
> */
> - phy_write_mmd_indirect(dev, 4, 2, 0);
> - phy_write_mmd_indirect(dev, 5, 2, 0);
> - phy_write_mmd_indirect(dev, 8, 2, 0x03ff);
> + phy_write_mmd_indirect(dev, 4, MDIO_MMD_WIS, 0);
> + phy_write_mmd_indirect(dev, 5, MDIO_MMD_WIS, 0);
> + phy_write_mmd_indirect(dev, 8, MDIO_MMD_WIS, 0x03ff);
>
> return 0;
> }
> diff --git a/arch/arm/boards/embest-marsboard/board.c b/arch/arm/boards/embest-marsboard/board.c
> index 7835a9265a..7274595e2a 100644
> --- a/arch/arm/boards/embest-marsboard/board.c
> +++ b/arch/arm/boards/embest-marsboard/board.c
> @@ -9,6 +9,7 @@
> #include <init.h>
> #include <envfs.h>
> #include <mach/imx/bbu.h>
> +#include <linux/mdio.h>
> #include <linux/phy.h>
> #include <deep-probe.h>
>
> @@ -19,13 +20,13 @@ static int ar8035_phy_fixup(struct phy_device *dev)
> /* Ar803x phy SmartEEE feature cause link status generates glitch,
> * which cause ethernet link down/up issue, so disable SmartEEE
> */
> - val = phy_read_mmd_indirect(dev, 0x805d, 0x3);
> + val = phy_read_mmd_indirect(dev, 0x805d, MDIO_MMD_PCS);
> phy_write(dev, MII_MMD_DATA, val & ~(1 << 8));
>
> - val = phy_read_mmd_indirect(dev, 0x4003, 0x3);
> + val = phy_read_mmd_indirect(dev, 0x4003, MDIO_MMD_PCS);
> phy_write(dev, MII_MMD_DATA, val & ~(1 << 8));
>
> - val = phy_read_mmd_indirect(dev, 0x4007, 0x3);
> + val = phy_read_mmd_indirect(dev, 0x4007, MDIO_MMD_PCS);
> val &= 0xffe3;
> val |= 0x18;
> phy_write(dev, MII_MMD_DATA, val);
> diff --git a/arch/arm/boards/terasic-de0-nano-soc/board.c b/arch/arm/boards/terasic-de0-nano-soc/board.c
> index 19f74b784c..832160c595 100644
> --- a/arch/arm/boards/terasic-de0-nano-soc/board.c
> +++ b/arch/arm/boards/terasic-de0-nano-soc/board.c
> @@ -5,6 +5,7 @@
> #include <driver.h>
> #include <init.h>
> #include <asm/armlinux.h>
> +#include <linux/mdio.h>
> #include <linux/micrel_phy.h>
> #include <linux/phy.h>
> #include <linux/sizes.h>
> @@ -18,9 +19,9 @@ static int phy_fixup(struct phy_device *dev)
> * min rx data delay, max rx/tx clock delay,
> * min rx/tx control delay
> */
> - phy_write_mmd_indirect(dev, 4, 2, 0);
> - phy_write_mmd_indirect(dev, 5, 2, 0);
> - phy_write_mmd_indirect(dev, 8, 2, 0x003ff);
> + phy_write_mmd_indirect(dev, 4, MDIO_MMD_WIS, 0);
> + phy_write_mmd_indirect(dev, 5, MDIO_MMD_WIS, 0);
> + phy_write_mmd_indirect(dev, 8, MDIO_MMD_WIS, 0x003ff);
> return 0;
> }
>
> diff --git a/arch/arm/boards/terasic-de10-nano/board.c b/arch/arm/boards/terasic-de10-nano/board.c
> index 580c898012..e47d9ac841 100644
> --- a/arch/arm/boards/terasic-de10-nano/board.c
> +++ b/arch/arm/boards/terasic-de10-nano/board.c
> @@ -5,6 +5,7 @@
> #include <driver.h>
> #include <init.h>
> #include <asm/armlinux.h>
> +#include <linux/mdio.h>
> #include <linux/micrel_phy.h>
> #include <linux/phy.h>
> #include <linux/sizes.h>
> @@ -18,9 +19,9 @@ static int phy_fixup(struct phy_device *dev)
> * min rx data delay, max rx/tx clock delay,
> * min rx/tx control delay
> */
> - phy_write_mmd_indirect(dev, 4, 2, 0);
> - phy_write_mmd_indirect(dev, 5, 2, 0);
> - phy_write_mmd_indirect(dev, 8, 2, 0x003ff);
> + phy_write_mmd_indirect(dev, 4, MDIO_MMD_WIS, 0);
> + phy_write_mmd_indirect(dev, 5, MDIO_MMD_WIS, 0);
> + phy_write_mmd_indirect(dev, 8, MDIO_MMD_WIS, 0x003ff);
> return 0;
> }
>
> diff --git a/arch/arm/boards/tqma6x/board.c b/arch/arm/boards/tqma6x/board.c
> index 4bb7223a6e..8a91ad652a 100644
> --- a/arch/arm/boards/tqma6x/board.c
> +++ b/arch/arm/boards/tqma6x/board.c
> @@ -11,6 +11,7 @@
> #include <gpio.h>
> #include <of.h>
>
> +#include <linux/mdio.h>
> #include <linux/micrel_phy.h>
> #include <mfd/stmpe-i2c.h>
>
> @@ -46,9 +47,9 @@ static int ksz9031rn_phy_fixup(struct phy_device *dev)
> * min rx data delay, max rx/tx clock delay,
> * min rx/tx control delay
> */
> - phy_write_mmd_indirect(dev, 4, 2, 0);
> - phy_write_mmd_indirect(dev, 5, 2, 0);
> - phy_write_mmd_indirect(dev, 8, 2, 0x003ff);
> + phy_write_mmd_indirect(dev, 4, MDIO_MMD_WIS, 0);
> + phy_write_mmd_indirect(dev, 5, MDIO_MMD_WIS, 0);
> + phy_write_mmd_indirect(dev, 8, MDIO_MMD_WIS, 0x003ff);
>
> return 0;
> }
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2023-07-10 9:56 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-10 6:36 Marco Felsch
2023-07-10 6:36 ` [PATCH 2/7] net: phy: micrel: " Marco Felsch
2023-07-10 9:56 ` Ahmad Fatoum
2023-07-10 10:37 ` Marco Felsch
2023-07-10 6:36 ` [PATCH 3/7] net: phy: sync phy_{write,read,modify}_mmd_indirect with linux Marco Felsch
2023-07-10 9:59 ` Ahmad Fatoum
2023-07-10 10:49 ` Marco Felsch
2023-07-10 10:53 ` Ahmad Fatoum
2023-07-10 11:01 ` Marco Felsch
2023-07-10 11:03 ` Ahmad Fatoum
2023-07-10 12:43 ` Marco Felsch
2023-07-10 12:52 ` Ahmad Fatoum
2023-07-10 6:36 ` [PATCH 4/7] net: phy: add phydev_{err,err_probe,info,warn,dbg} macros Marco Felsch
2023-07-10 10:01 ` Ahmad Fatoum
2023-07-10 6:36 ` [PATCH 5/7] net: phy: at803x: add support for configuring SmartEEE Marco Felsch
2023-07-10 10:10 ` Ahmad Fatoum
2023-07-10 12:10 ` Oleksij Rempel
2023-07-10 6:36 ` [PATCH 6/7] net: phy: at803x: add disable hibernation mode support Marco Felsch
2023-07-10 10:07 ` Ahmad Fatoum
2023-07-10 10:53 ` Marco Felsch
2023-07-10 11:07 ` Ahmad Fatoum
2023-07-10 6:36 ` [PATCH 7/7] net: phy: at803x: disable extended next page bit Marco Felsch
2023-07-10 10:03 ` Ahmad Fatoum
2023-07-10 9:55 ` Ahmad Fatoum [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=c1a55baa-1284-4201-3a25-00e9e6a615c9@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=m.felsch@pengutronix.de \
/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