mediatek: convert eeprom/macaddr to nvmem format for jdcloud re-cp-03
Switch to new nvmem binding. Also fixes a issue that the MAC address assigned to lan/wan was reversed. Tested-by: Yangyu Chen <cyy@cyyself.name> Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
parent
3fd593b848
commit
0397932fdd
3 changed files with 35 additions and 12 deletions
|
@ -101,6 +101,9 @@
|
||||||
reg = <0>;
|
reg = <0>;
|
||||||
phy-mode = "2500base-x";
|
phy-mode = "2500base-x";
|
||||||
|
|
||||||
|
nvmem-cells = <&macaddr_factory_2a 0>;
|
||||||
|
nvmem-cell-names = "mac-address";
|
||||||
|
|
||||||
fixed-link {
|
fixed-link {
|
||||||
speed = <2500>;
|
speed = <2500>;
|
||||||
full-duplex;
|
full-duplex;
|
||||||
|
@ -113,6 +116,9 @@
|
||||||
reg = <1>;
|
reg = <1>;
|
||||||
phy-mode = "2500base-x";
|
phy-mode = "2500base-x";
|
||||||
phy-handle = <&phy6>;
|
phy-handle = <&phy6>;
|
||||||
|
|
||||||
|
nvmem-cells = <&macaddr_factory_24 0>;
|
||||||
|
nvmem-cell-names = "mac-address";
|
||||||
};
|
};
|
||||||
|
|
||||||
mdio: mdio-bus {
|
mdio: mdio-bus {
|
||||||
|
@ -166,7 +172,34 @@
|
||||||
|
|
||||||
block {
|
block {
|
||||||
compatible = "block-device";
|
compatible = "block-device";
|
||||||
|
|
||||||
partitions {
|
partitions {
|
||||||
|
block-partition-factory {
|
||||||
|
partname = "factory";
|
||||||
|
|
||||||
|
nvmem-layout {
|
||||||
|
compatible = "fixed-layout";
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
|
||||||
|
eeprom_factory_0: eeprom@0 {
|
||||||
|
reg = <0x0 0x1000>;
|
||||||
|
};
|
||||||
|
|
||||||
|
macaddr_factory_24: macaddr@24 {
|
||||||
|
compatible = "mac-base";
|
||||||
|
reg = <0x24 0x6>;
|
||||||
|
#nvmem-cell-cells = <1>;
|
||||||
|
};
|
||||||
|
|
||||||
|
macaddr_factory_2a: macaddr@2a {
|
||||||
|
compatible = "mac-base";
|
||||||
|
reg = <0x2a 0x6>;
|
||||||
|
#nvmem-cell-cells = <1>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
emmc_rootdisk: block-partition-production {
|
emmc_rootdisk: block-partition-production {
|
||||||
partname = "production";
|
partname = "production";
|
||||||
};
|
};
|
||||||
|
@ -304,6 +337,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
&wifi {
|
&wifi {
|
||||||
|
nvmem-cells = <&eeprom_factory_0>;
|
||||||
|
nvmem-cell-names = "eeprom";
|
||||||
pinctrl-names = "default";
|
pinctrl-names = "default";
|
||||||
pinctrl-0 = <&wf_2g_5g_pins>;
|
pinctrl-0 = <&wf_2g_5g_pins>;
|
||||||
status = "okay";
|
status = "okay";
|
||||||
|
|
|
@ -145,11 +145,6 @@ mediatek_setup_macs()
|
||||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||||
label_mac=$wan_mac
|
label_mac=$wan_mac
|
||||||
;;
|
;;
|
||||||
jdcloud,re-cp-03)
|
|
||||||
wan_mac=$(mmc_get_mac_binary factory 0x2a)
|
|
||||||
lan_mac=$(mmc_get_mac_binary factory 0x24)
|
|
||||||
label_mac=$lan_mac
|
|
||||||
;;
|
|
||||||
mercusys,mr90x-v1)
|
mercusys,mr90x-v1)
|
||||||
label_mac=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
|
label_mac=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
|
||||||
lan_mac=$label_mac
|
lan_mac=$label_mac
|
||||||
|
|
|
@ -60,13 +60,6 @@ case "$FIRMWARE" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
"mediatek/mt7986_eeprom_mt7976_dual.bin")
|
|
||||||
case "$board" in
|
|
||||||
jdcloud,re-cp-03)
|
|
||||||
caldata_extract_mmc "factory" 0x0 0x1000
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue