Re: [PATCH v3 2/2] drivers: soc: Add LLCC driver

2018-04-07 Thread Stanimir Varbanov

Hi,

On  4.04.2018 20:30, risha...@codeaurora.org wrote:

Hi Stanimir,
We incorporated all your comments except the following:
1. Removing the driver that maintains the SCT (system cache table)
per chipset. As responded earlier the data is expected to change
from chipset to chipset and would clutter the main driver if we
choose using compatible string. We think its good to keep the data
separate from core driver.
2. Changing struct llcc_slice_desc to llcc_desc:
The descriptor is specific to each slice and not the whole llcc.
All the properties such as id and size are specific to each slice
and not whole llcc.

please let me know if you are ok with the approach. Based on that
I can send my next revision of changes.


Yes, please go ahead and send the next version.

regards,
Stan


Re: [PATCH v3 2/2] drivers: soc: Add LLCC driver

2018-04-07 Thread Stanimir Varbanov

Hi,

On  4.04.2018 20:30, risha...@codeaurora.org wrote:

Hi Stanimir,
We incorporated all your comments except the following:
1. Removing the driver that maintains the SCT (system cache table)
per chipset. As responded earlier the data is expected to change
from chipset to chipset and would clutter the main driver if we
choose using compatible string. We think its good to keep the data
separate from core driver.
2. Changing struct llcc_slice_desc to llcc_desc:
The descriptor is specific to each slice and not the whole llcc.
All the properties such as id and size are specific to each slice
and not whole llcc.

please let me know if you are ok with the approach. Based on that
I can send my next revision of changes.


Yes, please go ahead and send the next version.

regards,
Stan


Re: [PATCH v3 2/2] drivers: soc: Add LLCC driver

2018-04-04 Thread rishabhb

Hi Stanimir,
We incorporated all your comments except the following:
1. Removing the driver that maintains the SCT (system cache table)
per chipset. As responded earlier the data is expected to change
from chipset to chipset and would clutter the main driver if we
choose using compatible string. We think its good to keep the data
separate from core driver.
2. Changing struct llcc_slice_desc to llcc_desc:
The descriptor is specific to each slice and not the whole llcc.
All the properties such as id and size are specific to each slice
and not whole llcc.

please let me know if you are ok with the approach. Based on that
I can send my next revision of changes.



On 2018-03-29 01:08, Stanimir Varbanov wrote:

Hi,

On 03/27/2018 09:52 PM, Rishabh Bhatnagar wrote:

LLCC (Last Level Cache Controller) provides additional cache memory
in the system. LLCC is partitioned into muliple slices and each
slice getting its own priority, size, ID and other config parameters.
LLCC driver programs these parameters for each slice. Clients that
are assigned to use LLCC need to get information such size & ID of the
 slice they get and activate or deactivate the slice as needed. LLCC 
driver

provides API interfaces for the clients to perform these operations.

Signed-off-by: Channagoud Kadabi 
Signed-off-by: Rishabh Bhatnagar 
---
 drivers/soc/qcom/Kconfig   |  16 ++
 drivers/soc/qcom/Makefile  |   2 +
 drivers/soc/qcom/llcc-sdm845.c | 120 ++
 drivers/soc/qcom/llcc-slice.c  | 454 
+


I'd name it just llcc.c, slice suffix didn't add any value.


 include/linux/soc/qcom/llcc-qcom.h | 178 +++
 5 files changed, 770 insertions(+)
 create mode 100644 drivers/soc/qcom/llcc-sdm845.c
 create mode 100644 drivers/soc/qcom/llcc-slice.c
 create mode 100644 include/linux/soc/qcom/llcc-qcom.h

diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index e050eb8..28237fc 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -21,6 +21,22 @@ config QCOM_GSBI
   functions for connecting the underlying serial UART, SPI, 
and I2C

   devices to the output pins.

+config QCOM_LLCC
+   tristate "Qualcomm Technologies, Inc. LLCC driver"
+   depends on ARCH_QCOM
+   help
+ Qualcomm Technologies, Inc. platform specific LLCC driver for Last
+	  Level Cache. This provides interfaces to client's that use the 
LLCC.

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

+ LLCC slices.
+
 config QCOM_MDT_LOADER
tristate
select QCOM_SCM
diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile
index dcebf28..e16d6a2 100644
--- a/drivers/soc/qcom/Makefile
+++ b/drivers/soc/qcom/Makefile
@@ -12,3 +12,5 @@ obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o
 obj-$(CONFIG_QCOM_SMP2P)   += smp2p.o
 obj-$(CONFIG_QCOM_SMSM)+= smsm.o
 obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o
+obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o
+obj-$(CONFIG_QCOM_SDM845_LLCC) += llcc-sdm845.o
diff --git a/drivers/soc/qcom/llcc-sdm845.c 
b/drivers/soc/qcom/llcc-sdm845.c

