qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>
Subject: [Qemu-devel] [PATCH 12/25] pxa: Pass in address_space to pxa{255, 270}_init
Date: Sun,  2 Oct 2011 16:26:43 +0200	[thread overview]
Message-ID: <1317565616-12997-13-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1317565616-12997-1-git-send-email-avi@redhat.com>

From: Richard Henderson <rth@twiddle.net>

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
---
 hw/gumstix.c   |    7 +++++--
 hw/mainstone.c |    2 +-
 hw/pxa.h       |    7 +++++--
 hw/pxa2xx.c    |   10 +++++-----
 hw/spitz.c     |    4 +++-
 hw/tosa.c      |    4 +++-
 hw/z2.c        |    4 +++-
 7 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/hw/gumstix.c b/hw/gumstix.c
index b8b76f4..686a5ed 100644
--- a/hw/gumstix.c
+++ b/hw/gumstix.c
@@ -38,6 +38,7 @@
 #include "devices.h"
 #include "boards.h"
 #include "blockdev.h"
+#include "exec-memory.h"
 
 static const int sector_len = 128 * 1024;
 
@@ -49,11 +50,12 @@ static void connex_init(ram_addr_t ram_size,
     PXA2xxState *cpu;
     DriveInfo *dinfo;
     int be;
+    MemoryRegion *address_space_mem = get_system_memory();
 
     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) {
@@ -87,11 +89,12 @@ static void verdex_init(ram_addr_t ram_size,
     PXA2xxState *cpu;
     DriveInfo *dinfo;
     int be;
+    MemoryRegion *address_space_mem = get_system_memory();
 
     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 336f31e..3ed6649 100644
--- a/hw/mainstone.c
+++ b/hw/mainstone.c
@@ -110,7 +110,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 c47e698..70d7c8a 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 @@ static void pxa2xx_reset(void *opaque, int line, int level)
 
     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 @@ static void pxa2xx_reset(void *opaque, int line, int level)
 }
 
 /* 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 @@ static void pxa2xx_reset(void *opaque, int line, int level)
 
     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 0adae59..6f8a94c 100644
--- a/hw/spitz.c
+++ b/hw/spitz.c
@@ -24,6 +24,7 @@
 #include "boards.h"
 #include "blockdev.h"
 #include "sysbus.h"
+#include "exec-memory.h"
 
 #undef REG_FMT
 #define REG_FMT			"0x%02lx"
@@ -896,12 +897,13 @@ static void spitz_common_init(ram_addr_t ram_size,
 {
     PXA2xxState *cpu;
     DeviceState *scp0, *scp1 = NULL;
+    MemoryRegion *address_space_mem = get_system_memory();
 
     if (!cpu_model)
         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 7b407f4..92702d1 100644
--- a/hw/tosa.c
+++ b/hw/tosa.c
@@ -20,6 +20,7 @@
 #include "ssi.h"
 #include "blockdev.h"
 #include "sysbus.h"
+#include "exec-memory.h"
 
 #define TOSA_RAM    0x04000000
 #define TOSA_ROM	0x00800000
@@ -206,6 +207,7 @@ static void tosa_init(ram_addr_t ram_size,
                 const char *kernel_filename, const char *kernel_cmdline,
                 const char *initrd_filename, const char *cpu_model)
 {
+    MemoryRegion *address_space_mem = get_system_memory();
     PXA2xxState *cpu;
     TC6393xbState *tmio;
     DeviceState *scp0, *scp1;
@@ -213,7 +215,7 @@ static void tosa_init(ram_addr_t ram_size,
     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 b6ae608..a03bb33 100644
--- a/hw/z2.c
+++ b/hw/z2.c
@@ -20,6 +20,7 @@
 #include "blockdev.h"
 #include "console.h"
 #include "audio/audio.h"
+#include "exec-memory.h"
 
 #ifdef DEBUG_Z2
 #define DPRINTF(fmt, ...) \
@@ -277,6 +278,7 @@ static void z2_init(ram_addr_t ram_size,
                 const char *kernel_filename, const char *kernel_cmdline,
                 const char *initrd_filename, const char *cpu_model)
 {
+    MemoryRegion *address_space_mem = get_system_memory();
     uint32_t sector_len = 0x10000;
     PXA2xxState *cpu;
     DriveInfo *dinfo;
@@ -290,7 +292,7 @@ static void z2_init(ram_addr_t ram_size,
     }
 
     /* 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
     be = 1;
-- 
1.7.6.3

  parent reply	other threads:[~2011-10-02 14:27 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-02 14:26 [Qemu-devel] [PULL 00/25] Memory API conversion, batch 10 Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 01/25] etrax-pic: Convert to MemoryRegion Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 02/25] etrax-ser: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 03/25] etrax-timer: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 04/25] etrax-dma: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 05/25] etrax-eth: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 06/25] serial: Convert serial_mm_init " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 07/25] serial: Use enum device_endian in serial_mm_init parameter Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 08/25] serial: Remove ioregister parameter from serial_mm_init Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 09/25] serial: Add MemoryRegion parameter to serial_mm_init Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 10/25] ppc405: Pass in address_space_mem to ppc405{cr, ep}_init Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 11/25] ppc440: Pass in address_space_mem to ppc440ep_init Avi Kivity
2011-10-02 14:26 ` Avi Kivity [this message]
2011-10-02 14:26 ` [Qemu-devel] [PATCH 13/25] sm501: Pass address_space_mem to sm501_init Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 14/25] sun4u: Pass address_space_mem to sun4uv_init Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 15/25] hw/smc91c111: Convert to MemoryRegion Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 16/25] openpic: Memory API conversion for mpic Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 17/25] milkymist-ac97: convert to memory API Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 18/25] milkymist-hpdmc: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 19/25] milkymist-memcard: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 20/25] milkymist-pfpu: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 21/25] milkymist-sysctl: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 22/25] milkymist-tmu2: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 23/25] milkymist-uart: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 24/25] milkymist-vgafb: " Avi Kivity
2011-10-02 14:26 ` [Qemu-devel] [PATCH 25/25] milkymist-{minimac2, softusb}: rename memory names Avi Kivity
2011-10-09 10:33 ` [Qemu-devel] [PULL 00/25] Memory API conversion, batch 10 Avi Kivity
2011-10-09 11:01   ` Blue Swirl
2011-10-09 12:07     ` Avi Kivity
2011-10-09 12:50       ` Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1317565616-12997-13-git-send-email-avi@redhat.com \
    --to=avi@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).