All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lasse Johnsen <lasse@timebeat.app>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, richardcochran@gmail.com,
	Gordon Hollingworth <gordon@raspberrypi.com>,
	Ahmad Byagowi <clk@fb.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	bcm-kernel-feedback-list@broadcom.com,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH net-next] 1588 support on bcm54210pe
Date: Fri, 22 Apr 2022 15:21:16 +0100	[thread overview]
Message-ID: <C6DCE6EC-926D-4EDF-AFE9-F949C0F55B7F@timebeat.app> (raw)
In-Reply-To: <YmBc2E2eCPHMA7lR@lunn.ch>

Hi Andrew,

> On 20 Apr 2022, at 20:19, Andrew Lunn <andrew@lunn.ch> wrote:
> 
> On Wed, Apr 20, 2022 at 03:03:26PM +0100, Lasse Johnsen wrote:
>> Hello,
>> 
>> 
>> The attached set of patches adds support for the IEEE1588 functionality on the BCM54210PE PHY using the Linux Kernel mii_timestamper interface. The BCM54210PE PHY can be found in the Raspberry PI Compute Module 4 and the work has been undertaken by Timebeat.app on behalf of Raspberry PI with help and support from the nice engineers at Broadcom.
> 
> Hi Lasse
> 
> There are a few process issues you should address.
> 
> Please wrap your email at about 80 characters.
> 
> Please take a read of
> 
> https://www.kernel.org/doc/html/latest/process/submitting-patches.html
> 
> and
> 
> https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#netdev-faq
> 
> It is a bit of a learning curve getting patches accepted, and you have
> to follow the processes defined in these documents.

I have read the documents, I understand about 10% of them and I am considering jumping off a tall building :-)

I’ve changed the subject of the email. How did I do?

> 
>> arch/arm/configs/bcm2711_defconfig            |    1 +
>> arch/arm64/configs/bcm2711_defconfig          |    1 +
> 
> You will need to split these changes up. defconfg changes go via the
> Broadcom maintainers. PHY driver changes go via netdev. You can
> initially post them as a series, but in the end you might need to send
> them to different people/lists.
> 

Ok. I was asked by Florian to put the Broadcom maintainers in Cc so I will do this to begin with.

>> +obj-$(CONFIG_BCM54120PE_PHY)	+= bcm54210pe_ptp.o
> 
> How specific is this code to the bcm54210pe? Should it work for any
> bcm54xxx PHY? You might want to name this file broadcom_ptp.c if it
> will work with any PHY supported by broadcom.c.

I am confident that this code is relevant exclusively to the BCM54210PE. It will not even work with the BCM54210, BCM54210S and BCM54210SE PHYs.

> 
>> +static bool bcm54210pe_fetch_timestamp(u8 txrx, u8 message_type, u16 seq_id, struct bcm54210pe_private *private, u64 *timestamp)
>> +{
>> +	struct bcm54210pe_circular_buffer_item *item; 
>> +	struct list_head *this, *next;
>> +
>> +	u8 index = (txrx * 4) + message_type;
>> +
>> +	if(index >= CIRCULAR_BUFFER_COUNT)
>> +	{
>> +		return false;
>> +	}
> 
> Please run your code through ./scripts/checkpatch.pl. You will find
> the code has a number of code style issues which need cleaning up.

I am about to respond to Richard's mail with an amended set of patches which is much cleaner. checkpatch now complains only about a Signed-off line and asks if Maintainers needs updating because I’ve added a file (I guess it probably does). 

> 
>> +#if IS_ENABLED (CONFIG_BCM54120PE_PHY)
>> +{
>> +	.phy_id		= PHY_ID_BCM54213PE,
>> +	.phy_id_mask	= 0xffffffff,
>> +        .name           = "Broadcom BCM54210PE",
>> +        /* PHY_GBIT_FEATURES */
>> +        .config_init    = bcm54xx_config_init,
>> +        .ack_interrupt  = bcm_phy_ack_intr,
>> +        .config_intr    = bcm_phy_config_intr,
>> +	.probe		= bcm54210pe_probe,
>> +#elif
>> +{ 
>> 	.phy_id		= PHY_ID_BCM54213PE,
>> 	.phy_id_mask	= 0xffffffff,
>> 	.name		= "Broadcom BCM54213PE",
>> @@ -786,6 +804,7 @@ static struct phy_driver broadcom_drivers[] = {
>> 	.config_init	= bcm54xx_config_init,
>> 	.ack_interrupt	= bcm_phy_ack_intr,
>> 	.config_intr	= bcm_phy_config_intr,
>> +#endif
> 
> Don't replace the existing entry, extend it with your new
> functionality.

Is what you propose possible? Isn’t the issue here that the two PHYs (54213PE and 54210PE) present themselves with the same phy ID? If there is a way to seperate them then I will need your instruction on how to do it. 

> 
> 	Andrew

All the best,

Lasse

  parent reply	other threads:[~2022-04-22 14:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 14:03 Support for IEEE1588 timestamping in the BCM54210PE PHY using the kernel mii_timestamper interface Lasse Johnsen
2022-04-20 19:19 ` Andrew Lunn
2022-04-21 17:32   ` Florian Fainelli
2022-04-22 14:21   ` Lasse Johnsen [this message]
2022-04-22 15:00     ` [PATCH net-next] 1588 support on bcm54210pe Andrew Lunn
2022-04-22 19:48       ` Richard Cochran
2022-04-23 14:40         ` Florian Fainelli
2022-04-23 18:16           ` Richard Cochran
2022-04-21 14:48 ` Support for IEEE1588 timestamping in the BCM54210PE PHY using the kernel mii_timestamper interface Richard Cochran
2022-04-22 15:08   ` [PATCH net-next v2] net: phy: broadcom: 1588 support on bcm54210pe Lasse Johnsen
2022-04-22 15:22     ` Jonathan Lemon
2022-04-22 18:11       ` Lasse Johnsen
2022-04-22 18:20         ` Jonathan Lemon
2022-04-23 10:26           ` Lasse Johnsen
2022-04-22 15:42     ` 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=C6DCE6EC-926D-4EDF-AFE9-F949C0F55B7F@timebeat.app \
    --to=lasse@timebeat.app \
    --cc=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=clk@fb.com \
    --cc=f.fainelli@gmail.com \
    --cc=gordon@raspberrypi.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.