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

Commit 1beb63f1 authored by Channagoud Kadabi's avatar Channagoud Kadabi
Browse files

drivers: soc: Update the max capacity programming



LLCC has four instances, the total size of the memory is divided equally
among these four instances. SW uses broadcast registers to program the
LLCC, meaning if SW writes to broadcast register the value reflects in
all the llcc instances. So when max capacity for a client is programmed
we need to divide it by four, otherwise the max capacity for a client
will exceed the max capacity of LLCC.

Change-Id: Ifbc6b712689bb70d3b35c7d88cc72fbb3eb25d37
Signed-off-by: default avatarChannagoud Kadabi <ckadabi@codeaurora.org>
parent df91074e
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@
#define LLCC_STATUS_READ_DELAY 100

#define CACHE_LINE_SIZE_SHIFT 6
#define SIZE_PER_LLCC_SHIFT   2
#define MAX_CAP_TO_BYTES(n) (n * 1024)
#define LLCC_TRP_ACT_CTRLn(n) (n * 0x1000)
#define LLCC_TRP_STATUSn(n)   (4 + n * 0x1000)
@@ -344,7 +345,12 @@ static void qcom_llcc_cfg_program(struct platform_device *pdev)

		max_cap_cacheline = MAX_CAP_TO_BYTES(llcc_table[i].max_cap);
		max_cap_cacheline >>= CACHE_LINE_SIZE_SHIFT;

		/* There are four llcc instances llcc0..llcc3. The SW writes to
		 * to broadcast register which gets propagated to each llcc.
		 * Since the size of the memory is divided equally amongst the
		 * four llcc, we need to divide the max cap by 4
		 */
		max_cap_cacheline >>= SIZE_PER_LLCC_SHIFT;
		attr1_val |= (max_cap_cacheline << ATTR1_MAX_CAP_SHIFT);

		attr0_val = llcc_table[i].res_ways & ATTR0_RES_WAYS_MASK;