2023-08-12 01:54:06

by Bryan O'Donoghue

[permalink] [raw]
Subject: [PATCH v3 0/7] apq8016: camss: Update dts with various fixes

V3:
- Fixes licensing boilerplate error in d3 mezzanine - Stephan
- Moves regulators into d3 mezzanine - Stephan
- Drops redundant enable of camss in d3 mezzanine - Stephan
- Declares ports in core dtsi - Konrad
- Adds R/B for assigned-clocks - Konrad

Link: https://git.codelinaro.org/bryan.odonoghue/kernel/-/tree/linux-next-23-08-07-db410c-rb3-camss-dts-v3

V2:
- Adds R/B - Konrad
- Adds newline as flagged - Konrad
- Squashes patch#6 into patch#5 ammends commit log
- Following up on TPG comentary:
The CAMSS would not have populated device nodes prior to this series
save for the case a user had a D3 Engineering board.
Splitting out the sensor from the core board is correct w/r/t the
hardware/dts since few db410c have the mezzanine.
Once split we can enable the basic camss node by default and thus get the
TPG going for both the mezzanine and non-mezzanine cases.

Link: https://git.codelinaro.org/bryan.odonoghue/kernel/-/tree/linux-next-23-08-07-db410c-rb3-camss-dts-v2

V1:
This is a series which updates the apq8016-sbc to fixup CAMSS support.

The first four patches fixup the current state of the ov5640 bindings for
the apq8016.

Following on from that we move the ov5640 sensor from the main apq8016-sbc
into a standalone mezzanine dts with an accompanying patch to enable the
sensor by default in the mezzaine. This makes sense since the D3
Engineering camera mezzanine is but one of a slew of camera mezzanines we
can attach here.

The final patch switches on CAMSS in the core apq8016-sbc allowing us to use
the test-pattern-generator TPG on apq8016-sbc with or without a camera mezzaine
attached. This to me is a good idea since it means we can test out and
verify the CAMSS on this board absent a camera mezzaine on the main apq8016
board.

Link: https://git.codelinaro.org/bryan.odonoghue/kernel/-/tree/linux-next-23-08-07-db410c-rb3-camss-dts

Bryan O'Donoghue (7):
arm64: dts: qcom: msm8916: Define CAMSS ports in core dtsi
arm64: dts: qcom: apq8016-sbc: Fix ov5640 regulator supply names
arm64: dts: qcom: apq8016-sbc: Fix ov5640 data-lanes declaration
arm64: dts: qcom: apq8016-sbc: Set ov5640 assigned-clock
arm64: dts: qcom: apq8016-sbc: Rename ov5640 enable-gpios to
powerdown-gpios
arm64: dts: qcom: apq8016-sbc-d3-camera-mezzanine: Move default ov5640
to a standalone dts
arm64: dts: qcom: apq8016-sbc: Enable camss for non-mezzanine cases

arch/arm64/boot/dts/qcom/Makefile | 1 +
.../qcom/apq8016-sbc-d3-camera-mezzanine.dts | 81 +++++++++++++++++++
arch/arm64/boot/dts/qcom/apq8016-sbc.dts | 68 ----------------
arch/arm64/boot/dts/qcom/msm8916.dtsi | 8 ++
4 files changed, 90 insertions(+), 68 deletions(-)
create mode 100644 arch/arm64/boot/dts/qcom/apq8016-sbc-d3-camera-mezzanine.dts

--
2.41.0



2023-08-12 02:23:12

by Bryan O'Donoghue

[permalink] [raw]
Subject: [PATCH v3 6/7] arm64: dts: qcom: apq8016-sbc-d3-camera-mezzanine: Move default ov5640 to a standalone dts

At the moment we define a single ov5640 sensor in the apq8016-sbc and
disable that sensor.

The sensor mezzanine for this is a D3 Engineering Dual ov5640 mezzanine
card. Move the definition from the apq8016-sbc where it shouldn't be to a
standalone dts.

Enables the sensor by default, as we are adding a standalone mezzanine
structure.

Signed-off-by: Bryan O'Donoghue <[email protected]>
Reviewed-by: Konrad Dybcio <[email protected]>
---
arch/arm64/boot/dts/qcom/Makefile | 1 +
.../qcom/apq8016-sbc-d3-camera-mezzanine.dts | 81 +++++++++++++++++++
arch/arm64/boot/dts/qcom/apq8016-sbc.dts | 73 -----------------
3 files changed, 82 insertions(+), 73 deletions(-)
create mode 100644 arch/arm64/boot/dts/qcom/apq8016-sbc-d3-camera-mezzanine.dts

diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
index f15548dbfa56e..19016765ba4c6 100644
--- a/arch/arm64/boot/dts/qcom/Makefile
+++ b/arch/arm64/boot/dts/qcom/Makefile
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
dtb-$(CONFIG_ARCH_QCOM) += apq8016-sbc.dtb
+dtb-$(CONFIG_ARCH_QCOM) += apq8016-sbc-d3-camera-mezzanine.dtb
dtb-$(CONFIG_ARCH_QCOM) += apq8039-t2.dtb
dtb-$(CONFIG_ARCH_QCOM) += apq8094-sony-xperia-kitakami-karin_windy.dtb
dtb-$(CONFIG_ARCH_QCOM) += apq8096-db820c.dtb
diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc-d3-camera-mezzanine.dts b/arch/arm64/boot/dts/qcom/apq8016-sbc-d3-camera-mezzanine.dts
new file mode 100644
index 0000000000000..c08b4be5cc7ee
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/apq8016-sbc-d3-camera-mezzanine.dts
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2023, Linaro Ltd.
+ */
+
+/dts-v1/;
+
+#include "apq8016-sbc.dts"
+
+/ {
+ camera_vdddo_1v8: camera-vdddo-1v8 {
+ compatible = "regulator-fixed";
+ regulator-name = "camera_vdddo";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ };
+
+ camera_vdda_2v8: camera-vdda-2v8 {
+ compatible = "regulator-fixed";
+ regulator-name = "camera_vdda";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-always-on;
+ };
+
+ camera_vddd_1v5: camera-vddd-1v5 {
+ compatible = "regulator-fixed";
+ regulator-name = "camera_vddd";
+ regulator-min-microvolt = <1500000>;
+ regulator-max-microvolt = <1500000>;
+ regulator-always-on;
+ };
+};
+
+&camss {
+ status = "okay";
+
+ ports {
+ port@0 {
+ reg = <0>;
+ csiphy0_ep: endpoint {
+ data-lanes = <0 2>;
+ remote-endpoint = <&ov5640_ep>;
+ };
+ };
+ };
+};
+
+&cci {
+ status = "okay";
+};
+
+&cci_i2c0 {
+ camera_rear@3b {
+ compatible = "ovti,ov5640";
+ reg = <0x3b>;
+
+ powerdown-gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>;
+ reset-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&camera_rear_default>;
+
+ clocks = <&gcc GCC_CAMSS_MCLK0_CLK>;
+ clock-names = "xclk";
+ assigned-clocks = <&gcc GCC_CAMSS_MCLK0_CLK>;
+ assigned-clock-rates = <23880000>;
+
+ DOVDD-supply = <&camera_vdddo_1v8>;
+ AVDD-supply = <&camera_vdda_2v8>;
+ DVDD-supply = <&camera_vddd_1v5>;
+
+ port {
+ ov5640_ep: endpoint {
+ data-lanes = <1 2>;
+ remote-endpoint = <&csiphy0_ep>;
+ };
+ };
+ };
+};
diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dts b/arch/arm64/boot/dts/qcom/apq8016-sbc.dts
index ddb19709a9eee..c3cd08aa5c85b 100644
--- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dts
+++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dts
@@ -34,30 +34,6 @@ chosen {
stdout-path = "serial0";
};

