wan_mac=$(get_mac_label)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
- mikrotik,cap-ac|\
- mikrotik,hap-ac2|\
- mikrotik,hap-ac3|\
- mikrotik,hap-ac3-lte6-kit)
- wan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base)
- lan_mac=$(macaddr_add $wan_mac 1)
- label_mac="$wan_mac"
- ;;
- mikrotik,lhgg-60ad|\
- mikrotik,sxtsq-5-ac)
- lan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base)
- label_mac="$lan_mac"
- ;;
netgear,rbr40|\
netgear,rbr50|\
netgear,srr60|\
extreme-networks,ws-ap391x)
ip link set dev eth0 address $(mtd_get_mac_ascii CFG1 ethaddr)
;;
- mikrotik,wap-ac|\
- mikrotik,wap-ac-lte|\
- mikrotik,wap-r-ac)
- base_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base)
- ip link set dev sw-eth1 address "$base_mac"
- ip link set dev sw-eth2 address $(macaddr_add "$base_mac" 1)
- ;;
teltonika,rutx50)
# Vendor Bootloader removes nvmem-cells from partition,
# so this needs to be done here.
};
aliases {
- // TODO: Verify if the ethernet0 alias is needed
- ethernet0 = &gmac;
led-boot = &led_user;
led-failsafe = &led_user;
led-running = &led_user;
led-upgrade = &led_user;
+ label-mac-device = &gmac;
};
soc {
hard_config {
read-only;
+
+ nvmem-layout {
+ compatible = "mikrotik,routerboot-nvmem";
+
+ macaddr_hard: base-mac-address {
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
dtb_config {
&gmac {
status = "okay";
+
+ nvmem-cells = <&macaddr_hard 0>;
+ nvmem-cell-names = "mac-address";
};
&switch {
status = "okay";
label = "lan";
+
+ nvmem-cells = <&macaddr_hard 1>;
+ nvmem-cell-names = "mac-address";
};
&swport5 {
};
aliases {
- // TODO: Verify if the ethernet0 alias is needed
- ethernet0 = &gmac;
led-boot = &led_user;
led-failsafe = &led_user;
led-running = &led_user;
led-upgrade = &led_user;
+ label-mac-device = &gmac;
};
soc {
hard_config {
read-only;
size = <0x2000>;
+
+ nvmem-layout {
+ compatible = "mikrotik,routerboot-nvmem";
+
+ macaddr_hard: base-mac-address {
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
dtb_config {
&gmac {
status = "okay";
+
+ nvmem-cells = <&macaddr_hard 0>;
+ nvmem-cell-names = "mac-address";
};
&switch {
&swport1 {
status = "okay";
label = "lan4";
+
+ nvmem-cells = <&macaddr_hard 4>;
+ nvmem-cell-names = "mac-address";
};
&swport2 {
status = "okay";
label = "lan3";
+
+ nvmem-cells = <&macaddr_hard 3>;
+ nvmem-cell-names = "mac-address";
};
&swport3 {
status = "okay";
label = "lan2";
+
+ nvmem-cells = <&macaddr_hard 2>;
+ nvmem-cell-names = "mac-address";
};
&swport4 {
status = "okay";
label = "lan1";
+
+ nvmem-cells = <&macaddr_hard 1>;
+ nvmem-cell-names = "mac-address";
};
&swport5 {
};
aliases {
- // TODO: Verify if the ethernet0 alias is needed
- ethernet0 = &gmac;
led-boot = &led_user;
led-failsafe = &led_user;
led-running = &led_user;
led-upgrade = &led_user;
+ label-mac-device = &gmac;
};
soc {
hard_config {
read-only;
+
+ nvmem-layout {
+ compatible = "mikrotik,routerboot-nvmem";
+
+ macaddr_hard: base-mac-address {
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
dtb_config {
&gmac {
status = "okay";
+
+ nvmem-cells = <&macaddr_hard 0>;
+ nvmem-cell-names = "mac-address";
};
&switch {
};
aliases {
- // TODO: Verify if the ethernet0 alias is needed
- ethernet0 = &gmac;
led-boot = &led_user;
led-failsafe = &led_user;
led-running = &led_user;
led-upgrade = &led_user;
+ label-mac-device = &gmac;
};
soc {
hard_config {
read-only;
size = <0x2000>;
+
+ nvmem-layout {
+ compatible = "mikrotik,routerboot-nvmem";
+
+ macaddr_hard: base-mac-address {
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
dtb_config {
&gmac {
status = "okay";
+
+ nvmem-cells = <&macaddr_hard 0>;
+ nvmem-cell-names = "mac-address";
};
&switch {
&swport4 {
status = "okay";
label = "sw-eth2";
+
+ nvmem-cells = <&macaddr_hard 1>;
+ nvmem-cell-names = "mac-address";
};
&swport5 {
};
aliases {
- // TODO: Verify if the ethernet0 alias is needed
- ethernet0 = &gmac;
led-boot = &led_status_blue;
led-failsafe = &led_status_red;
led-running = &led_status_blue;
led-upgrade = &led_status_red;
+ label-mac-device = &gmac;
};
soc {
hard_config {
size = <0x2000>;
+
+ nvmem-layout {
+ compatible = "mikrotik,routerboot-nvmem";
+
+ macaddr_hard: base-mac-address {
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
dtb_config {
&gmac {
status = "okay";
+
+ nvmem-cells = <&macaddr_hard 0>;
+ nvmem-cell-names = "mac-address";
};
&switch {
&swport1 {
status = "okay";
label = "lan4";
+
+ nvmem-cells = <&macaddr_hard 4>;
+ nvmem-cell-names = "mac-address";
};
&swport2 {
status = "okay";
label = "lan3";
+
+ nvmem-cells = <&macaddr_hard 3>;
+ nvmem-cell-names = "mac-address";
};
&swport3 {
status = "okay";
label = "lan2";
+
+ nvmem-cells = <&macaddr_hard 2>;
+ nvmem-cell-names = "mac-address";
};
&swport4 {
status = "okay";
label = "lan1";
+
+ nvmem-cells = <&macaddr_hard 1>;
+ nvmem-cell-names = "mac-address";
};
&swport5 {
};
aliases {
- // TODO: Verify if the ethernet0 alias is needed
- ethernet0 = &gmac;
led-boot = &led_status_blue;
led-failsafe = &led_status_red;
led-running = &led_status_blue;
led-upgrade = &led_status_red;
+ label-mac-device = &gmac;
};
soc {
hard_config {
read-only;
size = <0x2000>;
+
+ nvmem-layout {
+ compatible = "mikrotik,routerboot-nvmem";
+
+ macaddr_hard: base-mac-address {
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
dtb_config {
&gmac {
status = "okay";
+
+ nvmem-cells = <&macaddr_hard 0>;
+ nvmem-cell-names = "mac-address";
};
&switch {
&swport1 {
status = "okay";
label = "lan4";
+
+ nvmem-cells = <&macaddr_hard 4>;
+ nvmem-cell-names = "mac-address";
};
&swport2 {
status = "okay";
label = "lan3";
+
+ nvmem-cells = <&macaddr_hard 3>;
+ nvmem-cell-names = "mac-address";
};
&swport3 {
status = "okay";
label = "lan2";
+
+ nvmem-cells = <&macaddr_hard 2>;
+ nvmem-cell-names = "mac-address";
};
&swport4 {
status = "okay";
label = "lan1";
+
+ nvmem-cells = <&macaddr_hard 1>;
+ nvmem-cell-names = "mac-address";
};
&swport5 {
};
aliases {
- // TODO: Verify if the ethernet0 alias is needed
- ethernet0 = &gmac;
led-boot = &user;
led-failsafe = &user;
led-running = &user;
led-upgrade = &user;
+ label-mac-device = &gmac;
};
soc {
hard_config {
read-only;
size = <0x2000>;
+
+ nvmem-layout {
+ compatible = "mikrotik,routerboot-nvmem";
+
+ macaddr_hard: base-mac-address {
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
dtb_config {
&gmac {
status = "okay";
+
+ nvmem-cells = <&macaddr_hard 0>;
+ nvmem-cell-names = "mac-address";
};
&switch {
CONFIG_MTD_UBI_BLOCK=y
CONFIG_MTD_UBI_NVMEM=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
-# CONFIG_NVMEM_LAYOUT_MIKROTIK is not set
+CONFIG_NVMEM_LAYOUT_MIKROTIK=y
CONFIG_UBIFS_FS=y