qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] versatile AB board support


From: Jason Wessel
Subject: [Qemu-devel] [PATCH] versatile AB board support
Date: Thu, 27 Apr 2006 09:57:31 -0500
User-agent: Thunderbird 1.5 (Windows/20051201)

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: address@hidden


Thanks,
Jason.
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 via email to

[Prev in Thread] Current Thread [Next in Thread]