new file mode 100644
index 000..cd431d9
--- /dev/null
+++ b/drivers/soc/qcom/llcc-sdm845.c
@@ -0,0 +1,120 @@
+/* Copyright (c) 2017-2018, 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+/*
+ * 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

+ 

Re: [PATCH v3 2/2] drivers: soc: Add LLCC driver

2018-04-04 Thread rishabhb

Hi Stanimir,
We incorporated all your comments except the following:
1. Removing the driver that maintains the SCT (system cache table)
per chipset. As responded earlier the data is expected to change
from chipset to chipset and would clutter the main driver if we
choose using compatible string. We think its good to keep the data
separate from core driver.
2. Changing struct llcc_slice_desc to llcc_desc:
The descriptor is specific to each slice and not the whole llcc.
All the properties such as id and size are specific to each slice
and not whole llcc.

please let me know if you are ok with the approach. Based on that
I can send my next revision of changes.



On 2018-03-29 01:08, Stanimir Varbanov wrote:

Hi,

On 03/27/2018 09:52 PM, Rishabh Bhatnagar wrote:

LLCC (Last Level Cache Controller) provides additional cache memory
in the system. LLCC is partitioned into muliple slices and each
slice getting its own priority, size, ID and other config parameters.
LLCC driver programs these parameters for each slice. Clients that
are assigned to use LLCC need to get information such size & ID of the
 slice they get and activate or deactivate the slice as needed. LLCC 
driver

provides API interfaces for the clients to perform these operations.

Signed-off-by: Channagoud Kadabi 
Signed-off-by: Rishabh Bhatnagar 
---
 drivers/soc/qcom/Kconfig   |  16 ++
 drivers/soc/qcom/Makefile  |   2 +
 drivers/soc/qcom/llcc-sdm845.c | 120 ++
 drivers/soc/qcom/llcc-slice.c  | 454 
+


I'd name it just llcc.c, slice suffix didn't add any value.


 include/linux/soc/qcom/llcc-qcom.h | 178 +++
 5 files changed, 770 insertions(+)
 create mode 100644 drivers/soc/qcom/llcc-sdm845.c
 create mode 100644 drivers/soc/qcom/llcc-slice.c
 create mode 100644 include/linux/soc/qcom/llcc-qcom.h

diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index e050eb8..28237fc 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -21,6 +21,22 @@ config QCOM_GSBI
   functions for connecting the underlying serial UART, SPI, 
and I2C

   devices to the output pins.

+config QCOM_LLCC
+   tristate "Qualcomm Technologies, Inc. LLCC driver"
+   depends on ARCH_QCOM
+   help
+ Qualcomm Technologies, Inc. platform specific LLCC driver for Last
+	  Level Cache. This provides interfaces to client's that use the 
LLCC.

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

+ LLCC slices.
+
 config QCOM_MDT_LOADER
tristate
select QCOM_SCM
diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile
index dcebf28..e16d6a2 100644
--- a/drivers/soc/qcom/Makefile
+++ b/drivers/soc/qcom/Makefile
@@ -12,3 +12,5 @@ obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o
 obj-$(CONFIG_QCOM_SMP2P)   += smp2p.o
 obj-$(CONFIG_QCOM_SMSM)+= smsm.o
 obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o
+obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o
+obj-$(CONFIG_QCOM_SDM845_LLCC) += llcc-sdm845.o
diff --git a/drivers/soc/qcom/llcc-sdm845.c 
b/drivers/soc/qcom/llcc-sdm845.c

new file mode 100644
index 000..cd431d9
--- /dev/null
+++ b/drivers/soc/qcom/llcc-sdm845.c
@@ -0,0 +1,120 @@
+/* Copyright (c) 2017-2018, 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+/*
+ * 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
+ * 

Re: [PATCH v3 2/2] drivers: soc: Add LLCC driver

2018-04-02 Thread Channa

On 2018-04-02 02:11, Stanimir Varbanov wrote:

Hi,

Please adjust your mail client to drop on new line on 80 column!

On 03/29/2018 08:55 PM, Channa wrote:

On 2018-03-29 01:08, Stanimir Varbanov wrote:

Hi,

On 03/27/2018 09:52 PM, Rishabh Bhatnagar wrote:

LLCC (Last Level Cache Controller) provides additional cache memory
in the system. LLCC is partitioned into muliple slices and each
slice getting its own priority, size, ID and other config 
parameters.

LLCC driver programs these parameters for each slice. Clients that
are assigned to use LLCC need to get information such size & ID of 
the

 slice they get and activate or deactivate the slice as needed. LLCC
driver
provides API interfaces for the clients to perform these operations.

Signed-off-by: Channagoud Kadabi 
Signed-off-by: Rishabh Bhatnagar 
---
 drivers/soc/qcom/Kconfig   |  16 ++
 drivers/soc/qcom/Makefile  |   2 +
 drivers/soc/qcom/llcc-sdm845.c | 120 ++
 drivers/soc/qcom/llcc-slice.c  | 454
+


I'd name it just llcc.c, slice suffix didn't add any value.


 include/linux/soc/qcom/llcc-qcom.h | 178 +++
 5 files changed, 770 insertions(+)
 create mode 100644 drivers/soc/qcom/llcc-sdm845.c
 create mode 100644 drivers/soc/qcom/llcc-slice.c
 create mode 100644 include/linux/soc/qcom/llcc-qcom.h

diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index e050eb8..28237fc 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -21,6 +21,22 @@ config QCOM_GSBI
   functions for connecting the underlying serial UART, SPI,
and I2C
   devices to the output pins.

+config QCOM_LLCC
+    tristate "Qualcomm Technologies, Inc. LLCC driver"
+    depends on ARCH_QCOM
+    help
+  Qualcomm Technologies, Inc. platform specific LLCC driver for
Last
+  Level Cache. This provides interfaces to client's that use 
the

LLCC.
+  Say yes here to enable LLCC slice driver.
+
+config QCOM_SDM845_LLCC
+    tristate "Qualcomm Technologies, Inc. SDM845 LLCC driver"
+    depends on QCOM_LLCC
+    help
+  Say yes here to enable the LLCC driver for SDM845. This is
provides
+  data required to configure LLCC so that clients can start
using the
+  LLCC slices.
+
 config QCOM_MDT_LOADER
 tristate
 select QCOM_SCM
diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile
index dcebf28..e16d6a2 100644
--- a/drivers/soc/qcom/Makefile
+++ b/drivers/soc/qcom/Makefile
@@ -12,3 +12,5 @@ obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o
 obj-$(CONFIG_QCOM_SMP2P)    += smp2p.o
 obj-$(CONFIG_QCOM_SMSM)    += smsm.o
 obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o
+obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o
+obj-$(CONFIG_QCOM_SDM845_LLCC) += llcc-sdm845.o
diff --git a/drivers/soc/qcom/llcc-sdm845.c
b/drivers/soc/qcom/llcc-sdm845.c
new file mode 100644
index 000..cd431d9
--- /dev/null
+++ b/drivers/soc/qcom/llcc-sdm845.c
@@ -0,0 +1,120 @@
+/* Copyright (c) 2017-2018, 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+/*
+ * 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 

Re: [PATCH v3 2/2] drivers: soc: Add LLCC driver

2018-04-02 Thread Channa

On 2018-04-02 02:11, Stanimir Varbanov wrote:

Hi,

Please adjust your mail client to drop on new line on 80 column!

On 03/29/2018 08:55 PM, Channa wrote:

On 2018-03-29 01:08, Stanimir Varbanov wrote:

Hi,

On 03/27/2018 09:52 PM, Rishabh Bhatnagar wrote:

LLCC (Last Level Cache Controller) provides additional cache memory
in the system. LLCC is partitioned into muliple slices and each
slice getting its own priority, size, ID and other config 
parameters.

LLCC driver programs these parameters for each slice. Clients that
are assigned to use LLCC need to get information such size & ID of 
the

 slice they get and activate or deactivate the slice as needed. LLCC
driver
provides API interfaces for the clients to perform these operations.

Signed-off-by: Channagoud Kadabi 
Signed-off-by: Rishabh Bhatnagar 
---
 drivers/soc/qcom/Kconfig   |  16 ++
 drivers/soc/qcom/Makefile  |   2 +
 drivers/soc/qcom/llcc-sdm845.c | 120 ++
 drivers/soc/qcom/llcc-slice.c  | 454
+


I'd name it just llcc.c, slice suffix didn't add any value.


 include/linux/soc/qcom/llcc-qcom.h | 178 +++
 5 files changed, 770 insertions(+)
 create mode 100644 drivers/soc/qcom/llcc-sdm845.c
 create mode 100644 drivers/soc/qcom/llcc-slice.c
 create mode 100644 include/linux/soc/qcom/llcc-qcom.h

diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index e050eb8..28237fc 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -21,6 +21,22 @@ config QCOM_GSBI
   functions for connecting the underlying serial UART, SPI,
and I2C
   devices to the output pins.

+config QCOM_LLCC
+    tristate "Qualcomm Technologies, Inc. LLCC driver"
+    depends on ARCH_QCOM
+    help
+  Qualcomm Technologies, Inc. platform specific LLCC driver for
Last
+  Level Cache. This provides interfaces to client's that use 
the

LLCC.
+  Say yes here to enable LLCC slice driver.
+
+config QCOM_SDM845_LLCC
+    tristate "Qualcomm Technologies, Inc. SDM845 LLCC driver"
+    depends on QCOM_LLCC
+    help
+  Say yes here to enable the LLCC driver for SDM845. This is
provides
+  data required to configure LLCC so that clients can start
using the
+  LLCC slices.
+
 config QCOM_MDT_LOADER
 tristate
 select QCOM_SCM
diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile
index dcebf28..e16d6a2 100644
--- a/drivers/soc/qcom/Makefile
+++ b/drivers/soc/qcom/Makefile
@@ -12,3 +12,5 @@ obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o
 obj-$(CONFIG_QCOM_SMP2P)    += smp2p.o
 obj-$(CONFIG_QCOM_SMSM)    += smsm.o
 obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o
+obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o
+obj-$(CONFIG_QCOM_SDM845_LLCC) += llcc-sdm845.o
diff --git a/drivers/soc/qcom/llcc-sdm845.c
b/drivers/soc/qcom/llcc-sdm845.c
new file mode 100644
index 000..cd431d9
--- /dev/null
+++ b/drivers/soc/qcom/llcc-sdm845.c
@@ -0,0 +1,120 @@
+/* Copyright (c) 2017-2018, 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+/*
+ * 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
+ */

