linux/drivers/bus
Jan Luebbe 1937c0e586 bus: mbus: fix window size calculation for 4GB windows
commit 2bbbd96357 upstream.

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")
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-01-01 20:51:52 +00:00
..
arm-cci.c drivers: cci: Export CCI PMU revision 2014-02-25 19:36:17 +01:00
brcmstb_gisb.c bus: add Broadcom GISB bus arbiter timeout/error handler 2014-05-24 00:58:39 +02:00
imx-weim.c bus: imx-weim: Take the 'status' property value into account 2016-05-01 00:05:57 +02:00
Kconfig bus/arm-cci: add dependency on OF && CPU_V7 2014-06-17 17:09:35 +02:00
Makefile ARM: SoC driver changes 2014-06-02 16:35:49 -07:00
mvebu-mbus.c bus: mbus: fix window size calculation for 4GB windows 2018-01-01 20:51:52 +00:00
omap-ocp2scp.c ARM: OMAP2+: Remove omap4 ocp2scp pdata 2013-05-30 13:09:31 -07:00
omap_l3_noc.c bus: omap_l3_noc: Correct returning IRQ_HANDLED unconditionally in the irq handler 2015-02-04 10:57:52 +00:00
omap_l3_noc.h bus: omap_l3_noc: Add AM4372 interconnect error data 2014-05-05 14:34:37 -05:00
omap_l3_smx.c drivers: bus: Move the OMAP interconnect driver to drivers/bus/ 2012-09-19 16:53:26 +02:00
omap_l3_smx.h drivers: bus: Move the OMAP interconnect driver to drivers/bus/ 2012-09-19 16:53:26 +02:00
vexpress-config.c bus: vexpress-config: fix device reference leak 2017-03-16 02:26:27 +00:00