linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Drew Fustini <dfustini@tenstorrent.com>
To: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
Cc: "Andi Shyti" <andi.shyti@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Jisheng Zhang" <jszhang@kernel.org>,
	"Guo Ren" <guoren@kernel.org>, "Fu Wei" <wefu@redhat.com>,
	"Emil Renner Berthing" <emil.renner.berthing@canonical.com>,
	"Conor Dooley" <conor@kernel.org>,
	"Jarkko Nikula" <jarkko.nikula@linux.intel.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Miquèl Raynal" <miquel.raynal@bootlin.com>,
	linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
	"Conor Dooley" <conor.dooley@microchip.com>
Subject: Re: [PATCH v3 0/3] Add I2C support on TH1520
Date: Tue, 25 Jun 2024 14:28:02 -0700	[thread overview]
Message-ID: <Zns2YnLSDZfGgrIP@x1> (raw)
In-Reply-To: <20240618-i2c-th1520-v3-0-3042590a16b1@bootlin.com>

On Tue, Jun 18, 2024 at 09:42:37AM +0200, Thomas Bonnefille wrote:
> This adds I2C support in the device tree of the T-Head TH1520 RISCV-SoC
> and a default configuration for the BeagleV-Ahead. It appears that the
> TH1520 I2C is already supported in the upstream kernel through the
> Synopsis Designware I2C adapter driver.
> 
> This patch depends on the clock patch from Drew Fustini
> Link: https://lore.kernel.org/linux-riscv/20240615-th1520-clk-v1-0-3ba4978c4d6b@tenstorrent.com
> and the pinctrl patch from Emil Renner Berthing
> Link: https://lore.kernel.org/linux-riscv/20240103132852.298964-1-emil.renner.berthing@canonical.com
> 
> Changed from v1:
> 1. Remove redundant example for Synopsis DesignWare-I2C bindings
> 2. Remove Node Ordering commit as it has already been taken
> 3. Remove EEPROM label
> 4. Rebase on pinctrl and clock driver patches
> 5. Add pinctrl configuration
> 6. Replaced the fixed-clock with a correct configuration
> 
> Changed from v2:
> 1. Reorder nodes to conserve ascending register node ordering
> 2. Add support for I2C2 as it probably use the same controller
> 3. Format comments to match kernel coding style
> 4. Reorder nodes to conserve alphabetical node ordering
> 6. Declare I2C2
> 6. Set pinctrl pull-up resistor to the highest value
> 
> Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
> ---
> Thomas Bonnefille (3):
>       dt-bindings: i2c: dw: Document compatible thead,th1520-i2c
>       riscv: dts: thead: Add TH1520 I2C nodes
>       riscv: dts: thead: Enable I2C on the BeagleV-Ahead
> 
>  .../bindings/i2c/snps,designware-i2c.yaml          |  4 ++
>  arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts | 84 ++++++++++++++++++++++
>  arch/riscv/boot/dts/thead/th1520.dtsi              | 60 ++++++++++++++++
>  3 files changed, 148 insertions(+)

The I2C controllers and the EEPROM probe okay on the BeagleV Ahead:

[    3.834654] i2c_dev: i2c /dev entries driver
[    4.037875] at24 0-0050: supply vcc not found, using dummy regulator
[    4.050303] at24 0-0050: 4096 byte 24c32 EEPROM, writable, 1 bytes/write

The EEPROM on I2C0 is working correctly:

# hexdump -C /sys/class/i2c-dev/i2c-0/device/0-0050/eeprom
[  196.438252] random: crng init done
00000000  42 45 41 47 4c 45 56 2d  41 48 45 41 44 2d 41 30  |BEAGLEV-AHEAD-A0|
00000010  0a ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00000020  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
*
00001000

I did have to modify the .config to enable the necessary drivers.

Could you add patch that includes these in arch/riscv/configs/defconfig?

CONFIG_I2C_DESIGNWARE_CORE
CONFIG_I2C_DESIGNWARE_PLATFORM 
CONFIG_EEPROM_AT24

Thanks,
Drew

  parent reply	other threads:[~2024-06-25 21:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18  7:42 [PATCH v3 0/3] Add I2C support on TH1520 Thomas Bonnefille
2024-06-18  7:42 ` [PATCH v3 1/3] dt-bindings: i2c: dw: Document compatible thead,th1520-i2c Thomas Bonnefille
2024-06-19  6:40   ` Jarkko Nikula
2024-06-19  7:37     ` Icenowy Zheng
2024-06-19  7:39     ` Krzysztof Kozlowski
2024-06-19 13:42       ` Jarkko Nikula
2024-06-18  7:42 ` [PATCH v3 2/3] riscv: dts: thead: Add TH1520 I2C nodes Thomas Bonnefille
2024-06-25 21:30   ` Drew Fustini
2024-06-18  7:42 ` [PATCH v3 3/3] riscv: dts: thead: Enable I2C on the BeagleV-Ahead Thomas Bonnefille
2024-06-25 21:30   ` Drew Fustini
2024-07-21 22:47   ` Emil Renner Berthing
2024-06-25 21:28 ` Drew Fustini [this message]
2024-06-28  9:30 ` [PATCH v3 0/3] Add I2C support on TH1520 Andi Shyti
2024-06-28 10:49   ` Conor Dooley
2024-07-10  7:48 ` (subset) " Andi Shyti
2024-07-10  8:21   ` Krzysztof Kozlowski
2024-07-10 13:01     ` Andi Shyti

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=Zns2YnLSDZfGgrIP@x1 \
    --to=dfustini@tenstorrent.com \
    --cc=andi.shyti@kernel.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=conor.dooley@microchip.com \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=emil.renner.berthing@canonical.com \
    --cc=guoren@kernel.org \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=jszhang@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh@kernel.org \
    --cc=thomas.bonnefille@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wefu@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).