* [PATCH] arm64: dts: rockchip: support camera module on Haikou Video Demo on PX30 Ringneck
@ 2025-05-16 17:26 Quentin Schulz
2025-06-09 9:56 ` Heiko Stuebner
0 siblings, 1 reply; 2+ messages in thread
From: Quentin Schulz @ 2025-05-16 17:26 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Quentin Schulz
From: Quentin Schulz <quentin.schulz@cherry.de>
The Haikou Video Demo adapter has a proprietary connector for a camera
module which has an OV5675 camera sensor and a companion DW9714 focus
lens driver.
This adds support for the camera module on PX30 Ringneck module fitted
on a Haikou devkit with the Haikou Video Demo adapter.
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
This adapter is also used with RK3588 Tiger, but there's currently no
camera stack at all on RK3588, and RK3399 Puma, but:
- 19.2MHz is not achievable exactly, so need to patch the driver to
support 24MHz for example, this will come later,
- The camera clk is on an IO domain at 1.8V but configured at boot at
3.3V, and until the IO domain is properly configured, the camera
won't receive a clock. Based on the probe order, it is possible (and
empirically very likely) that the camera won't be detected at all.
A Linux kernel solution was attempted multiple times in the past,
c.f.
https://lore.kernel.org/linux-gpio/20230904115816.1237684-1-s.hauer@pengutronix.de/
https://lore.kernel.org/lkml/20220802095252.2486591-1-foss+kernel@0leil.net/
We'll need to figure something out this time as I won't be able to
upstream camera support without it :)
To test, install libcamera on Debian Bookworm (or more recent I guess)
add a file at /usr/share/libcamera/ipa/rkisp1/ov5675.yaml whose content
is (remove one leading whitespace):
# SPDX-License-Identifier: CC0-1.0
%YAML 1.1
---
version: 1
algorithms:
- Agc:
- Awb:
- BlackLevelCorrection:
- ColorProcessing:
...
then call
qcam -platform eglfs -c /base/i2c@ff190000/camera@36
While this is running, control the focus lens driver with:
v4l2-ctl -d /dev/v4l-subdev5 -c focus_absolute=150
and change the focus_absolute value to see the lens moving and the focus
change.
I'll try to have a look at libcamera's config file so I can send a
proper one to the project instead of this dummy one.
---
.../rockchip/px30-ringneck-haikou-video-demo.dtso | 56 ++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/px30-ringneck-haikou-video-demo.dtso b/arch/arm64/boot/dts/rockchip/px30-ringneck-haikou-video-demo.dtso
index 7d9ea5aa598486680191d52e4c87af59f7b0e579..1e3f43bbe1734e5c88d1f76f8f7a545d881df88d 100644
--- a/arch/arm64/boot/dts/rockchip/px30-ringneck-haikou-video-demo.dtso
+++ b/arch/arm64/boot/dts/rockchip/px30-ringneck-haikou-video-demo.dtso
@@ -94,6 +94,15 @@ video-adapter-led {
};
};
+&cif_clkout_m0 {
+ rockchip,pins =
+ <2 RK_PB3 1 &pcfg_pull_none_12ma>;
+};
+
+&csi_dphy {
+ status = "okay";
+};
+
&display_subsystem {
status = "okay";
};
@@ -135,6 +144,12 @@ &i2c1 {
/* OV5675, GT911, DW9714 are limited to 400KHz */
clock-frequency = <400000>;
+ focus: focus@c {
+ compatible = "dongwoon,dw9714";
+ reg = <0xc>;
+ vcc-supply = <&cam_afvdd_2v8>;
+ };
+
touchscreen@14 {
compatible = "goodix,gt911";
reg = <0x14>;
@@ -157,6 +172,47 @@ pca9670: gpio@27 {
pinctrl-names = "default";
reset-gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
};
+
+ camera@36 {
+ compatible = "ovti,ov5675";
+ reg = <0x36>;
+ clocks = <&cru SCLK_CIF_OUT>;
+ assigned-clocks = <&cru SCLK_CIF_OUT>;
+ /* Only parent to get exactly 19.2MHz */
+ assigned-clock-parents = <&cru USB480M>;
+ assigned-clock-rates = <19200000>;
+ avdd-supply = <&cam_avdd_2v8>;
+ dvdd-supply = <&cam_dvdd_1v2>;
+ dovdd-supply = <&cam_dovdd_1v8>;
+ lens-focus = <&focus>;
+ orientation = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&cif_clkout_m0>;
+ reset-gpios = <&pca9670 6 GPIO_ACTIVE_LOW>;
+ rotation = <180>;
+
+ port {
+ cam_out: endpoint {
+ data-lanes = <1 2>;
+ link-frequencies = /bits/ 64 <450000000>;
+ remote-endpoint = <&mipi_in_cam>;
+ };
+ };
+ };
+};
+
+&isp {
+ status = "okay";
+
+ ports {
+ port@0 {
+ mipi_in_cam: endpoint@0 {
+ reg = <0>;
+ data-lanes = <1 2>;
+ remote-endpoint = <&cam_out>;
+ };
+ };
+ };
};
&pinctrl {
---
base-commit: fee3e843b309444f48157e2188efa6818bae85cf
change-id: 20250516-ringneck-haikou-video-demo-cam-420685fb7f9f
Best regards,
--
Quentin Schulz <quentin.schulz@cherry.de>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] arm64: dts: rockchip: support camera module on Haikou Video Demo on PX30 Ringneck
2025-05-16 17:26 [PATCH] arm64: dts: rockchip: support camera module on Haikou Video Demo on PX30 Ringneck Quentin Schulz
@ 2025-06-09 9:56 ` Heiko Stuebner
0 siblings, 0 replies; 2+ messages in thread
From: Heiko Stuebner @ 2025-06-09 9:56 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Quentin Schulz
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Quentin Schulz
Hi Quentin,
Am Freitag, 16. Mai 2025, 19:26:10 Mitteleuropäische Sommerzeit schrieb Quentin Schulz:
> +&isp {
> + status = "okay";
> +
> + ports {
> + port@0 {
> + mipi_in_cam: endpoint@0 {
> + reg = <0>;
> + data-lanes = <1 2>;
> + remote-endpoint = <&cam_out>;
> + };
> + };
> + };
> };
dtc is quite unhappy about this construct ;-) .
with a W=1 build option when compiling DTBs we end up with a number
of complaints about missing and/or unneeded address-cells/size-cells
or "only one endpoint, @0 not necessary".
I think it would make sense to give the isp port a phandle in the
px30.dtsi and reference that one here - similar to how the dsi-panel
works.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-09 9:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-16 17:26 [PATCH] arm64: dts: rockchip: support camera module on Haikou Video Demo on PX30 Ringneck Quentin Schulz
2025-06-09 9:56 ` Heiko Stuebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).