Skip to content

Fix SC59x Ethernet PHY descriptions and ADIN PHY Driver - #130

Open
ozan956 wants to merge 5 commits into
adi-u-boot-2025.10.yfrom
fix-phy-sc5xx
Open

Fix SC59x Ethernet PHY descriptions and ADIN PHY Driver#130
ozan956 wants to merge 5 commits into
adi-u-boot-2025.10.yfrom
fix-phy-sc5xx

Conversation

@ozan956

@ozan956 ozan956 commented Jul 19, 2026

Copy link
Copy Markdown
Member

This series updates SC594 and SC598 + EZKIT or EZLITE ethernet support for ADIN1200 and ADIN1300 PHYs.

Changes include:

  • Add ADIN1200 PHY registration to the U-Boot ADIN PHY driver. (tried to match the Linux Driver)
  • Configure ADIN1200 RMII mode and FIFO depth.
  • Configure ADIN1300 RGMII RX/TX internal delays to 2000 ps.
  • Configure ADIN1200 RMII FIFO depth to 8 bits on EZKIT boards.
  • Enable ADIN PHY support in the relevant board configurations.
  • Remove obsolete TI PHY fixups and reset handling.
  • Update SC594 and SC598 device trees consistently.

Hardware test is performed on SC598 with EZKIT on ADIN1300:

ADIN1300 PHY detected at addr 0
eth0 Waiting for PHY auto negotiation to complete........ done
BOOTP broadcast 1

References:

@ozan956
ozan956 requested a review from a team July 19, 2026 20:46
@ozan956 ozan956 self-assigned this Jul 19, 2026
@ozan956 ozan956 added this to ADSP Jul 19, 2026
@ozan956 ozan956 moved this to In Development in ADSP Jul 19, 2026
@ozan956

ozan956 commented Jul 19, 2026

Copy link
Copy Markdown
Member Author

Related with: analogdevicesinc/linux#2883

@ozan956 ozan956 added the llm review Request a review from a LLM Reviewer label Jul 19, 2026
@ozan956
ozan956 requested a review from a team July 20, 2026 06:38
@ozan956

ozan956 commented Jul 20, 2026

Copy link
Copy Markdown
Member Author

@gastmaier the llm-review is not triggered here 😭

@gastmaier gastmaier added llm review Request a review from a LLM Reviewer and removed llm review Request a review from a LLM Reviewer labels Jul 20, 2026
@gastmaier

gastmaier commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator
sudo systemctl --machine apps@.host --user status  webhook-action.service
sudo journalctl _UID=$(id -u apps) --user-unit=webhook-action.service -f

it did run https://github.com/analogdevicesinc/u-boot/actions/runs/29704103738/job/88238050338 but died

@github-actions

Copy link
Copy Markdown

LLM review

This series adds ADIN1200/1300 Ethernet PHY support for SC594/SC598 boards, fixing incorrect DP83867/DP83848 PHY descriptions in device trees, removing stale board-level GPIO-hog reset hooks, enabling CONFIG_PHY_ADIN in five defconfigs, and extending the ADIN driver with ADIN1200 support and RMII FIFO-depth configuration.

run: 29742054170

218166f3 - configs: adi: enable ADIN PHY support

Defconfig ordering bug: CONFIG_PHY_ADIN=y is placed after CONFIG_PHY=y but savedefconfig (via qconfig.py -s) requires it immediately after CONFIG_SPI_FLASH_MTD=y. This is because drivers/net/phy/Kconfig is sourced before ETH_DESIGNWARE/DWC_ETH_QOS in drivers/net/Kconfig, so the canonical ordering puts PHY_ADIN earlier in the defconfig. All five affected defconfigs have the same issue.

Reproduced locally:

$ python3 tools/qconfig.py -s -d <list-of-5-defconfigs>
# Result: "defconfig updated" for all 5 files, moving PHY_ADIN earlier

CI warnings

The check_qconfig_sync check fails for all five modified defconfigs (sc594-som-ezkit-spl_defconfig, sc594-som-ezlite-spl_defconfig, sc598-htol-spl_defconfig, sc598-som-ezkit-spl_defconfig, sc598-som-ezlite-spl_defconfig). The build job failures (ARM/AArch64) are a CI infrastructure issue (missing cross-compiler toolchains), not a code defect.

Verification data

Datasheets for ADIN1200 and ADIN1300 were obtained from the docling mirror at https://raw.githubusercontent.com/analogdevicesinc/doctools/refs/heads/docling/media/en/technical-documentation/data-sheets/adin12{00,00}.md and used to verify:

  • PHY IDs: ADIN1200 = 0x0283BC20, ADIN1300 = 0x0283BC30 — both correct
  • GE_RMII_CFG (0xFF24) present in both PHYs with identical bit layout; FIFO depth field [6:4], encoding 001 = ±8 bits matches the driver default
  • GE_RGMII_CFG (0xFF23) delay encoding 000 = 8×200ps+400ps = 2000 ps — matches adi,{rx,tx}-internal-delay-ps = <2000> in DTS
  • RESET_N: minimum assert 10 µs (DTS: 10000 µs), register access 5 ms after deassert (DTS: 5000 µs) — both correct
  • EXT_REG_PTR/EXT_REG_DATA at 0x10/0x11 present in both PHYs — shared adin_ext_read/adin_ext_write mechanism is valid

