Ivan Grokhotkov 6d06f5fe44
fix(esp_eth): fix openeth driver to consider MAC address set in QEMU
Openeth driver did not consider the possibility that the MAC address
was specified when launching QEMU, and would always overwrite that
address with the address obtained from esp_read_mac.
When running QEMU, setting the MAC address via QEMU arguments is more
convenient than crafting an eFuse file with the correct MAC address.
This change modifies openeth driver to first check if an address has
been set in QEMU and uses it if so. Otherwise it falls back to the
address obtained from esp_read_mac.

As part of this change, also removed the unnecessary variable
emac_opencores_t::addr, the address is only kept in the registers of
the emulated peripheral now.

For full effect this also requires changes in QEMU, see
https://github.com/espressif/qemu/issues/107 for background. Without
changes in QEMU, this commit keeps the same behavior.
2024-12-10 12:29:10 +01:00
..