mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
Add -drive parameter, by Laurent Vivier.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3759 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
7233b35557
commit
e4bcb14c79
27 changed files with 875 additions and 317 deletions
|
@ -29,6 +29,7 @@ static void mainstone_common_init(int ram_size, int vga_ram_size,
|
|||
uint32_t mainstone_rom = 0x00800000;
|
||||
struct pxa2xx_state_s *cpu;
|
||||
qemu_irq *mst_irq;
|
||||
int index;
|
||||
|
||||
if (!cpu_model)
|
||||
cpu_model = "pxa270-c5";
|
||||
|
@ -47,18 +48,32 @@ static void mainstone_common_init(int ram_size, int vga_ram_size,
|
|||
/* Setup initial (reset) machine state */
|
||||
cpu->env->regs[15] = PXA2XX_SDRAM_BASE;
|
||||
|
||||
/* There are two 32MiB flash devices on the board */
|
||||
if (!pflash_register(MST_FLASH_0, mainstone_ram + PXA2XX_INTERNAL_SIZE,
|
||||
pflash_table[0], 256 * 1024, 128, 4, 0, 0, 0, 0)) {
|
||||
fprintf(stderr, "qemu: Error register flash memory.\n");
|
||||
exit(1);
|
||||
}
|
||||
/* There are two 32MiB flash devices on the board */
|
||||
index = drive_get_index(IF_PFLASH, 0, 0);
|
||||
if (index == -1) {
|
||||
fprintf(stderr, "Two flash images must be given with the "
|
||||
"'pflash' parameter\n");
|
||||
exit(1);
|
||||
}
|
||||
if (!pflash_register(MST_FLASH_0, mainstone_ram + PXA2XX_INTERNAL_SIZE,
|
||||
drives_table[index].bdrv,
|
||||
256 * 1024, 128, 4, 0, 0, 0, 0)) {
|
||||
fprintf(stderr, "qemu: Error registering flash memory.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!pflash_register(MST_FLASH_1, mainstone_ram + PXA2XX_INTERNAL_SIZE,
|
||||
pflash_table[1], 256 * 1024, 128, 4, 0, 0, 0, 0)) {
|
||||
fprintf(stderr, "qemu: Error register flash memory.\n");
|
||||
exit(1);
|
||||
}
|
||||
index = drive_get_index(IF_PFLASH, 0, 1);
|
||||
if (index == -1) {
|
||||
fprintf(stderr, "Two flash images must be given with the "
|
||||
"'pflash' parameter\n");
|
||||
exit(1);
|
||||
}
|
||||
if (!pflash_register(MST_FLASH_1, mainstone_ram + PXA2XX_INTERNAL_SIZE,
|
||||
drives_table[index].bdrv,
|
||||
256 * 1024, 128, 4, 0, 0, 0, 0)) {
|
||||
fprintf(stderr, "qemu: Error registering flash memory.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
mst_irq = mst_irq_init(cpu, MST_FPGA_PHYS, PXA2XX_PIC_GPIO_0);
|
||||
smc91c111_init(&nd_table[0], MST_ETH_PHYS, mst_irq[ETHERNET_IRQ]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue