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

Commit 148259c4 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drivers: soc: qcom: Add sdm855 SoC llcc driver" into msm-next

parents 8a2fd924 74262eac
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -49,6 +49,17 @@ Require Properties:
	Value Type: <stringlist>
	Definition: Address names. Must be "llcc"

- llcc-bank-off:
	Usage: required
	Value Type: <u32 array>
	Definition: Offsets of llcc banks from llcc base address starting from
		LLCC bank0.

- llcc-broadcast-off:
	Usage: required
	Value Type: <u32>
	Definition: Offset of broadcast register from LLCC bank0 address.

- #cache-cells:
	Usage: required
	Value Type: <u32>
@@ -71,6 +82,12 @@ Optional Properties:
-qcom,fg-cnt : The value of fine grained counter of activity monitor
	        block.

compatible devices:
		qcom,sdm845-llcc,
		qcom,sdm670-llcc,
		qcom,sdm855-llcc


Example:

	qcom,llcc@01300000 {
@@ -79,8 +96,8 @@ Example:
		reg-names = "llcc_base";
		status = "disabled";

		llcc: qcom,msmskunk-llcc {
			compatible = "qcom,msmskunk-llcc";
		llcc: qcom,sdm845-llcc {
			compatible = "qcom,sdm845-llcc";
			#cache-cells = <1>;
			max-slices = <32>;
		};
+8 −0
Original line number Diff line number Diff line
@@ -31,6 +31,14 @@ config QCOM_LLCC
	  Level Cache. This provides interfaces to client's that use the LLCC.
	  Say yes here to enable LLCC slice driver.

config QCOM_SDM855_LLCC
	tristate "Qualcomm Technologies, Inc. SDM855 LLCC driver"
	depends on QCOM_LLCC
	help
	  Say yes here to enable the LLCC driver for SDM855. This is provides
	  data required to configure LLCC so that clients can start using the
	  LLCC slices.

config QCOM_LLCC_AMON
	tristate "Qualcomm Technologies, Inc. LLCC Activity Monitor(AMON) driver"
	depends on QCOM_LLCC
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ obj-$(CONFIG_QCOM_CPUSS_DUMP) += cpuss_dump.o
obj-$(CONFIG_QCOM_GSBI)	+=	qcom_gsbi.o
obj-$(CONFIG_QCOM_MDT_LOADER)	+= mdt_loader.o
obj-$(CONFIG_QCOM_LLCC) += llcc-core.o llcc-slice.o
obj-$(CONFIG_QCOM_SDM855_LLCC) += llcc-sdm855.o
obj-$(CONFIG_QCOM_LLCC_AMON) += llcc-amon.o
obj-$(CONFIG_QCOM_PM)	+=	spm.o
obj-$(CONFIG_QCOM_SMD_RPM)	+= smd-rpm.o
+113 −0
Original line number Diff line number Diff line
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/soc/qcom/llcc-qcom.h>

/*
 * SCT entry contains of the following parameters
 * name: Name of the client's use case for which the llcc slice is used
 * uid: Unique id for the client's use case
 * slice_id: llcc slice id for each client
 * max_cap: The maximum capacity of the cache slice provided in KB
 * priority: Priority of the client used to select victim line for replacement
 * fixed_size: Determine of the slice has a fixed capacity
 * bonus_ways: Bonus ways to be used by any slice, bonus way is used only if
 *             it't not a reserved way.
 * res_ways: Reserved ways for the cache slice, the reserved ways cannot be used
 *           by any other client than the one its assigned to.
 * cache_mode: Each slice operates as a cache, this controls the mode of the
 *             slice normal or TCM
 * probe_target_ways: Determines what ways to probe for access hit. When
 *                    configured to 1 only bonus and reseved ways are probed.
 *                    when configured to 0 all ways in llcc are probed.
 * dis_cap_alloc: Disable capacity based allocation for a client
 * retain_on_pc: If this bit is set and client has maitained active vote
 *               then the ways assigned to this client are not flushed on power
 *               collapse.
 * activate_on_init: Activate the slice immidiately after the SCT is programmed
 */
#define SCT_ENTRY(n, uid, sid, mc, p, fs, bway, rway, cmod, ptw, dca, rp, a) \
	{					\
		.name = n,			\
		.usecase_id = uid,		\
		.slice_id = sid,		\
		.max_cap = mc,			\
		.priority = p,			\
		.fixed_size = fs,		\
		.bonus_ways = bway,		\
		.res_ways = rway,		\
		.cache_mode = cmod,		\
		.probe_target_ways = ptw,	\
		.dis_cap_alloc = dca,		\
		.retain_on_pc = rp,		\
		.activate_on_init = a,		\
	}

static struct llcc_slice_config sdm855_data[] =  {
	SCT_ENTRY("cpuss",       1, 1, 3072, 1, 0, 0xFF0, 0xF, 0, 0, 1, 1, 1),
	SCT_ENTRY("vidsc0",      2, 2, 512, 2, 1, 0x0,  0x0F0, 0, 0, 1, 1, 0),
	SCT_ENTRY("vidsc1",      3, 3, 512, 2, 1, 0x0,  0x0F0, 0, 0, 1, 1, 0),
	SCT_ENTRY("rotator",     4, 4, 563, 2, 1, 0x0,  0x00F, 2, 0, 1, 1, 0),
	SCT_ENTRY("voice",       5, 5, 3072, 1, 0, 0xFF0, 0xF, 0, 0, 1, 1, 0),
	SCT_ENTRY("audio",       6, 6, 3072, 1, 0, 0xFF0, 0xF, 0, 0, 1, 1, 0),
	SCT_ENTRY("modemhp_grow", 7, 7, 1024, 2, 0, 0x0F0, 0xF0F, 0, 0, 1, 1, 0),
	SCT_ENTRY("modem",       8, 8, 3072, 1, 0, 0xFF0, 0xF, 0, 0, 1, 1, 0),
	SCT_ENTRY("compute",     10, 10, 3072, 1, 0, 0xFF0, 0xF, 0, 0, 1, 1, 0),
	SCT_ENTRY("gpuhtw",      11, 11, 512, 1, 1, 0x0,  0xC, 0, 0, 1, 1, 0),
	SCT_ENTRY("gpu",         12, 12, 2560, 1, 0, 0xFF0, 0x3, 0, 0, 1, 1, 0),
	SCT_ENTRY("mmuhwt",      13, 13, 3072, 1, 0, 0xFF0, 0xF, 0, 0, 1, 0, 1),
	SCT_ENTRY("compute_dma", 15, 15, 3072, 1, 0, 0xFF0, 0xF, 0, 0, 1, 1, 0),
	SCT_ENTRY("display",     16, 16, 3072, 1, 0, 0xFF0, 0xF, 0, 0, 1, 1, 0),
	SCT_ENTRY("modemhp_fix", 20, 20, 1024, 2, 1, 0x0,  0xF00, 0, 0, 1, 1, 0),
	SCT_ENTRY("modem_paging", 21, 21, 1024, 0, 1, 0x0,  0xF, 0, 0, 1, 1, 0),
	SCT_ENTRY("audiohw",     22, 22, 1024, 1, 1, 0xFF0, 0xF, 0, 0, 1, 1, 0),
};

static int sdm855_qcom_llcc_probe(struct platform_device *pdev)
{
	return qcom_llcc_probe(pdev, sdm855_data,
				 ARRAY_SIZE(sdm855_data));
}

static const struct of_device_id sdm855_qcom_llcc_of_match[] = {
	{ .compatible = "qcom,sdm855-llcc", },
	{ },
};

static struct platform_driver sdm855_qcom_llcc_driver = {
	.driver = {
		.name = "sdm855-llcc",
		.owner = THIS_MODULE,
		.of_match_table = sdm855_qcom_llcc_of_match,
	},
	.probe = sdm855_qcom_llcc_probe,
	.remove = qcom_llcc_remove,
};

static int __init sdm855_init_qcom_llcc_init(void)
{
	return platform_driver_register(&sdm855_qcom_llcc_driver);
}
module_init(sdm855_init_qcom_llcc_init);

static void __exit sdm855_exit_qcom_llcc_exit(void)
{
	platform_driver_unregister(&sdm855_qcom_llcc_driver);
}
module_exit(sdm855_exit_qcom_llcc_exit);

MODULE_DESCRIPTION("Qualcomm Technologies Inc sdm855 LLCC driver");
MODULE_LICENSE("GPL v2");