mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 08:46:46 +00:00
[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: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: Nicolas Pitre <nico@marvell.com>
This commit is contained in:
parent
6b7b284958
commit
7788cd5557
1 changed files with 6 additions and 0 deletions
|
@ -132,6 +132,12 @@ static void __init orion_pcie_setup_wins(void __iomem *base,
|
||||||
size += cs->size;
|
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.
|
* Setup BAR[1] to all DRAM banks.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue