diff options
author | Alexandru Gagniuc <mr.nuke.me@gmail.com> | 2022-08-20 18:22:40 -0500 |
---|---|---|
committer | Sander Vanheule <sander@svanheule.net> | 2022-09-13 09:22:26 +0200 |
commit | d55c08739032e906ece6f842f8fac97265018c4f (patch) | |
tree | 403b57cd0855b2862ac65ec0ecb2cd7119bf2f4e /target/linux/realtek/base-files | |
parent | 5f026f12728fbe9fe909c44c293f4ea58311d50f (diff) | |
download | upstream-d55c08739032e906ece6f842f8fac97265018c4f.tar.gz upstream-d55c08739032e906ece6f842f8fac97265018c4f.tar.bz2 upstream-d55c08739032e906ece6f842f8fac97265018c4f.zip |
realtek: tl-sg2xxx: read MAC address from nvmem-cells
The TP-Link RTL83xx based switches have their MAC address programmed
in the "para" partition. While in theory, the format of this partition
is dynamic, in practice, the MAC address appears to be located at a
consistent address. Thus, use nvmem-cells to read this MAC address.
The main MAC is required for deriving the MAC address of the switch
ports. Instead of reading it via mtd_get_mac_binary(), alias the
ethernet0 node as the label-mac-device, and use get_mac_label().
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Diffstat (limited to 'target/linux/realtek/base-files')
-rw-r--r-- | target/linux/realtek/base-files/etc/board.d/02_network | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index 6e0e0e7e03..aacbef77b4 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -41,7 +41,7 @@ hpe,1920-24g) ;; tplink,sg2008p-v1|\ tplink,sg2452p-v4) - label_mac=$(mtd_get_mac_binary para 0xfdff4) + label_mac=$(get_mac_label) lan_mac="$label_mac" ;; *) |