SDM845 System Cache Driver
cover SDM845 System Cache Driver
This series implements system cache or LLCC(Last Level Cache Controller) driver for SDM845 SOC. The purpose of the driver is to partition the system cache and program the settings such as priortiy, lines to probe while doing a look up in the system cache, low power related settings etc. The partitions are called cache slices. Each cache slice is associated with size and SCID (System Cache ID) The driver also provides API for clients to query the cache slice details, activate and deactivate them.
System cache has other blocks for memory error detection and AMON (Activity Monitor) for lock up detection.
Since the hardware block has multiple functional units the driver is implemented to use syscon/regmap interface. The driver can be broadly classified into:
- Core driver: llcc-core.c: This driver initializes the syscon, does common settings required to enable interrupts and error handling features.
- SOC specific driver: llcc-sdm845.c: Cache partitioning and cache slice properties for usecases on sdm845 that need to use system cache.
- API : llcc-slice.c: Exports APIs to clients to query cache slice details, activate and deactivate cache slices.
Channagoud Kadabi (2):
dt-bindings: Documentation for qcom,llcc
drivers: soc: Add LLCC driver
.../devicetree/bindings/arm/msm/qcom,llcc.txt | 93 +++++ drivers/soc/qcom/Kconfig | 16 + drivers/soc/qcom/Makefile | 2 + drivers/soc/qcom/llcc-core.c | 120 ++++++ drivers/soc/qcom/llcc-sdm845.c | 102 +++++ drivers/soc/qcom/llcc-slice.c | 456 +++++++++++++++++++++ include/linux/soc/qcom/llcc-qcom.h | 152 +++++++ 7 files changed, 941 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt create mode 100644 drivers/soc/qcom/llcc-core.c 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
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH 1/2 dt-bindings: Documentation for qcom,llcc
Documentation for last level cache controller device tree bindings, client bindings usage examples.
--- .../devicetree/bindings/arm/msm/qcom,llcc.txt | 93 ++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +93 -0
@@ -0,0 +1,93 @@ +* LLCC (Last Level Cache Controller) + +Properties: +- compatible: + Usage: required + Value type: <string> + Definition: must be "qcom,llcc-core" + +- reg: + Usage: required + Value Type: <prop-encoded-array> + Definition: must be addresses and sizes of the LLCC registers + +- 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> + Definition: Number of cache cells, must be 1 + +- max-slices: + usage: required + Value Type: <u32> + Definition: Number of cache slices supported by hardware + +- status: + Usage: optional + Value type: <string> + Definition: Property to enable or disable the driver + +== llcc amon device == + +Properties: +-qcom,fg-cnt : The value of fine grained counter of activity monitor + block. + +compatible devices: + qcom,sdm845-llcc + +Example: + + qcom,system-cache at 1300000 { + compatible = "qcom,llcc-core", "syscon", "simple-mfd"; + reg = <0x1300000 0x50000>; + reg-names = "llcc_base"; + + llcc: qcom,sdm845-llcc { + compatible = "qcom,sdm845-llcc"; + #cache-cells = <1>; + max-slices = <32>; + }; + + qcom,llcc-ecc { + compatible = "qcom,llcc-ecc"; + }; + + qcom,llcc-amon { + compatible = "qcom,llcc-amon"; + qcom,fg-cnt = <0x7>; + }; + + }; + +== Client == + +Properties: +- cache-slice-names: + Usage: required + Value type: <stringlist> + Definition: A set of names that identify the usecase names of a client that uses + cache slice. These strings are used to look up the cache slice + entries by name. + +- cache-slices: + Usage: required + Value type: <prop-encoded-array> + Definition: The tuple has phandle to llcc device as the first argument and the + second argument is the usecase id of the client. +For example: + + video-decoder-encoder { + cache-slice-names = "vidsc0", "vidsc1"; + cache-slices = <&llcc 2>, <&llcc 3>; + };
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH 2/2 drivers: soc: Add LLCC driver
In reply to Channagoud KadabiLLCC (Last Level Cache Controller) provides additional cache memory in the system. LLCC is partitioned into muliple slices and each slice gets 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 for their usecase and activate or deactivate the slice as needed. LLCC driver provides API interfaces for the clients to perform these operations.
--- drivers/soc/qcom/Kconfig | 16 ++ drivers/soc/qcom/Makefile | 2 + drivers/soc/qcom/llcc-core.c | 120 ++++++++++ drivers/soc/qcom/llcc-sdm845.c | 102 +++++++++ drivers/soc/qcom/llcc-slice.c | 456 +++++++++++++++++++++++++++++++++++++ include/linux/soc/qcom/llcc-qcom.h | 152 +++++++++++++ 6 files changed, 848 insertions(+) create mode 100644 drivers/soc/qcom/llcc-core.c 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
drivers/soc/qcom/Kconfig +16 -0
@@ -89,6 +89,22 @@ config QCOM_SMSM Say yes here to support the Qualcomm Shared Memory State Machine. The state machine is represented by bits in shared memory. +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_WCNSS_CTRL tristate "Qualcomm WCNSS control driver" depends on ARCH_QCOM
drivers/soc/qcom/Makefile +2 -0
@@ -1,5 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_QCOM_GLINK_SSR) += glink_ssr.o +obj-$(CONFIG_QCOM_LLCC) += llcc-core.o llcc-slice.o +obj-$(CONFIG_QCOM_SDM845_LLCC) += llcc-sdm845.o obj-$(CONFIG_QCOM_GSBI) += qcom_gsbi.o obj-$(CONFIG_QCOM_MDT_LOADER) += mdt_loader.o obj-$(CONFIG_QCOM_PM) += spm.o
drivers/soc/qcom/llcc-core.c new file +120 -0
120 lines not on this page · raw message
drivers/soc/qcom/llcc-sdm845.c new file +102 -0
102 lines not on this page · raw message
drivers/soc/qcom/llcc-slice.c new file +456 -0
456 lines not on this page · raw message
include/linux/soc/qcom/llcc-qcom.h new file +152 -0
152 lines not on this page · raw message
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH 1/2] dt-bindings: Documentation for qcom,llcc
In reply to Channagoud KadabiQuoted 28 lines · Channagoud Kadabi
Documentation for last level cache controller device tree bindings, client bindings usage examples.
Signed-off-by Channagoud Kadabi <[email protected]>--- .../devicetree/bindings/arm/msm/qcom,llcc.txt | 93 ++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,llcc.txtDocumentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +13
-0@@ -0,0 +1,93 @@ +* LLCC (Last Level Cache Controller) + +Properties: +- compatible: + Usage: required + Value type: <string> + Definition: must be "qcom,llcc-core" + +- reg: + Usage: required + Value Type: <prop-encoded-array> + Definition: must be addresses and sizes of the LLCC registers +
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 23
Quoted 10 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +10
-0+- 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.
Please could we use "offset" rather than "off" for both of these? That way it's obvious these aren't properties for disabling some feature.
How variable are these offsets in practice? Is the memory map not fixed?
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 28
Quoted 5 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +5
-0+ +- #cache-cells: + Usage: required + Value Type: <u32> + Definition: Number of cache cells, must be 1
What's this for, and how is it used?
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 38
Quoted 10 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +10
-0+ +- max-slices: + usage: required + Value Type: <u32> + Definition: Number of cache slices supported by hardware + +- status: + Usage: optional + Value type: <string> + Definition: Property to enable or disable the driver
This is a standard property, so I don't think it needs to be described here.
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 44
Quoted 6 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +6
-0+ +== llcc amon device == + +Properties: +-qcom,fg-cnt : The value of fine grained counter of activity monitor + block.
Could you elaborate on this?
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 47
Quoted 3 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +3
-0+ +compatible devices: + qcom,sdm845-llcc
Huh? The "qcom,sdm845-llcc" bindings wasn't described above, and it's not clear what this means.
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 52
Quoted 5 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +5
-0+ +Example: + + qcom,system-cache at 1300000 { + compatible = "qcom,llcc-core", "syscon", "simple-mfd";
This looks very wrong. Why do you need syscon and simple-mfd?
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 57
Quoted 5 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +5
-0+ reg = <0x1300000 0x50000>; + reg-names = "llcc_base"; + + llcc: qcom,sdm845-llcc { + compatible = "qcom,sdm845-llcc";
Why is this a sub-node?
Why isn't the top-level node just "qcom,sdm845-llcc" ?
Quoted 20 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +20
-0+ #cache-cells = <1>; + max-slices = <32>; + }; + + qcom,llcc-ecc { + compatible = "qcom,llcc-ecc"; + }; + + qcom,llcc-amon { + compatible = "qcom,llcc-amon"; + qcom,fg-cnt = <0x7>; + }; + + }; + +== Client == + +Properties: +- cache-slice-names: + Usage: required
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 87
Quoted 10 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +10
-0+ Value type: <stringlist> + Definition: A set of names that identify the usecase names of a client that uses + cache slice. These strings are used to look up the cache slice + entries by name. + +- cache-slices: + Usage: required + Value type: <prop-encoded-array> + Definition: The tuple has phandle to llcc device as the first argument and the + second argument is the usecase id of the client.
What is a "usecase id" ?
Is this meant to align with #cache-cells? It would be best to keep a common prefix (i.e. call that #cache-slice-cells).
Thanks,
Mark.
Re: [PATCH 1/2] dt-bindings: Documentation for qcom,llcc
In reply to Channagoud KadabiQuoted 22 lines · Channagoud Kadabi
Documentation for last level cache controller device tree bindings, client bindings usage examples.
Signed-off-by Channagoud Kadabi <[email protected]>--- .../devicetree/bindings/arm/msm/qcom,llcc.txt | 93 ++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,llcc.txtDocumentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +13
-0+Example: + + qcom,system-cache at 1300000 { + compatible = "qcom,llcc-core", "syscon", "simple-mfd"; + reg = <0x1300000 0x50000>; + reg-names = "llcc_base"; + + llcc: qcom,sdm845-llcc { + compatible = "qcom,sdm845-llcc"; + #cache-cells = <1>; + max-slices = <32>; + }; +
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 71
Quoted 10 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +10
-0+ qcom,llcc-ecc { + compatible = "qcom,llcc-ecc"; + }; + + qcom,llcc-amon { + compatible = "qcom,llcc-amon"; + qcom,fg-cnt = <0x7>; + }; + + };
The "qcom,llcc-ecc" and "qcom,llcc-amon" bindings doesn't seem to be used by the driver in patch 2, and it's not clear how they are intended to be used, so I think they should go from the binding for now.
I don't think you need syscon and simple-mfd, and I think you can simplify the binding to a single node like:
qcom,system-cache at 1300000 {
compatible = "qcom,sdm845-llcc";
reg = <0x1300000 0x50000>;
#cache-slice-cells = <1>;
max-slices = <32>;
}If ECC and AMON are option features, we can always add boolean properties for those later, e.g. "has-ecc".
Thanks,
Mark.
Re: [PATCH 1/2] dt-bindings: Documentation for qcom,llcc
In reply to Mark RutlandQuoted 47 lines · Mark Rutland
Quoted 36 lines · Channagoud Kadabi
Documentation for last level cache controller device tree bindings, client bindings usage examples.
Signed-off-by Channagoud Kadabi <[email protected]>--- .../devicetree/bindings/arm/msm/qcom,llcc.txt | 93 ++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txtDocumentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +17
-0@@ -0,0 +1,93 @@ +* LLCC (Last Level Cache Controller) + +Properties: +- compatible: + Usage: required + Value type: <string> + Definition: must be "qcom,llcc-core" + +- reg: + Usage: required + Value Type: <prop-encoded-array> + Definition: must be addresses and sizes of the LLCC registers + +- llcc-bank-off: + Usage: required + Value Type: <u32 array> + Definition: Offsets of llcc banks from llcc base address startingfrom
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 23
Quoted 6 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +6
-0+ LLCC bank0. + +- llcc-broadcast-off: + Usage: required + Value Type: <u32> + Definition: Offset of broadcast register from LLCC bank0 address.Please could we use "offset" rather than "off" for both of these? That way it's obvious these aren't properties for disabling some feature.
Quoted 2 lines
How variable are these offsets in practice? Is the memory map not fixed?
The offsets depends on the number of LLCC HW blocks. These number of HW blocks vary from
chipset to chipset and new registers could be added that changes the offset.
Quoted 8 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 28
Quoted 6 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +5
-0+ +- #cache-cells: + Usage: required + Value Type: <u32> + Definition: Number of cache cells, must be 1What's this for, and how is it used?
This is to obtain the phandle arguments from client devices. Related to cache-slices property.
Quoted 14 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 38
Quoted 11 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +10
-0+ +- max-slices: + usage: required + Value Type: <u32> + Definition: Number of cache slices supported by hardware + +- status: + Usage: optional + Value type: <string> + Definition: Property to enable or disable the driverThis is a standard property, so I don't think it needs to be described here.
Sure, will remove it.
Quoted 9 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 44
Quoted 7 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +6
-0+ +== llcc amon device == + +Properties: +-qcom,fg-cnt : The value of fine grained counter of activity monitor + block.Could you elaborate on this?
This is counter value programmed in the HW to detect live locks. This parameter is tunable to avoid false positives.
Quoted 8 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 47
Quoted 4 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +3
-0+ +compatible devices: + qcom,sdm845-llccHuh? The "qcom,sdm845-llcc" bindings wasn't described above, and it's not clear what this means.
Quoted 7 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 52
Quoted 5 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +5
-0+ +Example: + + qcom,system-cache at 1300000 { + compatible = "qcom,llcc-core", "syscon", "simple-mfd";This looks very wrong. Why do you need syscon and simple-mfd?
LLCC HW block has 3 functionalities:
System cache core, ECC & AMON drivers for debugging.
All three drivers use the same register space for configuration, status etc.
In order to avoid remapping the same address region across multiple drivers,
I have implemented this driver as a syncon and simple-mfd.
Quoted 8 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 57
Quoted 6 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +5
-0+ reg = <0x1300000 0x50000>; + reg-names = "llcc_base"; + + llcc: qcom,sdm845-llcc { + compatible = "qcom,sdm845-llcc";Why is this a sub-node?
qcom,sdm845-llcc: This core driver as mentioned in the list above.
Quoted 10 lines
Why isn't the top-level node just "qcom,sdm845-llcc" ?
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 64
Quoted 7 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +7
-0+ #cache-cells = <1>; + max-slices = <32>; + }; + + qcom,llcc-ecc { + compatible = "qcom,llcc-ecc"; + };
qcom,llcc-ecc: Driver #2 for ECC
Quoted 6 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 70
Quoted 6 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +6
-0+ + qcom,llcc-amon { + compatible = "qcom,llcc-amon"; + qcom,fg-cnt = <0x7>; + }; +
qcom,llcc-amon: Driver #3 for AMON
Quoted 13 lines
Quoted 13 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +9
-0+ }; + +== Client == + +Properties: +- cache-slice-names: + Usage: required + Value type: <stringlist> + Definition: A set of names that identify the usecase names of aclient that uses
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +3
-0+ cache slice. These strings are used to look up the cache slice + entries by name. +
Quoted 8 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 87
Quoted 6 lines
+- cache-slices:
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +3
-0+ Usage: required + Value type: <prop-encoded-array> + Definition: The tuple has phandle to llcc device as the firstargument and the
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +1
-0+ second argument is the usecase id of the client.What is a "usecase id" ?
Usecase id for use case that wants to use system cache for eg:
video-encode and video-decode
Quoted 3 lines
Is this meant to align with #cache-cells? It would be best to keep a common prefix (i.e. call that #cache-slice-cells).
Yes. Will update the name.
Quoted 3 lines
Thanks,
Mark.
Signature · 4 lines
-- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH 1/2] dt-bindings: Documentation for qcom,llcc
In reply to Mark RutlandQuoted 31 lines · Mark Rutland
Quoted 30 lines · Channagoud Kadabi
Documentation for last level cache controller device tree bindings, client bindings usage examples.
Signed-off-by Channagoud Kadabi <[email protected]>--- .../devicetree/bindings/arm/msm/qcom,llcc.txt | 93 ++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txtDocumentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +19
-0+Example: + + qcom,system-cache at 1300000 { + compatible = "qcom,llcc-core", "syscon", "simple-mfd"; + reg = <0x1300000 0x50000>; + reg-names = "llcc_base"; + + llcc: qcom,sdm845-llcc { + compatible = "qcom,sdm845-llcc"; + #cache-cells = <1>; + max-slices = <32>; + }; + + qcom,llcc-ecc { + compatible = "qcom,llcc-ecc"; + }; + + qcom,llcc-amon { + compatible = "qcom,llcc-amon";
Quoted 8 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 71
Quoted 4 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +4
-0+ qcom,fg-cnt = <0x7>; + }; + + };The "qcom,llcc-ecc" and "qcom,llcc-amon" bindings doesn't seem to be used by the driver in patch 2, and it's not clear how they are intended to be used, so I think they should go from the binding for now.
Sure I can remove them for now and add them when the I push other drivers
for review.
Quoted 2 lines
I don't think you need syscon and simple-mfd, and I think you can
I used syscon and simple-mfd because three drivers touch the same address space.
Driver 1:
system cache core: The purpose of the driver is to partition the system cache
and program the settings such as priority, lines to probe while doing a look up
in the system cache, low power related settings etc.
The driver also provides API for clients to query the cache slice details,
activate and deactivate them.
Driver 2:
ECC to detect single and double bit errors in LLCC memory. Implemented using EDAC framework.
Driver 3:
AMON: Activity Monitor to detect live lock ups in the HW block. Implemented as SOC driver similar to driver #1.
Since the hardware block has multiple functional units the driver is implemented
to use syscon/regmap interface.
Quoted 14 lines
simplify the binding to a single node like:
qcom,system-cache at 1300000 { compatible = "qcom,sdm845-llcc"; reg = <0x1300000 0x50000>; #cache-slice-cells = <1>; max-slices = <32>; }If ECC and AMON are option features, we can always add boolean properties for those later, e.g. "has-ecc".
Thanks,
Mark.
Signature · 4 lines
-- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH 1/2] dt-bindings: Documentation for qcom,llcc
In reply to ChannaQuoted 48 lines · Channa
Quoted 47 lines · Mark Rutland
Quoted 36 lines · Channagoud Kadabi
Documentation for last level cache controller device tree bindings, client bindings usage examples.
Signed-off-by Channagoud Kadabi <[email protected]>--- .../devicetree/bindings/arm/msm/qcom,llcc.txt | 93 ++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txtDocumentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +17
-0@@ -0,0 +1,93 @@ +* LLCC (Last Level Cache Controller) + +Properties: +- compatible: + Usage: required + Value type: <string> + Definition: must be "qcom,llcc-core" + +- reg: + Usage: required + Value Type: <prop-encoded-array> + Definition: must be addresses and sizes of the LLCC registers + +- llcc-bank-off: + Usage: required + Value Type: <u32 array> + Definition: Offsets of llcc banks from llcc base address startingfrom
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 23
Quoted 6 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +6
-0+ LLCC bank0. + +- llcc-broadcast-off: + Usage: required + Value Type: <u32> + Definition: Offset of broadcast register from LLCC bank0 address.Please could we use "offset" rather than "off" for both of these? That way it's obvious these aren't properties for disabling some feature.
Quoted 5 lines
Quoted 1 line
How variable are these offsets in practice? Is the memory map not fixed?
The offsets depends on the number of LLCC HW blocks. These number of HW blocks vary from
chipset to chipset and new registers could be added that changes the offset.
Surely if new registers are added, we need a new compatible string?
Can't we encode the number of LLCC HW blocks, instead? Presumably that would give enough information to cover both llcc-bank-off and llcc-broadcast-off.
[...]
Quoted 15 lines
Quoted 7 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 47
Quoted 3 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +3
-0+ +compatible devices: + qcom,sdm845-llccHuh? The "qcom,sdm845-llcc" bindings wasn't described above, and it's not clear what this means.
Quoted 7 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 52
Quoted 5 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +5
-0+ +Example: + + qcom,system-cache at 1300000 { + compatible = "qcom,llcc-core", "syscon", "simple-mfd";This looks very wrong. Why do you need syscon and simple-mfd?
Quoted 5 lines
LLCC HW block has 3 functionalities:
System cache core, ECC & AMON drivers for debugging.
All three drivers use the same register space for configuration, status etc. In order to avoid remapping the same address region across multiple drivers, I have implemented this driver as a syncon and simple-mfd.
Please don't do that; that's completely dependent on Linux implementation details.
Have one top level driver for the whole LLCC block, which maps the registers, and provides an API for accessing them. When that probes, it can cause the other drivers to be probed (e.g. with a platform device), and those can access the LLCC registers via that API.
Quoted 21 lines
Quoted 7 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 57
Quoted 5 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +5
-0+ reg = <0x1300000 0x50000>; + reg-names = "llcc_base"; + + llcc: qcom,sdm845-llcc { + compatible = "qcom,sdm845-llcc";Why is this a sub-node?
qcom,sdm845-llcc: This core driver as mentioned in the list above.
Quoted 10 lines
Why isn't the top-level node just "qcom,sdm845-llcc" ?
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 64
Quoted 7 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +7
-0+ #cache-cells = <1>; + max-slices = <32>; + }; + + qcom,llcc-ecc { + compatible = "qcom,llcc-ecc"; + };qcom,llcc-ecc: Driver #2 for ECC
Quoted 8 lines
Quoted 6 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 70
Quoted 6 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +6
-0+ + qcom,llcc-amon { + compatible = "qcom,llcc-amon"; + qcom,fg-cnt = <0x7>; + }; +qcom,llcc-amon: Driver #3 for AMON
Please describe the HW, not the drivers.
As above, I don't believe you need multiple nodes here. Linux can instantiate the drivers as necessary.
[...]
Quoted 11 lines
Quoted 8 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 87
Quoted 6 lines
+- cache-slices:
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +3
-0+ Usage: required + Value type: <prop-encoded-array> + Definition: The tuple has phandle to llcc device as the firstargument and the
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +1
-0+ second argument is the usecase id of the client.What is a "usecase id" ?
Usecase id for use case that wants to use system cache for eg: video-encode and video-decode
Sure, but how is the value used? Is it the index of a slice? Or something more abstract?
Thanks,
Mark.
Re: [PATCH 1/2] dt-bindings: Documentation for qcom,llcc
In reply to ChannaQuoted 41 lines · Channa
Quoted 31 lines · Mark Rutland
Quoted 30 lines · Channagoud Kadabi
Documentation for last level cache controller device tree bindings, client bindings usage examples.
Signed-off-by Channagoud Kadabi <[email protected]>--- .../devicetree/bindings/arm/msm/qcom,llcc.txt | 93 ++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txtDocumentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +19
-0+Example: + + qcom,system-cache at 1300000 { + compatible = "qcom,llcc-core", "syscon", "simple-mfd"; + reg = <0x1300000 0x50000>; + reg-names = "llcc_base"; + + llcc: qcom,sdm845-llcc { + compatible = "qcom,sdm845-llcc"; + #cache-cells = <1>; + max-slices = <32>; + }; + + qcom,llcc-ecc { + compatible = "qcom,llcc-ecc"; + }; + + qcom,llcc-amon { + compatible = "qcom,llcc-amon";Quoted 8 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 71
Quoted 4 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +4
-0+ qcom,fg-cnt = <0x7>; + }; + + };The "qcom,llcc-ecc" and "qcom,llcc-amon" bindings doesn't seem to be used by the driver in patch 2, and it's not clear how they are intended to be used, so I think they should go from the binding for now.
Quoted 7 lines
Sure I can remove them for now and add them when the I push other drivers for review.
Quoted 1 line
I don't think you need syscon and simple-mfd, and I think you can
I used syscon and simple-mfd because three drivers touch the same address space.
As in my other reply, I don't think that's the right way to solve the problem.
Please have one top-level driver and associated binding. That driver can carve up the functional units and allow other drivers to access the registers as necessary.
Thanks,
Mark.
Re: [PATCH 1/2] dt-bindings: Documentation for qcom,llcc
In reply to Mark RutlandQuoted 57 lines · Mark Rutland
Quoted 48 lines · Channa
Quoted 47 lines · Mark Rutland
Quoted 36 lines · Channagoud Kadabi
Documentation for last level cache controller device tree bindings, client bindings usage examples.
Signed-off-by Channagoud Kadabi <[email protected]>--- .../devicetree/bindings/arm/msm/qcom,llcc.txt | 93 ++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txtDocumentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +17
-0@@ -0,0 +1,93 @@ +* LLCC (Last Level Cache Controller) + +Properties: +- compatible: + Usage: required + Value type: <string> + Definition: must be "qcom,llcc-core" + +- reg: + Usage: required + Value Type: <prop-encoded-array> + Definition: must be addresses and sizes of the LLCC registers + +- llcc-bank-off: + Usage: required + Value Type: <u32 array> + Definition: Offsets of llcc banks from llcc base address startingfrom
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 23
Quoted 6 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +6
-0+ LLCC bank0. + +- llcc-broadcast-off: + Usage: required + Value Type: <u32> + Definition: Offset of broadcast register from LLCC bank0 address.Please could we use "offset" rather than "off" for both of these? That way it's obvious these aren't properties for disabling some feature.
Quoted 7 lines
Quoted 1 line
How variable are these offsets in practice? Is the memory map not fixed?
The offsets depends on the number of LLCC HW blocks. These number of HW
blocks vary from
chipset to chipset and new registers could be added that changes the offset.
Quoted 7 lines
Surely if new registers are added, we need a new compatible string?
Can't we encode the number of LLCC HW blocks, instead? Presumably that would give enough information to cover both llcc-bank-off and llcc-broadcast-off.
[...]
Are you suggesting to move these offset handing out of DTS files and manage in the driver?
Quoted 24 lines
Quoted 16 lines
Quoted 8 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 47
Quoted 4 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +3
-0+ +compatible devices: + qcom,sdm845-llccHuh? The "qcom,sdm845-llcc" bindings wasn't described above, and it's not clear what this means.
Quoted 7 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 52
Quoted 5 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +5
-0+ +Example: + + qcom,system-cache at 1300000 { + compatible = "qcom,llcc-core", "syscon", "simple-mfd";This looks very wrong. Why do you need syscon and simple-mfd?
Quoted 7 lines
LLCC HW block has 3 functionalities:
System cache core, ECC & AMON drivers for debugging.
All three drivers use the same register space for configuration, status etc.
In order to avoid remapping the same address region across multiple drivers,
I have implemented this driver as a syncon and simple-mfd.
Quoted 2 lines
Please don't do that; that's completely dependent on Linux implementation details.
Why do you think simple-mfd is not good here? The LLCC HW clock is outside of CPUSS and has
multiple functional blocks.
Quoted 52 lines
Have one top level driver for the whole LLCC block, which maps the registers, and provides an API for accessing them. When that probes, it can cause the other drivers to be probed (e.g. with a platform device), and those can access the LLCC registers via that API.
Quoted 21 lines
Quoted 7 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 57
Quoted 5 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +5
-0+ reg = <0x1300000 0x50000>; + reg-names = "llcc_base"; + + llcc: qcom,sdm845-llcc { + compatible = "qcom,sdm845-llcc";Why is this a sub-node?
qcom,sdm845-llcc: This core driver as mentioned in the list above.
Quoted 10 lines
Why isn't the top-level node just "qcom,sdm845-llcc" ?
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 64
Quoted 7 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +7
-0+ #cache-cells = <1>; + max-slices = <32>; + }; + + qcom,llcc-ecc { + compatible = "qcom,llcc-ecc"; + };qcom,llcc-ecc: Driver #2 for ECC
Quoted 8 lines
Quoted 6 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 70
Quoted 6 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +6
-0+ + qcom,llcc-amon { + compatible = "qcom,llcc-amon"; + qcom,fg-cnt = <0x7>; + }; +qcom,llcc-amon: Driver #3 for AMON
Please describe the HW, not the drivers.
As above, I don't believe you need multiple nodes here. Linux can instantiate the drivers as necessary.
[...]
Quoted 9 lines
Quoted 8 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 87
Quoted 6 lines
+- cache-slices:
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +3
-0+ Usage: required + Value type: <prop-encoded-array> + Definition: The tuple has phandle to llcc device as the firstargument and the
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +1
-0+ second argument is the usecase id of the client.What is a "usecase id" ?
Quoted 6 lines
Quoted 3 lines
Usecase id for use case that wants to use system cache for eg:
video-encode
and video-decodeSure, but how is the value used? Is it the index of a slice? Or something more abstract?
This is used as an index to the SCT (System cache Table) configuration data that controls
the behavior of each cache slice.
Quoted 3 lines
Thanks,
Mark.
Signature · 4 lines
-- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH 1/2] dt-bindings: Documentation for qcom,llcc
In reply to Channagoud KadabiHiya,
Quoted 2 lines · Channagoud Kadabi
Documentation for last level cache controller device tree bindings, client bindings usage examples.
[snippety snip]
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 23
Quoted 10 lines
+- llcc-bank-off:
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +9
-0+ 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.
What's with the redundant namespacing?
Have we not, as a community, realised that we do not need to namespace properties which are only present under
a single binding or node, or even those that aren't? This mess started with the regulator bindings and it's never
stopped. What are we at now, 25 years of device trees, 10 years of FDT on Arm?
Notwithstanding the complete waste of rodata in the kernel image for matching (& increased time to compare), why
wouldn't you consider why "bank-offset" for your node be any different than a common property for any other node?
And if you need to describe register offsets... why aren't you able to use the reg property?
Ta,
Matt
Re: [PATCH 1/2] dt-bindings: Documentation for qcom,llcc
Quoted 31 lines · Matt Sealey
Hiya,
Quoted 2 lines · Channagoud Kadabi
Documentation for last level cache controller device tree bindings, client bindings usage examples.
[snippety snip]
Quoted 11 lines
+- llcc-bank-off:
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +3
-0+ Usage: required + Value Type: <u32 array> + Definition: Offsets of llcc banks from llcc base addressstarting from
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +6
-0+ LLCC bank0. + +- llcc-broadcast-off: + Usage: required + Value Type: <u32> + Definition: Offset of broadcast register from LLCC bank0Quoted 1 line
address.
What's with the redundant namespacing?
Have we not, as a community, realised that we do not need to namespace properties which are only present under
a single binding or node, or even those that aren't? This mess started with the regulator bindings and it's never
stopped. What are we at now, 25 years of device trees, 10 years of FDT on Arm?
Quoted 4 lines
Notwithstanding the complete waste of rodata in the kernel image for matching (& increased time to compare), why
wouldn't you consider why "bank-offset" for your node be any different than a common property for any other node?
I will clean up the name space and use bank-offset for the property name.
Quoted 3 lines
And if you need to describe register offsets... why aren't you able to use the reg property?
Reg property did not suit well for my need, so I choose to maintain offsets instead.
The registers in the HW block are organized as
(offset1) (offset2) (offset3) (offset4)
Base(Block0) -- Block1 -- Block 2 -- Block 3 -- Broadcast_Block
Each block has identical register mapping. You can think of it as 4 instances of identical HW.
Broadcast block is to simplify writes, you don't need to write to individual blocks instead write to broadcast block.
I use simple-mfd/syscon as the hardware has multiple functions. Doing regmap on the the Base (Block0) and maintaining offset makes the driver cleaner rather than using the reg property for
each instance.
Quoted 3 lines
Ta,
Matt
Signature · 4 lines
-- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH 1/2] dt-bindings: Documentation for qcom,llcc
Quoted 27 lines · Channa
Quoted 20 lines · Matt Sealey
Quoted 2 lines · Channagoud Kadabi
Documentation for last level cache controller device tree bindings, client bindings usage examples.
[snippety snip]
Quoted 11 lines
+- llcc-bank-off:
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +3
-0+ Usage: required + Value Type: <u32 array> + Definition: Offsets of llcc banks from llcc base addressstarting from
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +6
-0+ LLCC bank0. + +- llcc-broadcast-off: + Usage: required + Value Type: <u32> + Definition: Offset of broadcast register from LLCC bank0Quoted 1 line
address.
Quoted 2 lines
And if you need to describe register offsets... why aren't you able to use the reg property?
Reg property did not suit well for my need, so I choose to maintain offsets instead.
Quoted 6 lines
The registers in the HW block are organized as
(offset1) (offset2) (offset3) (offset4)
Base(Block0) -- Block1 -- Block 2 -- Block 3 --Broadcast_BlockEach block has identical register mapping. You can think of it as 4 instances of identical HW.
We have similar in other devices (e.g. GICv3 has multiple instances of the same register block).
If there's nothing between those blocks, using a reg entry sounds prefectly reasonable. You can list the broadcast block first, then the others, or use reg-names.
Thanks,
Mark.
Re: [PATCH 1/2] dt-bindings: Documentation for qcom,llcc
In reply to ChannaQuoted 29 lines · Channa
Quoted 28 lines · Mark Rutland
Quoted 17 lines · Channa
Quoted 16 lines · Mark Rutland
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 23
Quoted 11 lines · Channagoud Kadabi
+- llcc-bank-off:
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +3
-0+ Usage: required + Value Type: <u32 array> + Definition: Offsets of llcc banks from llcc base address startingfrom
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +6
-0+ LLCC bank0. + +- llcc-broadcast-off: + Usage: required + Value Type: <u32> + Definition: Offset of broadcast register from LLCC bank0 address.Please could we use "offset" rather than "off" for both of these? That way it's obvious these aren't properties for disabling some feature.
Quoted 7 lines
Quoted 1 line
How variable are these offsets in practice? Is the memory map not fixed?
The offsets depends on the number of LLCC HW blocks. These number of HW
blocks vary from
chipset to chipset and new registers could be added that changes the offset.Surely if new registers are added, we need a new compatible string?
Quoted 8 lines
Quoted 5 lines
Can't we encode the number of LLCC HW blocks, instead? Presumably that would give enough information to cover both llcc-bank-off and llcc-broadcast-off.
[...]
Are you suggesting to move these offset handing out of DTS files and manage in the driver?
Something like that, though it depends on how exactly the offsets can be derived.
Using reg entries, as Matt suggested, sounds better though.
Quoted 22 lines
Quoted 22 lines
Quoted 21 lines
Quoted 6 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 47
Quoted 2 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +2
-0+compatible devices: + qcom,sdm845-llccHuh? The "qcom,sdm845-llcc" bindings wasn't described above, and it's not clear what this means.
Quoted 7 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 52
Quoted 5 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +5
-0+ +Example: + + qcom,system-cache at 1300000 { + compatible = "qcom,llcc-core", "syscon", "simple-mfd";This looks very wrong. Why do you need syscon and simple-mfd?
LLCC HW block has 3 functionalities:
System cache core, ECC & AMON drivers for debugging.
All three drivers use the same register space for configuration, status etc.
In order to avoid remapping the same address region across multiple drivers,
I have implemented this driver as a syncon and simple-mfd.
Quoted 6 lines
Quoted 2 lines
Please don't do that; that's completely dependent on Linux implementation details.
Why do you think simple-mfd is not good here? The LLCC HW clock is outside of CPUSS and has
multiple functional blocks.
For one thing, there's no need for this to be a syscon *and* a simple-mfd.
W.R.T. simple-mfd, I think it would bet better to decompose the device in a top-level driver, as I described in my prior reply, rather than describing a set of drivers (which are not themselves HW).
Quoted 13 lines
Quoted 13 lines
Quoted 12 lines
Quoted 8 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 87
Quoted 6 lines
+- cache-slices:
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +3
-0+ Usage: required + Value type: <prop-encoded-array> + Definition: The tuple has phandle to llcc device as the firstargument and the
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +1
-0+ second argument is the usecase id of the client.What is a "usecase id" ?
Usecase id for use case that wants to use system cache for eg:
video-encode
and video-decode
Quoted 5 lines
Quoted 2 lines
Sure, but how is the value used? Is it the index of a slice? Or something more abstract?
This is used as an index to the SCT (System cache Table) configuration data that controls the behavior of each cache slice.
Ok. Where does that SCT live? Is that in HW? Is it programmed by SW, or statically configured for a given platform?
Thanks,
Mark.
Re: [PATCH 1/2] dt-bindings: Documentation for qcom,llcc
Quoted 96 lines · Mark Rutland
Quoted 33 lines · Channa
Quoted 32 lines · Mark Rutland
Quoted 17 lines · Channa
Quoted 16 lines · Mark Rutland
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 23
Quoted 11 lines · Channagoud Kadabi
+- llcc-bank-off:
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +3
-0+ Usage: required + Value Type: <u32 array> + Definition: Offsets of llcc banks from llcc base address startingfrom
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +6
-0+ LLCC bank0. + +- llcc-broadcast-off: + Usage: required + Value Type: <u32> + Definition: Offset of broadcast register from LLCC bank0 address.Please could we use "offset" rather than "off" for both of these? That way it's obvious these aren't properties for disabling some feature.
Quoted 7 lines
Quoted 1 line
How variable are these offsets in practice? Is the memory map not fixed?
The offsets depends on the number of LLCC HW blocks. These number of HW
blocks vary from
chipset to chipset and new registers could be added that changes the offset.Surely if new registers are added, we need a new compatible string?
Can't we encode the number of LLCC HW blocks, instead? Presumably that would give enough information to cover both llcc-bank-off and llcc-broadcast-off.
Quoted 5 lines
Quoted 1 line
[...]
Are you suggesting to move these offset handing out of DTS files and manage
in the driver?Something like that, though it depends on how exactly the offsets can be
derived.Using reg entries, as Matt suggested, sounds better though.
Quoted 22 lines
Quoted 22 lines
Quoted 21 lines
Quoted 6 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 47
Quoted 2 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +2
-0+compatible devices: + qcom,sdm845-llccHuh? The "qcom,sdm845-llcc" bindings wasn't described above, and it's not clear what this means.
Quoted 7 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 52
Quoted 5 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +5
-0+ +Example: + + qcom,system-cache at 1300000 { + compatible = "qcom,llcc-core", "syscon", "simple-mfd";This looks very wrong. Why do you need syscon and simple-mfd?
LLCC HW block has 3 functionalities:
System cache core, ECC & AMON drivers for debugging.
All three drivers use the same register space for configuration, status etc.
In order to avoid remapping the same address region across multiple drivers,
I have implemented this driver as a syncon and simple-mfd.Quoted 7 lines
Quoted 2 lines
Please don't do that; that's completely dependent on Linux implementation details.
Why do you think simple-mfd is not good here? The LLCC HW clock is outside
of CPUSS and has
multiple functional blocks.For one thing, there's no need for this to be a syscon *and* a simple-mfd.
W.R.T. simple-mfd, I think it would bet better to decompose the device in a top-level driver, as I described in my prior reply, rather than describing a set of drivers (which are not themselves HW).
Quoted 13 lines
Quoted 13 lines
Quoted 12 lines
Quoted 8 lines
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt line 87
Quoted 6 lines
+- cache-slices:
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +3
-0+ Usage: required + Value type: <prop-encoded-array> + Definition: The tuple has phandle to llcc device as the firstargument and the
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt new file +1
-0+ second argument is the usecase id of the client.What is a "usecase id" ?
Usecase id for use case that wants to use system cache for eg:
video-encode
and video-decode
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Sure, but how is the value used? Is it the index of a slice? Or something more abstract?
This is used as an index to the SCT (System cache Table) configuration data that controls the behavior of each cache slice.
Ok. Where does that SCT live? Is that in HW? Is it programmed by SW, or statically configured for a given platform?
SCT is in the HW. Kernel driver programs these settings for a given platform. The table is also used to lookup size, cache slice id details requested by client drivers.
Quoted 3 lines
Thanks,
Mark.
Signature · 4 lines
-- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH 2/2] drivers: soc: Add LLCC driver
In reply to Channagoud KadabiQuoted 8 lines · Channagoud Kadabi
LLCC (Last Level Cache Controller) provides additional cache memory in the system. LLCC is partitioned into muliple slices and each slice gets 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 for their usecase and activate or deactivate the slice as needed. LLCC driver provides API interfaces for the clients to perform these operations.
<snip>
Quoted 5 lines
drivers/soc/qcom/llcc-slice.c new file +5
-0+/** +* llcc_slice_deactivate - Deactivate the llcc slice +* @desc: Pointer to llcc slice descriptor +* +* A value zero will be returned on success and a negative errno will
drivers/soc/qcom/llcc-slice.c line 264
Quoted 10 lines
drivers/soc/qcom/llcc-slice.c new file +10
-0+* be returned in error cases +*/ +int llcc_slice_deactivate (struct llcc_slice_desc *desc) +{ +u32 act_ctrl_val; +int rc = -EINVAL ; +struct llcc_drv_data *drv; + +if (desc ==NULL ) { +pr_err ("Input descriptor supplied is invalid\n" );
Sorry that this is out of the blue, but I was reviewing a client driver that uses this API. This should not print an error - we should be allowed to safely pass a null pointer from an aborted sequence in the driver without the conditional checks and it shouldn't generate a bit of log spam as it goes about it's business.
Jordan
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH 2/2] drivers: soc: Add LLCC driver
Quoted 29 lines · Jordan Crouse
Quoted 9 lines · Channagoud Kadabi
LLCC (Last Level Cache Controller) provides additional cache memory in the system. LLCC is partitioned into muliple slices and each slice gets 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 for their usecase and activate or deactivate the slice as needed.
LLCC driver provides API interfaces for the clients to perform these operations.<snip>
Quoted 5 lines
drivers/soc/qcom/llcc-slice.c new file +5
-0+/** +* llcc_slice_deactivate - Deactivate the llcc slice +* @desc: Pointer to llcc slice descriptor +* +* A value zero will be returned on success and a negative errno will drivers/soc/qcom/llcc-slice.c line 264
Quoted 10 lines
drivers/soc/qcom/llcc-slice.c new file +10
-0+* be returned in error cases +*/ +int llcc_slice_deactivate (struct llcc_slice_desc *desc) +{ +u32 act_ctrl_val; +int rc = -EINVAL ; +struct llcc_drv_data *drv; + +if (desc ==NULL ) { +pr_err ("Input descriptor supplied is invalid\n" );
Quoted 8 lines
Sorry that this is out of the blue, but I was reviewing a client driver that
uses this API. This should not print an error - we should be allowed to safely
pass a null pointer from an aborted sequence in the driver without the conditional checks and it shouldn't generate a bit of log spam as it goes about
it's business.
Thanks Jordan. I will incorporate this change in my next patchset.
Quoted 2 lines
Jordan
Signature · 4 lines
-- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project