From patchwork Thu Jan 4 17:09:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antony Pavlov X-Patchwork-Id: 10145213 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 C98D3601A1 for ; Thu, 4 Jan 2018 17:07:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EFA528600 for ; Thu, 4 Jan 2018 17:07:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 941B228607; Thu, 4 Jan 2018 17:07: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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 E2C8528600 for ; Thu, 4 Jan 2018 17:07:09 +0000 (UTC) Received: from localhost ([::1]:51492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eX8yz-0007Rq-6y for patchwork-qemu-devel@patchwork.kernel.org; Thu, 04 Jan 2018 12:07:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eX8nU-00041z-T8 for qemu-devel@nongnu.org; Thu, 04 Jan 2018 11:55:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eX8nQ-0005pk-1C for qemu-devel@nongnu.org; Thu, 04 Jan 2018 11:55:16 -0500 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:43553) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eX8nP-0005oe-N9 for qemu-devel@nongnu.org; Thu, 04 Jan 2018 11:55:11 -0500 Received: by mail-lf0-x243.google.com with SMTP id o26so2421663lfc.10 for ; Thu, 04 Jan 2018 08:55:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=udq8mZlx3gIfmFkl0ZwxS8zLCu3uVgunJ+RYPDmd9Qs=; b=Wx5sVgN0ky3fIttQKHVOTOkkmPOalXlSjz2v3VaGp8axg6b8iLCf6b2ulfyDOHkxys VrytW+AC7dnPPapkHqXGB17zb58kEdMz43PDB/FiPkfKByQ4XP7hIm0TAVRjbgi9yiBe UqhanM3D2s52gG1ENk1qdmXnY2lCR4dZB9z9Wi7AmQ1kmE4pJO8Pl6TtahBl4mpcuYtD L94INb6D9X2I9y0jVmjfThmuBqlQHWwPF/BL/rcD0AQ5NPEcMj+6GchrqjvluTaKMAmp vCcgwSUTN0inuxe8x8g4fPiYlLbxNpgsDmR8oLvvvDuWrImIM2YYeUFFPnP2+z3mCs4s T/dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=udq8mZlx3gIfmFkl0ZwxS8zLCu3uVgunJ+RYPDmd9Qs=; b=ZfeNX4On0xj7yDViQ2BmAhAf9pSLBuRJUGjFctv8Nlw217a1JvkJglNe0GmOAJMRC3 /+b84s6zhTgLvVxqgSJDnBCyH9eRv4EGgWu9/p+iOqBaDE9RmAdUFF2hZ5V2yNV3VNmz 0AARKp6byIsA677VWwGJCt+x4Dhb/UWociQmHgqBX/jWzwGKDcsttjvHX7l13qg2LrwO e9167HJYgKoc+lRHj1ra2GhAV6zyDq8HroX+/pRjGiX7G2aRxc8KLpWzFylzz/K3luJc P0NG28PL3X2oI7sc2JuIfZUKTzggWsjf2XoLqfH+c2k0XwilkxouLuv9ftDeDdmynnlj uBhw== X-Gm-Message-State: AKwxytcAnuzoXJ45puLOwmy5st60SCQtDOeyVfWWrDdLsAC7RIhn1DKr r5B8M4+Yi6qaMdCR+RvCEow= X-Google-Smtp-Source: ACJfBou9Wn3C8KrTkt6mCjHYUcQ70lxS9YGeI160rr6+H/OarhzadTJcVVK+dLtAyXZ7MOSShygCaQ== X-Received: by 10.25.87.211 with SMTP id l202mr86165lfb.22.1515084910191; Thu, 04 Jan 2018 08:55:10 -0800 (PST) Received: from flare (t35.niisi.ras.ru. [193.232.173.35]) by smtp.gmail.com with ESMTPSA id f42sm708558lfi.18.2018.01.04.08.55.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jan 2018 08:55:09 -0800 (PST) Date: Thu, 4 Jan 2018 20:09:07 +0300 From: Antony Pavlov To: Michael Clark Message-Id: <20180104200907.7232a1e131af98e25931faa5@gmail.com> In-Reply-To: <1514940265-18093-22-git-send-email-mjc@sifive.com> References: <1514940265-18093-1-git-send-email-mjc@sifive.com> <1514940265-18093-22-git-send-email-mjc@sifive.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.25; i686-pc-linux-gnu) Mime-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::243 Subject: Re: [Qemu-devel] [PATCH v1 21/21] RISC-V Build Infrastructure 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 , qemu-devel@nongnu.org, Sagar Karandikar Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Wed, 3 Jan 2018 13:44:25 +1300 Michael Clark wrote: > This adds RISC-V into the build system enabling the following targets: > > - riscv32-softmmu > - riscv64-softmmu > - riscv32-linux-user > - riscv64-linux-user > ... > diff --git a/default-configs/riscv32-softmmu.mak b/default-configs/riscv32-softmmu.mak > new file mode 100644 > index 0000000..f9e7421 > --- /dev/null > +++ b/default-configs/riscv32-softmmu.mak > @@ -0,0 +1,4 @@ > +# Default configuration for riscv-softmmu > + > +CONFIG_SERIAL=y > +CONFIG_VIRTIO=y > diff --git a/default-configs/riscv64-linux-user.mak b/default-configs/riscv64-linux-user.mak > new file mode 100644 > index 0000000..865b362 > --- /dev/null > +++ b/default-configs/riscv64-linux-user.mak > @@ -0,0 +1 @@ > +# Default configuration for riscv-linux-user > diff --git a/default-configs/riscv64-softmmu.mak b/default-configs/riscv64-softmmu.mak > new file mode 100644 > index 0000000..f9e7421 > --- /dev/null > +++ b/default-configs/riscv64-softmmu.mak > @@ -0,0 +1,4 @@ > +# Default configuration for riscv-softmmu > + > +CONFIG_SERIAL=y > +CONFIG_VIRTIO=y > diff --git a/hw/riscv/Makefile.objs b/hw/riscv/Makefile.objs > new file mode 100644 > index 0000000..a0c31ae > --- /dev/null > +++ b/hw/riscv/Makefile.objs > @@ -0,0 +1,12 @@ > +obj-y += riscv_elf.o > +obj-y += riscv_htif.o > +obj-y += riscv_hart.o > +obj-y += sifive_e300.o > +obj-y += sifive_clint.o > +obj-y += sifive_prci.o > +obj-y += sifive_plic.o > +obj-y += sifive_u500.o > +obj-y += sifive_uart.o > +obj-y += spike_v1_09.o > +obj-y += spike_v1_10.o > +obj-y += virt.o According to https://www.sifive.com/products/freedom/ Freedom E300 Platform uses RV32IMAC Architecture and Freedom U500 Platform uses RV64GC Architecture. Which means that qemu-system-riscv32 has to have E300 support but not U500 support. qemu-system-riscv64 has to have U500 support but not E300 support. However please see this log: riscv-qemu$ ./riscv32-softmmu/qemu-system-riscv32 -M ? Supported machines are: none empty machine sifive_e300 RISC-V Board compatible with SiFive E300 SDK sifive_u500 RISC-V Board compatible with SiFive U500 SDK <<<<<< U500 in 32-bit mode spike_v1.10 RISC-V Spike Board (Privileged ISA v1.10) spike_v1.9 RISC-V Spike Board (Privileged ISA v1.9.1) (default) virt RISC-V VirtIO Board (Privileged spec v1.10) riscv-qemu$ ./riscv64-softmmu/qemu-system-riscv64 -M ? Supported machines are: none empty machine sifive_e300 RISC-V Board compatible with SiFive E300 SDK <<<<<< E300 in 64-bit mode sifive_u500 RISC-V Board compatible with SiFive U500 SDK spike_v1.10 RISC-V Spike Board (Privileged ISA v1.10) spike_v1.9 RISC-V Spike Board (Privileged ISA v1.9.1) (default) virt RISC-V VirtIO Board (Privileged spec v1.10) I propose at least this fixup: diff --git a/default-configs/riscv32-softmmu.mak b/default-configs/riscv32-softmmu.mak index f9e742120c..6a807f5f96 100644 --- a/default-configs/riscv32-softmmu.mak +++ b/default-configs/riscv32-softmmu.mak @@ -1,4 +1,5 @@ -# Default configuration for riscv-softmmu +# Default configuration for riscv32-softmmu CONFIG_SERIAL=y CONFIG_VIRTIO=y +CONFIG_SIFIVE_E300=y diff --git a/default-configs/riscv64-softmmu.mak b/default-configs/riscv64-softmmu.mak index f9e742120c..1a0349fe27 100644 --- a/default-configs/riscv64-softmmu.mak +++ b/default-configs/riscv64-softmmu.mak @@ -1,4 +1,5 @@ -# Default configuration for riscv-softmmu +# Default configuration for riscv64-softmmu CONFIG_SERIAL=y CONFIG_VIRTIO=y +CONFIG_SIFIVE_U500=y diff --git a/hw/riscv/Makefile.objs b/hw/riscv/Makefile.objs index a0c31ae25e..bac5faa603 100644 --- a/hw/riscv/Makefile.objs +++ b/hw/riscv/Makefile.objs @@ -1,11 +1,11 @@ obj-y += riscv_elf.o obj-y += riscv_htif.o obj-y += riscv_hart.o -obj-y += sifive_e300.o +obj-$(CONFIG_SIFIVE_E300) += sifive_e300.o obj-y += sifive_clint.o obj-y += sifive_prci.o obj-y += sifive_plic.o -obj-y += sifive_u500.o +obj-$(CONFIG_SIFIVE_U500) += sifive_u500.o obj-y += sifive_uart.o obj-y += spike_v1_09.o obj-y += spike_v1_10.o