aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@gmail.com>2009-12-10 14:40:35 +0100
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2009-12-10 14:40:35 +0100
commitb4d34d5e9b05fab4c8a4346036b3d413a304c94e (patch)
tree4f64153dc758dce3aee8917130b3db39ab6984fb
parent6287462ef595515ce7873199f33817318712f98b (diff)
microblaze: Boot and reset fixes.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
-rw-r--r--hw/petalogix_s3adsp1800_mmu.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/hw/petalogix_s3adsp1800_mmu.c b/hw/petalogix_s3adsp1800_mmu.c
index 9f4c36037b..fdecc13975 100644
--- a/hw/petalogix_s3adsp1800_mmu.c
+++ b/hw/petalogix_s3adsp1800_mmu.c
@@ -38,13 +38,19 @@
#define LMB_BRAM_SIZE (128 * 1024)
#define FLASH_SIZE (16 * 1024 * 1024)
-static uint32_t bootstrap_pc;
+struct
+{
+ uint32_t bootstrap_pc;
+ uint32_t cmdline;
+ uint32_t fdt;
+} boot_info;
static void main_cpu_reset(void *opaque)
{
CPUState *env = opaque;
- cpu_reset(env);
- env->sregs[SR_PC] = bootstrap_pc;
+ env->regs[5] = boot_info.cmdline;
+ env->regs[7] = boot_info.fdt;
+ env->sregs[SR_PC] = boot_info.bootstrap_pc;
}
#define BINARY_DEVICE_TREE_FILE "petalogix-s3adsp1800.dtb"
@@ -166,27 +172,24 @@ petalogix_s3adsp1800_init(ram_addr_t ram_size,
1, ELF_MACHINE, 0);
}
/* Always boot into physical ram. */
- bootstrap_pc = ddr_base + (entry & 0x0fffffff);
+ boot_info.bootstrap_pc = ddr_base + (entry & 0x0fffffff);
if (kernel_size < 0) {
/* If we failed loading ELF's try a raw image. */
kernel_size = load_image_targphys(kernel_filename, ddr_base,
ram_size);
- bootstrap_pc = ddr_base;
+ boot_info.bootstrap_pc = ddr_base;
}
- env->regs[5] = ddr_base + kernel_size + 8192;
+ boot_info.cmdline = ddr_base + kernel_size + 8192;
if (kernel_cmdline && (kcmdline_len = strlen(kernel_cmdline))) {
- pstrcpy_targphys("cmdline", env->regs[5], 256, kernel_cmdline);
+ pstrcpy_targphys("cmdline", boot_info.cmdline, 256, kernel_cmdline);
}
- env->regs[6] = 0;
/* Provide a device-tree. */
- env->regs[7] = ddr_base + kernel_size + 256;
- petalogix_load_device_tree(env->regs[7], ram_size,
- env->regs[6], 0,
+ boot_info.fdt = boot_info.cmdline + 256;
+ petalogix_load_device_tree(boot_info.fdt, ram_size,
+ 0, 0,
kernel_cmdline);
}
-
- env->sregs[SR_PC] = bootstrap_pc;
}
static QEMUMachine petalogix_s3adsp1800_machine = {