R-Car/Boards/Salvator-X

= Introduction =

This is the Wiki for the Renesas Salvator-X board, which is available in different versions, depending on the actual SiP mounted: Refer to the R-Car page for information about Renesas' R-Car SoC family.
 * RTP0RC7795SIPB0010S (with R-Car H3),
 * RTP0RC7796SIPB0011S (with R-Car M3-W or M3-N).

= Hardware Features =


 * R-CAR H3
 * ARM CA57 (ARMv8) 1.5 GHz quad core, with NEON/VFPv4, L1$ I/D 48K/32K, L2$ 2MB
 * ARM CA53 (ARMv8) 1.2 GHz quad core, with NEON/VFPv4, L1$ I/D 32K/32K, L2$ 512K
 * Memory controller for LPDDR4-3200 4GB in 2 channels, each 64-bit wide
 * Two- and three-dimensional graphics engines,
 * Video processing units,
 * 3 channels Display Output,
 * 6 channels Video Input,
 * SD card host interface,
 * USB3.0 and USB2.0 interfaces,
 * CAN interfaces
 * Ethernet AVB
 * PCI Express Interfaces
 * Memories
 * INTERNAL 384KB SYSTEM RAM
 * DDR 4 GB LPDDR4
 * HYPERFLASH 64 MB HYPER FLASH (512 MBITS, 160 MHZ, 320 MBYTES/S)
 * QSPI FLASH 16MB QSPI (128 MBITS,80 MHZ,80 MBYTES/S)1 HEADER QSPI MODULE
 * EMMC 32 GB EMMC (HS400 240 MBYTES/S)
 * MICROSD-CARD SLOT (SDR104 100 MBYTES/S)

= Quick Start How To =

This sections describes steps that are necessary to run a "Hello, World!" application using Yocto build. Both X11 and Wayland are supported.

Build Yocto image
Refer to Yocto for steps necessary for making a Yocto image.

Connect 12 V power supply to the board
Use 12 V power supply with a 5.5 mm barrel plug. The power supply should be able to provide 9 Amps.

Connect to serial console
Use a microUSB cable to connect the Salvator-X board. CN25 ("DEBUG SERIAL-0") must be used on Salvator-X side. It is routed to SCIF2 in the R-Car H3 via a FT232 interface converter chip.

On Linux, FT232 driver is included with kernel versions >=2.6.12. Windows driver and sources can be found on Silicon Labs website.

Serial settings are 115200 8N1. Any standard terminal emulator program can be used.

On Linux:

picocom

sudo picocom -b 115200 DEVICE replace DEVICE with the proper tty device name, for example /dev/ttyUSB0. Running dmesg | tail can help locating proper device. After the successful connection, picocom should display:

picocom v1.7 port is       : /dev/ttyUSB0 flowcontrol   : none baudrate is   : 115200 parity is     : none databits are  : 8 escape is     : C-a local echo is : no noinit is      : no noreset is     : no nolock is      : no send_cmd is    : sz -vv receive_cmd is : rz -vv imap is       : omap is       : emap is       : crcrlf,delbs, Terminal ready

Use Ctrl+A, Ctrl+Q to exit picocom.

minicom

sudo minicom -b 115200 -D DEVICE replace DEVICE with the proper tty device name, for example /dev/ttyUSB0. Running dmesg | tail can help locating proper device. After the successful connection, minicom should display:

Welcome to minicom 2.6.2 OPTIONS: I18n Compiled on Aug 7 2013, 13:32:48. Port /dev/ttyUSB0 Press CTRL-A Z for help on special keys Use Ctrl+A, Q to exit minicom.

Power on the board and go to U-Boot prompt
Switch "SW23" to "ON" to switch the board on. Then you should see the following output in the terminal: Welcome to minicom 2.7 OPTIONS: I18n Compiled on Jan 1 2014, 17:13:19. Port /dev/ttyUSB0, 18:31:48 Press CTRL-A Z for help on special keys NOTICE: BL2: R-Car Gen3 Initial Program Loader(CA57) Rev.1.0.9 NOTICE: BL2: PRR is R-Car H3 ES1.1 NOTICE: BL2: Boot device is HyperFlash(80MHz) NOTICE: BL2: LCM state is CM NOTICE:  BL2: AVS setting succeeded. DVFS_SetVID=0x52 NOTICE: BL2: DDR1600(rev.0.10) NOTICE: BL2: DRAM Split is 4ch NOTICE: BL2: QoS is default setting(rev.0.32) NOTICE: BL2: Lossy Decomp areas NOTICE:      Entry 0: DCMPAREACRAx:0x80000540 DCMPAREACRBx:0x570 NOTICE:      Entry 1: DCMPAREACRAx:0x40000000 DCMPAREACRBx:0x0 NOTICE:      Entry 2: DCMPAREACRAx:0x20000000 DCMPAREACRBx:0x0 NOTICE: BL2: v1.1(release):3ad02ac NOTICE: BL2: Built : 13:03:52, Sep 20 2016 NOTICE: BL2: Normal boot NOTICE: BL2: dst=0xe631a208 src=0x8180000 len=512(0x200) NOTICE: BL2: dst=0x43f00000 src=0x8180400 len=6144(0x1800) NOTICE: BL2: dst=0x44000000 src=0x81c0000 len=65536(0x10000) NOTICE: BL2: dst=0x44100000 src=0x8200000 len=524288(0x80000) NOTICE: BL2: dst=0x49000000 src=0x8640000 len=1048576(0x100000) U-Boot 2015.04 (Sep 23 2016 - 18:54:42) CPU: Renesas Electronics R8A7795 rev 1.1 Board: H3ULCB I2C:  ready DRAM: 3.9 GiB MMC:  sh-sdhi: 0, sh-sdhi: 1 In:   serial Out:  serial Err:  serial Net:  ravb Hit any key to stop autoboot: 3 Quickly hit any key to get into U-boot command prompt. Use SW9 ("Reset") to reboot the board when necessary.

