summaryrefslogtreecommitdiff
path: root/drivers/power/reset/ocelot-reset.c
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2019-01-04 14:07:47 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2019-01-04 14:07:47 +0300
commitd538d94f0ca86cfedc892cc427169219acb3c2f7 (patch)
tree8363c4ff35907edb5245da737d7f6982bf22b945 /drivers/power/reset/ocelot-reset.c
parentf460772291f8171988b2b60141a45706123d0c69 (diff)
parent96d4f267e40f9509e8a66e2b39e8b95655617693 (diff)
downloadlinux-d538d94f0ca86cfedc892cc427169219acb3c2f7.tar.xz
Merge branch 'master' into fixes
We have a fix to apply on top of commit 96d4f267e40f ("Remove 'type' argument from access_ok() function"), so merge master to get it.
Diffstat (limited to 'drivers/power/reset/ocelot-reset.c')
-rw-r--r--drivers/power/reset/ocelot-reset.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/power/reset/ocelot-reset.c b/drivers/power/reset/ocelot-reset.c
index 5a13a5cc8188..419952c61fd0 100644
--- a/drivers/power/reset/ocelot-reset.c
+++ b/drivers/power/reset/ocelot-reset.c
@@ -26,6 +26,13 @@ struct ocelot_reset_context {
#define SOFT_CHIP_RST BIT(0)
+#define ICPU_CFG_CPU_SYSTEM_CTRL_GENERAL_CTRL 0x24
+#define IF_SI_OWNER_MASK GENMASK(1, 0)
+#define IF_SI_OWNER_SISL 0
+#define IF_SI_OWNER_SIBM 1
+#define IF_SI_OWNER_SIMC 2
+#define IF_SI_OWNER_OFFSET 4
+
static int ocelot_restart_handle(struct notifier_block *this,
unsigned long mode, void *cmd)
{
@@ -37,6 +44,11 @@ static int ocelot_restart_handle(struct notifier_block *this,
regmap_update_bits(ctx->cpu_ctrl, ICPU_CFG_CPU_SYSTEM_CTRL_RESET,
CORE_RST_PROTECT, 0);
+ /* Make the SI back to boot mode */
+ regmap_update_bits(ctx->cpu_ctrl, ICPU_CFG_CPU_SYSTEM_CTRL_GENERAL_CTRL,
+ IF_SI_OWNER_MASK << IF_SI_OWNER_OFFSET,
+ IF_SI_OWNER_SIBM << IF_SI_OWNER_OFFSET);
+
writel(SOFT_CHIP_RST, ctx->base);
pr_emerg("Unable to restart system\n");