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

Commit 9942b28e authored by Venkata Narendra Kumar Gutta's avatar Venkata Narendra Kumar Gutta
Browse files

drivers: llcc: Support targets that can write to llcc


 registers

For older targets, it is possible that they are not allowed
to configure certain llcc registers, as that is handled by
the secure side. However, this is not the case for newer
targets, and as such, they must configure these registers
according to the contents of the SCT table, while keeping in
mind that older targets may not have these capabilities.
Allow configuration of registers to enable capacity based
allocation and power collapse retention for capable targets.

Change-Id: I2106f98812a9369f1fdb7e20453741f1375c0a58
Signed-off-by: default avatarIsaac J. Manjarres <isaacm@codeaurora.org>
[vgutta@codeaurora.org: Resolved trivial merge conflicts]
Signed-off-by: default avatarVenkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
parent 03a06b36
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -45,6 +45,9 @@
#define LLCC_TRP_WRSC_EN              0x21F20
#define LLCC_WRSC_SCID_EN(n)          BIT(n)

#define LLCC_TRP_PCB_ACT	      0x21F04
#define LLCC_TRP_SCID_DIS_CAP_ALLOC   0x21F00

#define BANK_OFFSET_STRIDE            0x80000

static struct llcc_drv_data *drv_data;
@@ -227,9 +230,13 @@ static int qcom_llcc_cfg_program(struct platform_device *pdev)
	u32 attr0_val;
	u32 max_cap_cacheline;
	u32 sz;
	u32 pcb = 0;
	u32 cad = 0;
	int ret = 0;
	const struct llcc_slice_config *llcc_table;
	struct llcc_slice_desc desc;
	bool cap_based_alloc_and_pwr_collapse =
		drv_data->cap_based_alloc_and_pwr_collapse;

	sz = drv_data->cfg_size;
	llcc_table = drv_data->cfg;
@@ -278,6 +285,18 @@ static int qcom_llcc_cfg_program(struct platform_device *pdev)
				return ret;
		}

		if (cap_based_alloc_and_pwr_collapse) {
			cad |= llcc_table[i].dis_cap_alloc <<
				llcc_table[i].slice_id;
			regmap_write(drv_data->bcast_regmap,
					LLCC_TRP_SCID_DIS_CAP_ALLOC, cad);

			pcb |= llcc_table[i].retain_on_pc <<
					llcc_table[i].slice_id;
			regmap_write(drv_data->bcast_regmap,
					LLCC_TRP_PCB_ACT, pcb);
		}

		if (llcc_table[i].activate_on_init) {
			desc.slice_id = llcc_table[i].slice_id;
			ret = llcc_slice_activate(&desc);
@@ -342,6 +361,10 @@ int qcom_llcc_probe(struct platform_device *pdev,
	if (!drv_data->offsets)
		return -ENOMEM;

	drv_data->cap_based_alloc_and_pwr_collapse =
		of_property_read_bool(pdev->dev.of_node,
				      "cap-based-alloc-and-pwr-collapse");

	for (i = 0; i < num_banks; i++)
		drv_data->offsets[i] = i * BANK_OFFSET_STRIDE;

+1 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ struct llcc_drv_data {
	unsigned long *bitmap;
	u32 *offsets;
	int ecc_irq;
	bool cap_based_alloc_and_pwr_collapse;
};

/**