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

Commit 1a77a99a 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: Add alternate unit configuration for sdm845/670"

parents 887288c7 58d268e7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -23,9 +23,16 @@ The required properties for rpmh-master-stats are:
	Value type: <prop-encoded-array>
	Definition: Specifies physical address of start of profiling unit.

- qcom,use-alt-unit:
	Usage: Optional
	Value type: <u32>
	Definition: Specifies designated unit no. for which alternate unit
		is configured to capture time stamp.

Example:

qcom,rpmh-master-stats {
	compatible = "qcom,rpmh-master-stats";
	reg = <0xb221200 0x60>;
	qcom,use-alt-unit = <3>;
};
+1 −0
Original line number Diff line number Diff line
@@ -195,5 +195,6 @@
	qcom,rpmh-master-stats@b221200 {
		compatible = "qcom,rpmh-master-stats-v1";
		reg = <0xb221200 0x60>;
		qcom,use-alt-unit = <3>;
	};
};
+1 −0
Original line number Diff line number Diff line
@@ -149,5 +149,6 @@
	qcom,rpmh-master-stats@b221200 {
		compatible = "qcom,rpmh-master-stats-v1";
		reg = <0xb221200 0x60>;
		qcom,use-alt-unit = <3>;
	};
};
+20 −1
Original line number Diff line number Diff line
@@ -58,7 +58,8 @@ enum profile_data {
	POWER_UP_END,
	POWER_DOWN_END,
	POWER_UP_START,
	NUM_UNIT,
	ALT_UNIT,
	NUM_UNIT = ALT_UNIT,
};

struct msm_rpmh_master_data {
@@ -96,6 +97,7 @@ struct rpmh_master_stats_prv_data {

static struct msm_rpmh_master_stats apss_master_stats;
static void __iomem *rpmh_unit_base;
static uint32_t use_alt_unit;

static DEFINE_MUTEX(rpmh_stats_mutex);

@@ -178,6 +180,17 @@ void msm_rpmh_master_stats_update(void)
		return;

	for (i = POWER_DOWN_END; i < NUM_UNIT; i++) {
		if (i == use_alt_unit) {
			profile_unit[i].value = readl_relaxed(
						rpmh_unit_base + GET_ADDR(
						REG_DATA_LO, ALT_UNIT));
			profile_unit[i].value |= ((uint64_t)
						readl_relaxed(
						rpmh_unit_base + GET_ADDR(
						REG_DATA_HI, ALT_UNIT)) << 32);
			continue;
		}

		profile_unit[i].valid = readl_relaxed(rpmh_unit_base +
						GET_ADDR(REG_VALID, i));

@@ -233,6 +246,12 @@ static int msm_rpmh_master_stats_probe(struct platform_device *pdev)
		goto fail_sysfs;
	}

	ret = of_property_read_u32(pdev->dev.of_node,
					"qcom,use-alt-unit",
					&use_alt_unit);
	if (ret)
		use_alt_unit = -1;

	rpmh_unit_base = of_iomap(pdev->dev.of_node, 0);
	if (!rpmh_unit_base) {
		pr_err("Failed to get rpmh_unit_base\n");