X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=hw%2Fmips_malta.c;h=6f0edf9a3b3e3835db8d89d4162b37db1d4015d8;hb=cd346349b45ef056f138a184f660b8c34c3213cc;hp=7336b7b05f6f15537b92e4e84e8aa5707b3e62e9;hpb=3187ef0390b049ee75bf806f13f6e5004e382c03;p=qemu diff --git a/hw/mips_malta.c b/hw/mips_malta.c index 7336b7b..6f0edf9 100644 --- a/hw/mips_malta.c +++ b/hw/mips_malta.c @@ -42,7 +42,6 @@ #define ENVP_NB_ENTRIES 16 #define ENVP_ENTRY_SIZE 256 - extern FILE *logfile; typedef struct { @@ -70,7 +69,7 @@ static void malta_fpga_update_display(void *opaque) for (i = 7 ; i >= 0 ; i--) { if (s->leds & (1 << i)) leds_text[i] = '#'; - else + else leds_text[i] = ' '; } leds_text[8] = '\0'; @@ -511,9 +510,9 @@ static void write_bootloader (CPUState *env, unsigned long bios_offset, int64_t stl_raw(p++, 0x00000000); /* nop */ /* YAMON service vector */ - stl_raw(phys_ram_base + bios_offset + 0x500, 0xbfc00580); /* start: */ + stl_raw(phys_ram_base + bios_offset + 0x500, 0xbfc00580); /* start: */ stl_raw(phys_ram_base + bios_offset + 0x504, 0xbfc0083c); /* print_count: */ - stl_raw(phys_ram_base + bios_offset + 0x520, 0xbfc00580); /* start: */ + stl_raw(phys_ram_base + bios_offset + 0x520, 0xbfc00580); /* start: */ stl_raw(phys_ram_base + bios_offset + 0x52c, 0xbfc00800); /* flush_cache: */ stl_raw(phys_ram_base + bios_offset + 0x534, 0xbfc00808); /* print: */ stl_raw(phys_ram_base + bios_offset + 0x538, 0xbfc00800); /* reg_cpu_isr: */ @@ -539,6 +538,15 @@ static void write_bootloader (CPUState *env, unsigned long bios_offset, int64_t stl_raw(p++, 0x34e70000 | (env->ram_size & 0xffff)); /* ori a3, a3, low(env->ram_size) */ /* Load BAR registers as done by YAMON */ + stl_raw(p++, 0x3c09b400); /* lui t1, 0xb400 */ + +#ifdef TARGET_WORDS_BIGENDIAN + stl_raw(p++, 0x3c08df00); /* lui t0, 0xdf00 */ +#else + stl_raw(p++, 0x340800df); /* ori t0, r0, 0x00df */ +#endif + stl_raw(p++, 0xad280068); /* sw t0, 0x0068(t1) */ + stl_raw(p++, 0x3c09bbe0); /* lui t1, 0xbbe0 */ #ifdef TARGET_WORDS_BIGENDIAN @@ -783,7 +791,9 @@ void mips_malta_init (int ram_size, int vga_ram_size, int boot_device, /* Load a BIOS image unless a kernel image has been specified. */ if (!kernel_filename) { - snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME); + if (bios_name == NULL) + bios_name = BIOS_FILENAME; + snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name); ret = load_image(buf, phys_ram_base + bios_offset); if (ret < 0 || ret > BIOS_SIZE) { fprintf(stderr,