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

Commit b22f3aac authored by Tirupathi Reddy's avatar Tirupathi Reddy
Browse files

regulator: mem-acc: Remove skip L1 memory ACC configuration logic



Remove the fuse based logic to skip the L1 memory ACC configuration.

Change-Id: If20c6ff36d0f26f0138b80aa27d8ed116bc080db
Signed-off-by: default avatarTirupathi Reddy <tirupath@codeaurora.org>
parent 04ac75d7
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -53,21 +53,6 @@ Optional properties:
				defined by the qcom,acc-sel-l2-bit-size
				property.  This N-bit value specifies the corner
				value used by the accelerator for the L2 cache.
- qcom,l1-config-skip-fuse-sel:	Array of 5 elements to indicate where to read the bits, what value to
				compare with in order to decide whether to
				skip configuring the L1 accelerator or not while changing the APC corner
				and method to read fuse row, using SCM to read or read register directly.
				The 5 elements with index [0..4] are:
				  [0] => the fuse row number of the selector
				  [1] => LSB bit position of the bits
				  [2] => number of bits
				  [3] => the value to select skip L1 config logic
				  [4] => fuse reading method, 0 for direct reading or 1 for SCM reading
				When the value of the fuse bits specified by first 3 elements equals to
				the value in 4th element, L1 accelerator
				configuration logic is skipped. Otherwise, the original configuration sent
				from corner map should be applied. If the 5th element is 0, read the fuse row
				from register directly. Otherwise, read it through SCM.
- qcom,l1-acc-custom-data:	Array which maps APC corner values to L1 ACC custom data values.
				The corresponding custom data is written into the custom register
				while switching between APC corners. The custom register address
@@ -150,7 +135,6 @@ mem_acc_vreg_corner: regulator@fd4aa044 {
	qcom,acc-sel-l1-bit-size = <2>;
	qcom,acc-sel-l2-bit-size = <2>;
	qcom,corner-acc-map = <0 1 3>;
	qcom,l1-config-skip-fuse-sel = <0 52 1 1 0>;
	qcom,l2-acc-custom-data = <0x0 0x3000 0x3000>;

	qcom,override-acc-fuse-sel = <0 52 2 0>;
+1 −51
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@
#define BYTES_PER_FUSE_ROW		8

/* mem-acc config flags */
#define MEM_ACC_SKIP_L1_CONFIG		BIT(0)
#define FUSE_MAP_NO_MATCH		(-1)
#define FUSE_PARAM_MATCH_ANY		(-1)

@@ -134,28 +133,6 @@ static u64 mem_acc_read_efuse_row(struct mem_acc_regulator *mem_acc_vreg,
	return efuse_bits;
}

static int mem_acc_fuse_is_setting_expected(
		struct mem_acc_regulator *mem_acc_vreg, u32 sel_array[5])
{
	u64 fuse_bits;
	u32 ret;

	fuse_bits = mem_acc_read_efuse_row(mem_acc_vreg, sel_array[0],
							sel_array[4]);
	ret = (fuse_bits >> sel_array[1]) & ((1 << sel_array[2]) - 1);
	if (ret == sel_array[3])
		ret = 1;
	else
		ret = 0;

	pr_info("[row:%d] = 0x%llx @%d:%d == %d ?: %s\n",
			sel_array[0], fuse_bits,
			sel_array[1], sel_array[2],
			sel_array[3],
			(ret == 1) ? "yes" : "no");
	return ret;
}

static inline u32 apc_to_acc_corner(struct mem_acc_regulator *mem_acc_vreg,
								int corner)
{
@@ -171,14 +148,6 @@ static void __update_acc_sel(struct mem_acc_regulator *mem_acc_vreg,
{
	u32 acc_data, acc_data_old, i, bit, acc_corner;

	/*
	 * Do not configure the L1 ACC corner if the the corresponding flag is
	 * set.
	 */
	if ((mem_type == MEMORY_L1)
			&& (mem_acc_vreg->flags & MEM_ACC_SKIP_L1_CONFIG))
		return;

	acc_data = readl_relaxed(mem_acc_vreg->acc_sel_base[mem_type]);
	acc_data_old = acc_data;
	for (i = 0; i < mem_acc_vreg->num_acc_sel[mem_type]; i++) {
@@ -427,8 +396,7 @@ static int mem_acc_efuse_init(struct platform_device *pdev,
				 struct mem_acc_regulator *mem_acc_vreg)
{
	struct resource *res;
	int len, rc = 0;
	u32 l1_config_skip_fuse_sel[5];
	int len;

	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "efuse_addr");
	if (!res || !res->start) {
@@ -450,24 +418,6 @@ static int mem_acc_efuse_init(struct platform_device *pdev,
		return -EINVAL;
	}

	if (of_find_property(mem_acc_vreg->dev->of_node,
				"qcom,l1-config-skip-fuse-sel", NULL)) {
		rc = of_property_read_u32_array(mem_acc_vreg->dev->of_node,
					"qcom,l1-config-skip-fuse-sel",
					l1_config_skip_fuse_sel, 5);
		if (rc < 0) {
			pr_err("Read failed - qcom,l1-config-skip-fuse-sel rc=%d\n",
					rc);
			return rc;
		}

		if (mem_acc_fuse_is_setting_expected(mem_acc_vreg,
						l1_config_skip_fuse_sel)) {
			mem_acc_vreg->flags |= MEM_ACC_SKIP_L1_CONFIG;
			pr_debug("Skip L1 configuration enabled\n");
		}
	}

	return 0;
}