Skip to content

Commit f8aa6c8

Browse files
legoaterbroonie
authored andcommitted
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 <[email protected]> Fixes: e3228ed ("spi: spi-mem: Convert Aspeed SMC driver to spi-mem") Signed-off-by: Cédric Le Goater <[email protected]> Reviewed-by: Joel Stanley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent b40af61 commit f8aa6c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi-aspeed-smc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ static void aspeed_spi_get_windows(struct aspeed_spi *aspi,
398398
windows[cs].cs = cs;
399399
windows[cs].size = data->segment_end(aspi, reg_val) -
400400
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;
402402
dev_vdbg(aspi->dev, "CE%d offset=0x%.8x size=0x%x\n", cs,
403403
windows[cs].offset, windows[cs].size);
404404
}

0 commit comments

Comments
 (0)