Suggested patches

Apply the suggested patches with:

cd path/to/repository
export GITHUB_TOKEN=ghp_***
apply-patches --repo=analogdevicesinc/u-boot 29742054170
Install instructions

The following one-liner installs the script if not present already:

curl -fSsL "https://raw.githubusercontent.com/analogdevicesinc/doctools/refs/heads/main/ci/scripts/apply-patches.sh" \
     -o ~/.local/bin/apply-patches.sh && \
  grep -q "/apply-patches.sh" ~/.bashrc || echo "source ~/.local/bin/apply-patches.sh" >> $_ ; . $_

More information at AI Usage.

ozan956 added 5 commits July 21, 2026 09:34
Configure the shared ADIN vendor registers for both ADIN1200 and
ADIN1300 PHYs. This enables RMII mode and programs the RMII FIFO depth
for ADIN1200 instead of relying only on generic PHY configuration.

Keep the device-tree values in physical units. When the delay and FIFO
properties are absent, use the ADIN1300 defaults of 2 ns for RGMII
internal delay and 8 bits for RMII FIFO depth.

Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
Enable the ADIN PHY driver in the SC594 and SC598 SPL defconfigs,
which describe ADIN1200 and ADIN1300 PHYs.

Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
The ADIN1300 reset GPIO is now described by the PHY node. Remove the
obsolete carrier reset hooks so the PHY driver is the sole reset owner.

Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
The SC598 boards use an ADIN1300 on eth0, and the EZKIT also uses
an ADIN1200 on eth1. Replace the stale DP83867 description, describe
the second RMII PHY, and remove the obsolete board PHY fixup.

Move the ADIN1300 reset GPIO into the PHY nodes. The ADIN1300 data
sheet, Table 3, requires RESET_N to be asserted for at least 10 us and
specifies a 5 ms delay before MDIO registers are accessible after reset
deassertion.

Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
The SC594 EZKIT uses an ADIN1300 on eth0 and an ADIN1200 on eth1.
Replace the stale PHY descriptions, describe the second RMII PHY, and
remove the obsolete board PHY fixup.

Move the ADIN1300 reset GPIO into the PHY nodes. The ADIN1300 data
sheet, Table 3, requires RESET_N to be asserted for at least 10 us and
specifies a 5 ms delay before MDIO registers are accessible after reset
deassertion.

Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
@ozan956
ozan956 force-pushed the fix-phy-sc5xx branch 2 times, most recently from 34946ba to 036effb Compare July 21, 2026 07:40
Comment thread drivers/net/phy/adin.c

static int adin1300_config(struct phy_device *phydev)
{
printf("ADIN1300 PHY detected at addr %d\n", phydev->addr);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do wonder how useful this print really is (imagine if all devices announced their presence like this)

Comment thread drivers/net/phy/adin.c

dflt = adin_lookup_reg_value(tbl, dflt_cfg);
if (dflt < 0)
return dflt;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if dflt is negative, you are then implicitly casting that negative value to a u32 when returning. looks like the callers of this function expect a valid value to always be returned. but now you might be returning ((u32)(-EINVAL)) which is pretty dank

I am all for error handling, but maybe it's easier to just drop this check since it is anyway unrelated to your PR. otherwise you need to find a way for this function to unambiguously return error/success, and also update the callers to actually check for it (otherwise why bother?)

Comment thread drivers/net/phy/adin.c
printf("%s: failed to find %s, using default %d\n",
__func__, prop_name, dflt);
printf("%s: failed to find %s, using default %u\n",
__func__, prop_name, dflt_cfg);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the property is not required by the bindings then I think such a print is a bit noisy, but maybe it's just me

Comment thread drivers/net/phy/adin.c
return adin_config(phydev);
}

U_BOOT_PHY_DRIVER(ADIN1200) = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, weird, I was looking at mainline u-boot and noticed this is already there.

u-boot@52309be

Since we agreed in the Linux PR not to bother explicitly configuring RMII FIFO size, maybe you wanna just backport the above patch instead? Should achieve the same thing (except erroneously printing "ADIN1300" detected for an ADIN1200)

#size-cells = <0>;

adin1200: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what u-boot policy is on whether to require this compatible or not, but worth a look

#size-cells = <0>;

dp83867: ethernet-phy@0 {
adin1300: ethernet-phy@0 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't look right. the PHY is on the carrier board, not the SoM

{
struct gpio_desc *eth1;
struct gpio_desc *eth1_reset;
struct gpio_desc *gige_reset;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this commit should be ordered after the update to the DT, or reworded as such, since in the commit message it suggests that the reset has already been put there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llm review Request a review from a LLM Reviewer

Projects

Status: In Development

Development

Successfully merging this pull request may close these issues.

3 participants