From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18EE5EC873E for ; Thu, 7 Sep 2023 16:20:06 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.96) (envelope-from ) id 1qeHjh-0008AG-2d for kernelnewbies@archiver.kernel.org; Thu, 07 Sep 2023 12:20:05 -0400 Received: from mail-oa1-f49.google.com ([209.85.160.49]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1qeHhw-0006BL-0n for kernelnewbies@kernelnewbies.org; Thu, 07 Sep 2023 12:18:16 -0400 Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-1c4c5375329so853077fac.2 for ; Thu, 07 Sep 2023 09:18:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694103478; x=1694708278; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6vJCUVp5l5e8MLy8mNlJ59ywBKIxCpFxUc7CrIBSgX0=; b=C9apmIN0qkW1qZ3s9IX0mTDiTJ4mK7YBsM7zy17zNquSnzF+jZTeMMlCmQC+GVdBCO Xlaczt4EN1U+3WStsy1e6Jg+DpZhl1WMCSoWMerOzH6rnFghc/C7x5TFOgU6pWUqANBb Yoo/HwfUSX1+WGKeQqVfH0FbJ9ibvaxiox6F9isAICIWBGSLsqKvAQENtJ99+fODr+CV XmwglWvhp/SdpxfTDEX5ZdSMVsSvYb+CcQqh/hBZbdLMBntkweGZ5NVGRNkt1N1oMf0B 53B8SfmSLuEv+1CvVxvQ7pGCOScUxzJ2ndh5a9/mBnoN7Jy34mckCCzUQP1ibBG9OkiR Y7HA== X-Gm-Message-State: AOJu0Yybhg+NSymXQsclyFUEexxfeEjq4YDQhie1CfG7qjsvO3ByLPHz aSPLcVpVljIm393VdCHJSQrtx1ZRKxbbNw== X-Google-Smtp-Source: AGHT+IG8AGJeyge5vVf/V/ZtNSK1gGxzBOEJVbBLHJaDuhEKXBsWENGVQpCXTSRkcz/hiWXiVztnTQ== X-Received: by 2002:a05:6808:13c1:b0:3a0:4636:d079 with SMTP id d1-20020a05680813c100b003a04636d079mr82158oiw.22.1694103477780; Thu, 07 Sep 2023 09:17:57 -0700 (PDT) Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com. [209.85.210.47]) by smtp.gmail.com with ESMTPSA id d17-20020a05680813d100b003a43759b9cdsm1092484oiw.29.2023.09.07.09.17.57 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Sep 2023 09:17:57 -0700 (PDT) Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6beff322a97so794254a34.3 for ; Thu, 07 Sep 2023 09:17:57 -0700 (PDT) X-Received: by 2002:a05:6830:1147:b0:6b0:c67c:96f3 with SMTP id x7-20020a056830114700b006b0c67c96f3mr18417397otq.18.1694103476755; Thu, 07 Sep 2023 09:17:56 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Lucas Tanure Date: Thu, 7 Sep 2023 17:17:47 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Debugging i2c : i2cdetect cant detect a device on i2c line To: "Russell King (Oracle)" Cc: Linux Devicetree , Conor Dooley , Andi Shyti , Krzysztof Kozlowski , kernelnewbies , Linus Walleij , LKML , Rob Herring , Linux I2C , Bagas Sanjaya , Raul Piper , Linux ARM X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: tanure@linux.com Content-Type: multipart/mixed; boundary="===============5037946158762969823==" Errors-To: kernelnewbies-bounces+kernelnewbies=archiver.kernel.org@kernelnewbies.org --===============5037946158762969823== Content-Type: multipart/alternative; boundary="000000000000f1e9830604c73322" --000000000000f1e9830604c73322 Content-Type: text/plain; charset="UTF-8" On Thu, 7 Sept 2023, 14:56 Russell King (Oracle), wrote: > On Thu, Sep 07, 2023 at 08:36:32PM +0700, Bagas Sanjaya wrote: > > [also Cc: devicetree and ARM folks] > > > > On Thu, Sep 07, 2023 at 08:21:44AM +0530, Raul Piper wrote: > > > Hello , > > > I am trying to detect an i2c device A on i2c1 line on one of the Arm > > > Cortex A7 platform but not able to see any device on a given address ( > > > 0x3d) . > > > > > > Is there any parameters of i2c which i can change like rise/fall time > > > , timeout etc in a device tree or kernel source and re test it? > > > I have tried changing the i2c speed from 100KHz to 400 KHz but no > success. > > > I have even tried removing the 1.5K pull ups on the i2c lines but no > result. > > Honestly, from this description, I'm wondering if this posting is a joke. > > I2C is entirely _reliant_ on pull-ups. It's a wire-or bus, and the > logic 1 state is created by no device pulling the signal low, thereby > allowing the pull-up resistor to pull the line to the logic 1 state. > > The pull-up must be the correct strength for the devices on the bus. > If it is too strong, then a driver may not be able to pull the signal > sufficiently low for other devices to register it as a logic 0. > > Conversely, the pull-up must be strong enough so that the rise-time > of the signal is sufficient to register as a logic 1. > > If it's a problem with the rise time, then increasing the clock rate > will just make the situation worse. > > So, if other devices work on the bus, it could be that the Vil > threshold of this device is not being achieved, whereas the other > devices are happy. Therefore, I would suggest you study the data > sheets of the device that isn't being detected. > > Lastly, if the undetectable device has a reset line, it's possible > that the device isn't responding because it's being held in reset. > Please try to use an logic analyser like saleae logic. Probe the i2c bus, reset line, power lines, pins that set the i2c address for the device. Can tell us which device it is? -- > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ > FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! > > _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > --000000000000f1e9830604c73322 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, 7 Sept 2023, 14:56 Russell King (Oracle), <= linux@armlinux.org.uk> wrot= e:
On Thu, Sep 07, 2023 at 08:36:32= PM +0700, Bagas Sanjaya wrote:
> [also Cc: devicetree and ARM folks]
>
> On Thu, Sep 07, 2023 at 08:21:44AM +0530, Raul Piper wrote:
> > Hello ,
> > I am trying to detect an i2c device A on i2c1 line on=C2=A0 one o= f the Arm
> > Cortex A7 platform but not able to see any device on a given addr= ess (
> > 0x3d) .
> >
> > Is there any parameters of i2c which i can change like rise/fall = time
> > , timeout etc in a device tree or kernel source and re test it? > > I have tried changing the i2c speed from 100KHz to 400 KHz=C2=A0 = but no success.
> > I have even tried removing the 1.5K pull ups on the i2c lines but= no result.

