From patchwork Fri Nov 17 09:28:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jai Luthra X-Patchwork-Id: 166031 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp406229vqn; Fri, 17 Nov 2023 01:31:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJ21YvOMmQH64Rh9gajpdzraLEms7yk2d+xkrGzCPERaopEL9Yv7UL1UQzKZ41952aAgkl X-Received: by 2002:a05:6870:a54d:b0:1ea:b1c:b859 with SMTP id p13-20020a056870a54d00b001ea0b1cb859mr22200586oal.35.1700213498664; Fri, 17 Nov 2023 01:31:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700213498; cv=none; d=google.com; s=arc-20160816; b=zvF2H00PHHokDo2l8GnuQRbb2NbH+JJKYDIffKHWDdcP9FQ2oIiToEwOMho8/s6dYw c6YRF4GfKfBjZZsKGDfDQsy3uNcl+DZJ1hX0O4lzo9DIMRGCPkxE4C6C0LmrE58tIPTp O720mz6UKubUP1LseZjKsVLI9F4BU0xhrWhG3b8xxFzyXJ3QknwwwLNFX+LCj3aeZ+h6 fQYq/Hzj415zjBEDb3lURd6tpRoSjcz2rhyuBuSi0wg+dkm81MffBu9O4kxAPYlVPa6/ cPwTuP5C7NMHf018wgvYmUL2NTafmIYpmkEhfI62eu+6XxDr/GyvUq2MmORbJoKGzEVf ydOw== 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=JauA4khxPK7o+cjNFoIdPKmFCznz5fnmYpVeAGFpL7XaSC7yjGHYX4E6A+tCi37NyL 4081NPb+DBJ5776cLwEDgyWxb81viy78p720ouelCFvD20BJZhil8oS/gfJuEuwpQpOZ OHb95+j+FDXnmAvg7bPYw804j1VL4/a+rQHRpVPyYt0wI0XyNSCJb3GOHxs27fyY4hKm isSOFMy23W51UawPAB/EqjBFAbffZciHAJ/j73eyIJn2rjs/lt3CZpnMV0P7ltT55ask z0X7warB76IXuYxOZ7sGByK5cYelASP8scDZtO4LN3epu8hnrgobqkc4lXyAhtK4AOXe /NvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ncT3qPkY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id d16-20020a63ed10000000b00578c64433d5si1452590pgi.877.2023.11.17.01.31.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 01:31:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ncT3qPkY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id A4DE5806A11A; Fri, 17 Nov 2023 01:30:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345824AbjKQJa1 (ORCPT + 30 others); Fri, 17 Nov 2023 04:30:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345749AbjKQJaH (ORCPT ); Fri, 17 Nov 2023 04:30:07 -0500 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3005ED71; Fri, 17 Nov 2023 01:30:03 -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 3AH9TcY0083286; Fri, 17 Nov 2023 03:29:38 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1700213378; bh=zmcZXRnf/O3DHdDwB61wPRcAg+uD5m20ddO3L0EkAuE=; h=From:Date:Subject:References:In-Reply-To:To:CC; b=ncT3qPkYiKnZ5cENqAGidjDL32UYz7lCk8ehwEk83DAsUyi3I2VLlVLDLV2HU2+iE kNe+3BjROyoo22W0ZhVMKKvoDszfviScw2/t19eAIoaC2wyyzxwr2gkOivbkZoPqzu 6BWqTAzTqw4kZ3P6Wm7Xq+3xx14imvINxRr+i6Hg= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3AH9Tc6H014620 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Nov 2023 03:29:38 -0600 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 17 Nov 2023 03:29:38 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE113.ent.ti.com (157.170.170.24) 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; Fri, 17 Nov 2023 03:29:38 -0600 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3AH9TbUW017776; Fri, 17 Nov 2023 03:29:37 -0600 From: Jai Luthra Date: Fri, 17 Nov 2023 14:58:12 +0530 Subject: [PATCH v2 4/9] arm64: dts: ti: k3-am625-beagleplay: Add overlays for OV5640 MIME-Version: 1.0 Message-ID: <20231117-csi_dts-v2-4-bf4312194a6b@ti.com> References: <20231117-csi_dts-v2-0-bf4312194a6b@ti.com> In-Reply-To: <20231117-csi_dts-v2-0-bf4312194a6b@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/ZANAwAIAUPekfkkmnFFAcsmYgBlVzJvNLiVWucMa2ZUVO/AtYWDMBhGJC9qoluCV MuRRmKuhU+JAjMEAAEIAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCZVcybwAKCRBD3pH5JJpx RWUDEACH8TepHetL6WZE2rdj01b8z/iN4EfT3TBflZ66chhEwQP3XEXpcq+TKjIxFfmd8lzwXxX CzPUqCZeBag3+7yTfP4PIigXUXs+U/ULplcGM647G9oPGTxZJgCRwSYF5q48px1dy7iVxNxAvlq apJMHwS+pni5MNTfxdTONpb1VihQX2/rVN42OMiwdKLmVQO239aaNLyd75337duc7F6w347AMFj RU/ZkT09oGQy3knfJbSx86T69ypH8vw7/AK6i54FbKdLqN5yVNuqMUQJRT+6DfqJkEi6mXx5WvY Ru1uoM9HLlKNkjiYMtAxICN/ZO8HXbT1OpIktw6yJL5lXBcrlCkzeMmR0mpPQc5x27mllGI0Qh3 xz+ULBrNbMeVe3NTbvyncCidGJ3Wa7ocMrA559kliSousX2KYAvXAEBnfowbkk65m8Zh20StnPr th37uaVeM3muZu0C9d+ApJJv2GyfiORtn62572vDaCeouxQLkn1uMHxDaaAmEOrNvbB5UthWQs1 7kd/ifj80vSB13auNDiWxEpQXdPgEgayI32kE1BkU4j5sA+L2XXm2vKiZYdESJJUaNR/cIMlYi9 0v9pXVfdLik0V0ewS5TLrYByTpVsTbmcSErOfprYLqjTp5MXMTgNGanz1t2shsDyVQXPe4aByRW j3LjVOWt+YKfYiQ== 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=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 17 Nov 2023 01:30:31 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782803069594148660 X-GMAIL-MSGID: 1782803069594148660 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"; +};