Difference between revisions of "R-Car/Boards/S4SK-Proto"
(→CPU Hotplug) |
(→Linux user) |
||
Line 149: | Line 149: | ||
Please refer to the following file for the writing procedure. | Please refer to the following file for the writing procedure. | ||
${WORK}/README | ${WORK}/README | ||
− | ${WORK}/s4sk-prototype/README | + | ${WORK}/board/s4sk-prototype/README |
− | ${WORK}/s4sk-prototype/linux/README | + | ${WORK}/board/s4sk-prototype/linux/README |
</pre> | </pre> | ||
Revision as of 00:43, 28 October 2022
Contents
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]
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.12.0 (R-Car SDK v3.3.0) |
Host PC
Ubuntu 20.04 LTS (64bit) is recommended as OS. 32bit version is not supported.
Supported OS
Linux
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)
#!/bin/bash WORK=`pwd`/s4sk_proto s4sk_proto META_RENESAS_COMMIT=b3745d99266782e38a9b627ba207537c180f43e3 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
- 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 b3745d99266782e38a9b627ba207537c180f43e3
- 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.
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.
In order to prepare you SD card, follow these instructions on 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' # 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 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
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:~#
PCIe 0ch
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:~#
QA site
Please contact the S4SK Prototype board provider for the URL.
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
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.