From nobody Wed Nov 12 16:28:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571685134; cv=none; d=zoho.com; s=zohoarc; b=OAhTAvD2tZaU/ZnNa9/7MU341+vzo3D3Pf14NkTv0mallxqA6IptJFrVk5iJSk7Fx0QIqNc38NvRCHAdzyuEQzNPPMBt+/wPTmSWg0w6oLSjsMuhYOQ5iLW6GiZk2jdFO7J6SjmZdT0gvi5ozM09aaFshwUfCd5nFlGdim2DElk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571685134; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7mvEiwYhWi38A3Q4VwmKuPn4Vw0EqFfBIT1Jfwf4t0k=; b=j/UCp7qh5ZsTsBRad0Db3rRkpqGIMatoHCcYanvIgiOCcfEqkFviA87gFC7GQDZ1iYs3hA4aTCa9IzpE7j2CRavsSxjGmJAkahfXiR94feb0x4TIjGpOq0iNOJIuee/LyDw2bGnPcA1sbXdc6oK2vtc8hNOGxlBTKdhuOOs+yOE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571685134210440.92547383393844; Mon, 21 Oct 2019 12:12:14 -0700 (PDT) Received: from localhost ([::1]:46996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMd6C-0000NC-Qv for importer@patchew.org; Mon, 21 Oct 2019 15:12:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57981) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMd1V-0003u8-LF for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMd1U-0001vK-9G for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:21 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:50792 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMd1U-0001v3-6P for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:20 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-61-KWD7N01UMjObdtlzTaXO2A-1; Mon, 21 Oct 2019 15:07:16 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F2ABF1800D79; Mon, 21 Oct 2019 19:07:14 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-124.brq.redhat.com [10.40.204.124]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 55ACC196AE; Mon, 21 Oct 2019 19:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571684839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7mvEiwYhWi38A3Q4VwmKuPn4Vw0EqFfBIT1Jfwf4t0k=; b=Dc0CBeg4oXNb++0400mDMlgALxb0YG5zijEM/UlrrjzI0zlvQSvK0k4XNwMPBjmdVqb6V6 VDwJfIDpLnfMFt+bHgsHVNftYaSt2HrlLlaNzTzqE+9ftiobKlYkD4i7/AUELZUeyIYpfK 5vqaY05Xsm78HDQxS+G1ct3a3xUPu6Q= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Peter Maydell Subject: [PATCH v2 3/6] hw/arm/collie: Create the RAM in the board Date: Mon, 21 Oct 2019 21:06:50 +0200 Message-Id: <20191021190653.9511-4-philmd@redhat.com> In-Reply-To: <20191021190653.9511-1-philmd@redhat.com> References: <20191021190653.9511-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: KWD7N01UMjObdtlzTaXO2A-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Alistair Francis , Richard Henderson , qemu-arm@nongnu.org, Antony Pavlov , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The SDRAM is incorrectly created in the SA1110 SoC. Move its creation in the board code, this will later allow the board to have the QOM ownership of the RAM. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/collie.c | 8 ++++++-- hw/arm/strongarm.c | 7 +------ hw/arm/strongarm.h | 4 +--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/arm/collie.c b/hw/arm/collie.c index b1288ccea8..970a4405cc 100644 --- a/hw/arm/collie.c +++ b/hw/arm/collie.c @@ -27,9 +27,13 @@ static void collie_init(MachineState *machine) { StrongARMState *s; DriveInfo *dinfo; - MemoryRegion *sysmem =3D get_system_memory(); + MemoryRegion *sdram =3D g_new(MemoryRegion, 1); =20 - s =3D sa1110_init(sysmem, collie_binfo.ram_size, machine->cpu_type); + s =3D sa1110_init(machine->cpu_type); + + memory_region_allocate_system_memory(sdram, NULL, "strongarm.sdram", + collie_binfo.ram_size); + memory_region_add_subregion(get_system_memory(), SA_SDCS0, sdram); =20 dinfo =3D drive_get(IF_PFLASH, 0, 0); pflash_cfi01_register(SA_CS0, "collie.fl1", 0x02000000, diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c index dc65d88a65..6bee034914 100644 --- a/hw/arm/strongarm.c +++ b/hw/arm/strongarm.c @@ -1586,8 +1586,7 @@ static const TypeInfo strongarm_ssp_info =3D { }; =20 /* Main CPU functions */ -StrongARMState *sa1110_init(MemoryRegion *sysmem, - unsigned int sdram_size, const char *cpu_type) +StrongARMState *sa1110_init(const char *cpu_type) { StrongARMState *s; int i; @@ -1601,10 +1600,6 @@ StrongARMState *sa1110_init(MemoryRegion *sysmem, =20 s->cpu =3D ARM_CPU(cpu_create(cpu_type)); =20 - memory_region_allocate_system_memory(&s->sdram, NULL, "strongarm.sdram= ", - sdram_size); - memory_region_add_subregion(sysmem, SA_SDCS0, &s->sdram); - s->pic =3D sysbus_create_varargs("strongarm_pic", 0x90050000, qdev_get_gpio_in(DEVICE(s->cpu), ARM_CPU_IRQ), qdev_get_gpio_in(DEVICE(s->cpu), ARM_CPU_FIQ), diff --git a/hw/arm/strongarm.h b/hw/arm/strongarm.h index e98840b461..192821f6aa 100644 --- a/hw/arm/strongarm.h +++ b/hw/arm/strongarm.h @@ -55,7 +55,6 @@ enum { =20 typedef struct { ARMCPU *cpu; - MemoryRegion sdram; DeviceState *pic; DeviceState *gpio; DeviceState *ppc; @@ -63,7 +62,6 @@ typedef struct { SSIBus *ssp_bus; } StrongARMState; =20 -StrongARMState *sa1110_init(MemoryRegion *sysmem, - unsigned int sdram_size, const char *rev); +StrongARMState *sa1110_init(const char *cpu_type); =20 #endif --=20 2.21.0