Commit eef784bb authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/8xx: Ensures RAM mapped with LTLB is seen as block mapped on 8xx.

On the 8xx, the RAM mapped with LTLBs must be seen as block mapped,
just like areas mapped with BATs on standard PPC32.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 36992606
...@@ -22,8 +22,11 @@ ...@@ -22,8 +22,11 @@
extern int __map_without_ltlbs; extern int __map_without_ltlbs;
static unsigned long block_mapped_ram;
/* /*
* Return PA for this VA if it is in IMMR area, or 0 * Return PA for this VA if it is in an area mapped with LTLBs.
* Otherwise, returns 0
*/ */
phys_addr_t v_block_mapped(unsigned long va) phys_addr_t v_block_mapped(unsigned long va)
{ {
...@@ -33,11 +36,13 @@ phys_addr_t v_block_mapped(unsigned long va) ...@@ -33,11 +36,13 @@ phys_addr_t v_block_mapped(unsigned long va)
return 0; return 0;
if (va >= VIRT_IMMR_BASE && va < VIRT_IMMR_BASE + IMMR_SIZE) if (va >= VIRT_IMMR_BASE && va < VIRT_IMMR_BASE + IMMR_SIZE)
return p + va - VIRT_IMMR_BASE; return p + va - VIRT_IMMR_BASE;
if (va >= PAGE_OFFSET && va < PAGE_OFFSET + block_mapped_ram)
return __pa(va);
return 0; return 0;
} }
/* /*
* Return VA for a given PA or 0 if not mapped * Return VA for a given PA mapped with LTLBs or 0 if not mapped
*/ */
unsigned long p_block_mapped(phys_addr_t pa) unsigned long p_block_mapped(phys_addr_t pa)
{ {
...@@ -47,6 +52,8 @@ unsigned long p_block_mapped(phys_addr_t pa) ...@@ -47,6 +52,8 @@ unsigned long p_block_mapped(phys_addr_t pa)
return 0; return 0;
if (pa >= p && pa < p + IMMR_SIZE) if (pa >= p && pa < p + IMMR_SIZE)
return VIRT_IMMR_BASE + pa - p; return VIRT_IMMR_BASE + pa - p;
if (pa < block_mapped_ram)
return (unsigned long)__va(pa);
return 0; return 0;
} }
...@@ -133,6 +140,8 @@ unsigned long __init mmu_mapin_ram(unsigned long top) ...@@ -133,6 +140,8 @@ unsigned long __init mmu_mapin_ram(unsigned long top)
if (mapped) if (mapped)
memblock_set_current_limit(mapped); memblock_set_current_limit(mapped);
block_mapped_ram = mapped;
return mapped; return mapped;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment