+++ /dev/null
-preinit_set_mac_address() {
- . /lib/functions.sh
-
- case $(board_name) in
- meraki,mr24|\
- meraki,mx60)
- mac_lan=$(mtd_get_mac_binary_ubi board-config 0x66)
- [ -n "$mac_lan" ] && ip link set eth0 address "$mac_lan"
- ;;
- esac
-}
-
-boot_hook_add preinit_main preinit_set_mac_address
};
partition@180000 {
+ compatible = "linux,ubi";
label = "ubi";
reg = <0x00180000 0x01e80000>;
+
+ volumes {
+ ubi-volume-board-config {
+ volume = "board-config";
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_board_66: macaddr@66 {
+ reg = <0x66 0x6>;
+ };
+ };
+ };
+ };
};
};
};
&EMAC0 {
status = "okay";
+ nvmem-cells = <&macaddr_board_66>;
+ nvmem-cell-names = "mac-address";
+
phy-mode = "rgmii-id";
phy-map = <0x2>;
phy-address = <0x1>;
};
partition@240000 {
+ compatible = "linux,ubi";
label = "ubi";
reg = <0x00240000 0x3fdc0000>;
+
+ volumes {
+ ubi-volume-board-config {
+ volume = "board-config";
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_board_66: macaddr@66 {
+ compatible = "mac-base";
+ reg = <0x66 0x6>;
+ #nvmem-cell-cells = <1>;
+ };
+ };
+ };
+ };
};
};
};
&EMAC0 {
status = "okay";
+ nvmem-cells = <&macaddr_board_66 0>;
+ nvmem-cell-names = "mac-address";
+
fixed-link {
speed = <1000>;
full-duplex;
label = "wan";
phy-mode = "internal";
phy-handle = <&phy_port5>;
+ nvmem-cells = <&macaddr_board_66 1>;
+ nvmem-cell-names = "mac-address";
leds {
#address-cells = <1>;