]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
spi: aspeed: Improve timing calibration algorithm for AST2600 platform
authorChin-Ting Kuo <chin-ting_kuo@aspeedtech.com>
Wed, 1 Oct 2025 11:26:01 +0000 (19:26 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 13 Oct 2025 10:27:43 +0000 (11:27 +0100)
commitefb79de36e947d136517bac14c139d494fcc72fa
tree3c31da05b5d721a01463d55a414500bddbd99c90
parent31dcc7e1f8a9377d8fd9f967f84c121c5ba8f89c
spi: aspeed: Improve timing calibration algorithm for AST2600 platform

Starting with the AST2600 platform, most platfom manufacturers have
adopted more complex board designs and signal routing, making SPI
timing calibration increasingly sensitive and critical. Previously,
the driver selected the first "PASS" timing point during calibration,
which may not yield the most stable result.

This patch introduces a more robust calibration method:
- It evaluates all combinations of HCLK sample point delay and DI input
  delay. The results are stored in a 2D buffer for further comparison.
- Because the timing delay behavior is non-linear across HCLK sample
  points, the optimal timing point is selected as the center of the
  longest consecutive "PASS" interval within a single HCLK sample
  point row.

This approach ensures better stability and precision in SPI read timing,
especially under complex signal integrity conditions.

Signed-off-by: Chin-Ting Kuo <chin-ting_kuo@aspeedtech.com>
Link: https://patch.msgid.link/20251001112605.1130723-3-chin-ting_kuo@aspeedtech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-aspeed-smc.c