Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: aspeed: Fix window offset of CE1

The offset value of the mapping window in the kernel structure is
calculated using the value of the previous window offset. This doesn't
reflect how the HW is configured and can lead to erroneous setting of
the second flash device (CE1).

Cc: Chin-Ting Kuo <chin-ting_kuo@aspeedtech.com>
Fixes: e3228ed92893 ("spi: spi-mem: Convert Aspeed SMC driver to spi-mem")
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20221016155722.3520802-1-clg@kaod.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Cédric Le Goater and committed by
Mark Brown
f8aa6c89 b40af618

+1 -1
+1 -1
drivers/spi/spi-aspeed-smc.c
··· 398 398 windows[cs].cs = cs; 399 399 windows[cs].size = data->segment_end(aspi, reg_val) - 400 400 data->segment_start(aspi, reg_val); 401 - windows[cs].offset = cs ? windows[cs - 1].offset + windows[cs - 1].size : 0; 401 + windows[cs].offset = data->segment_start(aspi, reg_val) - aspi->ahb_base_phy; 402 402 dev_vdbg(aspi->dev, "CE%d offset=0x%.8x size=0x%x\n", cs, 403 403 windows[cs].offset, windows[cs].size); 404 404 }