From nobody Wed Nov 12 15:00:45 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=1571685118; cv=none; d=zoho.com; s=zohoarc; b=BIGmTwSyoLEHSrtl1foxucZKFHI4Ni75dGmTdsMu4v3YcR7gzFDCdBaxRkPQKgK7Sb9fbl8hFhRM3Bpj2/bleOKtOasF8HW3dL9n5fwgb6/QslyK1KV0bu9R45i7x2WUBYjAirjasmX3VPhszp3Pa50i1J0xBP1djfxbL/PU+ps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571685118; 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=PxxT2q26ZZUAHp7TQylAM5LKENoqgx0DKKAcchaygfY=; b=jVBg+E4xDUwzCVHDNV8ekuFI4BD4WowPm4OjZpFWI+m/tDR/cVdxf+CsgBHqU7Aqb3kXSTkgfv4+PQE7gv0h+mpifUMCuEzHpQhWAZ7NSAy3pbG7bKOM0Yczq1/QpAAr3c413C8q5jDndMxzCk4RuMCXmMsD3u1DFHynX2SPvCY= 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 157168511870781.12722472846815; Mon, 21 Oct 2019 12:11:58 -0700 (PDT) Received: from localhost ([::1]:46994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMd5x-000064-4K for importer@patchew.org; Mon, 21 Oct 2019 15:11:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57931) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMd1S-0003oP-90 for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMd1R-0001tO-Bp for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:18 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:45446 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMd1Q-0001rL-Sp for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:17 -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-26-QaTmpAHUNfmX5dOoxMB3Xw-1; Mon, 21 Oct 2019 15:07:08 -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 8AA11107AD31; Mon, 21 Oct 2019 19:07:06 +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 24B81196AE; Mon, 21 Oct 2019 19:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571684831; 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=PxxT2q26ZZUAHp7TQylAM5LKENoqgx0DKKAcchaygfY=; b=WOsS7HisBxpgAAxXWfsgp4LCKl63S7bb/gn9eDUV4vp0rMtSqys7g/eizVkNZP02qVhT1x VeNb15Bbhlmxscu5HiNpWEsAMevp3rMpsrLTcsRVgeybgCvy8sNmeXrUyOOrI292xqKUDp DOTb8jtDIykV2YEx9aa2t81G/57qwJo= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Peter Maydell Subject: [PATCH v2 1/6] hw/arm/xilinx_zynq: Use the IEC binary prefix definitions Date: Mon, 21 Oct 2019 21:06:48 +0200 Message-Id: <20191021190653.9511-2-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: QaTmpAHUNfmX5dOoxMB3Xw-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: 205.139.110.61 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" IEC binary prefixes ease code review: the unit is explicit. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis --- hw/arm/xilinx_zynq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index c14774e542..3a0fa5b23f 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -16,6 +16,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "cpu.h" #include "hw/sysbus.h" @@ -194,7 +195,7 @@ static void zynq_init(MachineState *machine) memory_region_add_subregion(address_space_mem, 0, ext_ram); =20 /* 256K of on-chip memory */ - memory_region_init_ram(ocm_ram, NULL, "zynq.ocm_ram", 256 << 10, + memory_region_init_ram(ocm_ram, NULL, "zynq.ocm_ram", 256 * KiB, &error_fatal); memory_region_add_subregion(address_space_mem, 0xFFFC0000, ocm_ram); =20 --=20 2.21.0 From nobody Wed Nov 12 15:00:45 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=1571684992; cv=none; d=zoho.com; s=zohoarc; b=cGbc1MrKjWIXBPtskMEuQ4P/AipG1QAVRzfuw92SJS/HYhRr6GF+pAsnH8tgmEsWOr72cTFio7LTantfcB/Bemtn3dLSRfJjVAPXwMUwI4i2G70cqHi66b5ARzox5VpO64fwm1RbNOFNClNc/+mHVwMFtG0FRT9OTm92IuaxkXo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571684992; 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=hh4hGc05qaiqE0PriS+TCQOOBJ4IG7QAWw+gTJb4YJA=; b=Pj6TEDg/Qz5FrLZ9WybQGF2j3ERf+yZOqNZV5uQJ7Ts16X9Ek0hfeg+DqxqSwXUDFlrITYjJPcEds2TKir3dwLsYWpFdZSAH0A4wOo4lkasX2Nx3KQXxhQursRZlorUFNPP2Ae0iwQ87UIEFfZlG5eW8h5woKVAuhQd/y4nBz+4= 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 1571684992004594.1806037272174; Mon, 21 Oct 2019 12:09:52 -0700 (PDT) Received: from localhost ([::1]:46972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMd3u-0005hQ-L1 for importer@patchew.org; Mon, 21 Oct 2019 15:09:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57965) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMd1U-0003rm-5U for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMd1T-0001uW-5k for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:20 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:41373 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMd1T-0001u2-1q for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:19 -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-152-fIhEpp9TMPuOfxoXvzVHcw-1; Mon, 21 Oct 2019 15:07:12 -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 8E5D6107AD31; Mon, 21 Oct 2019 19:07:10 +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 0BA2C3DE5; Mon, 21 Oct 2019 19:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571684838; 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=hh4hGc05qaiqE0PriS+TCQOOBJ4IG7QAWw+gTJb4YJA=; b=aYLODmUbvGwiQoxmFxWJ/FiD9NQQd0Nj5LJ+QdMXpfTVeXLB/U/pnYZi1mAB8GYGduCmOu q8xhgkc/HsTDkbrNjJcT/zWf8gWEJtGNxWFKboH9m1H0r1kLEMj3gJvWwir716jekZruho nE39LqOTALWHQf+iCkcVgVXvAELaKTQ= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Peter Maydell Subject: [PATCH v2 2/6] hw/arm/mps2: Use the IEC binary prefix definitions Date: Mon, 21 Oct 2019 21:06:49 +0200 Message-Id: <20191021190653.9511-3-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: fIhEpp9TMPuOfxoXvzVHcw-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: 205.139.110.61 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" IEC binary prefixes ease code review: the unit is explicit. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis --- hw/arm/mps2-tz.c | 3 ++- hw/arm/mps2.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c index 6b24aaacde..f8b620bcc6 100644 --- a/hw/arm/mps2-tz.c +++ b/hw/arm/mps2-tz.c @@ -38,6 +38,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu/error-report.h" #include "hw/arm/boot.h" @@ -458,7 +459,7 @@ static void mps2tz_common_init(MachineState *machine) * call the 16MB our "system memory", as it's the largest lump. */ memory_region_allocate_system_memory(&mms->psram, - NULL, "mps.ram", 0x01000000); + NULL, "mps.ram", 16 * MiB); memory_region_add_subregion(system_memory, 0x80000000, &mms->psram); =20 /* The overflow IRQs for all UARTs are ORed together. diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c index 10efff36b2..d002b126d3 100644 --- a/hw/arm/mps2.c +++ b/hw/arm/mps2.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu/error-report.h" #include "hw/arm/boot.h" @@ -146,7 +147,7 @@ static void mps2_common_init(MachineState *machine) * zbt_boot_ctrl is always zero). */ memory_region_allocate_system_memory(&mms->psram, - NULL, "mps.ram", 0x1000000); + NULL, "mps.ram", 16 * MiB); memory_region_add_subregion(system_memory, 0x21000000, &mms->psram); =20 switch (mmc->fpga_type) { --=20 2.21.0 From nobody Wed Nov 12 15:00:45 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 Reviewed-by: Alistair Francis --- 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 From nobody Wed Nov 12 15:00:45 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=1571685005; cv=none; d=zoho.com; s=zohoarc; b=MOw49xjhiED+0choyizBIP1waAIy6r74rFG+iFqwtd1w/1bfLiybn2EmUTReSEB5+PSuAA3Cs/8klWc3wtfcer66S47NK00uBPX8X2QnyMpqwP+u5XMMFBRX4URlPFWa/m5iGKGBLgyHiYG9D0wujcDDU2lrZmqi38NLHU47cMM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571685005; 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=Djlb/LOp0JEWa3jMyB/e62bHk5Ac8Y4m7TdUNTq7Tmc=; b=ij3Jv7tAnGJl3iResB1VxxIgJxsAguEou5yO2HuDGlO8IuKygMJBmEcgFq2g+Nc8kyATWcLaaa4dkZCkKLk8EC8asfA5nmMugxxXmnFEjAkFjLsBtZfwdMJDhsN36HGSHXvuqkb76rkAXaIP4mAZjnp+BDFbuRI9TezqbNI2/JY= 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 1571685005173506.728126716019; Mon, 21 Oct 2019 12:10:05 -0700 (PDT) Received: from localhost ([::1]:46976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMd46-00065Z-Jg for importer@patchew.org; Mon, 21 Oct 2019 15:10:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58000) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMd1c-00046W-6f for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMd1a-0001xn-S8 for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:28 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:43213 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMd1a-0001xO-LX for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:26 -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-191-wJo49e-xOjeqbMNX0jUXgQ-1; Mon, 21 Oct 2019 15:07:23 -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 A2E26107AD31; Mon, 21 Oct 2019 19:07:21 +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 BCBE5196AE; Mon, 21 Oct 2019 19:07:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571684846; 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=Djlb/LOp0JEWa3jMyB/e62bHk5Ac8Y4m7TdUNTq7Tmc=; b=QXhE2mn57UnfvdO+Is1Pe+2D0+B4E0uJ9MfERRZ7Tml+ZxqHcTh6Az29bJW8i2tPfnmeHQ xjDRPPlkd3L7jJthSaB3h+ykInGqCE2NfVQjoIy0glKDnwriqkWTexqB0tRO+WZos82Fza 4y/I/gegUuzamvr7rDPacUxlCoFUeVU= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Peter Maydell Subject: [PATCH v2 4/6] hw/arm/omap2: Create the RAM in the board Date: Mon, 21 Oct 2019 21:06:51 +0200 Message-Id: <20191021190653.9511-5-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: wJo49e-xOjeqbMNX0jUXgQ-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.81 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 OMAP2420 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 Reviewed-by: Alistair Francis --- v2: Move MemoryRegion sdram to struct n800_s (Richard) --- hw/arm/nseries.c | 10 +++++++--- hw/arm/omap2.c | 13 +++++-------- include/hw/arm/omap.h | 4 +--- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c index a36971d39a..7e361936a9 100644 --- a/hw/arm/nseries.c +++ b/hw/arm/nseries.c @@ -47,6 +47,7 @@ =20 /* Nokia N8x0 support */ struct n800_s { + MemoryRegion sdram; struct omap_mpu_state_s *mpu; =20 struct rfbi_chip_s blizzard; @@ -1311,11 +1312,14 @@ static int n810_atag_setup(const struct arm_boot_in= fo *info, void *p) static void n8x0_init(MachineState *machine, struct arm_boot_info *binfo, int model) { - MemoryRegion *sysmem =3D get_system_memory(); struct n800_s *s =3D (struct n800_s *) g_malloc0(sizeof(*s)); - int sdram_size =3D binfo->ram_size; + uint64_t sdram_size =3D binfo->ram_size; =20 - s->mpu =3D omap2420_mpu_init(sysmem, sdram_size, machine->cpu_type); + memory_region_allocate_system_memory(&s->sdram, NULL, "omap2.dram", + sdram_size); + memory_region_add_subregion(get_system_memory(), OMAP2_Q2_BASE, &s->sd= ram); + + s->mpu =3D omap2420_mpu_init(&s->sdram, machine->cpu_type); =20 /* Setup peripherals * diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c index bd7ddff983..457f152bac 100644 --- a/hw/arm/omap2.c +++ b/hw/arm/omap2.c @@ -22,6 +22,7 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "cpu.h" +#include "exec/address-spaces.h" #include "sysemu/blockdev.h" #include "sysemu/qtest.h" #include "sysemu/reset.h" @@ -2276,8 +2277,7 @@ static const struct dma_irq_map omap2_dma_irq_map[] = =3D { { 0, OMAP_INT_24XX_SDMA_IRQ3 }, }; =20 -struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sysmem, - unsigned long sdram_size, +struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sdram, const char *cpu_type) { struct omap_mpu_state_s *s =3D g_new0(struct omap_mpu_state_s, 1); @@ -2286,11 +2286,11 @@ struct omap_mpu_state_s *omap2420_mpu_init(MemoryRe= gion *sysmem, int i; SysBusDevice *busdev; struct omap_target_agent_s *ta; + MemoryRegion *sysmem =3D get_system_memory(); =20 /* Core */ s->mpu_model =3D omap2420; s->cpu =3D ARM_CPU(cpu_create(cpu_type)); - s->sdram_size =3D sdram_size; s->sram_size =3D OMAP242X_SRAM_SIZE; =20 s->wakeup =3D qemu_allocate_irq(omap_mpu_wakeup, s, 0); @@ -2299,9 +2299,6 @@ struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegi= on *sysmem, omap_clk_init(s); =20 /* Memory-mapped stuff */ - memory_region_allocate_system_memory(&s->sdram, NULL, "omap2.dram", - s->sdram_size); - memory_region_add_subregion(sysmem, OMAP2_Q2_BASE, &s->sdram); memory_region_init_ram(&s->sram, NULL, "omap2.sram", s->sram_size, &error_fatal); memory_region_add_subregion(sysmem, OMAP2_SRAM_BASE, &s->sram); @@ -2338,8 +2335,8 @@ struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegi= on *sysmem, s->port->addr_valid =3D omap2_validate_addr; =20 /* Register SDRAM and SRAM ports for fast DMA transfers. */ - soc_dma_port_add_mem(s->dma, memory_region_get_ram_ptr(&s->sdram), - OMAP2_Q2_BASE, s->sdram_size); + soc_dma_port_add_mem(s->dma, memory_region_get_ram_ptr(sdram), + OMAP2_Q2_BASE, memory_region_size(sdram)); soc_dma_port_add_mem(s->dma, memory_region_get_ram_ptr(&s->sram), OMAP2_SRAM_BASE, s->sram_size); =20 diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index 2fda996648..763d8eab4f 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -824,7 +824,6 @@ struct omap_mpu_state_s { MemoryRegion tap_iomem; MemoryRegion imif_ram; MemoryRegion emiff_ram; - MemoryRegion sdram; MemoryRegion sram; =20 struct omap_dma_port_if_s { @@ -938,8 +937,7 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion = *system_memory, const char *core); =20 /* omap2.c */ -struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sysmem, - unsigned long sdram_size, +struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sdram, const char *core); =20 uint32_t omap_badwidth_read8(void *opaque, hwaddr addr); --=20 2.21.0 From nobody Wed Nov 12 15:00:45 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=1571685157; cv=none; d=zoho.com; s=zohoarc; b=J0S0ik+vxKuK843pIU6DS62gLsUI7Lfhss+zc1cvfqubirYWkPJTknMsDNVvny+2mzchdrAFQz5gat88i4jzyhxt0C+ppJ3Qvo5cU5QqBrSgkrpD1WYtrufy3er1BdlWuKo5G6BkvAhb7v/WYb2wPO/GIg0GB0EVTXtbywNZB08= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571685157; 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=DX9d+kTgb8IhSTWDTp51phSf6KdCis8b9hmzJkoqI5A=; b=iY/RmgFhLwJc/XBJTzHZ2eUaUH+OaworO/2O7DpwTIONOBMxaWjVMp97AjfXUNn7uosAbPCQa9TTxPeE9pFTAnFAjv4L7F9X0pGCyCR+kTO0lkh/ZlJFLrd2J/PIa0oGGOJU5Fe9eVRc4QgMUZmmawtnfcJdBafTdVK2uKaEj1g= 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 1571685157866264.8611168146101; Mon, 21 Oct 2019 12:12:37 -0700 (PDT) Received: from localhost ([::1]:46998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMd6a-0000av-Gp for importer@patchew.org; Mon, 21 Oct 2019 15:12:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58027) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMd1f-0004Ce-UY for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMd1e-0001zi-Hq for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:31 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:44927 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMd1e-0001zQ-Es for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:30 -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-335-NfIB8rREPUqflFXEHtxaKA-1; Mon, 21 Oct 2019 15:07:26 -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 566C71800D79; Mon, 21 Oct 2019 19:07:25 +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 5BC0E194BE; Mon, 21 Oct 2019 19:07:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571684850; 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=DX9d+kTgb8IhSTWDTp51phSf6KdCis8b9hmzJkoqI5A=; b=QFbXEQRpqebfHEfhTJliwuMFQiIrumIuD/mZJ6Wa2kwypDRvryKr5wCEeTfuIdcFNiqt/Q dJGKlYzKw5sK+spfN07XDnYOcvv293/HmDARsXd444oUakVFEWhU9h/cGDdiiFKY2H1q1q Nr/I/6xUJIlOB7FxGHGJmlUpAp8qJB0= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Peter Maydell Subject: [PATCH v2 5/6] hw/arm/omap1: Create the RAM in the board Date: Mon, 21 Oct 2019 21:06:52 +0200 Message-Id: <20191021190653.9511-6-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: NfIB8rREPUqflFXEHtxaKA-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.81 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 OMAP310 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 Reviewed-by: Alistair Francis --- hw/arm/omap1.c | 12 +++++------- hw/arm/omap_sx1.c | 8 ++++++-- hw/arm/palm.c | 8 ++++++-- include/hw/arm/omap.h | 6 ++---- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index 0400593805..6ce038a453 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -23,6 +23,7 @@ #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" +#include "exec/address-spaces.h" #include "hw/boards.h" #include "hw/hw.h" #include "hw/irq.h" @@ -3858,8 +3859,7 @@ static int omap_validate_tipb_mpui_addr(struct omap_m= pu_state_s *s, return range_covers_byte(0xe1010000, 0xe1020004 - 0xe1010000, addr); } =20 -struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory, - unsigned long sdram_size, +struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *dram, const char *cpu_type) { int i; @@ -3867,11 +3867,12 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryReg= ion *system_memory, qemu_irq dma_irqs[6]; DriveInfo *dinfo; SysBusDevice *busdev; + MemoryRegion *system_memory =3D get_system_memory(); =20 /* Core */ s->mpu_model =3D omap310; s->cpu =3D ARM_CPU(cpu_create(cpu_type)); - s->sdram_size =3D sdram_size; + s->sdram_size =3D memory_region_size(dram); s->sram_size =3D OMAP15XX_SRAM_SIZE; =20 s->wakeup =3D qemu_allocate_irq(omap_mpu_wakeup, s, 0); @@ -3880,9 +3881,6 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegio= n *system_memory, omap_clk_init(s); =20 /* Memory-mapped stuff */ - memory_region_allocate_system_memory(&s->emiff_ram, NULL, "omap1.dram", - s->sdram_size); - memory_region_add_subregion(system_memory, OMAP_EMIFF_BASE, &s->emiff_= ram); memory_region_init_ram(&s->imif_ram, NULL, "omap1.sram", s->sram_size, &error_fatal); memory_region_add_subregion(system_memory, OMAP_IMIF_BASE, &s->imif_ra= m); @@ -3925,7 +3923,7 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegio= n *system_memory, s->port[tipb_mpui].addr_valid =3D omap_validate_tipb_mpui_addr; =20 /* Register SDRAM and SRAM DMA ports for fast transfers. */ - soc_dma_port_add_mem(s->dma, memory_region_get_ram_ptr(&s->emiff_ram), + soc_dma_port_add_mem(s->dma, memory_region_get_ram_ptr(dram), OMAP_EMIFF_BASE, s->sdram_size); soc_dma_port_add_mem(s->dma, memory_region_get_ram_ptr(&s->imif_ram), OMAP_IMIF_BASE, s->sram_size); diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index c071197be7..be245714db 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -103,6 +103,7 @@ static void sx1_init(MachineState *machine, const int v= ersion) { struct omap_mpu_state_s *mpu; MemoryRegion *address_space =3D get_system_memory(); + MemoryRegion *dram =3D g_new(MemoryRegion, 1); MemoryRegion *flash =3D g_new(MemoryRegion, 1); MemoryRegion *cs =3D g_new(MemoryRegion, 4); static uint32_t cs0val =3D 0x00213090; @@ -118,8 +119,11 @@ static void sx1_init(MachineState *machine, const int = version) flash_size =3D flash2_size; } =20 - mpu =3D omap310_mpu_init(address_space, sx1_binfo.ram_size, - machine->cpu_type); + memory_region_allocate_system_memory(dram, NULL, "omap1.dram", + sx1_binfo.ram_size); + memory_region_add_subregion(address_space, OMAP_EMIFF_BASE, dram); + + mpu =3D omap310_mpu_init(dram, machine->cpu_type); =20 /* External Flash (EMIFS) */ memory_region_init_ram(flash, NULL, "omap_sx1.flash0-0", flash_size, diff --git a/hw/arm/palm.c b/hw/arm/palm.c index 02a3a82b9b..72eca8cc55 100644 --- a/hw/arm/palm.c +++ b/hw/arm/palm.c @@ -190,16 +190,20 @@ static void palmte_init(MachineState *machine) MemoryRegion *address_space_mem =3D get_system_memory(); struct omap_mpu_state_s *mpu; int flash_size =3D 0x00800000; - int sdram_size =3D palmte_binfo.ram_size; static uint32_t cs0val =3D 0xffffffff; static uint32_t cs1val =3D 0x0000e1a0; static uint32_t cs2val =3D 0x0000e1a0; static uint32_t cs3val =3D 0xe1a0e1a0; int rom_size, rom_loaded =3D 0; + MemoryRegion *dram =3D g_new(MemoryRegion, 1); MemoryRegion *flash =3D g_new(MemoryRegion, 1); MemoryRegion *cs =3D g_new(MemoryRegion, 4); =20 - mpu =3D omap310_mpu_init(address_space_mem, sdram_size, machine->cpu_t= ype); + memory_region_allocate_system_memory(dram, NULL, "omap1.dram", + palmte_binfo.ram_size); + memory_region_add_subregion(address_space_mem, OMAP_EMIFF_BASE, dram); + + mpu =3D omap310_mpu_init(dram, machine->cpu_type); =20 /* External Flash (EMIFS) */ memory_region_init_ram(flash, NULL, "palmte.flash", flash_size, diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index 763d8eab4f..f3aa670036 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -823,7 +823,6 @@ struct omap_mpu_state_s { MemoryRegion mpui_io_iomem; MemoryRegion tap_iomem; MemoryRegion imif_ram; - MemoryRegion emiff_ram; MemoryRegion sram; =20 struct omap_dma_port_if_s { @@ -835,7 +834,7 @@ struct omap_mpu_state_s { hwaddr addr); } port[__omap_dma_port_last]; =20 - unsigned long sdram_size; + uint64_t sdram_size; unsigned long sram_size; =20 /* MPUI-TIPB peripherals */ @@ -932,8 +931,7 @@ struct omap_mpu_state_s { }; =20 /* omap1.c */ -struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory, - unsigned long sdram_size, +struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *sdram, const char *core); =20 /* omap2.c */ --=20 2.21.0 From nobody Wed Nov 12 15:00:45 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=1571685360; cv=none; d=zoho.com; s=zohoarc; b=KjG+WqKKM9a3asAgK3A5y6yONRsSORzLwb9h6VobuGHsBAfLaueL4hAlRmDkwF5nUEuu4Yzt+2qsUkjGg1VmDzc0IDhlscwiIThR5rCxJfWLQ3SJnMGSenuFio31HcCz46WodFExcWM2jXYfuJDde9NLGmcv4XEf9btAQIRQork= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571685360; 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=pG+G68WgVMUlBSMG+FIA/vBrrchUsd+YdC6zcPuCWtA=; b=JvOfUtG22vcqdmwbP4iwG8LOl3ZyVE1r+yvEWRcD6wtR8TPYrtCSBb19T8aVu3HRi5qp1VvjE+4KbHlpe0GShX3oyVd1eu7Nnre4YPznivWAB/U7IU27vtAzVF3IrXRkd7kNRRliKXMWcwak/bhyInJ72j3hg6ka9vz3+xNBY/g= 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 1571685360526982.1407518107977; Mon, 21 Oct 2019 12:16:00 -0700 (PDT) Received: from localhost ([::1]:47032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMd9q-0004Lh-U0 for importer@patchew.org; Mon, 21 Oct 2019 15:15:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58056) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMd1k-0004Gg-FY for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMd1j-00021U-FC for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:36 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:26902 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMd1j-000215-BX for qemu-devel@nongnu.org; Mon, 21 Oct 2019 15:07:35 -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-304-nHKXP7i_MtutRMk2-T7ZUw-1; Mon, 21 Oct 2019 15:07:30 -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 6C51647B; Mon, 21 Oct 2019 19:07:29 +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 D4981171C6; Mon, 21 Oct 2019 19:07:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571684854; 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=pG+G68WgVMUlBSMG+FIA/vBrrchUsd+YdC6zcPuCWtA=; b=fJzDAezYZZRwyImsdZtzyalnSstsSmA2kw802laYSBoV9oR+Swr431bbfqjkL84Y1i7JeI rux54uUfGfdQdpEcpPH7LAhftUxdFSJNLarzHdDt5UQcLAC2LK2CHh8koWYBxokDsp0sR9 A2FQz6lPtbtI1jmtG7elQl9zyrkxZaI= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Peter Maydell Subject: [PATCH v2 6/6] hw/arm/digic4: Inline digic4_board_setup_ram() function Date: Mon, 21 Oct 2019 21:06:53 +0200 Message-Id: <20191021190653.9511-7-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: nHKXP7i_MtutRMk2-T7ZUw-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: 205.139.110.61 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" Having the RAM creation code in a separate function is not very helpful. Move this code directly inside the board_init() function, 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 Reviewed-by: Alistair Francis --- hw/arm/digic_boards.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c index 304e4d1a29..ef3fc2b6a5 100644 --- a/hw/arm/digic_boards.c +++ b/hw/arm/digic_boards.c @@ -53,12 +53,6 @@ typedef struct DigicBoard { const char *rom1_def_filename; } DigicBoard; =20 -static void digic4_board_setup_ram(DigicBoardState *s, hwaddr ram_size) -{ - memory_region_allocate_system_memory(&s->ram, NULL, "ram", ram_size); - memory_region_add_subregion(get_system_memory(), 0, &s->ram); -} - static void digic4_board_init(DigicBoard *board) { Error *err =3D NULL; @@ -72,7 +66,8 @@ static void digic4_board_init(DigicBoard *board) exit(1); } =20 - digic4_board_setup_ram(s, board->ram_size); + memory_region_allocate_system_memory(&s->ram, NULL, "ram", board->ram_= size); + memory_region_add_subregion(get_system_memory(), 0, &s->ram); =20 if (board->add_rom0) { board->add_rom0(s, DIGIC4_ROM0_BASE, board->rom0_def_filename); --=20 2.21.0