Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp381328lqt; Thu, 6 Jun 2024 06:34:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUcH+OHuyXJ9C60Qvu8K9NuKPe84ISFKJ64gWjrLWXv8xfMmH4k+W0f9BbYeeZin9VMcR8+4ADUFUO53EXHaRptCBsz5q22nV89JKCrqw== X-Google-Smtp-Source: AGHT+IFWmKgKidUr0ShrQiMl2t3mBCjxMJuDPjVdi8p95npoxQ5pYo4daor0m/22O0QvcvM3XaXB X-Received: by 2002:a17:902:da8e:b0:1f5:e635:21e3 with SMTP id d9443c01a7336-1f6a5a12b85mr73014965ad.27.1717680890292; Thu, 06 Jun 2024 06:34:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717680890; cv=pass; d=google.com; s=arc-20160816; b=lh9gefIVe2H+Jk/95PcrrLvFzhMPhukMEt+AQOVDKIAa0yEt5Fp/o6k3lref0XBVw1 q7kYGF84lhME9pT9aPtjduM0wIAcf+thMGJchOpXFobjkIIBywkcl8ct+J06xk1Grjvm h6LCgQo633yDiHQUI591A34OosHq0r1hDDp5pNDVuzU8zjNfuEqEUm6EZrDB9J44IONN 0HOo5zuBW+cVjIKCvoFbtXutyJSnMr1pFoNRK8ikwHLlPHRA6RBh43aTM3cbAkHcK0FN XUABbbaWjLdku38EVUZ1hwiyYTyCVgb+MghTPCSChTgflSy7mHI+VYLttkN7qKSNxU6d mavg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=/+G9rIsjvlkSvVjgxZoKsv6U9cSKjBr/hSZnFkMaWUw=; fh=l4WnJuONSjnRzWeoEiioaGFdIbLEP0ULVnA8Jltd26U=; b=CAvq/Yt2RaV8tgGGdxlc19YOELi1gO5NWOBXOU5mjlbMGT0SGRdC2qWwetAOYu0nYg cQUmLLdnTO4i0tFucAe+KPFToPCuWFYHER9Ht4dVdl0p/2pIeBSOUKYhtADKZaFTCPum UJ3y1qjGJCCXAmsbx2LOuO/hPHlo7A62+psVxeJVoUCMl+1WV3mfENn7gdYrjeaNiaC6 qnCbyZ87QE7Uh/6mJDMDSCVQPGhVom3vGFg8dMATkiPjItqgm4wa4/GVxpJM/lcck+lw oIg0dG463JupsZRxiBlIouEkEpZBaryk/g1ql5Q12+mkejLGdxbGo3g429I5/BSVoKKU ay7Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=KPMoVINz; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-204377-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204377-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd8207d1si11905615ad.590.2024.06.06.06.34.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 06:34:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204377-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=KPMoVINz; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-204377-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204377-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0ADB4281A2C for ; Thu, 6 Jun 2024 13:34:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C42C196C6C; Thu, 6 Jun 2024 13:34:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="KPMoVINz" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA766194A7B; Thu, 6 Jun 2024 13:34:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717680867; cv=none; b=pMUGWvlFiduAS+NNOG/A0SNMvx5Vyh/TCkxj22SVk0jzhlqnhVFa9tYUNPwnVB7XY6u3rXRD7/Y+wJIp1zqnGtx3R2JfzFY4lpFxUb1PwA7CpiSPvS88VMc8Yxv/1oNToNM7FGcU5oGFzn+n3UF85NDVHDFLZJ0xlA30QkBlfTY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717680867; c=relaxed/simple; bh=dQ6yhjfZfplamzfb30U5qvWrBbL+8+7pqVQuhytkwuY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qyCBXGX5BQ2OlHLeb+AYWbY/hEU+A48rPPs9kbG/aOYjHSuTaDMHNTC+5kdfGSg72KMZooMJjd2h6HqIZL/plHkt1hZXsX3m30c3Se10TdQTiLZmmZz2f3Dv8CeykJZHT8hCx05vl5yFqBqiVFNhOc16LkDz1r6QxkUkkZQAz0s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=KPMoVINz; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from [192.168.88.20] (91-158-144-210.elisa-laajakaista.fi [91.158.144.210]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 39A55720; Thu, 6 Jun 2024 15:34:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1717680853; bh=dQ6yhjfZfplamzfb30U5qvWrBbL+8+7pqVQuhytkwuY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=KPMoVINzAPoS5J0dcDdD1uWm6AxjD5xyfR7XACFTURyOa6nvFnqRHAErSJfXQUEyY yOfYmIS5BUc2VD14RRTpjNQXrStSqqGnIaKZv9bV+IUgk7DoGafLjfLvQewBBa/P41 KPYGz+7DHXkibjuWpi9zDZLEGK7fWXRF4oVhM/3U= Message-ID: <8d67c3b3-a3a6-4733-ac0d-ddd2c244d790@ideasonboard.com> Date: Thu, 6 Jun 2024 16:34:19 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 0/5] Add support for MAX96714/F and MAX96717/F GMSL2 ser/des To: Julien Massot , sakari.ailus@iki.fi, Laurent Pinchart Cc: devicetree@vger.kernel.org, kernel@collabora.com, linux-kernel@vger.kernel.org, mchehab@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-media@vger.kernel.org, conor+dt@kernel.org References: <20240430131931.166012-1-julien.massot@collabora.com> From: Tomi Valkeinen Content-Language: en-US Autocrypt: addr=tomi.valkeinen@ideasonboard.com; keydata= xsFNBE6ms0cBEACyizowecZqXfMZtnBniOieTuFdErHAUyxVgtmr0f5ZfIi9Z4l+uUN4Zdw2 wCEZjx3o0Z34diXBaMRJ3rAk9yB90UJAnLtb8A97Oq64DskLF81GCYB2P1i0qrG7UjpASgCA Ru0lVvxsWyIwSfoYoLrazbT1wkWRs8YBkkXQFfL7Mn3ZMoGPcpfwYH9O7bV1NslbmyJzRCMO eYV258gjCcwYlrkyIratlHCek4GrwV8Z9NQcjD5iLzrONjfafrWPwj6yn2RlL0mQEwt1lOvn LnI7QRtB3zxA3yB+FLsT1hx0va6xCHpX3QO2gBsyHCyVafFMrg3c/7IIWkDLngJxFgz6DLiA G4ld1QK/jsYqfP2GIMH1mFdjY+iagG4DqOsjip479HCWAptpNxSOCL6z3qxCU8MCz8iNOtZk DYXQWVscM5qgYSn+fmMM2qN+eoWlnCGVURZZLDjg387S2E1jT/dNTOsM/IqQj+ZROUZuRcF7 0RTtuU5q1HnbRNwy+23xeoSGuwmLQ2UsUk7Q5CnrjYfiPo3wHze8avK95JBoSd+WIRmV3uoO rXCoYOIRlDhg9XJTrbnQ3Ot5zOa0Y9c4IpyAlut6mDtxtKXr4+8OzjSVFww7tIwadTK3wDQv Bus4jxHjS6dz1g2ypT65qnHen6mUUH63lhzewqO9peAHJ0SLrQARAQABzTBUb21pIFZhbGtl aW5lbiA8dG9taS52YWxrZWluZW5AaWRlYXNvbmJvYXJkLmNvbT7CwY4EEwEIADgWIQTEOAw+ ll79gQef86f6PaqMvJYe9QUCX/HruAIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRD6 PaqMvJYe9WmFD/99NGoD5lBJhlFDHMZvO+Op8vCwnIRZdTsyrtGl72rVh9xRfcS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5kUqLV7rJnM9 /4cwy+uZUt8cuCZlcA5u8IsBCNJudxEqBG10GHg1B6h1RZIz9Q9XfiBdaqa5+CjyFs8ua01c 9HmyfkuhXG2OLjfQuK+Ygd56mV3lq0aFdwbaX16DG22c6flkkBSjyWXYepFtHz9KsBS0DaZb 4IkLmZwEXpZcIOQjQ71fqlpiXkXSIaQ6YMEs8WjBbpP81h7QxWIfWtp+VnwNGc6nq5IQDESH mvQcsFS7d3eGVI6eyjCFdcAO8eMAEQEAAcLBXwQYAQIACQUCTqazRwIbDAAKCRD6PaqMvJYe 9fA7EACS6exUedsBKmt4pT7nqXBcRsqm6YzT6DeCM8PWMTeaVGHiR4TnNFiT3otD5UpYQI7S suYxoTdHrrrBzdlKe5rUWpzoZkVK6p0s9OIvGzLT0lrb0HC9iNDWT3JgpYDnk4Z2mFi6tTbq xKMtpVFRA6FjviGDRsfkfoURZI51nf2RSAk/A8BEDDZ7lgJHskYoklSpwyrXhkp9FHGMaYII m9EKuUTX9JPDG2FTthCBrdsgWYPdJQvM+zscq09vFMQ9Fykbx5N8z/oFEUy3ACyPqW2oyfvU CH5WDpWBG0s5BALp1gBJPytIAd/pY/5ZdNoi0Cx3+Z7jaBFEyYJdWy1hGddpkgnMjyOfLI7B CFrdecTZbR5upjNSDvQ7RG85SnpYJTIin+SAUazAeA2nS6gTZzumgtdw8XmVXZwdBfF+ICof 92UkbYcYNbzWO/GHgsNT1WnM4sa9lwCSWH8Fw1o/3bX1VVPEsnESOfxkNdu+gAF5S6+I6n3a ueeIlwJl5CpT5l8RpoZXEOVtXYn8zzOJ7oGZYINRV9Pf8qKGLf3Dft7zKBP832I3PQjeok7F yjt+9S+KgSFSHP3Pa4E7lsSdWhSlHYNdG/czhoUkSCN09C0rEK93wxACx3vtxPLjXu6RptBw 3dRq7n+mQChEB1am0BueV1JZaBboIL0AGlSJkm23kw== In-Reply-To: <20240430131931.166012-1-julien.massot@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 30/04/2024 16:19, Julien Massot wrote: > Change since v6: > - Remove mention of C-PHY for MAX96717, this serializer is D-PHY only > - Remove bus-type requirement for MAX96717 > - Minor changes requested by Sakari > - Workaround a MAX96717 issue, which occurs when stopping > the CSI source before stopping the MAX96717 CSI receiver. > > Power management is not included in this patchset. The GMSL link is > not always resuming when the deserializer is suspended without > suspending the serializer. > > Change since v5: > - Reverse fallback logic: max9671{4,7} can fallback to max9671{4,7}F > - use const instead of enum for max9671{4,7}f compatible as suggested > > Change since v4: > - Add support for MAX96717 and MAX96714 and use them as a fallback for > MAX96717F and MAX96714F respectively > - The drivers are now compatible with MAX96717 and MAX96714 since no change in > the logic is needed > - Reference 'i2c-gate' instead of 'i2c-controller' in the bindings > > Change since v3: > - bindings > - Renamed bindings to drop the 'f' suffix > - Add bus type to MAX96717 and remove from MAX9674 > - Add lane-polarities to both bindings > > - drivers > - Address changes requested by Sakari in v3 > - use v4l2_subdev_s_stream_helper for MAX96714 > - do not init regmap twice in the MAX96714 driver > - Fix compilations on 32 bits platforms > > Change since v2: > - Convert drivers to use CCI helpers > - Use generic node name > - Use 'powerdown' as gpio name instead of 'enable' > - Add pattern generator support for MAX96714 > > These patches add support for Maxim MAX96714F deserializer and > MAX96717F serializer. > > MAX96714F has one GMSL2 input port and one CSI2 4 lanes output port, > MAX96717F has one CSI2 input port and one GMSL2 output port. > > The drivers support the tunnel mode where all the > CSI2 traffic coming from an imager is replicated through the deserializer > output port. > > Both MAX96714F and MAX96717F are limited to a 3Gbps forward link rate > leaving a maximum of 2.6Gbps for the video payload. (I see this mail turned out to be a collection of thoughts rather than clear questions... Bear with me =)) I know I'm very late to this party, and perhaps these topics have already been discussed, but as I will most likely be doing some GMSL work in the future I wanted to ask these questions. My main questions/concerns are related to the i2c and the representation of the links in the DT. First, I know these particular devices are one input, one output serializer and deserializer, so there's not much to do wrt. i2c translation/gating. But even here I wonder how does one support a case where a single local i2c bus would have two deserializer devices (with different i2c addresses), connected to two identical camera modules? Controlling the deserializers would work fine, but as the serializers and the remote peripherals (sensor) would answer to identical i2c addresses, it would conflict and not work. If I understand the HW docs right, a way (maybe there are others?) to handle this would be: - deser probes, but keeps the link disabled by default - deser reads the initial serializer i2c address from the DT, but also a new address which we want the serializer to have (which doesn't conflict with the other serializer) - deser enables the link and immediately (how to be sure the other deser driver doesn't do this at the same time?) sends a write to the serializer's DEV_ADDR, changing the serializer's i2c address. - deser can now add the serializer linux i2c device, so that the serializer can probe - the serializer should prevent any remote i2c transactions until it has written the SRC_A/B and DST_A/B registers, to get translation for the remote peripherals (or maybe the deser driver should do this part too). Am I on the right track with the above? Now, maybe having such a HW config, two deserializers on a single i2c bus, doesn't happen in real life, but this issue comes up with multi-port deserializers. And while those deserializers are different devices than what's added in this series, the serializers used may be the same as here. This means the serializer drivers and DT bindings should be such that multi-port deserializers can be supported. As I said, I'm late (and new) to this party, and struggling to consume and understand all the related specs and drivers, so I hope you can give some insight into how all this might be implemented in the future =). Have you looked at the FPD-Link drivers (ds90ub9xx)? The i2c management is a bit different with those (with my current understanding, a bit saner...), but I wonder if similar style would help here, or if the i2c-atr could be utilized. It would be nice (but I guess not really mandatory in any way) to have similar style in DT bindings for all ser-des solutions. To summarize the i2c management on both FPD-Link and GMSL (if I have understood it right): In FPD-Link the deserializer does it all: it has registers for the serializer i2c aliases, and for i2c address translation (per port). So when the deser probes, it can program suitable i2c addresses (based on data from DT), which will be the addresses visible on the main i2c bus, and thus there are never any conflicts. In addition to that, the drivers utilize i2c-atr, which means that new linux i2c busses are created for each serializer. E.g. the deser might be, say, on i2c bus 4, and also the serializers, via their i2c aliases, would be accessible bus 4. When the serializer drivers probe they will create new i2c busses with i2c-atr. So with a 4 port deserializer we might get i2c busses 5, 6, 7 and 8. The linux i2c devices for remote peripherals (sensors mainly) would be created on these busses with their real i2c addresses. When a sensor driver does an i2c write to its device, the i2c-atr will catch the write, change the address according to the translation table, and do an actual write on the i2c bus 4. This would result in the deser HW to catch this write, switch the address back to the "real" one, and send it to the appropriate serializer, which would then send the i2c transaction on its i2c bus. In GMSL the deser just forwards everything it sees on the i2c bus, if a port is enabled. The deser has no other support related to i2c. The serializers have DEV_ADDR register which can be used to change the address the serializers respond to, and the serializers also have i2c translation for two remote peripherals. But if the i2c translation is used, it would mean that, say, the sensor driver would need to use the "virtual" address, not the real one to communicate with the sensor device, which doesn't sound right... You have used i2c-gate for both the deser and the ser. I don't have experience with i2c-gate, but how can we manage the serializer i2c address and the i2c address translation with it? One difference with the FPD-Link and this series' DT bindings is that I have a "links" node in the deser, instead of just adding the serializers under an i2c node. In FPD-Link case this allowed me to better represent the hardware and the configuration needed. So... Perhaps my bottom line question is: do we need something similar to what the FPD-Link uses (links, i2c-atr) to fully support GMSL devices? And also, if we merge the DT bindings in this series, will we have gone into a corner wrt. how we can manage the i2c? Tomi