aboutsummaryrefslogtreecommitdiff
path: root/hw/axis_dev88.c
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@gmail.com>2010-05-21 16:09:10 +0200
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2010-05-21 16:09:10 +0200
commita9456998e978d86c91e58cf1d56cf42739b627e8 (patch)
tree01648e8b8c7bbfa6e9bf84a13978a155a27fe872 /hw/axis_dev88.c
parentf6d20d0f4f1e01f293c3d3b5772926275927c661 (diff)
axisdev88: Fix passing of kernel cmdline.
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
Diffstat (limited to 'hw/axis_dev88.c')
-rw-r--r--hw/axis_dev88.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/hw/axis_dev88.c b/hw/axis_dev88.c
index 5516e42528..7d59c96ca1 100644
--- a/hw/axis_dev88.c
+++ b/hw/axis_dev88.c
@@ -240,13 +240,22 @@ static CPUWriteMemoryFunc * const gpio_write[] = {
#define INTMEM_SIZE (128 * 1024)
-static uint32_t bootstrap_pc;
+static struct {
+ uint32_t bootstrap_pc;
+ uint32_t regs[16];
+} loadargs;
+
static void main_cpu_reset(void *opaque)
{
+ int i;
+
CPUState *env = opaque;
cpu_reset(env);
- env->pc = bootstrap_pc;
+ env->pc = loadargs.bootstrap_pc;
+ for (i = 0; i < 16; i++) {
+ env->regs[i] = loadargs.regs[i];
+ }
}
static uint64_t translate_kernel_address(void *opaque, uint64_t addr)
@@ -352,15 +361,15 @@ void axisdev88_init (ram_addr_t ram_size,
devboard SDK. */
kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
&entry, NULL, &high, 0, ELF_MACHINE, 0);
- bootstrap_pc = entry;
+ loadargs.bootstrap_pc = entry;
if (kernel_size < 0) {
/* Takes a kimage from the axis devboard SDK. */
kernel_size = load_image_targphys(kernel_filename, 0x40004000,
ram_size);
- bootstrap_pc = 0x40004000;
- env->regs[9] = 0x40004000 + kernel_size;
+ loadargs.bootstrap_pc = 0x40004000;
+ loadargs.regs[9] = 0x40004000 + kernel_size;
}
- env->regs[8] = 0x56902387; /* RAM init magic. */
+ loadargs.regs[8] = 0x56902387; /* RAM init magic. */
if (kernel_cmdline && (kcmdline_len = strlen(kernel_cmdline))) {
if (kcmdline_len > 256) {
@@ -368,15 +377,11 @@ void axisdev88_init (ram_addr_t ram_size,
exit(1);
}
/* Let the kernel know we are modifying the cmdline. */
- env->regs[10] = 0x87109563;
- env->regs[11] = 0x40000000;
- pstrcpy_targphys("cmdline", env->regs[11], 256, kernel_cmdline);
+ loadargs.regs[10] = 0x87109563;
+ loadargs.regs[11] = 0x40000000;
+ pstrcpy_targphys("cmdline", loadargs.regs[11], 256, kernel_cmdline);
}
}
- env->pc = bootstrap_pc;
-
- printf ("pc =%x\n", env->pc);
- printf ("ram size =%ld\n", ram_size);
}
static QEMUMachine axisdev88_machine = {