RZ-A/Boards/GR-PEACH-bsp

=Hardware Setup=

Please refer to RZ-A/Boards/GR-PEACH

=Linux v4.9 Renesas BSP=

Below are the instructions on how to build and load a XIP Linux image on a GR-PEACH board along with a AXFS (XIP) file image. After kernel boot, you should only be using about 3MB of your 10MB internal RAM.

The kernel version will be Linux-4.9

Install the RZ/A1 RSK BSP
$ git clone https://github.com/renesas-rz/rza_linux-4.9_bsp.git $ cd rza_linux-4.9_bsp
 * 1) Clone the BSP from github

Select GR-PEACH as the Target Board
$ ./build.sh config
 * First enter the BSP configuration screen
 * Then change the Target Board selection (the first item in list) from RSKRZA1 to GR-PEACH
 * Select Save (the last item in the list)
 * Now all your build defaults and J-Link programming examples will be specifically for GR-PEACH

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 buildroot
 * We do this first because we need Buildroot to download the toolchain that we will use to build u-boot and the kernel.

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

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

Programming

 * These instructions assume you have replaced the 8MB SPI Flash with the 16MB SPI flash.
 * Note that the RSK board has dual SPI flash where as the GR-PEACH 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 u-boot
 * Requires Jlink to be connected to Linux (if running a Virtual Machine)
 * This will program the u-boot binary directly into the QSPI flash

- use mbed 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 dtb
 * This will program the device tree binary directly into the QSPI flash

Program Kernel into QSPI Flash
$ ./build.sh jlink xipImage 0x20000000 => sf probe 0 ; sf erase 100000 500000 ; sf write 20000000 100000 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

$ ./build.sh jlink output/linux-4.9/arch/arm/boot/xipImage 0x18100000
 * Alternatively, you could use Jlink to program the SPI flash directly (easier...but takes twice as long as u-boot)

Program File System
$ ./build.sh jlink rootfs_axfs 0x20000000 => sf probe 0 ; sf erase 600000 900000 ; sf write 20000000 600000 900000
 * If your file system is smaller than 9MB, use this method because it's faster:
 * After download, enter these u-boot commands to copy from RAM to SPI flash

$ ./build.sh jlink rootfs_axfs 0x18600000
 * If your file system is larger than 9MB, use this method because it will program the SPI Flash directly...but it's going to take a while...
 * The reason is that the RZ/A1H only has 10MB of on chip RAM, and u-boot is using the upper portion of RAM, so we can only download 9MB.

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


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