public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: neil.armstrong@linaro.org
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Da Xue <da@libre.computer>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: dts: amlogic: gxl: set i2c bias to pull-up
Date: Mon, 5 May 2025 14:27:09 +0200	[thread overview]
Message-ID: <75104e42-282d-4a63-be0e-07a5c6fdf276@linaro.org> (raw)
In-Reply-To: <CAFBinCBiVQqeYTmR3sj++E8CqQXSMsOzhafAV0JNgDVR9OU7ZA@mail.gmail.com>

On 04/05/2025 23:03, Martin Blumenstingl wrote:
> On Mon, Apr 28, 2025 at 9:32 AM Neil Armstrong
> <neil.armstrong@linaro.org> wrote:
>>
>> On 25/04/2025 22:31, Da Xue wrote:
>>> GXL I2C pins need internal pull-up enabled to operate if there
>>> is no external resistor. The pull-up is 60kohms per the datasheet.
>>>
>>> We should set the bias when i2c pinmux is enabled.
>>
>> So, yes in some cases when the on-board pull-up is missing, the on-pad
>> pull-up is required, but the whole idea was to only add the pull-up property
>> when needed.
>>
>> So I know the real motivation is again about the 40pin headers, where
>> some applications don't add a pull-up and still want to have i2c working.
> For SD/eMMC, SPI and UART we have pull up/down enabled in meson-gxl.dtsi.
> I can't recall if I have asked this before: what's the rule (of thumb)
> for having bias-pull-up/down vs. bias-disable in .dtsi files?
> 
> In the past I had to track down incorrect bias.
> It gets especially tricky when we don't have schematics and there's no
> u-boot sources available from the vendor (I know, the latter shouldn't
> be possible - but that's the world we live in unfortunately).
> It means that we can end up with one of four cases for the bias settings:
> - there's an actual resistor on the PCB (pulling the pin up/down)
> - hardware (SoC) default for the pin
> - vendor u-boot configures bias for the pin (but we don't know because
> we don't have the sources)
> - vendor Linux configures bias for the pin (at least we can dump the
> .dtb and hope that the bias setting is in there)
> 
> That's why I lean towards having sane defaults in the SoC.dtsi (it
> seems that rockchip does the same?).

Right, but in this case the biases needed for i2c is rather easy to figure out,
and the very weak 60kohms on the pad won't affect i2c if a proper PU is on
the PCB. So I'll pick this one, and yeah a similar one should be needed
for G12/SM1 and newer SoCs.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Neil

> 
> 
> Best regards,
> Martin



  reply	other threads:[~2025-05-05 12:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-25 20:31 [PATCH] arm64: dts: amlogic: gxl: set i2c bias to pull-up Da Xue
2025-04-27 21:08 ` Martin Blumenstingl
2025-04-28  2:36   ` Xianwei Zhao
2025-04-28  2:46   ` Da Xue
2025-04-28  7:32 ` Neil Armstrong
2025-04-29  2:08   ` Da Xue
2025-05-04 21:03   ` Martin Blumenstingl
2025-05-05 12:27     ` neil.armstrong [this message]
2025-05-05 12:36 ` Neil Armstrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=75104e42-282d-4a63-be0e-07a5c6fdf276@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=da@libre.computer \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox