mirror of https://github.com/xqemu/xqemu.git
Flash support for mips r4k pseudo-machine, by
Jean-Christophe Plagniol-Villard. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4224 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
eb69b50ad9
commit
b305b5ba18
|
@ -14,6 +14,7 @@
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "sysemu.h"
|
#include "sysemu.h"
|
||||||
#include "boards.h"
|
#include "boards.h"
|
||||||
|
#include "flash.h"
|
||||||
|
|
||||||
#ifdef TARGET_WORDS_BIGENDIAN
|
#ifdef TARGET_WORDS_BIGENDIAN
|
||||||
#define BIOS_FILENAME "mips_bios.bin"
|
#define BIOS_FILENAME "mips_bios.bin"
|
||||||
|
@ -144,6 +145,7 @@ static void main_cpu_reset(void *opaque)
|
||||||
load_kernel (env);
|
load_kernel (env);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const int sector_len = 32 * 1024;
|
||||||
static
|
static
|
||||||
void mips_r4k_init (int ram_size, int vga_ram_size,
|
void mips_r4k_init (int ram_size, int vga_ram_size,
|
||||||
const char *boot_device, DisplayState *ds,
|
const char *boot_device, DisplayState *ds,
|
||||||
|
@ -197,7 +199,17 @@ void mips_r4k_init (int ram_size, int vga_ram_size,
|
||||||
if ((bios_size > 0) && (bios_size <= BIOS_SIZE)) {
|
if ((bios_size > 0) && (bios_size <= BIOS_SIZE)) {
|
||||||
cpu_register_physical_memory(0x1fc00000,
|
cpu_register_physical_memory(0x1fc00000,
|
||||||
BIOS_SIZE, bios_offset | IO_MEM_ROM);
|
BIOS_SIZE, bios_offset | IO_MEM_ROM);
|
||||||
} else {
|
} else if ((index = drive_get_index(IF_PFLASH, 0, 0)) > -1) {
|
||||||
|
uint32_t mips_rom = 0x00400000;
|
||||||
|
cpu_register_physical_memory(0x1fc00000, mips_rom,
|
||||||
|
qemu_ram_alloc(mips_rom) | IO_MEM_ROM);
|
||||||
|
if (!pflash_cfi01_register(0x1fc00000, qemu_ram_alloc(mips_rom),
|
||||||
|
drives_table[index].bdrv, sector_len, mips_rom / sector_len,
|
||||||
|
4, 0, 0, 0, 0)) {
|
||||||
|
fprintf(stderr, "qemu: Error registering flash memory.\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
/* not fatal */
|
/* not fatal */
|
||||||
fprintf(stderr, "qemu: Warning, could not load MIPS bios '%s'\n",
|
fprintf(stderr, "qemu: Warning, could not load MIPS bios '%s'\n",
|
||||||
buf);
|
buf);
|
||||||
|
|
Loading…
Reference in New Issue