summaryrefslogtreecommitdiffstats
path: root/hw/mainstone.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-02 04:51:10 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-02 04:51:10 +0000
commite4bcb14c79fb63a35aef3eb39e02c16c19b8b28d (patch)
tree06bee4b9dbf4c7b50e20c9996924d7d132cdfec2 /hw/mainstone.c
parent7233b355571ad2a8e7aec7eb19db5f530e81f052 (diff)
downloadhqemu-e4bcb14c79fb63a35aef3eb39e02c16c19b8b28d.zip
hqemu-e4bcb14c79fb63a35aef3eb39e02c16c19b8b28d.tar.gz
Add -drive parameter, by Laurent Vivier.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3759 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/mainstone.c')
-rw-r--r--hw/mainstone.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/hw/mainstone.c b/hw/mainstone.c
index 13f72b3..3540152 100644
--- a/hw/mainstone.c
+++ b/hw/mainstone.c
@@ -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]);
OpenPOWER on IntegriCloud