ramips: fix reboot for remaining 32 MB boards
authorMichael Pratt <mcpratt@pm.me>
Sat, 11 Sep 2021 02:06:10 +0000 (22:06 -0400)
committerPiotr Dymacz <pepe2k@gmail.com>
Fri, 8 Apr 2022 08:31:32 +0000 (10:31 +0200)
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>
[pepe2k@gmail.com: backported to 21.02]
Fixes: #9655, #9636, #9547
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(backported from commit 74516f4357d281f093f0daac01c4c5c239acc443)

18 files changed:
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/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_wiznet_wizfi630s.dts
target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi
target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts

index 0fc8fc60e42ebbdaced4decca47a515e9fd32bd5..577e7e05e9cda8563541011bbaa0b37d7bcb8f81 100644 (file)
@@ -8,6 +8,10 @@
        model = "Zbtlink ZBT-WE1026-H (32M)";
 };
 
+&flash0 {
+       broken-flash-reset;
+};
+
 &firmware {
        reg = <0x50000 0x1fb0000>;
 };
index 91bbd4a0449643a779a9a5a5711c37c57da2c2ea..3dae6d951524b3a609c567b440d76fbac928a373 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 6f5bc41d5d1dbfed2fc68fae88bded76fcabcf40..ad07682c981c4f83b49c052a3c87f8b145d12596 100644 (file)
@@ -12,6 +12,7 @@
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";
index bce6afe263fa3b362d62e01c40e05e59d0aa01c6..69502111fa43fff9bdff5b82d9f2dae3135a081c 100644 (file)
@@ -40,6 +40,7 @@
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";
index 49eeb46d5fea961c16cc987e565a67886cb6fe31..a0fd3786ffd4709b5f059270d3bbd8aa4aa23d67 100644 (file)
@@ -69,6 +69,7 @@
                reg = <0>;
                spi-max-frequency = <80000000>;
                m25p,fast-read;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";
index b90ff92c70495952a77089fe9797b22d17d814bc..a87bcd072797bfd0d797803bf0f5674bd9870387 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 515d37ceaa6471886f6bd438dfe34d19895c886a..1e44945794978287bf295bcd731481dcee4ea4c7 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 2ef042292554a2b52b77c91f45eaad3eda27c7eb..eaae0b9c5a685f5eba7fbee8558f49f4c32cc575 100644 (file)
@@ -80,6 +80,7 @@
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <50000000>;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";
index 969488e4167970e6b856521ddbe682acf59b8687..1f878b0d9a00e9e35c029eb62e4534b059d213da 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 3fd173914e970d1c94cbe3a1ae1a73c2b1ff4b0a..e4952d4adba2036dfb01c72c48e2ba06fc5f66b1 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 b6d2df47563db0ab00e1e0552ed61008f5b123ac..460a563257caf9a672a1ee62af36471f9756b39f 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 adc74e6643ce8bc91552b600e9d0665cce192460..312e6a91d11094e06cfbc24418a92ac230d5fe16 100644 (file)
@@ -15,6 +15,7 @@
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <40000000>;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";
index 1246651204420d5d76a99f1f0aa2d26458e32550..08cf9ab160eff3bef35befdfc017d6b8328767b9 100644 (file)
@@ -97,6 +97,7 @@
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <40000000>;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";
index a3330fb2ebd9760a1dbfc37663538ae9f0d0d16a..2f2b942a4d0c17fe7729036f217f6e50b2472748 100644 (file)
@@ -28,6 +28,7 @@
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";
index 5e92cd2126133d6a7bf4e47fbd7f9c9578ed06d8..7f21f1f908dd904ffd44ac26d7e6513256f7e724 100644 (file)
@@ -86,6 +86,7 @@
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";