From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DF07520E31B; Wed, 19 Mar 2025 07:40:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742370006; cv=none; b=BI3+9M4H1jxxESAfyNRmSVkjdrof6I5LcmAkAWLydMOUVvnvjGB/AdpRj81jgAykYlV2Q1Sza4HmYQp7/DW796asMycWOhScIlqUXSOVaGYpp5NuwFEsMzH6SqQTAn84BLlYWxWcjvTbG7Pi5jNPyKo0AkDW+wOH4Xa2ep6kQaY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742370006; c=relaxed/simple; bh=tKIbx2+7UEC6SU/Ci8glYFwYES+rjaNTdcbdH+R6TS4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=b6vOfK/30ZIbVDI36fqCtZ0xWtJz46neO5QtQ3Ij+FdpsKgz76jUMf+st4S97+oaydJYpmb8wCFRUZ2gpe48i/H+1r7TLwsBeS9PGXtgkb6ehQXNpUBLYmuVioa+nnq/vzIFuBLCeKeHXf3SbWZ1tmP1VKZCde1fArx8pxuOy0g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iTC2J7vI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iTC2J7vI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B4F4C4CEE9; Wed, 19 Mar 2025 07:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1742370005; bh=tKIbx2+7UEC6SU/Ci8glYFwYES+rjaNTdcbdH+R6TS4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=iTC2J7vI9gdw4qI2bdHDiMSymEqGhCe2EaCZpTpfQ2DERnFKR7kQs4qTvHQnTr7Tf Ng+DPcHm19bSxSO0miPkBpWLO9gbiq1xESNFLalNDHqTCSKQCmbd3l20qsrxk52w7E 1h+0v7377B0cpcqmfluYlpWf/kC4rT5P6xGzjjlq9e/M9/O33V9w2INM76kL2Cdj/P BfD+wdg8rSDUGHcoR4q3cB/LF3zf9aViOVfjBrvSYFhbuZWGQRR9UO2pkjT8JYGzm5 f2jqjFYo3VhcjJWuf2wRJ3A6viyEJjxq4lLg20lqwORpgH2hKficXCrNhSLVw+6SiB w0dToPGlDelcA== Message-ID: Date: Wed, 19 Mar 2025 08:39:52 +0100 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 09/13] dt-bindings: phy: Add documentation for Airoha AN7581 USB PHY To: Christian Marangi Cc: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lee Jones , Vinod Koul , Kishon Vijay Abraham I , Matthias Brugger , AngeloGioacchino Del Regno , Greg Kroah-Hartman , Lorenzo Bianconi , Daniel Danzberger , Arnd Bergmann , Linus Walleij , Nikita Shubin , Guo Ren , Yangyu Chen , Ben Hutchings , Felix Fietkau , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-usb@vger.kernel.org, upstream@airoha.com References: <20250309132959.19045-1-ansuelsmth@gmail.com> <20250309132959.19045-10-ansuelsmth@gmail.com> <4f16d239-f540-45d5-b67a-767b09f1c70c@kernel.org> <67d0862f.df0a0220.375bd.6b15@mx.google.com> <4a9ac302-dfbe-4d76-a634-a445957c313c@kernel.org> <67d95979.050a0220.166852.25e6@mx.google.com> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzSVLcnp5c3p0b2Yg S296bG93c2tpIDxrcnprQGtlcm5lbC5vcmc+wsGVBBMBCgA/AhsDBgsJCAcDAgYVCAIJCgsE FgIDAQIeAQIXgBYhBJvQfg4MUfjVlne3VBuTQ307QWKbBQJgPO8PBQkUX63hAAoJEBuTQ307 QWKbBn8P+QFxwl7pDsAKR1InemMAmuykCHl+XgC0LDqrsWhAH5TYeTVX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.25e6@mx.google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 18/03/2025 12:31, Christian Marangi wrote: > On Sun, Mar 16, 2025 at 06:01:02PM +0100, Krzysztof Kozlowski wrote: >> On 11/03/2025 19:51, Christian Marangi wrote: >>>> >>>>> + $ref: /schemas/types.yaml#/definitions/uint32 >>>>> + enum: [0, 1] >>>> >>>> I don't understand why do you need index property here (which are >>>> usually not allowed). >>>> >>> >>> Eh... As said in the description this is really to differentiate the 2 >>> different physical port... >>> >>> Each port have a dedicated oscillator for calibration and these >>> calibration are identified by an offset (all placed one after another in >>> a separate register space). >> >> So different oscillators? Then describe the oscillator and its differences. >> >> Different programing model? Different compatible. >> >> Other difference? Depending what is the difference. >> >> But there is no such thing as "different port ID" based on your >> description above. You just claimed that they are different, but you do >> not put that difference to hardware description. Instead you encode that >> difference in the drivers and it should be opposite. The DTS, so the >> hardware description, should tell you the difference. And I am sorry, >> but in 99% of cases "I am the first phy" and "I am the second" is not >> the actual difference we are interested in. >> > > Ok to make it as clear as possible. (hope I don't contraddict with the > previous statement) (actually yes the "separate register space statement > was wrong and sorry for the confusion") > > - 2 USB port > - USB 2.0 needs to be calibrated with an oscillator > - Each USB port have his own dedicated oscillator somewhere in the HW > - Each USB port have at the same offset a register to SELECT the > oscillator. This register refer to the same oscillator selection in > the HW. > > Example: > reg 0x1fac0100 MASK 27:26 can be set to source out of oscillator 0,1,2 > reg 0x1fae0100 MASK 27:26 can be set to source out of oscillator 0,1,2 So that's your difference between devices - you choose the oscillator. > > Both register refer to the same oscillators in hardware (hence each > port should select the correct one) > Selecting oscillator 0 for both USB port is problematic. > > With this in mind is it ok if I describe this with something like > > airoha,usb2-monitor-clk-sel = ; > > and some dt-bindings include > > #define AIROHA_USB2_MONCLK_SEL0 0 > #define AIROHA_USB2_MONCLK_SEL1 1 > #define AIROHA_USB2_MONCLK_SEL2 2 > #define AIROHA_USB2_MONCLK_SEL3 3 > > Or an enum of string like "osc0", "osc1", "osc2"...? Both are fine. Best regards, Krzysztof