|
@@ -25,6 +25,7 @@
|
|
|
#include <linux/clk-provider.h>
|
|
|
#include <linux/mfd/syscon.h>
|
|
|
#include <linux/regmap.h>
|
|
|
+#include <linux/reboot.h>
|
|
|
#include "clk.h"
|
|
|
|
|
|
/**
|
|
@@ -330,3 +331,27 @@ void __init rockchip_clk_protect_critical(const char *clocks[], int nclocks)
|
|
|
clk_prepare_enable(clk);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+static unsigned int reg_restart;
|
|
|
+static int rockchip_restart_notify(struct notifier_block *this,
|
|
|
+ unsigned long mode, void *cmd)
|
|
|
+{
|
|
|
+ writel(0xfdb9, reg_base + reg_restart);
|
|
|
+ return NOTIFY_DONE;
|
|
|
+}
|
|
|
+
|
|
|
+static struct notifier_block rockchip_restart_handler = {
|
|
|
+ .notifier_call = rockchip_restart_notify,
|
|
|
+ .priority = 128,
|
|
|
+};
|
|
|
+
|
|
|
+void __init rockchip_register_restart_notifier(unsigned int reg)
|
|
|
+{
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ reg_restart = reg;
|
|
|
+ ret = register_restart_handler(&rockchip_restart_handler);
|
|
|
+ if (ret)
|
|
|
+ pr_err("%s: cannot register restart handler, %d\n",
|
|
|
+ __func__, ret);
|
|
|
+}
|