You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2026/03/23 06:25:36 UTC
(nuttx) branch master updated: arch/risc-v/k210: Remove QEMU support
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 864fdb090c9 arch/risc-v/k210: Remove QEMU support
864fdb090c9 is described below
commit 864fdb090c9593bc7f4b92e7fc3fd19b027166ad
Author: Huang Qi <hu...@xiaomi.com>
AuthorDate: Sun Mar 22 14:09:18 2026 +0800
arch/risc-v/k210: Remove QEMU support
Remove the CONFIG_K210_WITH_QEMU option and associated conditional
code paths. The reasons for removal are:
* Simplifies code path for real hardware by removing QEMU workarounds
* The current QEMU target uses sifive_u machine, which is not designed
for K210 emulation
* For RISC-V QEMU simulation, the qemu-rv (rv-virt) target is a better
choice
* Renode can be used as an alternative for K210 simulation if needed
Signed-off-by: Huang Qi <hu...@xiaomi.com>
---
.github/CODEOWNERS | 1 -
.../risc-v/k210/boards/maix-bit/index.rst | 47 +---------------------
arch/risc-v/Kconfig | 4 +-
arch/risc-v/include/k210/irq.h | 4 --
arch/risc-v/src/k210/Kconfig | 8 ----
arch/risc-v/src/k210/hardware/k210_memorymap.h | 4 --
arch/risc-v/src/k210/k210_clockconfig.c | 4 --
arch/risc-v/src/k210/k210_timerisr.c | 4 --
boards/Kconfig | 2 +-
9 files changed, 4 insertions(+), 74 deletions(-)
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 4acd4715ba9..af9aa333479 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -687,7 +687,6 @@ Documentation/platforms/risc-v/hpm6750/index.rst raiden00@railab.me
Documentation/platforms/risc-v/index.rst matias@protobits.dev
Documentation/platforms/risc-v/jh7110/boards/star64/index.rst luppy@appkaki.com
Documentation/platforms/risc-v/jh7110/index.rst luppy@appkaki.com
-Documentation/platforms/risc-v/k210/boards/maix-bit/README-qemu.txt raiden00@railab.me
Documentation/platforms/risc-v/k210/boards/maix-bit/README.txt raiden00@railab.me
Documentation/platforms/risc-v/k210/boards/maix-bit/index.rst raiden00@railab.me
Documentation/platforms/risc-v/k210/index.rst raiden00@railab.me
diff --git a/Documentation/platforms/risc-v/k210/boards/maix-bit/index.rst b/Documentation/platforms/risc-v/k210/boards/maix-bit/index.rst
index 8ab90c7e9b8..83bb368ab9b 100644
--- a/Documentation/platforms/risc-v/k210/boards/maix-bit/index.rst
+++ b/Documentation/platforms/risc-v/k210/boards/maix-bit/index.rst
@@ -30,7 +30,7 @@ Features
.. todo::
- If you are intersted in using this board, please consider contributing
+ If you are interested in using this board, please consider contributing
implementations for the above missing features.
Installation
@@ -77,51 +77,6 @@ Write ``nuttx.bin`` to SPI-Flash:
The ``kflash_gui`` is not recommended because it's unstable.
-QEMU Process
-============
-
-In order to run this board's version of NuttX on QEMU, make the following
-adjustments:
-
-QEMU Installation
------------------
-
-Installing and building QEMU can be done with:
-
-.. code:: console
-
- $ git clone https://github.com/qemu/qemu
- $ cd qemu
- $ ./configure --target-list=riscv64-softmmu
- $ make
- $ sudo make install
-
-Building NuttX for QEMU
------------------------
-
-Building NuttX follows the same process, but you will need to modify your chosen
-configuration to include the option ``CONFIG_K210_WITH_QEMU=y``.
-
-Running on QEMU
----------------
-
-Run the following:
-
-.. code:: console
-
- $ qemu-system-riscv64 -nographic -machine sifive_u -bios ./nuttx
-
-
-.. note::
-
- To run Nuttx for kostest, ``gdb`` needs to be used to load both
- ``nuttx_user.elf`` and ``nuttx``.
-
- .. code:: console
-
- $ qemu-system-riscv64 -nographic -machine sifive_u -s -S
- $ riscv64-unknown-elf-gdb -ex 'target extended-remote:1234' -ex 'load nuttx_user.elf' -ex 'load nuttx' -ex 'c'
-
Configurations
==============
diff --git a/arch/risc-v/Kconfig b/arch/risc-v/Kconfig
index 3dfdd26ec09..e7446507a96 100644
--- a/arch/risc-v/Kconfig
+++ b/arch/risc-v/Kconfig
@@ -29,8 +29,8 @@ config ARCH_CHIP_K210
select ARCH_RV_ISA_M
select ARCH_RV_ISA_A
select ARCH_RV_ISA_C
- select ARCH_HAVE_FPU if !K210_WITH_QEMU
- select ARCH_HAVE_DPFPU if !K210_WITH_QEMU
+ select ARCH_HAVE_FPU
+ select ARCH_HAVE_DPFPU
select ARCH_HAVE_MPU
select ARCH_HAVE_TESTSET
select ARCH_HAVE_MULTICPU
diff --git a/arch/risc-v/include/k210/irq.h b/arch/risc-v/include/k210/irq.h
index 728da5b5fa6..c2aa5194900 100644
--- a/arch/risc-v/include/k210/irq.h
+++ b/arch/risc-v/include/k210/irq.h
@@ -33,13 +33,9 @@
/* Map RISC-V exception code to NuttX IRQ */
-#ifdef CONFIG_K210_WITH_QEMU
-#define K210_IRQ_UART0 (RISCV_IRQ_MEXT + 4)
-#else
#define K210_IRQ_WDT0 (RISCV_IRQ_MEXT + 21)
#define K210_IRQ_WDT1 (RISCV_IRQ_MEXT + 22)
#define K210_IRQ_UART0 (RISCV_IRQ_MEXT + 33)
-#endif
/* Total number of IRQs */
diff --git a/arch/risc-v/src/k210/Kconfig b/arch/risc-v/src/k210/Kconfig
index 385fc6843c4..74b3411c8bc 100644
--- a/arch/risc-v/src/k210/Kconfig
+++ b/arch/risc-v/src/k210/Kconfig
@@ -50,11 +50,3 @@ config K210_CPU_FREQ
Set the K210 CPU target frequency in Hz.
Default is 400000000 (400 MHz).
Valid range: 40000000-600000000 Hz (40-600 MHz).
-
-menu "K210 Others"
-
-config K210_WITH_QEMU
- bool "qemu support"
- default n
-
-endmenu
diff --git a/arch/risc-v/src/k210/hardware/k210_memorymap.h b/arch/risc-v/src/k210/hardware/k210_memorymap.h
index 59f6ab15a17..2ef0db1827a 100644
--- a/arch/risc-v/src/k210/hardware/k210_memorymap.h
+++ b/arch/risc-v/src/k210/hardware/k210_memorymap.h
@@ -32,11 +32,7 @@
#define K210_CLINT_BASE 0x02000000
#define K210_PLIC_BASE 0x0c000000
-#ifdef CONFIG_K210_WITH_QEMU
-#define K210_UART0_BASE 0x10010000
-#else
#define K210_UART0_BASE 0x38000000
-#endif
#define K210_GPIOHS_BASE 0x38001000
#define K210_FPIOA_BASE 0x502B0000
diff --git a/arch/risc-v/src/k210/k210_clockconfig.c b/arch/risc-v/src/k210/k210_clockconfig.c
index b911cd3d4b6..0cd68f10cec 100644
--- a/arch/risc-v/src/k210/k210_clockconfig.c
+++ b/arch/risc-v/src/k210/k210_clockconfig.c
@@ -66,7 +66,6 @@ uint32_t k210_get_cpuclk(void)
* Name: k210_get_pll0clk
****************************************************************************/
-#ifndef CONFIG_K210_WITH_QEMU
uint32_t k210_get_pll0clk(void)
{
uint32_t pll0;
@@ -81,7 +80,6 @@ uint32_t k210_get_pll0clk(void)
return OSC_FREQ / nr * nf / od;
}
-#endif
/****************************************************************************
* Name: k210_clockconfig
@@ -89,7 +87,6 @@ uint32_t k210_get_pll0clk(void)
void k210_clockconfig(void)
{
-#ifndef CONFIG_K210_WITH_QEMU
uint32_t clksel0;
uint32_t div;
@@ -133,5 +130,4 @@ void k210_clockconfig(void)
/* Workaround for stabilization */
up_udelay(1);
-#endif
}
diff --git a/arch/risc-v/src/k210/k210_timerisr.c b/arch/risc-v/src/k210/k210_timerisr.c
index 514e29065c8..066663721bd 100644
--- a/arch/risc-v/src/k210/k210_timerisr.c
+++ b/arch/risc-v/src/k210/k210_timerisr.c
@@ -46,11 +46,7 @@
* Pre-processor Definitions
****************************************************************************/
-#ifdef CONFIG_K210_WITH_QEMU
-#define MTIMER_FREQ 1000000
-#else
#define MTIMER_FREQ (k210_get_cpuclk() / 50)
-#endif
/****************************************************************************
* Public Functions
diff --git a/boards/Kconfig b/boards/Kconfig
index 0ae1906040d..b67776a957f 100644
--- a/boards/Kconfig
+++ b/boards/Kconfig
@@ -1116,7 +1116,7 @@ config ARCH_BOARD_LX_CPU
config ARCH_BOARD_MAIX_BIT
bool "Sipeed Maix Bit board"
depends on ARCH_CHIP_K210
- select ARCH_HAVE_LEDS if !K210_WITH_QEMU
+ select ARCH_HAVE_LEDS
---help---
This is the board configuration for the port of NuttX to the
Sipeed Maix Bit board. This board features the RISC-V K210