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

Commit bc71cf75 authored by Rishabh Bhatnagar's avatar Rishabh Bhatnagar
Browse files

drivers: llcc: Write to sub-cache register based on version



Check the llcc version before writing to write subcache register as
its not supported by older targets.

Change-Id: Ifc3f2d4d66612d6dcc6070d3cbc3fce97202ccf3
Signed-off-by: default avatarRishabh Bhatnagar <rishabhb@codeaurora.org>
parent 16deced5
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -236,12 +236,15 @@ static int qcom_llcc_cfg_program(struct platform_device *pdev)
	u32 sz;
	u32 pcb = 0;
	u32 cad = 0;
	u32 wren = 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;
	uint32_t mask = ~0;
	int v2_ver = of_device_is_compatible(pdev->dev.of_node,
							 "qcom,llcc-v2");

	sz = drv_data->cfg_size;
	llcc_table = drv_data->cfg;
@@ -249,7 +252,7 @@ static int qcom_llcc_cfg_program(struct platform_device *pdev)
	/* Disable the Cache as Non-Cache override and enable
	 * the Non-Cache as Cache override
	 */
	if (of_device_is_compatible(pdev->dev.of_node, "qcom,llcc-v2")) {
	if (v2_ver) {
		ret  = regmap_write(drv_data->bcast_regmap,
						 LLCC_TRP_C_AS_NC, 0);
		if (ret)
@@ -307,10 +310,11 @@ static int qcom_llcc_cfg_program(struct platform_device *pdev)
		if (ret)
			return ret;

		if (llcc_table[i].write_scid_en) {
		if (v2_ver) {
			wren |= llcc_table[i].write_scid_en <<
						llcc_table[i].slice_id;
			ret = regmap_write(drv_data->bcast_regmap,
				LLCC_TRP_WRSC_EN,
				LLCC_WRSC_SCID_EN(llcc_table[i].slice_id));
				LLCC_TRP_WRSC_EN, wren);
			if (ret)
				return ret;
		}