From patchwork Fri Apr 24 19:31:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 464392 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2F1FB140079 for ; Sat, 25 Apr 2015 05:38:44 +1000 (AEST) Received: from localhost ([::1]:46236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YljQw-0006ZT-Ec for incoming@patchwork.ozlabs.org; Fri, 24 Apr 2015 15:38:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YljKU-00036e-HB for qemu-devel@nongnu.org; Fri, 24 Apr 2015 15:32:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YljKR-0007th-Bd for qemu-devel@nongnu.org; Fri, 24 Apr 2015 15:32:02 -0400 Received: from mail-bn1bon0070.outbound.protection.outlook.com ([157.56.111.70]:58336 helo=na01-bn1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YljKR-0007tU-60 for qemu-devel@nongnu.org; Fri, 24 Apr 2015 15:31:59 -0400 Received: from BY2FFO11HUB057.protection.gbl (10.1.15.232) by BY2FFO11HUB008.protection.gbl (10.1.14.214) with Microsoft SMTP Server (TLS) id 15.1.154.14; Fri, 24 Apr 2015 19:31:56 +0000 Received: from BY2FFO11OLC005.protection.gbl (10.1.14.31) by BY2FFO11HUB057.protection.gbl (10.1.15.232) with Microsoft SMTP Server (TLS) id 15.1.148.11; Fri, 24 Apr 2015 19:31:31 +0000 Authentication-Results: spf=fail (sender IP is 149.199.60.96) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of xilinx.com does not designate 149.199.60.96 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.96; helo=xsj-tvapsmtpgw01; Received: from xsj-tvapsmtpgw01 (149.199.60.96) by BY2FFO11OLC005.mail.protection.outlook.com (10.1.14.145) with Microsoft SMTP Server (TLS) id 15.1.154.14 via Frontend Transport; Fri, 24 Apr 2015 19:31:31 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:51903 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1YljFF-0001n0-KO; Fri, 24 Apr 2015 12:26:37 -0700 Received: from [127.0.0.1] (port=33527 helo=tsj-smtp-dlp1.xlnx.xilinx.com) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1YljJy-0001H9-IF; Fri, 24 Apr 2015 12:31:30 -0700 Received: from xsj-tvapsmtp02 (xsj-tvapsmtp02.xilinx.com [172.16.1.203]) by tsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id t3OJRRk0005381; Fri, 24 Apr 2015 12:27:27 -0700 Received: from [172.19.74.49] (port=38256 helo=xsjsorenbubuntu.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1YljJx-0001Gf-LO; Fri, 24 Apr 2015 12:31:29 -0700 From: Peter Crosthwaite To: Date: Fri, 24 Apr 2015 12:31:29 -0700 Message-ID: <45939d896a8b93bf59251ec1e3f076170200bd6e.1429903602.git.peter.crosthwaite@xilinx.com> X-Mailer: git-send-email 2.3.6.3.g2cc70ee In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-7.5.0.1018-21500.005 X-TM-AS-Result: No--13.273-7.0-31-10 X-imss-scan-details: No--13.273-7.0-31-10 X-TMASE-MatchedRID: iSQL5szRvdEDh1tb/sWFHJY9D0/NRxoqUAjrAJWsTe8Y0A95tjAn++gY NLLnK4fd4vksdftaW7om2SNlXt0Mh7BAQLqGlKivPJAf1AuYU6AbFOwqTAzggLzZNXfJG3+aXRA +E/CoYBYPe3v2s+gSy2aecY+NuL5IXHEPHmpuRH0URSScn+QSXt0H8LFZNFG7bkV4e2xSge41Yd 06Z6N/5aTYshjt3qKiPWFCXW8i16y7K4qQ2S697jZFEgw6u+Np X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.96; CTRY:US; IPV:NLI; EFV:NLI; BMV:1; SFV:NSPM; SFS:(10009020)(6009001)(339900001)(189002)(199003)(47776003)(2351001)(46102003)(19580395003)(64026002)(36756003)(105606002)(48376002)(50466002)(33646002)(19580405001)(86362001)(106466001)(110136001)(71366001)(118296001)(85426001)(77096005)(92566002)(62966003)(77156002)(76176999)(50226001)(87936001)(229853001)(50986999)(6806004)(2950100001)(5001920100001)(107986001)(4001430100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2FFO11HUB057; H:xsj-tvapsmtpgw01; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BY2FFO11HUB057; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BY2FFO11HUB008; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5002010)(5005006)(3002001); SRVR:BY2FFO11HUB057; BCL:0; PCL:0; RULEID:; SRVR:BY2FFO11HUB057; X-Forefront-PRVS: 05568D1FF7 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2015 19:31:31.0396 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.96]; Helo=[xsj-tvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2FFO11HUB057 X-OriginatorOrg: xilinx.com X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 157.56.111.70 Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, zach.pfeffer@xilinx.com, jues@xilinx.com, ozaki.ryota@gmail.com, Alistair Francis , michals@xilinx.com Subject: [Qemu-devel] [PATCH target-arm v5 13/14] arm: xilinx-ep108: Add external RAM 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 Zynq MPSoC supports external DDR RAM. Add a RAM at 0 to the model. Reviewed-by: Alistair Francis Tested-by: Alistair Francis Signed-off-by: Peter Crosthwaite --- changed since v4: Use memory_region_allocate_system_memory Change too-small warning to be qemu_log changed since v1: Add ram size clamps and warnings hw/arm/xlnx-ep108.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/hw/arm/xlnx-ep108.c b/hw/arm/xlnx-ep108.c index 81704bb..46f145b 100644 --- a/hw/arm/xlnx-ep108.c +++ b/hw/arm/xlnx-ep108.c @@ -18,11 +18,16 @@ #include "hw/arm/xlnx-zynqmp.h" #include "hw/boards.h" #include "qemu/error-report.h" +#include "exec/address-spaces.h" typedef struct XlnxEP108 { XlnxZynqMPState soc; + MemoryRegion ddr_ram; } XlnxEP108; +/* Max 2GB RAM */ +#define EP108_MAX_RAM_SIZE 0x80000000ull + static void xlnx_ep108_init(MachineState *machine) { XlnxEP108 *s = g_new0(XlnxEP108, 1); @@ -37,6 +42,21 @@ static void xlnx_ep108_init(MachineState *machine) error_report("%s", error_get_pretty(err)); exit(1); } + + if (machine->ram_size > EP108_MAX_RAM_SIZE) { + error_report("WARNING: RAM size " RAM_ADDR_FMT " above max supported, " + "reduced to %llx", machine->ram_size, EP108_MAX_RAM_SIZE); + machine->ram_size = EP108_MAX_RAM_SIZE; + } + + if (machine->ram_size <= 0x08000000) { + qemu_log("WARNING: RAM size " RAM_ADDR_FMT " is small for EP108", + machine->ram_size); + } + + memory_region_allocate_system_memory(&s->ddr_ram, NULL, "ddr-ram", + machine->ram_size); + memory_region_add_subregion(get_system_memory(), 0, &s->ddr_ram); } static QEMUMachine xlnx_ep108_machine = {