All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] versatile AB board support
@ 2006-04-27 14:57 Jason Wessel
  0 siblings, 0 replies; only message in thread
From: Jason Wessel @ 2006-04-27 14:57 UTC (permalink / raw)
  To: qemu-devel

[-- 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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-27 14:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-27 14:57 [Qemu-devel] [PATCH] versatile AB board support Jason Wessel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.