Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2134395rwd; Mon, 15 May 2023 07:42:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ68K6gTXUC4nhsnPu7B+smdiQCp0gPlsm02outSIPkCEjGCWU93GvEY1GBX4/gIwxw+zy0Y X-Received: by 2002:a17:90a:df86:b0:249:86bd:42a7 with SMTP id p6-20020a17090adf8600b0024986bd42a7mr35623908pjv.42.1684161767724; Mon, 15 May 2023 07:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684161767; cv=none; d=google.com; s=arc-20160816; b=lzF93TevM3NeubER6s9VFe9eP0BE/scNGKuEhDlnW/8455Df/fjna6f/07Suj6gQQe WPuT3JpYg3tkgw53J+gt2qEhsUSKZpGsI4rFJZnFn3KYBVweUuFyn72+HLiHSZ9+1BoZ s/00ieyVf6+gi0KLBK1zcHGC8IErRhSRtFbhrqMjkMoBXqzcWiTpe7xORUbreVJ3IrLP x1hXESNUDVH6eboX42BNzY7kZ8CfWIuWLmcoa8Mg2rid0ubOZoK3O/Il+9djKJ4+5M16 tJ/OO/2LrnWCZmqmyiKuQ1FpaUay6bkh7Ey0jPL/puRke/bSp9HYgSHboYSJvOGpgPlA HYbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=FEN96dmV0QOn0Xv30DSUNmzscaAgRSM74ruFY3Omo5Y=; b=YgaN1815BjCl5OxnjYrabi9epatjn7JDlvBXCDTWq/aDYlffZ1f+CdF9z6ITrYkIqC ryKMNy0Mp6jTnzcxP3Maz/6LotV4Qs4g163s3MEUA1CuVfb8JyURV63po3iM9scm3Nhh SDxdHmqDqDucFWelFjz1QGE/dc3RWhLZrnKi6r6LBggbawl37a7yHRoxj8Oj+wDzLiVz 22MOYcUpwYaC6F44FM73RBLbSabvjQBwVx1oONeT28bVxSiqXTPp23/korRmeq3bnpvg hyzkwvya2nQy+dHxB9MM2nAyIUla7Ew3wi3z3K1QLNxRZcGDPf1Ll0zgKtwQUt57qYdo 1ULQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=U+eR1vgo; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pt6-20020a17090b3d0600b0022bbae722fcsi16538563pjb.1.2023.05.15.07.42.32; Mon, 15 May 2023 07:42:47 -0700 (PDT) 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=@collabora.com header.s=mail header.b=U+eR1vgo; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240247AbjEOOeJ (ORCPT + 99 others); Mon, 15 May 2023 10:34:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241730AbjEOOdx (ORCPT ); Mon, 15 May 2023 10:33:53 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FCE51FCE for ; Mon, 15 May 2023 07:33:23 -0700 (PDT) Received: from [IPV6:2001:b07:2ed:14ed:a962:cd4d:a84:1eab] (unknown [IPv6:2001:b07:2ed:14ed:a962:cd4d:a84:1eab]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id C3CEB66029DE; Mon, 15 May 2023 15:32:45 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1684161166; bh=bWZThDJSU0iT2g+zjqNeZ3/ILxoEj05Ce5sSgcKUe/o=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=U+eR1vgoJXvDzgRfU2ak0AcHjYq5CcRxGoLBcC++VJhYWXDmJ4sZ746fZ7zXTBnbw TBPemcV8v/KRvCQOroPb9vkpvNaWbXC0IJ0wztLD6RYdRJdGNcwuBX2QG5FBHa5cqe VX0TJJvEXBIqAqA5NpXh1yHIXyMQpYSREE9i7K8Ik66ybXu7ivAk/y5Rz7pse5naP+ CUWiQQgXNZ6u0AAcyRsDSHEimkhbunfZOOvtKI1m4N3zaWGxw7vdT5DGLy+M/C5B81 sHWNVY4Q9Y50BPgQx7y1D+/M+sByFaC5GTQxv8Dx3wnatXCeG+jSDv4vVsHp2Q/a3K kSL6TUU/EeGtg== Message-ID: <54e6923c-729a-49de-8395-fbd0b8443aa8@collabora.com> Date: Mon, 15 May 2023 16:32:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH v2 2/2] phy: mtk-mipi-csi: add driver for CSI phy Content-Language: en-US To: Julien Stephan Cc: krzysztof.kozlowski@linaro.org, robh@kernel.org, chunkuang.hu@kernel.org, linux-mediatek@lists.infradead.org, Phi-bang Nguyen , Louis Kuo , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Andy Hsieh , Philipp Zabel , Matthias Brugger , open list , "moderated list:ARM/Mediatek USB3 PHY DRIVER" , "open list:GENERIC PHY FRAMEWORK" , "open list:DRM DRIVERS FOR MEDIATEK" References: <20230515090551.1251389-1-jstephan@baylibre.com> <20230515090551.1251389-3-jstephan@baylibre.com> From: AngeloGioacchino Del Regno In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Il 15/05/23 16:07, Julien Stephan ha scritto: > On Mon, May 15, 2023 at 02:22:52PM +0200, AngeloGioacchino Del Regno wrote: >>> +#define CSIxB_OFFSET 0x1000 >> >> What if we grab two (or three?) iospaces from devicetree? >> >> - base (global) >> - csi_a >> - csi_b >> >> That would make it possible to maybe eventually extend this driver to more >> versions (older or newer) of the CSI PHY IP without putting fixes offsets >> inside of platform data structures and such. >> > Hi Angelo, > The register bank of the CSI port is divided into 2: > * from base address to base + 0x1000 (port A) > * from base + 0x1000 to base +0x2000 (port B) > Some CSI port can be configured in 4D1C mode (4 data + 1 clock) using > the whole register bank from base to base + 0x2000 or in 2D1C mode (2 data + > 1 clock) and use either port A or port B. > > For example mt8365 has CSI0 that can be used either in 4D1C mode or in > 2 * 2D1C and CSI1 which can use only 4D1C mode > > 2D1C mode can not be tested and is not implemented in the driver so > I guess adding csi_a and csi_b reg value may be confusing? > > What do you think? Ok so we're talking about two data lanes per CSI port... it may still be beneficial to split the two register regions as reg-names = "csi-a", "csi-b"; (whoops, I actually used underscores before, and that was a mistake, sorry!) ....but that would be actually good only if we are expecting to get a CSI PHY in the future with four data lanes per port. If you do *not* expect at all such a CSI PHY, or you do *not* expect such a PHY to ever be compatible with this driver (read as: if you expect such a PHY to be literally completely different from this one), then it would not change much to have the registers split in two. Another case in which it would make sense is if we were to get a PHY that provides more than two CSI ports: in that case, we'd avoid platform data machinery to check the number of actual ports in the IP, as we would be just checking how many register regions we were given from the devicetree, meaning that if we got "csi-a", "csi-b", "csi-c", "csi-d", we have four ports. Besides, another thing to think about is... yes you cannot test nor implement 2D1C mode in your submission, but this doesn't mean that others won't ever be interested in this and that other people won't be actually implementing that; Providing them with the right initial driver structure will surely make things easier, encouraging other people from the community to spend their precious time on the topic. Regards, Angelo