]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: LPAE: add support for ATAG_MEM64
authorWill Deacon <will.deacon@arm.com>
Mon, 31 Jan 2011 13:50:46 +0000 (13:50 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 14 Jun 2011 13:43:59 +0000 (14:43 +0100)
LPAE provides support for memory banks with physical addresses of up
to 40 bits.

This patch adds a new atag, ATAG_MEM64, so that the Kernel can be
informed about memory that exists above the 4GB boundary.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm/include/asm/setup.h
arch/arm/kernel/compat.c
arch/arm/kernel/setup.c

index ee2ad8ae07af7d4006d82a474cb2282654cb986a..d6d2efb3ed0ec4fefbe4a2548722d2e4f245b576 100644 (file)
@@ -43,6 +43,13 @@ struct tag_mem32 {
        __u32   start;  /* physical start address */
 };
 
+#define ATAG_MEM64     0x54420002
+
+struct tag_mem64 {
+       __u64   size;
+       __u64   start;  /* physical start address */
+};
+
 /* VGA text type displays */
 #define ATAG_VIDEOTEXT 0x54410003
 
@@ -147,7 +154,8 @@ struct tag {
        struct tag_header hdr;
        union {
                struct tag_core         core;
-               struct tag_mem32        mem;
+               struct tag_mem32        mem32;
+               struct tag_mem64        mem64;
                struct tag_videotext    videotext;
                struct tag_ramdisk      ramdisk;
                struct tag_initrd       initrd;
index 925652318b8b5df4cb7dce4383b99cee2640285b..f224d950202d996a0868214acc9bcded714fda96 100644 (file)
@@ -86,8 +86,8 @@ static struct tag * __init memtag(struct tag *tag, unsigned long start, unsigned
        tag = tag_next(tag);
        tag->hdr.tag = ATAG_MEM;
        tag->hdr.size = tag_size(tag_mem32);
-       tag->u.mem.size = size;
-       tag->u.mem.start = start;
+       tag->u.mem32.size = size;
+       tag->u.mem32.start = start;
 
        return tag;
 }
index ed11fb08b05a5b2d3fd022d981970c01c9fdc088..906a6bb8142e0019514aa2624dd01c8aae1a65de 100644 (file)
@@ -600,11 +600,21 @@ __tagtable(ATAG_CORE, parse_tag_core);
 
 static int __init parse_tag_mem32(const struct tag *tag)
 {
-       return arm_add_memory(tag->u.mem.start, tag->u.mem.size);
+       return arm_add_memory(tag->u.mem32.start, tag->u.mem32.size);
 }
 
 __tagtable(ATAG_MEM, parse_tag_mem32);
 
+#ifdef CONFIG_PHYS_ADDR_T_64BIT
+static int __init parse_tag_mem64(const struct tag *tag)
+{
+       /* We only use 32-bits for the size. */
+       return arm_add_memory(tag->u.mem64.start, (unsigned long)tag->u.mem64.size);
+}
+
+__tagtable(ATAG_MEM64, parse_tag_mem64);
+#endif /* CONFIG_PHYS_ADDR_T_64BIT */
+
 #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
 struct screen_info screen_info = {
  .orig_video_lines     = 30,