Skip to content

CMSIS-Driver: Add Gigabit Ethernet support to the Ethernet driver API - #321

Merged
RobertRostohar merged 6 commits into
ARM-software:mainfrom
furbanc:gbit_ethernet
Sep 11, 2026
Merged

RobertRostohar merged 6 commits into
ARM-software:mainfrom
furbanc:gbit_ethernet

Conversation

@furbanc

@furbanc furbanc commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@furbanc

furbanc commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@RobertRostohar could you please review this PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

ARM.CMSIS.pdsc leaves the Ethernet PHY Capiversion at 2.2.0 while related Ethernet entries are bumped to 2.3.0, creating inconsistent API metadata.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR extends the CMSIS-Driver Ethernet API surface to describe Gigabit-capable media interfaces (GMII/RGMII/SGMII) and updates the associated documentation and package metadata to reflect the new capability.

Changes:

  • Added new ARM_ETH_INTERFACE_* constants for gigabit media interface variants in the common Ethernet driver definitions.
  • Expanded ARM_ETH_MAC_CAPABILITIES.media_interface bitfield to represent the larger interface enum range.
  • Updated CMSIS-Driver Doxygen docs/versioning and ARM.CMSIS.pdsc metadata for the Ethernet driver API update.
File summaries
File Description
CMSIS/Driver/Include/Driver_ETH.h Adds Gigabit interface type constants and updates header revision/history.
CMSIS/Driver/Include/Driver_ETH_MAC.h Expands media_interface capability bitfield and updates header revision/history.
CMSIS/Documentation/Doxygen/Driver/src/history.md Adds a 2.12.0 documentation history entry for the Ethernet API update.
CMSIS/Documentation/Doxygen/Driver/src/Driver_ETH.c Documents the new Gigabit interface constants in the Ethernet driver Doxygen.
CMSIS/Documentation/Doxygen/Driver/src/Driver_ETH_PHY.c Updates PHY interface parameter documentation to include new Gigabit interface types.
CMSIS/Documentation/Doxygen/Driver/Driver.dxy.in Bumps Doxygen PROJECT_NUMBER to 2.12.0.
ARM.CMSIS.pdsc Updates Ethernet/Ethernet MAC Capiversion metadata and release notes for the change.
Review details

Suppressed comments (1)

ARM.CMSIS.pdsc:785

  • ARM.CMSIS.pdsc bumps the custom components for Ethernet and Ethernet MAC to Capiversion 2.3.0, but the adjacent custom component "Ethernet PHY" remains at 2.2.0; update it to keep the driver family consistent.
    <component Cclass="CMSIS Driver" Cgroup="Ethernet" Csub="Custom" Cversion="1.0.0" Capiversion="2.3.0" custom="1">
  • Files reviewed: 7/7 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ARM.CMSIS.pdsc
Comment thread CMSIS/Driver/Include/Driver_ETH.h Outdated
Comment thread CMSIS/Driver/Include/Driver_ETH.h
Comment thread CMSIS/Driver/Include/Driver_ETH_MAC.h Outdated
Comment thread CMSIS/Driver/Include/Driver_ETH_MAC.h Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The Ethernet Capiversion was bumped to 2.3.0 but the corresponding ARM_ETH_{MAC,PHY}_API_VERSION header macros still indicate 2.2, creating an API versioning mismatch for consumers.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread ARM.CMSIS.pdsc
Comment thread CMSIS/Driver/Include/Driver_ETH_PHY.h Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The updated Ethernet driver templates introduce incorrect/insufficient argument validation and a missing return path in ARM_ETH_PHY_SetMode, and the PR also surfaces a CMSIS-Core version-sync inconsistency that should be reconciled when modifying ARM.CMSIS.pdsc.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (6)

Previously missed (1) — in code that hasn't changed since the last review.

ARM.CMSIS.pdsc:20

  • CMSIS-Core version metadata appears inconsistent: ARM.CMSIS.pdsc declares CORE Cversion 6.2.0 for M/A and 6.1.0 for R (e.g., lines ~675/688/697), but CMSIS/Core/Include/cmsis_version.h defines __CM_CMSIS_VERSION_MAIN/SUB = 6.1, __CA_* = 6.1, and __CR_* = 6.0. Since ARM.CMSIS.pdsc is modified in this PR, please align these version sources per the repo's version-sync rules.

CMSIS/Driver/DriverTemplates/Driver_ETH_PHY.c:92

  • In ARM_ETH_PHY_SetMode, the speed switch compares against ARM_ETH_SPEED_1G instead of the PHY-mode value (ARM_ETH_PHY_SPEED_1G) and also lacks a default: path; this can silently accept invalid speed encodings.
    case ARM_ETH_PHY_SPEED_100M:
        break;
    case ARM_ETH_SPEED_1G:
        break;
    }

CMSIS/Driver/DriverTemplates/Driver_ETH_MAC.c:142

  • The duplex switch in ARM_ETH_MAC_Control has no default: case, so invalid duplex encodings will be treated as success instead of ARM_DRIVER_ERROR_UNSUPPORTED.
        case ARM_ETH_MAC_DUPLEX_HALF:
            break;
        }

CMSIS/Driver/DriverTemplates/Driver_ETH_MAC.c:152

  • The template currently accepts ARM_ETH_MAC_CHECKSUM_OFFLOAD_RX/TX configuration flags but performs no action and returns OK. Since the template capabilities are all-zero by default, it is safer for the template to return ARM_DRIVER_ERROR_UNSUPPORTED when checksum-offload is requested (until an implementation adds support).
        if (arg & ARM_ETH_MAC_CHECKSUM_OFFLOAD_RX)
        {
        }

        if (arg & ARM_ETH_MAC_CHECKSUM_OFFLOAD_TX)

CMSIS/Driver/DriverTemplates/Driver_ETH_PHY.c:94

  • ARM_ETH_PHY_SetMode's duplex switch has no default: case, so invalid duplex encodings will be treated as success rather than ARM_DRIVER_ERROR_UNSUPPORTED.
    switch (mode & ARM_ETH_PHY_DUPLEX_Msk)

CMSIS/Driver/DriverTemplates/Driver_ETH_PHY.c:94

  • ARM_ETH_PHY_SetMode (returns int32_t) has no return statement at the end of the function, which is a compile-time error / undefined behavior depending on toolchain settings.
    switch (mode & ARM_ETH_PHY_DUPLEX_Msk)
  • Files reviewed: 10/10 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread CMSIS/Driver/DriverTemplates/Driver_ETH_MAC.c Outdated
Comment thread CMSIS/Driver/DriverTemplates/Driver_ETH_PHY.c

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The manifest and synchronized Core version definitions report inconsistent versions.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

ARM.CMSIS.pdsc:20

  • The manifest now declares CMSIS-Core(M/A) 6.2.0 and Core(R) 6.1.0, but the synchronized version definitions remain at 6.1/6.1/6.0 in CMSIS/Core/Include/cmsis_version.h; the Cortex-M history also still starts at V6.1.1. Please update the corresponding synchronized Core version locations so the manifest and headers/documentation cannot report different versions.
  • Files reviewed: 10/10 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The capability bit-field layout breaks compatibility with 2.2 drivers and needs append-only or explicit versioned handling.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread CMSIS/Driver/Include/Driver_ETH_MAC.h
@RobertRostohar
RobertRostohar merged commit 26206e4 into ARM-software:main Sep 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants