Merge tag '2019.01-next' of https://github.com/mbgg/u-boot
[platform/kernel/u-boot.git] / drivers / watchdog / ast_wdt.c
index b2bd912..523484b 100644 (file)
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2017 Google, Inc
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -14,8 +13,6 @@
 #define WDT_AST2500    2500
 #define WDT_AST2400    2400
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct ast_wdt_priv {
        struct ast_wdt *regs;
 };
@@ -53,6 +50,7 @@ static int ast_wdt_stop(struct udevice *dev)
 
        clrbits_le32(&priv->regs->ctrl, WDT_CTRL_EN);
 
+       writel(WDT_RESET_DEFAULT, &priv->regs->reset_mask);
        return 0;
 }
 
@@ -84,7 +82,7 @@ static int ast_wdt_ofdata_to_platdata(struct udevice *dev)
 {
        struct ast_wdt_priv *priv = dev_get_priv(dev);
 
-       priv->regs = dev_get_addr_ptr(dev);
+       priv->regs = devfdt_get_addr_ptr(dev);
        if (IS_ERR(priv->regs))
                return PTR_ERR(priv->regs);
 
@@ -121,5 +119,4 @@ U_BOOT_DRIVER(ast_wdt) = {
        .priv_auto_alloc_size = sizeof(struct ast_wdt_priv),
        .ofdata_to_platdata = ast_wdt_ofdata_to_platdata,
        .ops = &ast_wdt_ops,
-       .flags = DM_FLAG_PRE_RELOC,
 };