Skip to content

Commit

Permalink
Revert "ramips: convert MT7915 EEPROM to NVMEM format"
Browse files Browse the repository at this point in the history
Some MT7915 devices need to load the second part of the eeprom to
work properly. The mt76 driver is not yet ready to read the pre-cal
data via the NVMEM cell. Therefore, partially revert commit to fix
the device probe issue on some devices.

P.S.
Except for D-Link and Ubnt devices, It is still uncertain whether
pre-cal data is required for other devices in the patch.

This partially reverts commit 9ac891f.

Fixes: openwrt#13700
Signed-off-by: Shiji Yang <[email protected]>
  • Loading branch information
DragonBluep committed Oct 17, 2023
1 parent 9921973 commit 6f31941
Show file tree
Hide file tree
Showing 19 changed files with 149 additions and 224 deletions.
12 changes: 4 additions & 8 deletions target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,13 @@
};

factory: partition@1e0000 {
compatible = "nvmem-cells";
label = "factory";
reg = <0x1e0000 0x100000>;
#address-cells = <1>;
#size-cells = <1>;
read-only;

eeprom_factory_0: eeprom@0 {
reg = <0x0 0xe00>;
};
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_factory_4: macaddr@4 {
reg = <0x4 0x6>;
Expand Down Expand Up @@ -158,8 +155,7 @@
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&eeprom_factory_0>;
nvmem-cell-names = "eeprom";
mediatek,mtd-eeprom = <&factory 0x0000>;
mediatek,disable-radar-background;
};
};
Expand Down
12 changes: 4 additions & 8 deletions target/linux/ramips/dts/mt7621_asus_rt-ax54.dts
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,13 @@
};

factory: partition@1e0000 {
compatible = "nvmem-cells";
label = "factory";
reg = <0x1e0000 0x100000>;
#address-cells = <1>;
#size-cells = <1>;
read-only;

eeprom_factory_0: eeprom@0 {
reg = <0x0 0xe00>;
};
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_factory_4: macaddr@4 {
reg = <0x4 0x6>;
Expand Down Expand Up @@ -131,8 +128,7 @@
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&eeprom_factory_0>;
nvmem-cell-names = "eeprom";
mediatek,mtd-eeprom = <&factory 0x0000>;
mediatek,disable-radar-background;
};
};
Expand Down
24 changes: 11 additions & 13 deletions target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&eeprom_factory_0>;
nvmem-cell-names = "eeprom";
mediatek,mtd-eeprom = <&factory 0x0>;
};
};

Expand Down Expand Up @@ -88,20 +87,9 @@
};

factory: partition@50000 {
compatible = "nvmem-cells";
label = "factory";
reg = <0x50000 0x10000>;
#address-cells = <1>;
#size-cells = <1>;
read-only;

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

macaddr_factory_e000: macaddr@e000 {
reg = <0xe000 0x6>;
};
};

partition@90000 {
Expand All @@ -113,6 +101,16 @@
};
};

&factory {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_factory_e000: macaddr@e000 {
reg = <0xe000 0x6>;
};
};

&gmac0 {
nvmem-cells = <&macaddr_factory_e000>;
nvmem-cell-names = "mac-address";
Expand Down
10 changes: 1 addition & 9 deletions target/linux/ramips/dts/mt7621_cudy_m1800.dts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&eeprom_factory_0>;
nvmem-cell-names = "eeprom";
mediatek,mtd-eeprom = <&factory 0x0000>;
mediatek,disable-radar-background;
};
};
Expand Down Expand Up @@ -115,16 +114,9 @@
};

factory: partition@40000 {
compatible = "nvmem-cells";
label = "factory";
reg = <0x40000 0x10000>;
#address-cells = <1>;
#size-cells = <1>;
read-only;

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

partition@50000 {
Expand Down
10 changes: 1 addition & 9 deletions target/linux/ramips/dts/mt7621_cudy_x6.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,9 @@
};

factory: partition@40000 {
compatible = "nvmem-cells";
label = "factory";
reg = <0x40000 0x10000>;
#address-cells = <1>;
#size-cells = <1>;
read-only;

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

/* additional partitions in DTS */
Expand All @@ -101,8 +94,7 @@
wifi:wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&eeprom_factory_0>;
nvmem-cell-names = "eeprom";
mediatek,mtd-eeprom = <&factory 0x0000>;
mediatek,disable-radar-background;
};
};
Expand Down
12 changes: 4 additions & 8 deletions target/linux/ramips/dts/mt7621_dlink_dap-x1860-a1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,13 @@
};

