diff mbox

[V3,13/41] xen/arm: Remove early_ioremap

Message ID 1368152307-598-14-git-send-email-julien.grall@linaro.org
State Superseded, archived
Headers show

Commit Message

Julien Grall May 10, 2013, 2:17 a.m. UTC
In the commit "xen/arm: Introduce ioremap_attr", vamp initialization has been
moved earlier in the boot process.
All the calls to early_ioremap can be replaced by ioremap_attr.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/mm.c             |   38 +-------------------------------------
 xen/drivers/video/arm_hdlcd.c |    3 ++-
 xen/include/asm-arm/mm.h      |    2 --
 3 files changed, 3 insertions(+), 40 deletions(-)

Comments

Ian Campbell May 10, 2013, 9:21 a.m. UTC | #1
On Fri, 2013-05-10 at 03:17 +0100, Julien Grall wrote:
> In the commit "xen/arm: Introduce ioremap_attr", vamp initialization has been
> moved earlier in the boot process.

Any reason not to make that move as part of this change?

This pushes vm_init before a whole bunch of other setup -- has this been
checked for safety?
Julien Grall May 10, 2013, 12:35 p.m. UTC | #2
On 05/10/2013 10:21 AM, Ian Campbell wrote:

> On Fri, 2013-05-10 at 03:17 +0100, Julien Grall wrote:
>> In the commit "xen/arm: Introduce ioremap_attr", vamp initialization has been
>> moved earlier in the boot process.
> 
> Any reason not to make that move as part of this change?

No. I will merge with the previous patch.

> This pushes vm_init before a whole bunch of other setup -- has this been
> checked for safety?

I didn't find any reason to not move vm_init. It only relies on memory,
which is initialized by setup_mm.
diff mbox

Patch

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 10d2869..d8d0309 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -568,45 +568,9 @@  void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
     frametable_virt_end = FRAMETABLE_VIRT_START + (nr_pages * sizeof(struct page_info));
 }
 
-/* Map the physical memory range start -  start + len into virtual
- * memory and return the virtual address of the mapping.
- * start has to be 2MB aligned.
- * len has to be < VMAP_VIRT_END - VMAP_VIRT_START.
- */
-static __initdata unsigned long early_vmap_start = VMAP_VIRT_END;
-void* __init early_ioremap(paddr_t start, size_t len, unsigned attributes)
-{
-    paddr_t end = start + len;
-    unsigned long map_start;
-
-    len = (len + SECOND_SIZE - 1) & ~SECOND_MASK;
-    early_vmap_start -= len;
-
-    ASSERT(!(start & (~SECOND_MASK)));
-    ASSERT(!(early_vmap_start & (~SECOND_MASK)));
-
-    /* The range we need to map is too big */
-    if ( early_vmap_start >= VMAP_VIRT_START )
-        return NULL;
-
-    map_start = early_vmap_start;
-    while ( start < end )
-    {
-        lpae_t e = mfn_to_xen_entry(start >> PAGE_SHIFT);
-        e.pt.ai = attributes;
-        write_pte(xen_second + second_table_offset(map_start), e);
-
-        start += SECOND_SIZE;
-        map_start += SECOND_SIZE;
-    }
-    flush_xen_data_tlb_range_va(early_vmap_start, len);
-
-    return (void*)early_vmap_start;
-}
-
 void *__init arch_vmap_virt_end(void)
 {
-    return (void *)early_vmap_start;
+    return (void *)VMAP_VIRT_END;
 }
 
 /*
diff --git a/xen/drivers/video/arm_hdlcd.c b/xen/drivers/video/arm_hdlcd.c
index d0ec13d..ecf2eba 100644
--- a/xen/drivers/video/arm_hdlcd.c
+++ b/xen/drivers/video/arm_hdlcd.c
@@ -211,7 +211,8 @@  void __init video_init(void)
 
     printk(KERN_INFO "Initializing HDLCD driver\n");
 
-    lfb = early_ioremap(framebuffer_start, framebuffer_size, DEV_WC);
+    lfb = ioremap_attr(framebuffer_start, framebuffer_size,
+                       PAGE_HYPERVISOR_WC);
     if ( !lfb )
     {
         printk(KERN_ERR "Couldn't map the framebuffer\n");
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index b5ea2d1..6b993bc 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -153,8 +153,6 @@  extern void setup_frametable_mappings(paddr_t ps, paddr_t pe);
 extern void set_fixmap(unsigned map, unsigned long mfn, unsigned attributes);
 /* Remove a mapping from a fixmap entry */
 extern void clear_fixmap(unsigned map);
-/* map a 2MB aligned physical range in virtual memory. */
-void* early_ioremap(paddr_t start, size_t len, unsigned attributes);
 /* map a physical range in virtual memory */
 void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned attributes);