Skip to content

Commit

Permalink
mediatek: filogic: asus-tuf-ax4200: use NVMEM-on-UBI
Browse files Browse the repository at this point in the history
Use newly added support for NVMEM-on-UBI instead of extracting MAC
address and WiFi EEPROM data in userspace.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  • Loading branch information
dangowrt committed Feb 19, 2024
1 parent 652987b commit bba47ba
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
37 changes: 32 additions & 5 deletions target/linux/mediatek/dts/mt7986a-asus-tuf-ax4200.dts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

aliases {
serial0 = &uart0;
label-mac-device = &gmac0;
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
Expand All @@ -21,7 +22,6 @@

chosen {
stdout-path = "serial0:115200n8";
bootargs-override = "ubi.mtd=UBI_DEV";
};

memory {
Expand Down Expand Up @@ -101,6 +101,8 @@
/* LAN */
compatible = "mediatek,eth-mac";
reg = <0>;
nvmem-cells = <&macaddr_factory_4>;
nvmem-cell-names = "mac-address";
phy-mode = "2500base-x";

fixed-link {
Expand Down Expand Up @@ -221,19 +223,42 @@
#size-cells = <1>;

partition@0 {
label = "bootloader";
reg = <0x0 0x400000>;
label = "bootloader";
read-only;
};

partition@400000 {
label = "UBI_DEV";
compatible = "linux,ubi";
reg = <0x400000 0xfc00000>;
label = "UBI_DEV";

volumes {
ubi_factory: ubi-volume-factory {
volname = "Factory";
};
};
};
};
};
};

&ubi_factory {
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;

eeprom_factory_0: eeprom@0 {
reg = <0x0 0x1000>;
};

macaddr_factory_4: macaddr@4 {
reg = <0x4 0x6>;
};
};
};

&switch {
ports {
#address-cells = <1>;
Expand Down Expand Up @@ -340,10 +365,12 @@
};

&wifi {
status = "okay";
pinctrl-names = "default", "dbdc";
nvmem-cells = <&eeprom_factory_0>;
nvmem-cell-names = "eeprom";
pinctrl-0 = <&wf_2g_5g_pins>;
pinctrl-1 = <&wf_dbdc_pins>;
pinctrl-names = "default", "dbdc";
status = "okay";
};

&trng {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ mediatek_setup_macs()
local label_mac=""

case $board in
asus,tuf-ax4200|\
asus,tuf-ax6000)
CI_UBIPART="UBI_DEV"
addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ case "$FIRMWARE" in
;;
esac
;;
"mediatek/mt7986_eeprom_mt7976_dbdc.bin")
case "$board" in
asus,tuf-ax4200)
CI_UBIPART="UBI_DEV"
caldata_extract_ubi "Factory" 0x0 0x1000
;;
esac
;;
"mediatek/mt7986_eeprom_mt7976_dual.bin")
case "$board" in
asus,tuf-ax6000)
Expand Down

0 comments on commit bba47ba

Please sign in to comment.