mediatek: filogic: asus-tuf-ax6000: use NVMEM-on-UBI
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>
This commit is contained in:
parent
25c9ebc6d4
commit
1794309bb5
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
aliases {
|
aliases {
|
||||||
serial0 = &uart0;
|
serial0 = &uart0;
|
||||||
|
label-mac-device = &gmac0;
|
||||||
led-boot = &led_system;
|
led-boot = &led_system;
|
||||||
led-failsafe = &led_system;
|
led-failsafe = &led_system;
|
||||||
led-running = &led_system;
|
led-running = &led_system;
|
||||||
@ -21,7 +22,7 @@
|
|||||||
|
|
||||||
chosen {
|
chosen {
|
||||||
stdout-path = "serial0:115200n8";
|
stdout-path = "serial0:115200n8";
|
||||||
bootargs-override = "ubi.mtd=UBI_DEV";
|
bootargs-override = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
memory {
|
memory {
|
||||||
@ -101,6 +102,8 @@
|
|||||||
/* LAN */
|
/* LAN */
|
||||||
compatible = "mediatek,eth-mac";
|
compatible = "mediatek,eth-mac";
|
||||||
reg = <0>;
|
reg = <0>;
|
||||||
|
nvmem-cells = <&macaddr_factory_4>;
|
||||||
|
nvmem-cell-names = "mac-address";
|
||||||
phy-mode = "2500base-x";
|
phy-mode = "2500base-x";
|
||||||
|
|
||||||
fixed-link {
|
fixed-link {
|
||||||
@ -219,33 +222,74 @@
|
|||||||
|
|
||||||
spi_nand_flash: flash@0 {
|
spi_nand_flash: flash@0 {
|
||||||
compatible = "spi-nand";
|
compatible = "spi-nand";
|
||||||
|
reg = <0>;
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
#size-cells = <1>;
|
#size-cells = <1>;
|
||||||
reg = <0>;
|
|
||||||
|
|
||||||
spi-max-frequency = <20000000>;
|
spi-max-frequency = <20000000>;
|
||||||
spi-tx-bus-width = <4>;
|
spi-tx-bus-width = <4>;
|
||||||
spi-rx-bus-width = <4>;
|
spi-rx-bus-width = <4>;
|
||||||
|
|
||||||
partitions: partitions {
|
/*
|
||||||
|
* ASUS bootloader tries to replace the partitions defined in
|
||||||
|
* Device Tree and by that also deletes all additional properties
|
||||||
|
* needed for UBI and NVMEM-on-UBI.
|
||||||
|
* Prevent this from happening by tricking the loader to delete and
|
||||||
|
* replace a bait node instead.
|
||||||
|
*/
|
||||||
|
partitions: dummy {
|
||||||
|
compatible = "u-boot-dummy-partitions";
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
|
||||||
|
partition@0 {
|
||||||
|
reg = <0x0 0x0>;
|
||||||
|
label = "remove_me";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
partitions {
|
||||||
compatible = "fixed-partitions";
|
compatible = "fixed-partitions";
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
#size-cells = <1>;
|
#size-cells = <1>;
|
||||||
|
|
||||||
partition@0 {
|
partition@0 {
|
||||||
label = "bootloader";
|
|
||||||
reg = <0x0 0x400000>;
|
reg = <0x0 0x400000>;
|
||||||
|
label = "bootloader";
|
||||||
read-only;
|
read-only;
|
||||||
};
|
};
|
||||||
|
|
||||||
partition@400000 {
|
partition@400000 {
|
||||||
label = "UBI_DEV";
|
compatible = "linux,ubi";
|
||||||
reg = <0x400000 0xfc00000>;
|
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 {
|
&switch {
|
||||||
ports {
|
ports {
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
@ -360,10 +404,12 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
&wifi {
|
&wifi {
|
||||||
status = "okay";
|
nvmem-cells = <&eeprom_factory_0>;
|
||||||
|
nvmem-cell-names = "eeprom";
|
||||||
pinctrl-names = "default", "dbdc";
|
pinctrl-names = "default", "dbdc";
|
||||||
pinctrl-0 = <&wf_2g_5g_pins>;
|
pinctrl-0 = <&wf_2g_5g_pins>;
|
||||||
pinctrl-1 = <&wf_dbdc_pins>;
|
pinctrl-1 = <&wf_dbdc_pins>;
|
||||||
|
status = "okay";
|
||||||
};
|
};
|
||||||
|
|
||||||
&trng {
|
&trng {
|
||||||
|
@ -109,12 +109,6 @@ mediatek_setup_macs()
|
|||||||
local label_mac=""
|
local label_mac=""
|
||||||
|
|
||||||
case $board in
|
case $board in
|
||||||
asus,tuf-ax6000)
|
|
||||||
CI_UBIPART="UBI_DEV"
|
|
||||||
addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)
|
|
||||||
wan_mac="${addr}"
|
|
||||||
lan_mac="${addr}"
|
|
||||||
;;
|
|
||||||
bananapi,bpi-r3)
|
bananapi,bpi-r3)
|
||||||
wan_mac=$(macaddr_add $(cat /sys/class/net/eth0/address) 1)
|
wan_mac=$(macaddr_add $(cat /sys/class/net/eth0/address) 1)
|
||||||
;;
|
;;
|
||||||
|
@ -59,10 +59,6 @@ case "$FIRMWARE" in
|
|||||||
;;
|
;;
|
||||||
"mediatek/mt7986_eeprom_mt7976_dual.bin")
|
"mediatek/mt7986_eeprom_mt7976_dual.bin")
|
||||||
case "$board" in
|
case "$board" in
|
||||||
asus,tuf-ax6000)
|
|
||||||
CI_UBIPART="UBI_DEV"
|
|
||||||
caldata_extract_ubi "Factory" 0x0 0x1000
|
|
||||||
;;
|
|
||||||
jdcloud,re-cp-03)
|
jdcloud,re-cp-03)
|
||||||
caldata_extract_mmc "factory" 0x0 0x1000
|
caldata_extract_mmc "factory" 0x0 0x1000
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user