[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [Patch] PXA27x Mainstone II board support
From: |
Armin |
Subject: |
[Qemu-devel] [Patch] PXA27x Mainstone II board support |
Date: |
Sun, 18 Nov 2007 20:06:20 -1000 |
User-agent: |
Thunderbird 2.0.0.5 (X11/20070727) |
Hello,
The following patch adds basic PXA27x Mainstone II support.
Boots from initrd at the monument.
Comments and Feedback welcome.
Kind regards,
Armin
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 <address@hidden> or
+ * <address@hidden>
+ *
+ * Code based on spitz platform by Andrzej Zaborowski <address@hidden>
+ *
+ * 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);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] [Patch] PXA27x Mainstone II board support,
Armin <=