Page MenuHomeFreeBSD

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

Authored by mmel on Wed, Jul 8, 11:47 AM.
Tags
None
Referenced Files
F162707110: D58108.id.diff
Thu, Jul 16, 12:23 AM
Unknown Object (File)
Wed, Jul 15, 10:26 PM
Unknown Object (File)
Tue, Jul 14, 1:15 AM
Unknown Object (File)
Mon, Jul 13, 10:27 PM
Unknown Object (File)
Mon, Jul 13, 3:41 AM
Unknown Object (File)
Sun, Jul 12, 1:17 AM
Unknown Object (File)
Wed, Jul 8, 1:11 PM
Subscribers

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.Wed, Jul 8, 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