From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Itzm9-0003AB-Tb for qemu-devel@nongnu.org; Mon, 19 Nov 2007 01:06:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Itzm8-00039G-Ls for qemu-devel@nongnu.org; Mon, 19 Nov 2007 01:06:29 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Itzm8-000391-4G for qemu-devel@nongnu.org; Mon, 19 Nov 2007 01:06:28 -0500 Received: from gateway-1237.mvista.com ([63.81.120.158]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Itzm7-0007dj-5z for qemu-devel@nongnu.org; Mon, 19 Nov 2007 01:06:27 -0500 Message-ID: <474127DC.7030606@kama-aina.net> Date: Sun, 18 Nov 2007 20:06:20 -1000 From: Armin MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030109020003030003010505" Subject: [Qemu-devel] [Patch] PXA27x Mainstone II 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 Cc: Armin This is a multi-part message in MIME format. --------------030109020003030003010505 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, The following patch adds basic PXA27x Mainstone II support. Boots from initrd at the monument. Comments and Feedback welcome. Kind regards, Armin --------------030109020003030003010505 Content-Type: text/x-patch; name="mainstone2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mainstone2.patch" diff -ruN qemu_org/hw/boards.h qemu/hw/boards.h --- qemu_org/hw/boards.h 2007-11-17 22:46:57.000000000 -1000 +++ qemu/hw/boards.h 2007-11-18 17:51:37.000000000 -1000 @@ -92,4 +92,7 @@ /* dummy_m68k.c */ extern QEMUMachine dummy_m68k_machine; +/* Arm PXA27x - mainstone.c */ +extern QEMUMachine mainstone2_machine; + #endif diff -ruN qemu_org/hw/mainstone.c qemu/hw/mainstone.c --- qemu_org/hw/mainstone.c 1969-12-31 14:00:00.000000000 -1000 +++ qemu/hw/mainstone.c 2007-11-18 17:52:00.000000000 -1000 @@ -0,0 +1,67 @@ +/* + * PXA270-based Intel Mainstone platforms. + * + * Copyright (c) 2007 by Armin Kuster or + * + * + * Code based on spitz platform by Andrzej Zaborowski + * + * This code is licensed under the GNU GPL v2. + */ +#include "hw.h" +#include "pxa.h" +#include "arm-misc.h" +#include "sysemu.h" +#include "qemu-timer.h" +#include "net.h" +#include "devices.h" +#include "console.h" +#include "boards.h" + +enum mainstone_model_e { mainstone }; + +static void mainstone_common_init(int ram_size, int vga_ram_size, + DisplayState *ds, const char *kernel_filename, + const char *kernel_cmdline, const char *initrd_filename, + const char *cpu_model, enum mainstone_model_e model, int arm_id) +{ + uint32_t mainstone_ram = 0x04000000; + uint32_t mainstone_rom = 0x00800000; + struct pxa2xx_state_s *cpu; + qemu_irq *mst_irq; + + if (!cpu_model) + cpu_model = "pxa270-c5"; + + /* Setup CPU & memory */ + if (ram_size < mainstone_ram + mainstone_rom + PXA2XX_INTERNAL_SIZE) { + fprintf(stderr, "This platform requires %i bytes of memory\n", + mainstone_ram + mainstone_rom + PXA2XX_INTERNAL_SIZE); + exit(1); + } + cpu = pxa270_init(mainstone_ram, ds, cpu_model); + + cpu_register_physical_memory(0, mainstone_rom, + qemu_ram_alloc(mainstone_rom) | IO_MEM_ROM); + + /* Setup initial (reset) machine state */ + cpu->env->regs[15] = PXA2XX_SDRAM_BASE; + + arm_load_kernel(cpu->env, mainstone_ram, kernel_filename, kernel_cmdline, + initrd_filename, arm_id, PXA2XX_SDRAM_BASE); +} + +static void mainstone_init(int ram_size, int vga_ram_size, + const char *boot_device, DisplayState *ds, + const char *kernel_filename, const char *kernel_cmdline, + const char *initrd_filename, const char *cpu_model) +{ + mainstone_common_init(ram_size, vga_ram_size, ds, kernel_filename, + kernel_cmdline, initrd_filename, cpu_model, mainstone, 0x196); +} + +QEMUMachine mainstone2_machine = { + "mainstone", + "Mainstone II (PXA27x)", + mainstone_init, +}; diff -ruN qemu_org/Makefile.target qemu/Makefile.target --- qemu_org/Makefile.target 2007-11-18 12:34:46.000000000 -1000 +++ qemu/Makefile.target 2007-11-18 17:53:12.000000000 -1000 @@ -499,6 +499,7 @@ VL_OBJS+= spitz.o ide.o serial.o nand.o ecc.o VL_OBJS+= omap.o omap_lcdc.o omap1_clk.o omap_mmc.o omap_i2c.o VL_OBJS+= palm.o tsc210x.o +VL_OBJS+= mainstone.o CPPFLAGS += -DHAS_AUDIO endif ifeq ($(TARGET_BASE_ARCH), sh4) diff -ruN qemu_org/vl.c qemu/vl.c --- qemu_org/vl.c 2007-11-18 15:05:22.000000000 -1000 +++ qemu/vl.c 2007-11-18 17:51:37.000000000 -1000 @@ -7451,6 +7451,7 @@ qemu_register_machine(&lm3s811evb_machine); qemu_register_machine(&lm3s6965evb_machine); qemu_register_machine(&connex_machine); + qemu_register_machine(&mainstone2_machine); #elif defined(TARGET_SH4) qemu_register_machine(&shix_machine); qemu_register_machine(&r2d_machine); --------------030109020003030003010505--