Lines Matching +full:syscon +full:- +full:reboot +full:- +full:mode

1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
11 #include <linux/mfd/syscon.h>
15 #include <linux/reboot.h>
19 const char *syscon; member
41 unsigned long mode, void *cmd) in ocelot_restart_handle() argument
46 u32 if_si_owner_bit = ctx->props->if_si_owner_bit; in ocelot_restart_handle()
49 regmap_update_bits(ctx->cpu_ctrl, ctx->props->protect_reg, in ocelot_restart_handle()
50 ctx->props->vcore_protect, 0); in ocelot_restart_handle()
52 /* Make the SI back to boot mode */ in ocelot_restart_handle()
53 regmap_update_bits(ctx->cpu_ctrl, ICPU_CFG_CPU_SYSTEM_CTRL_GENERAL_CTRL, in ocelot_restart_handle()
59 writel(SOFT_CHIP_RST, ctx->base); in ocelot_restart_handle()
70 struct device *dev = &pdev->dev; in ocelot_reset_probe()
73 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); in ocelot_reset_probe()
75 return -ENOMEM; in ocelot_reset_probe()
78 ctx->base = devm_ioremap_resource(dev, res); in ocelot_reset_probe()
79 if (IS_ERR(ctx->base)) in ocelot_reset_probe()
80 return PTR_ERR(ctx->base); in ocelot_reset_probe()
82 ctx->props = device_get_match_data(dev); in ocelot_reset_probe()
84 ctx->cpu_ctrl = syscon_regmap_lookup_by_compatible(ctx->props->syscon); in ocelot_reset_probe()
85 if (IS_ERR(ctx->cpu_ctrl)) { in ocelot_reset_probe()
86 dev_err(dev, "No syscon map: %s\n", ctx->props->syscon); in ocelot_reset_probe()
87 return PTR_ERR(ctx->cpu_ctrl); in ocelot_reset_probe()
90 ctx->restart_handler.notifier_call = ocelot_restart_handle; in ocelot_reset_probe()
91 ctx->restart_handler.priority = 192; in ocelot_reset_probe()
92 err = register_restart_handler(&ctx->restart_handler); in ocelot_reset_probe()
100 .syscon = "mscc,ocelot-cpu-syscon",
107 .syscon = "microchip,sparx5-cpu-syscon",
115 .compatible = "mscc,ocelot-chip-reset",
118 .compatible = "microchip,sparx5-chip-reset",
127 .name = "ocelot-chip-reset",