Skip to content

[PW_SID:1087309] i2c: spacemit: improve clock handling and cleanups#1835

Closed
linux-riscv-bot wants to merge 3 commits into
workflowfrom
pw1087309
Closed

[PW_SID:1087309] i2c: spacemit: improve clock handling and cleanups#1835
linux-riscv-bot wants to merge 3 commits into
workflowfrom
pw1087309

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1087309 applied to workflow

Name: i2c: spacemit: improve clock handling and cleanups
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1087309
Version: 6

Linux RISC-V bot and others added 3 commits April 28, 2026 17:02
The SpacemiT I2C controller's SCL (Serial Clock Line) frequency for
master mode operations is determined by the ILCR (I2C Load Count Register).
Previously, the driver relied on the hardware's reset default
values for this register.

The hardware's default ILCR values (SLV=0x156, FLV=0x5d) yield SCL
frequencies lower than intended. For example, with the default
31.5 MHz input clock, these default settings result in an SCL
frequency of approximately 93 kHz (standard mode) when targeting 100 kHz,
and approximately 338 kHz (fast mode) when targeting 400 kHz.
These frequencies are below the 100 kHz/400 kHz nominal speeds.

This patch integrates the SCL frequency management into
the Common Clock Framework (CCF). Specifically, the ILCR register,
which acts as a frequency divider for the SCL clock, is now registered
as a managed clock (scl_clk) within the CCF.

The actual hardware timing formulas are:
- standard mode: SCL = FCLK / (2 * SLV + 8)
- fast mode:     SCL = FCLK / (2 * FLV + 10)

These formulas are only valid when the IWCR (Wait Count Register) is
programmed to 0x142A, a value specified by the I2C IP designer. The
driver now initializes IWCR to this value during controller init.

Reviewed-by: Yixun Lan <dlan@gentoo.org>
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The clock-frequency property is optional according to the DT binding.
Do not emit a warning when the property is missing and fall back to the
default frequency instead.

Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] i2c: spacemit: configure ILCR/IWCR for accurate SCL frequency"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 140.43 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] i2c: spacemit: configure ILCR/IWCR for accurate SCL frequency"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1071.67 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] i2c: spacemit: configure ILCR/IWCR for accurate SCL frequency"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1451.62 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] i2c: spacemit: configure ILCR/IWCR for accurate SCL frequency"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.31 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] i2c: spacemit: configure ILCR/IWCR for accurate SCL frequency"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.06 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] i2c: spacemit: configure ILCR/IWCR for accurate SCL frequency"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.56 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] i2c: spacemit: configure ILCR/IWCR for accurate SCL frequency"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 84.83 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] i2c: spacemit: configure ILCR/IWCR for accurate SCL frequency"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] i2c: spacemit: configure ILCR/IWCR for accurate SCL frequency"
kdoc
Desc: Detects for kdoc errors
Duration: 0.87 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] i2c: spacemit: configure ILCR/IWCR for accurate SCL frequency"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] i2c: spacemit: configure ILCR/IWCR for accurate SCL frequency"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] i2c: spacemit: configure ILCR/IWCR for accurate SCL frequency"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] i2c: spacemit: drop warning when clock-frequency property is absent"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 141.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] i2c: spacemit: drop warning when clock-frequency property is absent"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1055.42 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] i2c: spacemit: drop warning when clock-frequency property is absent"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1443.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] i2c: spacemit: drop warning when clock-frequency property is absent"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.40 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] i2c: spacemit: drop warning when clock-frequency property is absent"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.64 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] i2c: spacemit: drop warning when clock-frequency property is absent"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.80 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] i2c: spacemit: drop warning when clock-frequency property is absent"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 86.42 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] i2c: spacemit: drop warning when clock-frequency property is absent"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] i2c: spacemit: drop warning when clock-frequency property is absent"
kdoc
Desc: Detects for kdoc errors
Duration: 0.87 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] i2c: spacemit: drop warning when clock-frequency property is absent"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] i2c: spacemit: drop warning when clock-frequency property is absent"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] i2c: spacemit: drop warning when clock-frequency property is absent"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot force-pushed the workflow branch 3 times, most recently from 83cebcb to e5fd44b Compare April 30, 2026 17:01
@linux-riscv-bot linux-riscv-bot deleted the pw1087309 branch April 30, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants