Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9afe6250 authored by Alexandre Belloni's avatar Alexandre Belloni Committed by Sebastian Reichel
Browse files

power: reset: ocelot: switch the SI to boot mode



Switch the SI to boot mode so on a warm reboot, the SI is able to access
the flash.

Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 76ee875c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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");