From patchwork Fri Dec 1 05:09:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jai Luthra X-Patchwork-Id: 172250 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp889583vqy; Thu, 30 Nov 2023 21:10:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMWPb0b0+z6LIdtZrggtKkS2+tEfXQgRfCi7W7aWXJmaFE5WWJV2XYRo3yk18+S2pTJJXL X-Received: by 2002:a05:6a21:6d98:b0:18c:376d:fbe8 with SMTP id wl24-20020a056a216d9800b0018c376dfbe8mr22919884pzb.41.1701407449853; Thu, 30 Nov 2023 21:10:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701407449; cv=none; d=google.com; s=arc-20160816; b=YI7TJdUg3Hmkr6qAji4g1GGptcUYDs7Iz33Wdb/WwDFzpWCP1iFe7qk7WY6QEH9rAW Gp2td/VzVhU+JSQ57UIqcYDIorTJhGXR4dlEpwN7nQMrbhBMpRrriZwgRD1XAp0c3F9L qreAWsV02IHaBWhyJpp8JSh074Jdo4szRZUIohZ4gjkHZjzpbzwa8doEYkQWvBihSkU/ 9HQKqqMbgQet/1noO4AkbVm0hiFU7LMPJq8Hi2OlDq4AhRk11HpCsm4YCb0W8nL0rHER CvuixMi/Rl0mbnZlKhYdS+2eaxN6J+9iZM6x24nyP0EFmBLwSQHy0HP6HT3lTl9ZEhn4 wlxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TXwdryAk3KvLew2aYZTv2br41TDQVy4Et3R1+LZ2JEU=; fh=PDawwUYW755NePhH5FRrjcMB44FRTef/amC8zj9bqUk=; b=jNGzpS23OUhcaYs8F90o0y3mGC41UJO1PEZhpWF+TC8ETG2Kya+8/Cnx6izuhhp/Iy IUsMhXoSBxiXu0WSGUYJaPHZGASiSoiYYWTikSImRjKCwX9EjEB+y1qyvILqpd/U5mCv dy6akwHeqaR5PscdFzZpdSCBYemcIWZH+8qqzpyIzVikj7ZROx6CQhC2Z5L00pDiz5Dd V630d0++lbFlkAzp0ZcYb879mWKnL+wR6AutRZJWN5Ck8I57bSJSxEUm4KnDM2bipyxc JyDDDLC77L9xvLzB8HUaahQc8/gU4DnOrtGYfC2MgWrmdCGySQ8aZ8+j5NJatJb2AhNY XHVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=XLYW52m4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id z39-20020a056a001da700b006b6cc63a79csi2617423pfw.330.2023.11.30.21.10.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 21:10:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=XLYW52m4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id A1B0E803DB35; Thu, 30 Nov 2023 21:10:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377547AbjLAFKe (ORCPT + 99 others); Fri, 1 Dec 2023 00:10:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377544AbjLAFKV (ORCPT ); Fri, 1 Dec 2023 00:10:21 -0500 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F8511736; Thu, 30 Nov 2023 21:10:18 -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 3B15A6S3025870; Thu, 30 Nov 2023 23:10:06 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1701407406; bh=TXwdryAk3KvLew2aYZTv2br41TDQVy4Et3R1+LZ2JEU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=XLYW52m4Vz/kmF7ND/xMgMMwylETk3OvwR8dq7OuV+/RKSVMEgOV94c1sXlz2qhnY xHLBIyJItiTdIyrUgxF8F/Vx1kLHg5XOYxUhInXZFeZ0LQ3EDICaru4yo2gCIbctkt /GuPG6PWnTOV0bRMTc3lNdk1Ey76KGlLY8h+mLl0= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3B15A6YM007066 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 30 Nov 2023 23:10:06 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 30 Nov 2023 23:10:06 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE115.ent.ti.com (157.170.170.26) 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; Thu, 30 Nov 2023 23:10:06 -0600 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3B15A5UX023469; Thu, 30 Nov 2023 23:10:06 -0600 From: Jai Luthra To: Catalin Marinas , Will Deacon , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: Jai Luthra , , , , Aradhya Bhatia , Devarsh Thakkar , Vaishnav Achath , Julien Massot , Martyn Welch , Matthias Schiffer , Andrew Davis Subject: [PATCH RESEND v3 4/9] arm64: dts: ti: k3-am625-beagleplay: Add overlays for OV5640 Date: Fri, 1 Dec 2023 10:39:19 +0530 Message-ID: <20231201-csi_dts-v3-4-9f06f31080fe@ti.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231201-csi_dts-v3-0-9f06f31080fe@ti.com> References: <20231201-csi_dts-v3-0-9f06f31080fe@ti.com> MIME-Version: 1.0 X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=5498; i=j-luthra@ti.com; h=from:subject:message-id; bh=M+9Rsg0ibVClxe5Zu6Qc5VQ9yb+dxt+bKYeHE5oBfWY=; b=owEBbQKS/ZANAwAIAUPekfkkmnFFAcsmYgBlaWYLpWzNFEZMhTV0jPd1JpYlVbbW3uzTwy08x pqnOR7FvhWJAjMEAAEIAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCZWlmCwAKCRBD3pH5JJpx RSunD/9AxVxPl2O4Dvks18M9Kfmt/+OddmH2jaW8hVkHwWOg3u7HC5xIJXOTjef5cBI0jR/lSL3 IYCNuLL1Kkl9M+c8sV3aGF3I+nH8f88jpNC+ZUQ0eh/gzmLGJByy3p6B54wvvqD7iXub+iJTIy1 8ZHSzAduNArOskFk9XcQRyHH91+fhj7lZKempge/tZypNQCRjXm3hOo3zwFnwNaFSbXLasg4HwC 7mWOX5hHM9eAfkIyhfqzR/1EqeU3z1PmF/I76gHeknInFktAhYAf4L8kac1yLC5fuwQ10Re94ky 1l070zDCnSVbpM4RtXaK7/2u2Hqq+szRxs+yxL2t5hKgaAfdpeHACg/juY4vDwqEdkmtrSK6Pfj 9a+ahvCNybMgqpEDhFGghn4khPVpSFo9rbNdZOf7FM8gRqB5vsJDT/msFT5Ai2FHwMvY40JYbrF bef/yClxzP54mjoi2j5RWYHymorzSiSPGufiCW1qomJYfNmbtLBWgdxbDVKS7Pre1vMDAnUMoHK JBKwr3juOZo7fkfZS1wFZwRxG0VZ0WW8BXL4bNI4FjbHCO7NVG7ZgEBWtOgyxkJsPPz/PfkdXxn 60XQe/QjV7A9jCCT9U34i7ZRL1uxZ5RCdEUp45e/sd+PtY3nI20bGb06oGlSQWetBVQUH+YB/3S 6ZhmSvDKNIuvRQw== 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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 30 Nov 2023 21:10:43 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784055018339742855 X-GMAIL-MSGID: 1784055018339742855 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. Reviewed-by: Andrew Davis Signed-off-by: Jai Luthra --- 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(+) -- 2.42.1 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"; +};