All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] i2c/clk: spacemit: k1: fix I2C bus configuration and clock handling
@ 2026-08-15  3:40 Junhui Liu
  2026-08-15  3:40 ` [PATCH v2 1/4] i2c: k1: fix wrong bus speed setting Junhui Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Junhui Liu @ 2026-08-15  3:40 UTC (permalink / raw)
  To: Heiko Schocher, u-boot-spacemit, u-boot
  Cc: Huan Zhou, Guodong Xu, Tom Rini, Junhui Liu, Raymond Mao,
	Lukasz Majewski, Yixun Lan, Troy Mitchell

Fix two issues in the SpacemiT K1 I2C driver and clock provider.

The first issue is that the controller bus mode is selected using the
functional clock rate instead of the requested I2C bus speed from the
device tree.

The second issue is that the TWSI functional clocks incorrectly include
the bus clock enable bit in their gate masks. As a result the I2C driver
can operate with only the functional clock enabled, which diverges from
the device tree description and the Linux driver (both expect separate
"func" and "bus" clocks).

To fix the second issue without breaking intermediate states, the
patches are ordered as follows:

- First add the missing bus clocks (and their parent chain) to the SPL
  clock tree.
- Then update the I2C driver to acquire and enable both the functional
  and bus clocks by name.
- Finally remove the bus gate bit from the functional clock definitions
  (except TWSI8, whose write-only register requires the combined gate).

---
Changes in v2:
- Split the original patch 2/2 into three patches
- Acquire the functional and bus clocks explicitly by name instead of
  using the bulk clock API
- Link to v1: https://patch.msgid.link/20260814-k1-i2c-fix-v1-0-f2e19cbe0af6@pigmoral.tech

To: Heiko Schocher <hs@nabladev.com>
To: u-boot-spacemit@groups.io
To: u-boot@lists.u-boot-project.org
Cc: Huan Zhou <pericycle.cc@gmail.com>
Cc: Guodong Xu <guodong.xu@oss.qualcomm.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Junhui Liu <junhui.liu@pigmoral.tech>
Cc: Raymond Mao <raymond.mao@riscstar.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Yixun Lan <dlan@kernel.org>
Cc: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>

---
Junhui Liu (4):
      i2c: k1: fix wrong bus speed setting
      clk: spacemit: k1: add TWSI bus clocks to SPL
      i2c: k1: enable both functional and bus clocks
      clk: spacemit: k1: remove bus gate from TWSI functional clocks

 drivers/clk/spacemit/clk-k1.c | 41 +++++++++++++++++++++++++++++++++--------
 drivers/i2c/k1_i2c.c          | 27 ++++++++++++++++++---------
 2 files changed, 51 insertions(+), 17 deletions(-)
---
base-commit: 527115ef6783cec49e5610c523c124b399011361
change-id: 20260814-k1-i2c-fix-04dc9e3fd45a

Best regards,
--  
Junhui Liu <junhui.liu@pigmoral.tech>


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-08-17 14:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-15  3:40 [PATCH v2 0/4] i2c/clk: spacemit: k1: fix I2C bus configuration and clock handling Junhui Liu
2026-08-15  3:40 ` [PATCH v2 1/4] i2c: k1: fix wrong bus speed setting Junhui Liu
2026-08-17  8:29   ` Yixun Lan
2026-08-17  9:12   ` Troy Mitchell
2026-08-17 14:25     ` Junhui Liu
2026-08-15  3:40 ` [PATCH v2 2/4] clk: spacemit: k1: add TWSI bus clocks to SPL Junhui Liu
2026-08-15  3:40 ` [PATCH v2 3/4] i2c: k1: enable both functional and bus clocks Junhui Liu
2026-08-17  4:50   ` Heiko Schocher via U-Boot
2026-08-17  8:31   ` Yixun Lan
2026-08-17  8:56   ` Troy Mitchell
2026-08-17  9:18     ` Yixun Lan
2026-08-15  3:40 ` [PATCH v2 4/4] clk: spacemit: k1: remove bus gate from TWSI functional clocks Junhui Liu
2026-08-17  8:55   ` Troy Mitchell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.