R-Car/Boards/Porter:PEXT01

Introduction
This is the official Wiki for Porter Infotainment Expansion Board.

Please refer to R-Car/Boards/Porter for Renesas R-Car M2 Porter board Rev C.

Hardware
This section contains information about Porter Expansion Board hardware.

Hardware Features

 * Ethernet AVB phy
 * KSZ9031 phy
 * MOST interface
 * Support both 3-pin and 6-pin MLB interface
 * Pinout compatible with Microchip evaluation boards
 * LVDS camera interface
 * MAX9272 deserializer
 * 8-bit wide video bus connected to VI2 interface of R-Car M2 CPU
 * 5V or 12V selectable supply voltage for camera with current limiting
 * High quality 24-bit audio codec PCM3168A
 * 6 input channels (3 stereo jacks for microphone connection)
 * 6 line out channels (RCA connectors)
 * 6 HP outputs (3 stereo jack connectors for direct headphones connection)
 * 44100/48000 Hz sampling frequency
 * Si4689 base AM/FM/DAB radio
 * Digital audio interface to R-Car M2 CPU
 * Additional flash storage for fast radio boot
 * Supply for active DAB antennas with current limit (5 or 12 V)
 * LIN interface (TJA1027 driver)
 * On-board +12V generator
 * GPS/GLONASS receiver
 * 9-axis sensor: 3D digital linear acceleration sensor, and a 3D digital angular rate sensor, a 3D digital magnetic sensor
 * WiFi/BT module Texas Instruments WL1837

EthernetAVB
This section provides information about Ethernet for Audio Video Bridging (AVB) for R-Car M2 Porter board.

R-Car M2 SoC provides Ethernet AVB functionality with 1000Mbps speed. This IP block shares pins with Ethernet MAC so only one of these interfaces can be used. R-Car M2 Porter board provides Ethernet MAC with KSZ8041RNLI PHY and Ethernet AVB connector (CN3). You can find this connector on the Porter hardware page. Thus it is necessary to disconnect KSZ8041RNLI PHY before using Ethernet AVB. To achieve this you should remove resistor R321. Resistors R1005 and R1006 allows to connect PHY reset pin to different SoC pins. Please, check that resistor R1005 is installed and R1006 is not. This resistor connects KSZ8041RNLI PHY reset pin with R-Car M2 SoC. Without this resistor MAC PHY remains in the reset mode and does not use shared pins. Next step you should set JP7 in open state. Pext01 board generates own 125MHz refclock.

Schematics
Porter Expansion Board schematics can be found in

How to build
Install 'repo' tool from Google

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo

Init repo in working directory

$ repo init -u https://github.com/CogentEmbedded/manifest.git -b v1.10.0_pext01

Sync sources

$ repo sync

Download proprietary driver modules from http://www.renesas.com/secret/r_car_download/rcar_demoboard.jsp and unzip them to ./proprietary folder. You should see the following files: $ ls -lh ./proprietary total 8.1M -rw-r--r-- 1 builduser builduser 5.8M Dec 28 17:21 R-Car_Series_Evaluation_Software_Package_for_Linux-20151228.tar.gz   -rw-r--r-- 1 builduser builduser 2.3M Dec 28 17:21 R-Car_Series_Evaluation_Software_Package_of_Linux_Drivers-20151228.tar.gz

Setup Environment

$ source meta-renesas/scripts/envsetup.sh porter-ext01 [builddir]

edit local.conf to setup workstation specific settings, for example DL_DIR could be pointed to a single download location for all builds

Build base image

$ bitbake core-image-weston

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 4704 tasks of which 31 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

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

How to test some capabilities of Porter EXT01
1. Gigabit Ethernet port:

Connect port to workstation/network via Ethernet switch or directly. Set up eth0 interface: $ ifconfig eth0 up Set up network address (via dhcp, for example): $ udhcpc -i eth0 After that you could optionaly check speed of Ethernet port by iperf util (add it to IMAGE_INSTALL_append in local.conf or build directlyby bitbake and install via ipk): $ iperf -s

Now run on your host machine iperf client: $ iperf -c 

2. LIN interface (see http://rtime.felk.cvut.cz/gitweb/linux-lin.git/blob/HEAD:/sllin/README.txt):

$ ldattach 25 /dev/ttySC9 $ ip link set sllin0 up

Use cangen util to send frames via lin.

3. Sound and radio:

Check existence of sound devices via aplay/arecord: $ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: pcm3168a [pcm3168a], device 0: rsnd-dai.0-pcm3168a pcm3168a-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: ak464x [ak464x], device 0: rsnd-dai.1-ak4642-hifi ak4642-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0

$ arecord -l **** List of CAPTURE Hardware Devices **** card 0: pcm3168a [pcm3168a], device 0: rsnd-dai.0-pcm3168a pcm3168a-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: ak464x [ak464x], device 0: rsnd-dai.1-ak4642-hifi ak4642-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: radio [radio], device 0: rsnd-dai.2-si468x-pcm si468x-pcm-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0

To scan and play radio FM stations you could use this shell script:

set -o pipefail if si_ctl -l "$1" | grep Frequency > /run/radio.frequency; then export LD_LIBRARY_PATH=/usr/local/lib exec gst-launch-1.0 alsasrc device='hw:2,0' ! \           queue ! \           audioconvert ! audioresample ! \       audio/x-raw,rate=48000 ! \           alsasink sync=false device='hw:1,0'
 * 1) !/bin/sh

To set radio station and change FM/AM see si_ctl util. 4. GPS/GLONASS:

Available as NMEA through /dev/ttySC7

5. WiFi: To check wifi and scan available WAPs run: $ ifconfig wlan0 up  $ iwlist wlan0 scan

6. Bluetooth: To check bluetooth and scan available BT devices run: $ hciconfig hci0 up  $ hcitool -i hci0 scan

7. Sensors (LSM9DS0) : Accelerometer -- /dev/input/event0 Magnetometer -- /dev/input/event1 Gyroscope    -- /dev/input/event2

Installing Porter Expansion Board
Use the following procedure to install Porter Expansion Board to the Porter Board. 1. Find EXIO and Ethernet AVB connectors on both Porter and Porter Expansion boards. 2. Align and carefully push them to each other until Ethernet AVB and EXIO connectors are fully inserted. 3. SD Cable connection. 3.1 Take SD Adapter. Carefully pull up brown cable latch. 3.2 Take SD cable. Plug one side of this flat cable to the cable port. Connectors on the cable should fit port connectors. (Position the side of SD cable with the connectors on the opposite side from the latch, as displayed on the Step 3.) 3.3 Lock the latch by carefully pushing it down. 3.4 Repeat the aforementioned steps with another cable's side and SDIO port (CN9). 4. Plug SD Adapter to the Porter Board's SD Card slot (CN9). 5. Now, when boards are reliably mounted and connected with SD adapter, use 12V power supply splitter cables to connect both Porter and Porter Expansion board's power plugs to one power adapter.