This is an automated email from the ASF dual-hosted git repository. GUIDINGLI pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit bc8fda73a79c336fb492dafc5c2b221a17817291 Author: Hoa Bui <[email protected]> AuthorDate: Fri Nov 20 04:43:22 2026 +0000 Documentation/arm/rzv2h: Document I2C support Document the RIIC and SCI I2C drivers, their pin assignments and the riic-i2c and sci-i2c configurations for the Renesas RZV2H-EVK and RZV2H-RDK. Signed-off-by: Hoa Bui <[email protected]> --- .../platforms/arm/rzv2h/boards/rzv2h-evk/index.rst | 246 +++++++++++++++++++++ .../platforms/arm/rzv2h/boards/rzv2h-rdk/index.rst | 109 +++++++++ Documentation/platforms/arm/rzv2h/index.rst | 65 +++++- 3 files changed, 415 insertions(+), 5 deletions(-) diff --git a/Documentation/platforms/arm/rzv2h/boards/rzv2h-evk/index.rst b/Documentation/platforms/arm/rzv2h/boards/rzv2h-evk/index.rst index 2ac7e596ffc..cb43c4fb16a 100644 --- a/Documentation/platforms/arm/rzv2h/boards/rzv2h-evk/index.rst +++ b/Documentation/platforms/arm/rzv2h/boards/rzv2h-evk/index.rst @@ -373,6 +373,235 @@ devices in ascending hardware-channel order. Their TX and RX pin choices are board-specific and are defined by ``BOARD_SCIn_TXD_GPIO`` and ``BOARD_SCIn_RXD_GPIO`` in ``boards/arm/rzv2h/rzv2h-evk/include/board.h``. +RIIC I2C +======== + +The RZV2H-EVK exposes nine RIIC I2C master channels (RIIC0-RIIC8). + +RIIC Pin Assignments +-------------------- + +Each RIIC channel is routed to the following board pins. + +.. list-table:: + :header-rows: 1 + + * - Channel + - SCL Pin + - SDA Pin + * - RIIC0 + - ``P3_1`` + - ``P3_0`` + * - RIIC1 + - ``P3_3`` + - ``P3_2`` + * - RIIC2 + - ``P2_1`` + - ``P2_0`` + * - RIIC3 + - ``P3_7`` + - ``P3_6`` + * - RIIC4 + - ``P4_1`` + - ``P4_0`` + * - RIIC5 + - ``P4_3`` + - ``P4_2`` + * - RIIC6 + - ``P4_5`` + - ``P4_4`` + * - RIIC7 + - ``P4_7`` + - ``P4_6`` + * - RIIC8 + - ``P0_7`` + - ``P0_6`` + +These definitions are in ``boards/arm/rzv2h/rzv2h-evk/include/board.h``. + +Default Interrupt Select IDs +----------------------------- + +Each RIIC channel uses eight interrupt sources. TXI and RXI are routed +through the programmable INTC interrupt-select (SEL) lines; the remaining +six (TEI, NAKI, SPI, STI, ALI, TMOI) are fixed GIC interrupts. + +**TXI / RXI SEL IRQ numbers** (configurable via Kconfig, valid range +353-479): + +.. list-table:: + :header-rows: 1 + + * - Channel + - TXI SEL (GIC IRQ) + - RXI SEL (GIC IRQ) + * - RIIC0 + - 447 (SEL94) + - 446 (SEL93) + * - RIIC1 + - 445 (SEL92) + - 444 (SEL91) + * - RIIC2 + - 443 (SEL90) + - 442 (SEL89) + * - RIIC3 + - 441 (SEL88) + - 440 (SEL87) + * - RIIC4 + - 439 (SEL86) + - 438 (SEL85) + * - RIIC5 + - 437 (SEL84) + - 436 (SEL83) + * - RIIC6 + - 435 (SEL82) + - 434 (SEL81) + * - RIIC7 + - 433 (SEL80) + - 432 (SEL79) + * - RIIC8 + - 431 (SEL78) + - 430 (SEL77) + +The relevant options for enabling RIIC2 as an example are:: + + CONFIG_I2C=y + CONFIG_RZV2H_RIIC_I2C=y + CONFIG_RZV2H_RIIC2=y + CONFIG_I2C_RESET=y + CONFIG_SYSTEM_I2CTOOL=y + +Each channel has additional Kconfig options for bitrate, SCL rise/fall +times, duty cycle, noise filter stages, TXI/RXI interrupt-select (SEL) IRQ +numbers, and interrupt priority. + +After boot, enabled RIIC I2C channels are registered as ``/dev/i2cN`` +devices. +Verify with:: + + nsh> ls /dev + /dev: + console + i2c2 + null + zero + +The ``riic-i2c`` board configuration (``rzv2h-evk:riic-i2c``) enables +RIIC2 and the ``i2ctool`` application for interactive testing. Other +channels can be enabled by adding the corresponding ``CONFIG_RZV2H_RIICn`` +options. + +Using the ``i2ctool`` Application with RIIC +------------------------------------------- + +Scan for devices on bus 2 from address 0x00 to 0x20:: + + nsh> i2c dev -b 2 0 0x20 + +Get the register at address 0x2D from a device at address 0x1D on bus 2:: + + nsh> i2c get -b 2 -a 0x1D -r 0x2D + +Set value 0x08 to the register at address 0x2D of a device at address 0x1D +on bus 2:: + + nsh> i2c set -b 2 -a 0x1D -r 0x2D 0x08 + +Dump 6 consecutive bytes starting at register address 0x32 from a device at +address 0x1D on bus 2:: + + nsh> i2c dump -b 2 -a 0x1D -r 0x32 6 + +SCI I2C +======= + +The SCI channels listed below can run as I2C masters in simple I2C mode, +provided that the channel's SCI UART is disabled. SCI channel ``n`` is +registered as ``/dev/i2c<CONFIG_RZV2H_SCI_I2C_BUS_OFFSET + n>``. The +default offset is 10, so the SCI I2C buses do not overlap the RIIC I2C +buses. + +SCI I2C Pin Assignments +----------------------- + +SDA uses the TXDn pin and SCL uses the RXDn pin of each SCI channel. + +.. list-table:: + :header-rows: 1 + + * - Channel + - SDA Pin + - SCL Pin + * - SCI0 + - ``P5_0`` + - ``P5_1`` + * - SCI1 + - ``P5_2`` + - ``P5_3`` + * - SCI2 + - ``P5_4`` + - ``P5_5`` + * - SCI4 + - ``P8_4`` + - ``P8_5`` + * - SCI5 + - ``P7_2`` + - ``P7_3`` + * - SCI6 + - ``P7_4`` + - ``P7_5`` + * - SCI7 + - ``P7_6`` + - ``P7_7`` + * - SCI8 + - ``P8_0`` + - ``P8_1`` + * - SCI9 + - ``P8_2`` + - ``P8_3`` + +Configuration +------------- + +The relevant options for enabling SCI7 as an example are:: + + CONFIG_I2C=y + CONFIG_RZV2H_SCI_I2C=y + CONFIG_RZV2H_SCI_I2C7=y + CONFIG_I2C_RESET=y + CONFIG_SYSTEM_I2CTOOL=y + CONFIG_I2CTOOL_MAXBUS=19 + +``CONFIG_I2CTOOL_MAXBUS`` must be at least +``CONFIG_RZV2H_SCI_I2C_BUS_OFFSET`` plus the SCI channel number, or +``i2ctool`` rejects the bus number. + +Each channel has additional Kconfig options for bit rate, SDA output delay, +noise filter clock, bit-rate modulation, and interrupt priority. TXI and +TEI are fixed GIC interrupts, so SCI I2C has no interrupt-select (SEL) +options. + +After boot, verify that the channel is registered:: + + nsh> ls /dev + /dev: + ... + i2c17 + ... + +Using the ``i2ctool`` Application with SCI I2C +---------------------------------------------- + +The ``sci-i2c`` board configuration (``rzv2h-evk:sci-i2c``) enables +SCI7 and the ``i2ctool`` application. Use the same ``i2c`` commands as for +RIIC I2C, with the SCI I2C bus number:: + + nsh> i2c bus + nsh> i2c dev -b 17 0x03 0x77 + nsh> i2c get -b 17 -a 0x50 -r 0x00 + nsh> i2c set -b 17 -a 0x50 -r 0x10 0x5a + nsh> i2c reset -b 17 + QSPI Flash ========== @@ -544,6 +773,23 @@ active-low ``P0_0`` and ``P0_1`` LED outputs. The generic ``/dev/gpio1`` and testing. Automatic OS-status LED control through ``CONFIG_ARCH_LEDS`` is not yet implemented. +riic-i2c +-------- + +RIIC I2C configuration enabling RIIC2 with the +``i2ctool`` application for interactive bus scanning and device +read/write testing. The channel is registered as ``/dev/i2c2`` at boot. +Bus reset recovery (``CONFIG_I2C_RESET``) is enabled. + +sci-i2c +------- + +SCI I2C configuration enabling SCI channel 7 in simple I2C mode with the +``i2ctool`` application. The channel is registered as ``/dev/i2c17`` at +boot. SDA is on ``P7_6`` (CN3 pin 9) and SCL on ``P7_7`` (CN3 pin 10); +external pull-up resistors are required. Bus reset recovery +(``CONFIG_I2C_RESET``) is enabled. RIIC is not enabled. + nsh-xspi -------- diff --git a/Documentation/platforms/arm/rzv2h/boards/rzv2h-rdk/index.rst b/Documentation/platforms/arm/rzv2h/boards/rzv2h-rdk/index.rst index 42c042b33b1..ffca9c2725f 100644 --- a/Documentation/platforms/arm/rzv2h/boards/rzv2h-rdk/index.rst +++ b/Documentation/platforms/arm/rzv2h/boards/rzv2h-rdk/index.rst @@ -259,6 +259,106 @@ devices in ascending hardware-channel order. Their TX and RX pin choices are board-specific and are defined by ``BOARD_SCIn_TXD_GPIO`` and ``BOARD_SCIn_RXD_GPIO`` in ``boards/arm/rzv2h/rzv2h-rdk/include/board.h``. +SCI I2C +======= + +The SCI channels listed below can run as I2C masters in simple I2C mode. +SCI channel ``n`` is registered as +``/dev/i2c<CONFIG_RZV2H_SCI_I2C_BUS_OFFSET + n>``. The default offset is +10, so the SCI I2C buses do not overlap the RIIC I2C buses. + +Pin Assignments +--------------- + +SDA uses the TXDn pin and SCL uses the RXDn pin of each SCI channel. + +.. list-table:: + :header-rows: 1 + + * - Channel + - SDA Pin + - SCL Pin + * - SCI0 + - ``P5_0`` + - ``P5_1`` + * - SCI1 + - ``P5_2`` + - ``P5_3`` + * - SCI4 + - ``P8_4`` + - ``P8_5`` + * - SCI5 + - ``P7_2`` + - ``P7_3`` + * - SCI6 + - ``P7_4`` + - ``P7_5`` + * - SCI7 + - ``P7_6`` + - ``P7_7`` + * - SCI9 + - ``P8_2`` + - ``P8_3`` + +Configuration +------------- + +The relevant options for enabling SCI7 as an example are:: + + CONFIG_I2C=y + CONFIG_RZV2H_SCI_I2C=y + CONFIG_RZV2H_SCI_I2C7=y + CONFIG_I2C_RESET=y + CONFIG_SYSTEM_I2CTOOL=y + CONFIG_I2CTOOL_MAXBUS=19 + +``CONFIG_I2CTOOL_MAXBUS`` must be at least +``CONFIG_RZV2H_SCI_I2C_BUS_OFFSET`` plus the SCI channel number, or +``i2ctool`` rejects the bus number. + +Each channel has additional Kconfig options for bit rate, SDA output delay, +noise filter clock, bit-rate modulation, and interrupt priority. TXI and +TEI are fixed GIC interrupts, so SCI I2C has no interrupt-select (SEL) +options. + +After boot, verify that the channel is registered:: + + nsh> ls /dev + /dev: + ... + i2c17 + ... + +Using the ``i2ctool`` Application +--------------------------------- + +The ``sci-i2c`` board configuration (``rzv2h-rdk:sci-i2c``) enables +SCI7 and the ``i2ctool`` application. Use the ``i2c`` commands with the +SCI I2C bus number. + +List which buses from ``CONFIG_I2CTOOL_MINBUS`` to ``CONFIG_I2CTOOL_MAXBUS`` +exist; bus 17 should be reported as present:: + + nsh> i2c bus + +Scan for devices on bus 17 from address 0x03 to 0x77:: + + nsh> i2c dev -b 17 0x03 0x77 + +Get the register at address 0x00 from a device at address 0x50 on bus 17:: + + nsh> i2c get -b 17 -a 0x50 -r 0x00 + +Set value 0x5a to the register at address 0x10 of a device at address 0x50 +on bus 17:: + + nsh> i2c set -b 17 -a 0x50 -r 0x10 0x5a + +Reset bus 17 to recover a slave that holds the bus (requires +``CONFIG_I2C_RESET``):: + + nsh> i2c reset -b 17 + QSPI Flash ========== @@ -365,6 +465,15 @@ active-low ``P11_4`` and ``P11_5`` LED outputs. The generic ``/dev/gpio0``, ``/dev/gpio1``, and ``/dev/gpio2`` interfaces are also available for individual read/write testing. +sci-i2c +------- + +SCI I2C configuration enabling SCI channel 7 in simple I2C mode with the +``i2ctool`` application. The channel is registered as ``/dev/i2c17`` at +boot. SDA is on J1 pin 3 (``P7_6``) and SCL on J1 pin 5 (``P7_7``), which +have on-board pull-ups. Bus reset recovery (``CONFIG_I2C_RESET``) is +enabled. + nsh-xspi -------- diff --git a/Documentation/platforms/arm/rzv2h/index.rst b/Documentation/platforms/arm/rzv2h/index.rst index 8e00be0b0c7..0f85929e2b0 100644 --- a/Documentation/platforms/arm/rzv2h/index.rst +++ b/Documentation/platforms/arm/rzv2h/index.rst @@ -39,6 +39,8 @@ MPU Yes Static PMSAv7 region table (ITCM/DTCM/SRAM/code) TIMER Yes MPCore Private Timer used as the system tick source SCI Yes Interrupt-driven SCI-B asynchronous UART on channels 0-9 GPIO Yes Basic operations (config/read/write), no interrupt support +RIIC I2C Yes Interrupt-driven RIIC master on channels 0-8 +SCI I2C Yes Interrupt-driven SCI simple I2C master on channels 0-9 QSPI Yes xSPI controller in QSPI mode, manual-command transfers only ========== ======= ============================================================ @@ -88,6 +90,9 @@ Runtime baud-rate changes are supported through the standard termios Hardware flow control and DMA are not implemented yet. +An SCI channel can be used for UART or for simple I2C (see SCI I2C +below), but not for both at once. + GPIO ---- @@ -110,11 +115,61 @@ Default SEL IDs The 127-line SEL pool (SEL0-SEL126, IRQ 353-479) is conventionally partitioned by module, allocated from the top of the range downward: -====== ================== ================================ -Module Count IRQ range (>= 353) -====== ================== ================================ -TINT 32 (tint0-tint31) 479-448 -====== ================== ================================ +======== ================== ================================ +Module Count IRQ range (>= 353) +======== ================== ================================ +TINT 32 (tint0-tint31) 479-448 +RIIC I2C 9 (riic0-riic8) 447-430 (txi/rxi only) +======== ================== ================================ + +Changing interrupt-select IDs (RIIC2 as an example) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +When the default interrupt-select ID needs to change, e.g. to move +RIIC2 off its default TXI/RXI SEL IDs (443/442) and onto SEL IDs +397/396 instead: + +#. Run ``make menuconfig`` and navigate to + ``System Type -> RZ/V2H Configuration Options -> RIIC I2C support -> + RIIC 2``. +#. Set ``RIIC2 TXI interrupt-select (SEL) IRQ number`` to ``397``. +#. Set ``RIIC2 RXI interrupt-select (SEL) IRQ number`` to ``396``. + +Rebuild and reflash after changing either option so the new INTSEL +values are picked up. + + +RIIC I2C +-------- + +The RIIC driver provides interrupt-driven I2C master +operation on channels 0 through 8. + +``CONFIG_RZV2H_RIIC_I2C`` enables the driver and +``CONFIG_RZV2H_RIICn`` selects each required channel. Each channel has +independent Kconfig options for bus bitrate, SCL rise/fall times, duty +cycle, noise filter stages, TXI/RXI interrupt-select (SEL) IRQ numbers, +and interrupt priority. + +I2C bus reset recovery (``CONFIG_I2C_RESET``) is supported. The driver +bit-bangs SCL to clock out stuck slaves, then generates a START+STOP +sequence to reset slave state machines. + +SCI I2C +------- + +The SCI I2C driver provides interrupt-driven I2C master operation (SCI simple +I2C mode, up to 400 kHz) on channels 0 through 9. + +``CONFIG_RZV2H_SCI_I2C`` enables the driver and +``CONFIG_RZV2H_SCI_I2Cn`` selects each required channel; the channel's +SCI UART must be disabled. Each channel has independent Kconfig options +for bus bitrate, SDA output delay, noise filter clock, bit-rate modulation, +and interrupt priority. Channel ``n`` is registered as +``/dev/i2c<CONFIG_RZV2H_SCI_I2C_BUS_OFFSET + n>``. + +I2C bus reset recovery (``CONFIG_I2C_RESET``) is supported, using the same +method as RIIC I2C. QSPI ----
