From d55c08739032e906ece6f842f8fac97265018c4f Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Sat, 20 Aug 2022 18:22:40 -0500 Subject: 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 --- target/linux/realtek/base-files/etc/board.d/02_network | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'target/linux/realtek/base-files/etc/board.d/02_network') 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" ;; *) -- cgit v1.2.3