Honestly, from this description, I'm wondering if this posting is a jok= e.

I2C is entirely _reliant_ on pull-ups. It's a wire-or bus, and the
logic 1 state is created by no device pulling the signal low, thereby
allowing the pull-up resistor to pull the line to the logic 1 state.

The pull-up must be the correct strength for the devices on the bus.
If it is too strong, then a driver may not be able to pull the signal
sufficiently low for other devices to register it as a logic 0.

Conversely, the pull-up must be strong enough so that the rise-time
of the signal is sufficient to register as a logic 1.

If it's a problem with the rise time, then increasing the clock rate will just make the situation worse.

So, if other devices work on the bus, it could be that the Vil
threshold of this device is not being achieved, whereas the other
devices are happy. Therefore, I would suggest you study the data
sheets of the device that isn't being detected.

Lastly, if the undetectable device has a reset line, it's possible
that the device isn't responding because it's being held in reset.<= br>
Please try to use an logic an= alyser like saleae logic.
Probe the i2c bus, reset l= ine, power lines, pins that set the i2c address for the device.
Can tell us which device it is?



--
RMK's Patch system: https://www.armlinu= x.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies= .org/mailman/listinfo/kernelnewbies
--000000000000f1e9830604c73322-- --===============5037946158762969823== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============5037946158762969823==--