9
0
Fork 0

ARM: MMU: Fix memory reaching to the end of address space

For memory reaching the end of the address space
phys + bank->size overflows to 0. Fix this by right shifting
phys and bank->size before adding them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Sean Cross <xobs@kosagi.com>
This commit is contained in:
Sascha Hauer 2014-03-18 09:53:18 +01:00
parent 0017d4d2d6
commit 5a6410edd7
1 changed files with 1 additions and 1 deletions

View File

@ -200,7 +200,7 @@ static int arm_mmu_remap_sdram(struct memory_bank *bank)
{
unsigned long phys = (unsigned long)bank->start;
unsigned long ttb_start = phys >> 20;
unsigned long ttb_end = (phys + bank->size) >> 20;
unsigned long ttb_end = (phys >> 20) + (bank->size >> 20);
unsigned long num_ptes = bank->size >> 10;
int i, pte;
u32 *ptes;