devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Artur Rojek <contact@artur-rojek.eu>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Rob Landley <rob@landley.net>, Jeff Dionne <jeff@coresemi.io>,
	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] net: j2: Introduce J-Core EMAC
Date: Sun, 17 Aug 2025 14:04:11 +0200	[thread overview]
Message-ID: <b6dd9b94e3a43d98bacdcd22f536a10c@artur-rojek.eu> (raw)
In-Reply-To: <52aef275-0907-4510-b95c-b2b01738ce0b@lunn.ch>

On 2025-08-16 17:04, Andrew Lunn wrote:
> On Sat, Aug 16, 2025 at 03:40:57PM +0200, Artur Rojek wrote:
>> On 2025-08-16 02:18, Andrew Lunn wrote:
>> > > Yes, it's an IC+ IP101ALF 10/100 Ethernet PHY [1]. It does have both
>> > > MDC
>> > > and MDIO pins connected, however I suspect that nothing really
>> > > configures it, and it simply runs on default register values (which
>> > > allow for valid operation in 100Mb/s mode, it seems). I doubt there is
>> > > another IP core to handle MDIO, as this SoC design is optimized for
>> > > minimal utilization of FPGA blocks. Does it make sense to you that a
>> > > MAC
>> > > could run without any access to an MDIO bus?
>> >
>> > It can work like that. You will likely have problems if the link ever
>> > negotiates 10Mbps or 100Mbps half duplex. You generally need to change
>> > something in the MAC to support different speeds and duplex. Without
>> > being able to talk to the PHY over MDIO you have no idea what it has
>> > negotiated with the link peer.
>> 
>> Thanks for the explanation. I just confirmed that there is no activity
>> on the MDIO bus from board power on, up to the jcore_emac driver start
>> (and past it), so most likely this SoC design does not provide any
>> management interface between MAC and PHY. I guess once/if MDIO is
>> implemented, we can distinguish between IP core revision compatibles,
>> and properly switch between netif_carrier_*()/phylink logic.
> 
> How cut down of a SoC design is it? Is there pinmux and each pin can
> also be used for GPIO?

It's pretty limited - there is no MMU or DMA, for example. There does
appear to be a GPIO controller, however I'm not sure if it is of pinmux
variety (whether pins used by an IP core can be multiplexed to PIO), or
if it has its own pool of general purpose pins, that don't overlap with
PHY. In any case, there is no Linux driver for it (I have interest to
eventually write one), and I don't know if the design for it is even
included in the bitstream on my board.

> Linux has software bit-banging MDIO, if you can
> make the two pins be standard Linux GPIOs, and can configure them
> correctly, i _think_ open drain on MDIO. It will be slow, but it
> works, and it is pretty much for free.

This is a clever idea! It does however sound like Jeff & co. will
eventually add a proper MDIO interface to this MAC. I will halt upstream
of this driver for now and see what happens first (that, or me
experimenting with GPIO). Thanks for the review of this series thus far!

Cheers,
Artur

> 
> MDIO itself is simple, just a big shift register:
> 
> https://opencores.org/websvn/filedetails?repname=ethmac10g&path=%2Fethmac10g%2Ftrunk%2Frtl%2Fverilog%2Fmgmt%2Fmdio.v
> 
> 	Andrew

  reply	other threads:[~2025-08-17 12:04 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-15 19:48 [PATCH 0/3] J2 Ethernet MAC driver Artur Rojek
2025-08-15 19:48 ` [PATCH 1/3] dt-bindings: vendor-prefixes: Document J-Core Artur Rojek
2025-08-16  8:18   ` Krzysztof Kozlowski
2025-08-16  8:22     ` Geert Uytterhoeven
2025-08-16  9:40       ` Krzysztof Kozlowski
2025-08-16 10:34         ` Artur Rojek
2025-08-16  9:40   ` Krzysztof Kozlowski
2025-08-15 19:48 ` [PATCH 2/3] dt-bindings: net: Add support for J-Core EMAC Artur Rojek
2025-08-16  8:19   ` Krzysztof Kozlowski
2025-08-16 12:06     ` Artur Rojek
2025-08-18  6:43       ` Geert Uytterhoeven
2025-08-18  8:07         ` Krzysztof Kozlowski
2025-08-18  8:21           ` D. Jeff Dionne
2025-08-18  9:58             ` Krzysztof Kozlowski
2025-08-18 10:57               ` Geert Uytterhoeven
2025-08-18 13:41                 ` Krzysztof Kozlowski
2025-08-18 13:55                   ` D. Jeff Dionne
2025-08-20 21:39                     ` Rob Herring
2025-08-21 21:02                       ` Rob Landley
2025-08-18 15:03           ` Rob Landley
2025-08-15 19:48 ` [PATCH 3/3] net: j2: Introduce " Artur Rojek
2025-08-15 20:16   ` Andrew Lunn
2025-08-15 20:52     ` Artur Rojek
2025-08-15 21:14       ` Artur Rojek
2025-08-15 22:38         ` Andrew Lunn
2025-08-15 23:25           ` Artur Rojek
2025-08-16  0:18             ` Andrew Lunn
2025-08-16 13:40               ` Artur Rojek
2025-08-16 15:04                 ` Andrew Lunn
2025-08-17 12:04                   ` Artur Rojek [this message]
2025-08-17 18:09                   ` Rob Landley
2025-08-17 19:39                     ` Andrew Lunn
2025-08-17  4:29                 ` D. Jeff Dionne
2025-08-17 11:50                   ` Artur Rojek
2025-08-17 16:04           ` Rob Landley
2025-08-17 16:08             ` Andrew Lunn
2025-08-15 23:26   ` Stephen Hemminger
2025-08-16 11:24   ` kernel test robot
2025-08-19 21:09   ` kernel test robot

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=b6dd9b94e3a43d98bacdcd22f536a10c@artur-rojek.eu \
    --to=contact@artur-rojek.eu \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=geert+renesas@glider.be \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=jeff@coresemi.io \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rob@landley.net \
    --cc=robh@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).