qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] versatile AB board support
Date: Thu, 27 Apr 2006 09:57:31 -0500	[thread overview]
Message-ID: <4450DBDB.7020006@windriver.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 301 bytes --]

Paul Brook did all the hard work for the Versatile PB. 

The Versatile AB is quite similar to the PB but has a different 
expansion bus and flash. This patch adds Versatile AB support so you can 
boot an unmodified ARM Versatile AB kernel. 

signed-off-by: jason.wessel@windriver.com


Thanks,
Jason.

[-- Attachment #2: versatileab.patch --]
[-- Type: text/plain, Size: 2377 bytes --]

Index: qemu/hw/versatilepb.c
===================================================================
--- qemu.orig/hw/versatilepb.c
+++ qemu/hw/versatilepb.c
@@ -314,8 +314,39 @@ static void vpb_init(int ram_size, int v
     set_kernel_args(ram_size, initrd_size, kernel_cmdline);
 }
 
+static void vab_init(int ram_size, int vga_ram_size, int boot_device,
+                     DisplayState *ds, const char **fd_filename, int snapshot,
+                     const char *kernel_filename, const char *kernel_cmdline,
+                     const char *initrd_filename)
+{
+	/* The versatile AB is mostly the same board as the versatile PB
+	 * but with a different machine number.  IE: 926ejs core with the
+	 * same core perpheriphals (ethernet/serial/vga/keyboard/mouse).
+	 * Later the flash and the different I/O devices could be added
+	 * here.  For now, this allows an unmodified versatile AB kernel
+	 * to boot.
+	 */
+	int n;
+	vpb_init(ram_size, vga_ram_size, boot_device,
+			 ds, fd_filename, snapshot,
+			 kernel_filename, kernel_cmdline,
+			 initrd_filename);
+	/* The versatile/AB needs 0x25e for the machine number */
+	bootloader[1] = 0xe3a0105e; /* mov     r1, #0x5e */
+	bootloader[2] = 0xe3811c02; /* orr     r1, r1, #0x200 */
+    for (n = 0; n < sizeof(bootloader) / 4; n++)
+        stl_raw(phys_ram_base + (n * 4), bootloader[n]);
+
+}
+
 QEMUMachine versatilepb_machine = {
     "versatilepb",
     "ARM Versatile/PB (ARM926EJ-S)",
     vpb_init,
 };
+
+QEMUMachine versatileab_machine = {
+    "versatileab",
+    "ARM Versatile/AB (ARM926EJ-S)",
+    vab_init,
+};
Index: qemu/vl.c
===================================================================
--- qemu.orig/vl.c
+++ qemu/vl.c
@@ -4863,6 +4863,7 @@ void register_machines(void)
     qemu_register_machine(&integratorcp926_machine);
     qemu_register_machine(&integratorcp1026_machine);
     qemu_register_machine(&versatilepb_machine);
+    qemu_register_machine(&versatileab_machine);
 #else
 #error unsupported CPU
 #endif
Index: qemu/vl.h
===================================================================
--- qemu.orig/vl.h
+++ qemu/vl.h
@@ -984,6 +984,7 @@ extern QEMUMachine integratorcp1026_mach
 
 /* versatilepb.c */
 extern QEMUMachine versatilepb_machine;
+extern QEMUMachine versatileab_machine;
 
 /* ps2.c */
 void *ps2_kbd_init(void (*update_irq)(void *, int), void *update_arg);

                 reply	other threads:[~2006-04-27 14:57 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=4450DBDB.7020006@windriver.com \
    --to=jason.wessel@windriver.com \
    --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).