diff options
author | Bo Hu <bohu@google.com> | 2015-05-07 15:10:07 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-05-07 15:10:08 +0000 |
commit | 4daddd3f2487e99c30b09693411bbba4b2df76d7 (patch) | |
tree | 0f691fb37becfea2a4d89f7f90f95168a8abe434 | |
parent | 92053a21f16c202d0b8ad22125b4ef09dbe7eef9 (diff) | |
parent | 5561478fec519b4accf349f5a2bcef45877ba4b8 (diff) | |
download | qemu-studio-1.2-dev.tar.gz |
Merge "Revert "Backport arm_boot: Change initrd load address to "halfway through RAM"" Because this CL causes Mac not to boot arm image anymore This reverts commit deff600e4e880b01953d4c5c0363774c385de09f." into studio-1.2-devstudio-1.2-dev
-rw-r--r-- | hw/arm/boot.c | 28 | ||||
-rw-r--r-- | include/hw/arm/arm.h | 1 |
2 files changed, 8 insertions, 21 deletions
diff --git a/hw/arm/boot.c b/hw/arm/boot.c index b4fb9e9a58..4c901485f8 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -13,6 +13,7 @@ #define KERNEL_ARGS_ADDR 0x100 #define KERNEL_LOAD_ADDR 0x00010000 +#define INITRD_LOAD_ADDR 0x00800000 /* The worlds second smallest bootloader. Set r0-r2, then jump to kernel. */ static uint32_t bootloader[] = { @@ -79,7 +80,7 @@ static void set_kernel_args(const struct arm_boot_info *info, /* ATAG_INITRD2 */ WRITE_WORD(p, 4); WRITE_WORD(p, 0x54420005); - WRITE_WORD(p, info->initrd_start); + WRITE_WORD(p, info->loader_start + INITRD_LOAD_ADDR); WRITE_WORD(p, initrd_size); } if (info->kernel_cmdline && *info->kernel_cmdline) { @@ -155,11 +156,10 @@ static void set_kernel_args_old(const struct arm_boot_info *info, /* pages_in_vram */ WRITE_WORD(p, 0); /* initrd_start */ - if (initrd_size) { - WRITE_WORD(p, info->initrd_start); - } else { + if (initrd_size) + WRITE_WORD(p, info->loader_start + INITRD_LOAD_ADDR); + else WRITE_WORD(p, 0); - } /* initrd_size */ WRITE_WORD(p, initrd_size); /* rd_start */ @@ -203,19 +203,6 @@ void arm_load_kernel(CPUARMState *env, struct arm_boot_info *info) nb_cpus = info->nb_cpus ? info->nb_cpus : 1; env->boot_info = info; - /* We want to put the initrd far enough into RAM that when the - * kernel is uncompressed it will not clobber the initrd. However - * on boards without much RAM we must ensure that we still leave - * enough room for a decent sized initrd, and on boards with large - * amounts of RAM we must avoid the initrd being so far up in RAM - * that it is outside lowmem and inaccessible to the kernel. - * So for boards with less than 256MB of RAM we put the initrd - * halfway into RAM, and for boards with 256MB of RAM or more we put - * the initrd at 128MB. - */ - info->initrd_start = info->loader_start + - MIN(info->ram_size / 2, 128 * 1024 * 1024); - /* Assume that raw images are linux kernels, and ELF images are not. */ kernel_size = load_elf(info->kernel_filename, 0, &elf_entry, NULL, NULL); entry = elf_entry; @@ -241,8 +228,9 @@ void arm_load_kernel(CPUARMState *env, struct arm_boot_info *info) } else { if (info->initrd_filename) { initrd_size = load_image_targphys(info->initrd_filename, - info->initrd_start, - ram_size - info->initrd_start); + info->loader_start + + INITRD_LOAD_ADDR, + ram_size - INITRD_LOAD_ADDR); if (initrd_size < 0) { fprintf(stderr, "qemu: could not load initrd '%s'\n", info->initrd_filename); diff --git a/include/hw/arm/arm.h b/include/hw/arm/arm.h index 2a11ee84b2..a4983331dc 100644 --- a/include/hw/arm/arm.h +++ b/include/hw/arm/arm.h @@ -37,7 +37,6 @@ struct arm_boot_info { int (*atag_board)(const struct arm_boot_info *info, void *p); /* Used internally by arm_boot.c */ int is_linux; - hwaddr initrd_start; hwaddr initrd_size; hwaddr entry; }; |