From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FZ7w2-00066p-I0 for qemu-devel@nongnu.org; Thu, 27 Apr 2006 10:57:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FZ7w1-00066V-LQ for qemu-devel@nongnu.org; Thu, 27 Apr 2006 10:57:38 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FZ7w1-00066S-GD for qemu-devel@nongnu.org; Thu, 27 Apr 2006 10:57:37 -0400 Received: from [147.11.1.11] (helo=mail.wrs.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FZ7yx-0005tl-1C for qemu-devel@nongnu.org; Thu, 27 Apr 2006 11:00:39 -0400 Received: from ala-mail04.corp.ad.wrs.com (ala-mail04 [147.11.57.145]) by mail.wrs.com (8.13.6/8.13.3) with ESMTP id k3REvX4n008368 for ; Thu, 27 Apr 2006 07:57:33 -0700 (PDT) Message-ID: <4450DBDB.7020006@windriver.com> Date: Thu, 27 Apr 2006 09:57:31 -0500 From: Jason Wessel MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030401040504090601000804" Subject: [Qemu-devel] [PATCH] versatile AB board support Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------030401040504090601000804 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. --------------030401040504090601000804 Content-Type: text/plain; name="versatileab.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="versatileab.patch" 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); --------------030401040504090601000804--