Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2569835pxb; Thu, 3 Feb 2022 09:16:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/P9Q59opb9WVioa1phnF0D0RJ5KCgErNezPanweVvvE1BkjxBV1umjhBfYqwD78IjFobn X-Received: by 2002:a17:90a:c68c:: with SMTP id n12mr14887172pjt.219.1643908593435; Thu, 03 Feb 2022 09:16:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643908593; cv=none; d=google.com; s=arc-20160816; b=WpnnaW+8NR0LeUbqAXXzRsUgGjrbBP8PsmB0r3/G2IT2IJ2cOKDLBbMp3P5g+axRJF KfMdAnubshAkt0BZPRInCg2Y44/lXzsH8tPxnenCn41YiqrgxA63woSjEJl8VGj25iNE D25a+TrzymEiohPgCXapAywGSy2BO/ldrmxVIEfcXOGOnq1Ivp7uHPrHo22yBEXu8RBC QUVG06/c038Bx8MZ/JE2LIwrLLX5ey8AuCr4F5tj9GIT6+lGZe6SSq3jsTv+ersYJzjE yjtxZ2iK4v0QJLVF7FRdLL+YPWvTndr6h6Zqye6IBjAAi8R+27nCBj/ftLGtH2jw3BbP 7HyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=vFy48ZZiU8QAY9/PLWSNOvL9jOGgbaoU12BTjZhog7Y=; b=EHUHKmGMa4xMgdG/WRhBPGdEZJFxjgQrOn3TmFA8zQcEt9HkNHDeVG73jdQZZVNItI t92l1nwX4n0zNBFj2YxDvpPLmlpXHdLkIPWadMIgPW1FFBS6nFR3OygfhW0GVNOqjrPS GNQYkw+KCfa55RX1zCzp1u2dmJijsdbB04x1uMsiuzgP566ITeXVSO6cTu793YmUjbk8 mQv35+qF3v46FHxrcc+DrO9ugcvgToBNslD9tCzQjM80+bGPHSr49n6B6z8RlEC78pvO xJozzR9/fSOiGO1Ks9HDYWATeI1/qK78pTQm+FWB03dZIWq79RnaHVbkSAtvgT0hpTwh Uz5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=mMcdGxMt; 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=NONE sp=NONE dis=NONE) header.from=raspberrypi.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lp4si10568547pjb.94.2022.02.03.09.16.17; Thu, 03 Feb 2022 09:16:33 -0800 (PST) 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=@raspberrypi.com header.s=google header.b=mMcdGxMt; 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=NONE sp=NONE dis=NONE) header.from=raspberrypi.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350287AbiBCLgs (ORCPT + 99 others); Thu, 3 Feb 2022 06:36:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236195AbiBCLgr (ORCPT ); Thu, 3 Feb 2022 06:36:47 -0500 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A9F9C06173B for ; Thu, 3 Feb 2022 03:36:47 -0800 (PST) Received: by mail-ed1-x52c.google.com with SMTP id u24so5232141eds.11 for ; Thu, 03 Feb 2022 03:36:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=vFy48ZZiU8QAY9/PLWSNOvL9jOGgbaoU12BTjZhog7Y=; b=mMcdGxMtuo6M+460mzP5SzpBNrbzI6tUkqeMYttEMODU6LTLjXAO0U46aRsT20IH7d KycfwJjPq/+FCEb9HUoDiO1x3TnIWz8YufiJt6CVqurYl86lnKge8OuJLqdzt8FAjBhf 6Wkq/dbSe7q/5Nt8m5GBr0IBzb3PXDnaz4598QUXh62dFnbBJUZtnWWWA37tN56P8ewj 0WLg8Y6aCJ5/210fJzQfyqnKylDYRX5XQo30ilFNaMsahH7zBpgXvQkYw8OJZKhsE64H 8GRJ6ksyflJ37pSgHG0Uuwj5W+6fnlqnhsdkbHM8tV2r3LhowHsVYPmea2/0uLN+L529 /9kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=vFy48ZZiU8QAY9/PLWSNOvL9jOGgbaoU12BTjZhog7Y=; b=snvjX6bCwXp3+kJi+mngZ5W0QqZCF1QBHZaBngdjgld6i8oXd+IlaP6bpHl/+oYxSm V+O+Q9jPOZQoyTyVbGhOkTq/+RbEpHNpF6BDSSAuC8qEmlcsJZwgz1CGlhoUgq3wwWaC GjDI6cJkFNSgECR73+3areWBHfiJRVxrw5+YvXKlJFizNbXNc4dF4qfF0ia0Pk6ylaZw YfssGRx/r/Qxc08tLail4U2KZBL3iNybXmWAIW6QZ3nvhxbs0dP6yhHxtWCQUZ3EsnAO seR6MTybrOx8+boaQ5BxDWlewbiwMHESFHsHxCOYdUq8TAuaCdbK5UU6YSg1l4aYRsGz KSsw== X-Gm-Message-State: AOAM531RTgaqX+ddihZ7BHLXdQXMY1KzUmPxSGcZxkWdUMuGz7QfFCP9 SBVQvrXl7w+ZlR4A22OdzEE5ATQdOOMHmPGeQVOVag== X-Received: by 2002:a05:6402:5191:: with SMTP id q17mr35177389edd.395.1643888205646; Thu, 03 Feb 2022 03:36:45 -0800 (PST) MIME-Version: 1.0 References: <20220202175639.149681-1-jeanmichel.hautbois@ideasonboard.com> <20220202175639.149681-4-jeanmichel.hautbois@ideasonboard.com> <9bce4322-881e-06a7-d6a4-431b1417ced5@ideasonboard.com> In-Reply-To: From: Dave Stevenson Date: Thu, 3 Feb 2022 11:36:29 +0000 Message-ID: Subject: Re: [RFC PATCH v3 03/11] media: dt-bindings: media: Add bindings for bcm2835-unicam To: Laurent Pinchart Cc: Jean-Michel Hautbois , Stefan Wahren , devicetree@vger.kernel.org, kernel-list@raspberrypi.com, linux-arm-kernel@lists.infradead.org, LKML , Linux Media Mailing List , linux-rpi-kernel@lists.infradead.org, lukasz@jany.st, Mauro Carvalho Chehab , Naushir Patuck , robh@kernel.org, Tomi Valkeinen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jean-Michel and Laurent n Wed, 2 Feb 2022 at 22:36, Laurent Pinchart wrote: > > Hi Jean-Michel, > > On Wed, Feb 02, 2022 at 11:09:20PM +0100, Jean-Michel Hautbois wrote: > > On 02/02/2022 19:33, Stefan Wahren wrote: > > > Hi Jean-Michel, > > > > > > please drop the first "media:" before dt-bindings. > > > > > > Am 02.02.22 um 18:56 schrieb Jean-Michel Hautbois: > > >> Introduce the dt-bindings documentation for bcm2835 CCP2/CSI2 Unicam > > >> camera interface. Also add a MAINTAINERS entry for it. > > >> > > >> Signed-off-by: Dave Stevenson > > >> Signed-off-by: Naushir Patuck > > >> Signed-off-by: Jean-Michel Hautbois > > >> --- > > >> Dave: I assumed you were the maintainer for this file, as I based it= on the > > >> bcm2835-unicam.txt file. Are you happy to be added directly as the > > >> maintainer, or should this be specified as "Raspberry Pi Kernel > > >> Maintenance " Probably easiest to switch to "Raspberry Pi Kernel Maintenance ". That list didn't exist when I originally wrote the doc, and it just makes life easier should I decide to move on (not planning it). Naush is on that list too. > > >> --- > > >> .../bindings/media/brcm,bcm2835-unicam.yaml | 107 ++++++++++++++= ++++ > > >> MAINTAINERS | 7 ++ > > >> 2 files changed, 114 insertions(+) > > >> create mode 100644 Documentation/devicetree/bindings/media/brcm,bc= m2835-unicam.yaml > > >> > > >> diff --git a/Documentation/devicetree/bindings/media/brcm,bcm2835-un= icam.yaml b/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yam= l > > >> new file mode 100644 > > >> index 000000000000..5bf41a8834fa > > >> --- /dev/null > > >> +++ b/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.ya= ml > > >> @@ -0,0 +1,107 @@ > > >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > >> +%YAML 1.2 > > >> +--- > > >> +$id: http://devicetree.org/schemas/media/brcm,bcm2835-unicam.yaml# > > >> +$schema: http://devicetree.org/meta-schemas/core.yaml# > > >> + > > >> +title: Broadcom BCM283x Camera Interface (Unicam) > > >> + > > >> +maintainers: > > >> + - Dave Stevenson > > >> + > > >> +description: |- > > >> + The Unicam block on BCM283x SoCs is the receiver for either > > >> + CSI-2 or CCP2 data from image sensors or similar devices. > > >> + > > >> + The main platform using this SoC is the Raspberry Pi family of bo= ards. > > >> + On the Pi the VideoCore firmware can also control this hardware b= lock, > > >> + and driving it from two different processors will cause issues. > > >> + To avoid this, the firmware checks the device tree configuration > > >> + during boot. If it finds device tree nodes starting by csi then > > >> + it will stop the firmware accessing the block, and it can then > > >> + safely be used via the device tree binding. > > >> + > > >> +properties: > > >> + compatible: > > >> + const: brcm,bcm2835-unicam > > >> + > > >> + reg: > > >> + maxItems: 2 > > > > > > I would be nice to have reg-names here similar to the clocks. > > > > Sure, I just don't know what the names are ;-). > > Please discuss this with the Rasperry Pi developers to figure out then. It's the "Unicam" and "Clock Manager Image" (CMI) blocks respectively. CMI is only 4 registers. It provides high speed clock source selection for the two Unicam blocks, a camera test block that has never been used, and one of the USB controllers. Each peripheral is controlled by a separate register. It was discussed previously and viewed as not worthwhile creating a full clock driver for it. > > >> + > > >> + interrupts: > > >> + maxItems: 1 > > >> + > > >> + clocks: > > >> + items: > > >> + - description: Clock for the camera. > > This also seems weird, as far as I know the SoC doesn't output a clock > for the camera sensor (and it should be specified in the camera sensor > DT node if it did anyway). It's the clocks to Unicam, not to the camera / sensor. The LP clock drives the LP state machine of Unicam for the relevant DPHY state transitions. The VPU or core clock is needed to ensure that the other bus systems are running fast enough for the data generated. Dave > > >> + - description: Clock for the vpu. > > >> + > > >> + clock-names: > > >> + items: > > >> + - const: lp > > >> + - const: vpu > > >> + > > >> + power-domains: > > >> + items: > > >> + - description: Unicam power domain > > >> + > > >> + num-data-lanes: > > This is a vendor-specific property and thus requires a vendor prefix. > > > >> + items: > > >> + - enum: [ 2, 4 ] > > >> + > > >> + port: > > >> + additionalProperties: false > > >> + $ref: /schemas/graph.yaml#/$defs/port-base > > >> + > > >> + properties: > > >> + endpoint: > > >> + $ref: /schemas/media/video-interfaces.yaml# > > >> + unevaluatedProperties: false > > >> + > > >> + properties: > > >> + data-lanes: true > > >> + link-frequencies: true > > >> + > > >> + required: > > >> + - data-lanes > > >> + - link-frequencies > > >> + > > >> + required: > > >> + - endpoint > > >> + > > >> +required: > > >> + - compatible > > >> + - reg > > >> + - interrupts > > >> + - clocks > > >> + - clock-names > > >> + - power-domains > > >> + - num-data-lanes > > >> + - port > > >> + > > >> +additionalProperties: False > > >> + > > >> +examples: > > >> + - | > > >> + #include > > >> + #include > > >> + #include > > >> + csi1: csi@7e801000 { > > >> + compatible =3D "brcm,bcm2835-unicam"; > > >> + reg =3D <0x7e801000 0x800>, > > >> + <0x7e802004 0x4>; > > >> + interrupts =3D ; > > >> + clocks =3D <&clocks BCM2835_CLOCK_CAM1>, > > >> + <&firmware_clocks 4>; > > >> + clock-names =3D "lp", "vpu"; > > >> + power-domains =3D <&power RPI_POWER_DOMAIN_UNICAM1>; > > >> + num-data-lanes =3D <2>; > > >> + port { > > >> + csi1_ep: endpoint { > > >> + remote-endpoint =3D <&imx219_0>; > > >> + data-lanes =3D <1 2>; > > >> + link-frequencies =3D /bits/ 64 <456000000>; > > >> + }; > > >> + }; > > >> + }; > > >> +... > > >> diff --git a/MAINTAINERS b/MAINTAINERS > > >> index a0770a861ca4..29344ea86847 100644 > > >> --- a/MAINTAINERS > > >> +++ b/MAINTAINERS > > >> @@ -3670,6 +3670,13 @@ N: bcm113* > > >> N: bcm216* > > >> N: kona > > >> > > >> +BROADCOM BCM2835 CAMERA DRIVER > > >> +M: Raspberry Pi Kernel Maintenance > > >> +L: linux-media@vger.kernel.org > > >> +S: Maintained > > >> +F: Documentation/devicetree/bindings/media/brcm,bcm2835-unic= am.yaml > > >> +F: arch/arm/boot/dts/bcm283x* > > >> + > > > > > > I suggest to make the MAINTAINERS changes a single separate patch > > > instead of small incremental changes. > > > > I can make it a separate patch, indeed. > > > > >> BROADCOM BCM47XX MIPS ARCHITECTURE > > >> M: Hauke Mehrtens > > >> M: Rafa=C5=82 Mi=C5=82ecki > > -- > Regards, > > Laurent Pinchart