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

Commit 98d12c09 authored by Raghavendra Rao Ananta's avatar Raghavendra Rao Ananta Committed by Shadab Naseem
Browse files

power: reset: Add force warm reboot support



Some entities, such as PCIe on the LE platforms, do not want
to lose the communication link on a system reboot. As a result,
add support to force warm reboot of the system and preserve the
link.

Change-Id: Id47ac11fcfa35f36b0fbb53e9a0d9cedad437a17
Signed-off-by: default avatarRaghavendra Rao Ananta <rananta@codeaurora.org>
parent f7979ae4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -9,6 +9,10 @@ Required Properties:
-compatible: "qcom,pshold"
-reg: Specifies the physical address of the ps-hold register

Optional Properties:
-qcom,force-warm-reboot: Issue a warm reboot, even for the traditional cases
				where hard reboot is issued.

Example:

	restart@fc4ab000 {
+9 −1
Original line number Diff line number Diff line
@@ -87,6 +87,8 @@ static bool scm_dload_supported;
static struct kobject dload_kobj;
static void *dload_type_addr;

static bool force_warm_reboot;

static int dload_set(const char *val, const struct kernel_param *kp);
/* interface for exporting attributes */
struct reset_attribute {
@@ -302,8 +304,11 @@ static void msm_restart_prepare(const char *cmd)
				(cmd != NULL && cmd[0] != '\0'));
	}

	if (force_warm_reboot)
		pr_info("Forcing a warm reset of the system\n");

	/* Hard reset the PMIC unless memory contents must be maintained. */
	if (need_warm_reset)
	if (force_warm_reboot || need_warm_reset)
		qpnp_pon_system_pwr_off(PON_POWER_OFF_WARM_RESET);
	else
		qpnp_pon_system_pwr_off(PON_POWER_OFF_HARD_RESET);
@@ -684,6 +689,9 @@ static int msm_restart_probe(struct platform_device *pdev)
	if (!download_mode)
		scm_disable_sdi();

	force_warm_reboot = of_property_read_bool(dev->of_node,
						"qcom,force-warm-reboot");

	return 0;

err_restart_reason: