Message ID | 20220202175639.149681-4-jeanmichel.hautbois@ideasonboard.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from <linux-media-owner@vger.kernel.org>) id 1nFJsa-001x6Q-Qr; Wed, 02 Feb 2022 17:57:17 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346423AbiBBR5P (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Wed, 2 Feb 2022 12:57:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346419AbiBBR5N (ORCPT <rfc822;linux-media@vger.kernel.org>); Wed, 2 Feb 2022 12:57:13 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC46BC06173D; Wed, 2 Feb 2022 09:57:12 -0800 (PST) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:7139:eada:2ff6:73dd]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E31A3E04; Wed, 2 Feb 2022 18:56:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1643824610; bh=1oG8FpUhanwzJ6Xba8rv47glsXs3JVRy9iJcIqk3Grs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j7UYdY2dRIPVhpWwWnv2DUXzxM62S3z5MZkBDfcHPcR/Ha9pjiIXxiVVv+FyLXJJA GCiQeQh81GAnPm/gmM2XOR2g5efCxjAjhuYmBHyBUefUxbMmW+cicYfg30VvN3fdzq hDF9rfUZ/FM1PX/c/Lb/l4Kj1jGuURyNNwcZTJFY= From: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> To: jeanmichel.hautbois@ideasonboard.com Cc: dave.stevenson@raspberrypi.com, devicetree@vger.kernel.org, kernel-list@raspberrypi.com, laurent.pinchart@ideasonboard.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, lukasz@jany.st, mchehab@kernel.org, naush@raspberrypi.com, robh@kernel.org, tomi.valkeinen@ideasonboard.com Subject: [RFC PATCH v3 03/11] media: dt-bindings: media: Add bindings for bcm2835-unicam Date: Wed, 2 Feb 2022 18:56:31 +0100 Message-Id: <20220202175639.149681-4-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220202175639.149681-1-jeanmichel.hautbois@ideasonboard.com> References: <20220202175639.149681-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -7.5 (-------) X-LSpam-Report: No, score=-7.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_HI=-5 autolearn=ham autolearn_force=no |
Series |
Add support for BCM2835 camera interface (unicam)
|
|
Commit Message
Jean-Michel Hautbois
Feb. 2, 2022, 5:56 p.m. UTC
Introduce the dt-bindings documentation for bcm2835 CCP2/CSI2 Unicam camera interface. Also add a MAINTAINERS entry for it. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> --- 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 <kernel-list@raspberrypi.com>" --- .../bindings/media/brcm,bcm2835-unicam.yaml | 107 ++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 114 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml
Comments
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 <dave.stevenson@raspberrypi.com> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com> > Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> > --- > 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 <kernel-list@raspberrypi.com>" > --- > .../bindings/media/brcm,bcm2835-unicam.yaml | 107 ++++++++++++++++++ > MAINTAINERS | 7 ++ > 2 files changed, 114 insertions(+) > create mode 100644 Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml > > diff --git a/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml b/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml > new file mode 100644 > index 000000000000..5bf41a8834fa > --- /dev/null > +++ b/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml > @@ -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 <dave.stevenson@raspberrypi.com> > + > +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 boards. > + On the Pi the VideoCore firmware can also control this hardware block, > + 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. > + > + interrupts: > + maxItems: 1 > + > + clocks: > + items: > + - description: Clock for the camera. > + - description: Clock for the vpu. > + > + clock-names: > + items: > + - const: lp > + - const: vpu > + > + power-domains: > + items: > + - description: Unicam power domain > + > + num-data-lanes: > + 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 <dt-bindings/clock/bcm2835.h> > + #include <dt-bindings/interrupt-controller/arm-gic.h> > + #include <dt-bindings/power/raspberrypi-power.h> > + csi1: csi@7e801000 { > + compatible = "brcm,bcm2835-unicam"; > + reg = <0x7e801000 0x800>, > + <0x7e802004 0x4>; > + interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&clocks BCM2835_CLOCK_CAM1>, > + <&firmware_clocks 4>; > + clock-names = "lp", "vpu"; > + power-domains = <&power RPI_POWER_DOMAIN_UNICAM1>; > + num-data-lanes = <2>; > + port { > + csi1_ep: endpoint { > + remote-endpoint = <&imx219_0>; > + data-lanes = <1 2>; > + link-frequencies = /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 <kernel-list@raspberrypi.com> > +L: linux-media@vger.kernel.org > +S: Maintained > +F: Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml > +F: arch/arm/boot/dts/bcm283x* > + I suggest to make the MAINTAINERS changes a single separate patch instead of small incremental changes. Best regards > BROADCOM BCM47XX MIPS ARCHITECTURE > M: Hauke Mehrtens <hauke@hauke-m.de> > M: Rafał Miłecki <zajec5@gmail.com>
Hi Stefan, 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 <dave.stevenson@raspberrypi.com> >> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> >> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> >> --- >> 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 <kernel-list@raspberrypi.com>" >> --- >> .../bindings/media/brcm,bcm2835-unicam.yaml | 107 ++++++++++++++++++ >> MAINTAINERS | 7 ++ >> 2 files changed, 114 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml >> >> diff --git a/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml b/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml >> new file mode 100644 >> index 000000000000..5bf41a8834fa >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml >> @@ -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 <dave.stevenson@raspberrypi.com> >> + >> +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 boards. >> + On the Pi the VideoCore firmware can also control this hardware block, >> + 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 ;-). >> + >> + interrupts: >> + maxItems: 1 >> + >> + clocks: >> + items: >> + - description: Clock for the camera. >> + - description: Clock for the vpu. >> + >> + clock-names: >> + items: >> + - const: lp >> + - const: vpu >> + >> + power-domains: >> + items: >> + - description: Unicam power domain >> + >> + num-data-lanes: >> + 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 <dt-bindings/clock/bcm2835.h> >> + #include <dt-bindings/interrupt-controller/arm-gic.h> >> + #include <dt-bindings/power/raspberrypi-power.h> >> + csi1: csi@7e801000 { >> + compatible = "brcm,bcm2835-unicam"; >> + reg = <0x7e801000 0x800>, >> + <0x7e802004 0x4>; >> + interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>; >> + clocks = <&clocks BCM2835_CLOCK_CAM1>, >> + <&firmware_clocks 4>; >> + clock-names = "lp", "vpu"; >> + power-domains = <&power RPI_POWER_DOMAIN_UNICAM1>; >> + num-data-lanes = <2>; >> + port { >> + csi1_ep: endpoint { >> + remote-endpoint = <&imx219_0>; >> + data-lanes = <1 2>; >> + link-frequencies = /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 <kernel-list@raspberrypi.com> >> +L: linux-media@vger.kernel.org >> +S: Maintained >> +F: Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.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. > > Best regards > >> BROADCOM BCM47XX MIPS ARCHITECTURE >> M: Hauke Mehrtens <hauke@hauke-m.de> >> M: Rafał Miłecki <zajec5@gmail.com> >
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 <dave.stevenson@raspberrypi.com> > >> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> > >> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> > >> --- > >> 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 <kernel-list@raspberrypi.com>" > >> --- > >> .../bindings/media/brcm,bcm2835-unicam.yaml | 107 ++++++++++++++++++ > >> MAINTAINERS | 7 ++ > >> 2 files changed, 114 insertions(+) > >> create mode 100644 Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml > >> > >> diff --git a/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml b/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml > >> new file mode 100644 > >> index 000000000000..5bf41a8834fa > >> --- /dev/null > >> +++ b/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml > >> @@ -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 <dave.stevenson@raspberrypi.com> > >> + > >> +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 boards. > >> + On the Pi the VideoCore firmware can also control this hardware block, > >> + 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. > >> + > >> + 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). > >> + - 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 <dt-bindings/clock/bcm2835.h> > >> + #include <dt-bindings/interrupt-controller/arm-gic.h> > >> + #include <dt-bindings/power/raspberrypi-power.h> > >> + csi1: csi@7e801000 { > >> + compatible = "brcm,bcm2835-unicam"; > >> + reg = <0x7e801000 0x800>, > >> + <0x7e802004 0x4>; > >> + interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>; > >> + clocks = <&clocks BCM2835_CLOCK_CAM1>, > >> + <&firmware_clocks 4>; > >> + clock-names = "lp", "vpu"; > >> + power-domains = <&power RPI_POWER_DOMAIN_UNICAM1>; > >> + num-data-lanes = <2>; > >> + port { > >> + csi1_ep: endpoint { > >> + remote-endpoint = <&imx219_0>; > >> + data-lanes = <1 2>; > >> + link-frequencies = /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 <kernel-list@raspberrypi.com> > >> +L: linux-media@vger.kernel.org > >> +S: Maintained > >> +F: Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.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 <hauke@hauke-m.de> > >> M: Rafał Miłecki <zajec5@gmail.com>
Hi Jean-Michel and Laurent n Wed, 2 Feb 2022 at 22:36, Laurent Pinchart <laurent.pinchart@ideasonboard.com> 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 <dave.stevenson@raspberrypi.com> > > >> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> > > >> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> > > >> --- > > >> 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 <kernel-list@raspberrypi.com>" Probably easiest to switch to "Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>". 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,bcm2835-unicam.yaml > > >> > > >> diff --git a/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml b/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml > > >> new file mode 100644 > > >> index 000000000000..5bf41a8834fa > > >> --- /dev/null > > >> +++ b/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml > > >> @@ -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 <dave.stevenson@raspberrypi.com> > > >> + > > >> +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 boards. > > >> + On the Pi the VideoCore firmware can also control this hardware block, > > >> + 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 <dt-bindings/clock/bcm2835.h> > > >> + #include <dt-bindings/interrupt-controller/arm-gic.h> > > >> + #include <dt-bindings/power/raspberrypi-power.h> > > >> + csi1: csi@7e801000 { > > >> + compatible = "brcm,bcm2835-unicam"; > > >> + reg = <0x7e801000 0x800>, > > >> + <0x7e802004 0x4>; > > >> + interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>; > > >> + clocks = <&clocks BCM2835_CLOCK_CAM1>, > > >> + <&firmware_clocks 4>; > > >> + clock-names = "lp", "vpu"; > > >> + power-domains = <&power RPI_POWER_DOMAIN_UNICAM1>; > > >> + num-data-lanes = <2>; > > >> + port { > > >> + csi1_ep: endpoint { > > >> + remote-endpoint = <&imx219_0>; > > >> + data-lanes = <1 2>; > > >> + link-frequencies = /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 <kernel-list@raspberrypi.com> > > >> +L: linux-media@vger.kernel.org > > >> +S: Maintained > > >> +F: Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.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 <hauke@hauke-m.de> > > >> M: Rafał Miłecki <zajec5@gmail.com> > > -- > Regards, > > Laurent Pinchart
diff --git a/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml b/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml new file mode 100644 index 000000000000..5bf41a8834fa --- /dev/null +++ b/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml @@ -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 <dave.stevenson@raspberrypi.com> + +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 boards. + On the Pi the VideoCore firmware can also control this hardware block, + 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 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: Clock for the camera. + - description: Clock for the vpu. + + clock-names: + items: + - const: lp + - const: vpu + + power-domains: + items: + - description: Unicam power domain + + num-data-lanes: + 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 <dt-bindings/clock/bcm2835.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/power/raspberrypi-power.h> + csi1: csi@7e801000 { + compatible = "brcm,bcm2835-unicam"; + reg = <0x7e801000 0x800>, + <0x7e802004 0x4>; + interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clocks BCM2835_CLOCK_CAM1>, + <&firmware_clocks 4>; + clock-names = "lp", "vpu"; + power-domains = <&power RPI_POWER_DOMAIN_UNICAM1>; + num-data-lanes = <2>; + port { + csi1_ep: endpoint { + remote-endpoint = <&imx219_0>; + data-lanes = <1 2>; + link-frequencies = /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 <kernel-list@raspberrypi.com> +L: linux-media@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml +F: arch/arm/boot/dts/bcm283x* + BROADCOM BCM47XX MIPS ARCHITECTURE M: Hauke Mehrtens <hauke@hauke-m.de> M: Rafał Miłecki <zajec5@gmail.com>