ramips: fix reboot for remaining 32 MB boards
authorMichael Pratt <mcpratt@pm.me>
Sat, 11 Sep 2021 02:06:10 +0000 (22:06 -0400)
committerChristian Lamparter <chunkeey@gmail.com>
Sat, 15 Jan 2022 16:12:12 +0000 (17:12 +0100)
The following devices have a Winbond W25Q256FV flash chip,
which does not have the RESET pin enabled by default,
and otherwise would require setting a bit in a status register.

Before moving to Linux 5.4, we had the patch:
0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch
which kept specific flash chips with explicit 3-byte and 4-byte address modes
to stay in 3-byte address mode while idle (after an erase or write)
by using a custom flag SPI_NOR_4B_READ_OP that was part of the patch.

this was obsoleted by the patch:
481-mtd-spi-nor-rework-broken-flash-reset-support.patch
which uses the newer upstream flag SNOR_F_BROKEN_RESET
for devices with a flash chip that cannot be hardware reset with RESET pin
and therefore must be left in 3-byte address mode when idle.

The new patch requires that the DTS of affected devices
have the property "broken-flash-reset", which was not yet added for most of them.

This commit adds the property for remaining affected devices in ramips target,
specifically because of the flash chip model.

However, it is possible that there are other devices
where the flash chip uses an explicit 4-byte address mode
and the RESET pin is not connected to the SOC on the board,
and those DTS would also need this property.

Ref: 22d982ea0033 ("ramips: add support for switching between 3-byte and 4-byte addressing")
Ref: dfa521f12953 ("generic: spi-nor: rework broken-flash-reset")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
22 files changed:
target/linux/ramips/dts/mt7620a_youku_yk-l1.dts
target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi
target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-h-32m.dts
target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi
target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-32m.dts
target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-e.dts
target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi
target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts
target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts
target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526-32m.dts
target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi
target/linux/ramips/dts/mt7628an_hak5_wifi-pineapple-mk7.dts
target/linux/ramips/dts/mt7628an_hilink_hlk-7688a.dts
target/linux/ramips/dts/mt7628an_jotale_js76x8-32m.dts
target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi
target/linux/ramips/dts/mt7628an_onion_omega2.dtsi
target/linux/ramips/dts/mt7628an_onion_omega2p.dts
target/linux/ramips/dts/mt7628an_widora_neo-32m.dts
target/linux/ramips/dts/mt7628an_widora_neo.dtsi
target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts
target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi
target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts

index 5155318b0cc4882ff4972e81f10e6b064557cb12..3a607ee5fabd392c0ae9d06461aa4f8c7433fd31 100644 (file)
@@ -7,6 +7,10 @@
        model = "Youku YK-L1";
 };
 
+&flash0 {
+       broken-flash-reset;
+};
+
 &firmware {
        reg = <0x50000 0x1fb0000>;
 };
index 937a41d54b785403e79af8a2332ee2c4bf648dd2..ac874cef3d82f18032f59f3d2c8b9e35d943f1c0 100644 (file)
@@ -56,7 +56,7 @@
 &spi0 {
        status = "okay";
 
-       flash@0 {
+       flash0: flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <80000000>;
index 0fc8fc60e42ebbdaced4decca47a515e9fd32bd5..577e7e05e9cda8563541011bbaa0b37d7bcb8f81 100644 (file)
@@ -8,6 +8,10 @@
        model = "Zbtlink ZBT-WE1026-H (32M)";
 };
 
+&flash0 {
+       broken-flash-reset;
+};
+
 &firmware {
        reg = <0x50000 0x1fb0000>;
 };
index cdbdfbd38c25c99bfb0ba5f8090cd03c1a5baba2..57f3b4b7a6202415298c5dd01741e955bc7a8ee2 100644 (file)
@@ -30,7 +30,7 @@
 &spi0 {
        status = "okay";
 
-       flash@0 {
+       flash0: flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;
index c86890193d96b7ca1fc88f22ceb2a2d7fcf121cd..8c4eb31988764122d3dc282ec763b00e86d53d65 100644 (file)
@@ -5,6 +5,10 @@
        model = "Zbtlink ZBT-WE826 (32M)";
 };
 
+&flash0 {
+       broken-flash-reset;
+};
+
 &firmware {
        reg = <0x50000 0x1fb0000>;
 };
index 3808538ab8a35d1b8f25d471d51833ea6f0eccf0..fe5414815441cd2ded9667490276c06d3b44976b 100644 (file)
        };
 };
 
+&flash0 {
+       broken-flash-reset;
+};
+
 &firmware {
        reg = <0x50000 0x1fb0000>;
 };
