From patchwork Fri Mar 9 04:12:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Clark X-Patchwork-Id: 10269645 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A58D260236 for ; Fri, 9 Mar 2018 04:22:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97EF229403 for ; Fri, 9 Mar 2018 04:22:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C5FF29C18; Fri, 9 Mar 2018 04:22:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3519A29403 for ; Fri, 9 Mar 2018 04:22:10 +0000 (UTC) Received: from localhost ([::1]:43128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu9Xl-0000Y5-Bu for patchwork-qemu-devel@patchwork.kernel.org; Thu, 08 Mar 2018 23:22:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu9QF-0003up-90 for qemu-devel@nongnu.org; Thu, 08 Mar 2018 23:14:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu9QE-0006rP-AU for qemu-devel@nongnu.org; Thu, 08 Mar 2018 23:14:23 -0500 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:34296) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu9QE-0006r7-4U for qemu-devel@nongnu.org; Thu, 08 Mar 2018 23:14:22 -0500 Received: by mail-pg0-x244.google.com with SMTP id m19so3123360pgn.1 for ; Thu, 08 Mar 2018 20:14:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5Jmt2S7tGiJkpXUze54sFFbw21q2mcZOIxdqngTr56M=; b=bi3U0s04hM2pFzbPdbi6a4jKUVo8pHsAke0H0mk5y7W9LjCz/H8luI3aUsDOaOu3rl 3O4o1bgA/b8dpYoptWzUuFe+lrITCfb3YX9AHwLqaKG0yQ7vsufzFR+gNEVTfxZjacVX NPG2whvviCN9bnjnBGoBny09FJj8vK4VS+Lb0V7JvU1i6yn4UBYLxPsZhTX0atPGy1Li EvDSHzQMzPnBqxr3/u4sCYY1J5LibXMYTjWc3Yp7Qntz5KowJX6xUp7IgevWCdTouXIi OAGaJq7ZZYEOkfCkdvdMt3UGqPjnDbh2Oxzpnnc275MVS9lloXbbC5/Ls4LM4Fmra96v Xolw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5Jmt2S7tGiJkpXUze54sFFbw21q2mcZOIxdqngTr56M=; b=VpkMYeiE3XoSnwv79S8OsNfh719PoeBnFwPDHuAuv/85pZhSPyQ6yapK9lR1Oh1sx1 NM/T81QOousYuHY/fRHW8l10lWBjk023QSBchFfI+x/dbpKayoctIJI2W10om/q21wZl S4i0r82QLKvs0lT1xSS5yDJZnCJYwEtmBeo9JSYNBlSg2lut7p68OVdYbz7pAy57u795 yZF150VQrejEO3uQbF0jR+t0ePSRzN/ah7GRxWepWWsAHboKcsvqvSIEeDrhjCag9qUE aN51QD/DpA0+YXUfiICqqc/ApmCjnnQvntnJtdOq9As9mjN9YGuCfL9k2xR5n4yJ1jpN /aPg== X-Gm-Message-State: APf1xPBTY7YeFUoVx9qy0JHguYoFS61fOe17qmxQa7rOosI10N4/s0HF kKCLQ/R1cx4pBGl67QiQaaxwiOp9dik= X-Google-Smtp-Source: AG47ELutCRPHp3HuJybdzIwNW7daD5QlByWISvrQpGbzy+gRkiEiKjkue5//jw0E6ZfmDP8R9Fam+Q== X-Received: by 10.98.72.204 with SMTP id q73mr28772142pfi.48.1520568861177; Thu, 08 Mar 2018 20:14:21 -0800 (PST) Received: from localhost.localdomain (125-237-39-90-fibre.bb.spark.co.nz. [125.237.39.90]) by smtp.gmail.com with ESMTPSA id h15sm334141pfi.56.2018.03.08.20.14.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Mar 2018 20:14:20 -0800 (PST) From: Michael Clark To: qemu-devel@nongnu.org Date: Fri, 9 Mar 2018 17:12:26 +1300 Message-Id: <1520568765-58189-5-git-send-email-mjc@sifive.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1520568765-58189-1-git-send-email-mjc@sifive.com> References: <1520568765-58189-1-git-send-email-mjc@sifive.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::244 Subject: [Qemu-devel] [PATCH v2 04/23] RISC-V: Use ROM base address and size from memmap X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bastian Koppelmann , Michael Clark , Palmer Dabbelt , Sagar Karandikar Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Another case of replaceing hard coded constants, this time referring to the definition in the virt machine's memmap. Cc: Sagar Karandikar Cc: Bastian Koppelmann Signed-off-by: Michael Clark Signed-off-by: Palmer Dabbelt Reviewed-by: Philippe Mathieu-Daudé --- hw/riscv/virt.c | 4 ++-- include/hw/riscv/virt.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 0055439..0d101fc 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -338,11 +338,11 @@ static void riscv_virt_board_init(MachineState *machine) }; /* copy in the reset vector */ - copy_le32_to_phys(ROM_BASE, reset_vec, sizeof(reset_vec)); + copy_le32_to_phys(memmap[VIRT_MROM].base, reset_vec, sizeof(reset_vec)); /* copy in the device tree */ qemu_fdt_dumpdtb(s->fdt, s->fdt_size); - cpu_physical_memory_write(ROM_BASE + sizeof(reset_vec), + cpu_physical_memory_write(memmap[VIRT_MROM].base + sizeof(reset_vec), s->fdt, s->fdt_size); /* create PLIC hart topology configuration string */ diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h index 2fbe808..655e85d 100644 --- a/include/hw/riscv/virt.h +++ b/include/hw/riscv/virt.h @@ -23,8 +23,6 @@ #define VIRT(obj) \ OBJECT_CHECK(RISCVVirtState, (obj), TYPE_RISCV_VIRT_BOARD) -enum { ROM_BASE = 0x1000 }; - typedef struct { /*< private >*/ SysBusDevice parent_obj;