WSL2-Linux-Kernel/drivers/bus
Jan Luebbe 2bbbd96357 bus: mbus: fix window size calculation for 4GB windows
At least the Armada XP SoC supports 4GB on a single DRAM window. Because
the size register values contain the actual size - 1, the MSB is set in
that case. For example, the SDRAM window's control register's value is
0xffffffe1 for 4GB (bits 31 to 24 contain the size).

The MBUS driver reads back each window's size from registers and
calculates the actual size as (control_reg | ~DDR_SIZE_MASK) + 1, which
overflows for 32 bit values, resulting in other miscalculations further
on (a bad RAM window for the CESA crypto engine calculated by
mvebu_mbus_setup_cpu_target_nooverlap() in my case).

This patch changes the type in 'struct mbus_dram_window' from u32 to
u64, which allows us to keep using the same register calculation code in
most MBUS-using drivers (which calculate ->size - 1 again).

Fixes: fddddb52a6 ("bus: introduce an Marvell EBU MBus driver")
CC: stable@vger.kernel.org
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-10-12 15:01:30 +02:00
..
Kconfig bus: sunxi-rsb: Enable by default for ARM64 2017-08-18 14:30:15 +08:00
Makefile
arm-cci.c bus: Convert to using %pOF instead of full_name 2017-08-16 17:21:40 +02:00
arm-ccn.c
brcmstb_gisb.c
da8xx-mstpri.c
imx-weim.c bus: Convert to using %pOF instead of full_name 2017-08-16 17:21:40 +02:00
mips_cdmm.c
mvebu-mbus.c bus: mbus: fix window size calculation for 4GB windows 2017-10-12 15:01:30 +02:00
omap-ocp2scp.c
omap_l3_noc.c
omap_l3_noc.h
omap_l3_smx.c
omap_l3_smx.h
qcom-ebi2.c
simple-pm-bus.c
sunxi-rsb.c bus: Convert to using %pOF instead of full_name 2017-08-16 17:21:40 +02:00
tegra-aconnect.c
tegra-gmi.c
uniphier-system-bus.c bus: uniphier-system-bus: set up registers when resuming 2017-08-04 12:57:18 +02:00
vexpress-config.c