diff --git a/target/linux/ath79/dts/qca9557_meraki_mr18.dts b/target/linux/ath79/dts/qca9557_meraki_mr18.dts index 1df5d6125cc4c5..582879d83296bc 100644 --- a/target/linux/ath79/dts/qca9557_meraki_mr18.dts +++ b/target/linux/ath79/dts/qca9557_meraki_mr18.dts @@ -125,11 +125,22 @@ }; partition@1080000 { - label = "ubi"; + compatible = "linux,ubi"; reg = <0x1080000 0x6f00000>; + label = "ubi"; + + volumes { + ubi_board_config: board-config { + label = "board-config"; + }; + + ubi_caldata: caldata { + label = "caldata"; + }; + }; }; - partition@7fe0000 { + odm_caldata: partition@7fe0000 { /* * This is not always present. And if * it is, then Meraki (or contractor) @@ -157,7 +168,8 @@ wifi@0,0 { compatible = "pci168c,0033"; reg = <0x0000 0 0 0 0>; - qca,no-eeprom; + nvmem-cells = <&macaddr_board_config 66 2>, <&cal_caldata_5000>; + nvmem-cell-names = "mac-address", "calibration"; }; }; @@ -167,7 +179,8 @@ wifi@0,0 { compatible = "pci168c,0033"; reg = <0x0000 0 0 0 0>; - qca,no-eeprom; + nvmem-cells = <&macaddr_board_config 66 3>, <&cal_caldata_9000>; + nvmem-cell-names = "mac-address", "calibration"; }; }; @@ -187,6 +200,8 @@ status = "okay"; pll-data = <0xa6000000 0xa0000101 0x80001313>; phy-handle = <&phy>; + nvmem-cells = <&macaddr_board_config 66 0>; + nvmem-cell-names = "mac-address"; gmac-config { device = <&gmac>; @@ -198,5 +213,64 @@ &wmac { status = "okay"; - qca,no-eeprom; + nvmem-cells = <&macaddr_board_config 66 1>, <&cal_caldata_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&ubi_board_config { + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_board_config_66: macaddr@102 { + compatible = "mac-base"; + reg = <0x66 0x6>; + #nvmem-cell-cells = <1>; + }; + }; +}; + +&odm_caldata { + /* Currently unused - please see the note in main node. + * Can be used as a backup (again) if a fallback mechanism + * can be implemented into nvmem subsystem for getting calibration data + */ + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_caldata_1000_backup: calibration@1000 { + reg = <0x1000 0x440>; + }; + + cal_caldata_5000_backup: calibration@5000 { + reg = <0x5000 0x440>; + }; + + cal_caldata_9000_backup: calibration@9000 { + reg = <0x9000 0x440>; + }; + }; +}; + +&ubi_caldata { + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_caldata_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + cal_caldata_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; + + cal_caldata_9000: calibration@9000 { + reg = <0x9000 0x440>; + }; + }; }; diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network index b60586a15effa2..c3ea5629c84efc 100644 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -103,9 +103,6 @@ ath79_setup_macs() wan_mac=$(mtd_get_mac_binary art 0x0) lan_mac=$(macaddr_add "$wan_mac" 1) ;; - meraki,mr18) - lan_mac=$(mtd_get_mac_binary_ubi board-config 102) - ;; netgear,wndr3700-v4|\ netgear,wndr4300|\ netgear,wndr4300sw|\ diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index c4ccb04f5bc765..36ab24e2dfe354 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -12,50 +12,6 @@ case "$FIRMWARE" in 8dev,rambutan) caldata_extract "caldata" 0x1000 0x800 ;; - meraki,mr18) - . /lib/upgrade/nand.sh - - if [ -n "$(nand_find_volume ubi0 caldata)" ]; then - caldata_extract_ubi "caldata" 0x1000 0x440 - else - caldata_extract "odm-caldata" 0x1000 0x440 - fi - ath9k_patch_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) 1) - ;; - *) - caldata_die "board $board is not supported yet" - ;; - esac - ;; -"ath9k-eeprom-pci-0000:00:00.0.bin") - case $board in - meraki,mr18) - . /lib/upgrade/nand.sh - - if [ -n "$(nand_find_volume ubi0 caldata)" ]; then - caldata_extract_ubi "caldata" 0x5000 0x440 - else - caldata_extract "odm-caldata" 0x5000 0x440 - fi - ath9k_patch_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) 2) - ;; - *) - caldata_die "board $board is not supported yet" - ;; - esac - ;; -"ath9k-eeprom-pci-0000:01:00.0.bin") - case $board in - meraki,mr18) - . /lib/upgrade/nand.sh - - if [ -n "$(nand_find_volume ubi0 caldata)" ]; then - caldata_extract_ubi "caldata" 0x9000 0x440 - else - caldata_extract "odm-caldata" 0x9000 0x440 - fi - ath9k_patch_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) 3) - ;; *) caldata_die "board $board is not supported yet" ;;