factory: partition@100000 {
compatible = "nvmem-cells";
label = "factory";
reg = <0x100000 0x80000>;
#address-cells = <1>;
#size-cells = <1>;
read-only;

eeprom_factory_0: eeprom@0 {
reg = <0x0 0xe00>;
};
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_factory_4: macaddr@4 {
reg = <0x4 0x6>;
Expand Down Expand Up @@ -178,8 +175,7 @@
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&eeprom_factory_0>;
nvmem-cell-names = "eeprom";
mediatek,mtd-eeprom = <&factory 0x0>;
mediatek,disable-radar-background;
};
};
Expand Down
12 changes: 4 additions & 8 deletions target/linux/ramips/dts/mt7621_iptime_ax2004m.dts
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,13 @@
};

factory: partition@100000 {
compatible = "nvmem-cells";
label = "factory";
reg = <0x100000 0x80000>;
#address-cells = <1>;
#size-cells = <1>;
read-only;

eeprom_factory_0: eeprom@0 {
reg = <0x0 0xe00>;
};
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_factory_4: macaddr@4 {
reg = <0x4 0x6>;
Expand Down Expand Up @@ -171,7 +168,6 @@
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&eeprom_factory_0>;
nvmem-cell-names = "eeprom";
mediatek,mtd-eeprom = <&factory 0x0>;
};
};
29 changes: 13 additions & 16 deletions target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,9 @@
};

config: partition@fa0000 {
compatible = "nvmem-cells";
label = "config";
reg = <0xfa0000 0x010000>;
#address-cells = <1>;
#size-cells = <1>;
read-only;

macaddr_config_8: macaddr@8 {
reg = <0x8 0x6>;
};
};

partition@fb0000 {
Expand All @@ -91,16 +84,9 @@
};

radio: partition@ff0000 {
compatible = "nvmem-cells";
label = "radio";
reg = <0xff0000 0x010000>;
#address-cells = <1>;
#size-cells = <1>;
read-only;

eeprom_radio_0: eeprom@0 {
reg = <0x0 0xe00>;
};
};
};
};
Expand All @@ -114,8 +100,9 @@
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8>;
nvmem-cell-names = "eeprom", "mac-address";
mediatek,mtd-eeprom = <&radio 0x0>;
nvmem-cells = <&macaddr_config_8>;
nvmem-cell-names = "mac-address";
mediatek,disable-radar-background;
};
};
Expand Down Expand Up @@ -166,3 +153,13 @@
function = "gpio";
};
};

&config {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_config_8: macaddr@8 {
reg = <0x8 0x6>;
};
};
10 changes: 1 addition & 9 deletions target/linux/ramips/dts/mt7621_netgear_eax12.dts
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,9 @@
};

factory: partition@100000 {
compatible = "nvmem-cells";
label = "Factory";
reg = <0x100000 0x80000>;
#address-cells = <1>;
#size-cells = <1>;
read-only;

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

partition@180000 {
Expand Down Expand Up @@ -178,8 +171,7 @@
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&eeprom_factory_0>;
nvmem-cell-names = "eeprom";
mediatek,mtd-eeprom = <&factory 0x0>;
};
};

Expand Down
29 changes: 13 additions & 16 deletions target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,9 @@
};

config: partition@fa0000 {
compatible = "nvmem-cells";
label = "config";
reg = <0xfa0000 0x010000>;
#address-cells = <1>;
#size-cells = <1>;
read-only;

macaddr_config_8: macaddr@8 {
reg = <0x8 0x6>;
};
};

partition@fb0000 {
Expand All @@ -124,16 +117,9 @@
};

radio: partition@ff0000 {
compatible = "nvmem-cells";
label = "radio";
reg = <0xff0000 0x010000>;
#address-cells = <1>;
#size-cells = <1>;
read-only;

eeprom_radio_0: eeprom@0 {
reg = <0x0 0xe00>;
};
};
};
};
Expand All @@ -147,8 +133,9 @@
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8>;
nvmem-cell-names = "eeprom", "mac-address";
mediatek,mtd-eeprom = <&radio 0x0>;
nvmem-cells = <&macaddr_config_8>;
nvmem-cell-names = "mac-address";
mediatek,disable-radar-background;
};
};
Expand Down Expand Up @@ -204,3 +191,13 @@
function = "gpio";
};
};

&config {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_config_8: macaddr@8 {
reg = <0x8 0x6>;
};
};
10 changes: 1 addition & 9 deletions target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,9 @@
};

radio: partition@ff0000 {
compatible = "nvmem-cells";
label = "radio";
reg = <0xff0000 0x10000>;
#address-cells = <1>;
#size-cells = <1>;
read-only;

eeprom_radio_0: eeprom@0 {
reg = <0x0 0xe00>;
};
};
};
};
Expand All @@ -138,8 +131,7 @@
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&eeprom_radio_0>;
nvmem-cell-names = "eeprom";
mediatek,mtd-eeprom = <&radio 0x0>;
mediatek,disable-radar-background;
};
};
Expand Down
Loading

0 comments on commit 6f31941

Please sign in to comment.