Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2461530rwb; Sat, 24 Sep 2022 08:43:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6nBCEUn6N9H806fouDe0PX2AQr0YB4Xmd2TdK1BCuK1vtkU2/dexU/dMZ3ZuZiH9jFHiVc X-Received: by 2002:a17:90a:c711:b0:202:5cda:765c with SMTP id o17-20020a17090ac71100b002025cda765cmr27928763pjt.35.1664034225443; Sat, 24 Sep 2022 08:43:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664034225; cv=none; d=google.com; s=arc-20160816; b=sWUqiLBY6M6GIokTnYqj2UT0Bi97wuyWryl6ALmKCXZ7W7c3vE9CcuABzs7rV/sG/v xb8jWf+3itu5vvTggx2XJONtYmWgayswMF29IoMr4d6F5ccG2hzOU88ojaGdX3Ellu3X 5FwvXhY603/G5m3WmoEqZKv0pAFYIdlSAFUxfFtEv1EIt2x3BP95pmmv6olPG6qCVx+p mft5aIc6i5AM6gicW0mDEBJn2ZzsbSyI13WFakXMx8SXP227v+cTBnRvaI43FsB0QC6n kWeTES6Bzcx2RD8C6bQZDD37vkd1zsJtevSPVMK6+c3R7uM7hpi5bh7Kud1cSWy65ZPv DH5Q== 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=XsO/BYrcWFqLx/gODpAbtz9SaYlGX80Tqx/ZADbQ4d0=; b=mDfWkcJFWFREyCOdEUBeMN2YdFaTvlJVPUGLjM+uDnbIyaS3Mz8I5+sk2gCOpwJhsv xWcFkrQaah29CSVSS99lx2+2+G45DGt5mKSwf1Zs6STszUXTZIBSuq6sxX1ELJizQC6h vf6TW9B74UKTZMGXuSSZqGmPcvSFkQHMLgdeGAm/0XTjfCpZAG+JzQHsaYy7ZoV8SP++ Uj3b/SIEaUaMaOyO/Xcp9TGrT/GjwVRv62rEqkYQ90T+4hVtY7o5XTQWTn+GynZYXmSE pQSC9jjiDskl5mu1qEYFUiLdHbBF/SRod8U0hYSynHFV4NSta3lG+17rKoNkEl906cKD ir4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=FKopA6cv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 196-20020a6215cd000000b00541e5f1d633si12798665pfv.172.2022.09.24.08.43.30; Sat, 24 Sep 2022 08:43:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=FKopA6cv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233874AbiIXP2v (ORCPT + 99 others); Sat, 24 Sep 2022 11:28:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233760AbiIXP2h (ORCPT ); Sat, 24 Sep 2022 11:28:37 -0400 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D1339E8AF; Sat, 24 Sep 2022 08:28:35 -0700 (PDT) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 97F391C0006; Sat, 24 Sep 2022 15:28:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1664033313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XsO/BYrcWFqLx/gODpAbtz9SaYlGX80Tqx/ZADbQ4d0=; b=FKopA6cvBNKxDlmJ5QIzDGJKrpTZ3+T4LGav4v7DP3vshKvD16fDc0cBSkG3LjpBOPYe9Z Kwm2oFc6Ci3WjbPtjfud3DshWMvfKmA+3toNKCfRcppaL1ep1RWy/MPRwHxfs4rIUrK9ua cAFjhXYV68qXCapPDVj6RtS2mURwVf0BOP4PhGoE6r7LtArGzJwwEynRLAQqZK0VLA4H63 XB1bNGgUgZkWEJXVOQV/27TV2nrPrnu+Pt1T+2gVeMWrNhltqYW4KWokmgTRMqdZAR5I/S kH/OYoBpxsFCb43j6yCzEUG/eWiWn2rzx7hBxJICPrwAIORRpytluSQgtVhzOg== From: Paul Kocialkowski To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Rob Herring , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Michael Turquette , Stephen Boyd , Frank Rowand , Maxime Ripard , Laurent Pinchart , Thomas Petazzoni , Paul Kocialkowski Subject: [PATCH v6 3/7] ARM: dts: sun8i: v3s: Add nodes for MIPI CSI-2 support Date: Sat, 24 Sep 2022 17:28:16 +0200 Message-Id: <20220924152820.77149-4-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220924152820.77149-1-paul.kocialkowski@bootlin.com> References: <20220924152820.77149-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS 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 MIPI CSI-2 is supported on the V3s with an A31-based MIPI CSI-2 bridge controller. The controller uses a separate D-PHY, which is the same that is otherwise used for MIPI DSI, but used in Rx mode. On the V3s, the CSI0 controller is dedicated to MIPI CSI-2 as it does not have access to any parallel interface pins. Add all the necessary nodes (CSI0, MIPI CSI-2 bridge and D-PHY) to support the MIPI CSI-2 interface. Note that a fwnode graph link is created between CSI0 and MIPI CSI-2 even when no sensor is connected. This will result in a probe failure for the controller as long as no sensor is connected but this is fine since no other interface is available. The interconnects property is used to inherit the proper DMA offset. Signed-off-by: Paul Kocialkowski --- arch/arm/boot/dts/sun8i-v3s.dtsi | 71 ++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi index 34f7df6b3960..99966f11d061 100644 --- a/arch/arm/boot/dts/sun8i-v3s.dtsi +++ b/arch/arm/boot/dts/sun8i-v3s.dtsi @@ -621,6 +621,77 @@ gic: interrupt-controller@1c81000 { interrupts = ; }; + csi0: camera@1cb0000 { + compatible = "allwinner,sun8i-v3s-csi"; + reg = <0x01cb0000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_CSI>, + <&ccu CLK_CSI1_SCLK>, + <&ccu CLK_DRAM_CSI>; + clock-names = "bus", "mod", "ram"; + resets = <&ccu RST_BUS_CSI>; + interconnects = <&mbus 5>; + interconnect-names = "dma-mem"; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <1>; + + csi0_in_mipi_csi2: endpoint { + remote-endpoint = <&mipi_csi2_out_csi0>; + }; + }; + }; + }; + + mipi_csi2: csi@1cb1000 { + compatible = "allwinner,sun8i-v3s-mipi-csi2", + "allwinner,sun6i-a31-mipi-csi2"; + reg = <0x01cb1000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_CSI>, + <&ccu CLK_CSI1_SCLK>; + clock-names = "bus", "mod"; + resets = <&ccu RST_BUS_CSI>; + status = "disabled"; + + phys = <&dphy>; + phy-names = "dphy"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + mipi_csi2_in: port@0 { + reg = <0>; + }; + + mipi_csi2_out: port@1 { + reg = <1>; + + mipi_csi2_out_csi0: endpoint { + remote-endpoint = <&csi0_in_mipi_csi2>; + }; + }; + }; + }; + + dphy: d-phy@1cb2000 { + compatible = "allwinner,sun6i-a31-mipi-dphy"; + reg = <0x01cb2000 0x1000>; + clocks = <&ccu CLK_BUS_CSI>, + <&ccu CLK_MIPI_CSI>; + clock-names = "bus", "mod"; + resets = <&ccu RST_BUS_CSI>; + allwinner,direction = "rx"; + status = "disabled"; + #phy-cells = <0>; + }; + csi1: camera@1cb4000 { compatible = "allwinner,sun8i-v3s-csi"; reg = <0x01cb4000 0x3000>; -- 2.37.3