From nobody Sun May 5 22:17:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629991282536858.1827481659303; Thu, 26 Aug 2021 08:21:22 -0700 (PDT) Received: from localhost ([::1]:52480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJHBx-0001qo-H5 for importer@patchew.org; Thu, 26 Aug 2021 11:21:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49562) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJH7a-0002j5-Nz; Thu, 26 Aug 2021 11:16:50 -0400 Received: from atcsqr.andestech.com ([60.248.187.195]:22686) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJH7X-0002HT-FO; Thu, 26 Aug 2021 11:16:49 -0400 Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id 17QFDZ6k022016; Thu, 26 Aug 2021 23:13:35 +0800 (GMT-8) (envelope-from ruinland@andestech.com) Received: from atcfdc88.andestech.com (10.0.15.120) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.498.0; Thu, 26 Aug 2021 23:13:36 +0800 From: Ruinland Chuan-Tzu Tsai To: , , , , Subject: [RFC PATCH 1/2] Adding Kconfig options for custom CSR support and Andes CPU model Date: Thu, 26 Aug 2021 23:13:31 +0800 Message-ID: <20210826151332.32753-2-ruinland@andestech.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20210826151332.32753-1-ruinland@andestech.com> References: <20210826151332.32753-1-ruinland@andestech.com> MIME-Version: 1.0 X-Originating-IP: [10.0.15.120] X-DNSRBL: X-MAIL: ATCSQR.andestech.com 17QFDZ6k022016 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=60.248.187.195; envelope-from=ruinland@andestech.com; helo=ATCSQR.andestech.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Cc: Ruinland ChuanTzu Tsai , dylan@andestech.com, imruinland.cs00@g2.nctu.edu.tw, alankao@andestech.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1629991283207100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ruinland ChuanTzu Tsai Introduce Kconfig to target/riscv/Kconfig. RISCV_CUSTOM_CSR will be toggled if ANDES_CORE is selected. We need to modify meson.build for handling linux-user in a reasonable way. Otherwise, all Kconfig options goes into *-config-devices.h which won't be accessible for linux-user mode. --- Kconfig | 1 + meson.build | 26 ++++++++++++++++++++++++++ target/riscv/Kconfig | 6 ++++++ 3 files changed, 33 insertions(+) create mode 100644 target/riscv/Kconfig diff --git a/Kconfig b/Kconfig index bf694c4..d2cc9c7 100644 --- a/Kconfig +++ b/Kconfig @@ -2,3 +2,4 @@ source Kconfig.host source backends/Kconfig source accel/Kconfig source hw/Kconfig +source ./target/riscv/Kconfig diff --git a/meson.build b/meson.build index 736810e..8a8413d 100644 --- a/meson.build +++ b/meson.build @@ -1315,7 +1315,33 @@ foreach target : target_dirs endif endforeach =20 + config_target_data =3D configuration_data() + + #Parse RISC-V custom definitions in advance. FIXME: rewrite core detecti= on + if config_target['TARGET_BASE_ARCH'] =3D=3D 'riscv' + config_riscv_custom_mak =3D 'riscv-custom-' + target + '-config-target= .mak' + config_riscv_custom_mak =3D configure_file( + input: ['default-configs/targets/rv_custom' / target + '.mak', 'Kcon= fig'], + output: config_riscv_custom_mak, + depfile: config_riscv_custom_mak + '.d', + capture: true, + command: [minikconf, + get_option('default_devices') ? '--defconfig' : '--allnoco= nfig', + config_riscv_custom_mak, '@DEPFILE@', '@INPUT@', + host_kconfig, accel_kconfig]) + + rvcustom_parse =3D keyval.load(config_riscv_custom_mak) + foreach k, v : rvcustom_parse + if k =3D=3D 'CONFIG_RISCV_CUSTOM_CSR' + config_target_data.set(k, 1) + endif + if k =3D=3D 'CONFIG_ANDES_CORE' + config_target_data.set(k, 1) + endif + endforeach + endif + foreach k, v: config_target if not k.startswith('TARGET_') and not k.startswith('CONFIG_') # do nothing diff --git a/target/riscv/Kconfig b/target/riscv/Kconfig new file mode 100644 index 0000000..a0b09aa --- /dev/null +++ b/target/riscv/Kconfig @@ -0,0 +1,6 @@ +config RISCV_CUSTOM_CSR + bool +config ANDES_CORE + bool + select RISCV_CUSTOM_CSR + default n --=20 2.32.0 From nobody Sun May 5 22:17:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629991158913332.35390255555524; Thu, 26 Aug 2021 08:19:18 -0700 (PDT) Received: from localhost ([::1]:46302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJH9x-00067L-TH for importer@patchew.org; Thu, 26 Aug 2021 11:19:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJH7a-0002jE-RP; Thu, 26 Aug 2021 11:16:50 -0400 Received: from atcsqr.andestech.com ([60.248.187.195]:22684) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJH7X-0002Gy-F1; Thu, 26 Aug 2021 11:16:50 -0400 Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id 17QFDeJr022151; Thu, 26 Aug 2021 23:13:41 +0800 (GMT-8) (envelope-from ruinland@andestech.com) Received: from atcfdc88.andestech.com (10.0.15.120) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.498.0; Thu, 26 Aug 2021 23:13:41 +0800 From: Ruinland Chuan-Tzu Tsai To: , , , , Subject: [RFC PATCH 2/2] Adding necessary files for Andes platforms, cores to enable custom CSR support Date: Thu, 26 Aug 2021 23:13:32 +0800 Message-ID: <20210826151332.32753-3-ruinland@andestech.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20210826151332.32753-1-ruinland@andestech.com> References: <20210826151332.32753-1-ruinland@andestech.com> MIME-Version: 1.0 X-Originating-IP: [10.0.15.120] X-DNSRBL: X-MAIL: ATCSQR.andestech.com 17QFDeJr022151 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=60.248.187.195; envelope-from=ruinland@andestech.com; helo=ATCSQR.andestech.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Cc: Ruinland ChuanTzu Tsai , dylan@andestech.com, imruinland.cs00@g2.nctu.edu.tw, alankao@andestech.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1629991161178100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ruinland ChuanTzu Tsai Since Andes A25/AX25 is an extented "target" to existing, we suggest that i= f a vendor flavored RISC-V platform or core is presented, it could utilize the fact that `configure` the way how a "target" is defined by making correspon= ding mak files. `rv_custom` is presented for the mere use that the `meson.build` uses minikconf to parse `default-configs/devices/*.mak`, we want to use minimize the change of logics. --- .../devices/riscv32-andes-softmmu.mak | 17 +++++++++++++++++ .../devices/riscv64-andes-softmmu.mak | 17 +++++++++++++++++ .../targets/riscv32-andes-linux-user.mak | 1 + .../targets/riscv32-andes-softmmu.mak | 1 + .../targets/riscv64-andes-linux-user.mak | 1 + .../targets/riscv64-andes-softmmu.mak | 1 + default-configs/targets/rv_custom/no_custom.mak | 0 .../rv_custom/riscv32-andes-linux-user.mak | 1 + .../targets/rv_custom/riscv32-andes-softmmu.mak | 1 + .../targets/rv_custom/riscv32-linux-user.mak | 1 + .../targets/rv_custom/riscv32-softmmu.mak | 1 + .../rv_custom/riscv64-andes-linux-user.mak | 1 + .../targets/rv_custom/riscv64-andes-softmmu.mak | 1 + .../targets/rv_custom/riscv64-linux-user.mak | 1 + .../targets/rv_custom/riscv64-softmmu.mak | 1 + 15 files changed, 46 insertions(+) create mode 100644 default-configs/devices/riscv32-andes-softmmu.mak create mode 100644 default-configs/devices/riscv64-andes-softmmu.mak create mode 120000 default-configs/targets/riscv32-andes-linux-user.mak create mode 120000 default-configs/targets/riscv32-andes-softmmu.mak create mode 120000 default-configs/targets/riscv64-andes-linux-user.mak create mode 120000 default-configs/targets/riscv64-andes-softmmu.mak create mode 100644 default-configs/targets/rv_custom/no_custom.mak create mode 100644 default-configs/targets/rv_custom/riscv32-andes-linux-u= ser.mak create mode 100644 default-configs/targets/rv_custom/riscv32-andes-softmmu= .mak create mode 120000 default-configs/targets/rv_custom/riscv32-linux-user.mak create mode 120000 default-configs/targets/rv_custom/riscv32-softmmu.mak create mode 100644 default-configs/targets/rv_custom/riscv64-andes-linux-u= ser.mak create mode 100644 default-configs/targets/rv_custom/riscv64-andes-softmmu= .mak create mode 120000 default-configs/targets/rv_custom/riscv64-linux-user.mak create mode 120000 default-configs/targets/rv_custom/riscv64-softmmu.mak diff --git a/default-configs/devices/riscv32-andes-softmmu.mak b/default-co= nfigs/devices/riscv32-andes-softmmu.mak new file mode 100644 index 0000000..8f2e781 --- /dev/null +++ b/default-configs/devices/riscv32-andes-softmmu.mak @@ -0,0 +1,17 @@ +# Default configuration for riscv32-softmmu + +# Uncomment the following lines to disable these optional devices: +# +#CONFIG_PCI_DEVICES=3Dn +CONFIG_SEMIHOSTING=3Dy +CONFIG_ARM_COMPATIBLE_SEMIHOSTING=3Dy + +# Boards: +# +CONFIG_ANDES_AE350=3Dy +CONFIG_SPIKE=3Dy +CONFIG_SIFIVE_E=3Dy +CONFIG_SIFIVE_U=3Dy +CONFIG_RISCV_VIRT=3Dy +CONFIG_OPENTITAN=3Dy +CONFIG_ANDES_CORE=3Dy diff --git a/default-configs/devices/riscv64-andes-softmmu.mak b/default-co= nfigs/devices/riscv64-andes-softmmu.mak new file mode 100644 index 0000000..7120cb8 --- /dev/null +++ b/default-configs/devices/riscv64-andes-softmmu.mak @@ -0,0 +1,17 @@ +# Default configuration for riscv64-softmmu + +# Uncomment the following lines to disable these optional devices: +# +#CONFIG_PCI_DEVICES=3Dn +CONFIG_SEMIHOSTING=3Dy +CONFIG_ARM_COMPATIBLE_SEMIHOSTING=3Dy + +# Boards: +# +CONFIG_ANDES_AE350=3Dy +CONFIG_SPIKE=3Dy +CONFIG_SIFIVE_E=3Dy +CONFIG_SIFIVE_U=3Dy +CONFIG_RISCV_VIRT=3Dy +CONFIG_MICROCHIP_PFSOC=3Dy +CONFIG_ANDES_CORE=3Dy diff --git a/default-configs/targets/riscv32-andes-linux-user.mak b/default= -configs/targets/riscv32-andes-linux-user.mak new file mode 120000 index 0000000..640a619 --- /dev/null +++ b/default-configs/targets/riscv32-andes-linux-user.mak @@ -0,0 +1 @@ +./riscv32-linux-user.mak \ No newline at end of file diff --git a/default-configs/targets/riscv32-andes-softmmu.mak b/default-co= nfigs/targets/riscv32-andes-softmmu.mak new file mode 120000 index 0000000..e806510 --- /dev/null +++ b/default-configs/targets/riscv32-andes-softmmu.mak @@ -0,0 +1 @@ +./riscv32-softmmu.mak \ No newline at end of file diff --git a/default-configs/targets/riscv64-andes-linux-user.mak b/default= -configs/targets/riscv64-andes-linux-user.mak new file mode 120000 index 0000000..01cefa0 --- /dev/null +++ b/default-configs/targets/riscv64-andes-linux-user.mak @@ -0,0 +1 @@ +./riscv64-linux-user.mak \ No newline at end of file diff --git a/default-configs/targets/riscv64-andes-softmmu.mak b/default-co= nfigs/targets/riscv64-andes-softmmu.mak new file mode 120000 index 0000000..ed1cae6 --- /dev/null +++ b/default-configs/targets/riscv64-andes-softmmu.mak @@ -0,0 +1 @@ +./riscv64-softmmu.mak \ No newline at end of file diff --git a/default-configs/targets/rv_custom/no_custom.mak b/default-conf= igs/targets/rv_custom/no_custom.mak new file mode 100644 index 0000000..e69de29 diff --git a/default-configs/targets/rv_custom/riscv32-andes-linux-user.mak= b/default-configs/targets/rv_custom/riscv32-andes-linux-user.mak new file mode 100644 index 0000000..984affb --- /dev/null +++ b/default-configs/targets/rv_custom/riscv32-andes-linux-user.mak @@ -0,0 +1 @@ +CONFIG_ANDES_CORE=3Dy diff --git a/default-configs/targets/rv_custom/riscv32-andes-softmmu.mak b/= default-configs/targets/rv_custom/riscv32-andes-softmmu.mak new file mode 100644 index 0000000..984affb --- /dev/null +++ b/default-configs/targets/rv_custom/riscv32-andes-softmmu.mak @@ -0,0 +1 @@ +CONFIG_ANDES_CORE=3Dy diff --git a/default-configs/targets/rv_custom/riscv32-linux-user.mak b/def= ault-configs/targets/rv_custom/riscv32-linux-user.mak new file mode 120000 index 0000000..073fa18 --- /dev/null +++ b/default-configs/targets/rv_custom/riscv32-linux-user.mak @@ -0,0 +1 @@ +./no_custom.mak \ No newline at end of file diff --git a/default-configs/targets/rv_custom/riscv32-softmmu.mak b/defaul= t-configs/targets/rv_custom/riscv32-softmmu.mak new file mode 120000 index 0000000..073fa18 --- /dev/null +++ b/default-configs/targets/rv_custom/riscv32-softmmu.mak @@ -0,0 +1 @@ +./no_custom.mak \ No newline at end of file diff --git a/default-configs/targets/rv_custom/riscv64-andes-linux-user.mak= b/default-configs/targets/rv_custom/riscv64-andes-linux-user.mak new file mode 100644 index 0000000..984affb --- /dev/null +++ b/default-configs/targets/rv_custom/riscv64-andes-linux-user.mak @@ -0,0 +1 @@ +CONFIG_ANDES_CORE=3Dy diff --git a/default-configs/targets/rv_custom/riscv64-andes-softmmu.mak b/= default-configs/targets/rv_custom/riscv64-andes-softmmu.mak new file mode 100644 index 0000000..984affb --- /dev/null +++ b/default-configs/targets/rv_custom/riscv64-andes-softmmu.mak @@ -0,0 +1 @@ +CONFIG_ANDES_CORE=3Dy diff --git a/default-configs/targets/rv_custom/riscv64-linux-user.mak b/def= ault-configs/targets/rv_custom/riscv64-linux-user.mak new file mode 120000 index 0000000..073fa18 --- /dev/null +++ b/default-configs/targets/rv_custom/riscv64-linux-user.mak @@ -0,0 +1 @@ +./no_custom.mak \ No newline at end of file diff --git a/default-configs/targets/rv_custom/riscv64-softmmu.mak b/defaul= t-configs/targets/rv_custom/riscv64-softmmu.mak new file mode 120000 index 0000000..073fa18 --- /dev/null +++ b/default-configs/targets/rv_custom/riscv64-softmmu.mak @@ -0,0 +1 @@ +./no_custom.mak \ No newline at end of file --=20 2.32.0