Forum Discussion
Altera_Forum
Honored Contributor
13 years agoCreating a MAC address from a serial number on the host PC is not a good idea. What happens when you plug in your second board? Or more likely, what happens when the next person working with your hardware decides to expand it to more boards?
You will only lead to much debugging pain! Ideally, you would use the board to provide its own serial number. However, here's a scheme where you could use the host to create a MAC address: 1. PCIe board boots and finds it has no MAC address, so it leaves its PHY in reset. 2. Host PC boots and loads the driver for your board. 3. The driver or application code accesses the board via PCIe to see if the board has initialized correctly. 4. If the board has no MAC, then the host creates and writes a MAC address to a register mapped to PCIe, and then instructs the board to enable the PHY. In this scheme, the host can use the PCIe bus/slot/fun of the board along with the motherboard serial number to construct a unique MAC that is identical each time the system boots - allowing you to create a mapping in DHCP. Cheers, Dave