提交 b8dec144 编写于 作者: A Alexander Graf

PPC: e500: Change in-memory order of load blobs

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: NAlexander Graf <agraf@suse.de>
上级 746a870b
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#define UIMAGE_LOAD_BASE 0 #define UIMAGE_LOAD_BASE 0
#define DTC_LOAD_PAD 0x1800000 #define DTC_LOAD_PAD 0x1800000
#define DTC_PAD_MASK 0xFFFFF #define DTC_PAD_MASK 0xFFFFF
#define DTB_MAX_SIZE (8 * 1024 * 1024)
#define INITRD_LOAD_PAD 0x2000000 #define INITRD_LOAD_PAD 0x2000000
#define INITRD_PAD_MASK 0xFFFFFF #define INITRD_PAD_MASK 0xFFFFFF
...@@ -629,6 +630,10 @@ void ppce500_init(PPCE500Params *params) ...@@ -629,6 +630,10 @@ void ppce500_init(PPCE500Params *params)
} }
cur_base = loadaddr + kernel_size; 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. */ /* Load initrd. */
...@@ -651,13 +656,13 @@ void ppce500_init(PPCE500Params *params) ...@@ -651,13 +656,13 @@ void ppce500_init(PPCE500Params *params)
struct boot_info *boot_info; struct boot_info *boot_info;
int dt_size; 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, dt_size = ppce500_load_device_tree(env, params, dt_base, initrd_base,
initrd_size); initrd_size);
if (dt_size < 0) { if (dt_size < 0) {
fprintf(stderr, "couldn't load device tree\n"); fprintf(stderr, "couldn't load device tree\n");
exit(1); exit(1);
} }
assert(dt_size < DTB_MAX_SIZE);
boot_info = env->load_info; boot_info = env->load_info;
boot_info->entry = entry; boot_info->entry = entry;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册