From: Armin <akuster@kama-aina.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [Patch 2/2] switch support, Mainstone
Date: Fri, 14 Dec 2007 15:45:56 -1000 [thread overview]
Message-ID: <476331D4.3010602@kama-aina.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 62 bytes --]
Here is the use of the switches patch on a Mainstone.
-Armin
[-- Attachment #2: mst_switches.patch --]
[-- Type: text/x-patch, Size: 2217 bytes --]
Index: qemu/hw/mainstone.c
===================================================================
--- qemu.orig/hw/mainstone.c
+++ qemu/hw/mainstone.c
@@ -51,32 +51,28 @@ static void mainstone_common_init(int ra
/* 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 "
+ fprintf(stderr, "One flash image must be given with the "
"'pflash' parameter\n");
exit(1);
}
- if (!pflash_cfi01_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);
- }
- 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_cfi01_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);
+ if(switch_get_value(CFG_SPDT_SWITCH, 7)) {
+ if (!pflash_cfi01_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);
+ }
+ }else{
+ if (!pflash_cfi01_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);
/* MMC/SD host */
reply other threads:[~2007-12-16 6:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=476331D4.3010602@kama-aina.net \
--to=akuster@kama-aina.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).