Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
47 changes: 1 addition & 46 deletions Documentation/platforms/risc-v/k210/boards/maix-bit/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
==============

Expand Down
4 changes: 2 additions & 2 deletions arch/risc-v/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions arch/risc-v/include/k210/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
8 changes: 0 additions & 8 deletions arch/risc-v/src/k210/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 0 additions & 4 deletions arch/risc-v/src/k210/hardware/k210_memorymap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions arch/risc-v/src/k210/k210_clockconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -81,15 +80,13 @@ uint32_t k210_get_pll0clk(void)

return OSC_FREQ / nr * nf / od;
}
#endif

/****************************************************************************
* Name: k210_clockconfig
****************************************************************************/

void k210_clockconfig(void)
{
#ifndef CONFIG_K210_WITH_QEMU
uint32_t clksel0;
uint32_t div;

Expand Down Expand Up @@ -133,5 +130,4 @@ void k210_clockconfig(void)
/* Workaround for stabilization */

up_udelay(1);
#endif
}
4 changes: 0 additions & 4 deletions arch/risc-v/src/k210/k210_timerisr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion boards/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading