Page MenuHomeFreeBSD

cgem: add support for ethernet on RP1 chip found on Raspberry Pi 5
Needs ReviewPublic

Authored by mmel on Jul 8 2026, 11:47 AM.
Tags
None
Referenced Files
F168434355: D58108.diff
Fri, Aug 28, 8:00 AM
Unknown Object (File)
Thu, Aug 13, 12:32 AM
Unknown Object (File)
Thu, Aug 13, 12:32 AM
Unknown Object (File)
Thu, Aug 13, 12:32 AM
Unknown Object (File)
Sat, Aug 8, 8:00 PM
Unknown Object (File)
Fri, Aug 7, 1:22 PM
Unknown Object (File)
Thu, Aug 6, 3:25 AM
Unknown Object (File)
Mon, Aug 3, 5:04 AM

Details

Reviewers
None
Group Reviewers
arm64
Summary

Add compatible string "raspberrypi,rp1-gem" with a new hardware quirk
HWQUIRK_HWCLK to indicate that the IP block provides its own clock
management and we should not override the pclk frequency.

Do other improvement:

  • Switch MAC address retrieval to the new fdt_ether_get_macaddr() helper (which respects "mac-address"/"local-mac-address" properties and falls back gracefully).
  • Convert some flags to bool for clarity (neednullqs, rxhangwar, have_hwclk).
  • Significantly improve clock retrieval and enabling code with better error handling and proper cleanup paths.

MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74618
Build 71501: arc lint + arc unit

Event Timeline

mmel requested review of this revision.Jul 8 2026, 11:47 AM

Switching to bool and cgem_get_mac rework LGTM and could be committed independently if you like. I haven't looked at the rest yet.

sys/dev/cadence/if_cgem.c
136

perhaps reorder the struct to put the bools together