This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit fc2d853c1d1724a6895b43e8a14947d418d58c23
Author: Saravanan Sekar <[email protected]>
AuthorDate: Sat Oct 31 18:32:15 2026 +0530

    Documentation: add RH850 and qemu-rh850-u2c.
    
    Add the pages for the RH850 architecture, the RH850/U2C chip and the
    qemu-rh850-u2c board.
    
    Signed-off-by: Saravanan Sekar <[email protected]>
    Signed-off-by: Parthiban Nallathambi <[email protected]>
---
 Documentation/platforms/rh850/index.rst            | 29 +++++++
 .../rh850/u2c/boards/qemu-rh850-u2c/index.rst      | 93 ++++++++++++++++++++++
 Documentation/platforms/rh850/u2c/index.rst        | 44 ++++++++++
 3 files changed, 166 insertions(+)

diff --git a/Documentation/platforms/rh850/index.rst 
b/Documentation/platforms/rh850/index.rst
new file mode 100644
index 00000000000..b68de64254b
--- /dev/null
+++ b/Documentation/platforms/rh850/index.rst
@@ -0,0 +1,29 @@
+=====
+RH850
+=====
+
+.. tags:: arch:rh850, vendor:renesas
+
+The RH850 port runs NuttX on the Renesas RH850 family with its G4KH CPU core
+(V850E3v5 instruction set, RH850 ABI).  Sources are in ``arch/rh850``.
+
+arch/rh850/src/common/ Directory
+================================
+
+Logic common to all RH850 chips: reset entry and vector table, exception frame
+save and restore, the TRAP 0 system call used for context switches, EIINT
+interrupt entry with interrupt nesting, CPU exception reporting, stacks, 
signals
+and the idle loop.
+
+Chip-Specific Directories
+=========================
+
+``u2c``
+  The RH850/U2C (R7F702600) chip: clock and standby control, the INTC1/INTC2
+  interrupt controllers, the OSTM0 system timer and the RLIN3 UART.
+
+.. toctree::
+   :maxdepth: 1
+   :glob:
+
+   */*
diff --git a/Documentation/platforms/rh850/u2c/boards/qemu-rh850-u2c/index.rst 
b/Documentation/platforms/rh850/u2c/boards/qemu-rh850-u2c/index.rst
new file mode 100644
index 00000000000..6d915e281c6
--- /dev/null
+++ b/Documentation/platforms/rh850/u2c/boards/qemu-rh850-u2c/index.rst
@@ -0,0 +1,93 @@
+==============
+qemu-rh850-u2c
+==============
+
+.. tags:: arch:rh850, chip:u2c, vendor:renesas
+
+This board runs NuttX on the QEMU ``rh850-u2c`` machine, which models the
+RH850/U2C8 (R7F702600) CPU0 with code flash at 0x00000000, local RAM at
+0xFDC00000, INTC1/INTC2, OSTM0 and RLIN311 (serial0).
+
+Toolchain
+=========
+
+The ``v850-elf`` GCC toolchain (GCC 14, ``-mv850e3v5 -mrh850-abi``) is used.  A
+prebuilt Linux x86_64 toolchain is available as a release asset::
+
+  $ curl -L -O 
https://github.com/linumiz/rh850-gcc-toolchain/releases/download/v1.2.0/v850-elf-toolchain-linux-x86_64.tar.gz
+  $ mkdir -p v850-elf-gcc
+  $ tar -C v850-elf-gcc -xzf v850-elf-toolchain-linux-x86_64.tar.gz
+  $ export PATH=$PWD/v850-elf-gcc/bin:$PATH
+
+The toolchain may also come with the Zephyr SDK later.
+
+QEMU
+====
+
+``qemu-system-rh850`` is not in upstream QEMU yet.  A prebuilt Linux x86_64
+binary is available as a release asset::
+
+  $ curl -L -O 
https://github.com/linumiz/qemu-rh850/releases/download/rh850-v1.2.0/qemu-rh850-linux-x86_64.tar.gz
+  $ mkdir -p qemu-rh850
+  $ tar -C qemu-rh850 -xzf qemu-rh850-linux-x86_64.tar.gz
+  $ export PATH=$PWD/qemu-rh850/bin:$PATH
+
+Both release binaries run on x86_64 Linux with glibc 2.35 or later (Ubuntu
+22.04 and 24.04) and need these runtime packages: ``libexpat1``,
+``libncursesw6`` and ``libstdc++6`` (GDB) and ``libglib2.0-0`` on Ubuntu 22.04
+or ``libglib2.0-0t64`` on Ubuntu 24.04 (QEMU).
+
+Configurations
+==============
+
+Each configuration is selected with::
+
+  $ ./tools/configure.sh qemu-rh850-u2c:<subdir>
+
+nsh
+---
+
+NuttShell on the RLIN311 console, ticked system timer.
+
+Building
+========
+
+Make::
+
+  $ ./tools/configure.sh qemu-rh850-u2c:nsh
+  $ make -j$(nproc)
+
+CMake::
+
+  $ cmake -B build -DBOARD_CONFIG=qemu-rh850-u2c:nsh -GNinja
+  $ cmake --build build
+
+Running
+=======
+
+::
+
+  $ qemu-system-rh850 -M rh850-u2c,test-exit=on -icount shift=4,sleep=on \
+      -nographic -kernel nuttx
+
+- ``-icount shift=4,sleep=on`` runs 16 ns per instruction with virtual time
+  following host time while the CPU is in HALT.  ``CONFIG_BOARD_LOOPSPERMSEC``
+  (8906) is calibrated for this setting.
+- ``test-exit=on`` maps the test-exit device at 0x40000000.  
``board_power_off``
+  writes 0x5555 (exit code 0) or ``(status << 16) | 0x3333`` (exit code
+  ``status``).  With ``CONFIG_QEMU_RH850_U2C_TEST_EXIT``, ``board_reset``
+  with a non-zero status, the PANIC path with
+  ``CONFIG_BOARD_RESET_ON_ASSERT``, ends QEMU with that status.
+- ``board_reset`` otherwise, and ``reboot`` in NSH, start a software system
+  reset through SWSRESA: the machine restarts from the reset vector.
+- ``-M rh850-u2c,clk-hsb=<Hz>`` changes the OSTM clock (default 20 MHz); set
+  ``CONFIG_RH850_CLK_HSB_FREQUENCY`` to the same value.
+
+Limitations
+===========
+
+- Tested on QEMU only; silicon is untested.
+- Local RAM keeps its content over a reset in QEMU; on silicon its value
+  after a reset is not guaranteed.
+- No MPU, no protected or kernel build, no user mode.
+- CPU exceptions always panic.
diff --git a/Documentation/platforms/rh850/u2c/index.rst 
b/Documentation/platforms/rh850/u2c/index.rst
new file mode 100644
index 00000000000..ee810908885
--- /dev/null
+++ b/Documentation/platforms/rh850/u2c/index.rst
@@ -0,0 +1,44 @@
+=========
+RH850/U2C
+=========
+
+.. tags:: arch:rh850, chip:u2c, vendor:renesas
+
+**RH850/U2C** (R7F702600, G4KH core) is supported in a flat build with these
+features:
+
+- Runs in supervisor mode with the FPU enabled (``-msoft-float`` builds with
+  ``CONFIG_ARCH_FPU=n``).
+- Interrupts are managed by INTC1 and INTC2 with the direct vector method and
+  16 priority levels.  Interrupts of a higher priority nest; ISPR holds
+  requests of equal and lower priority until the handler returns.
+- OSTM0 in free-run compare mode is the system timer through the oneshot
+  lower half (``arch_alarm``), ticked or tickless.
+- RLIN311 in UART mode is the console, with receive and transmit interrupts.
+- CPU exceptions (EI and FE level) print the cause and the registers, then
+  panic.
+
+This port has been tested on QEMU only:
+
+- ``qemu-rh850-u2c``: the QEMU ``rh850-u2c`` machine.
+
+Peripheral Support
+==================
+
+==========  =======  ===============================
+Peripheral  Support  Notes
+==========  =======  ===============================
+INTC1/2     Yes      Priorities 0-15, nesting
+OSTM0       Yes      System timer
+RLIN3       Yes      RLIN311 UART console
+Others      No
+==========  =======  ===============================
+
+Supported Boards
+================
+
+.. toctree::
+   :glob:
+   :maxdepth: 1
+
+   boards/*/*

Reply via email to