From patchwork Mon May 18 19:15:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 48714 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2979621411 for ; Mon, 18 May 2015 19:22:50 +0000 (UTC) Received: by labcd2 with SMTP id cd2sf9488189lab.0 for ; Mon, 18 May 2015 12:22:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=6SkzTTCdaeSZqOCbU/TSl+7p/9NgHe26as+AeYct+58=; b=fz2JkR9fPJPdMP9Y+fDn3uuxB4Mhq1mhBW3/L7JdWoq94AFF9EF5yD/AsYraCiGgVz OA4RubZ2sX0Cs1VLI5wyi8BadV1SvzRGylgiaJrr6n//m7nt6e3WG8YfhVSetD0TeZtH JbqqyBBmnCGlzBWL01EELtaHOHApqMO+afrRcJ51dQ/8EAUfUAAmRqNHGuhBBiIAtWpJ hh7pxRKh5aHZb4fpzonTXqyClMKFHos5Ls2IwK2JzELRrLmmiDG9WtgdkPX7bT58bnKE tbB3l9XoMriIbSL2YGywv4tqupZ67FZLLSsGd3/SvIvm1qgH9Vu/1kA07jLd/ZSBS9KD sJ/Q== X-Gm-Message-State: ALoCoQl/geVHABpP6UtljSpOOGbnBzemX8o3HNNArA1qn7idF2+8i5Vx9A5uyo05GCIG1v8xZHrr X-Received: by 10.112.122.39 with SMTP id lp7mr18887533lbb.5.1431976968984; Mon, 18 May 2015 12:22:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.5.42 with SMTP id cj10ls794416lad.51.gmail; Mon, 18 May 2015 12:22:48 -0700 (PDT) X-Received: by 10.112.120.199 with SMTP id le7mr18284524lbb.48.1431976968831; Mon, 18 May 2015 12:22:48 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id jn4si7291470lbc.49.2015.05.18.12.22.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 May 2015 12:22:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by lagv1 with SMTP id v1so234593860lag.3 for ; Mon, 18 May 2015 12:22:48 -0700 (PDT) X-Received: by 10.152.37.228 with SMTP id b4mr18186479lak.117.1431976968698; Mon, 18 May 2015 12:22:48 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp283620lbb; Mon, 18 May 2015 12:22:47 -0700 (PDT) X-Received: by 10.140.232.3 with SMTP id d3mr32526792qhc.46.1431976966875; Mon, 18 May 2015 12:22:46 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id z31si11275098qgd.1.2015.05.18.12.22.45 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 18 May 2015 12:22:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:42693 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuQcf-0005CC-Ef for patch@linaro.org; Mon, 18 May 2015 15:22:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuQVn-0001cB-Ts for qemu-devel@nongnu.org; Mon, 18 May 2015 15:15:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuQVi-00007l-0b for qemu-devel@nongnu.org; Mon, 18 May 2015 15:15:39 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:34173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuQVh-0008QT-GX for qemu-devel@nongnu.org; Mon, 18 May 2015 15:15:33 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1YuQVV-0007v3-Rc for qemu-devel@nongnu.org; Mon, 18 May 2015 20:15:21 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 18 May 2015 20:15:13 +0100 Message-Id: <1431976521-30352-14-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1431976521-30352-1-git-send-email-peter.maydell@linaro.org> References: <1431976521-30352-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 13/21] arm: xlnx-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Peter Crosthwaite 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 Message-id: 2c25e2a4198402a6477aef2975d5df7c415dd341.1431381507.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell --- 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 = {