From patchwork Tue Oct 22 13:31:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 177189 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp4902268ill; Tue, 22 Oct 2019 06:58:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlZ4rAg4gma68uucC/yHeWl5SYG6DCAZ3dhR8UTGK/nN9Gu7VYywAbfqqXI0wmQaX+UlI8 X-Received: by 2002:a05:6402:20c:: with SMTP id t12mr7509585edv.109.1571752721516; Tue, 22 Oct 2019 06:58:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571752721; cv=none; d=google.com; s=arc-20160816; b=QvY9xt6RwKSZw55NopibNL37QMfnKGWBTKEg91Ib1QW+FiqOI4vo2IoIrywwjaPNkK qqCcCX7breOep3+xmHOAfc+m+0TqnLR6qjEL4EuCn/sgraj4lgUnjCQOnUBXEkkVGZYf Zy+xRCquU2LfegZXYSmViAImOBFBPIMWsVZC0SIhIthmyeTY/dAolefZkZlB5Ai4R02A /or28dL5yu4R6dSQDIJH8mYtEAMh53aQlfCDFgBlHFwL8zehsohWe3VwZf9QlXSmuUWA G64q19twQ/Dla46Y8WV2FNXByT8U2g5XzRW7x0npQgtsqM4yOctLp5gLV8UVXfH4Ygo9 Rnog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=bRVLYeRm52S1+mDtVEVVM44iNY6mCQd1H1UdrE+pTLs=; b=LQfYHn6zr4gbAa8zQJhliRd1THwIc1qVB2xYZ9UMpx0qzY0IMeoQwtTSnevia8U5jH Dueg///2IRIJQlanAVhtqg5pkbJLUHpod3KcUAsvoICg6GPz7txO9KipfMjbH8Mk8/M4 LN2UfVQBVaQwDybinU1s9Uby7JzpVQiQ/L8VA2ROD0Zo/qWUUXn0rjlujFA3ZwPYpImL OL4NDunGQ/IcUePQiSor3qt08gJd688cHVmBurKC0kqYQrIkF3nHHeSii0tZPyUqyVp3 3b207lz/tyF5/SP/nABdWsrp0HRlrZN+ZKsjKRbMHJtSXRE/mRQ4GZqmFKSGube3by80 45fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LgDtlhSZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q20si10922225ejn.18.2019.10.22.06.58.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Oct 2019 06:58:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LgDtlhSZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMugJ-0008D0-A6 for patch@linaro.org; Tue, 22 Oct 2019 09:58:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37270) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMuHk-0003YD-4c for qemu-devel@nongnu.org; Tue, 22 Oct 2019 09:33:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMuHc-0001ej-Km for qemu-devel@nongnu.org; Tue, 22 Oct 2019 09:33:12 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:36789) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iMuHa-0001dl-L9 for qemu-devel@nongnu.org; Tue, 22 Oct 2019 09:33:08 -0400 Received: by mail-wm1-x32e.google.com with SMTP id c22so7082397wmd.1 for ; Tue, 22 Oct 2019 06:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=bRVLYeRm52S1+mDtVEVVM44iNY6mCQd1H1UdrE+pTLs=; b=LgDtlhSZioQxUUTVC1mfFG86hTFQAyL6xIokL7y8ZSzU4DyCWYPAjkB8kj/yLJL+9Q veRnnNdKfF4Eef0g+MOsWuG/NwTyhK7J+UyLdjHCtIig76QRRNhATxHXabVB2SLFlIrN Hj9vRaYDghamRHpXUO+bBHhknMD4m04mfpFe+KCNsqAses9MABB2zQaPkn+s0ECoaFyp h8agvjWdLiGE+Dui8R1aSRicWvJL9W5EQpVWeE/FV8kLENn/69qb/w9GLRbglhFitkfX P7kRQ0jR/iucIXIJPM8GoG4g2STmOJeyWyjOP95e/tDZZZegY04bP/mKIoyJbn4Gc6n+ D/8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bRVLYeRm52S1+mDtVEVVM44iNY6mCQd1H1UdrE+pTLs=; b=dVXyOcA0mBJm52i4dtwIjLSRueh1cubWCVCopKyJA5vLSdsYS3EcGe7muyTfY4SAIN 8yGvVADFudjnC74CZXEoJFUuSnuH1nSgKVyG3jNsyh16hOyVxWhyyba0x1ydo3IyayY0 tf4zI5DVhMXJvOlc8Y2eepQaxnnin74ySsvWMiwyjOKHe3+E8vr62SPMrrta+BsuZMZr wHCGF/lmHBUPbe4/lyz0thXtGQ8g+Rj16wAyIWUmDqowJeFBsXZd/EwLFBVNsbNRjEwT m6K5JL6LSRoy7DrQG4gz63kvK7Mws7fdFMojj4/UB7Bqgwcu4BdpkPk1B8hhfzyBJNoF Ty/g== X-Gm-Message-State: APjAAAXKHryWp8FMX8NNyRVygK2ySquH+MaPoMPWr3gugOMc3WZPpoz5 VLX9KAPedkdDFfHcQiEVF2dg1dUDtsI= X-Received: by 2002:a7b:c186:: with SMTP id y6mr3252813wmi.67.1571751184274; Tue, 22 Oct 2019 06:33:04 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id r2sm20263856wma.1.2019.10.22.06.33.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2019 06:33:02 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 38/41] hw/arm/collie: Create the RAM in the board Date: Tue, 22 Oct 2019 14:31:31 +0100 Message-Id: <20191022133134.14487-39-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191022133134.14487-1-peter.maydell@linaro.org> References: <20191022133134.14487-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32e 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé 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é Reviewed-by: Alistair Francis Message-id: 20191021190653.9511-4-philmd@redhat.com Signed-off-by: Peter Maydell --- hw/arm/strongarm.h | 4 +--- hw/arm/collie.c | 8 ++++++-- hw/arm/strongarm.c | 7 +------ 3 files changed, 8 insertions(+), 11 deletions(-) -- 2.20.1 diff --git a/hw/arm/strongarm.h b/hw/arm/strongarm.h index e98840b461a..192821f6aab 100644 --- a/hw/arm/strongarm.h +++ b/hw/arm/strongarm.h @@ -55,7 +55,6 @@ enum { typedef struct { ARMCPU *cpu; - MemoryRegion sdram; DeviceState *pic; DeviceState *gpio; DeviceState *ppc; @@ -63,7 +62,6 @@ typedef struct { SSIBus *ssp_bus; } StrongARMState; -StrongARMState *sa1110_init(MemoryRegion *sysmem, - unsigned int sdram_size, const char *rev); +StrongARMState *sa1110_init(const char *cpu_type); #endif diff --git a/hw/arm/collie.c b/hw/arm/collie.c index b1288ccea80..970a4405ccf 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 = get_system_memory(); + MemoryRegion *sdram = g_new(MemoryRegion, 1); - s = sa1110_init(sysmem, collie_binfo.ram_size, machine->cpu_type); + s = 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); dinfo = 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 dc65d88a657..6bee0349149 100644 --- a/hw/arm/strongarm.c +++ b/hw/arm/strongarm.c @@ -1586,8 +1586,7 @@ static const TypeInfo strongarm_ssp_info = { }; /* 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, s->cpu = ARM_CPU(cpu_create(cpu_type)); - memory_region_allocate_system_memory(&s->sdram, NULL, "strongarm.sdram", - sdram_size); - memory_region_add_subregion(sysmem, SA_SDCS0, &s->sdram); - s->pic = 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),