Skip to content

Support random MAC address generation in AXI Ethernet driver #91821

@venodela

Description

@venodela

Summary

The AXI Ethernet driver(eth_xilinx_axienet.c) in Zephyr currently requires the local-mac-address property to be specified in the device tree. If it's not present, the driver fails to build due to the DT_INST_PROP(inst, local_mac_address) reference. This limits flexibility and requires each board/platform to provide a unique MAC manually, even during development and testing.

This enhancement proposes improving the AXI Ethernet driver to support random MAC address generation using Zephyr’s existing gen_random_mac() API if local-mac-address is not defined.

Describe the solution you'd like

Enhance the AXI Ethernet driver to detect if local-mac-address is missing from the device tree and generate a MAC address at runtime using Zephyr's gen_random_mac() function. The generated address should be stored in the driver’s runtime data structure and configured into the hardware as usual.

This change would eliminate the need for explicitly defining local-mac-address in all DT overlays, while still supporting it if present.

Driver file to update:
drivers/ethernet/eth_xilinx_axienet.c

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions