From patchwork Mon Mar 16 12:12:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 450531 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 A4464140083 for ; Mon, 16 Mar 2015 23:19:09 +1100 (AEDT) Received: from localhost ([::1]:48933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXTz9-0003E9-QJ for incoming@patchwork.ozlabs.org; Mon, 16 Mar 2015 08:19:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXTsj-0000LN-VV for qemu-devel@nongnu.org; Mon, 16 Mar 2015 08:12:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXTsf-0003X2-SD for qemu-devel@nongnu.org; Mon, 16 Mar 2015 08:12:29 -0400 Received: from mail-bn1on0093.outbound.protection.outlook.com ([157.56.110.93]:41818 helo=na01-bn1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXTsf-0003Wu-Op for qemu-devel@nongnu.org; Mon, 16 Mar 2015 08:12:25 -0400 Received: from BN1AFFO11FD036.protection.gbl (10.58.52.34) by BN1AFFO11HUB048.protection.gbl (10.58.52.107) with Microsoft SMTP Server (TLS) id 15.1.112.13; Mon, 16 Mar 2015 12:12:25 +0000 Received: from xsj-tvapsmtpgw01 (149.199.60.96) by BN1AFFO11FD036.mail.protection.outlook.com (10.58.52.240) with Microsoft SMTP Server (TLS) id 15.1.112.13 via Frontend Transport; Mon, 16 Mar 2015 12:12:24 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:35361 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1YXToW-0001mx-LU; Mon, 16 Mar 2015 05:08:08 -0700 Received: from [127.0.0.1] (port=32935 helo=xsj-tvapsmtp02) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1YXTsd-0006st-G5; Mon, 16 Mar 2015 05:12:23 -0700 Received: from [172.19.74.49] (port=51346 helo=xsjsorenbubuntu.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1YXTsd-0006sp-7r; Mon, 16 Mar 2015 05:12:23 -0700 From: Peter Crosthwaite To: Date: Mon, 16 Mar 2015 05:12:23 -0700 Message-ID: X-Mailer: git-send-email 2.3.1.2.g90df61e.dirty In-Reply-To: References: X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-7.5.0.1018-21400.005 X-TM-AS-Result: No--11.634-7.0-31-10 X-imss-scan-details: No--11.634-7.0-31-10 X-TMASE-MatchedRID: yvDAzrttxFWKfuODkuzgfAwfhKwa9GwDXlDwLGF87ODfUZT83lbkEGvK 1rsrYfZXicRFJOHcTdoL1e7TPqB0BbdjTQUenVDDMIiU395I8H25JJEy92I4jE1KG1YrOQW/C2b f4vQBGC6wwbl9Om31sYAy6p60ZV62fJ5/bZ6npdg7AFczfjr/7Ma86GptpIRUqjvmaIu68nvUK0 gw4rdaZ4MjZ29f74CyVTGaRM/5GRw= X-EOPAttributedMessage: 0 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; Authentication-Results: spf=fail (sender IP is 149.199.60.96) smtp.mailfrom=peter.crosthwaite@xilinx.com; nongnu.org; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:149.199.60.96; CTRY:US; IPV:NLI; EFV:NLI; BMV:1; SFV:NSPM; SFS:(10009020)(6009001)(339900001)(199003)(189002)(50986999)(85426001)(6806004)(46102003)(77156002)(77096005)(76176999)(19580405001)(105606002)(19580395003)(47776003)(36756003)(118296001)(86362001)(87936001)(106466001)(2351001)(110136001)(229853001)(2950100001)(62966003)(92566002)(50226001)(71366001)(48376002)(33646002)(64026002)(50466002)(16796002)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1AFFO11HUB048; H:xsj-tvapsmtpgw01; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1AFFO11HUB048; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5002010)(5005006); SRVR:BN1AFFO11HUB048; BCL:0; PCL:0; RULEID:; SRVR:BN1AFFO11HUB048; X-Forefront-PRVS: 05177D47DC X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Mar 2015 12:12:24.3998 (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: BN1AFFO11HUB048 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 157.56.110.93 Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, zach.pfeffer@xilinx.com, alistair.francis@xilinx.com, michals@xilinx.com, alex.bennee@linaro.org Subject: [Qemu-devel] [PATCH target-arm v3 13/15] 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. Signed-off-by: Peter Crosthwaite --- changed since v1: Add ram size clamps and warnings hw/arm/xlnx-ep108.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/hw/arm/xlnx-ep108.c b/hw/arm/xlnx-ep108.c index eec3e94..6042cbc 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); @@ -36,6 +41,22 @@ 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) { + error_report("WARNING: RAM size " RAM_ADDR_FMT " is small for EP108\n", + machine->ram_size); + } + + memory_region_init_ram(&s->ddr_ram, NULL, "ddr-ram", machine->ram_size, + &error_abort); + vmstate_register_ram_global(&s->ddr_ram); + memory_region_add_subregion(get_system_memory(), 0, &s->ddr_ram); } static QEMUMachine xlnx_ep108_machine = {