From patchwork Thu Aug 11 23:07:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 109713 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [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 9379DB6FD7 for ; Fri, 12 Aug 2011 09:09:31 +1000 (EST) Received: from localhost ([::1]:48618 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QreNT-00016j-OK for incoming@patchwork.ozlabs.org; Thu, 11 Aug 2011 19:09:27 -0400 Received: from eggs.gnu.org ([140.186.70.92]:59549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QreMJ-000610-PL for qemu-devel@nongnu.org; Thu, 11 Aug 2011 19:08:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QreMD-0004iz-SD for qemu-devel@nongnu.org; Thu, 11 Aug 2011 19:08:15 -0400 Received: from mail-qy0-f180.google.com ([209.85.216.180]:59464) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QreMD-0004hi-Og for qemu-devel@nongnu.org; Thu, 11 Aug 2011 19:08:09 -0400 Received: by mail-qy0-f180.google.com with SMTP id 31so1610068qyk.4 for ; Thu, 11 Aug 2011 16:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=iFvfnudEydE+msGVMvGXg33voaNlYApvDwfxi0w0aZw=; b=S7Hzp/tJeCJWVMdYxFIoyB39Ib4rCBq/U1P7GSW7FPnB3n6nB5XvIZf9gzzuduazcy DeFMYwKKPOhz5FfYl1K3B+nrIsoiQ4aU/e5cNeCJkwrf00DhN1ynM1vwkHLzQaW0ayNa oDzZlFngHOHwmc48vxTvV1jVxYTiuZnUCBQUs= Received: by 10.229.46.18 with SMTP id h18mr166304qcf.141.1313104089639; Thu, 11 Aug 2011 16:08:09 -0700 (PDT) Received: from localhost.localdomain (c-71-227-161-214.hsd1.wa.comcast.net [71.227.161.214]) by mx.google.com with ESMTPS id r3sm1904723qct.3.2011.08.11.16.08.08 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Aug 2011 16:08:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 11 Aug 2011 16:07:19 -0700 Message-Id: <1313104041-1641-8-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1313104041-1641-1-git-send-email-rth@twiddle.net> References: <1313104041-1641-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.216.180 Cc: avi@redhat.com Subject: [Qemu-devel] [PATCH 7/9] pxa: Pass in address_space to pxa{255, 270}_init. 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: Richard Henderson --- hw/gumstix.c | 4 ++-- hw/mainstone.c | 2 +- hw/pxa.h | 7 +++++-- hw/pxa2xx.c | 10 +++++----- hw/spitz.c | 2 +- hw/tosa.c | 2 +- hw/z2.c | 2 +- 7 files changed, 16 insertions(+), 13 deletions(-) diff --git a/hw/gumstix.c b/hw/gumstix.c index 620bdd7..3466893 100644 --- a/hw/gumstix.c +++ b/hw/gumstix.c @@ -57,7 +57,7 @@ static void connex_init(MemoryRegion *address_space_mem, uint32_t connex_rom = 0x01000000; uint32_t connex_ram = 0x04000000; - cpu = pxa255_init(connex_ram); + cpu = pxa255_init(address_space_mem, connex_ram); dinfo = drive_get(IF_PFLASH, 0, 0); if (!dinfo) { @@ -100,7 +100,7 @@ static void verdex_init(MemoryRegion *address_space_mem, uint32_t verdex_rom = 0x02000000; uint32_t verdex_ram = 0x10000000; - cpu = pxa270_init(verdex_ram, cpu_model ?: "pxa270-c0"); + cpu = pxa270_init(address_space_mem, verdex_ram, cpu_model ?: "pxa270-c0"); dinfo = drive_get(IF_PFLASH, 0, 0); if (!dinfo) { diff --git a/hw/mainstone.c b/hw/mainstone.c index ae7a542..da14cb4 100644 --- a/hw/mainstone.c +++ b/hw/mainstone.c @@ -111,7 +111,7 @@ static void mainstone_common_init(MemoryRegion *address_space_mem, cpu_model = "pxa270-c5"; /* Setup CPU & memory */ - cpu = pxa270_init(mainstone_binfo.ram_size, cpu_model); + cpu = pxa270_init(address_space_mem, mainstone_binfo.ram_size, cpu_model); memory_region_init_ram(rom, NULL, "mainstone.rom", MAINSTONE_ROM); memory_region_set_readonly(rom, true); memory_region_add_subregion(address_space_mem, 0, rom); diff --git a/hw/pxa.h b/hw/pxa.h index 859fc67..1204165 100644 --- a/hw/pxa.h +++ b/hw/pxa.h @@ -9,6 +9,8 @@ #ifndef PXA_H # define PXA_H "pxa.h" +#include "memory.h" + /* Interrupt numbers */ # define PXA2XX_PIC_SSP3 0 # define PXA2XX_PIC_USBH2 2 @@ -173,7 +175,8 @@ struct PXA2xxI2SState { # define PA_FMT "0x%08lx" # define REG_FMT "0x" TARGET_FMT_plx -PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision); -PXA2xxState *pxa255_init(unsigned int sdram_size); +PXA2xxState *pxa270_init(MemoryRegion *address_space, unsigned int sdram_size, + const char *revision); +PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size); #endif /* PXA_H */ diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c index c1a8cfc..bf00ff7 100644 --- a/hw/pxa2xx.c +++ b/hw/pxa2xx.c @@ -15,7 +15,6 @@ #include "ssi.h" #include "qemu-char.h" #include "blockdev.h" -#include "exec-memory.h" static struct { target_phys_addr_t io_base; @@ -2060,7 +2059,8 @@ static void pxa2xx_reset(void *opaque, int line, int level) } /* Initialise a PXA270 integrated chip (ARM based core). */ -PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision) +PXA2xxState *pxa270_init(MemoryRegion *address_space, + unsigned int sdram_size, const char *revision) { PXA2xxState *s; int iomemtype, i; @@ -2116,7 +2116,7 @@ PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision) for (i = 0; pxa270_serial[i].io_base; i++) { if (serial_hds[i]) { - serial_mm_init(get_system_memory(), pxa270_serial[i].io_base, 2, + serial_mm_init(address_space, pxa270_serial[i].io_base, 2, qdev_get_gpio_in(s->pic, pxa270_serial[i].irqn), 14857000 / 16, serial_hds[i], DEVICE_NATIVE_ENDIAN); @@ -2199,7 +2199,7 @@ PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision) } /* Initialise a PXA255 integrated chip (ARM based core). */ -PXA2xxState *pxa255_init(unsigned int sdram_size) +PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size) { PXA2xxState *s; int iomemtype, i; @@ -2248,7 +2248,7 @@ PXA2xxState *pxa255_init(unsigned int sdram_size) for (i = 0; pxa255_serial[i].io_base; i++) { if (serial_hds[i]) { - serial_mm_init(get_system_memory(), pxa255_serial[i].io_base, 2, + serial_mm_init(address_space, pxa255_serial[i].io_base, 2, qdev_get_gpio_in(s->pic, pxa255_serial[i].irqn), 14745600 / 16, serial_hds[i], DEVICE_NATIVE_ENDIAN); diff --git a/hw/spitz.c b/hw/spitz.c index cac4669..a288879 100644 --- a/hw/spitz.c +++ b/hw/spitz.c @@ -907,7 +907,7 @@ static void spitz_common_init(MemoryRegion *address_space_mem, cpu_model = (model == terrier) ? "pxa270-c5" : "pxa270-c0"; /* Setup CPU & memory */ - cpu = pxa270_init(spitz_binfo.ram_size, cpu_model); + cpu = pxa270_init(address_space_mem, spitz_binfo.ram_size, cpu_model); sl_flash_register(cpu, (model == spitz) ? FLASH_128M : FLASH_1024M); diff --git a/hw/tosa.c b/hw/tosa.c index cce828f..4b15cc4 100644 --- a/hw/tosa.c +++ b/hw/tosa.c @@ -219,7 +219,7 @@ static void tosa_init(MemoryRegion *address_space_mem, if (!cpu_model) cpu_model = "pxa255"; - cpu = pxa255_init(tosa_binfo.ram_size); + cpu = pxa255_init(address_space_mem, tosa_binfo.ram_size); cpu_register_physical_memory(0, TOSA_ROM, qemu_ram_alloc(NULL, "tosa.rom", TOSA_ROM) | IO_MEM_ROM); diff --git a/hw/z2.c b/hw/z2.c index a6a4761..58c361a 100644 --- a/hw/z2.c +++ b/hw/z2.c @@ -294,7 +294,7 @@ static void z2_init(MemoryRegion *address_space_mem, } /* Setup CPU & memory */ - cpu = pxa270_init(z2_binfo.ram_size, cpu_model); + cpu = pxa270_init(address_space_mem, z2_binfo.ram_size, cpu_model); #ifdef TARGET_WORDS_BIGENDIAN flash_ops = &pflash_cfi01_ops_be;