Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K4Zel-0001Us-GR for qemu-devel@nongnu.org; Fri, 06 Jun 2008 06:58:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K4Zej-0001UK-R5 for qemu-devel@nongnu.org; Fri, 06 Jun 2008 06:58:50 -0400 Received: from [199.232.76.173] (port=49675 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K4Zej-0001UD-K6 for qemu-devel@nongnu.org; Fri, 06 Jun 2008 06:58:49 -0400 Received: from savannah.gnu.org ([199.232.41.3]:55639 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K4Zej-0004cY-Fz for qemu-devel@nongnu.org; Fri, 06 Jun 2008 06:58:49 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1K4Zei-0005EP-Nm for qemu-devel@nongnu.org; Fri, 06 Jun 2008 10:58:48 +0000 Received: from edgar_igl by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1K4Zei-0005EL-GE for qemu-devel@nongnu.org; Fri, 06 Jun 2008 10:58:48 +0000 MIME-Version: 1.0 Errors-To: edgar_igl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: "Edgar E. Iglesias" Message-Id: Date: Fri, 06 Jun 2008 10:58:48 +0000 Subject: [Qemu-devel] [4678] ETRAX machine updates. 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 Revision: 4678 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4678 Author: edgar_igl Date: 2008-06-06 10:58:48 +0000 (Fri, 06 Jun 2008) Log Message: ----------- ETRAX machine updates. * Move DMA_run into the dma controller to allow for multiple ETRAX/CRIS machines. * Support both ELF and kimage kernel images. * Correct emulation of the DMA RW_DATA register. Modified Paths: -------------- trunk/hw/etraxfs.c trunk/hw/etraxfs_dma.c Modified: trunk/hw/etraxfs.c =================================================================== --- trunk/hw/etraxfs.c 2008-06-06 10:55:02 UTC (rev 4677) +++ trunk/hw/etraxfs.c 2008-06-06 10:58:48 UTC (rev 4678) @@ -44,7 +44,6 @@ #define FLASH_SIZE 0x2000000 #define INTMEM_SIZE (128 * 1024) -static void *etraxfs_dmac; static uint32_t bootstrap_pc; static void main_cpu_reset(void *opaque) @@ -64,6 +63,7 @@ { CPUState *env; qemu_irq *pic; + void *etraxfs_dmac; struct etraxfs_dma_client *eth[2] = {NULL, NULL}; int kernel_size; int i; @@ -138,19 +138,20 @@ } if (kernel_filename) { -#if 1 + uint64_t entry; /* Boots a kernel elf binary, os/linux-2.6/vmlinux from the axis devboard SDK. */ kernel_size = load_elf(kernel_filename, 0, - &bootstrap_pc, NULL, NULL); -#else - /* Takes a kimage from the axis devboard SDK. */ - kernel_size = load_image(kernel_filename, phys_ram_base + 0x4000); - bootstrap_pc = 0x40004000; - /* magic for boot. */ - env->regs[8] = 0x56902387; - env->regs[9] = 0x40004000 + kernel_size; -#endif + &entry, NULL, NULL); + bootstrap_pc = entry; + if (kernel_size < 0) { + /* Takes a kimage from the axis devboard SDK. */ + kernel_size = load_image(kernel_filename, phys_ram_base + 0x4000); + bootstrap_pc = 0x40004000; + /* magic for boot. */ + env->regs[8] = 0x56902387; + env->regs[9] = 0x40004000 + kernel_size; + } } env->pc = bootstrap_pc; @@ -158,11 +159,6 @@ printf ("ram size =%ld\n", ram_size); } -void DMA_run(void) -{ - etraxfs_dmac_run(etraxfs_dmac); -} - QEMUMachine bareetraxfs_machine = { "bareetraxfs", "Bare ETRAX FS board", Modified: trunk/hw/etraxfs_dma.c =================================================================== --- trunk/hw/etraxfs_dma.c 2008-06-06 10:55:02 UTC (rev 4677) +++ trunk/hw/etraxfs_dma.c 2008-06-06 10:58:48 UTC (rev 4678) @@ -273,6 +273,7 @@ sizeof ctrl->channels[c].current_d); D(dump_d(c, &ctrl->channels[c].current_d)); + ctrl->channels[c].regs[RW_DATA] = addr; ctrl->channels[c].regs[RW_SAVED_DATA_BUF] = (uint32_t)ctrl->channels[c].current_d.buf; } @@ -561,7 +562,7 @@ switch (addr) { case RW_DATA: - printf("RW_DATA=%x\n", value); + ctrl->channels[c].regs[addr] = value; break; case RW_CFG: @@ -658,6 +659,13 @@ } +static void *etraxfs_dmac; +void DMA_run(void) +{ + if (etraxfs_dmac) + etraxfs_dmac_run(etraxfs_dmac); +} + void *etraxfs_dmac_init(CPUState *env, target_phys_addr_t base, int nr_channels) { @@ -686,6 +694,8 @@ ctrl->channels[i].regmap); } + /* Hax, we only support one DMA controller at a time. */ + etraxfs_dmac = ctrl; return ctrl; err: qemu_free(ctrl->channels);