You should see the following:

Hit any key to stop autoboot: 0 =>

Configure U-Boot to boot over TFTP + NFS or from a micro SD card
Refer to Yocto page for steps necessary for running Yocto.

= Serial Console =

Use a micro-USB cable to connect to "Debug Serial 0". Serial settings are 115200 8N1.

= Booting Linux =

* Kernel config: defconfig * Kernel image: arch/arm64/boot/Image * DTB: arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dtb (for R-Car H3 ES1.x) * DTB: arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dtb (for R-Car H3 ES2.0 and later) * DTB: arch/arm64/boot/dts/renesas/r8a77960-salvator-x.dtb (for R-Car M3-W) * DTB: arch/arm64/boot/dts/renesas/r8a77965-salvator-x.dtb (for R-Car M3-N)

U-Boot boot command: tftpboot 0x50000000 Image tftpboot 0x58000000 r8a77951-salvator-x.dtb (for R-Car H3 ES2.0 and later) tftpboot 0x58000000 r8a77960-salvator-x.dtb (for R-Car M3-W) tftpboot 0x58000000 r8a77965-salvator-x.dtb (for R-Car M3-N) booti 0x50000000 - 0x58000000

The old boot loader on R-Car H3 ES1.0 does not support the above addresses, but you can use the following instead: tftpboot 0x60000000 Image tftpboot 0x68000000 r8a77950-salvator-x.dtb (for R-Car H3 ES1.x) booti 0x60000000 - 0x68000000

Kernel v5.5 and older used different DTB names: * DTB: arch/arm64/boot/dts/renesas/r8a7795-es1-salvator-x.dtb (for R-Car H3 ES1.x) * DTB: arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dtb (for R-Car H3 ES2.0 and later) * DTB: arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dtb (for R-Car M3-W) * DTB: arch/arm64/boot/dts/renesas/r8a77965-salvator-x.dtb (for R-Car M3-N)

= Lossy decomp =

If you see the following strings, the firmware enables Lossy decomp feature. And, we cannot use the memory area from 0x54000000 to 0x56ffffff as Linux system memory.

NOTICE: BL2: Lossy Decomp areas NOTICE:      Entry 0: DCMPAREACRAx:0x80000540 DCMPAREACRBx:0x570 NOTICE:      Entry 1: DCMPAREACRAx:0x40000000 DCMPAREACRBx:0x0 NOTICE:      Entry 2: DCMPAREACRAx:0x20000000 DCMPAREACRBx:0x0


 * Remarks
 * The bit 31 of "DCMPAREACRAx" is set to 1, this means the Lossy decomp feature is enabled.
 * The lower 18-bits of "DCMPAREACRAx" means start address.
 * This 0x540 in Entry 0 means that the start address is 0x54000000.
 * The lower 18-bits of "DCMPAREACRBx" means end address.
 * This 0x570 in Entry 0 means that the end address is 0x56ffffff.

= Test procedures =


 * Tests:eMMC-8bit-width: Test the on-board eMMC with an 8 bit bus width
 * Tests:SCIF-FIFO: Test SCIF FIFO behavior, using SCIF3 and HSCIF3 on expansion I/O connectors
 * Tests:SDIO-KS7010: Test SDIO with a Spectec SDW823 microSD card (using an SD size adapter) on connectors CN13 or CN14
 * Tests:SDIO-H3-Voltage-Switching: Test if voltages change properly when inserting UHS capable SD cards into connectors CN13 or CN14
 * Tests:Watchdog-Pretimeout: Test watchdog pretimeouts. Because the hardware watchdog (RWDT) doesn't support this feature, a software watchdog must be used in addition

= Suspend-to-RAM =

PSCI System Suspend
The system can be suspended by triggering a PSCI System Suspend: echo mem > /sys/power/state

Caveats: echo on > /sys/bus/i2c/drivers/bd9571mwv/*/bd9571mwv-regulator*/backup_mode i2cset -f -y 7 0x30 0x20 0x0F
 * Before you can use the above, you must configure the PMIC for DDR Backup Mode first, using the command below, followed by switching SW23 off:
 * On kernels up to and including v4.18, the "backup_mode" sysfs file doesn't exist yet. Hence you must use i2cset instead, and repeat this operation after each wake-up:
 * PSCI System Suspend supports wake-up by PMIC only. Switch SW23 on to resume the system.
 * Please use firmware 2.16 or later for proper PSCI System Suspend support on R-Car H3 (ES1.0 and ES1.1) and M3-W (ES1.0).

Suspend-to-Idle
If you want to suspend the system, and wake up through other wake-up sources, you must use Suspend-to-Idle instead of PSCI System Suspend.

The system can be suspended ("frozen") using: echo freeze > /sys/power/state

Alternatively (since v4.10), you can configure the system to use Suspend-to-Idle by default: echo s2idle > /sys/power/mem_sleep

After that, you can suspend the system using the standard: echo mem > /sys/power/state

Wake-Up Sources
Suspend-to-Idle supports the following wake-up sources:

ethtool -s eth0 wol g # Enable wake on MagicPacket ethtool -s eth0 wol d # Disable Wake-up by sending a MagicPacket from another system using: wakeonlan  | |  # or  must be in /etc/ethers
 * gpio-keys: Not enabled in the upstream kernel due to sharing of GPIOs between switches and LEDs, but see Remote Control below.
 * ravb (Ethernet): Configure using one of:
 * sh-sci (Serial): Disabled by default
 * usb: Disabled by default

= Remote Control =