From patchwork Tue Dec 3 09:11:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liguang X-Patchwork-Id: 296126 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 24EF42C0098 for ; Tue, 3 Dec 2013 20:15:17 +1100 (EST) Received: from localhost ([::1]:41163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnm4X-0002xC-Jf for incoming@patchwork.ozlabs.org; Tue, 03 Dec 2013 04:15:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnm3k-0002ke-ID for qemu-devel@nongnu.org; Tue, 03 Dec 2013 04:14:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vnm3e-00078K-RN for qemu-devel@nongnu.org; Tue, 03 Dec 2013 04:14:24 -0500 Received: from [222.73.24.84] (port=24608 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnm3e-000780-Fd for qemu-devel@nongnu.org; Tue, 03 Dec 2013 04:14:18 -0500 X-IronPort-AV: E=Sophos;i="4.93,816,1378828800"; d="scan'208";a="9179332" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 03 Dec 2013 17:10:40 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id rB39DnYp010304; Tue, 3 Dec 2013 17:14:07 +0800 Received: from liguang.fnst.cn.fujitsu.com ([10.167.226.141]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2013120317124935-83742 ; Tue, 3 Dec 2013 17:12:49 +0800 From: liguang To: qemu-devel@nongnu.org Date: Tue, 3 Dec 2013 17:11:21 +0800 Message-Id: <1386061881-12720-6-git-send-email-lig.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1386061881-12720-1-git-send-email-lig.fnst@cn.fujitsu.com> References: <1386061881-12720-1-git-send-email-lig.fnst@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/12/03 17:12:49, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/12/03 17:14:02, Serialize complete at 2013/12/03 17:14:02 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 222.73.24.84 Cc: Peter Maydell , Peter Crosthwaite , =?UTF-8?q?Andreas=20F=C3=A4rber?= , liguang Subject: [Qemu-devel] [PATCH 5/5] hw/arm: add cubieboard support 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 Signed-off-by: liguang --- hw/arm/Makefile.objs | 2 +- hw/arm/cubieboard.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletions(-) create mode 100644 hw/arm/cubieboard.c diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs index b9e5983..8be8d8e 100644 --- a/hw/arm/Makefile.objs +++ b/hw/arm/Makefile.objs @@ -4,4 +4,4 @@ obj-y += omap_sx1.o palm.o realview.o spitz.o stellaris.o obj-y += tosa.o versatilepb.o vexpress.o xilinx_zynq.o z2.o obj-y += armv7m.o exynos4210.o pxa2xx.o pxa2xx_gpio.o pxa2xx_pic.o -obj-y += omap1.o omap2.o strongarm.o allwinner-a10.o +obj-y += omap1.o omap2.o strongarm.o allwinner-a10.o cubieboard.o diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c new file mode 100644 index 0000000..a5be21c --- /dev/null +++ b/hw/arm/cubieboard.c @@ -0,0 +1,33 @@ +#include "hw/sysbus.h" +#include "hw/devices.h" +#include "hw/boards.h" +#include "hw/arm/allwinner-a10.h" + + +static struct arm_boot_info cubieboard_binfo = { + .loader_start = A10_SDRAM_BASE, + .board_id = 0x1008, +}; + +static void cubieboard_init(QEMUMachineInitArgs *args) +{ + A10State *s = a10_init(get_system_memory(), args->ram_size); + + cubieboard_binfo.ram_size = args->ram_size; + cubieboard_binfo.kernel_filename = args->kernel_filename; + cubieboard_binfo.kernel_cmdline = args->kernel_cmdline; + arm_load_kernel(s->cpu, &cubieboard_binfo); +} + +static QEMUMachine cubieboard_machine = { + .name = "cubieboard", + .init = cubieboard_init, +}; + + +static void cubieboard_machine_init(void) +{ + qemu_register_machine(&cubieboard_machine); +} + +machine_init(cubieboard_machine_init);