public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Jiawen Wu" <jiawenwu@trustnetic•com>
To: "'Andrew Lunn'" <andrew@lunn•ch>
Cc: "'Mengyuan Lou'" <mengyuanlou@net-swift•com>, <netdev@vger•kernel.org>
Subject: RE: [PATCH net-next 1/5] net: txgbe: Identify PHY and SFP module
Date: Tue, 29 Nov 2022 16:20:35 +0800	[thread overview]
Message-ID: <003801d903cb$74c5ba20$5e512e60$@trustnetic.com> (raw)
In-Reply-To: <Y2uqk9BwVjPcEtPP@lunn.ch>

> The SFP driver is currently device tree only, but it should be easy to add support for a platform
device and
> platform data. That driver needs to be told about a standard Linux i2c master device, and
optionally a
> collection of GPIO which connect to the SFP socket.
> 
> So you need to implement a standard Linux I2C bus master. Which basically means being able to send
> and receive an I2C message. Take a look at for example drivers/net/ethernet/mellanox/mlxsw/i2c.c .
> This driver however does not use it with the SFP driver, since the Mellanox devices have firmware
> controlling the SFP. But it will give you the idea how you can embed an I2C bus driver inside
another
> driver.
> 
> For the GPIOs to the SFP socket, TX Enable, LOS, MODDEF etc, you want a standard Linux GPIO
driver.
> For an example, look at drivers/net/dsa/vitesse-vsc73xx-core.c.
> 
> https://github.com/lunn/linux/blob/v5.0.7-rap/drivers/platform/x86/zii-rap.c
> contains an example of registering a bit-bang MDIO controller. zii_rap_mdio_gpiod_table would
become
> a list of SFP GPIOs. zii_rap_mdio_init() registers a platform devices which instantiaces an MDIO
bus. You
> would register a platform device which instantiates an SFP device.
> 
> Once you have an SFP devices you need to extend phylink with a platform data binding. So you can
pass it
> your SFP device.
> 
> This should all be reasonably simple code.
> 
>      Andrew
> 

Hi Andrew,

I have encountered some difficulties.
When I register a platform device for SFP, then it matches the SFP driver by name. I found that SFP
driver needs to find I2C adapter by device node.
Which device node it needs? There was no device node when I created the I2C device. So it always
probe failed.
Could you please give me some guidance? Thanks.



  parent reply	other threads:[~2022-11-29  8:21 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-08 11:19 [PATCH net-next 0/5] net: WangXun ethernet drivers Mengyuan Lou
2022-11-08 11:19 ` [PATCH net-next 1/5] net: txgbe: Identify PHY and SFP module Mengyuan Lou
2022-11-08 20:52   ` Andrew Lunn
2022-11-09  6:32     ` Jiawen Wu
2022-11-09 13:26       ` Andrew Lunn
2022-11-14  9:34         ` Jiawen Wu
2022-11-14 13:25           ` Andrew Lunn
2022-11-29  8:20         ` Jiawen Wu [this message]
2022-11-14 15:34   ` Alexander Lobakin
2022-11-14 20:18     ` Andrew Lunn
2022-11-08 11:19 ` [PATCH net-next 2/5] net: txgbe: Initialize service task Mengyuan Lou
2022-11-08 23:55   ` Jakub Kicinski
2022-11-09  2:16     ` Jiawen Wu
2022-11-09  2:36       ` Andrew Lunn
2022-11-14 15:39   ` Alexander Lobakin
2022-11-08 11:19 ` [PATCH net-next 3/5] net: txgbe: Support to setup link Mengyuan Lou
2022-11-08 21:03   ` Andrew Lunn
2022-11-14 15:48   ` Alexander Lobakin
2022-11-14 20:20     ` Andrew Lunn
2022-11-08 11:19 ` [PATCH net-next 4/5] net: ngbe: Initialize phy information Mengyuan Lou
2022-11-08 21:10   ` Andrew Lunn
2022-11-11  3:13     ` mengyuanlou
2022-11-11  3:28       ` Andrew Lunn
2022-11-14 16:16   ` Alexander Lobakin
2022-11-08 11:19 ` [PATCH net-next 5/5] net: ngbe: Initialize service task Mengyuan Lou

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='003801d903cb$74c5ba20$5e512e60$@trustnetic.com' \
    --to=jiawenwu@trustnetic$(echo .)com \
    --cc=andrew@lunn$(echo .)ch \
    --cc=mengyuanlou@net-swift$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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