]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
spi: aspeed: Centralize address decoding region management
authorChin-Ting Kuo <chin-ting_kuo@aspeedtech.com>
Wed, 1 Oct 2025 11:26:03 +0000 (19:26 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 13 Oct 2025 10:27:45 +0000 (11:27 +0100)
commitb546e0023a203e7edf9377ac8f4f490a6965afd6
treedc29f75200d372ade909fe3e48ec7d0e07a96454
parent630a185fd06109193574d10f38b29812986c21de
spi: aspeed: Centralize address decoding region management

The original approach to handling address decoding overlaps was to trim
the next region directly. If the next CS's decoding range was fully
overlapped by the current one, it would be forcibly closed by trimming
its size to zero. This could lead expected behavior, especially on
the platform with multiple flashes layout.

To solve improper trimming problem, this patch collects the required
address decoding size at each stage, then, (re-)arragne address decoding
region to each CS centrally with knowing the total AHB decoding size.
If a segment register cannot be updated (e.g. due to bootloader write
protection), the original value is kept to avoid breaking access and
an error is reported if the total decoding size of all CS exceeds
the total AHB decoding size.

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