Re: [PATCH v3 2/2] drivers: soc: Add LLCC driver

2018-04-02 Thread Stanimir Varbanov
Hi,

Please adjust your mail client to drop on new line on 80 column!

On 03/29/2018 08:55 PM, Channa wrote:
> On 2018-03-29 01:08, Stanimir Varbanov wrote:
>> Hi,
>>
>> On 03/27/2018 09:52 PM, Rishabh Bhatnagar wrote:
>>> LLCC (Last Level Cache Controller) provides additional cache memory
>>> in the system. LLCC is partitioned into muliple slices and each
>>> slice getting its own priority, size, ID and other config parameters.
>>> LLCC driver programs these parameters for each slice. Clients that
>>> are assigned to use LLCC need to get information such size & ID of the
>>>  slice they get and activate or deactivate the slice as needed. LLCC
>>> driver
>>> provides API interfaces for the clients to perform these operations.
>>>
>>> Signed-off-by: Channagoud Kadabi 
>>> Signed-off-by: Rishabh Bhatnagar 
>>> ---
>>>  drivers/soc/qcom/Kconfig   |  16 ++
>>>  drivers/soc/qcom/Makefile  |   2 +
>>>  drivers/soc/qcom/llcc-sdm845.c | 120 ++
>>>  drivers/soc/qcom/llcc-slice.c  | 454
>>> +
>>
>> I'd name it just llcc.c, slice suffix didn't add any value.
>>
>>>  include/linux/soc/qcom/llcc-qcom.h | 178 +++
>>>  5 files changed, 770 insertions(+)
>>>  create mode 100644 drivers/soc/qcom/llcc-sdm845.c
>>>  create mode 100644 drivers/soc/qcom/llcc-slice.c
>>>  create mode 100644 include/linux/soc/qcom/llcc-qcom.h
>>>
>>> diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
>>> index e050eb8..28237fc 100644
>>> --- a/drivers/soc/qcom/Kconfig
>>> +++ b/drivers/soc/qcom/Kconfig
>>> @@ -21,6 +21,22 @@ config QCOM_GSBI
>>>    functions for connecting the underlying serial UART, SPI,
>>> and I2C
>>>    devices to the output pins.
>>>
>>> +config QCOM_LLCC
>>> +    tristate "Qualcomm Technologies, Inc. LLCC driver"
>>> +    depends on ARCH_QCOM
>>> +    help
>>> +  Qualcomm Technologies, Inc. platform specific LLCC driver for
>>> Last
>>> +  Level Cache. This provides interfaces to client's that use the
>>> LLCC.
>>> +  Say yes here to enable LLCC slice driver.
>>> +
>>> +config QCOM_SDM845_LLCC
>>> +    tristate "Qualcomm Technologies, Inc. SDM845 LLCC driver"
>>> +    depends on QCOM_LLCC
>>> +    help
>>> +  Say yes here to enable the LLCC driver for SDM845. This is
>>> provides
>>> +  data required to configure LLCC so that clients can start
>>> using the
>>> +  LLCC slices.
>>> +
>>>  config QCOM_MDT_LOADER
>>>  tristate
>>>  select QCOM_SCM
>>> diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile
>>> index dcebf28..e16d6a2 100644
>>> --- a/drivers/soc/qcom/Makefile
>>> +++ b/drivers/soc/qcom/Makefile
>>> @@ -12,3 +12,5 @@ obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o
>>>  obj-$(CONFIG_QCOM_SMP2P)    += smp2p.o
>>>  obj-$(CONFIG_QCOM_SMSM)    += smsm.o
>>>  obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o
>>> +obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o
>>> +obj-$(CONFIG_QCOM_SDM845_LLCC) += llcc-sdm845.o
>>> diff --git a/drivers/soc/qcom/llcc-sdm845.c
>>> b/drivers/soc/qcom/llcc-sdm845.c
>>> new file mode 100644
>>> index 000..cd431d9
>>> --- /dev/null
>>> +++ b/drivers/soc/qcom/llcc-sdm845.c
>>> @@ -0,0 +1,120 @@
>>> +/* Copyright (c) 2017-2018, 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 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +
>>> +
>>> +/*
>>> + * 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 

Re: [PATCH v3 2/2] drivers: soc: Add LLCC driver

2018-04-02 Thread Stanimir Varbanov
Hi,

Please adjust your mail client to drop on new line on 80 column!

On 03/29/2018 08:55 PM, Channa wrote:
> On 2018-03-29 01:08, Stanimir Varbanov wrote:
>> Hi,
>>
>> On 03/27/2018 09:52 PM, Rishabh Bhatnagar wrote:
>>> LLCC (Last Level Cache Controller) provides additional cache memory
>>> in the system. LLCC is partitioned into muliple slices and each
>>> slice getting its own priority, size, ID and other config parameters.
>>> LLCC driver programs these parameters for each slice. Clients that
>>> are assigned to use LLCC need to get information such size & ID of the
>>>  slice they get and activate or deactivate the slice as needed. LLCC
>>> driver
>>> provides API interfaces for the clients to perform these operations.
>>>
>>> Signed-off-by: Channagoud Kadabi 
>>> Signed-off-by: Rishabh Bhatnagar 
>>> ---
>>>  drivers/soc/qcom/Kconfig   |  16 ++
>>>  drivers/soc/qcom/Makefile  |   2 +
>>>  drivers/soc/qcom/llcc-sdm845.c | 120 ++
>>>  drivers/soc/qcom/llcc-slice.c  | 454
>>> +
>>
>> I'd name it just llcc.c, slice suffix didn't add any value.
>>
>>>  include/linux/soc/qcom/llcc-qcom.h | 178 +++
>>>  5 files changed, 770 insertions(+)
>>>  create mode 100644 drivers/soc/qcom/llcc-sdm845.c
>>>  create mode 100644 drivers/soc/qcom/llcc-slice.c
>>>  create mode 100644 include/linux/soc/qcom/llcc-qcom.h
>>>
>>> diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
>>> index e050eb8..28237fc 100644
>>> --- a/drivers/soc/qcom/Kconfig
>>> +++ b/drivers/soc/qcom/Kconfig
>>> @@ -21,6 +21,22 @@ config QCOM_GSBI
>>>    functions for connecting the underlying serial UART, SPI,
>>> and I2C
>>>    devices to the output pins.
>>>
>>> +config QCOM_LLCC
>>> +    tristate "Qualcomm Technologies, Inc. LLCC driver"
>>> +    depends on ARCH_QCOM
>>> +    help
>>> +  Qualcomm Technologies, Inc. platform specific LLCC driver for
>>> Last
>>> +  Level Cache. This provides interfaces to client's that use the
>>> LLCC.
>>> +  Say yes here to enable LLCC slice driver.
>>> +
>>> +config QCOM_SDM845_LLCC
>>> +    tristate "Qualcomm Technologies, Inc. SDM845 LLCC driver"
>>> +    depends on QCOM_LLCC
>>> +    help
>>> +  Say yes here to enable the LLCC driver for SDM845. This is
>>> provides
>>> +  data required to configure LLCC so that clients can start
>>> using the
>>> +  LLCC slices.
>>> +
>>>  config QCOM_MDT_LOADER
>>>  tristate
>>>  select QCOM_SCM
>>> diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile
>>> index dcebf28..e16d6a2 100644
>>> --- a/drivers/soc/qcom/Makefile
>>> +++ b/drivers/soc/qcom/Makefile
>>> @@ -12,3 +12,5 @@ obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o
>>>  obj-$(CONFIG_QCOM_SMP2P)    += smp2p.o
>>>  obj-$(CONFIG_QCOM_SMSM)    += smsm.o
>>>  obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o
>>> +obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o
>>> +obj-$(CONFIG_QCOM_SDM845_LLCC) += llcc-sdm845.o
>>> diff --git a/drivers/soc/qcom/llcc-sdm845.c
>>> b/drivers/soc/qcom/llcc-sdm845.c
>>> new file mode 100644
>>> index 000..cd431d9
>>> --- /dev/null
>>> +++ b/drivers/soc/qcom/llcc-sdm845.c
>>> @@ -0,0 +1,120 @@
>>> +/* Copyright (c) 2017-2018, 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 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +
>>> +
>>> +/*
>>> + * 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.

Re: [PATCH v3 2/2] drivers: soc: Add LLCC driver

2018-03-29 Thread Trilok Soni

Hi Stanimir,

+/* Get the slice entry by index */

