From patchwork Tue Nov 28 10:09:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jai Luthra X-Patchwork-Id: 170669 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3806760vqx; Tue, 28 Nov 2023 02:11:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRCJ1A+KOgif6V7LeqnN7o6A0rz0qtV9OYM14L+wNeAvSMcO1rPEugBWhre/mba0aoXznF X-Received: by 2002:a17:902:e750:b0:1cf:c02f:6cea with SMTP id p16-20020a170902e75000b001cfc02f6ceamr7310837plf.69.1701166284142; Tue, 28 Nov 2023 02:11:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701166284; cv=none; d=google.com; s=arc-20160816; b=bSt9Lzgeevd51iT97npHpBE6YlVwElmkh6PkHVWJupyOjchcNHOaxCH6ysDtoLqy3A U0B9XkWsqG54XSZBf/oVJ+ECJU6ry9LCr73UuQjq3/D88alJng1kdqA9nfqdrRUdepAL W6gi8J4b+SmgUFlw5Q0cC1dNzGIasVXSJmN7bvWKrexfY4DZ8zYiIS+GDn85vmDI47dC OjCFzfreTUknOdkYSssy/hEMrx3oJhbBcdXLKExeRDjjt+j3yB/g14J3wY+L0RypMpkm gDdXpueraQkjBIUePu03AKkqVVlksHd1Q8XqxtRcqilftsBrJe77YgQ+66OWTzOrgpNb 0zCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=zmcZXRnf/O3DHdDwB61wPRcAg+uD5m20ddO3L0EkAuE=; fh=gjf50MpIeI4y7DsLDR8KPyZZDZn0L+YVyMCrolRSpx0=; b=cgq5HTj163IBald/TXOpt93sbSoUJXSLeygJTiKs9TbTNDGmWQ/EQMYzeIRuQ5wRTy 86qTHpiW92j2R02O363zTrKJipRXdB4Ga05MWe8Oc+RyEvYpDRfdWzp4DKp3AaAPmf4I b4sJ+82NHiY9lPLpRT6v+simh4Xr/EWybKA3LSGQwsynqhX/3SNphvUccN4BKcI/XB7l 5BueuKbTfMPSJL+8uxEZWSMQJzdbvxUhbr1e+8B1N02l3uMJ+EOqO75o8G/F2k+CbtMz mc2HWI9/pOaWvmdoqiUQy6Tuaky44sWPDTrqzzd82KiW4WMpfuUgzEHfWQQm4cSGtrNl EIRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=T9ZbWFRu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id jj19-20020a170903049300b001ce64a096dfsi10564488plb.502.2023.11.28.02.11.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 02:11:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=T9ZbWFRu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 11DA08057B1E; Tue, 28 Nov 2023 02:11:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344278AbjK1KLB (ORCPT + 99 others); Tue, 28 Nov 2023 05:11:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234668AbjK1KKh (ORCPT ); Tue, 28 Nov 2023 05:10:37 -0500 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C71BDE; Tue, 28 Nov 2023 02:10:43 -0800 (PST) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3ASAATqg120125; Tue, 28 Nov 2023 04:10:29 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1701166229; bh=zmcZXRnf/O3DHdDwB61wPRcAg+uD5m20ddO3L0EkAuE=; h=From:Date:Subject:References:In-Reply-To:To:CC; b=T9ZbWFRuUqq3RGOkrsK19AvPAVhnSpt1HexxO6UrAsg6qRODAeqalWeCtPYc8cxxO yi1QR3wfbh7DTBEwFUpS2x3QafYomw20BNWmKaRyPR0SuL/lW3EUGBQfrB10nw0YN+ Nb4Dytwjt5c4MUG0vN5lMVZZH4QQbGK6zddLuZqo= Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3ASAATjt017615 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 28 Nov 2023 04:10:29 -0600 Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 28 Nov 2023 04:10:28 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 28 Nov 2023 04:10:28 -0600 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3ASAARto101282; Tue, 28 Nov 2023 04:10:28 -0600 From: Jai Luthra Date: Tue, 28 Nov 2023 15:39:46 +0530 Subject: [PATCH v3 4/9] arm64: dts: ti: k3-am625-beagleplay: Add overlays for OV5640 MIME-Version: 1.0 Message-ID: <20231128-csi_dts-v3-4-0bb11cfa9d43@ti.com> References: <20231128-csi_dts-v3-0-0bb11cfa9d43@ti.com> In-Reply-To: <20231128-csi_dts-v3-0-0bb11cfa9d43@ti.com> To: Catalin Marinas , Will Deacon , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: , , , Aradhya Bhatia , Devarsh Thakkar , Vaishnav Achath , Julien Massot , Martyn Welch , Matthias Schiffer , Jai Luthra X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=5458; i=j-luthra@ti.com; h=from:subject:message-id; bh=LIC3GIHhXLdiNuoGc+jg9VpDQIUTmYS+YEWHfVAN6Rc=; b=owEBbQKS/ZANAwAIAUPekfkkmnFFAcsmYgBlZbyBlxjxOPWImJC60Ce1smFslsQN+JBv1tuVT F9DdqekivWJAjMEAAEIAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCZWW8gQAKCRBD3pH5JJpx Rey3EACvYh6WMjPGZNZ9JNpg8breBA+EJMVinCKAACHb7FgiE+b+BhYcflBPiOgz0h9FyuzQic6 Jv3yS6/cRYcQ9Pxzj7boLmi8DjBT3MUgTB2lONUGHOxg9A6TIofDqt6ZD6YCLbca9IWlwrI97fG NhQmOMBc0D2EhsOESou0pZ/wCzD2np0vC4FPdror4C+zg8ujiEEBC+9IrbmcvBHLtWATuz53Ifa nhZgWGHnegssQMbQNMIdyvMGQ+TKMmwDfpV77MPDps9ETi0QgSh/RXKyN4KwGVeHU7C0vtA1kD8 wnTEcBpUbD7G/T+WZwTfsSestODrU4Ncjo7cMPYQL/QiFdNgxjNOfBLW02W4q+ahGhixarSIA/9 nCb2HX10XSTe8HbfvcDiwXv+hVKoOVsOCNe4K+RlFZM7orMtyh4q0Rxi3z6tdyBpmhXVz0ttJOz vz8gK7YD+ML5Iz1vf9HnTvhxQGQVxOu4refJw8Eil3NXR28OZ3OTTUUUoAK80w7yiR1KI3uyT2C q6D5JcmhNdA3wJfqvIw9E7Rc2SPWI19u+rScHyn+qJ4hM1yaZOdnF1H+/j5ChSlBmcCXsBsfX3o b5Gw+0KdPLEd1Gwm8ZzNaoadTc8oh32CZvKoereT4yS/wTRTChquPdLPlWNebfvVIWfzWkb7Mgx VVGtWvK/p2P4tTA== X-Developer-Key: i=j-luthra@ti.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 28 Nov 2023 02:11:18 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783802137416117503 X-GMAIL-MSGID: 1783802137416117503 Three different OV5640 modules are supported using the FFC connector on BeaglePlay: - Digilent PCam 5C - ALINX AN5641 - TEVI-OV5640-*-RPI The Digilent and ALINX modules supply a 12Mhz XCLK to the sensor, while the TEVI module supplies a 24Mhz XCLK, thus requiring a separate overlay. Signed-off-by: Jai Luthra Reviewed-by: Andrew Davis --- arch/arm64/boot/dts/ti/Makefile | 11 ++++ .../dts/ti/k3-am625-beagleplay-csi2-ov5640.dtso | 77 ++++++++++++++++++++++ .../ti/k3-am625-beagleplay-csi2-tevi-ov5640.dtso | 77 ++++++++++++++++++++++ 3 files changed, 165 insertions(+) diff --git a/arch/arm64/boot/dts/ti/Makefile b/arch/arm64/boot/dts/ti/Makefile index 77a347f9f47d..c6c7825b4cb2 100644 --- a/arch/arm64/boot/dts/ti/Makefile +++ b/arch/arm64/boot/dts/ti/Makefile @@ -12,6 +12,8 @@ k3-am625-sk-hdmi-audio-dtbs := k3-am625-sk.dtb k3-am62x-sk-hdmi-audio.dtbo k3-am62-lp-sk-hdmi-audio-dtbs := k3-am62-lp-sk.dtb k3-am62x-sk-hdmi-audio.dtbo dtb-$(CONFIG_ARCH_K3) += k3-am625-beagleplay.dtb +dtb-$(CONFIG_ARCH_K3) += k3-am625-beagleplay-csi2-ov5640.dtbo +dtb-$(CONFIG_ARCH_K3) += k3-am625-beagleplay-csi2-tevi-ov5640.dtbo dtb-$(CONFIG_ARCH_K3) += k3-am625-phyboard-lyra-rdk.dtb dtb-$(CONFIG_ARCH_K3) += k3-am625-sk.dtb dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-nonwifi-dahlia.dtb @@ -80,7 +82,16 @@ dtb-$(CONFIG_ARCH_K3) += k3-j721s2-evm.dtb dtb-$(CONFIG_ARCH_K3) += k3-am69-sk.dtb dtb-$(CONFIG_ARCH_K3) += k3-j784s4-evm.dtb +# Build time test only, enabled by CONFIG_OF_ALL_DTBS +k3-am625-beagleplay-csi2-ov5640-dtbs := k3-am625-beagleplay.dtb \ + k3-am625-beagleplay-csi2-ov5640.dtbo +k3-am625-beagleplay-csi2-tevi-ov5640-dtbs := k3-am625-beagleplay.dtb \ + k3-am625-beagleplay-csi2-tevi-ov5640.dtbo +dtb- += k3-am625-beagleplay-csi2-ov5640.dtb \ + k3-am625-beagleplay-csi2-tevi-ov5640.dtb + # Enable support for device-tree overlays +DTC_FLAGS_k3-am625-beagleplay += -@ DTC_FLAGS_k3-am625-sk += -@ DTC_FLAGS_k3-am62-lp-sk += -@ DTC_FLAGS_k3-am6548-iot2050-advanced-m2 += -@ diff --git a/arch/arm64/boot/dts/ti/k3-am625-beagleplay-csi2-ov5640.dtso b/arch/arm64/boot/dts/ti/k3-am625-beagleplay-csi2-ov5640.dtso new file mode 100644 index 000000000000..5e80ca7033ba --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-am625-beagleplay-csi2-ov5640.dtso @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * ALINX AN5641 & Digilent PCam 5C - OV5640 camera module + * Copyright (C) 2022-2023 Texas Instruments Incorporated - https://www.ti.com/ + */ + +/dts-v1/; +/plugin/; + +#include + +&{/} { + clk_ov5640_fixed: ov5640-xclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <12000000>; + }; +}; + +&main_gpio0 { + p11-hog { + /* P11 - CSI2_CAMERA_GPIO1 */ + gpio-hog; + gpios = <11 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "CSI2_CAMERA_GPIO1"; + }; +}; + +&wkup_i2c0 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + ov5640: camera@3c { + compatible = "ovti,ov5640"; + reg = <0x3c>; + + clocks = <&clk_ov5640_fixed>; + clock-names = "xclk"; + + port { + csi2_cam0: endpoint { + remote-endpoint = <&csi2rx0_in_sensor>; + clock-lanes = <0>; + data-lanes = <1 2>; + }; + }; + }; +}; + +&cdns_csi2rx0 { + ports { + #address-cells = <1>; + #size-cells = <0>; + + csi0_port0: port@0 { + reg = <0>; + status = "okay"; + + csi2rx0_in_sensor: endpoint { + remote-endpoint = <&csi2_cam0>; + bus-type = <4>; /* CSI2 DPHY. */ + clock-lanes = <0>; + data-lanes = <1 2>; + }; + }; + }; +}; + +&dphy0 { + status = "okay"; +}; + +&ti_csi2rx0 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/ti/k3-am625-beagleplay-csi2-tevi-ov5640.dtso b/arch/arm64/boot/dts/ti/k3-am625-beagleplay-csi2-tevi-ov5640.dtso new file mode 100644 index 000000000000..5e1cbbc27c8f --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-am625-beagleplay-csi2-tevi-ov5640.dtso @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Technexion TEVI-OV5640-*-RPI - OV5640 camera module + * Copyright (C) 2022-2023 Texas Instruments Incorporated - https://www.ti.com/ + */ + +/dts-v1/; +/plugin/; + +#include + +&{/} { + clk_ov5640_fixed: ov5640-xclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24000000>; + }; +}; + +&main_gpio0 { + p11-hog { + /* P11 - CSI2_CAMERA_GPIO1 */ + gpio-hog; + gpios = <11 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "CSI2_CAMERA_GPIO1"; + }; +}; + +&wkup_i2c0 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + ov5640: camera@3c { + compatible = "ovti,ov5640"; + reg = <0x3c>; + + clocks = <&clk_ov5640_fixed>; + clock-names = "xclk"; + + port { + csi2_cam0: endpoint { + remote-endpoint = <&csi2rx0_in_sensor>; + clock-lanes = <0>; + data-lanes = <1 2>; + }; + }; + }; +}; + +&cdns_csi2rx0 { + ports { + #address-cells = <1>; + #size-cells = <0>; + + csi0_port0: port@0 { + reg = <0>; + status = "okay"; + + csi2rx0_in_sensor: endpoint { + remote-endpoint = <&csi2_cam0>; + bus-type = <4>; /* CSI2 DPHY. */ + clock-lanes = <0>; + data-lanes = <1 2>; + }; + }; + }; +}; + +&dphy0 { + status = "okay"; +}; + +&ti_csi2rx0 { + status = "okay"; +};