Support the Nord CCI CCU output mux
Subsystems (5)
cover Support the Nord CCI CCU output mux
On Nord, the CCI controllers are wrapped by a CCU. After reset, the CCI I2C ports are routed to the CCU, and the CCU output mux must select the CCI before it can be used.
The mux register is part of CAM_TOP, a register block shared by multiple camera components and outside the CCI and CAMSS register ranges. Accessing the block requires the camera subsystem top power domain and AHB clock, and its state is lost when the power domain is turned off.
This RFC describes CAM_TOP as a syscon and lets each CCI reference its mux configuration through a phandle, register offset and mask. The CCI driver selects the CCI at probe and runtime resume, right after enabling the CCI clocks and before the CCI is reset or configured.
titan_cam_top: syscon@<addr> {
compatible = "qcom,nord-titan-cam-top", "syscon";
reg = <...>;
};
cci2: cci@<addr> {
compatible = "qcom,nord-cci", "qcom,msm8996-cci";
...
qcom,ccu-mux-sel = <&titan_cam_top OFFSET MASK>;
};The CAM_TOP syscon does not describe its clock or power domain. A clock attached to a syscon is kept prepared for the lifetime of the regmap, which would keep the camera clock controller runtime active even when the camera is idle. Instead, the CCI, as the consumer, writes the mux with its own power domain and clocks, which include the AHB clock, enabled.
An alternative is to introduce a dedicated CAM_TOP driver which owns the clock and power domain, provides the regmap through of_syscon_register_regmap() and handles runtime PM in its accessors. This describes the hardware resources more completely and avoids the debugfs issue, but adds a driver for a block currently used only by the CCI.
We would like feedback on whether using a plain syscon with power and clock management left to its consumer is acceptable, or whether CAM_TOP should instead have a dedicated binding and driver.
---
Wenmeng Liu (3):
dt-bindings: mfd: syscon: Add Qualcomm Nord Titan CAM_TOP
dt-bindings: i2c: qcom-cci: Document Nord compatible
i2c: qcom-cci: Support the CCU output mux
.../devicetree/bindings/i2c/qcom,i2c-cci.yaml | 41 +++++++++++++++++++++ Documentation/devicetree/bindings/mfd/syscon.yaml | 1 + drivers/i2c/busses/Kconfig | 1 + drivers/i2c/busses/i2c-qcom-cci.c | 42 ++++++++++++++++++++++ 4 files changed, 85 insertions(+)
---
base-commit: 8b7179210b22f8e48a82c5ceacb9d56a9c4cfec4
change-id: 20261105-ccu-99785a56dcd0
Best regards,
Signature · 1 line
Wenmeng Liu <[email protected]>
RFC PATCH 1/3 dt-bindings: mfd: syscon: Add Qualcomm Nord Titan CAM_TOP
The CAM_TOP block in the Nord Titan camera subsystem contains registers shared by several camera blocks, including the CCU output mux used to route the CCI I2C ports.
The block is outside of the CCI and CAMSS register ranges, so describe it as a syscon for its users to reference.
--- Documentation/devicetree/bindings/mfd/syscon.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/mfd/syscon.yaml +1 -0
@@ -109,6 +109,7 @@ properties: - qcom,apq8064-mmss-sfpb - qcom,apq8064-sps-sic - qcom,msm8960-sps-sic + - qcom,nord-titan-cam-top - rockchip,px30-qos - rockchip,rk3036-qos - rockchip,rk3066-qos
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH RFC 1/3] dt-bindings: mfd: syscon: Add Qualcomm Nord Titan CAM_TOP
Sashiko has reviewed this patch and found no issues.
Quoted 8 lines
The
CAM_TOPblock in the Nord Titan camera subsystem contains registers shared by several camera blocks, including the CCU output mux used to route the CCI I2C ports.The block is outside of the CCI and CAMSS register ranges, so describe it as a syscon for its users to reference.
Signed-off-by Wenmeng Liu <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
RFC PATCH 2/3 dt-bindings: i2c: qcom-cci: Document Nord compatible
In reply to Wenmeng LiuAdd the Nord CCI compatible. The CCI is based on the CCI v2 core, but is wrapped by a CCU. After reset, the I2C ports are routed to the CCU and the CCU output mux must select the CCI before any transfer can take place.
Add the qcom,ccu-mux-sel property to describe the syscon register and bits controlling the CCU output mux.
In addition to its core clock, the CCI requires the CCU AHB clock and the camera subsystem top AHB and fast AHB clocks. The top AHB clock is required to access the CCI registers and the CCU output mux.
--- .../devicetree/bindings/i2c/qcom,i2c-cci.yaml | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+)
Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml +41 -0
@@ -29,6 +29,7 @@ properties: - qcom,glymur-cci - qcom,kaanapali-cci - qcom,milos-cci + - qcom,nord-cci - qcom,qcm2290-cci - qcom,qcs8300-cci - qcom,sa8775p-cci
@@ -70,6 +71,20 @@ properties: reg: maxItems: 1 + qcom,ccu-mux-sel: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: + On SoCs where the CCI sits in a CCU wrapper, the CCI I2C ports are + routed to the CCU after reset and the CCU output mux has to select the + CCI before any transfer. + items: + - items: + - description: phandle to the Titan CAM_TOP syscon + - description: byte offset of the CCU output mux register in the + syscon + - description: mask of the mux bits of this CCI, set to 1 to route + the I2C ports to this CCI + patternProperties: "^i2c-bus@[01]$": $ref: /schemas/i2c/i2c-controller.yaml#
@@ -131,6 +146,32 @@ allOf: - const: cci_ahb - const: cci + - if: + properties: + compatible: + contains: + const: qcom,nord-cci + then: + properties: + clocks: + items: + - description: Camera subsystem top AHB clock, needed by the CCI + register interface and to access the CCU output mux + - description: CCI core clock + - description: AHB clock of the CCU wrapper the CCI sits in + - description: Camera subsystem top fast AHB clock + clock-names: + items: + - const: ahb + - const: cci + - const: ccu_ahb + - const: fast_ahb + required: + - qcom,ccu-mux-sel + else: + properties: + qcom,ccu-mux-sel: false + - if: properties: compatible:
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH RFC 2/3] dt-bindings: i2c: qcom-cci: Document Nord compatible
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] dt-bindings: i2c: qcom-cci: split unwieldy per-variant schema conditionals --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] dt-bindings: i2c: qcom-cci: split unwieldy per-variant schema conditionals --
commit 462fd62ad81784bc39c8c1fb16b33e4aa1f4c6be
Author: Wenmeng Liu <[email protected]>
dt-bindings: i2c: qcom-cci: Document Nord compatible
This commit documents the qcom,nord-cci compatible string in Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml, along with its four required clocks and the new qcom,ccu-mux-sel property for configuring the CCU wrapper output mux.
Quoted 52 lines
Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml +30
-0@@ -29,6 +29,7 @@ properties: - qcom,glymur-cci - qcom,kaanapali-cci - qcom,milos-cci + - qcom,nord-cci - qcom,qcm2290-cci - qcom,qcs8300-cci - qcom,sa8775p-cci@@ -70,6 +71,20 @@ properties: reg: maxItems: 1 + qcom,ccu-mux-sel: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: + On SoCs where the CCI sits in a CCU wrapper, the CCI I2C ports are + routed to the CCU after reset and the CCU output mux has to select the + CCI before any transfer. + items: + - items: + - description: phandle to the Titan CAM_TOP syscon + - description: byte offset of the CCU output mux register in the + syscon + - description: mask of the mux bits of this CCI, set to 1 to route + the I2C ports to this CCI + patternProperties: "^i2c-bus@[01]$": $ref: /schemas/i2c/i2c-controller.yaml#@@ -131,6 +146,32 @@ allOf: - const: cci_ahb - const: cci + - if: + properties: + compatible: + contains: + const: qcom,nord-cci + then: + properties: + clocks: + items: + - description: Camera subsystem top AHB clock, needed by the CCI + register interface and to access the CCU output mux + - description: CCI core clock + - description: AHB clock of the CCU wrapper the CCI sits in + - description: Camera subsystem top fast AHB clock + clock-names:
Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml allOf: · line 173
Quoted 10 lines
Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml +10
-0+ items: + - const: ahb + - const: cci + - const: ccu_ahb + - const: fast_ahb + required: + - qcom,ccu-mux-sel + else: + properties: + qcom,ccu-mux-sel: false
[Severity: Low] Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml already contains eleven per-compatible if-then blocks under allOf to handle variant differences in clocks, child I2C buses, and power domains.
Since qcom,nord-cci sits inside a CCU wrapper, introduces a variant-specific qcom,ccu-mux-sel property that must be disallowed for all other compatibles, and uses a distinct four-clock configuration (ahb, cci, ccu_ahb, fast_ahb), would it be cleaner to split this binding into separate schema documents rather than adding a twelfth per-compatible conditional block here?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
RFC PATCH 3/3 i2c: qcom-cci: Support the CCU output mux
In reply to Wenmeng LiuOn SoCs such as Nord, the CCIs are wrapped by a CCU. After reset, the CCI I2C ports are routed to the CCU, and the CCU output mux must select the CCI before any transfer can take place.
Get the mux register and bits from the optional qcom,ccu-mux-sel syscon reference and select the CCI at probe and runtime resume, right after enabling the CCI clocks and before the CCI is reset or configured, as the mux register is not retained across power collapse.
The mux register is accessible only with the camera subsystem top power domain and AHB clock enabled, both of which are CCI resources. The syscon regmap serializes the accesses from multiple CCI instances.
--- drivers/i2c/busses/Kconfig | 1 + drivers/i2c/busses/i2c-qcom-cci.c | 42 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+)
drivers/i2c/busses/Kconfig +1 -0
@@ -1061,6 +1061,7 @@ config I2C_PXA_SLAVE config I2C_QCOM_CCI tristate "Qualcomm Camera Control Interface" depends on ARCH_QCOM || COMPILE_TEST + select MFD_SYSCON select PM_OPP help If you say yes to this option, support will be included for the
drivers/i2c/busses/i2c-qcom-cci.c +42 -0
86 lines not on this page · raw message
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH RFC 3/3] i2c: qcom-cci: Support the CCU output mux
Sashiko has reviewed this patch and found no issues.
Quoted 9 lines
On SoCs such as Nord, the CCIs are wrapped by a CCU. After reset, the CCI I2C ports are routed to the CCU, and the CCU output mux must select the CCI before any transfer can take place.
Get the mux register and bits from the optional qcom,ccu-mux-sel syscon reference and select the CCI at probe and runtime resume, right after enabling the CCI clocks and before the CCI is reset or configured, as the mux register is not retained across power collapse.
Quoted 5 lines
The mux register is accessible only with the camera subsystem top power domain and AHB clock enabled, both of which are CCI resources. The syscon regmap serializes the accesses from multiple CCI instances.
Signed-off-by Wenmeng Liu <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3