ath79: mynet-wifi-rangeextender: use nvmem
Convert the last remaining userspace eeprom for ath9k to nvmem. Well, easily converted at least. wifi MAC has to be handled in userspace as the kernel nvram driver works on memory mapped addresses, not mtd ones. Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://github.com/openwrt/openwrt/pull/14666 Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
This commit is contained in:
@@ -118,6 +118,16 @@
|
||||
label = "art";
|
||||
reg = <0x7f0000 0x10000>;
|
||||
read-only;
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
cal_art_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -129,8 +139,8 @@
|
||||
ath9k: wifi@0,0 {
|
||||
compatible = "pci168c,0030";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
qca,no-eeprom;
|
||||
/* wifi MAC is stored in nvram */
|
||||
nvmem-cells = <&cal_art_1000>;
|
||||
nvmem-cell-names = "calibration";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -25,10 +25,6 @@ case "$FIRMWARE" in
|
||||
avm,fritz300e)
|
||||
caldata_extract_reverse "urloader" 0x1541 0x440
|
||||
;;
|
||||
wd,mynet-wifi-rangeextender)
|
||||
caldata_extract "art" 0x1000 0x440
|
||||
ath9k_patch_mac $(nvram get wl0_hwaddr)
|
||||
;;
|
||||
*)
|
||||
caldata_die "board $board is not supported yet"
|
||||
;;
|
||||
|
||||
@@ -110,6 +110,9 @@ case "$board" in
|
||||
[ "$PHYNBR" -eq 1 ] && \
|
||||
macaddr_add $base_mac 1 > /sys${DEVPATH}/macaddress
|
||||
;;
|
||||
wd,mynet-wifi-rangeextender)
|
||||
echo $(nvram get wl0_hwaddr) > /sys${DEVPATH}/macaddress
|
||||
;;
|
||||
wd,mynet-n600|\
|
||||
wd,mynet-n750)
|
||||
[ "$PHYNBR" -eq 0 ] && \
|
||||
|
||||
Reference in New Issue
Block a user