From: Andrew Lunn <andrew@lunn.ch>
To: Frank <Frank.Sae@motor-comm.com>
Cc: Peter Geis <pgwipeout@gmail.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
yinghong.zhang@motor-comm.com, fei.zhang@motor-comm.com,
hua.sun@motor-comm.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] net: phy: Add driver for Motorcomm yt8521 gigabit ethernet phy
Date: Tue, 28 Jun 2022 16:46:33 +0200 [thread overview]
Message-ID: <YrsUSSImpUXrZFUl@lunn.ch> (raw)
In-Reply-To: <20220628104245.35-1-Frank.Sae@motor-comm.com>
> --- a/drivers/net/phy/motorcomm.c
> +++ b/drivers/net/phy/motorcomm.c
> @@ -1,15 +1,115 @@
> // SPDX-License-Identifier: GPL-2.0+
> /*
> - * Driver for Motorcomm PHYs
> + * motorcomm.c: Motorcomm 8511/8521 PHY driver.
Generally you don't include a files name in the file, because it can
get renamed and nobody updates it.
> *
> * Author: Peter Geis <pgwipeout@gmail.com>
> + * Author: Frank <Frank.Sae@motor-comm.com>
> */
>
> #include <linux/kernel.h>
> #include <linux/module.h>
> #include <linux/phy.h>
> +#include <linux/etherdevice.h>
The includes are currently sorted, please keep it so.
>
> #define PHY_ID_YT8511 0x0000010a
> +#define PHY_ID_YT8521 0x0000011A
> +
> +/* YT8521 Register Overview
> + * UTP Register space | FIBER Register space
> + * ------------------------------------------------------------
> + * | UTP MII | FIBER MII |
> + * | UTP MMD | |
> + * | UTP Extended | FIBER Extended |
> + * ------------------------------------------------------------
> + * | Common Extended |
> + * ------------------------------------------------------------
> + */
> +
> +/* 0x10 ~ 0x15 , 0x1E and 0x1F are common MII registers of yt phy */
> +
> +/* Specific Function Control Register */
> +#define YTPHY_SPECIFIC_FUNCTION_CONTROL_REG 0x10
> +
> +/* 2b00 Manual MDI configuration
> + * 2b01 Manual MDIX configuration
> + * 2b10 Reserved
> + * 2b11 Enable automatic crossover for all modes *default*
> +
> +/* 2b00 10 Mbps
> + * 2b01 100 Mbps
> + * 2b10 1000 Mbps
> + * 2b11 Reserved
> +
> +/* 8 working modes:
> + * 3b000 UTP_TO_RGMII *default*
> + * 3b001 FIBER_TO_RGMII
> + * 3b010 UTP_FIBER_TO_RGMII
> + * 3b011 UTP_TO_SGMII
> + * 3b100 SGPHY_TO_RGMAC
> + * 3b101 SGMAC_TO_RGPHY
> + * 3b110 UTP_TO_FIBER_AUTO
> + * 3b111 UTP_TO_FIBER_FORCE
I don't think this notation is used anywhere else in the kernel. It
also took me a little while to figure it out. It would probably be
better to just add comments next to the #define.
Andrew
next prev parent reply other threads:[~2022-06-28 14:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 10:42 [PATCH v2] net: phy: Add driver for Motorcomm yt8521 gigabit ethernet phy Frank
2022-06-28 14:46 ` Andrew Lunn [this message]
2022-06-29 7:44 ` Andrew Lunn
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=YrsUSSImpUXrZFUl@lunn.ch \
--to=andrew@lunn.ch \
--cc=Frank.Sae@motor-comm.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fei.zhang@motor-comm.com \
--cc=hkallweit1@gmail.com \
--cc=hua.sun@motor-comm.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pgwipeout@gmail.com \
--cc=yinghong.zhang@motor-comm.com \
/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).