+static struct llcc_slice_desc *llcc_slice_get_entry(struct device *dev, int n)

drop this *slice* word from function names


Please note that we are activating/de-activating  a "slice" of the LLCC 
and not a whole LLCC. "slice" makes perfect sense here since the 
granularity is at the "slice" level and not the complete LLCC.


--Trilok Soni


Re: [PATCH v3 2/2] drivers: soc: Add LLCC driver

2018-03-29 Thread Trilok Soni

Hi Stanimir,

+/* Get the slice entry by index */

+static struct llcc_slice_desc *llcc_slice_get_entry(struct device *dev, int n)

drop this *slice* word from function names


Please note that we are activating/de-activating  a "slice" of the LLCC 
and not a whole LLCC. "slice" makes perfect sense here since the 
granularity is at the "slice" level and not the complete LLCC.


--Trilok Soni


Re: [PATCH v3 2/2] drivers: soc: Add LLCC driver

2018-03-29 Thread Channa

On 2018-03-29 01:08, Stanimir Varbanov wrote:

Hi,

On 03/27/2018 09:52 PM, Rishabh Bhatnagar wrote:

LLCC (Last Level Cache Controller) provides additional cache memory
in the system. LLCC is partitioned into muliple slices and each
slice getting its own priority, size, ID and other config parameters.
LLCC driver programs these parameters for each slice. Clients that
are assigned to use LLCC need to get information such size & ID of the
 slice they get and activate or deactivate the slice as needed. LLCC 
