[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 6/9] PPC: e500: Change in-memory order of load blobs
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PATCH 6/9] PPC: e500: Change in-memory order of load blobs |
Date: |
Fri, 18 Jan 2013 19:13:38 +0100 |
Today, we load
<kernel> <initrd> <dtb>
into memory in that order. However, Linux has a bug where it can only
handle the dtb if it's within the first 64MB of where <kernel> starts.
So instead, let's change the order to
<kernel> <dtb> <initrd>
making Linux happy.
Signed-off-by: Alexander Graf <address@hidden>
---
hw/ppc/e500.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index e5564ce..c36821a 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -41,6 +41,7 @@
#define UIMAGE_LOAD_BASE 0
#define DTC_LOAD_PAD 0x1800000
#define DTC_PAD_MASK 0xFFFFF
+#define DTB_MAX_SIZE (8 * 1024 * 1024)
#define INITRD_LOAD_PAD 0x2000000
#define INITRD_PAD_MASK 0xFFFFFF
@@ -629,6 +630,10 @@ void ppce500_init(PPCE500Params *params)
}
cur_base = loadaddr + kernel_size;
+
+ /* Reserve space for dtb */
+ dt_base = (cur_base + DTC_LOAD_PAD) & ~DTC_PAD_MASK;
+ cur_base += DTB_MAX_SIZE;
}
/* Load initrd. */
@@ -651,13 +656,13 @@ void ppce500_init(PPCE500Params *params)
struct boot_info *boot_info;
int dt_size;
- dt_base = (cur_base + DTC_LOAD_PAD) & ~DTC_PAD_MASK;
dt_size = ppce500_load_device_tree(env, params, dt_base, initrd_base,
initrd_size);
if (dt_size < 0) {
fprintf(stderr, "couldn't load device tree\n");
exit(1);
}
+ assert(dt_size < DTB_MAX_SIZE);
boot_info = env->load_info;
boot_info->entry = entry;
--
1.6.0.2
- [Qemu-ppc] [PULL 0/9] ppc patch queue 2013-01-18, Alexander Graf, 2013/01/18
- [Qemu-ppc] [PATCH 2/9] openpic: unify gcr mode mask updates, Alexander Graf, 2013/01/18
- [Qemu-ppc] [PATCH 5/9] PPC: Provide zero SVR for -cpu e500mc and e5500, Alexander Graf, 2013/01/18
- [Qemu-ppc] [PATCH 1/9] openpic: move gcr write into a function, Alexander Graf, 2013/01/18
- [Qemu-ppc] [PATCH 8/9] openpic: export e500 epr enable into a ppc.c function, Alexander Graf, 2013/01/18
- [Qemu-ppc] [PATCH 7/9] Update Linux kernel headers, Alexander Graf, 2013/01/18
- [Qemu-ppc] [PATCH 6/9] PPC: e500: Change in-memory order of load blobs,
Alexander Graf <=
- [Qemu-ppc] [PATCH 4/9] PPC: E500: Calculate loading blob offsets properly, Alexander Graf, 2013/01/18
- [Qemu-ppc] [PATCH 3/9] openpic: set mixed mode as supported, Alexander Graf, 2013/01/18
- [Qemu-ppc] [PATCH 9/9] PPC: KVM: Add support for EPR with KVM, Alexander Graf, 2013/01/18
- Re: [Qemu-ppc] [PULL 0/9] ppc patch queue 2013-01-18, Blue Swirl, 2013/01/19