index 8e781aa505a6b0a7e76d34649051cb1997ac646f..27876fc1408b38691dcc1164f2e5624a6d79eed7 100644 (file)
@@ -52,7 +52,7 @@
 &spi0 {
        status = "okay";
 
-       flash@0 {
+       flash0: flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;
index 8c1d2788c14f764eeda8dd1984b05c2fb1aef804..384da1bfa9faaa67fd73fb15a664b3b3ca655a8b 100644 (file)
@@ -69,6 +69,7 @@
                reg = <0>;
                spi-max-frequency = <80000000>;
                m25p,fast-read;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";
index c1f10ac55ead817a2757c6599f40276f254d75d2..0027bc96fe4ab8830097a8a028057f6435298ac2 100644 (file)
@@ -47,6 +47,7 @@
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <25000000>;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";
index fe4bc72f39dffb96a4df55992153bd6fd37c9bd5..66a762289dd4f125a5ea6891df262bb1791ad09c 100644 (file)
@@ -5,6 +5,10 @@
        model = "Zbtlink ZBT-WG3526 (32M)";
 };
 
+&flash0 {
+       broken-flash-reset;
+};
+
 &firmware {
        reg = <0x50000 0x1fb0000>;
 };
index 87f9e2243c86e7b79f48c5e9f08e20b5f41a64e8..01269e1c1cf108b4c2e98d89aeeff727183d26ec 100644 (file)
@@ -49,7 +49,7 @@
 &spi0 {
        status = "okay";
 
-       flash@0 {
+       flash0: flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;
index 0b21724b1a856548f56701526ee57dd48014bfe7..2901a2af51a82c490e2d7d80156ff7ffb2e9a1b8 100644 (file)
@@ -81,6 +81,7 @@
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <50000000>;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";
index 231aa15bfce63c43833b986b9eb5fe107e644983..2c7299af72fa13936314549f555e86c0b3b7ffae 100644 (file)
@@ -61,6 +61,7 @@
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <40000000>;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";
index 07e8be7848cff90e303a612676b7bb517115d15d..75ee98836ab52eab0fb6cb8b4596d6a32b58da79 100644 (file)
@@ -7,6 +7,10 @@
        model = "Jotale JS76x8 (32M)";
 };
 
+&flash0 {
+       broken-flash-reset;
+};
+
 &firmware {
        reg = <0x50000 0x1fb0000>;
 };
index 03de21224b1f824676ef900fb8f7e0c3779bd191..2d2f8a58b8d0622d3df6005b25aef624e7737364 100644 (file)
@@ -58,7 +58,7 @@
        pinctrl-names = "default";
        pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;
 
-       flash@0 {
+       flash0: flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <40000000>;
index 742c975d66b8e1003437e942e1e86d0f2fd395df..b10d448a30a2995309b697b7e849de71d92c1d47 100644 (file)
@@ -95,7 +95,7 @@
        pinctrl-names = "default";
        pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;
 
-       flash@0 {
+       flash0: flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <40000000>;
index 4ec07dbd91da62df823ee9378bc6e0025549538b..5694576974f31dc4b388aa65f4abf6f02cb3e8a4 100644 (file)
@@ -5,6 +5,10 @@
        model = "Onion Omega2+";
 };
 
+&flash0 {
+       broken-flash-reset;
+};
+
 &firmware {
        reg = <0x50000 0x1fb0000>;
 };
index c2387984c80dcbc6062a1522103fc00a5c82a153..9fe13eb5498a156df9c73df9e65eb08f8c507543 100644 (file)
@@ -5,6 +5,10 @@
        model = "Widora-NEO (32M)";
 };
 
+&flash0 {
+       broken-flash-reset;
+};
+
 &firmware {
        reg = <0x50000 0x1fb0000>;
 };
index 74f865aac9a340bea976b3e21f78e2eb505fa694..fd146e926444a8fefd65af784ceb79053ca05eb7 100644 (file)
@@ -52,7 +52,7 @@
        pinctrl-names = "default";
        pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>;
 
-       flash@0 {
+       flash0: flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <40000000>;
index 3f5db4441f15acba79469c7676d0a24a6c72a147..9ce585021ecc615882d98632210bb4d288645c13 100644 (file)
@@ -97,6 +97,7 @@
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <40000000>;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";
index 9024fb711bdccef32c72bad0b1c4466fd72d468c..bb35357808e5d8f2a1459bd8121b7725d2f4ad2f 100644 (file)
@@ -28,6 +28,7 @@
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";
index 50094a82dae10b0eba189bf17d05a5f3ee47ee13..d292b211afce933537e0abaae1c26141a98ffda8 100644 (file)
@@ -86,6 +86,7 @@
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";