Skip to content

Commit aa4302c

Browse files
gclementsre
authored andcommitted
power: reset: ocelot: Add support 2 other MIPS based SoCs
This adds reset support for Luton and Jaguar2 in the ocelot-reset driver. They are both MIPS based belonging to the Vcore III family. Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent 01b8f5b commit aa4302c

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

drivers/power/reset/ocelot-reset.c

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ struct ocelot_reset_context {
2929
struct notifier_block restart_handler;
3030
};
3131

32+
#define BIT_OFF_INVALID 32
33+
3234
#define SOFT_CHIP_RST BIT(0)
3335

3436
#define ICPU_CFG_CPU_SYSTEM_CTRL_GENERAL_CTRL 0x24
@@ -50,9 +52,11 @@ static int ocelot_restart_handle(struct notifier_block *this,
5052
ctx->props->vcore_protect, 0);
5153

5254
/* Make the SI back to boot mode */
53-
regmap_update_bits(ctx->cpu_ctrl, ICPU_CFG_CPU_SYSTEM_CTRL_GENERAL_CTRL,
54-
IF_SI_OWNER_MASK << if_si_owner_bit,
55-
IF_SI_OWNER_SIBM << if_si_owner_bit);
55+
if (if_si_owner_bit != BIT_OFF_INVALID)
56+
regmap_update_bits(ctx->cpu_ctrl,
57+
ICPU_CFG_CPU_SYSTEM_CTRL_GENERAL_CTRL,
58+
IF_SI_OWNER_MASK << if_si_owner_bit,
59+
IF_SI_OWNER_SIBM << if_si_owner_bit);
5660

5761
pr_emerg("Resetting SoC\n");
5862

@@ -96,6 +100,20 @@ static int ocelot_reset_probe(struct platform_device *pdev)
96100
return err;
97101
}
98102

103+
static const struct reset_props reset_props_jaguar2 = {
104+
.syscon = "mscc,ocelot-cpu-syscon",
105+
.protect_reg = 0x20,
106+
.vcore_protect = BIT(2),
107+
.if_si_owner_bit = 6,
108+
};
109+
110+
static const struct reset_props reset_props_luton = {
111+
.syscon = "mscc,ocelot-cpu-syscon",
112+
.protect_reg = 0x20,
113+
.vcore_protect = BIT(2),
114+
.if_si_owner_bit = BIT_OFF_INVALID, /* n/a */
115+
};
116+
99117
static const struct reset_props reset_props_ocelot = {
100118
.syscon = "mscc,ocelot-cpu-syscon",
101119
.protect_reg = 0x20,
@@ -112,6 +130,12 @@ static const struct reset_props reset_props_sparx5 = {
112130

113131
static const struct of_device_id ocelot_reset_of_match[] = {
114132
{
133+
.compatible = "mscc,jaguar2-chip-reset",
134+
.data = &reset_props_jaguar2
135+
}, {
136+
.compatible = "mscc,luton-chip-reset",
137+
.data = &reset_props_luton
138+
}, {
115139
.compatible = "mscc,ocelot-chip-reset",
116140
.data = &reset_props_ocelot
117141
}, {

0 commit comments

Comments
 (0)