mediatek: 6.6: refresh patches
[openwrt/staging/nbd.git] / target / linux / mediatek / patches-6.6 / 251-v6.8-watchdog-mediatek-mt7988-add-wdt-support.patch
index cb49ce1d253139763f889cbd2429460b94fec0ae..b89b385eeb466f3470041fe4312570faefb258e0 100644 (file)
@@ -18,7 +18,7 @@ Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
 
 --- a/drivers/watchdog/mtk_wdt.c
 +++ b/drivers/watchdog/mtk_wdt.c
-@@ -56,9 +56,13 @@
+@@ -58,9 +58,13 @@
  #define WDT_SWSYSRST          0x18U
  #define WDT_SWSYS_RST_KEY     0x88000000
  
@@ -32,10 +32,10 @@ Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
  static bool nowayout = WATCHDOG_NOWAYOUT;
  static unsigned int timeout;
  
-@@ -68,10 +72,12 @@ struct mtk_wdt_dev {
-       spinlock_t lock; /* protects WDT_SWSYSRST reg */
+@@ -71,10 +75,12 @@ struct mtk_wdt_dev {
        struct reset_controller_dev rcdev;
        bool disable_wdt_extrst;
+       bool reset_by_toprgu;
 +      bool has_swsysrst_en;
  };
  
@@ -45,7 +45,7 @@ Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
  };
  
  static const struct mtk_wdt_data mt2712_data = {
-@@ -82,6 +88,11 @@ static const struct mtk_wdt_data mt7986_
+@@ -89,6 +95,11 @@ static const struct mtk_wdt_data mt7986_
        .toprgu_sw_rst_num = MT7986_TOPRGU_SW_RST_NUM,
  };
  
@@ -57,7 +57,7 @@ Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
  static const struct mtk_wdt_data mt8183_data = {
        .toprgu_sw_rst_num = MT8183_TOPRGU_SW_RST_NUM,
  };
-@@ -98,6 +109,28 @@ static const struct mtk_wdt_data mt8195_
+@@ -109,6 +120,28 @@ static const struct mtk_wdt_data mt8195_
        .toprgu_sw_rst_num = MT8195_TOPRGU_SW_RST_NUM,
  };
  
@@ -86,7 +86,7 @@ Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
  static int toprgu_reset_update(struct reset_controller_dev *rcdev,
                               unsigned long id, bool assert)
  {
-@@ -108,6 +141,9 @@ static int toprgu_reset_update(struct re
+@@ -119,6 +152,9 @@ static int toprgu_reset_update(struct re
  
        spin_lock_irqsave(&data->lock, flags);
  
@@ -96,7 +96,7 @@ Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
        tmp = readl(data->wdt_base + WDT_SWSYSRST);
        if (assert)
                tmp |= BIT(id);
-@@ -116,6 +152,9 @@ static int toprgu_reset_update(struct re
+@@ -127,6 +163,9 @@ static int toprgu_reset_update(struct re
        tmp |= WDT_SWSYS_RST_KEY;
        writel(tmp, data->wdt_base + WDT_SWSYSRST);
  
@@ -106,7 +106,7 @@ Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
        spin_unlock_irqrestore(&data->lock, flags);
  
        return 0;
-@@ -393,6 +432,8 @@ static int mtk_wdt_probe(struct platform
+@@ -406,6 +445,8 @@ static int mtk_wdt_probe(struct platform
                                                       wdt_data->toprgu_sw_rst_num);
                if (err)
                        return err;
@@ -115,11 +115,11 @@ Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
        }
  
        mtk_wdt->disable_wdt_extrst =
-@@ -427,6 +468,7 @@ static const struct of_device_id mtk_wdt
-       { .compatible = "mediatek,mt2712-wdt", .data = &mt2712_data },
+@@ -444,6 +485,7 @@ static const struct of_device_id mtk_wdt
        { .compatible = "mediatek,mt6589-wdt" },
+       { .compatible = "mediatek,mt6795-wdt", .data = &mt6795_data },
        { .compatible = "mediatek,mt7986-wdt", .data = &mt7986_data },
 +      { .compatible = "mediatek,mt7988-wdt", .data = &mt7988_data },
        { .compatible = "mediatek,mt8183-wdt", .data = &mt8183_data },
        { .compatible = "mediatek,mt8186-wdt", .data = &mt8186_data },
-       { .compatible = "mediatek,mt8192-wdt", .data = &mt8192_data },
+       { .compatible = "mediatek,mt8188-wdt", .data = &mt8188_data },