RZ-A/Boards/Stream-it



=RZ Stream it! Board= https://www.renesas.com/en-eu/solutions/key-technology/human-interface/rz-stream-it.html

The Stream it kit is intended to showcase the graphics and image capture capabilities of the RZ/A1L as well as 3rd party middleware (non-OS and RTOS). However, the board can be used to run XIP Linux as well.

The board contains a RZ/A1L wtih 3MB of internal RAM. However, there is a footprint to solder down an external SDRAM device. While it is possible to boot and run XIP Linux using only 3MB of RAM (no external SDRAM), these instructions are only when an SDRAM has been added.

Below are the instructions on how to build and load a XIP Linux image on a Stream it board along with a AXFS (XIP) file image. An external SDRAM chip will be used for system memory.

NOTE that these instructions assume you have the same 16Byte SDRAM populated on the board as outlined below.

The kernel version will be Linux-3.14

Board Modifications
SDRAM to Populate
 * The follow SDRAM was used:
 * ISSI 128Mb SYNCHRONOUS DRAM (16MByte)
 * IS42/45S16800F
 * 2M x 16 x 4 Banks

SDRAM Rework
 * Because the Stream it board was laid out for a 32MB SDRAM chip, the BA1 pin (pin 21) on the SDRAM chip needs to be lifted and then jumper-ed to its A12 (pin 36) so that it can be connected to the RZ's A13 signal. Pin 36 on this SDRAM chip is a NC, so driving it with A13 is not an issue.
 * Using a 16MB SDRAM instead of a 32MB SDRAM has the benefit of freeing up the CEU clock (VIO_CLK) that is shared with the A15 signal on port P3_14.



USB-to-Serial Driver

 * If you will be using Windows for your serial terminal, you will need to download the usb to serial drivers. They are the same drivers that are used for the RZ/A1 RSK board.
 * https://github.com/renesas-rz/rskrza1_bsp/tree/master/Extra/USB-Serial-Drivers(win)
 * If you will be using Linux for your serial terminal, it will show up as /dev/ttyACM0
 * Note that we will be using a baud rate of 115200bps(8 bits, 1 stop bit, no parity)

Install the RZ/A1 RSK BSP
$ git clone https://github.com/renesas-rz/rskrza1_bsp.git $ cd rskrza1_bsp
 * We will us the RSK BSP build environment even though we we will be using a Stream it board. The reason is that the u-boot and Linux repositories on github also support Stream it.
 * 1) Clone the BSP from github

Get Latest code from github
$ cd output/u-boot-2015.01 ; git checkout 2015.01-rskrza1 ; git pull ; cd ../.. $ cd output/linux-3.14 ; git checkout master ; git pull ; cd ../..
 * (which will include Stream it updates)
 * Update the u-boot and kernel source inside the BSP by pulling updates from github
 * Start in the base of the BSP (where the build.sh file is, where you should have left off from the last step)

Install Segger Jlink Drivers for Linux

 * Install the "J-Link Software and Documentation Pack" from Segger's website
 * https://www.segger.com/downloads/jlink
 * Hint: You need to click the "Click for downloads" to actually find the download links.

Building

 * The tested build environment was Ubuntu. If using another distribution, some changes might be needed (but I'm not sure what exactly).
 * Lines that start with the symbol '$' are to be copy/pasted into the Linux PC terminal (without the $)
 * Lines that start wit the symbol '=>' are u-boot commands
 * Lines that start wit the symbol '#' are just comments

Build the File System
$ ./build.sh buidlroot $ ./build.sh buidlroot menuconfig
 * We do this first because we need Buildroot to download the toolchain that we will use to build u-boot and the kernel.
 * NOTE that I suggest the 'minimum' file system option when prompted becase it makes the build much quicker.
 * NOTE that because the Stream it uses a different serial port (SCIF3) as the RSK board(SCIF2), we will have to modify the Buildroot config from it's default RSK board value.
 * Now go back and switch the serial console (BR2_TARGET_GENERIC_GETTY_PORT from /dev/ttySC2 to /dev/ttySC3
 * System configuration -> Run a getty (login prompt) after boot -> (ttySC2) TTY port -> Change "ttySC2" to ttySC3"
 * Now use ESC to back out of the menu and save the new config.

$ ./build.sh buidlroot $ ./build.sh axfs
 * Run Buildroot again (will be quick this time)
 * Also build the AXFS XIP file image

Build u-boot
$ ./build.sh u-boot streamit_defconfig $ ./build.sh u-boot

Build the Kernel and Device Tree
$ ./build.sh kernel streamit_xip_defconfig $ ./build.sh kernel xipImage $ ./build.sh kernel dtbs

Programming

 * Note that the RSK board has dual SPI flash where as the Stream it only has a single SPI flash, so the programming commands are a little different.
 * Note we can program u-boot and Device Tree directly to SPI flash using the Segger JLink. However, to program the kernel and file system, we first need to download the images to RAM and then let u-boot do the actual SPI flash programming.
 * The memory map of the SPI flash will be as follows:

Program u-boot into QSPI Flash
$ ./build.sh jlink output/u-boot-2015.01/u-boot.bin 0x18000000
 * Requires Jlink to be connected to Linux (if running a Virtual Machine)
 * This will program teh u-boot binary directly into the QSPI flash

- use USB serial port - baud rate is 115,200 bps - click the reset button - type "saveenv" in u-boot to save the "environment settings" to SPI flash (gets rid of BAD CRC warning message after reset)
 * Test that u-boot comes up
 * Note that you will need to have u-boot working in order to program the kernel and file system

Program Device Tree for into QSPI Flash
$ ./build.sh jlink output/linux-3.14/arch/arm/boot/dts/r7s72100-streamit.dtb 0x180C0000
 * This will program the u-boot binary directly into the QSPI flash

Program Kernel into QSPI Flash
$ ./build.sh jlink output/linux-3.14/arch/arm/boot/xipImage 0x0C000000 => sf probe 0 ; sf erase 200000 500000 ; sf write 0c000000 200000 500000
 * Make sure u-boot is programmed and u-boot is running
 * Download the kernel binary to on-chip RAM using Jlink:
 * After download, enter these u-boot commands to copy from RAM to SPI flash

Program File System
$ ./build.sh jlink output/axfs/rootfs.axfs.bin 0x0C000000 => sf probe 0 ; sf erase 00800000 C00000 ; sf write 0x0C000000 00800000 C00000
 * If your file system is smaller than 16MB (the size of SDRAM), use this method because it's faster:
 * After download, enter these u-boot commands to copy from RAM to SPI flash
 * Programs 12MB

$ ./build.sh jlink output/axfs/rootfs.axfs.bin 0x18800000
 * If your file system is larger than 16MB, use this method because it will program the SPI Flash directly...but it's going to take a while...
 * The reason is that the Stream it board only has 16MB of SDRAM so we can only download 16MB.

Booting the Board
=> run xsa_boot
 * In u-boot, type:


 * Linux login
 * USER: root
 * PASS: {no password}