[PATCH v2 0/4] i2c/clk: spacemit: k1: fix I2C bus configuration and clock handling
Junhui Liu <[email protected]>
| Newsgroups | gmane.comp.boot-loaders.u-boot |
|---|---|
| Message-ID | <20260815-k1-i2c-fix-v2-0-7d2a48607233__34468.4956058458$1786765346$gmane$org@pigmoral.tech> |
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/[email protected] To: Heiko Schocher <[email protected]> To: [email protected] To: [email protected] Cc: Huan Zhou <[email protected]> Cc: Guodong Xu <[email protected]> Cc: Tom Rini <[email protected]> Cc: Junhui Liu <[email protected]> Cc: Raymond Mao <[email protected]> Cc: Lukasz Majewski <[email protected]> Cc: Yixun Lan <[email protected]> Cc: Troy Mitchell <[email protected]> Signed-off-by: Junhui Liu <[email protected]> --- 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 <[email protected]>