- camera_vdddo_1v8: camera-vdddo-1v8 {
- compatible = "regulator-fixed";
- regulator-name = "camera_vdddo";
- regulator-min-microvolt = <1800000>;
- regulator-max-microvolt = <1800000>;
- regulator-always-on;
- };
-
- camera_vdda_2v8: camera-vdda-2v8 {
- compatible = "regulator-fixed";
- regulator-name = "camera_vdda";
- regulator-min-microvolt = <2800000>;
- regulator-max-microvolt = <2800000>;
- regulator-always-on;
- };
-
- camera_vddd_1v5: camera-vddd-1v5 {
- compatible = "regulator-fixed";
- regulator-name = "camera_vddd";
- regulator-min-microvolt = <1500000>;
- regulator-max-microvolt = <1500000>;
- regulator-always-on;
- };
-
reserved-memory {
ramoops@bff00000 {
compatible = "ramoops";
@@ -250,55 +226,6 @@ &blsp_uart2 {
label = "LS-UART1";
};

-&camss {
- status = "okay";
- ports {
- port@0 {
- reg = <0>;
- csiphy0_ep: endpoint {
- data-lanes = <0 2>;
- remote-endpoint = <&ov5640_ep>;
- status = "okay";
- };
- };
- };
-};
-
-&cci {
- status = "okay";
-};
-
-&cci_i2c0 {
- camera_rear@3b {
- compatible = "ovti,ov5640";
- reg = <0x3b>;
-
- powerdown-gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>;
- reset-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
- pinctrl-names = "default";
- pinctrl-0 = <&camera_rear_default>;
-
- clocks = <&gcc GCC_CAMSS_MCLK0_CLK>;
- clock-names = "xclk";
- assigned-clocks = <&gcc GCC_CAMSS_MCLK0_CLK>;
- assigned-clock-rates = <23880000>;
-
- DOVDD-supply = <&camera_vdddo_1v8>;
- AVDD-supply = <&camera_vdda_2v8>;
- DVDD-supply = <&camera_vddd_1v5>;
-
- /* No camera mezzanine by default */
- status = "disabled";
-
- port {
- ov5640_ep: endpoint {
- data-lanes = <1 2>;
- remote-endpoint = <&csiphy0_ep>;
- };
- };
- };
-};
-
&lpass {
status = "okay";
};
--
2.41.0


2023-08-12 02:42:15

by Bryan O'Donoghue

[permalink] [raw]
Subject: [PATCH v3 2/7] arm64: dts: qcom: apq8016-sbc: Fix ov5640 regulator supply names

The ov5640 driver expects DOVDD, AVDD and DVDD as regulator supply names.

The ov5640 has depended on these names since the driver was committed
upstream in 2017. Similarly apq8016-sbc.dtsi has had completely different
regulator names since its own initial commit in 2020.

Perhaps the regulators were left on in previous 410c bootloaders. In any
case today on 6.5 we won't switch on the ov5640 without correctly naming
the regulators.

Fixes: 39e0ce6cd1bf ("arm64: dts: qcom: apq8016-sbc: Add CCI/Sensor nodes")
Signed-off-by: Bryan O'Donoghue <[email protected]>
Reviewed-by: Konrad Dybcio <[email protected]>
---
arch/arm64/boot/dts/qcom/apq8016-sbc.dts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dts b/arch/arm64/boot/dts/qcom/apq8016-sbc.dts
index f6eeb25988465..75b4e5ff7c95c 100644
--- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dts
+++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dts
@@ -282,9 +282,9 @@ camera_rear@3b {
clock-names = "xclk";
clock-frequency = <23880000>;

- vdddo-supply = <&camera_vdddo_1v8>;
- vdda-supply = <&camera_vdda_2v8>;
- vddd-supply = <&camera_vddd_1v5>;
+ DOVDD-supply = <&camera_vdddo_1v8>;
+ AVDD-supply = <&camera_vdda_2v8>;
+ DVDD-supply = <&camera_vddd_1v5>;

/* No camera mezzanine by default */
status = "disabled";
--
2.41.0


2023-08-12 02:57:28

by Bryan O'Donoghue

[permalink] [raw]
Subject: [PATCH v3 1/7] arm64: dts: qcom: msm8916: Define CAMSS ports in core dtsi

Each CSIPHY in CAMMS maps to a port here in the dtsi, since the number of
CSIPHYs is fixed per SoC define the 8916 ports for both available PHYs.

Signed-off-by: Bryan O'Donoghue <[email protected]>
---
arch/arm64/boot/dts/qcom/msm8916.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index c4d6739046989..33fb65d731046 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -1712,6 +1712,14 @@ camss: camss@1b0ac00 {
ports {
#address-cells = <1>;
#size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ };
+
+ port@1 {
+ reg = <1>;
+ };
};
};

--
2.41.0


2023-08-12 02:57:44

by Bryan O'Donoghue

[permalink] [raw]
Subject: [PATCH v3 4/7] arm64: dts: qcom: apq8016-sbc: Set ov5640 assigned-clock

The driver for the ov5640 doesn't do a set-rate, instead it expects the
clock to already be set at an appropriate rate.

Similarly the yaml for ov5640 doesn't understand clock-frequency. Convert
from clock-rate to assigned-clock and assigned-clock-rate to remediate.

Signed-off-by: Bryan O'Donoghue <[email protected]>
Reviewed-by: Konrad Dybcio <[email protected]>
---
arch/arm64/boot/dts/qcom/apq8016-sbc.dts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dts b/arch/arm64/boot/dts/qcom/apq8016-sbc.dts
index 0481a4a82090a..ada0777567623 100644
--- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dts
+++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dts
@@ -280,7 +280,8 @@ camera_rear@3b {

clocks = <&gcc GCC_CAMSS_MCLK0_CLK>;
clock-names = "xclk";
- clock-frequency = <23880000>;
+ assigned-clocks = <&gcc GCC_CAMSS_MCLK0_CLK>;
+ assigned-clock-rates = <23880000>;

DOVDD-supply = <&camera_vdddo_1v8>;
AVDD-supply = <&camera_vdda_2v8>;
--
2.41.0


2023-08-12 05:37:20

by Bryan O'Donoghue

[permalink] [raw]
Subject: [PATCH v3 5/7] arm64: dts: qcom: apq8016-sbc: Rename ov5640 enable-gpios to powerdown-gpios

There are two control lines controlled by GPIO going into ov5640

- Reset
- Powerdown

The driver and yaml expect "reset-gpios" and "powerdown-gpios" there has
never been an "enable-gpios".

Fixes: 39e0ce6cd1bf ("arm64: dts: qcom: apq8016-sbc: Add CCI/Sensor nodes")
Signed-off-by: Bryan O'Donoghue <[email protected]>
Reviewed-by: Konrad Dybcio <[email protected]>
---
arch/arm64/boot/dts/qcom/apq8016-sbc.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dts b/arch/arm64/boot/dts/qcom/apq8016-sbc.dts
index ada0777567623..ddb19709a9eee 100644
--- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dts
+++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dts
@@ -273,7 +273,7 @@ camera_rear@3b {
compatible = "ovti,ov5640";
reg = <0x3b>;

- enable-gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>;
+ powerdown-gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>;
reset-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&camera_rear_default>;
--
2.41.0


2023-08-12 12:22:58

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v3 1/7] arm64: dts: qcom: msm8916: Define CAMSS ports in core dtsi

On 12.08.2023 01:47, Bryan O'Donoghue wrote:
> Each CSIPHY in CAMMS maps to a port here in the dtsi, since the number of
> CSIPHYs is fixed per SoC define the 8916 ports for both available PHYs.
>
> Signed-off-by: Bryan O'Donoghue <[email protected]>
> ---
Reviewed-by: Konrad Dybcio <[email protected]>

Konrad

2023-08-14 06:19:44

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v3 0/7] apq8016: camss: Update dts with various fixes


On Sat, 12 Aug 2023 00:47:31 +0100, Bryan O'Donoghue wrote:
> V3:
> - Fixes licensing boilerplate error in d3 mezzanine - Stephan
> - Moves regulators into d3 mezzanine - Stephan
> - Drops redundant enable of camss in d3 mezzanine - Stephan
> - Declares ports in core dtsi - Konrad
> - Adds R/B for assigned-clocks - Konrad
>
> [...]

Applied, thanks!

[1/7] arm64: dts: qcom: msm8916: Define CAMSS ports in core dtsi
commit: 349a13a1e735ef84ff1af8e56a1309171f86f989
[2/7] arm64: dts: qcom: apq8016-sbc: Fix ov5640 regulator supply names
commit: 43a684580819e7f35b6cb38236be63c4cba26ef4
[3/7] arm64: dts: qcom: apq8016-sbc: Fix ov5640 data-lanes declaration
commit: 3652866ff493db60e2f767bd751fe15c1b4bd37a
[4/7] arm64: dts: qcom: apq8016-sbc: Set ov5640 assigned-clock
commit: 775d2f3f76b1de6d440d6071c61023ea71d88f69
[5/7] arm64: dts: qcom: apq8016-sbc: Rename ov5640 enable-gpios to powerdown-gpios
commit: 4facccb44a82129195878750eed8f9890091c1b8
[6/7] arm64: dts: qcom: apq8016-sbc-d3-camera-mezzanine: Move default ov5640 to a standalone dts
commit: 6823df31587707f5534663f04f80e40df3e709c4
[7/7] arm64: dts: qcom: apq8016-sbc: Enable camss for non-mezzanine cases
commit: c27c73bb560bae279deae8cd94554832cee88116

Best regards,
--
Bjorn Andersson <[email protected]>