Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7788cd55 authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by Nicolas Pitre
Browse files

[ARM] Orion: fix PCIe inbound window programming when RAM size is not a power of two



The PCIe inbound window size is supposed to be a power of two.  If
the total amount of RAM installed in the system is not a power of two,
round it up such that it is.

Signed-off-by: default avatarLennert Buytenhek <buytenh@marvell.com>
Signed-off-by: default avatarNicolas Pitre <nico@marvell.com>
parent 6b7b2849
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -132,6 +132,12 @@ static void __init orion_pcie_setup_wins(void __iomem *base,
		size += cs->size;
	}

	/*
	 * Round up 'size' to the nearest power of two.
	 */
	if ((size & (size - 1)) != 0)
		size = 1 << fls(size);

	/*
	 * Setup BAR[1] to all DRAM banks.
	 */