From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 905D82D29CC; Fri, 20 Jun 2025 15:21:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750432911; cv=none; b=iebmdW1P1xM8kNn2TNQSNO7biz1BXLRIbuUhWo0slGtwsMsSRN+oFlLSGvFB6u1y7PWn/+BldC9Yrlkfj4OORfI+k7NyvngX/xuN22TfZq3TREro1E4ibzOlKAnLnv2o8VpvWTVryShqTkImejbkCUgrqwBl5xGVWiaecZTbs0c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750432911; c=relaxed/simple; bh=LGnSFN9H9rbozGSNGVsWo0FtVKSQwW61jLk2zd/IGI8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pZp2P0yWEhhm//UXnHNP/F3eK5s10wCb5AH2pZ2/vJWGxfzmpodOKRw4ygyKBNViHP7iYD4cGd6sC79Is5UPFMZv0ms3Xs7iNxI7MRANOEf4hLWa3Kchm54XW7MPlfqzFpLTf1574D70G3fcQKF02ffSUFVpxrCZHrRRkcZiK4U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=FBEHMOt3; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="FBEHMOt3" Received: by mail.gandi.net (Postfix) with ESMTPSA id CB8D44326A; Fri, 20 Jun 2025 15:21:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1750432906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9nY0S3h9TNbvjPa0oqXiKssMDiiZYbdnLuZAy4PGUKk=; b=FBEHMOt3QA2tcRmg1IhTgJpD0kDH1a6QghFDUG9YKdXBL1/I3I536lWB8AdIqODJiCAcW2 9Q6vTKNX4DtrAwGRqJCs3M/aZP+6z4/Ukoik0FB2Tn6Rz5GlXr7meC6NihPF7CnWK0mDzs WRPnbP8uJaefVnSXFc6P6McyZqyvx3cFUrLzRtPdHu00FzmdVbmq3C69sTBTtjh6QLO9fm yEQMPP2E+WLiwC238XM5Tgz6zmFNWEUATafkTmf/D6P+A27pWzQr0FOX+2xFSdlgdobxOi 00dJ9s42pIeng7pJay1IdSM/asFH6pz0hsUYQWhXGLaE31YcQu01MbP1+aLC/w== From: Olivier Benjamin Date: Fri, 20 Jun 2025 17:21:35 +0200 Subject: [PATCH v4 4/4] arm64: dts: rockchip: describe the OV8858 user camera on PinePhone Pro Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250620-camera-v4-4-0201a8ed5fae@bootlin.com> References: <20250620-camera-v4-0-0201a8ed5fae@bootlin.com> In-Reply-To: <20250620-camera-v4-0-0201a8ed5fae@bootlin.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Jacopo Mondi , Nicholas Roth , Mauro Carvalho Chehab , Sakari Ailus , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: Thomas Petazzoni , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Krzysztof Kozlowski , imx@lists.linux.dev, Olivier Benjamin , ~diederik/pine64-discuss@lists.sr.ht, Dragan Simic , Ondrej Jirman X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgdekjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeenucfhrhhomhepqfhlihhvihgvrhcuuegvnhhjrghmihhnuceoohhlihhvihgvrhdrsggvnhhjrghmihhnsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeegueegiedvvdevveevvddufeejvefftdeugfffkeeileehheefieehgfelfeeileenucfkphepvdgrtddumegvfeegmegvtgefkeemvdegvgdtmehfhegtvgemfhefgedvmeeiheekjeemfheiheeinecuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehinhgvthepvdgrtddumegvfeegmegvtgefkeemvdegvgdtmehfhegtvgemfhefgedvmeeiheekjeemfheiheeipdhhvghloheplgduledvrdduieekrddurddvtdgnpdhmrghilhhfrhhomhepohhlihhvihgvrhdrsggvnhhjrghmihhnsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedvgedprhgtphhtthhopeimughivgguvghrihhksdhpihhnvgeigedqughishgtuhhssheslhhishhtshdrshhrrdhhthdprhgtphhtthhopehrohgshheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhhitghhohhlrghssehrohhth hgvmhgrihhlrdhnvghtpdhrtghpthhtohepjhgrtghophhordhmohhnughisehiuggvrghsohhnsghorghrugdrtghomhdprhgtphhtthhopeholhhivhhivghrrdgsvghnjhgrmhhinhessghoohhtlhhinhdrtghomhdprhgtphhtthhopehmtghhvghhrggssehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehimhigsehlihhsthhsrdhlihhnuhigrdguvghv X-GND-Sasl: olivier.benjamin@bootlin.com Add the description of the front/user camera (OV8858) on the PinePhone Pro to the device dts file. It receives commands over SCCB, an I2C-compatible protocol, at I2C address 0x36 and transmits data over CSI-MIPI. I confirmed this address experimentally. The pin control mapping was again extracted from the PinePhone Pro schematic v1.0 as well as the RK3399 datasheet revision 1.8. Table 2-3 in section 2.8 of the RK3399 datasheet contains the mapping of IO functions for the SoC pins. Page 52 shows GPIO1_A4, page 54 shows GPIO2_B4. For the reset (RESET) signal: page 11 quadrant D2 | p.18 q.B3-4 | p.18 q.C2 RK3399_E.R28 -> GPIO1_A4 -> Camera2_RST -> MIPI_RST1 -> OV8858.12 For the powerdown (PWDN) signal: page 9 quadrants D4-5 | p.18 q.B2 RK3399_L.F31 -> GPIO2_B4 -> DVP_PDN0_H -> OV8858.14 Helped-by: Dragan Simic Co-developed-by: Ondrej Jirman Signed-off-by: Ondrej Jirman Signed-off-by: Olivier Benjamin --- .../boot/dts/rockchip/rk3399-pinephone-pro.dts | 49 +++++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts index b335d044138b413359ba54269ab646142254a55f..c1a151ed4215638895ef5c9872d746dca38cb671 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts @@ -454,7 +454,7 @@ wcam: camera@1a { reg = <0x1a>; clocks = <&cru SCLK_CIF_OUT>; /* MIPI_MCLK0, derived from CIF_CLKO */ pinctrl-names = "default"; - pinctrl-0 = <&camera_rst>; + pinctrl-0 = <&camera_rst_l>; /* Note: both cameras also depend on vcca1v8_codec to power the I2C bus. */ vif-supply = <&vcc1v8_dvp>; vana-supply = <&avdd2v8_dvp>; @@ -479,6 +479,27 @@ wcam_lens: camera-lens@c { /* Same I2c bus as both cameras, depends on vcca1v8_codec for power. */ vcc-supply = <&vcc1v8_dvp>; }; + + ucam: camera@36 { + compatible = "ovti,ov8858"; + reg = <0x36>; + clocks = <&cru SCLK_CIF_OUT>; /* MIPI_MCLK1, derived from CIF_CLK0 */ + clock-names = "xvclk"; + pinctrl-names = "default"; + pinctrl-0 = <&camera2_rst_l &dvp_pdn0_h>; + dovdd-supply = <&vcc1v8_dvp>; + reset-gpios = <&gpio1 RK_PA4 GPIO_ACTIVE_LOW>; + powerdown-gpios = <&gpio2 RK_PB4 GPIO_ACTIVE_LOW>; + orientation = <0>; /* V4L2_CAMERA_ORIENTATION_FRONT */ + rotation = <90>; + + port { + ucam_out: endpoint { + remote-endpoint = <&mipi_in_ucam>; + data-lanes = <1 2 3 4>; + }; + }; + }; }; &i2c3 { @@ -523,6 +544,24 @@ &io_domains { status = "okay"; }; +&isp0 { + status = "okay"; + + ports { + port@0 { + mipi_in_ucam: endpoint@0 { + reg = <0>; + remote-endpoint = <&ucam_out>; + data-lanes = <1 2 3 4>; + }; + }; + }; +}; + +&isp0_mmu { + status = "okay"; +}; + &isp1 { status = "okay"; @@ -594,10 +633,16 @@ pwrbtn_pin: pwrbtn-pin { }; }; - camera { + cameras { camera_rst_l: camera-rst-l { rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; }; + camera2_rst_l: camera2-rst-l { + rockchip,pins = <1 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; + }; + dvp_pdn0_h: dvp-pdn0-h { + rockchip,pins = <2 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>; + }; }; leds { -- 2.49.0