Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp574660pxb; Tue, 15 Feb 2022 22:33:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJxjS8lpJGYmbstJt3Yzw2K0AT1idrrk33TvfKCG/nLydwT3kSgneoanzV7h6cl80rp4/x76 X-Received: by 2002:a17:902:728e:b0:14d:cb7a:951 with SMTP id d14-20020a170902728e00b0014dcb7a0951mr1110311pll.99.1644993233926; Tue, 15 Feb 2022 22:33:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644993233; cv=none; d=google.com; s=arc-20160816; b=GMOCjE9dXNEeoYUliJPdfLkNgze4dVG780aUbEqph2E/Qr2ow/pOP43EuLY0IQN6o0 1j48I8EBs6wNKRkLkZjQDl3wTRIbKH8/MrggE8wsMwnhHxOlJKgI7iS69+WJw2oUhoUA TwLcrRq0B4CFZCrqqkqgWg+Jj1GdUAAHvK7A3uoHjasCVEQRnO5QjGD/5J+4k69RrID3 n+Mcqd2SB0e3Tcpl62oEuyrWxh0jK4qMfNthK8M7QFIcN1HzfV6Zvh/a4Pv/YXfwgXpf pgBXeqDUEfy9G6q3BoHlaNRg3A76s2OK0LSFrQztbcdvT8F7P/u+MEYkk8wnya23ZnaR SR9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gFSUgnMPM4RIULavl5LQNMn3BXMoJoSSok2BuLvqbxI=; b=ZMJCso98qk20+sn/Aswxo/leV1ivCrH9egs6q5cHEgSUoGjKOWx8t7KAXpUCnIIM7d 8ZvfzMeVJnzCfepCdvNWhzpwJgclr98xIXQN6d7y4t95OlTip/a1sskza/CFNTaBLfUK 87SN1HejWi7f3fCAiRfqwxkp/rnGBtjIb2MA4wBlI/NhElX1Ozkfu1lC3ZUgBwyhtL8r 5oiPNvrMNjYS6WH5LOX+RVCE7yFuWuHcUM6Ju/kz1qjgzs6mLnHWJBAev38YN+8j1B0b cAvH2x3NzD0Ut/pbqcnIXeobJA65SsBBwVmg2toGss4KNsyzjkaR2gEwwpZEUM/R43Dd VLTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=f9e5T1eT; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j6si20728543plh.254.2022.02.15.22.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 22:33:53 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=f9e5T1eT; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 352931D9DFA; Tue, 15 Feb 2022 22:26:20 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236474AbiBOKLJ (ORCPT + 99 others); Tue, 15 Feb 2022 05:11:09 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:44642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236353AbiBOKLH (ORCPT ); Tue, 15 Feb 2022 05:11:07 -0500 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E5B988B1D; Tue, 15 Feb 2022 02:10:56 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id D0DD31BF214; Tue, 15 Feb 2022 10:10:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1644919855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gFSUgnMPM4RIULavl5LQNMn3BXMoJoSSok2BuLvqbxI=; b=f9e5T1eT9Sf20+5ubeUYInS9hRyyBcQ9k/EUA0vFe1tMUFPUuUH2kLPtEXrY1jRXt/ZKQi gKTDAsm6GMOdkmDuC7JCOqwsVXBT8+ciuqGc5tWJD4aYgSEdzMbGrK9YQCjto+hoILiWTe TxMbnz/nAbcsaXcfDRhpk60zu+nldhcPTql01RJqzVKtc4Id7dTmqFrK+2JC1Ee2XClYp2 3AUfkxcNdaRHfMHKdo/NrGhNIgyqeWWbKV0FH+jjcSWosC9GzFXQUlBk9+hJ9PGLYxixkS BHKj5HL8a2/okirgTSubL2TXmuHkqyG3MNdl4zd6rDr3wnb1cQtiVO4X07wg/g== Date: Tue, 15 Feb 2022 11:10:52 +0100 From: Paul Kocialkowski To: Laurent Pinchart Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org, linux-staging@lists.linux.dev, Yong Deng , Mauro Carvalho Chehab , Rob Herring , Maxime Ripard , Sakari Ailus , Hans Verkuil , Chen-Yu Tsai , Jernej Skrabec , Greg Kroah-Hartman , Helen Koike , Thomas Petazzoni Subject: Re: [PATCH v2 61/66] dt-bindings: media: Add Allwinner A31 ISP bindings documentation Message-ID: References: <20220205185429.2278860-1-paul.kocialkowski@bootlin.com> <20220205185429.2278860-62-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZfQyJZmLCE9mH4eu" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 --ZfQyJZmLCE9mH4eu Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Laurent, On Mon 14 Feb 22, 19:09, Laurent Pinchart wrote: > Hi Paul, >=20 > On Mon, Feb 14, 2022 at 05:18:07PM +0100, Paul Kocialkowski wrote: > > On Mon 07 Feb 22, 17:51, Laurent Pinchart wrote: > > > On Sat, Feb 05, 2022 at 07:54:24PM +0100, Paul Kocialkowski wrote: > > > > This introduces YAML bindings documentation for the Allwinner A31 I= mage > > > > Signal Processor (ISP). > > > >=20 > > > > Signed-off-by: Paul Kocialkowski > > > > --- > > > > .../media/allwinner,sun6i-a31-isp.yaml | 117 ++++++++++++++= ++++ > > > > 1 file changed, 117 insertions(+) > > > > create mode 100644 Documentation/devicetree/bindings/media/allwinn= er,sun6i-a31-isp.yaml > > > >=20 > > > > diff --git a/Documentation/devicetree/bindings/media/allwinner,sun6= i-a31-isp.yaml b/Documentation/devicetree/bindings/media/allwinner,sun6i-a3= 1-isp.yaml > > > > new file mode 100644 > > > > index 000000000000..2d87022c43ce > > > > --- /dev/null > > > > +++ b/Documentation/devicetree/bindings/media/allwinner,sun6i-a31-i= sp.yaml > > > > @@ -0,0 +1,117 @@ > > > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > > > > +%YAML 1.2 > > > > +--- > > > > +$id: http://devicetree.org/schemas/media/allwinner,sun6i-a31-isp.y= aml# > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > > + > > > > +title: Allwinner A31 Image Signal Processor Driver (ISP) Device Tr= ee Bindings > > > > + > > > > +maintainers: > > > > + - Paul Kocialkowski > > > > + > > > > +properties: > > > > + compatible: > > > > + enum: > > > > + - allwinner,sun6i-a31-isp > > > > + - allwinner,sun8i-v3s-isp > > > > + > > > > + reg: > > > > + maxItems: 1 > > > > + > > > > + interrupts: > > > > + maxItems: 1 > > > > + > > > > + clocks: > > > > + items: > > > > + - description: Bus Clock > > > > + - description: Module Clock > > > > + - description: DRAM Clock > > >=20 > > > That's interesting, does the ISP have a dedicated DRAM ? > >=20 > > It doesn't, it actually uses the main DRAM with the "mbus" interconnect. > > The clock is probably for the DMA engine. > >=20 > > > > + > > > > + clock-names: > > > > + items: > > > > + - const: bus > > > > + - const: mod > > > > + - const: ram > > > > + > > > > + resets: > > > > + maxItems: 1 > > > > + > > > > + ports: > > > > + $ref: /schemas/graph.yaml#/properties/ports > > > > + > > > > + properties: > > > > + port@0: > > > > + $ref: /schemas/graph.yaml#/$defs/port-base > > > > + description: CSI0 input port > > > > + > > > > + properties: > > > > + reg: > > > > + const: 0 > > > > + > > > > + endpoint: > > > > + $ref: video-interfaces.yaml# > > > > + unevaluatedProperties: false > > >=20 > > > If no other property than remote-endpoint are allowed, I'd write > > >=20 > > > endpoint: > > > $ref: video-interfaces.yaml# > > > remote-endpoint: true > > > additionalProperties: false > > >=20 > > > Same below. > > >=20 > > > > + > > > > + additionalProperties: false > > > > + > > > > + port@1: > > > > + $ref: /schemas/graph.yaml#/$defs/port-base > > > > + description: CSI1 input port > > > > + > > > > + properties: > > > > + reg: > > > > + const: 0 > > >=20 > > > This should be 1. > >=20 > > Correct, thanks! > >=20 > > > > + > > > > + endpoint: > > > > + $ref: video-interfaces.yaml# > > > > + unevaluatedProperties: false > > > > + > > > > + additionalProperties: false > > > > + > > > > + anyOf: > > > > + - required: > > > > + - port@0 > > > > + - required: > > > > + - port@1 > > >=20 > > > As ports are an intrinsic property of the ISP, both should be require= d, > > > but they don't have to be connected. > >=20 > > Well the ISP does have the ability to source from either CSI0 and CSI1 > > but I don't really get the point of declaring both ports when only one > > of the two controllers is present. >=20 > If it's within an SoC I don't mind too much. What I usually insist on is > declaring all ports even when no external devices are connected on the > board. It may however be easier to implement things on the driver side > when all the ports are declared, even for internal devices. I won't > insist either way here. >=20 > > > By the way, how do you select at runtime which CSI-2 RX the ISP gets = its > > > image stream from ? Is it configured through registers of the ISP ? > >=20 > > Actually what the ISP gets is fully dependent on what is received by the > > CSI controller it is connected to (which can be the mipi csi-2 controll= er > > or its direct parallel pins), so the configuration happens on the CSI s= ide. >=20 > OK, then how do you select at runtime which CSI the ISP gets its image > stream from ? :-) What is done in the driver is that all available csi(s) entities pads are l= inked to a single csi sink media pad, which allows userspace to enable one or the other. If there's only one, it's enabled by default. The actual stream source (isp_dev->proc.source) is selected at link_validate time and the source bit is set in sun6i_isp_proc_enable. I hope this answers your question! Thanks, Paul > > > > + > > > > +required: > > > > + - compatible > > > > + - reg > > > > + - interrupts > > > > + - clocks > > > > + - clock-names > > > > + - resets > > > > + > > > > +additionalProperties: false > > > > + > > > > +examples: > > > > + - | > > > > + #include > > > > + #include > > > > + #include > > > > + > > > > + isp: isp@1cb8000 { > > > > + compatible =3D "allwinner,sun8i-v3s-isp"; > > > > + reg =3D <0x01cb8000 0x1000>; > > > > + interrupts =3D ; > > > > + clocks =3D <&ccu CLK_BUS_CSI>, > > > > + <&ccu CLK_CSI1_SCLK>, > > > > + <&ccu CLK_DRAM_CSI>; > > > > + clock-names =3D "bus", "mod", "ram"; > > > > + resets =3D <&ccu RST_BUS_CSI>; > > > > + > > > > + ports { > > > > + #address-cells =3D <1>; > > > > + #size-cells =3D <0>; > > > > + > > > > + port@0 { > > > > + reg =3D <0>; > > > > + > > > > + isp_in_csi0: endpoint { > > > > + remote-endpoint =3D <&csi0_out_isp>; > > > > + }; > > > > + }; > > > > + }; > > > > + }; > > > > + > > > > +... >=20 > --=20 > Regards, >=20 > Laurent Pinchart --=20 Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com --ZfQyJZmLCE9mH4eu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAmILfCwACgkQ3cLmz3+f v9EwQwgAk/o403dFH/O+AgvwfNTZjkSOYhLmE9/4on9gCn/kX5el2y/KJ7C4m+K2 Cqp0BfXfUVqmv8k1Qpw4V6BJlDcJQQcrMS2RIoJts5lTnSNEN3D1aGGOrGZg4P9Z zDY5FjhkWSBVKfbKtDQ1TIwtchj7R+N7sK+t8smxXtUwei80ZrvoMaCmFd8uNIow v9tYf9pQtWJpB/uYEVu1MEikGizoVK3aZ7ZaAYBdwOuX9kfL4Q7trcIoSBVaEBre Glk2JTBXXIL5qAYW9T0iM6L00JdqBTcM5dZYeXn3gxu4qlpmORCzbFAW09ec9utj gFyqQy4XnnZ9VLpRpnClpgVP9T+I6A== =dzzP -----END PGP SIGNATURE----- --ZfQyJZmLCE9mH4eu--