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

Commit 97cdec91 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ARM: dts: msm: support APC off with L2RAM on state for MSM8909W"

parents e9ccf50e fccd6718
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -96,6 +96,8 @@ Optional properties:
	or not for the drivers to prepare for cluster collapse.
	- qcom,hyp-psci: This property is used to determine if the cpu
        enters the low power mode within hypervisor.
	- qcom,no-cache-flush: This boolean property will specify that cache
	will not be flushed and will be in retention for this mode.
	- qcom,reset-level: This property is used to determine in this
	low power mode only control logic power collapse happens or memory
	logic power collapse aswell happens or retention state.
+4 −3
Original line number Diff line number Diff line
@@ -175,9 +175,9 @@
		};
		qcom,mode2 {
			qcom,label = "qcom,saw2-spm-cmd-pc";
			qcom,sequence = [00 32 b0 10 e0 d0 6b c0 42 f0 11
				07 01 b0 50 4e 02 02 c0 d0 12 e0 6b 02 32
				50 f0 0f]; /*APC_L2RAM_OFF */
			qcom,sequence = [00 20 32 b0 6b c0 e0 d0 42 11 07
				01 b0 50 4e 02 02 d0 e0 c0 22 6b 02 32 52
				0f]; /*APC_L2RAM_ON */
			qcom,spm_en;
			qcom,pc_mode;
		};
@@ -228,6 +228,7 @@
				qcom,time-overhead = <2500>;
				qcom,min-child-idx = <2>;
				qcom,notify-rpm;
				qcom,no-cache-flush;
				qcom,reset-level = <LPM_RESET_LVL_PC>;
			};

+4 −1
Original line number Diff line number Diff line
@@ -358,7 +358,8 @@ static int parse_legacy_cluster_params(struct device_node *node,
	int ret;
	struct lpm_match {
		char *devname;
		int (*set_mode)(struct low_power_ops *, int, bool);
		int (*set_mode)(struct low_power_ops *, int,
					struct lpm_cluster_level *);
	};
	struct lpm_match match_tbl[] = {
		{"l2", set_l2_mode},
@@ -595,6 +596,8 @@ static int parse_cluster_level(struct device_node *node,
					"qcom,disable-dynamic-int-routing");
	level->last_core_only = of_property_read_bool(node,
					"qcom,last-core-only");
	level->no_cache_flush = of_property_read_bool(node,
					"qcom,no-cache-flush");

	key = "parse_power_params";
	ret = parse_power_params(node, &level->pwr);
+14 −5
Original line number Diff line number Diff line
@@ -354,10 +354,12 @@ static void msm_pm_set_timer(uint32_t modified_time_us)
	hrtimer_start(&lpm_hrtimer, modified_ktime, HRTIMER_MODE_REL_PINNED);
}

int set_l2_mode(struct low_power_ops *ops, int mode, bool notify_rpm)
int set_l2_mode(struct low_power_ops *ops, int mode,
				struct lpm_cluster_level *level)
{
	int lpm = mode;
	int rc = 0;
	bool notify_rpm = level->notify_rpm;
	struct low_power_ops *cpu_ops = per_cpu(cpu_cluster,
			smp_processor_id())->lpm_dev;

@@ -369,6 +371,9 @@ int set_l2_mode(struct low_power_ops *ops, int mode, bool notify_rpm)
	case MSM_SPM_MODE_STANDALONE_POWER_COLLAPSE:
	case MSM_SPM_MODE_POWER_COLLAPSE:
	case MSM_SPM_MODE_FASTPC:
		if (level->no_cache_flush)
			cpu_ops->tz_flag = MSM_SCM_L2_GDHS;
		else
			cpu_ops->tz_flag = MSM_SCM_L2_OFF;
		coresight_cti_ctx_save();
		break;
@@ -400,8 +405,10 @@ int set_l2_mode(struct low_power_ops *ops, int mode, bool notify_rpm)
	return rc;
}

int set_l3_mode(struct low_power_ops *ops, int mode, bool notify_rpm)
int set_l3_mode(struct low_power_ops *ops, int mode,
				struct lpm_cluster_level *level)
{
	bool notify_rpm = level->notify_rpm;
	struct low_power_ops *cpu_ops = per_cpu(cpu_cluster,
			smp_processor_id())->lpm_dev;

@@ -418,8 +425,10 @@ int set_l3_mode(struct low_power_ops *ops, int mode, bool notify_rpm)
}


int set_system_mode(struct low_power_ops *ops, int mode, bool notify_rpm)
int set_system_mode(struct low_power_ops *ops, int mode,
				struct lpm_cluster_level *level)
{
	bool notify_rpm = level->notify_rpm;
	return msm_spm_config_low_power_mode(ops->spm, mode, notify_rpm);
}

@@ -434,7 +443,7 @@ static int set_device_mode(struct lpm_cluster *cluster, int ndevice,
	ops = &cluster->lpm_dev[ndevice];
	if (ops && ops->set_mode)
		return ops->set_mode(ops, level->mode[ndevice],
				level->notify_rpm);
				level);
	else
		return -EINVAL;
}
+10 −5
Original line number Diff line number Diff line
/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -76,11 +76,13 @@ struct lpm_cluster_level {
	unsigned int psci_id;
	bool is_reset;
	int reset_level;
	bool no_cache_flush;
};

struct low_power_ops {
	struct msm_spm_device *spm;
	int (*set_mode)(struct low_power_ops *ops, int mode, bool notify_rpm);
	int (*set_mode)(struct low_power_ops *ops, int mode,
				struct lpm_cluster_level *level);
	enum msm_pm_l2_scm_flag tz_flag;
};

@@ -110,9 +112,12 @@ struct lpm_cluster {
	bool no_saw_devices;
};

int set_l2_mode(struct low_power_ops *ops, int mode, bool notify_rpm);
int set_system_mode(struct low_power_ops *ops, int mode, bool notify_rpm);
int set_l3_mode(struct low_power_ops *ops, int mode, bool notify_rpm);
int set_l2_mode(struct low_power_ops *ops, int mode,
				struct lpm_cluster_level *level);
int set_system_mode(struct low_power_ops *ops, int mode,
				struct lpm_cluster_level *level);
int set_l3_mode(struct low_power_ops *ops, int mode,
				struct lpm_cluster_level *level);
void lpm_suspend_wake_time(uint64_t wakeup_time);

struct lpm_cluster *lpm_of_parse_cluster(struct platform_device *pdev);