From patchwork Tue Apr 12 13:09:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 90778 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (unknown [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 39F3FB6F47 for ; Tue, 12 Apr 2011 23:09:36 +1000 (EST) Received: from localhost ([::1]:45702 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9dLY-0001WJ-VZ for incoming@patchwork.ozlabs.org; Tue, 12 Apr 2011 09:09:32 -0400 Received: from eggs.gnu.org ([140.186.70.92]:53643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9dLA-0001RL-FR for qemu-devel@nongnu.org; Tue, 12 Apr 2011 09:09:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q9dL8-0005uR-RI for qemu-devel@nongnu.org; Tue, 12 Apr 2011 09:09:08 -0400 Received: from mail-ww0-f53.google.com ([74.125.82.53]:47952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9dL8-0005tl-J9 for qemu-devel@nongnu.org; Tue, 12 Apr 2011 09:09:06 -0400 Received: by mail-ww0-f53.google.com with SMTP id 40so7299426wwj.10 for ; Tue, 12 Apr 2011 06:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:message-id:x-mailer :in-reply-to:references; bh=YnB5KKURJb36kJwCkZQQNK9CFmJ+6ozGWteI3QOE4S8=; b=p7cMMh04sK6SgNZPKNeK5vMR6YxbbxnunH/sWxW7VZjq2/0EV9Z6Pt/2Y40I4AHxg8 pUHIm2+cM7GAXs5JE4FhrjArjJEXKvorgrgKKAwHAB1eCvG47iOea1VnDLjeN6CafFWq s8NI18asbwgO/BwcSd5k36r14BfoP3eE9cOLw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references; b=oQJPdSLu3kqmOr0hLcZs0AItUjhmCe6wjubuiRbPK5mO5SZO4XUZyCzRTRRafvD+ST fP5VCZOXc0AZ4prS7DWlGWVQzEKR9IW4hR/odC74AjGdel+2zw7sULceyxy2HLjLxlUY 6ghsyryjigIHeq65muG1hp5W2XmtDkHZ51yh8= Received: by 10.227.9.20 with SMTP id j20mr6633076wbj.116.1302613745432; Tue, 12 Apr 2011 06:09:05 -0700 (PDT) Received: from doriath.ww600.siemens.net ([91.213.169.4]) by mx.google.com with ESMTPS id u9sm4027780wbg.34.2011.04.12.06.09.03 (version=SSLv3 cipher=OTHER); Tue, 12 Apr 2011 06:09:04 -0700 (PDT) From: Dmitry Eremin-Solenikov To: qemu-devel@nongnu.org Date: Tue, 12 Apr 2011 17:09:03 +0400 Message-Id: <1302613743-7448-3-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1302613743-7448-1-git-send-email-dbaryshkov@gmail.com> References: <1302613743-7448-1-git-send-email-dbaryshkov@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.53 Subject: [Qemu-devel] [PATCH 2/2] Basic implementation of Sharp Zaurus SL-5500 collie PDA X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add very basic implementation of collie PDA emulation. The system lacks LoCoMo and graphics/sound emulation. Linux kernel boots up to mounting rootfs (theoretically it can be provided in pflash images). Signed-off-by: Dmitry Eremin-Solenikov --- Makefile.target | 1 + hw/collie.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 0 deletions(-) create mode 100644 hw/collie.c diff --git a/Makefile.target b/Makefile.target index 9e4cfc0..0e0ef36 100644 --- a/Makefile.target +++ b/Makefile.target @@ -353,6 +353,7 @@ obj-arm-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o obj-arm-y += syborg_virtio.o obj-arm-y += vexpress.o obj-arm-y += strongarm.o +obj-arm-y += collie.o obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o diff --git a/hw/collie.c b/hw/collie.c new file mode 100644 index 0000000..156404d --- /dev/null +++ b/hw/collie.c @@ -0,0 +1,69 @@ +/* + * SA-1110-based Sharp Zaurus SL-5500 platform. + * + * Copyright (C) 2011 Dmitry Eremin-Solenikov + * + * This code is licensed under GNU GPL v2. + */ +#include "hw.h" +#include "sysbus.h" +#include "boards.h" +#include "devices.h" +#include "strongarm.h" +#include "arm-misc.h" +#include "flash.h" +#include "blockdev.h" + +static struct arm_boot_info collie_binfo = { + .loader_start = SA_SDCS0, + .ram_size = 0x20000000, +}; + +static void collie_init(ram_addr_t ram_size, + const char *boot_device, + const char *kernel_filename, const char *kernel_cmdline, + const char *initrd_filename, const char *cpu_model) +{ + StrongARMState *s; + DriveInfo *dinfo; + ram_addr_t phys_flash; + + if (!cpu_model) { + cpu_model = "sa1110"; + } + + s = sa1110_init(collie_binfo.ram_size, cpu_model); + + phys_flash = qemu_ram_alloc(NULL, "collie.fl1", 0x02000000); + dinfo = drive_get(IF_PFLASH, 0, 0); + pflash_cfi01_register(SA_CS0, phys_flash, + dinfo ? dinfo->bdrv : NULL, (64 * 1024), + 512, 4, 0x00, 0x00, 0x00, 0x00, 0); + + phys_flash = qemu_ram_alloc(NULL, "collie.fl2", 0x02000000); + dinfo = drive_get(IF_PFLASH, 0, 1); + pflash_cfi01_register(SA_CS1, phys_flash, + dinfo ? dinfo->bdrv : NULL, (64 * 1024), + 512, 4, 0x00, 0x00, 0x00, 0x00, 0); + + sysbus_create_simple("scoop", 0x40800000, NULL); + + collie_binfo.kernel_filename = kernel_filename; + collie_binfo.kernel_cmdline = kernel_cmdline; + collie_binfo.initrd_filename = initrd_filename; + collie_binfo.board_id = 0x208; + arm_load_kernel(s->env, &collie_binfo); +} + +static QEMUMachine collie_machine = { + .name = "collie", + .desc = "Collie PDA (SA-1110)", + .init = collie_init, +}; + +static void collie_machine_init(void) +{ + qemu_register_machine(&collie_machine); +} + +machine_init(collie_machine_init)