driver

provides API interfaces for the clients to perform these operations.

Signed-off-by: Channagoud Kadabi 
Signed-off-by: Rishabh Bhatnagar 
---
 drivers/soc/qcom/Kconfig   |  16 ++
 drivers/soc/qcom/Makefile  |   2 +
 drivers/soc/qcom/llcc-sdm845.c | 120 ++
 drivers/soc/qcom/llcc-slice.c  | 454 
+


I'd name it just llcc.c, slice suffix didn't add any value.


 include/linux/soc/qcom/llcc-qcom.h | 178 +++
 5 files changed, 770 insertions(+)
 create mode 100644 drivers/soc/qcom/llcc-sdm845.c
 create mode 100644 drivers/soc/qcom/llcc-slice.c
 create mode 100644 include/linux/soc/qcom/llcc-qcom.h

diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index e050eb8..28237fc 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -21,6 +21,22 @@ config QCOM_GSBI
   functions for connecting the underlying serial UART, SPI, 
and I2C

   devices to the output pins.

+config QCOM_LLCC
+   tristate "Qualcomm Technologies, Inc. LLCC driver"
+   depends on ARCH_QCOM
+   help
+ Qualcomm Technologies, Inc. platform specific LLCC driver for Last
+	  Level Cache. This provides interfaces to client's that use the 
LLCC.

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

+ LLCC slices.
+
 config QCOM_MDT_LOADER
tristate
select QCOM_SCM
diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile
index dcebf28..e16d6a2 100644
--- a/drivers/soc/qcom/Makefile
+++ b/drivers/soc/qcom/Makefile
@@ -12,3 +12,5 @@ obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o
 obj-$(CONFIG_QCOM_SMP2P)   += smp2p.o
 obj-$(CONFIG_QCOM_SMSM)+= smsm.o
 obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o
+obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o
+obj-$(CONFIG_QCOM_SDM845_LLCC) += llcc-sdm845.o
diff --git a/drivers/soc/qcom/llcc-sdm845.c 
b/drivers/soc/qcom/llcc-sdm845.c

