Difference between revisions of "R-Car/Boards/S4SK-Proto"
(→Hardware) |
(→Hardware feature) |
||
(55 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{TOC right}} | |
− | |||
== Introduction == | == Introduction == | ||
− | This page is for the Starter Kit <span style="color:#ff0000;">prototype</span> board equipped with R-Car S4(ws1. | + | This page is for the Starter Kit <span style="color:#ff0000;">prototype</span> board equipped with R-Car S4(ws1.1).<br> |
− | This board is not for sale.<br> | + | This board is not for sale and has limited users.<br> |
The mass production version is scheduled for 2023. Please look forward to it. | The mass production version is scheduled for 2023. Please look forward to it. | ||
== Hardware == | == Hardware == | ||
=== Type name === | === Type name === | ||
+ | <pre>Y-ASK-RCAR-S4</pre> | ||
+ | |||
=== Picture === | === Picture === | ||
==== [Top view] ==== | ==== [Top view] ==== | ||
Line 14: | Line 15: | ||
==== [Bottom view] ==== | ==== [Bottom view] ==== | ||
[[File:R-Car-S4SK-bottomview.jpg|700px|Bottom view]]<br/> | [[File:R-Car-S4SK-bottomview.jpg|700px|Bottom view]]<br/> | ||
+ | <!-- | ||
=== Block Diagram === | === Block Diagram === | ||
+ | --> | ||
=== Hardware feature === | === Hardware feature === | ||
+ | <li> Power connector for 5V input (incl. protection circuit) | ||
+ | <li> LPDDR4X (4 GiB) | ||
+ | <li> Boot device: QSPI (64 MiB) | ||
+ | <li> UFS memory (128GB(SanDisk/SDINFDO4-128G)) | ||
+ | <li> uSD-card x1 | ||
+ | <li> Ethernet TSN via RSwitch2: two PHYs for 2500BASE-T1 (88Q4364) with 2-wire automotive Ethernet connectors(Rosenberger/E6S20A-40MT5-x) | ||
+ | <li> Ethernet PHY (100 Mbps) at G4MH | ||
+ | <li> PCIe interfaces available on two OCuLink connectors (2 channels x 2 lanes) | ||
+ | <li> Debug port DBG0 and DBG1 | ||
+ | <li> two CAN transceivers (4-pin headers) | ||
+ | <li> one LIN transceiver (4-pin headers) | ||
+ | <li> 3 LEDs/buttons | ||
+ | |||
+ | === Note === | ||
+ | Heat sink and FAN : Tighten all 8 screws on the top of the acrylic board to prevent high temperatures. | ||
+ | |||
+ | <!-- | ||
== Documentation == | == Documentation == | ||
=== Schematic === | === Schematic === | ||
+ | --> | ||
+ | |||
+ | == AC Adapter == | ||
+ | AC adapter is not bundled with the board, please prepare it.<br> | ||
+ | Here is the AC adapter information that has been confirmed. | ||
+ | {| class="wikitable" | ||
+ | ! Type Name !! Where to buy | ||
+ | |- | ||
+ | | SMI36-5-V-P6 || [https://www.digikey.com/en/products/detail/cui-inc/SMI36-5-V-P6/5415061 Click to buy from Digi-Key]<br> [https://www.mouser.com/ProductDetail/CUI-Inc/SMI36-5-V-P6?qs=Uyjh6ApWNKupNvIimZaInA%3D%3D Click to buy from Mouser] | ||
+ | |} | ||
+ | |||
+ | == Debug Serial == | ||
+ | :CN13 | ||
+ | :: Two serial ports are recognized. Please use the younger number. | ||
+ | :Baudrate | ||
+ | :: 921600 | ||
+ | |||
+ | == PCIe == | ||
+ | :CH0(CN30) | ||
+ | :: Root Complex | ||
+ | :CH1(CN31) | ||
+ | :: Endpoint | ||
== Specification of DIP SW (SW3) == | == Specification of DIP SW (SW3) == | ||
Line 64: | Line 106: | ||
== How to update the loader == | == How to update the loader == | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ Write data information | ||
+ | |- | ||
+ | ! Filename !! Program Top Address !! Qspi Save Address !! Description | ||
+ | |- | ||
+ | | bootparam_sa0.srec || 0xEB200000 || 0x0000000 || ICUMX IPL (boot parameter) | ||
+ | |- | ||
+ | | icumx_loader.srec || 0xEB210000 || 0x0040000 || ICUMX IPL | ||
+ | |- | ||
+ | | cert_header_sa9.srec || 0xEB230000 || 0x0240000 || ICUMX IPL (certification) | ||
+ | |- | ||
+ | | dummy_fw.srec || 0xEB240000 || 0x0280000 || Dummy firmware (Instead of secure firmware) | ||
+ | |- | ||
+ | | dummy_rtos.srec || 0xE2100000 || 0x0500000 || Dummy RTOS (Instead of CR main OS) | ||
+ | |- | ||
+ | |ca55_loader.srec || 0xE6300000 || 0x0480000 || | ||
+ | |- | ||
+ | | dummy_g4mh_case0.srec || 0x00000000 || 0x0900000 || Dummy G4MH program image | ||
+ | |- | ||
+ | | dummy_icumh_case1.srec || 0x00500000 || 0x0380000 || Dummy ICUMH program image | ||
+ | |- | ||
+ | | bl31-s4sk-proto.srec || 0x46400000 || 0x0E00000 || Secure monitor | ||
+ | |- | ||
+ | | tee-s4sk-proto.srec || 0x44100000 || 0x0E80000 || Tee OS | ||
+ | |- | ||
+ | | u-boot-elf-s4sk-proto.srec || 0x50000000 || 0x0F80000 || U-Boot | ||
+ | |} | ||
+ | * If you do not have binaries, please contact the S4SK-Proto board provider. | ||
+ | |||
+ | === Windows user === | ||
+ | <ol> | ||
+ | <li> Connect the Windows PC to the SK4SK-Proto(CN13) with a USB serial cable </li> | ||
+ | baudrate : 921600 | ||
+ | <li> SW3 : Set to SCIF Download(DL) mode </li> | ||
+ | {| class="wikitable" | ||
+ | |+ SW3 | ||
+ | |- | ||
+ | ! !! Default !! SCIF DL mode | ||
+ | |- | ||
+ | | SW3.1 || On || Off | ||
+ | |- | ||
+ | | SW3.2 || On || Off | ||
+ | |- | ||
+ | | SW3.3 || Off || Off | ||
+ | |- | ||
+ | | SW3.4 || On || Off | ||
+ | |- | ||
+ | | SW3.5 || Off || Off | ||
+ | |- | ||
+ | | SW3.6 || On || On | ||
+ | |- | ||
+ | | SW3.7 || Off || Off | ||
+ | |- | ||
+ | | SW3.8 || Off || Off | ||
+ | |- | ||
+ | |} | ||
+ | <li> Power ON (SW5) </li> | ||
+ | <pre> | ||
+ | SCIF Download mode (w/o verification) | ||
+ | (C) Renesas Electronics Corp. | ||
+ | -- Load Program to SystemRAM --------------- | ||
+ | please send ! | ||
+ | </pre> | ||
+ | <li> Execute TeraTerm macro "S4SK_nonCX_QSPI_BL31.ttl" </li> | ||
+ | Teta Term: Control -> Macro -> S4SK_nonCX_QSPI_BL31.ttl<br> | ||
+ | The following log is output: | ||
+ | <pre> | ||
+ | Flash writer for R-Car S4 Series Rev.0.9.0 May 25,2022 | ||
+ | > xls2 | ||
+ | ===== Qspi/HyperFlash writing Command ============= | ||
+ | |||
+ | (snip) | ||
+ | </pre> | ||
+ | <li> Power OFF (SW5) </li> | ||
+ | <li> SW3 : Set to default mode </li> | ||
+ | </ol> | ||
+ | === Linux user === | ||
+ | <pre> | ||
+ | $ git clone https://github.com/morimoto/renesas-bsp-rom-writer.git | ||
+ | $ cd renesas-bsp-rom-writer | ||
+ | $ WORK=`pwd` | ||
+ | Please refer to the following file for the writing procedure. | ||
+ | ${WORK}/README | ||
+ | ${WORK}/board/s4sk-prototype/README | ||
+ | ${WORK}/board/s4sk-prototype/linux/README | ||
+ | </pre> | ||
== SW environments == | == SW environments == | ||
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 84: | Line 211: | ||
| U-Boot || 2020.10 | | U-Boot || 2020.10 | ||
|- | |- | ||
− | | Renesas Yocto BSP || v5. | + | | Renesas Yocto BSP || <span style="color:#ff0000;">v5.18.0 (R-Car SDK v3.9.0)</span> |
|} | |} | ||
=== Host PC === | === Host PC === | ||
Ubuntu 20.04 LTS (64bit) is recommended as OS. 32bit version is not supported. | Ubuntu 20.04 LTS (64bit) is recommended as OS. 32bit version is not supported. | ||
+ | === Supported BSP === | ||
+ | * Linux (this page)<br> | ||
+ | * Xen ([[R-Car/Boards/S4SK-Proto-Xen|here]]) | ||
== How to build == | == How to build == | ||
Line 100: | Line 230: | ||
=== Build script === | === Build script === | ||
+ | # Build script(build.sh) | ||
+ | #: <span style="color:#ff0000;">2023/02/22 updated</span> | ||
+ | #: <syntaxhighlight lang="bash"> | ||
+ | #!/bin/bash | ||
+ | |||
+ | WORK=`pwd`/s4sk_proto | ||
+ | META_RENESAS_COMMIT=eea3b61ec767d91624fdac0be2bea53e86db49be | ||
+ | |||
+ | mkdir -p ${WORK} | ||
+ | cd ${WORK} | ||
+ | |||
+ | git clone git://git.yoctoproject.org/poky | ||
+ | git clone git://git.openembedded.org/meta-openembedded | ||
+ | git clone https://github.com/renesas-rcar/meta-renesas | ||
+ | |||
+ | # Switch to proper branches/commits | ||
+ | cd $WORK/poky | ||
+ | git checkout -b tmp 74b22db6879b388d700f61e08cb3f239cf940d18 | ||
+ | cd $WORK/meta-openembedded | ||
+ | git checkout -b tmp 814eec96c2a29172da57a425a3609f8b6fcc6afe | ||
+ | cd $WORK/meta-renesas | ||
+ | git checkout -b tmp ${META_RENESAS_COMMIT} | ||
+ | |||
+ | cd $WORK | ||
+ | source $WORK/poky/oe-init-build-env build | ||
+ | cp $WORK/meta-renesas/meta-rcar-gateway/docs/sample/conf/s4sk-proto/poky-gcc/bsp/*.conf conf/ | ||
+ | |||
+ | bitbake rcar-image-gateway | ||
+ | </syntaxhighlight> | ||
+ | # build | ||
+ | #: <syntaxhighlight lang="bash"> | ||
+ | ./build.sh | ||
+ | </syntaxhighlight> | ||
+ | #: If the build completes successfully, all the necessary files are generated in a following directory: | ||
+ | #:: <syntaxhighlight lang="text"> | ||
+ | ./s4sk_proto/build/tmp/deploy/images/s4sk-proto/ | ||
+ | </syntaxhighlight> | ||
+ | |||
=== Manual steps === | === Manual steps === | ||
+ | <span style="color:#ff0000;">2022/12/27 updated</span> | ||
+ | # Create a directory and switch to it | ||
+ | #: Warning! Yocto builds require a lot of disk space (up to 100 GB). Make sure you have got enough before starting the build. | ||
+ | #: <syntaxhighlight lang="bash"> | ||
+ | mkdir build | ||
+ | cd build | ||
+ | export WORK=`pwd` | ||
+ | </syntaxhighlight> | ||
+ | # Clone basic Yocto layers: | ||
+ | #: <syntaxhighlight lang="bash">cd $WORK | ||
+ | git clone git://git.yoctoproject.org/poky | ||
+ | git clone git://git.openembedded.org/meta-openembedded | ||
+ | git clone https://github.com/renesas-rcar/meta-renesas | ||
+ | </syntaxhighlight> | ||
+ | # Switch to proper branches/commits | ||
+ | #: <syntaxhighlight lang="bash"> | ||
+ | cd $WORK/poky | ||
+ | git checkout -b tmp 74b22db6879b388d700f61e08cb3f239cf940d18 | ||
+ | cd $WORK/meta-openembedded | ||
+ | git checkout -b tmp 814eec96c2a29172da57a425a3609f8b6fcc6afe | ||
+ | cd $WORK/meta-renesas | ||
+ | git checkout -b tmp a634d930d30af39eec68c9fc82ce113c74775c25 | ||
+ | </syntaxhighlight> | ||
+ | # Setup build environment | ||
+ | #: <syntaxhighlight lang="bash"> | ||
+ | cd $WORK | ||
+ | source poky/oe-init-build-env $WORK/build | ||
+ | </syntaxhighlight> | ||
+ | # Prepare default configuration files. | ||
+ | #: <syntaxhighlight lang="bash"> | ||
+ | cp $WORK/meta-renesas/meta-rcar-gateway/docs/sample/conf/s4sk-proto/poky-gcc/bsp/*.conf conf/ ./conf/ | ||
+ | cd $WORK/build | ||
+ | </syntaxhighlight> | ||
+ | # Start the build | ||
+ | #: <syntaxhighlight lang="bash"> | ||
+ | bitbake rcar-image-gateway | ||
+ | </syntaxhighlight> | ||
+ | # Building image can take up to a few hours depending on your host system performance.<br>After the build has been completed successfully, you should see the output similar to: | ||
+ | #: <syntaxhighlight lang="bash"> | ||
+ | NOTE: Tasks Summary: Attempted 4956 tasks of which 5 didn't need to be rerun and all succeeded. | ||
+ | </syntaxhighlight> | ||
+ | #: and the command prompt should return. | ||
+ | # Bitbake has generated all the necessary files in ./tmp/deploy/images directory. <br/>You can verify its content: | ||
+ | #: <syntaxhighlight lang="bash"> | ||
+ | $ ls -1 `find ./tmp/deploy/images/s4sk-proto/ -maxdepth 1 -type l -print` | ||
+ | ./tmp/deploy/images/s4sk-proto/Image | ||
+ | ./tmp/deploy/images/s4sk-proto/Image-s4sk-proto.bin | ||
+ | ./tmp/deploy/images/s4sk-proto/modules-s4sk-proto.tgz | ||
+ | ./tmp/deploy/images/s4sk-proto/r8a779f0-s4sk-prototype-s4sk-proto.dtb | ||
+ | ./tmp/deploy/images/s4sk-proto/r8a779f0-s4sk-prototype.dtb | ||
+ | ./tmp/deploy/images/s4sk-proto/rcar-image-gateway-s4sk-proto.manifest | ||
+ | ./tmp/deploy/images/s4sk-proto/rcar-image-gateway-s4sk-proto.tar.bz2 | ||
+ | ./tmp/deploy/images/s4sk-proto/rcar-image-gateway-s4sk-proto.testdata.json | ||
+ | ./tmp/deploy/images/s4sk-proto/u-boot-elf-s4sk-proto.srec | ||
+ | ./tmp/deploy/images/s4sk-proto/u-boot-elf.srec | ||
+ | ./tmp/deploy/images/s4sk-proto/u-boot-initial-env | ||
+ | ./tmp/deploy/images/s4sk-proto/u-boot-initial-env-s4sk-proto | ||
+ | ./tmp/deploy/images/s4sk-proto/u-boot-s4sk-proto.bin | ||
+ | ./tmp/deploy/images/s4sk-proto/u-boot.bin | ||
+ | </syntaxhighlight> | ||
+ | #: '''Image''' is a Kernel image, '''r8a779f0-s4sk-prototype.dtb''' is a blob file, '''rcar-image-gateway-s4sk-proto.tar.bz2''' is the rootfs, '''modules-s4sk-proto.tgz''' is kernel modules. | ||
+ | |||
+ | == Build SDK == | ||
+ | * After building BSP you may build SDK: | ||
+ | *: <syntaxhighlight lang="text">bitbake rcar-image-gateway -c populate_sdk</syntaxhighlight> | ||
+ | * After build finished the SDK installation script may be found in following path: | ||
+ | *: <syntaxhighlight lang="text">tmp/deploy/sdk/poky-glibc-x86_64-rcarimage-gateway-aarch64-spider-toolchain-3.1.11.sh</syntaxhighlight> | ||
+ | * Install SDK by run the following command and follow instructions on the screen: | ||
+ | *: <syntaxhighlight lang="text">sudo ./poky-glibc-x86_64-rcar-image-gateway-aarch64-spider-toolchain-3.1.11.sh</syntaxhighlight> | ||
+ | |||
+ | Note: Please see the [[R-Car/Boards/S4SK-Proto#Known_issues_.26_Restrictions | Known issues & Restrictions]] chapter. | ||
== How to boot == | == How to boot == | ||
Line 106: | Line 345: | ||
This section describes steps that are necessary for preparing and booting from SD card. | This section describes steps that are necessary for preparing and booting from SD card. | ||
=== Preparing SD card === | === Preparing SD card === | ||
+ | <span style="color:#ff0000">'''WARNING!''' These steps will erase the SD card completely. In short, all files will be lost.</span><br/> | ||
+ | Follow these steps on the host machine: | ||
+ | # Partion your SD card to set 1 partition and ID=83 (Linux) | ||
+ | #: Make sure the SD card doesn't contain any important files. | ||
+ | #: <syntaxhighlight lang="bash"> | ||
+ | $ fdisk /dev/mmcblk0 | ||
+ | -> d | ||
+ | -> n | ||
+ | -> p | ||
+ | -> 1 | ||
+ | -> t | ||
+ | -> 83 | ||
+ | </syntaxhighlight> | ||
+ | # Format this partition to ext4 | ||
+ | #: <syntaxhighlight lang="bash"> | ||
+ | $ mkfs.ext4 /dev/mmcblk0p1 | ||
+ | </syntaxhighlight> | ||
+ | # Mount this partition on your host to any directory and upack the rcar-image-gateway-s4sk-proto.tar.bz2 into mounted folder.<br/> | ||
+ | #: <syntaxhighlight lang="bash"> | ||
+ | $ mount /dev/mmcblk0p1 /mnt | ||
+ | $ cd <your_yocto_build_directory> | ||
+ | $ tar xfj build/tmp/deploy/images/s4sk-proto/rcar-image-gateway-s4sk-proto.tar.bz2 -C /mnt | ||
+ | </syntaxhighlight> | ||
+ | #: NOTE: probably you need to be a root user, hence use "sudo" | ||
+ | === Configure U-Boot to boot from SD card === | ||
+ | * Proper U-Boot command to boot from SD: | ||
+ | *: <syntaxhighlight lang="text"> | ||
+ | # setenv bootargs 'console=ttySC0,921600 rw root=/dev/mmcblk0p1 rootwait cma=560M' | ||
+ | # ext4load mmc 0:1 0x48080000 /boot/Image | ||
+ | # ext4load mmc 0:1 0x48000000 /boot/r8a779f0-s4sk-prototype.dtb | ||
+ | # booti 0x48080000 - 0x48000000 | ||
+ | </syntaxhighlight> | ||
+ | * Example of U-Boot environment variables: | ||
+ | *: <syntaxhighlight lang="text"> | ||
+ | baudrate=921600 | ||
+ | bootargs=root=console=ttySC0,921600 rw root=/dev/mmcblk0p1 rootwait cma=560M | ||
+ | bootcmd=ext4load mmc 0:1 0x48080000 /boot/Image; ext4load mmc 0:1 0x48000000 /boot/r8a779f0-s4sk-prototype.dtb; booti 0x48080000 - 0x48000000 | ||
+ | bootdelay=2 | ||
+ | bootm_size=0x10000000 | ||
+ | fdtcontroladdr=bbf45160 | ||
+ | loadaddr=0x58000000 | ||
+ | platform=r8a779f0 | ||
+ | stderr=serial@e6540000 | ||
+ | stdin=serial@e6540000 | ||
+ | stdout=serial@e6540000 | ||
+ | </syntaxhighlight> | ||
== How to test some capabilities == | == How to test some capabilities == | ||
=== Thermal === | === Thermal === | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | root@s4sk:~# cat /sys/class/thermal/thermal_zone*/temp | + | root@s4sk-proto:~# cat /sys/class/thermal/thermal_zone*/temp |
− | + | 31500 | |
− | + | 31000 | |
− | + | 31000 | |
+ | root@s4sk-proto:~# | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | === CPU Hotplug === | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | Ex) | ||
+ | root@s4sk-proto:~# cat /sys/devices/system/cpu/online | ||
+ | 0-7 | ||
+ | root@s4sk-proto:~# | ||
+ | root@s4sk-proto:~# echo 0 > /sys/devices/system/cpu/cpu1/online | ||
+ | [ 83.276294] IRQ209: set affinity failed(-22). | ||
+ | [ 83.276416] CPU1: shutdown | ||
+ | [ 83.277352] psci: CPU1 killed (polled 0 ms) | ||
+ | root@s4sk-proto:~# | ||
+ | root@s4sk-proto:~# cat /sys/devices/system/cpu/offline | ||
+ | 1 | ||
+ | root@s4sk-proto:~# | ||
+ | root@s4sk-proto:~# echo 1 > /sys/devices/system/cpu/cpu1/online | ||
+ | [ 116.336034] Detected VIPT I-cache on CPU1 | ||
+ | [ 116.336084] GICv3: raw_spin_lock_init for SGI | ||
+ | [ 116.336093] GICv3: CPU1: found redistributor 100 region 0:0x00000000f1080000 | ||
+ | [ 116.336163] CPU1: Booted secondary processor 0x0000000100 [0x412fd050] | ||
+ | root@s4sk-proto:~# cat /sys/devices/system/cpu/offline | ||
+ | |||
+ | root@s4sk-proto:~# | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | === UFS === | ||
+ | After starting the Linux, from the start log, there are some messages are showed, | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | Well-known LUN WDC SDINFEO4-128G 1428 PQ: 0 ANSI: 6 | ||
+ | UFS dev info: WDC SDINFEO4-128G rev 1428 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Create partition | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | root@s4sk-proto:~# fdisk -u /dev/sda | ||
+ | Command (m for help): enter “o” | ||
+ | Command (m for help): enter “n” | ||
+ | Select (default p): enter “p” | ||
+ | Partition number (1-4, default 1): enter “1” | ||
+ | First sector (256-31246335): press enter key | ||
+ | Last sector, +/-sectors or +/-size{K,M,G,T,P} (256-31246335, default 31246335):press enter key | ||
+ | press enter key | ||
+ | Command (m for help): enter “w” | ||
+ | |||
+ | sda: sda1 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Format partition | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | root@s4sk-proto:~# mkfs -t ext4 /dev/sda1 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Read/Write | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | Ex) | ||
+ | root@s4sk-proto:~# mount /dev/sda1 /mnt/ | ||
+ | [ 1045.920790] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) | ||
+ | root@s4sk-proto:~# dd if=/dev/urandom of=/tmp/file bs=1M count=350 | ||
+ | 350+0 records in | ||
+ | 350+0 records out | ||
+ | 367001600 bytes (367 MB, 350 MiB) copied, 4.95581 s, 74.1 MB/s | ||
+ | root@s4sk-proto:~# cp /tmp/file /mnt/ | ||
+ | root@s4sk-proto:~# sync | ||
+ | root@s4sk-proto:~# cmp /tmp/file /mnt/file | ||
+ | root@s4sk-proto:~# | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | === PCIe Root Complex(CN30) : SSD === | ||
+ | Environment: | ||
+ | : 1) [https://www.amazon.co.jp/Samsung-MZVPV512HDGL00000/dp/B017LDAIJG MZVPV512HDGL-0000] | ||
+ | : 2) [https://www.microsatacables.com/u-2-sff-8639-to-m-2-m-key-nvme-ssd-and-pcie-x4-slot-u2-1329-m2 U.2 to M.2 M-Key NVME SSD and PCIe] | ||
+ | : 3) [https://www.microsatacables.com/pcie-gen-4-16-gt-s-oculink-sff-8611-to-u-2-sff-8639-cable Oculink to U.2 Cable ] | ||
+ | : 4) [https://www.yodobashi.com/product/100000001006318891/ SATA/IDE AC Adoperq(Japanese site)] | ||
+ | ::[[File:s4sk_pcie_nvme.jpg|350px]] | ||
+ | : <syntaxhighlight lang="bash"> | ||
+ | root@s4sk-proto:~# mount /dev/nvme0n1p1 /mnt/ | ||
+ | [ 25.899108] EXT4-fs (nvme0n1p1): mounted filesystem with ordered data mode. Opts: (null) | ||
+ | root@s4sk-proto:~# mount -t tmpfs -o size=400M tmpfs /tmp | ||
+ | root@s4sk-proto:~# dd if=/dev/urandom of=/tmp/file bs=1M count=350 | ||
+ | 350+0 records in | ||
+ | 350+0 records out | ||
+ | 367001600 bytes (367 MB, 350 MiB) copied, 4.94124 s, 74.3 MB/s | ||
+ | root@s4sk-proto:~# cp /tmp/file /mnt/ | ||
+ | root@s4sk-proto:~# sync | ||
+ | root@s4sk-proto:~# cmp /mnt/file /tmp/file | ||
+ | root@s4sk-proto:~# | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | === pcitest [S4SK - Another S4 SK] === | ||
+ | ==== Environments ==== | ||
+ | : <S4 SK Prototype board : PCIe CH0(CN30)[*1]> <--- OCuLink cable[*2] ---> Another <S4 SK Prototype board : PCIe CH1(CN31)[*3]> | ||
+ | :: [*1] PCIe CH0(CN30) : Root Complex | ||
+ | :: [*2] Ex) https://store.supermicro.com/supermicro-55cm-oculink-to-oculink-cable-cbl-sast-0818.html | ||
+ | :: [*3] PCIe CH1(CN31) : Endpoint | ||
+ | |||
+ | ==== Create DTB file for Endpoint ==== | ||
+ | : Disable: Root Complex of PCIe CH0 | ||
+ | : Enable : Endpoint of PCIe CH1 | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | Ex) | ||
+ | $ cd (Your SDK Build directory) | ||
+ | $ ls | ||
+ | build meta-openembedded meta-renesas poky | ||
+ | $ source poky/oe-init-build-env build/ | ||
+ | $ bitbake -c devshell linux-renesas | ||
+ | $ vi arch/arm64/boot/dts/renesas/r8a779f0-s4sk-prototype.dts | ||
+ | (snip) | ||
+ | &pciec0 { | ||
+ | status = "disabled"; <-- Change to disable !!! | ||
+ | pinctrl-0 = <&pcie0_pins>; | ||
+ | pinctrl-names = "default"; | ||
+ | clkreq-gpios = <&gpio2 15 GPIO_ACTIVE_LOW>; | ||
+ | }; | ||
+ | (snip) | ||
+ | &pciec1_ep { | ||
+ | status = "okay"; <-- Change to enable !!! | ||
+ | pinctrl-0 = <&pcie1_pins>; | ||
+ | pinctrl-names = "default"; | ||
+ | clkreq-gpios = <&gpio2 16 GPIO_ACTIVE_LOW>; | ||
+ | }; | ||
+ | $ make dtbs | ||
+ | $ exit | ||
+ | </syntaxhighlight> | ||
+ | Output: build/tmp/work/s4sk_proto-poky-linux/linux-renesas/5.10.41+xxxx/linux-s4sk_proto-standard-build/arch/arm64/boot/dts/renesas/r8a779f0-s4sk-prototype.dtb | ||
+ | : Copy r8a779f0-s4sk-prototype.dtb to SD card for Endpoint as r8a779f0-s4sk-prototype_pcie1ep.dtb | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | Ex) | ||
+ | $ mount /dev/mmcblk0p1 /mnt | ||
+ | $ cp r8a779f0-s4sk-prototype.dtb /mnt/boot/r8a779f0-s4sk-prototype_pcie1ep.dtb | ||
+ | $ ls /mnt/boot | ||
+ | Image Image-5.10.41-yocto-standard r8a779f0-s4sk-prototype.dtb r8a779f0-s4sk-prototype_pcie1ep.dtb | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ==== pcitest ==== | ||
+ | : Step 1: Start S4 SK of Endpoint using r8a779f0-s4sk-prototype_pcie1ep.dtb | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | => setenv bootargs console=ttySC0,921600 rw root=/dev/mmcblk0p1 rootwait cma=560M | ||
+ | => ext4load mmc 0:1 0x48080000 /boot/Image;ext4load mmc 0:1 0x48000000 /boot/r8a779f0-s4sk-prototype_pcie1ep.dtb;booti 0x48080000 - 0x48000000 | ||
+ | (snip) | ||
+ | s4sk-proto login: root | ||
+ | root@s4sk-proto:~# sed -e 's/e65d0000.pciec0_ep/e65d8000.pciec1_ep/' ep_setup.sh > ep1_setup.sh | ||
+ | root@s4sk-proto:~# chmod +x ep1_setup.sh | ||
+ | root@s4sk-proto:~# ./ep1_setup.sh | ||
+ | Endpoint setup | ||
+ | mount: /sys/kernel/config: none already mounted or mount point busy. | ||
+ | completed. | ||
+ | root@s4sk-proto:~# | ||
+ | </syntaxhighlight> | ||
+ | : Step 2: Start S4 SK of Root Complex (after Step 1) | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | => setenv bootargs console=ttySC0,921600 rw root=/dev/mmcblk0p1 rootwait cma=560M | ||
+ | => ext4load mmc 0:1 0x48080000 /boot/Image;ext4load mmc 0:1 0x48000000 /boot/r8a779f0-s4sk-prototype.dtb;booti 0x48080000 - 0x48000000 | ||
+ | (snip) | ||
+ | s4sk-proto login: root | ||
+ | root@s4sk-proto:~# sed -e 's/1024000/102400/' -e 's/1024001/102401/' pcitest_script.sh > pcitest_script_s4sk.sh | ||
+ | root@s4sk-proto:~# chmod +x pcitest_script_s4sk.sh | ||
+ | root@s4sk-proto:~# ./pcitest_script_s4sk.sh | ||
+ | </syntaxhighlight> | ||
+ | : Log: Root Complex | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | root@s4sk-proto:~# ./pcitest_script_s4sk.sh | ||
+ | BAR tests | ||
+ | |||
+ | BAR0: OKAY | ||
+ | BAR4: OKAY | ||
+ | |||
+ | MSI Interrupt tests | ||
+ | |||
+ | SET IRQ TYPE TO MSI: OKAY | ||
+ | MSI1: OKAY | ||
+ | MSI2: OKAY | ||
+ | |||
+ | (snip) | ||
+ | |||
+ | Copy Tests | ||
+ | |||
+ | COPY ( 1 bytes): OKAY | ||
+ | COPY ( 1024 bytes): OKAY | ||
+ | COPY ( 1025 bytes): OKAY | ||
+ | COPY ( 102400 bytes): OKAY | ||
+ | COPY ( 102401 bytes): OKAY | ||
+ | |||
+ | root@s4sk-proto:~# | ||
+ | </syntaxhighlight> | ||
+ | : Log: Endpoint | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | [ 44.917496] WRITE => Size: 1 bytes DMA: NO Time: 0.000001320 seconds Rate: 739 KB/s | ||
+ | [ 45.941519] | ||
+ | [ 45.941519] WRITE => Size: 1024 bytes DMA: NO Time: 0.000003060 seconds Rate: 326797 KB/s | ||
+ | |||
+ | (snip) | ||
+ | |||
+ | [ 642.777482] COPY => Size: 1 bytes DMA: NO Time: 0.000002160 seconds Rate: 452 KB/s | ||
+ | [ 643.793517] | ||
+ | [ 643.793517] COPY => Size: 1024 bytes DMA: NO Time: 0.000060420 seconds Rate: 16550 KB/s | ||
+ | [ 644.809523] | ||
+ | [ 644.809523] COPY => Size: 1025 bytes DMA: NO Time: 0.000061500 seconds Rate: 16276 KB/s | ||
+ | [ 645.831665] | ||
+ | [ 645.831665] COPY => Size: 102400 bytes DMA: NO Time: 0.006186660 seconds Rate: 16163 KB/s | ||
+ | [ 646.851668] | ||
+ | [ 646.851668] COPY => Size: 102401 bytes DMA: NO Time: 0.006195241 seconds Rate: 16141 KB/s | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | === Ethernet TSN === | ||
+ | ==== ifconfig ==== | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | Ex) | ||
+ | root@s4sk-proto:~# ifconfig tsn0 192.168.10.10 | ||
+ | [ 21.905703] rswitch_get_phy_node PHY interface = usxgmii | ||
+ | [ 22.909775] libphy: rswitch_mii: probed | ||
+ | [ 22.972707] Generic Clause 45 PHY etha0:00: attached PHY driver [Generic Clause 45 PHY] (mii_bus:phy_addr=etha0:00, irq=POLL) | ||
+ | root@s4sk-proto:~# | ||
+ | root@s4sk-proto:~# | ||
+ | root@s4sk-proto:~# ifconfig tsn1 192.168.100.10 | ||
+ | [ 37.085621] rswitch_get_phy_node PHY interface = usxgmii | ||
+ | [ 37.087327] libphy: rswitch_mii: probed | ||
+ | [ 37.149669] Generic Clause 45 PHY etha1:01: attached PHY driver [Generic Clause 45 PHY] (mii_bus:phy_addr=etha1:01, irq=POLL) | ||
+ | root@s4sk-proto:~# ifconfig | ||
+ | lo Link encap:Local Loopback | ||
+ | inet addr:127.0.0.1 Mask:255.0.0.0 | ||
+ | inet6 addr: ::1/128 Scope:Host | ||
+ | UP LOOPBACK RUNNING MTU:65536 Metric:1 | ||
+ | RX packets:80 errors:0 dropped:0 overruns:0 frame:0 | ||
+ | TX packets:80 errors:0 dropped:0 overruns:0 carrier:0 | ||
+ | collisions:0 txqueuelen:1000 | ||
+ | RX bytes:6080 (5.9 KiB) TX bytes:6080 (5.9 KiB) | ||
+ | |||
+ | tsn0 Link encap:Ethernet HWaddr 96:9C:6E:27:F5:92 | ||
+ | inet addr:192.168.10.10 Bcast:192.168.10.255 Mask:255.255.255.0 | ||
+ | inet6 addr: fe80::949c:6eff:fe27:f592/64 Scope:Link | ||
+ | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 | ||
+ | RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | ||
+ | TX packets:37 errors:0 dropped:0 overruns:0 carrier:0 | ||
+ | collisions:0 txqueuelen:1000 | ||
+ | RX bytes:0 (0.0 B) TX bytes:4782 (4.6 KiB) | ||
+ | |||
+ | tsn1 Link encap:Ethernet HWaddr 62:61:1A:65:6D:52 | ||
+ | inet addr:192.168.100.10 Bcast:192.168.100.255 Mask:255.255.255.0 | ||
+ | inet6 addr: fe80::6061:1aff:fe65:6d52/64 Scope:Link | ||
+ | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 | ||
+ | RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | ||
+ | TX packets:31 errors:0 dropped:0 overruns:0 carrier:0 | ||
+ | collisions:0 txqueuelen:1000 | ||
+ | RX bytes:0 (0.0 B) TX bytes:3831 (3.7 KiB) | ||
+ | |||
+ | root@s4sk-proto:~# | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== QA site== | == QA site== | ||
+ | Please contact the S4SK Prototype board provider for the URL. | ||
== Known issues & Restrictions == | == Known issues & Restrictions == | ||
+ | <!-- | ||
+ | # [SW restriction] PCIe ch1(CN31): doesn't support yet | ||
+ | # [SW restriction] Ethernet TSN(CN14, 17) : doesn't support yet | ||
+ | # UFS: doesn't support yet | ||
+ | # Thermal : doesn't support yet | ||
+ | --> | ||
+ | # [Known issue] Bitbake error messages when building SDK first time | ||
+ | #: <syntaxhighlight lang="bash"> | ||
+ | ERROR: When reparsing <build directory>../poky/meta/recipes-core/meta/meta-environment.bb:do_generate_content, the basehash value changed from c498a7b1837b356d8c9f0ca2507a80c9bdd3ae9096919f0ed50942fca91d7965 to e0d701347e83f6723e7525070147bcf143886e5896a3c2dc49c1c17086844261. The metadata is not deterministic and this needs to be fixed. | ||
+ | ERROR: The following commands may help: | ||
+ | ERROR: $ bitbake meta-environment-s4sk-proto -cdo_generate_content -Snone | ||
+ | ERROR: Then: | ||
+ | ERROR: $ bitbake meta-environment-s4sk-proto -cdo_generate_content -Sprintdiff | ||
+ | </syntaxhighlight> | ||
+ | #: These error message are Poky 3.1.11 bug, it doesn't affect to build output. | ||
+ | #: Ignore error messages. | ||
+ | # [Restriction] The "reboot" command is not completed. Therefore, press the power(SW5) or reset(SW4) button. | ||
+ | # [Restriction] PCIe 1ch Endpoint doesn't work when both PCIe 0ch Root Complex and PCIe 1ch Endpoint are enabled. | ||
− | = | + | == Release History == |
+ | 2022/10/13 : First release<br> | ||
+ | 2022/12/27 : Support thermal, UFS, PCIe and Ethernet TSN function<br> | ||
+ | 2023/02/22 : Change DDR size to 4GB<br> |
Latest revision as of 20:56, 23 April 2023
Introduction
This page is for the Starter Kit prototype board equipped with R-Car S4(ws1.1).
This board is not for sale and has limited users.
The mass production version is scheduled for 2023. Please look forward to it.
Hardware
Type name
Y-ASK-RCAR-S4
Picture
[Top view]
[Bottom view]
Hardware feature
Note
Heat sink and FAN : Tighten all 8 screws on the top of the acrylic board to prevent high temperatures.
AC Adapter
AC adapter is not bundled with the board, please prepare it.
Here is the AC adapter information that has been confirmed.
Type Name | Where to buy |
---|---|
SMI36-5-V-P6 | Click to buy from Digi-Key Click to buy from Mouser |
Debug Serial
- CN13
- Two serial ports are recognized. Please use the younger number.
- Baudrate
- 921600
PCIe
- CH0(CN30)
- Root Complex
- CH1(CN31)
- Endpoint
Specification of DIP SW (SW3)
SW | Usage | When on | When off | Description | Default |
---|---|---|---|---|---|
SW3-1 | MD1 | L | H | Boot device selection [0] | On |
SW3-2 | MD2 | L | H | Boot device selection [1] | On |
SW3-3 | MD3 | L | H | Boot device selection [2] | Off |
SW3-4 | MD4 | L | H | Boot device selection [3] | On |
SW3-5 | MD5 | L / enabled | H / disabled | Secure authorization | Off |
SW3-6 | MD6 | L / ICU-MXB | H / CR52 | Master boot processor | On |
SW3-7 | - | ||||
SW3-8 | - |
MD4 | MD3 | MD2 | MD1 | Selection of Boot Device |
---|---|---|---|---|
0 | 1 | 0 | 0 | Serial flash ROM boot at single read 40MHz using DMA |
1 | 1 | 1 | 1 | SCIF Downloading mode |
MD6 | Selection of Master Boot Processor |
---|---|
0 | Booted through ICUMXA (Initial setting) |
1 | Booted through Cortex-R52 |
How to update the loader
Filename | Program Top Address | Qspi Save Address | Description |
---|---|---|---|
bootparam_sa0.srec | 0xEB200000 | 0x0000000 | ICUMX IPL (boot parameter) |
icumx_loader.srec | 0xEB210000 | 0x0040000 | ICUMX IPL |
cert_header_sa9.srec | 0xEB230000 | 0x0240000 | ICUMX IPL (certification) |
dummy_fw.srec | 0xEB240000 | 0x0280000 | Dummy firmware (Instead of secure firmware) |
dummy_rtos.srec | 0xE2100000 | 0x0500000 | Dummy RTOS (Instead of CR main OS) |
ca55_loader.srec | 0xE6300000 | 0x0480000 | |
dummy_g4mh_case0.srec | 0x00000000 | 0x0900000 | Dummy G4MH program image |
dummy_icumh_case1.srec | 0x00500000 | 0x0380000 | Dummy ICUMH program image |
bl31-s4sk-proto.srec | 0x46400000 | 0x0E00000 | Secure monitor |
tee-s4sk-proto.srec | 0x44100000 | 0x0E80000 | Tee OS |
u-boot-elf-s4sk-proto.srec | 0x50000000 | 0x0F80000 | U-Boot |
- If you do not have binaries, please contact the S4SK-Proto board provider.
Windows user
- Connect the Windows PC to the SK4SK-Proto(CN13) with a USB serial cable
- SW3 : Set to SCIF Download(DL) mode
- Power ON (SW5)
- Execute TeraTerm macro "S4SK_nonCX_QSPI_BL31.ttl"
- Power OFF (SW5)
- SW3 : Set to default mode
baudrate : 921600
Default | SCIF DL mode | |
---|---|---|
SW3.1 | On | Off |
SW3.2 | On | Off |
SW3.3 | Off | Off |
SW3.4 | On | Off |
SW3.5 | Off | Off |
SW3.6 | On | On |
SW3.7 | Off | Off |
SW3.8 | Off | Off |
SCIF Download mode (w/o verification) (C) Renesas Electronics Corp. -- Load Program to SystemRAM --------------- please send !
Teta Term: Control -> Macro -> S4SK_nonCX_QSPI_BL31.ttl
The following log is output:
Flash writer for R-Car S4 Series Rev.0.9.0 May 25,2022 > xls2 ===== Qspi/HyperFlash writing Command ============= (snip)
Linux user
$ git clone https://github.com/morimoto/renesas-bsp-rom-writer.git $ cd renesas-bsp-rom-writer $ WORK=`pwd` Please refer to the following file for the writing procedure. ${WORK}/README ${WORK}/board/s4sk-prototype/README ${WORK}/board/s4sk-prototype/linux/README
SW environments
Software | Revision |
---|---|
Yocto Project | 3.1.11 |
aarch64-poky-linux-gcc (GCC) | 9.3 |
Kernel Ver | 5.10.41 |
Userland 64/32bit | 64 |
U-Boot | 2020.10 |
Renesas Yocto BSP | v5.18.0 (R-Car SDK v3.9.0) |
Host PC
Ubuntu 20.04 LTS (64bit) is recommended as OS. 32bit version is not supported.
Supported BSP
- Linux (this page)
- Xen (here)
How to build
Installation of required tools and libraries
Ubuntu is used as Linux Host PC since Yocto Project Quick Start specifies Ubuntu as one of the distributions. You need to install the required packages as follows.
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \ build-essential chrpath socat cpio python3 python3-pip python3-pexpect \ xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa \ libsdl1.2-dev pylint3 xterm libarchive-zip-perl
Build script
- Build script(build.sh)
- 2023/02/22 updated
#!/bin/bash WORK=`pwd`/s4sk_proto META_RENESAS_COMMIT=eea3b61ec767d91624fdac0be2bea53e86db49be mkdir -p ${WORK} cd ${WORK} git clone git://git.yoctoproject.org/poky git clone git://git.openembedded.org/meta-openembedded git clone https://github.com/renesas-rcar/meta-renesas # Switch to proper branches/commits cd $WORK/poky git checkout -b tmp 74b22db6879b388d700f61e08cb3f239cf940d18 cd $WORK/meta-openembedded git checkout -b tmp 814eec96c2a29172da57a425a3609f8b6fcc6afe cd $WORK/meta-renesas git checkout -b tmp ${META_RENESAS_COMMIT} cd $WORK source $WORK/poky/oe-init-build-env build cp $WORK/meta-renesas/meta-rcar-gateway/docs/sample/conf/s4sk-proto/poky-gcc/bsp/*.conf conf/ bitbake rcar-image-gateway
- build
./build.sh
- If the build completes successfully, all the necessary files are generated in a following directory:
./s4sk_proto/build/tmp/deploy/images/s4sk-proto/
Manual steps
2022/12/27 updated
- Create a directory and switch to it
- Warning! Yocto builds require a lot of disk space (up to 100 GB). Make sure you have got enough before starting the build.
mkdir build cd build export WORK=`pwd`
- Clone basic Yocto layers:
cd $WORK git clone git://git.yoctoproject.org/poky git clone git://git.openembedded.org/meta-openembedded git clone https://github.com/renesas-rcar/meta-renesas
- Switch to proper branches/commits
cd $WORK/poky git checkout -b tmp 74b22db6879b388d700f61e08cb3f239cf940d18 cd $WORK/meta-openembedded git checkout -b tmp 814eec96c2a29172da57a425a3609f8b6fcc6afe cd $WORK/meta-renesas git checkout -b tmp a634d930d30af39eec68c9fc82ce113c74775c25
- Setup build environment
cd $WORK source poky/oe-init-build-env $WORK/build
- Prepare default configuration files.
cp $WORK/meta-renesas/meta-rcar-gateway/docs/sample/conf/s4sk-proto/poky-gcc/bsp/*.conf conf/ ./conf/ cd $WORK/build
- Start the build
bitbake rcar-image-gateway
- Building image can take up to a few hours depending on your host system performance.
After the build has been completed successfully, you should see the output similar to:NOTE: Tasks Summary: Attempted 4956 tasks of which 5 didn't need to be rerun and all succeeded.
- and the command prompt should return.
- Bitbake has generated all the necessary files in ./tmp/deploy/images directory.
You can verify its content:$ ls -1 `find ./tmp/deploy/images/s4sk-proto/ -maxdepth 1 -type l -print` ./tmp/deploy/images/s4sk-proto/Image ./tmp/deploy/images/s4sk-proto/Image-s4sk-proto.bin ./tmp/deploy/images/s4sk-proto/modules-s4sk-proto.tgz ./tmp/deploy/images/s4sk-proto/r8a779f0-s4sk-prototype-s4sk-proto.dtb ./tmp/deploy/images/s4sk-proto/r8a779f0-s4sk-prototype.dtb ./tmp/deploy/images/s4sk-proto/rcar-image-gateway-s4sk-proto.manifest ./tmp/deploy/images/s4sk-proto/rcar-image-gateway-s4sk-proto.tar.bz2 ./tmp/deploy/images/s4sk-proto/rcar-image-gateway-s4sk-proto.testdata.json ./tmp/deploy/images/s4sk-proto/u-boot-elf-s4sk-proto.srec ./tmp/deploy/images/s4sk-proto/u-boot-elf.srec ./tmp/deploy/images/s4sk-proto/u-boot-initial-env ./tmp/deploy/images/s4sk-proto/u-boot-initial-env-s4sk-proto ./tmp/deploy/images/s4sk-proto/u-boot-s4sk-proto.bin ./tmp/deploy/images/s4sk-proto/u-boot.bin
- Image is a Kernel image, r8a779f0-s4sk-prototype.dtb is a blob file, rcar-image-gateway-s4sk-proto.tar.bz2 is the rootfs, modules-s4sk-proto.tgz is kernel modules.
Build SDK
- After building BSP you may build SDK:
bitbake rcar-image-gateway -c populate_sdk
- After build finished the SDK installation script may be found in following path:
tmp/deploy/sdk/poky-glibc-x86_64-rcarimage-gateway-aarch64-spider-toolchain-3.1.11.sh
- Install SDK by run the following command and follow instructions on the screen:
sudo ./poky-glibc-x86_64-rcar-image-gateway-aarch64-spider-toolchain-3.1.11.sh
Note: Please see the Known issues & Restrictions chapter.
How to boot
Loading kernel and rootfs via SD card
This section describes steps that are necessary for preparing and booting from SD card.
Preparing SD card
WARNING! These steps will erase the SD card completely. In short, all files will be lost.
Follow these steps on the host machine:
- Partion your SD card to set 1 partition and ID=83 (Linux)
- Make sure the SD card doesn't contain any important files.
$ fdisk /dev/mmcblk0 -> d -> n -> p -> 1 -> t -> 83
- Format this partition to ext4
$ mkfs.ext4 /dev/mmcblk0p1
- Mount this partition on your host to any directory and upack the rcar-image-gateway-s4sk-proto.tar.bz2 into mounted folder.
$ mount /dev/mmcblk0p1 /mnt $ cd <your_yocto_build_directory> $ tar xfj build/tmp/deploy/images/s4sk-proto/rcar-image-gateway-s4sk-proto.tar.bz2 -C /mnt
- NOTE: probably you need to be a root user, hence use "sudo"
Configure U-Boot to boot from SD card
- Proper U-Boot command to boot from SD:
# setenv bootargs 'console=ttySC0,921600 rw root=/dev/mmcblk0p1 rootwait cma=560M' # ext4load mmc 0:1 0x48080000 /boot/Image # ext4load mmc 0:1 0x48000000 /boot/r8a779f0-s4sk-prototype.dtb # booti 0x48080000 - 0x48000000
- Example of U-Boot environment variables:
baudrate=921600 bootargs=root=console=ttySC0,921600 rw root=/dev/mmcblk0p1 rootwait cma=560M bootcmd=ext4load mmc 0:1 0x48080000 /boot/Image; ext4load mmc 0:1 0x48000000 /boot/r8a779f0-s4sk-prototype.dtb; booti 0x48080000 - 0x48000000 bootdelay=2 bootm_size=0x10000000 fdtcontroladdr=bbf45160 loadaddr=0x58000000 platform=r8a779f0 stderr=serial@e6540000 stdin=serial@e6540000 stdout=serial@e6540000
How to test some capabilities
Thermal
root@s4sk-proto:~# cat /sys/class/thermal/thermal_zone*/temp
31500
31000
31000
root@s4sk-proto:~#
CPU Hotplug
Ex)
root@s4sk-proto:~# cat /sys/devices/system/cpu/online
0-7
root@s4sk-proto:~#
root@s4sk-proto:~# echo 0 > /sys/devices/system/cpu/cpu1/online
[ 83.276294] IRQ209: set affinity failed(-22).
[ 83.276416] CPU1: shutdown
[ 83.277352] psci: CPU1 killed (polled 0 ms)
root@s4sk-proto:~#
root@s4sk-proto:~# cat /sys/devices/system/cpu/offline
1
root@s4sk-proto:~#
root@s4sk-proto:~# echo 1 > /sys/devices/system/cpu/cpu1/online
[ 116.336034] Detected VIPT I-cache on CPU1
[ 116.336084] GICv3: raw_spin_lock_init for SGI
[ 116.336093] GICv3: CPU1: found redistributor 100 region 0:0x00000000f1080000
[ 116.336163] CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
root@s4sk-proto:~# cat /sys/devices/system/cpu/offline
root@s4sk-proto:~#
UFS
After starting the Linux, from the start log, there are some messages are showed,
Well-known LUN WDC SDINFEO4-128G 1428 PQ: 0 ANSI: 6
UFS dev info: WDC SDINFEO4-128G rev 1428
Create partition
root@s4sk-proto:~# fdisk -u /dev/sda
Command (m for help): enter “o”
Command (m for help): enter “n”
Select (default p): enter “p”
Partition number (1-4, default 1): enter “1”
First sector (256-31246335): press enter key
Last sector, +/-sectors or +/-size{K,M,G,T,P} (256-31246335, default 31246335):press enter key
press enter key
Command (m for help): enter “w”
sda: sda1
Format partition
root@s4sk-proto:~# mkfs -t ext4 /dev/sda1
Read/Write
Ex)
root@s4sk-proto:~# mount /dev/sda1 /mnt/
[ 1045.920790] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
root@s4sk-proto:~# dd if=/dev/urandom of=/tmp/file bs=1M count=350
350+0 records in
350+0 records out
367001600 bytes (367 MB, 350 MiB) copied, 4.95581 s, 74.1 MB/s
root@s4sk-proto:~# cp /tmp/file /mnt/
root@s4sk-proto:~# sync
root@s4sk-proto:~# cmp /tmp/file /mnt/file
root@s4sk-proto:~#
PCIe Root Complex(CN30) : SSD
Environment:
- 1) MZVPV512HDGL-0000
- 2) U.2 to M.2 M-Key NVME SSD and PCIe
- 3) Oculink to U.2 Cable
- 4) SATA/IDE AC Adoperq(Japanese site)
root@s4sk-proto:~# mount /dev/nvme0n1p1 /mnt/ [ 25.899108] EXT4-fs (nvme0n1p1): mounted filesystem with ordered data mode. Opts: (null) root@s4sk-proto:~# mount -t tmpfs -o size=400M tmpfs /tmp root@s4sk-proto:~# dd if=/dev/urandom of=/tmp/file bs=1M count=350 350+0 records in 350+0 records out 367001600 bytes (367 MB, 350 MiB) copied, 4.94124 s, 74.3 MB/s root@s4sk-proto:~# cp /tmp/file /mnt/ root@s4sk-proto:~# sync root@s4sk-proto:~# cmp /mnt/file /tmp/file root@s4sk-proto:~#
pcitest [S4SK - Another S4 SK]
Environments
- <S4 SK Prototype board : PCIe CH0(CN30)[*1]> <--- OCuLink cable[*2] ---> Another <S4 SK Prototype board : PCIe CH1(CN31)[*3]>
- [*1] PCIe CH0(CN30) : Root Complex
- [*2] Ex) https://store.supermicro.com/supermicro-55cm-oculink-to-oculink-cable-cbl-sast-0818.html
- [*3] PCIe CH1(CN31) : Endpoint
Create DTB file for Endpoint
- Disable: Root Complex of PCIe CH0
- Enable : Endpoint of PCIe CH1
Ex)
$ cd (Your SDK Build directory)
$ ls
build meta-openembedded meta-renesas poky
$ source poky/oe-init-build-env build/
$ bitbake -c devshell linux-renesas
$ vi arch/arm64/boot/dts/renesas/r8a779f0-s4sk-prototype.dts
(snip)
&pciec0 {
status = "disabled"; <-- Change to disable !!!
pinctrl-0 = <&pcie0_pins>;
pinctrl-names = "default";
clkreq-gpios = <&gpio2 15 GPIO_ACTIVE_LOW>;
};
(snip)
&pciec1_ep {
status = "okay"; <-- Change to enable !!!
pinctrl-0 = <&pcie1_pins>;
pinctrl-names = "default";
clkreq-gpios = <&gpio2 16 GPIO_ACTIVE_LOW>;
};
$ make dtbs
$ exit
Output: build/tmp/work/s4sk_proto-poky-linux/linux-renesas/5.10.41+xxxx/linux-s4sk_proto-standard-build/arch/arm64/boot/dts/renesas/r8a779f0-s4sk-prototype.dtb
- Copy r8a779f0-s4sk-prototype.dtb to SD card for Endpoint as r8a779f0-s4sk-prototype_pcie1ep.dtb
Ex)
$ mount /dev/mmcblk0p1 /mnt
$ cp r8a779f0-s4sk-prototype.dtb /mnt/boot/r8a779f0-s4sk-prototype_pcie1ep.dtb
$ ls /mnt/boot
Image Image-5.10.41-yocto-standard r8a779f0-s4sk-prototype.dtb r8a779f0-s4sk-prototype_pcie1ep.dtb
pcitest
- Step 1: Start S4 SK of Endpoint using r8a779f0-s4sk-prototype_pcie1ep.dtb
=> setenv bootargs console=ttySC0,921600 rw root=/dev/mmcblk0p1 rootwait cma=560M
=> ext4load mmc 0:1 0x48080000 /boot/Image;ext4load mmc 0:1 0x48000000 /boot/r8a779f0-s4sk-prototype_pcie1ep.dtb;booti 0x48080000 - 0x48000000
(snip)
s4sk-proto login: root
root@s4sk-proto:~# sed -e 's/e65d0000.pciec0_ep/e65d8000.pciec1_ep/' ep_setup.sh > ep1_setup.sh
root@s4sk-proto:~# chmod +x ep1_setup.sh
root@s4sk-proto:~# ./ep1_setup.sh
Endpoint setup
mount: /sys/kernel/config: none already mounted or mount point busy.
completed.
root@s4sk-proto:~#
- Step 2: Start S4 SK of Root Complex (after Step 1)
=> setenv bootargs console=ttySC0,921600 rw root=/dev/mmcblk0p1 rootwait cma=560M
=> ext4load mmc 0:1 0x48080000 /boot/Image;ext4load mmc 0:1 0x48000000 /boot/r8a779f0-s4sk-prototype.dtb;booti 0x48080000 - 0x48000000
(snip)
s4sk-proto login: root
root@s4sk-proto:~# sed -e 's/1024000/102400/' -e 's/1024001/102401/' pcitest_script.sh > pcitest_script_s4sk.sh
root@s4sk-proto:~# chmod +x pcitest_script_s4sk.sh
root@s4sk-proto:~# ./pcitest_script_s4sk.sh
- Log: Root Complex
root@s4sk-proto:~# ./pcitest_script_s4sk.sh
BAR tests
BAR0: OKAY
BAR4: OKAY
MSI Interrupt tests
SET IRQ TYPE TO MSI: OKAY
MSI1: OKAY
MSI2: OKAY
(snip)
Copy Tests
COPY ( 1 bytes): OKAY
COPY ( 1024 bytes): OKAY
COPY ( 1025 bytes): OKAY
COPY ( 102400 bytes): OKAY
COPY ( 102401 bytes): OKAY
root@s4sk-proto:~#
- Log: Endpoint
[ 44.917496] WRITE => Size: 1 bytes DMA: NO Time: 0.000001320 seconds Rate: 739 KB/s
[ 45.941519]
[ 45.941519] WRITE => Size: 1024 bytes DMA: NO Time: 0.000003060 seconds Rate: 326797 KB/s
(snip)
[ 642.777482] COPY => Size: 1 bytes DMA: NO Time: 0.000002160 seconds Rate: 452 KB/s
[ 643.793517]
[ 643.793517] COPY => Size: 1024 bytes DMA: NO Time: 0.000060420 seconds Rate: 16550 KB/s
[ 644.809523]
[ 644.809523] COPY => Size: 1025 bytes DMA: NO Time: 0.000061500 seconds Rate: 16276 KB/s
[ 645.831665]
[ 645.831665] COPY => Size: 102400 bytes DMA: NO Time: 0.006186660 seconds Rate: 16163 KB/s
[ 646.851668]
[ 646.851668] COPY => Size: 102401 bytes DMA: NO Time: 0.006195241 seconds Rate: 16141 KB/s
Ethernet TSN
ifconfig
Ex)
root@s4sk-proto:~# ifconfig tsn0 192.168.10.10
[ 21.905703] rswitch_get_phy_node PHY interface = usxgmii
[ 22.909775] libphy: rswitch_mii: probed
[ 22.972707] Generic Clause 45 PHY etha0:00: attached PHY driver [Generic Clause 45 PHY] (mii_bus:phy_addr=etha0:00, irq=POLL)
root@s4sk-proto:~#
root@s4sk-proto:~#
root@s4sk-proto:~# ifconfig tsn1 192.168.100.10
[ 37.085621] rswitch_get_phy_node PHY interface = usxgmii
[ 37.087327] libphy: rswitch_mii: probed
[ 37.149669] Generic Clause 45 PHY etha1:01: attached PHY driver [Generic Clause 45 PHY] (mii_bus:phy_addr=etha1:01, irq=POLL)
root@s4sk-proto:~# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:80 errors:0 dropped:0 overruns:0 frame:0
TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6080 (5.9 KiB) TX bytes:6080 (5.9 KiB)
tsn0 Link encap:Ethernet HWaddr 96:9C:6E:27:F5:92
inet addr:192.168.10.10 Bcast:192.168.10.255 Mask:255.255.255.0
inet6 addr: fe80::949c:6eff:fe27:f592/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:4782 (4.6 KiB)
tsn1 Link encap:Ethernet HWaddr 62:61:1A:65:6D:52
inet addr:192.168.100.10 Bcast:192.168.100.255 Mask:255.255.255.0
inet6 addr: fe80::6061:1aff:fe65:6d52/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:3831 (3.7 KiB)
root@s4sk-proto:~#
QA site
Please contact the S4SK Prototype board provider for the URL.
Known issues & Restrictions
- [Known issue] Bitbake error messages when building SDK first time
ERROR: When reparsing <build directory>../poky/meta/recipes-core/meta/meta-environment.bb:do_generate_content, the basehash value changed from c498a7b1837b356d8c9f0ca2507a80c9bdd3ae9096919f0ed50942fca91d7965 to e0d701347e83f6723e7525070147bcf143886e5896a3c2dc49c1c17086844261. The metadata is not deterministic and this needs to be fixed. ERROR: The following commands may help: ERROR: $ bitbake meta-environment-s4sk-proto -cdo_generate_content -Snone ERROR: Then: ERROR: $ bitbake meta-environment-s4sk-proto -cdo_generate_content -Sprintdiff
- These error message are Poky 3.1.11 bug, it doesn't affect to build output.
- Ignore error messages.
- [Restriction] The "reboot" command is not completed. Therefore, press the power(SW5) or reset(SW4) button.
- [Restriction] PCIe 1ch Endpoint doesn't work when both PCIe 0ch Root Complex and PCIe 1ch Endpoint are enabled.
Release History
2022/10/13 : First release
2022/12/27 : Support thermal, UFS, PCIe and Ethernet TSN function
2023/02/22 : Change DDR size to 4GB