machine: read a factory MAC from flash via mac_flash_offset

Adds an optional per-board mac_flash_offset. When non-zero, RTLPlayground
reads a 6-byte MAC from that flash address and uses it if it is a valid
globally-administered unicast address; otherwise it falls back to the
generated locally-administered MAC. Offset 0 (default for every board)
preserves current behaviour.

Enable it for the SWTGW218AS, whose stock firmware keeps the factory MAC
in nvcfg at 0x1FC000. RTLPlayground images and web upgrades only touch
flash below that region, so the factory MAC survives flashing.
This commit is contained in:
bloqaudio
2026-08-11 02:32:31 -05:00
parent 52692d05b1
commit 3853a2701d
3 changed files with 24 additions and 14 deletions
+1
View File
@@ -85,6 +85,7 @@ typedef struct machine {
uint32_t led_sets[4][4];
uint8_t led_mux_custom;
uint8_t led_mux[28];
uint32_t mac_flash_offset;
};
typedef struct machine_runtime