Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp1124113rdf; Wed, 22 Nov 2023 06:18:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYggRHYsTqXRHKA7fsGilS6E8TztvI3c5O/5biB6y8tvcQlA/2UGhHzY1m0x8WZSGodw7B X-Received: by 2002:a17:902:64c8:b0:1cf:54e1:8c8c with SMTP id y8-20020a17090264c800b001cf54e18c8cmr2472430pli.63.1700662684232; Wed, 22 Nov 2023 06:18:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700662684; cv=none; d=google.com; s=arc-20160816; b=GXaBlXy+K69knUS5zPRGCOHTy5cqno8XC/TX+TiLIH4z5+KrPwg3W5sKWUVbjebK1u U3BGYT9JePeJTtECUOq+SBuJ7cfKcnQzquUj6mqkOTND+lUaDks3hZPKp7mJK/flHMwF zIWaA2jhtinePCFKo565562sIpLjuAdONZBvVO0YuzuuxAp1sdq8bPI1yntrbjxzTf+T wYv4PsgCW4lTwyrdfoMF8JDaeoh2UMymhnKad7YGHn5gMIVqekVGoZEfiGF4EK0E9ORE iZy2fZE4gNqE4HdJDKZ2f33xy2z1UsOT3dCg4WorVpO+XeIRMIdJ/07gi+3eLiwnplDR 9oOg== 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=4r8AmM7mXWeipOMUfi50m9Hi0q6kLe/5x9Q/douM3aY=; fh=PHVbIgf+UxIdrbueJ5cOSpcsisIa90hQUxmE2wscmBk=; b=Aor5LHs35Md4xKzEWpSLnTtAMBRQTwKTAHj2LnMQ60XAHalkB8j9v+l4N3Mg/iak04 8x0xoj8WwE6c5hYMfrVkAxvXagPuvj/54rTn4Vah4+NlXBy5e9fEineYt9SI7pION6LV jby4BIxM6s1d+OQ9HJ4/Uh0Q6COGaUmHjCnf3NDFKWuoFF5Q1jFJ86DHc209X+T1rpvt heHIuY5ruWDeaXr4Wv99G+/fyEakUUNKECFcp/W/2sJOjVv2g1f2DGS29Y2co/nJFfrF PedUdRF2uJKg0Grewde8P8WKTCqNxt4NZ3c2XcR0TgqqvobeiYwie4E0BHwEK9rAQYd9 9oQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=RTfTRVsi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id d9-20020a170903230900b001c36018fdaasi9510518plh.219.2023.11.22.06.18.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 06:18:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=RTfTRVsi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id DFDAE80740F8; Wed, 22 Nov 2023 06:15:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235206AbjKVOPD (ORCPT + 99 others); Wed, 22 Nov 2023 09:15:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231620AbjKVOOx (ORCPT ); Wed, 22 Nov 2023 09:14:53 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E52E819D; Wed, 22 Nov 2023 06:14:49 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id E09E7E0012; Wed, 22 Nov 2023 14:14:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700662488; 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=4r8AmM7mXWeipOMUfi50m9Hi0q6kLe/5x9Q/douM3aY=; b=RTfTRVsisHRP5wcG9YOUbabpkm1gdgR9IUrxZ2EuBPNx1Y6drFoUm0Axd70PVxqBBTvE/c bcYl0hPsvjHoMMhJbRuIZMb7jn3OolmyCk+6ZFH3N3K547Ib+BFLG7vwc8wmHXRPToW6fi R1oR+So8dr6Ie2ALrCBshOGRR6wOm9JsQoVV5DNXL9TPBuCgVQ301ivNTsh/goID1r3QQA /pWJXv/XTs3U3BCEB/QRlDFu1dIMZq+PdAsXjlmNN5d1SYbzXp5wvyX1SIus2FIlMbsGY0 GALU9Cljj/HOQuklGq5goKsA2R1qvRXJoBOH4lkHWdQgcBFhox+I5VQ5G2Pzzw== 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-clk@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard , Laurent Pinchart , Michael Turquette , Stephen Boyd , Paul Kocialkowski Subject: [PATCH v7 3/7] ARM: dts: sun8i: v3s: Add nodes for MIPI CSI-2 support Date: Wed, 22 Nov 2023 15:14:21 +0100 Message-ID: <20231122141426.329694-4-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231122141426.329694-1-paul.kocialkowski@bootlin.com> References: <20231122141426.329694-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: paul.kocialkowski@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=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 groat.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 (groat.vger.email [0.0.0.0]); Wed, 22 Nov 2023 06:15:51 -0800 (PST) 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/allwinner/sun8i-v3s.dtsi | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi b/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi index 506e98f4f69d..d57612023aa4 100644 --- a/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +++ b/arch/arm/boot/dts/allwinner/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.42.1