From patchwork Thu Oct 15 18:27:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 286211 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8804C43457 for ; Thu, 15 Oct 2020 16:28:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8EE3A2225A for ; Thu, 15 Oct 2020 16:28:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389731AbgJOQ1k (ORCPT ); Thu, 15 Oct 2020 12:27:40 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:40973 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389699AbgJOQ1j (ORCPT ); Thu, 15 Oct 2020 12:27:39 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 63BA7FF804; Thu, 15 Oct 2020 16:27:36 +0000 (UTC) From: Jacopo Mondi To: kieran.bingham+renesas@ideasonboard.com, laurent.pinchart+renesas@ideasonboard.com, niklas.soderlund+renesas@ragnatech.se Cc: Jacopo Mondi , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Hyun Kwon , Manivannan Sadhasivam Subject: [PATCH v2 2/7] dt-bindings: media: max9286: Document 'maxim, high-threshold' Date: Thu, 15 Oct 2020 20:27:05 +0200 Message-Id: <20201015182710.54795-3-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201015182710.54795-1-jacopo+renesas@jmondi.org> References: <20201015182710.54795-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Document the 'maxim,high-threshold' vendor property in the bindings document of the max9286 driver. The newly introduced boolean property allows controlling the initial configuration of the GMSL reverse control channel to accommodate remote serializers pre-programmed with the high threshold power supply noise immunity enabled. Signed-off-by: Jacopo Mondi --- .../bindings/media/i2c/maxim,max9286.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml b/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml index 9ea827092fdd..50e08a7d3204 100644 --- a/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml +++ b/Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml @@ -51,6 +51,19 @@ properties: '#gpio-cells': const: 2 + maxim,high-threshold: + description: | + A boolean property to increase the initial amplitude of the reverse + control channel to compensate for remote serializers pre-programmed with + high threshold noise-immunity. + + Some camera modules (in example the RDACM20 one) include an on-board MCU + that pre-programs the embedded serializer with reverse channel power + supply noise immunity enabled. The deserializer shall increase its + reverse channel amplitude to compensate that and be able to communicate + with the remote end. + type: boolean + ports: type: object description: | @@ -243,6 +256,8 @@ examples: gpio-controller; #gpio-cells = <2>; + maxim,high-threshold; + ports { #address-cells = <1>; #size-cells = <0>; From patchwork Thu Oct 15 18:27:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 286213 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D42DC43467 for ; Thu, 15 Oct 2020 16:27:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06E2F2225A for ; Thu, 15 Oct 2020 16:27:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389826AbgJOQ1m (ORCPT ); Thu, 15 Oct 2020 12:27:42 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:36583 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389721AbgJOQ1m (ORCPT ); Thu, 15 Oct 2020 12:27:42 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 3173CFF805; Thu, 15 Oct 2020 16:27:38 +0000 (UTC) From: Jacopo Mondi To: kieran.bingham+renesas@ideasonboard.com, laurent.pinchart+renesas@ideasonboard.com, niklas.soderlund+renesas@ragnatech.se Cc: Jacopo Mondi , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Hyun Kwon , Manivannan Sadhasivam Subject: [PATCH v2 3/7] media: i2c: max9286: Break-out reverse channel setup Date: Thu, 15 Oct 2020 20:27:06 +0200 Message-Id: <20201015182710.54795-4-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201015182710.54795-1-jacopo+renesas@jmondi.org> References: <20201015182710.54795-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Break out the reverse channel setup configuration procedure to its own function. This change prepares for configuring the reverse channel conditionally to the remote side high threshold configuration. No functional changes intended. Signed-off-by: Jacopo Mondi Reviewed-by: Kieran Bingham --- drivers/media/i2c/max9286.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index d969ac21a058..89a7248f5c25 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -906,6 +906,22 @@ static void max9286_v4l2_unregister(struct max9286_priv *priv) * Probe/Remove */ +static void max9286_reverse_channel_setup(struct max9286_priv *priv) +{ + /* + * Reverse channel setup. + * + * - Enable custom reverse channel configuration (through register 0x3f) + * and set the first pulse length to 35 clock cycles. + * - Increase the reverse channel amplitude to 170mV to accommodate the + * high threshold enabled by the serializer driver. + */ + max9286_write(priv, 0x3f, MAX9286_EN_REV_CFG | MAX9286_REV_FLEN(35)); + max9286_write(priv, 0x3b, MAX9286_REV_TRF(1) | MAX9286_REV_AMP(70) | + MAX9286_REV_AMP_X); + usleep_range(2000, 2500); +} + static int max9286_setup(struct max9286_priv *priv) { /* @@ -941,19 +957,7 @@ static int max9286_setup(struct max9286_priv *priv) * only. This should be disabled after the mux is initialised. */ max9286_configure_i2c(priv, true); - - /* - * Reverse channel setup. - * - * - Enable custom reverse channel configuration (through register 0x3f) - * and set the first pulse length to 35 clock cycles. - * - Increase the reverse channel amplitude to 170mV to accommodate the - * high threshold enabled by the serializer driver. - */ - max9286_write(priv, 0x3f, MAX9286_EN_REV_CFG | MAX9286_REV_FLEN(35)); - max9286_write(priv, 0x3b, MAX9286_REV_TRF(1) | MAX9286_REV_AMP(70) | - MAX9286_REV_AMP_X); - usleep_range(2000, 2500); + max9286_reverse_channel_setup(priv); /* * Enable GMSL links, mask unused ones and autodetect link From patchwork Thu Oct 15 18:27:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 286212 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3450EC433DF for ; Thu, 15 Oct 2020 16:27:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D29E22225E for ; Thu, 15 Oct 2020 16:27:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389553AbgJOQ1x (ORCPT ); Thu, 15 Oct 2020 12:27:53 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:40973 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389869AbgJOQ1t (ORCPT ); Thu, 15 Oct 2020 12:27:49 -0400 X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id B447BFF80B; Thu, 15 Oct 2020 16:27:43 +0000 (UTC) From: Jacopo Mondi To: kieran.bingham+renesas@ideasonboard.com, laurent.pinchart+renesas@ideasonboard.com, niklas.soderlund+renesas@ragnatech.se Cc: Jacopo Mondi , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Hyun Kwon , Manivannan Sadhasivam Subject: [PATCH v2 6/7] [DNI] arm64: dts: renesas: salvator-x: Add MAX9286 expansion board Date: Thu, 15 Oct 2020 20:27:09 +0200 Message-Id: <20201015182710.54795-7-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201015182710.54795-1-jacopo+renesas@jmondi.org> References: <20201015182710.54795-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Laurent Pinchart Add a .dtsi fragment to describe the MAX9286-based expansion board for the Renesas Salvator-X board. The MAX9286 expansion board has eight RDACM20 cameras connected to it. They can be individually controlled by enabling or disabling the macro defines. Signed-off-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- v2: - Use SPDX headers - Remove link from ADV748x TXA (HDMI) - Use 0x31-0x38, and 0x41-0x48 for the 8 cameras. 0x30 and 0x40 are the base addresses for the OV10635 and MAX9271 (0x50 for the MCU) - Provide RDACM20 MCU I2C address reservations. (0x51-0x58) v3: - Fix gmsl-serializer@ i2c node addressing v6: - Make i2c-mux child node and update to be conformant to new bindings. v7: - Separate register arguments --- .../boot/dts/renesas/salvator-x-max9286.dtsi | 394 ++++++++++++++++++ 1 file changed, 394 insertions(+) create mode 100644 arch/arm64/boot/dts/renesas/salvator-x-max9286.dtsi -- 2.28.0 diff --git a/arch/arm64/boot/dts/renesas/salvator-x-max9286.dtsi b/arch/arm64/boot/dts/renesas/salvator-x-max9286.dtsi new file mode 100644 index 000000000000..6f4798859542 --- /dev/null +++ b/arch/arm64/boot/dts/renesas/salvator-x-max9286.dtsi @@ -0,0 +1,394 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Device Tree Source for the Salvator-X MAX9286 expansion board + * + * Copyright (C) 2017 Ideas on Board + */ + +#include + +/* + * MAX9286 A + */ +#define MAXIM_CAMERA0 "imi,rdacm20" +#define MAXIM_CAMERA1 "imi,rdacm20" +#define MAXIM_CAMERA2 "imi,rdacm20" +#define MAXIM_CAMERA3 "imi,rdacm20" + +/* + * MAX9286 B + */ +#define MAXIM_CAMERA4 "imi,rdacm20" +#define MAXIM_CAMERA5 "imi,rdacm20" +#define MAXIM_CAMERA6 "imi,rdacm20" +#define MAXIM_CAMERA7 "imi,rdacm20" + +/ { +/* + * Powered MCU IMI cameras need delay between power-on and R-Car access + * to avoid I2C bus conflicts since the R-Car I2C does not support I2C + * multi-master. The I2C bus conflict would result in R-Car I2C IP stall. + */ +#define IMI_MCU_V0_DELAY 8000000 /* delay for powered MCU firmware v0 */ +#define IMI_MCU_V1_DELAY 3000000 /* delay for powered MCU firmware v1 */ +#define IMI_MCU_NO_DELAY 0 /* delay for unpowered MCU */ +#define IMI_MCU_DELAY IMI_MCU_V0_DELAY + + poc_12v: regulator-vcc-poc-12v { + compatible = "regulator-fixed"; + + regulator-name = "Camera PoC 12V"; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + startup-delay-us = <(250000 + IMI_MCU_DELAY)>; + + gpio = <&gpio6 30 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; +}; + +&vin0 { + status = "okay"; +}; + +&vin1 { + status = "okay"; +}; + +&vin2 { + status = "okay"; +}; + +&vin3 { + status = "okay"; +}; + +&vin4 { + status = "okay"; +}; + +&vin5 { + status = "okay"; +}; + +&vin6 { + status = "okay"; +}; + +&vin7 { + status = "okay"; +}; + +/* Disconnect the csi40 endpoint from the ADV748x TXA (HDMI) */ +&adv7482_txa { + /delete-property/ remote-endpoint; + status = "disabled"; +}; + +&csi40 { + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + csi40_in: endpoint { + clock-lanes = <0>; + data-lanes = <1 2 3 4>; + remote-endpoint = <&max9286_out0>; + }; + }; + }; +}; + +&csi41 { + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + csi41_in: endpoint { + clock-lanes = <0>; + data-lanes = <1 2 3 4>; + remote-endpoint = <&max9286_out1>; + }; + }; + }; +}; + +&i2c4 { + gmsl-deserializer@4c { + compatible = "maxim,max9286"; + reg = <0x4c>; + poc-supply = <&poc_12v>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + max9286_in0: endpoint { +#ifdef MAXIM_CAMERA0 + remote-endpoint = <&rdacm20_out0>; +#endif + }; + }; + + port@1 { + reg = <1>; + max9286_in1: endpoint { +#ifdef MAXIM_CAMERA1 + remote-endpoint = <&rdacm20_out1>; +#endif + }; + }; + + port@2 { + reg = <2>; + max9286_in2: endpoint { +#ifdef MAXIM_CAMERA2 + remote-endpoint = <&rdacm20_out2>; +#endif + }; + }; + + port@3 { + reg = <3>; + max9286_in3: endpoint { +#ifdef MAXIM_CAMERA3 + remote-endpoint = <&rdacm20_out3>; +#endif + }; + }; + + port@4 { + reg = <4>; + max9286_out0: endpoint { + clock-lanes = <0>; + data-lanes = <1 2 3 4>; + remote-endpoint = <&csi40_in>; + }; + }; + }; + + i2c-mux { + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + +#ifdef MAXIM_CAMERA0 + camera@31 { + compatible = MAXIM_CAMERA0; + reg = <0x31>, <0x41>, <0x51>; + + port { + rdacm20_out0: endpoint { + remote-endpoint = <&max9286_in0>; + }; + }; + + }; +#endif + }; + + i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + +#ifdef MAXIM_CAMERA1 + camera@32 { + compatible = MAXIM_CAMERA1; + reg = <0x32>, <0x42>, <0x52>; + port { + rdacm20_out1: endpoint { + remote-endpoint = <&max9286_in1>; + }; + }; + }; +#endif + }; + + i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + +#ifdef MAXIM_CAMERA2 + camera@33 { + compatible = MAXIM_CAMERA2; + reg = <0x33>, <0x43>, <0x53>; + port { + rdacm20_out2: endpoint { + remote-endpoint = <&max9286_in2>; + }; + }; + }; +#endif + }; + + i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + +#ifdef MAXIM_CAMERA3 + camera@34 { + compatible = MAXIM_CAMERA3; + reg = <0x34>, <0x44>, <0x54>; + port { + rdacm20_out3: endpoint { + remote-endpoint = <&max9286_in3>; + }; + }; + }; +#endif + }; + }; + }; + + gmsl-deserializer@6c { + compatible = "maxim,max9286"; + reg = <0x6c>; + poc-supply = <&poc_12v>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + max9286_in4: endpoint { +#ifdef MAXIM_CAMERA4 + remote-endpoint = <&rdacm20_out4>; +#endif + }; + }; + + port@1 { + reg = <1>; + max9286_in5: endpoint { +#ifdef MAXIM_CAMERA5 + remote-endpoint = <&rdacm20_out5>; +#endif + }; + }; + + port@2 { + reg = <2>; + max9286_in6: endpoint { +#ifdef MAXIM_CAMERA6 + remote-endpoint = <&rdacm20_out6>; +#endif + }; + }; + + port@3 { + reg = <3>; + max9286_in7: endpoint { +#ifdef MAXIM_CAMERA7 + remote-endpoint = <&rdacm20_out7>; +#endif + }; + }; + + port@4 { + reg = <4>; + max9286_out1: endpoint { + clock-lanes = <0>; + data-lanes = <1 2 3 4>; + remote-endpoint = <&csi41_in>; + }; + }; + }; + + i2c-mux { + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + +#ifdef MAXIM_CAMERA4 + camera@35 { + compatible = MAXIM_CAMERA4; + reg = <0x35>, <0x45>, <0x55>; + port { + rdacm20_out4: endpoint { + remote-endpoint = <&max9286_in4>; + }; + }; + }; +#endif + }; + + i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + +#ifdef MAXIM_CAMERA5 + camera@36 { + compatible = MAXIM_CAMERA5; + reg = <0x36>, <0x46>, <0x56>; + port { + rdacm20_out5: endpoint { + remote-endpoint = <&max9286_in5>; + }; + }; + }; +#endif + }; + + i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + +#ifdef MAXIM_CAMERA6 + camera@37 { + compatible = MAXIM_CAMERA6; + reg = <0x37>, <0x47>, <0x57>; + port { + rdacm20_out6: endpoint { + remote-endpoint = <&max9286_in6>; + }; + }; + }; +#endif + }; + + i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + +#ifdef MAXIM_CAMERA7 + camera@38 { + compatible = MAXIM_CAMERA7; + reg = <0x38>, <0x48>, <0x58>; + port { + rdacm20_out7: endpoint { + remote-endpoint = <&max9286_in7>; + }; + }; + }; +#endif + }; + }; + }; +};