From: Oleksij Rempel <o.rempel@pengutronix.de>
To: David Picard <david.picard@clermont.in2p3.fr>
Cc: ML_Barebox <barebox@lists.infradead.org>
Subject: Re: Enclustra SA2: enable dual fast Ethernet
Date: Thu, 26 Mar 2026 07:53:29 +0100 [thread overview]
Message-ID: <acTX6Wgh1meZgedk@pengutronix.de> (raw)
In-Reply-To: <fdced1c1-5efd-481c-8b3b-a8cb43d0c220@clermont.in2p3.fr>
Hi David,
Ethernet is usually my playground, so I'll answer here as far as I can
:)
On Wed, Mar 25, 2026 at 05:13:52PM +0100, David Picard wrote:
> Hello,
>
> I am still using the same Mercury_SA2_ST1_Reference_Design [1][2] released
> by the manufacturer:
> https://github.com/enclustra/Mercury_SA2_ST1_Reference_Design.git
>
> But I compiled a variant of the project to enable dual fast Ethernet,
> because I need a 2nd Ethernet interface.
> SA2 module Ethernet layout:
> - 1 Ethernet MAC ("gmac1" in the DTS) of the HPS [3] is used for gigabit
> Ethernet, and connects with RGMII to PHY at address 3 >> working!
> - 2 Ethernet MACs are implemented as FPGA IP cores and connect with RMII to
> PHYs at addresses 1 and 2 >> to be configured...
>
> All 3 PHYs share the same MDIO bus.
In this case barebox will need to resolve all pre-dependencies in the
correct order, which make things tricky:
- FPGA MACs should be probed after MDIO bus was scanned and PHYs
detected. If PHY resets are asserted, we need to deasserted them in
software, before MDIO bus scan.
- if MDIO bus is a part of the gmac1 block and driver, then this one
should be probed as the first one in the chain.
- except of resets and MDIO bus, we need also clocks for the PHYs and
and MACs.
As soon as all related topology is reconstructed in the correct order,
it will magically work :D
> I generated a DTS file with Intel's tool:
> $ sopc2dts --force-altr -t dts -i
> ./Quartus/ME-SA2-D6-7I-D11-DFE/sdmmc/Mercury_SA2_pd.sopcinfo -o
> Mercury_SA2_pd.dts
>
> The file is here [4]:
> https://filesender.renater.fr/?s=download&token=b2eeab16-063c-41ef-8abe-ea5b44f8f25a&lang=en
Hm, i see some MACs, but no PHY configurations in attached devicetree.
PHYs should be properly described with resets and MAC <> PHY linkage.
> Now, I am trying to merge the fast Ethernet section with the
> socfpga_cyclone5_mercury_sa2.dtsi, but I really need a hint, here...
> https://git.pengutronix.de/cgit/barebox/tree/arch/arm/dts/socfpga_cyclone5_mercury_sa2.dtsi
> https://git.pengutronix.de/cgit/barebox/tree/dts/src/arm/intel/socfpga/socfpga.dtsi
>
> However, I do know for a fact that the 2 PHYs at addresses 1 and 2 share the
> same reset pin and can be released from reset by:
> reset-gpios = <&portb 6 GPIO_ACTIVE_LOW>;
Shared reset for PHYs is not very nice design :) Some times PHYs need
to be reset for each link up/down cycle. A shared reset makes it
impossible.
Best Regards,
Oleksij
--
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:[~2026-03-26 6:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-25 16:13 David Picard
2026-03-26 6:53 ` Oleksij Rempel [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=acTX6Wgh1meZgedk@pengutronix.de \
--to=o.rempel@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=david.picard@clermont.in2p3.fr \
/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