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

Jumper Positions
J1 - voltage select for LVDS camera "5V" - supply 5V to LVDS camera "12V" - supply 12V from CN4 to LVDS camera open - do not supply power to LVDS camera



J2 - power supply for LIN interface "Int" - use on-board +12V generator (default) "Ext" - use power from CN4



J3 - Si4689 firmware flash write enable: open - write disabled (default) closed - write enabled (for radio firmware update only)



J4 - DAB/FM antenna power supply (CN6) "5V" - supply +5V for DAB/FM antenna. 300 mA limit "12V" - supply +12V for DAB/FM antenna. 300 mA limit open - do not supply power for DAB/FM antenna. For passive antennas or antennas with own power supply. (default)



LEDs Explanation
LED1 - EthAVB activity LED2 - EthAVB link LED3 - LVDS camera deserializer status LED4 - LVDS camera deserializer LOCK indicator

Hardware
PCM3168A: 24-Bit, 96-kHz/192-kHz, 6-In/8-Out Audio Codec with Differential Input/Output (only 6 output channels used) TPA6133A2: Stereo Headphone Amplifiers for Headphones outputs OPA2134: High Performance Audio Operational Amplifiers for Line-outs and Microphone/Line-ins Connected to R-Car M2 processor through SSI3 and 4 in I2S TDM mode (Time Division Multiplexed Audio Interface).

Sound Stream Splitting/Mixing
CPLD is used to divide audio streams between Audio Codec and Bluetooth module. BT module occupied two last channels of 8-channel input and output stream. Stream muxing/demuxing is done fully transparent.



Input stream mixing is done similar way.



Software
From SW point of view PCM3168A codec is represented as 8-ch playback and 8-ch capture device. Due to share of WS and BCLK pins between SSI3 and SSI4 both playback and capture can be done with same sample rate only (48000 or 44100). Channels 6 and 7 of capture device is BT input stream. If WL1837 PCM interface is inactive silence will be captured on these channels. Same with playback - channels 6 and 7 are routed to PCM interface of WL1837 module. Using a PulseAudio soundcard can be splitted to several sink/sources.

Hardware
Si4689 single-chip digital receiver. SPI host control interface. I2S audio interface routed to SSI5 of R-Car M2 SST25VF016 16Mbit serial flash for firmware and setting

Software
From SW point of view Radio represented as stereo sound capture device and spidev. To control Si4689 several user-space tools provided.

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

Building the Yocto image
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 evaluation version of proprietary graphics and multimedia drivers from Renesas.

To download Multimedia and Graphics library, please use the following link: https://www.renesas.com/en-eu/software/D3017410.html To download related Linux drivers, please use the following link: https://www.renesas.com/en-eu/media/secret/solutions/automotive/rcar-demoboard/R-Car_Series_Evaluation_Software_Package_of_Linux_Drivers-20151228.zip

Graphic drivers are required for X11 and Wayland. Multimedia drivers are optional.

Unzip proprietary driver modules 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

Running Yocto image
Refer to Yocto for steps necessary for running 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 can optionaly check speed of Ethernet port by iperf util (add it to IMAGE_INSTALL_append in local.conf or build directly by bitbake and install via ipk): $ iperf -

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

Simple playback test can be done this way: speaker-test -c 8 -t wav 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.

Playing mp3 through 5.1 sound card with gstreamer: gst-launch-1.0 filesrc location=./test.mp3 ! mad ! audioresample ! audioconvert ! audio/x-raw, format=S32LE, rate=48000, channels=8 ! autoaudiosink

Recording sound from microphone of 5.1 sound card and playing it back: arecord -D hw:0 -c 8 -f S24_LE -r 48000 1.raw aplay -D hw:0 -c 8 -f S24_LE -r 48000 1.raw

NOTE: sound card jack inputs are made universal and you could is it as line inputs and/or microphone inputs.

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.