new file mode 100644
index 000..cd431d9
--- /dev/null
+++ b/drivers/soc/qcom/llcc-sdm845.c
@@ -0,0 +1,120 @@
+/* Copyright (c) 2017-2018, 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+/*
+ * 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, 

Re: [PATCH v3 2/2] drivers: soc: Add LLCC driver

2018-03-29 Thread Channa

On 2018-03-29 01:08, Stanimir Varbanov wrote:

Hi,

On 03/27/2018 09:52 PM, Rishabh Bhatnagar wrote:

LLCC (Last Level Cache Controller) provides additional cache memory
in the system. LLCC is partitioned into muliple slices and each
slice getting its own priority, size, ID and other config parameters.
LLCC driver programs these parameters for each slice. Clients that
are assigned to use LLCC need to get information such size & ID of the
 slice they get and activate or deactivate the slice as needed. LLCC 
driver

provides API interfaces for the clients to perform these operations.

Signed-off-by: Channagoud Kadabi 
Signed-off-by: Rishabh Bhatnagar 
---
 drivers/soc/qcom/Kconfig   |  16 ++
 drivers/soc/qcom/Makefile  |   2 +
 drivers/soc/qcom/llcc-sdm845.c | 120 ++
 drivers/soc/qcom/llcc-slice.c  | 454 
+


I'd name it just llcc.c, slice suffix didn't add any value.


 include/linux/soc/qcom/llcc-qcom.h | 178 +++
 5 files changed, 770 insertions(+)
 create mode 100644 drivers/soc/qcom/llcc-sdm845.c
 create mode 100644 drivers/soc/qcom/llcc-slice.c
 create mode 100644 include/linux/soc/qcom/llcc-qcom.h

diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index e050eb8..28237fc 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -21,6 +21,22 @@ config QCOM_GSBI
   functions for connecting the underlying serial UART, SPI, 
and I2C

   devices to the output pins.

+config QCOM_LLCC
+   tristate "Qualcomm Technologies, Inc. LLCC driver"
+   depends on ARCH_QCOM
+   help
+ Qualcomm Technologies, Inc. platform specific LLCC driver for Last
+	  Level Cache. This provides interfaces to client's that use the 
LLCC.

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

+ LLCC slices.
+
 config QCOM_MDT_LOADER
tristate
select QCOM_SCM
diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile
index dcebf28..e16d6a2 100644
--- a/drivers/soc/qcom/Makefile
+++ b/drivers/soc/qcom/Makefile
@@ -12,3 +12,5 @@ obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o
 obj-$(CONFIG_QCOM_SMP2P)   += smp2p.o
 obj-$(CONFIG_QCOM_SMSM)+= smsm.o
 obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o
+obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o
+obj-$(CONFIG_QCOM_SDM845_LLCC) += llcc-sdm845.o
diff --git a/drivers/soc/qcom/llcc-sdm845.c 
b/drivers/soc/qcom/llcc-sdm845.c

new file mode 100644
index 000..cd431d9
--- /dev/null
+++ b/drivers/soc/qcom/llcc-sdm845.c
@@ -0,0 +1,120 @@
+/* Copyright (c) 2017-2018, 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+/*
+ * 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) \

+   {

Re: [PATCH v3 2/2] drivers: soc: Add LLCC driver

2018-03-29 Thread Stanimir Varbanov
Hi,

On 03/27/2018 09:52 PM, Rishabh Bhatnagar wrote:
> LLCC (Last Level Cache Controller) provides additional cache memory
> in the system. LLCC is partitioned into muliple slices and each
> slice getting its own priority, size, ID and other config parameters.
> LLCC driver programs these parameters for each slice. Clients that
> are assigned to use LLCC need to get information such size & ID of the
>  slice they get and activate or deactivate the slice as needed. LLCC driver
> provides API interfaces for the clients to perform these operations.
> 
> Signed-off-by: Channagoud Kadabi 
> Signed-off-by: Rishabh Bhatnagar 
> ---
>  drivers/soc/qcom/Kconfig   |  16 ++
>  drivers/soc/qcom/Makefile  |   2 +
>  drivers/soc/qcom/llcc-sdm845.c | 120 ++
>  drivers/soc/qcom/llcc-slice.c  | 454 
> +

I'd name it just llcc.c, slice suffix didn't add any value.

>  include/linux/soc/qcom/llcc-qcom.h | 178 +++
>  5 files changed, 770 insertions(+)
>  create mode 100644 drivers/soc/qcom/llcc-sdm845.c
>  create mode 100644 drivers/soc/qcom/llcc-slice.c
>  create mode 100644 include/linux/soc/qcom/llcc-qcom.h
> 
> diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
> index e050eb8..28237fc 100644
> --- a/drivers/soc/qcom/Kconfig
> +++ b/drivers/soc/qcom/Kconfig
> @@ -21,6 +21,22 @@ config QCOM_GSBI
>functions for connecting the underlying serial UART, SPI, and I2C
>devices to the output pins.
> 
> +config QCOM_LLCC
> + tristate "Qualcomm Technologies, Inc. LLCC driver"
> + depends on ARCH_QCOM
> + help
> +   Qualcomm Technologies, Inc. platform specific LLCC driver for Last
> +   Level Cache. This provides interfaces to client's that use the LLCC.
> +   Say yes here to enable LLCC slice driver.
> +
> +config QCOM_SDM845_LLCC
> + tristate "Qualcomm Technologies, Inc. SDM845 LLCC driver"
> + depends on QCOM_LLCC
> + help
> +   Say yes here to enable the LLCC driver for SDM845. This is provides
> +   data required to configure LLCC so that clients can start using the
> +   LLCC slices.
> +
>  config QCOM_MDT_LOADER
>   tristate
>   select QCOM_SCM
> diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile
> index dcebf28..e16d6a2 100644
> --- a/drivers/soc/qcom/Makefile
> +++ b/drivers/soc/qcom/Makefile
> @@ -12,3 +12,5 @@ obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o
>  obj-$(CONFIG_QCOM_SMP2P) += smp2p.o
>  obj-$(CONFIG_QCOM_SMSM)  += smsm.o
>  obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o
> +obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o
> +obj-$(CONFIG_QCOM_SDM845_LLCC) += llcc-sdm845.o
> diff --git a/drivers/soc/qcom/llcc-sdm845.c b/drivers/soc/qcom/llcc-sdm845.c
> new file mode 100644
> index 000..cd431d9
> --- /dev/null
> +++ b/drivers/soc/qcom/llcc-sdm845.c
> @@ -0,0 +1,120 @@
> +/* Copyright (c) 2017-2018, 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 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +
> +/*
> + * 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: 

Re: [PATCH v3 2/2] drivers: soc: Add LLCC driver

2018-03-29 Thread Stanimir Varbanov
Hi,

On 03/27/2018 09:52 PM, Rishabh Bhatnagar wrote:
> LLCC (Last Level Cache Controller) provides additional cache memory
> in the system. LLCC is partitioned into muliple slices and each
> slice getting its own priority, size, ID and other config parameters.
> LLCC driver programs these parameters for each slice. Clients that
> are assigned to use LLCC need to get information such size & ID of the
>  slice they get and activate or deactivate the slice as needed. LLCC driver
> provides API interfaces for the clients to perform these operations.
> 
> Signed-off-by: Channagoud Kadabi 
> Signed-off-by: Rishabh Bhatnagar 
> ---
>  drivers/soc/qcom/Kconfig   |  16 ++
>  drivers/soc/qcom/Makefile  |   2 +
>  drivers/soc/qcom/llcc-sdm845.c | 120 ++
>  drivers/soc/qcom/llcc-slice.c  | 454 
> +

I'd name it just llcc.c, slice suffix didn't add any value.

>  include/linux/soc/qcom/llcc-qcom.h | 178 +++
>  5 files changed, 770 insertions(+)
>  create mode 100644 drivers/soc/qcom/llcc-sdm845.c
>  create mode 100644 drivers/soc/qcom/llcc-slice.c
>  create mode 100644 include/linux/soc/qcom/llcc-qcom.h
> 
> diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
> index e050eb8..28237fc 100644
> --- a/drivers/soc/qcom/Kconfig
> +++ b/drivers/soc/qcom/Kconfig
> @@ -21,6 +21,22 @@ config QCOM_GSBI
>functions for connecting the underlying serial UART, SPI, and I2C
>devices to the output pins.
> 
> +config QCOM_LLCC
> + tristate "Qualcomm Technologies, Inc. LLCC driver"
> + depends on ARCH_QCOM
> + help
> +   Qualcomm Technologies, Inc. platform specific LLCC driver for Last
> +   Level Cache. This provides interfaces to client's that use the LLCC.
> +   Say yes here to enable LLCC slice driver.
> +
> +config QCOM_SDM845_LLCC
> + tristate "Qualcomm Technologies, Inc. SDM845 LLCC driver"
> + depends on QCOM_LLCC
> + help
> +   Say yes here to enable the LLCC driver for SDM845. This is provides
> +   data required to configure LLCC so that clients can start using the
> +   LLCC slices.
> +
>  config QCOM_MDT_LOADER
>   tristate
>   select QCOM_SCM
> diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile
> index dcebf28..e16d6a2 100644
> --- a/drivers/soc/qcom/Makefile
> +++ b/drivers/soc/qcom/Makefile
> @@ -12,3 +12,5 @@ obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o
>  obj-$(CONFIG_QCOM_SMP2P) += smp2p.o
>  obj-$(CONFIG_QCOM_SMSM)  += smsm.o
>  obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o
> +obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o
> +obj-$(CONFIG_QCOM_SDM845_LLCC) += llcc-sdm845.o
> diff --git a/drivers/soc/qcom/llcc-sdm845.c b/drivers/soc/qcom/llcc-sdm845.c
> new file mode 100644
> index 000..cd431d9
> --- /dev/null
> +++ b/drivers/soc/qcom/llcc-sdm845.c
> @@ -0,0 +1,120 @@
> +/* Copyright (c) 2017-2018, 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 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +
> +/*
> + * 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 

Re: [PATCH v3 2/2] drivers: soc: Add LLCC driver

2018-03-28 Thread Evan Green
Hi Rishabh,

On Tue, Mar 27, 2018 at 11:54 AM Rishabh Bhatnagar 
wrote:

> LLCC (Last Level Cache Controller) provides additional cache memory
> in the system. LLCC is partitioned into muliple slices and each
> slice getting its own priority, size, ID and other config parameters.
> LLCC driver programs these parameters for each slice. Clients that
> are assigned to use LLCC need to get information such size & ID of the
>slice they get and activate or deactivate the slice as needed. LLCC
driver
> provides API interfaces for the clients to perform these operations.

> Signed-off-by: Channagoud Kadabi 
> Signed-off-by: Rishabh Bhatnagar 
> ---
>drivers/soc/qcom/Kconfig   |  16 ++
>drivers/soc/qcom/Makefile  |   2 +
>drivers/soc/qcom/llcc-sdm845.c | 120 ++
>drivers/soc/qcom/llcc-slice.c  | 454
+
>include/linux/soc/qcom/llcc-qcom.h | 178 +++
>5 files changed, 770 insertions(+)
>create mode 100644 drivers/soc/qcom/llcc-sdm845.c
>create mode 100644 drivers/soc/qcom/llcc-slice.c
>create mode 100644 include/linux/soc/qcom/llcc-qcom.h

> diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
> index e050eb8..28237fc 100644
> --- a/drivers/soc/qcom/Kconfig
> +++ b/drivers/soc/qcom/Kconfig
> @@ -21,6 +21,22 @@ config QCOM_GSBI
>  functions for connecting the underlying serial UART, SPI, and
I2C
>  devices to the output pins.

> +config QCOM_LLCC
> +   tristate "Qualcomm Technologies, Inc. LLCC driver"
> +   depends on ARCH_QCOM
> +   help
> + Qualcomm Technologies, Inc. platform specific LLCC driver for
Last
> + Level Cache. This provides interfaces to client's that use the
LLCC.
> + Say yes here to enable LLCC slice driver.

It would be nice if the acronym decoding of Last Level Cache Controller
were actually spelled out here. You almost do it, but never quite
get the CC part.

> +
> +config QCOM_SDM845_LLCC
> +   tristate "Qualcomm Technologies, Inc. SDM845 LLCC driver"
> +   depends on QCOM_LLCC
> +   help
> + Say yes here to enable the LLCC driver for SDM845. This is
provides

s/is provides/provides/

> + data required to configure LLCC so that clients can start using
the
> + LLCC slices.
> +
>config QCOM_MDT_LOADER
>   tristate
>   select QCOM_SCM
> diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile
> index dcebf28..e16d6a2 100644
> --- a/drivers/soc/qcom/Makefile
> +++ b/drivers/soc/qcom/Makefile
> @@ -12,3 +12,5 @@ obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o
>obj-$(CONFIG_QCOM_SMP2P)   += smp2p.o
>obj-$(CONFIG_QCOM_SMSM)+= smsm.o
>obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o
> +obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o
> +obj-$(CONFIG_QCOM_SDM845_LLCC) += llcc-sdm845.o
> diff --git a/drivers/soc/qcom/llcc-sdm845.c
b/drivers/soc/qcom/llcc-sdm845.c
> new file mode 100644
> index 000..cd431d9
> --- /dev/null
> +++ b/drivers/soc/qcom/llcc-sdm845.c
> @@ -0,0 +1,120 @@
> +/* Copyright (c) 2017-2018, 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 

Remove this, it's unused.

> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 

Remove.

> +#include 

Remove.

> +
> +
> +/*
> + * SCT entry contains of the following parameters

What does SCT stand for? Slender cat tree. Can you spell that out somewhere?

> + * 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

priority and fixed_size are out of order.

> + * fixed_size: Determine of the slice has a fixed capacity

s/Determine of/Determines if/

> + * bonus_ways: Bonus ways to be used by any slice, bonus way is used
only if
> + * it't not a reserved way.

it't. Might be more clear as "Bonus ways to be used by any slice, used only
if no reserved ways are available" (assuming that statement is correct?)

> + * 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 

Re: [PATCH v3 2/2] drivers: soc: Add LLCC driver

2018-03-28 Thread Evan Green
Hi Rishabh,

On Tue, Mar 27, 2018 at 11:54 AM Rishabh Bhatnagar 
wrote:

> LLCC (Last Level Cache Controller) provides additional cache memory
> in the system. LLCC is partitioned into muliple slices and each
> slice getting its own priority, size, ID and other config parameters.
> LLCC driver programs these parameters for each slice. Clients that
> are assigned to use LLCC need to get information such size & ID of the
>slice they get and activate or deactivate the slice as needed. LLCC
driver
> provides API interfaces for the clients to perform these operations.

> Signed-off-by: Channagoud Kadabi 
> Signed-off-by: Rishabh Bhatnagar 
> ---
>drivers/soc/qcom/Kconfig   |  16 ++
>drivers/soc/qcom/Makefile  |   2 +
>drivers/soc/qcom/llcc-sdm845.c | 120 ++
>drivers/soc/qcom/llcc-slice.c  | 454
+
>include/linux/soc/qcom/llcc-qcom.h | 178 +++
>5 files changed, 770 insertions(+)
>create mode 100644 drivers/soc/qcom/llcc-sdm845.c
>create mode 100644 drivers/soc/qcom/llcc-slice.c
>create mode 100644 include/linux/soc/qcom/llcc-qcom.h

> diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
> index e050eb8..28237fc 100644
> --- a/drivers/soc/qcom/Kconfig
> +++ b/drivers/soc/qcom/Kconfig
> @@ -21,6 +21,22 @@ config QCOM_GSBI
>  functions for connecting the underlying serial UART, SPI, and
I2C
>  devices to the output pins.

> +config QCOM_LLCC
> +   tristate "Qualcomm Technologies, Inc. LLCC driver"
> +   depends on ARCH_QCOM
> +   help
> + Qualcomm Technologies, Inc. platform specific LLCC driver for
Last
> + Level Cache. This provides interfaces to client's that use the
LLCC.
> + Say yes here to enable LLCC slice driver.

It would be nice if the acronym decoding of Last Level Cache Controller
were actually spelled out here. You almost do it, but never quite
get the CC part.

> +
> +config QCOM_SDM845_LLCC
> +   tristate "Qualcomm Technologies, Inc. SDM845 LLCC driver"
> +   depends on QCOM_LLCC
> +   help
> + Say yes here to enable the LLCC driver for SDM845. This is
provides

s/is provides/provides/

> + data required to configure LLCC so that clients can start using
the
> + LLCC slices.
> +
>config QCOM_MDT_LOADER
>   tristate
>   select QCOM_SCM
> diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile
> index dcebf28..e16d6a2 100644
> --- a/drivers/soc/qcom/Makefile
> +++ b/drivers/soc/qcom/Makefile
> @@ -12,3 +12,5 @@ obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o
>obj-$(CONFIG_QCOM_SMP2P)   += smp2p.o
>obj-$(CONFIG_QCOM_SMSM)+= smsm.o
>obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o
> +obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o
> +obj-$(CONFIG_QCOM_SDM845_LLCC) += llcc-sdm845.o
> diff --git a/drivers/soc/qcom/llcc-sdm845.c
b/drivers/soc/qcom/llcc-sdm845.c
> new file mode 100644
> index 000..cd431d9
> --- /dev/null
> +++ b/drivers/soc/qcom/llcc-sdm845.c
> @@ -0,0 +1,120 @@
> +/* Copyright (c) 2017-2018, 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 

Remove this, it's unused.

> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 

Remove.

> +#include 

Remove.

> +
> +
> +/*
> + * SCT entry contains of the following parameters

What does SCT stand for? Slender cat tree. Can you spell that out somewhere?

> + * 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

priority and fixed_size are out of order.

> + * fixed_size: Determine of the slice has a fixed capacity

s/Determine of/Determines if/

> + * bonus_ways: Bonus ways to be used by any slice, bonus way is used
only if
> + * it't not a reserved way.

it't. Might be more clear as "Bonus ways to be used by any slice, used only
if no reserved ways are available" (assuming that statement is correct?)

> + * 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

slice: normal or