[Renesas] Update Renesas bsp version
[AGL/documentation.git] / docs / 0_Getting_Started / 2_Building_AGL_Image / 5_3_RCar_Gen_3.md
1 # Building for Supported Renesas Boards
2
3 AGL supports building for several automotive
4 [Renesas](https://www.renesas.com/us/en/solutions/automotive.html) board kits.
5 Renesas is the number one supplier of vehicle control microcontrollers and
6 System on a Chip (SoC) products for the automotive industry.
7
8 This section provides the build and deploy steps you need to create an
9 image for the following Renesas platforms:
10
11 * [Renesas R-Car Starter Kit Pro Board](https://www.elinux.org/R-Car/Boards/M3SK)
12 * [Renesas R-Car Starter Kit Premier Board](https://www.elinux.org/R-Car/Boards/H3SK)
13 * [Renesas Salvator-X Board](https://www.elinux.org/R-Car/Boards/Salvator-X)
14 * [Renesas Kingfisher Infotainment Board](https://elinux.org/R-Car/Boards/Kingfisher)
15
16 **NOTE:** You can find similar information for the Pro and Premier board kits on the
17 [R-Car/Boards/Yocto-Gen3](https://elinux.org/R-Car/Boards/Yocto-Gen3) page on [elinux.org](https://elinux.org).
18 The information on this page describes setup and build procedures for both of these
19 Renesas development kits.
20
21 Additionally, the AGL Reference Hardware platform is based on the same Renesas
22 H3 processor used on the Renesas R-Car Starter Kit Premier and Salvator-X boards,
23 so support for it leverages the Starter Kit Premier (also known as "h3ulcb")
24 build.
25 For more information on the AGL reference hardware platform, please refer to its
26 [manual](https://wiki.automotivelinux.org/_media/eg-rhsa/rh_manual_ver.1.0.pdf),
27 or the Reference Hardware System Architecture Expert Group
28 [wiki page](https://wiki.automotivelinux.org/eg-rhsa).
29
30 ## 1. Downloading Proprietary Drivers
31
32 Before setting up the build environment, you need to download proprietary drivers from the
33 [R-Car H3/M3 Software library and Technical document](https://www.renesas.com/us/en/application/automotive/r-car-h3-m3-documents-software)
34 site.
35
36 Follow these steps to download the drivers you need:
37
38 1. **Determine the Files You Need:**
39
40      Run the ``setup_mm_packages.sh`` script as follows to
41      display the list of ZIP files containing the drivers you need.
42      Following is an example:
43
44      ```sh
45      grep -rn ZIP_.= $AGL_TOP/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh
46      ```
47
48      The script's output identifies the files you need to download from the page.
49
50 2. **Get Your Board Support Package (BSP) Version:**
51
52     Be sure to have the correct BSP version of the R-Car Starter Kit
53     based on the version of the AGL software you are using.
54     Find the appropriate download links on the
55     [R-Car H3/M3 Software library and Technical document](https://www.renesas.com/us/en/application/automotive/r-car-h3-m3-documents-software)
56     site.
57     The file pairs are grouped according to the Yocto Project version you are
58     using with the AGL software.
59
60     Use the following table to map the Renesas version to your AGL software:
61
62     | AGL Version | Renesas version |
63     |:-:|:-:|
64     | AGL master | 4.7.0 |
65
66 3. **Download the Files:**
67
68     Start the download process by clicking the download link.
69     If you do not have an account with Renesas, you will be asked to register a free account.
70     You must register and follow the "Click Through" licensing process
71     in order to download these proprietary files.
72
73     If needed, follow the instructions to create the free account by providing the required
74     account information.
75     Once the account is registered and you are logged in, you can download the files.
76
77     **NOTE:** You might have to re-access the
78     [original page](https://www.renesas.com/us/en/application/automotive/r-car-h3-m3-documents-software)
79     that contains the download links you need after creating the account and logging in.
80
81 4. **Create an Environment Variable to Point to Your Download Area:**
82
83     Create and export an environment variable named `XDG_DOWNLOAD_DIR` that points to
84     your download directory.
85     Here is an example:
86
87     ```sh
88     $ export XDG_DOWNLOAD_DIR=$HOME/Downloads
89     ```
90
91 5. **Be Sure the Files Have Rights:**
92
93     Be sure you have the necessary rights for the files you downloaded.
94     You can use the following command:
95
96     ```sh
97     chmod a+rw $XDG_DOWNLOAD_DIR/*.zip
98     ```
99
100 6. **Check to be Sure the Files are Downloaded and Have the Correct Rights:**
101
102     Do a quick listing of the files to ensure they are in the download directory and
103     they have the correct access rights.
104     Here is an example:
105
106     ```sh
107     $ ls -l $XDG_DOWNLOAD_DIR/*.zip
108     -rw-rw-r-- 1 scottrif scottrif 4662080 Nov 19 14:48 /home/scottrif/Downloads/R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-weston8-20200923.zip
109     -rw-rw-r-- 1 scottrif scottrif 3137626 Nov 19 14:49 /home/scottrif/Downloads/R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-weston8-20200923.zip
110     ```
111
112 ## 2. Getting More Software
113
114 1. **Get the `bmaptool`:**
115
116     Download this tool from the
117     [bmap-tools](https://build.opensuse.org/package/show/isv:LinuxAutomotive:AGL_Master/bmap-tools)
118     repository.
119     The site has pre-built packages (DEB or RPM) for the supported host
120     operating systems.
121
122 ## 3. Getting Your Hardware Together
123
124 Gather together this list of hardware items, which is not exhaustive.
125 Having these items ahead of time saves you from having to try and
126 collect hardware during development:
127
128    * Supported Starter Kit Gen3 board with its 5V power supply.
129    * Micro USB-A cable for serial console.
130      This cable is optional if you are using Ethernet and an SSH connection.
131    * USB 2.0 Hub.  The hub is optional but makes it easy to connect multiple USB devices.
132    * Ethernet cable.  The cable is optional if you are using a serial console.
133    * HDMI type D (Micro connector) cable and an associated display.
134    * 4 Gbyte minimum MicroSD Card.  It is recommended that you use a class 10 type.
135    * USB touch screen device such as the GeChic 1502i/1503i.  A touch screen device is optional.
136
137    **NOTE:** The Salvator-X Board has NDA restrictions.
138    Consequently, less documentation is available for this board both here and across the
139    Internet.
140
141
142 ## 4. Making Sure Your Build Environment is Correct
143
144 The
145 "[Initializing Your Build Environment](./3_Initializing_Your_Build_Environment.md)"
146 section presented generic information for setting up your build environment
147 using the `aglsetup.sh` script.
148 If you are building an image for a supported Renesas board,
149 you need to take steps to make sure your build host is set up correctly.
150
151 1. **Define Your Board:**
152
153     Depending on your Renesas board, define and export a `MACHINE` variable as follows:
154
155     | Board | `MACHINE` Setting |
156     |:-:|:-:|
157     | Starter Kit Pro/M3  | `MACHINE`=m3ulcb |
158     | Starter Kit Pro/M3 + kingfisher support | `MACHINE`=m3ulcb-kf |
159     | Starter Kit Pro/M3 without graphic driver (using pixman)  | `MACHINE`=m3ulcb-nogfx |
160     | Starter Kit Premier/H3  | `MACHINE`=h3ulcb |
161     | Starter Kit Premier/H3  + kingfisher support  | `MACHINE`=h3ulcb-kf |
162     | Starter Kit Premier/H3  without graphic driver (using pixman)  | `MACHINE`=h3ulcb-nogfx |
163     | Salvator-X  | `MACHINE`=h3-salvator-x |
164     | AGL Reference Hardware | `MACHINE`=h3ulcb |
165     | AGL Reference Hardware  without graphic driver (using pixman)  | `MACHINE`=h3ulcb-nogfx |
166
167     For example, the following command defines and exports the `MACHINE` variable
168     for the Starter Kit Premier/H3 Board:
169
170     ```sh
171     $ export MACHINE=h3ulcb
172     ```
173
174 2. **Run the `aglsetup.sh` Script:**
175
176     Use the following commands to run the AGL Setup script:
177
178     ```sh
179     $ cd $AGL_TOP
180     $ source meta-agl/scripts/aglsetup.sh -m $MACHINE -b build agl-devel agl-demo
181     ```
182
183     If building for the AGL Reference Hardware (with `MACHINE` set to "h3ulcb" or
184     "h3ulcb-nogfx"), add `agl-refhw-h3`, for example:
185
186     ```sh
187     $ cd $AGL_TOP
188     $ source meta-agl/scripts/aglsetup.sh -m $MACHINE -b build agl-devel agl-demo agl-refhw-h3
189     ```
190
191     **NOTE:**
192     Running the `aglsetup.sh` script automatically places you in the
193     working directory (i.e. `$AGL_TOP/build`).
194     You can change this default behavior by adding the "-f" option to the
195     script's command line.
196
197     In the previous command, the "-m" option sets your machine to the previously
198     defined `MACHINE` variable.
199     The "-b" option defines your Build Directory, which is the
200     default `$AGL_TOP/build`.
201     Finally, the AGL features are provided to support building the AGL Demo image
202     for the Renesas board.
203
204     You can learn more about the AGL Features in the
205     "[Initializing Your Build Environment](./3_Initializing_Your_Build_Environment.md)"
206     section.
207
208 3. **Examine the Script's Log:**
209
210     Running the `aglsetup.sh` script creates the `setup.log` file, which is in
211     the `build/conf` folder.
212     You can examine this log to see the results of the script.
213     For example, suppose the graphics drivers were missing or could not be extracted
214     when you ran the script.
215     In case of missing graphics drivers, you could notice an error message
216     similar to the following:
217     ```text
218     [snip]
219     --- fragment /home/working/workspace_agl_master/meta-agl/templates/machine/h3ulcb/50_setup.sh
220     /home/working/workspace_agl_master /home/working/workspace_agl_master/build_gen3
221     The graphics and multimedia acceleration packages for
222     the R-Car Gen3 board can be downloaded from:
223     https://www.renesas.com/en-us/solutions/automotive/rcar-demoboard-2.html
224
225     These 2 files from there should be store in your'/home/devel/Downloads' directory.
226       R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-weston8-20200923.zip
227       R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-weston8-20200923.zip
228     /home/working/workspace_agl_master/build_gen3
229     --- fragment /home/working/workspace_agl_master/meta-agl/templates/base/99_setup_EULAconf.sh
230     --- end of setup script
231     OK
232     Generating setup file: /home/working/workspace_agl_master/build_gen3/agl-init-build-env ... OK
233     ------------ aglsetup.sh: Done
234     [snip]
235     ```
236
237     If you encounter this issue, or any other unwanted behavior, you can fix the error
238     mentioned, remove the `$AGL_TOP/build` directory, and then re-launch the
239     `aglsetup.sh` again.
240
241     Here is another example that indicates the driver files could not be extracted from the downloads directory:
242     ```
243     ~/workspace_agl/build/conf $ cat setup.log
244     --- beginning of setup script
245     --- fragment /home/working/workspace_agl/meta-agl/templates/base/01_setup_EULAfunc.sh
246     --- fragment /home/working/workspace_agl/meta-agl/templates/machine/h3ulcb/50_setup.sh
247     ~/workspace_agl ~/workspace_agl/build
248     ERROR: FILES "+/home/working/Downloads/R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-weston8-20200923.zip+" NOT EXTRACTING CORRECTLY
249     ERROR: FILES "+/home/working/Downloads/R-car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-weston8-20200923.zip+" NOT EXTRACTING CORRECTLY
250     The graphics and multimedia acceleration packages for
251     the R-Car Gen3 board BSP can be downloaded from:
252     <https://www.renesas.com/us/en/application/automotive/r-car-h3-m3-documents-software>
253
254     These 2 files from there should be stored in your
255     '/home/working/Downloads' directory.
256       R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-weston8-20200923.zip
257       R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-weston8-20200923.zip
258     ERROR: Script /home/working/workspace_agl/build/conf/setup.sh failed
259     [snip]
260     ```
261
262 ## 5. Checking Your Configuration
263
264 Aside from environment variables and parameters you establish through
265 running the `aglsetup.sh` script, you can ensure your build's configuration
266 is just how you want it by examining the `local.conf` configuration file.
267
268 You can find this configuration file in the Build Directory (e.g.
269 `$TOP_DIR/build/conf/local.conf`).
270
271 In general, the defaults along with the configuration fragments the
272 `aglsetup.sh` script applies in the `local.conf` file are good enough.
273 However, you can customize aspects by editing the `local.conf` file.
274 See the
275 "[Customizing Your Build](4_Customizing_Your_Build.md)"
276 section for common configurations you might want to consider.
277
278 **NOTE:** For detailed explanations of the configurations you can make
279 in the ``local.conf`` file, consult the
280 [Yocto Project Documentation](https://www.yoctoproject.org/docs/).
281
282 A quick way to see if you have the `$MACHINE` variable set correctly
283 is to use the following command:
284
285 ```sh
286 grep -w -e "^MACHINE =" $AGL_TOP/build/conf/local.conf
287 ```
288
289 Depending on the Renesas board you are using, you should see output
290 as follows:
291
292 ```sh
293 MACHINE = "h3ulcb"
294 ```
295 or
296 ```sh
297 MACHINE = "m3ulcb"
298 ```
299 or
300 ```sh
301 MACHINE = "h3-salvator-x"
302 ```
303
304 If you ran the `aglsetup.sh` script as described in the
305 "[Making Sure Your Build Environment is Correct](./5_3_RCar_Gen_3.md#4-making-sure-your-build-environment-is-correct)"
306 section earlier, the "agl-devel", "agl-demo", "agl-netboot", "agl-appfw-smack", and
307 "agl-localdev" AGL features will be in effect.
308 These features provide the following:
309
310 * A debugger (gdb)
311 * Some tweaks, including a disabled root password
312 * A SFTP server
313 * The TCF Agent for easier application deployment and remote debugging
314 * Some extra system tools such as USB and bluetooth
315 * Support for the AGL demo platform
316 * Network boot support through TFTP and NBD protocols
317 * [IoT.bzh](https://iot.bzh/en/) Application Framework plus
318   [SMACK](https://en.wikipedia.org/wiki/Smack_(software)) and
319   [Cynara](https://wiki.tizen.org/Security:Cynara)
320 * Support for local development including `localdev.inc` when present
321
322 ## 6. Using BitBake
323
324 This section shows the `bitbake` command used to build the AGL image.
325 Before running BitBake to start your build, it is good to be reminded that AGL
326 does provide pre-built images for developers that work with supported hardware.
327 You can find these pre-built images on the
328 [AGL Download web site](https://download.automotivelinux.org/AGL/release).
329
330 Start the build using the `bitbake` command.
331
332 **NOTE:** An initial build can take many hours depending on your
333 CPU and and Internet connection speeds.
334 The build also takes approximately 100G-bytes of free disk space.
335
336 For this example, the target is "agl-demo-platform":
337
338 ```sh
339 bitbake agl-demo-platform
340 ```
341
342 The build process puts the resulting image in the Build Directory:
343
344 ```
345 <build_directory>/tmp/deploy/images/$MACHINE
346 ```
347
348 ## 7. Booting the Image Using a MicroSD Card
349
350 To boot your image on the Renesas board, you need to do three things:
351
352 1. Update all firmware on the board.
353 2. Prepare the MicroSD card to you can boot from it.
354 3. Boot the board.
355
356 **NOTE:** For subsequent builds, you only have to re-write the MicroSD
357 card with a new image.
358
359 ### Updating the Board's Firmware
360
361 Follow these steps to update the firmware:
362
363 1. **Update the Sample Loader and MiniMonitor:**
364
365     You only need to make these updates one time per device.
366
367     Follow the procedure found on the
368     eLinux.org wiki to update to at least version 3.02,
369     which is mandatory to run the AGL image
370     ([R-car loader update](https://elinux.org/R-Car/Boards/Kingfisher#How_to_update_of_Sample_Loader_and_MiniMonitor)).
371
372 2. **Update the Firmware Stack:**
373
374     You only need to update the firmware stack if you are
375     using the Eel or later (5.0) version of AGL software.
376
377     M3 and H3 Renesas board are AArch64 platforms.
378     As such, they have a firmware stack that is divided across: **ARM Trusted Firmware**, **OP-Tee** and **U-Boot**.
379
380     If you are using the Eel (5.0) version or later of the AGL software, you must update
381     the firmware using the **[h3ulcb] [R-car h3ulcb firmware update](http://elinux.org/R-Car/Boards/H3SK#Flashing_firmware)**
382     or **[m3ulcb] [R-car m3ulcb firmware update](https://elinux.org/R-Car/Boards/M3SK#Flashing_firmware)** links from the
383     [Embedded Linux Wiki](https://www.elinux.org/Main_Page) (i.e. `elinux.org`).
384
385     The table in the wiki lists the files you need to flash the firmware.
386     You can find these files in the following directory:
387
388     ```sh
389     $AGL_TOP/build/tmp/deploy/images/$MACHINE
390     ```
391
392     **NOTE:** The Salvator-X firmware update process is not documented on eLinux.
393     **NOTE:** The AGL Reference Hardware board generally should not require a
394     firmware update to be usable, and has a slightly different update procedure.
395     If you do need to update the firmware, the procedure is documented
396     [here](https://git.automotivelinux.org/AGL/meta-agl-refhw/tree/meta-agl-refhw-gen3/docs/ReferenceHW_Rcar_gen3.md).
397
398 ### Preparing the MicroSD Card
399
400 Plug the MicroSD card into your Build Host.
401 After plugging in the device, use the `dmesg` command as follows to
402 discover the device name:
403 ```sh
404 $ dmesg | tail -4
405 [ 1971.462160] sd 6:0:0:0: [sdc] Mode Sense: 03 00 00 00
406 [ 1971.462277] sd 6:0:0:0: [sdc] No Caching mode page found
407 [ 1971.462278] sd 6:0:0:0: [sdc] Assuming drive cache: write through
408 [ 1971.463870]  sdc: sdc1 sdc2
409 ```
410 In the previous example, the MicroSD card is attached to the device `/dev/sdc`.
411 You can also use the `lsblk` command to show all your devices.
412 Here is an example that shows the MicroSD card as `/dev/sdc`:
413 ```sh
414 $ lsblk
415   NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
416   sda      8:0    0 167,7G  0 disk
417   ├─sda1   8:1    0   512M  0 part /boot/efi
418   ├─sda2   8:2    0 159,3G  0 part /
419   └─sda3   8:3    0   7,9G  0 part [SWAP]
420   sdb      8:16   0 931,5G  0 disk
421   └─sdb1   8:17   0 931,5G  0 part /media/storage
422   sdc      8:32   1  14,9G  0 disk
423   ├─sdc1   8:33   1    40M  0 part
424   └─sdc2   8:34   1   788M  0 part
425 ```
426 **IMPORTANT NOTE:** Before re-writing any device on your Build Host, you need to
427 be sure you are actually writing to the removable MicroSD card and not some other
428 device.
429 Each computer is different and removable devices can change from time to time.
430 Consequently, you should repeat the previous operation with the MicroSD card to
431 confirm the device name every time you write to the card.
432
433 To summarize this example so far, we have the following:
434
435 * The first SATA drive is `/dev/sda`.
436
437 * `/dev/sdc` corresponds to the MicroSD card, and is also marked as a removable device.
438   You can see this in the output of the `lsblk` command where "1" appears in the "RM" column
439   for that device.
440
441 Now that you have identified the device you are going to be writing the image on,
442 you can use the `bmaptool` to copy the image to the MicroSD card.
443
444 Your desktop system might offer a choice to mount the MicroSD automatically
445 in some directory.
446 For this example, assume that the MicroSD card mount directory is stored in the
447 `$SDCARD` variable.
448
449 Following are example commands that write the image to the MicroSD card:
450
451 ```sh
452 cd $AGL_TOP/build/tmp/deploy/images/$MACHINE
453 bmaptool copy ./agl-demo-platform-$MACHINE.wic.xz <boot_device_name>
454 ```
455
456 Alternatively, you can leave the image in an uncompressed state and write it
457 to the MicroSD card:
458
459 ```sh
460 sudo umount <boot_device_name>
461 xzcat ./agl-demo-platform-$MACHINE.wic.xz | sudo dd of=<boot_device_name> bs=4M
462 sync
463 ```
464
465 ### Booting the Board
466
467 Follow these steps to boot the board:
468
469 1. Use the board's power switch to turn off the board.
470
471 2. Insert the MicroSD card into the board.
472
473 3. Verify that you have plugged in the following:
474
475     * An external monitor into the board's HDMI port
476
477     * An input device (e.g. keyboard, mouse, touchscreen, and so forth) into the board's USB ports.
478
479 4. Use the board's power switch to turn on the board.
480
481 After a few seconds, you will see the AGL splash screen on the display and you
482 will be able to log in at the console's terminal or using the graphic screen.
483
484 ## 8. Setting Up the Serial Console
485
486 Setting up the Serial Console involves the following:
487
488 * Installing a serial client on your build host
489 * Connecting your build host to your Renesas board's serial port
490 * Powering on the board to get a shell at the console
491 * Configuring U-Boot parameters
492 * Logging into the console
493 * Determining the board's IP address
494
495 ### Installing a Serial Client on Your Build Host
496
497 You need to install a serial client on your build host.
498 Some examples are:
499
500 * [GNU Screen](https://en.wikipedia.org/wiki/GNU_Screen)
501 * [picocom](https://linux.die.net/man/8/picocom)
502 * [Minicom](https://en.wikipedia.org/wiki/Minicom)
503
504 Of these three, "picocom" has the least dependencies and is therefore
505 considered the "lightest" solution.
506
507 ### Connecting Your Build Host to Your Renesas Board's Serial Port
508
509 You need to physically connect your build host to the Renesas board using
510 a USB cable from the host to the serial CP2102 USP port (i.e. Micro USB-A port)
511 on the Renesas board.
512
513 Once you connect the board, determine the device created for the serial link.
514 Use the ``dmesg`` command on your build host.
515 Here is an example:
516 ```sh
517 dmesg | tail 9
518 [2097783.287091] usb 2-1.5.3: new full-speed USB device number 24 using ehci-pci
519 [2097783.385857] usb 2-1.5.3: New USB device found, idVendor=0403, idProduct=6001
520 [2097783.385862] usb 2-1.5.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
521 [2097783.385864] usb 2-1.5.3: Product: FT232R USB UART
522 [2097783.385866] usb 2-1.5.3: Manufacturer: FTDI
523 [2097783.385867] usb 2-1.5.3: SerialNumber: AK04WWCE
524 [2097783.388288] ftdi_sio 2-1.5.3:1.0: FTDI USB Serial Device converter detected
525 [2097783.388330] usb 2-1.5.3: Detected FT232RL
526 [2097783.388658] usb 2-1.5.3: FTDI USB Serial Device converter now attached to ttyUSB0
527 ```
528 The device created is usually "/dev/ttyUSB0".
529 However, the number might vary depending on other USB serial ports connected to the host.
530
531 To use the link, you need to launch the client.
532 Here are three commands, which vary based on the serial client, that show
533 how to launch the client:
534
535 ```sh
536 $ picocom -b 115200 /dev/ttyUSB0
537 ```
538
539 or
540
541 ```sh
542 $ minicom -b 115200 -D /dev/ttyUSB0
543 ```
544
545 or
546
547 ```sh
548 $ screen /dev/ttyUSB0 115200
549 ```
550
551 ### Powering on the Board to Get a Shell at the Console
552
553 Both the Pro and Premier kits (e.g.
554 [m3ulcb](https://elinux.org/R-Car/Boards/M3SK) and
555 [h3ulcb](https://elinux.org/R-Car/Boards/H3SK#Hardware)) have nine
556 switches (SW1 through SW9).
557 To power on the board, "short-press" SW8, which is the power switch.
558
559 Following, is console output for the power on process for each kit:
560
561 **h3ulcb**:
562 ```text
563 NOTICE:  BL2: R-Car Gen3 Initial Program Loader(CA57) Rev.1.0.7
564 NOTICE:  BL2: PRR is R-Car H3 ES1.1
565 NOTICE:  BL2: LCM state is CM
566 NOTICE:  BL2: DDR1600(rev.0.15)
567 NOTICE:  BL2: DRAM Split is 4ch
568 NOTICE:  BL2: QoS is Gfx Oriented(rev.0.30)
569 NOTICE:  BL2: AVS setting succeeded. DVFS_SetVID=0x52
570 NOTICE:  BL2: Lossy Decomp areas
571 NOTICE:       Entry 0: DCMPAREACRAx:0x80000540 DCMPAREACRBx:0x570
572 NOTICE:       Entry 1: DCMPAREACRAx:0x40000000 DCMPAREACRBx:0x0
573 NOTICE:       Entry 2: DCMPAREACRAx:0x20000000 DCMPAREACRBx:0x0
574 NOTICE:  BL2: v1.1(release):41099f4
575 NOTICE:  BL2: Built : 19:20:52, Jun  9 2016
576 NOTICE:  BL2: Normal boot
577 NOTICE:  BL2: dst=0xe63150c8 src=0x8180000 len=36(0x24)
578 NOTICE:  BL2: dst=0x43f00000 src=0x8180400 len=3072(0xc00)
579 NOTICE:  BL2: dst=0x44000000 src=0x81c0000 len=65536(0x10000)
580 NOTICE:  BL2: dst=0x44100000 src=0x8200000 len=524288(0x80000)
581 NOTICE:  BL2: dst=0x49000000 src=0x8640000 len=1048576(0x100000)
582
583
584 U-Boot 2015.04 (Jun 09 2016 - 19:21:52)
585
586 CPU: Renesas Electronics R8A7795 rev 1.1
587 Board: H3ULCB
588 I2C:   ready
589 DRAM:  3.9 GiB
590 MMC:   sh-sdhi: 0, sh-sdhi: 1
591 In:    serial
592 Out:   serial
593 Err:   serial
594 Net:   Board Net Initialization Failed
595 No ethernet found.
596 Hit any key to stop autoboot:  0
597 =>
598 ```
599
600 **m3ulcb**:
601 ```text
602 NOTICE:  BL2: R-Car Gen3 Initial Program Loader(CA57) Rev.1.0.14
603 NOTICE:  BL2: PRR is R-Car M3 Ver1.0
604 NOTICE:  BL2: Board is Starter Kit Rev1.0
605 NOTICE:  BL2: Boot device is HyperFlash(80MHz)
606 NOTICE:  BL2: LCM state is CM
607 NOTICE:  BL2: AVS setting succeeded. DVFS_SetVID=0x52
608 NOTICE:  BL2: DDR1600(rev.0.22)NOTICE:  [COLD_BOOT]NOTICE:  ..0
609 NOTICE:  BL2: DRAM Split is 2ch
610 NOTICE:  BL2: QoS is default setting(rev.0.17)
611 NOTICE:  BL2: Lossy Decomp areas
612 NOTICE:       Entry 0: DCMPAREACRAx:0x80000540 DCMPAREACRBx:0x570
613 NOTICE:       Entry 1: DCMPAREACRAx:0x40000000 DCMPAREACRBx:0x0
614 NOTICE:       Entry 2: DCMPAREACRAx:0x20000000 DCMPAREACRBx:0x0
615 NOTICE:  BL2: v1.3(release):4eef9a2
616 NOTICE:  BL2: Built : 00:25:19, Aug 25 2017
617 NOTICE:  BL2: Normal boot
618 NOTICE:  BL2: dst=0xe631e188 src=0x8180000 len=512(0x200)
619 NOTICE:  BL2: dst=0x43f00000 src=0x8180400 len=6144(0x1800)
620 NOTICE:  BL2: dst=0x44000000 src=0x81c0000 len=65536(0x10000)
621 NOTICE:  BL2: dst=0x44100000 src=0x8200000 len=524288(0x80000)
622 NOTICE:  BL2: dst=0x50000000 src=0x8640000 len=1048576(0x100000)
623
624
625 U-Boot 2015.04-dirty (Aug 25 2017 - 10:55:49)
626
627 CPU: Renesas Electronics R8A7796 rev 1.0
628 Board: M3ULCB
629 I2C:   ready
630 DRAM:  1.9 GiB
631 MMC:   sh-sdhi: 0, sh-sdhi: 1
632 In:    serial
633 Out:   serial
634 Err:   serial
635 Net:   ravb
636 Hit any key to stop autoboot:  0
637 =>
638 ```
639
640 ## 9. Setting-up U-boot
641 ### Configuring U-Boot Parameters
642
643 Follow these steps to configure the board to use the MicroSD card as the
644 boot device and also to set the screen resolution:
645
646 1. As the board is powering up, press any key to stop the autoboot process.
647    You need to press a key quickly as you have just a few seconds in which to
648    press a key.
649
650 2. Once the autoboot process is interrupted, use the board's serial console to
651    enter `printenv` to check if you have correct parameters for booting your board:
652
653     Here is an example using the **h3ulcb** board:
654     ```sh
655     => printenv
656     baudrate=115200
657     bootargs=console=ttySC0,115200 root=/dev/mmcblk1p1 rootwait ro rootfstype=ext4
658     bootcmd=run load_ker; run load_dtb; booti 0x48080000 - 0x48000000
659     bootdelay=3
660     fdt_high=0xffffffffffffffff
661     initrd_high=0xffffffffffffffff
662     load_dtb=ext4load mmc 0:1 0x48000000 /boot/r8a7795-h3ulcb.dtb
663     load_ker=ext4load mmc 0:1 0x48080000 /boot/Image
664     stderr=serial
665     stdin=serial
666     stdout=serial
667     ver=U-Boot 2015.04 (Jun 09 2016 - 19:21:52)
668
669     Environment size: 648/131068 bytes
670     ```
671
672      Here is a second example using the **m3ulcb** board:
673     ```sh
674     baudrate=115200
675     bootargs=console=ttySC0,115200 root=/dev/mmcblk1p1 rootwait ro rootfstype=ext4
676     bootcmd=run load_ker; run load_dtb; booti 0x48080000 - 0x48000000
677     bootdelay=3
678     fdt_high=0xffffffffffffffff
679     filesize=cdeb
680     initrd_high=0xffffffffffffffff
681     load_dtb=ext4load mmc 0:1 0x48000000 /boot/r8a7796-m3ulcb.dtb
682     load_ker=ext4load mmc 0:1 0x48080000 /boot/Image
683     stderr=serial
684     stdin=serial
685     stdout=serial
686     ver=U-Boot 2015.04 (Nov 30 2016 - 18:25:18)
687
688     Environment size: 557/131068 bytes
689     ```
690
691 3. To boot your board using the MicroSD card, be sure your environment is set up
692    as follows:
693     ```sh
694     setenv bootargs console=ttySC0,115200 ignore_loglevel vmalloc=384M video=HDMI-A-1:1920x1080-32@60 root=/dev/mmcblk1p1 rw rootfstype=ext4 rootwait rootdelay=2
695     setenv bootcmd run load_ker\; run load_dtb\; booti 0x48080000 - 0x48000000
696     setenv load_ker ext4load mmc 0:1 0x48080000 /boot/Image
697     ```
698
699 4. Loading dtb :
700
701     **NOTE** : Refer [here](https://elinux.org/R-Car/Boards/Yocto-Gen3-CommonFAQ/Which_dtb_file_is_required_to_boot_linux_on_the_R-Car_Starter_Kit_board_%3F) for more information.
702
703     Make sure your ``load_dtb`` is set as follows :
704
705        * **H3SK v2.0(DDR 4GB)** : `$ setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/r8a7795-h3ulcb.dtb`
706
707        * **H3SK v2.0(DDR 8GB)/v3.0(DDR 8GB)** : `$ setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/r8a7795-h3ulcb-4x2g.dtb`
708
709        * **M3SK v1.0** : `$ setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/r8a7796-m3ulcb.dtb`
710
711        * **M3SK v3.0** : `$ setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/r8a7796-m3ulcb-2x4g.dtb`
712
713        * **H3SK with a Kingfisher board** : `$ setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/r8a7795-h3ulcb-kf.dtb`
714
715        * **M3SK with a Kingfisher board** : `$ setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/r8a7796-m3ulcb-kf.dtb`
716
717        * **AGL Reference Hardware board** : `$ setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/r8a7795-agl-refhw.dtb`
718
719 5. Save the boot environment:
720     ```sh
721     saveenv
722     ```
723
724 6. Boot the board:
725    ```sh
726    run bootcmd
727    ```
728
729 ## 10. Troubleshooting
730 ### Logging Into the Console
731
732 Once the board boots, you should see the
733 [Wayland display](https://en.wikipedia.org/wiki/Wayland_(display_server_protocol))
734 on the external monitor.
735 A login prompt should appear as follows depending on your board:
736
737 **h3ulcb** or **AGL Reference Hardware**:
738
739 ```text
740 Automotive Grade Linux ${AGL_VERSION} h3ulcb ttySC0
741
742 h3ulcb login: root
743 ```
744
745 **m3ulcb**:
746
747 ```text
748 Automotive Grade Linux ${AGL_VERSION} m3ulcb ttySC0
749
750 m3ulcb login: root
751 ```
752
753 At the prompt, login by using `root` as the login.
754 The password is "empty" so you should not be prompted for the password.
755
756 ### Determining the Board's IP Address
757
758 If your board is connected to a local network using Ethernet and
759 if a DHCP server is able to distribute IP addresses,
760 you can determine the board's IP address and log in using `ssh`.
761
762 Here is an example for the **m3ulcb** board:
763 ```sh
764 m3ulcb login: root
765 Last login: Tue Dec  6 09:55:15 UTC 2016 on tty2
766 root@m3ulcb:~# ip -4 a
767 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
768     inet 127.0.0.1/8 scope host lo
769       valid_lft forever preferred_lft forever
770 3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
771     inet 10.0.0.27/24 brd 10.0.0.255 scope global eth0
772       valid_lft forever preferred_lft forever
773 root@m3ulcb:~#
774 ```
775
776 In the previous example, IP address is 10.0.0.27.
777 Once you know the address, you can use `ssh` to login.
778 Following is an example that shows logging into SSH and then
779 displaying the contents of the `/etc/os-release` file:
780 ```sh
781 $ ssh root@10.0.0.27
782 Last login: Tue Dec  6 10:01:11 2016 from 10.0.0.13
783 root@m3ulcb:~# cat /etc/os-release
784 ID="poky-agl"
785 NAME="Automotive Grade Linux"
786 VERSION="11.0.0+snapshot-20210128 (koi)"
787 VERSION_ID="11.0.0-snapshot-20210128"
788 PRETTY_NAME="Automotive Grade Linux 11.0.0+snapshot-20210128 (koi)"
789 ```
790
791 ## 11. Supplementary Information
792
793 ### R-Car Generation 3 Information
794
795 Refer to the [R-Car](https://elinux.org/R-Car) page on the
796 [elinux.org](https://elinux.org) website for more information.
797
798 ### Proprietary libraries for meta-rcar-gen3
799
800 The meta-rcar-gen3 layer of meta-renesas supports Graphic GLES(GSX)
801 libraries, proprietary multimedia libraries, and ICCOM software.
802
803 #### Build with Renesas multimedia libraries
804
805 Multimedia portions depend on GLES portions.
806
807 * A. Configuration for Multimedia features
808
809     * Please copy proprietary libraries to the directory of recipes.
810
811     * Please set local.conf the following.
812
813         **Enable multimedia features. This provides package group of plug-ins of the GStreamer, multimedia libraries and kernel drivers.**
814
815         ```sh
816         MACHINE_FEATURES_append = " multimedia"
817         ```
818
819 * B. Configuration for optional codecs and middleware
820
821     * Please copy proprietary libraries to the directory of recipes.
822
823     * Add features to `DISTRO_FEATURES_append` to local.conf
824
825         **Additional configuration in OMX module**:
826
827         ```text
828         " h263dec_lib"       - for OMX Media Component H263 Decoder Library
829         " h264dec_lib"       - for OMX Media Component H264 Decoder Library
830         " h264enc_lib"       - for OMX Media Component H.264 Encoder Library
831         " h265dec_lib"       - for OMX Media Component H265 Decoder Library
832         " mpeg2dec_lib"      - for OMX Media Component MPEG2 Decoder Library
833         " mpeg4dec_lib"      - for OMX Media Component MPEG4 Decoder Library
834         " vc1dec_lib"        - for OMX Media Component VC-1 Decoder Library
835         " divxdec_lib"       - for OMX Media Component DivX Decoder Library
836         " rvdec_lib"         - for OMX Media Component RealVideo Decoder Library
837         " alacdec_lib"       - for OMX Media Component ALAC Decoder Library
838         " flacdec_lib"       - for OMX Media Component FLAC Decoder Library
839         " aaclcdec_lib"      - for OMX Media Component AAC-LC Decoder Library
840         " aaclcdec_mdw"      - for AAC-LC 2ch Decoder Middleware for Linux
841         " aacpv2dec_lib"     - for OMX Media Component aacPlus V2 Decoder Library
842         " aacpv2dec_mdw"     - for aacPlus V2 Decoder Middleware for Linux
843         " mp3dec_lib"        - for OMX Media Component MP3 Decoder Library
844         " mp3dec_mdw"        - for MP3 Decoder Middleware for Linux
845         " wmadec_lib"        - for OMX Media Component WMA Standard Decoder Library
846         " wmadec_mdw"        - for WMA Standard Decoder Middleware for Linux
847         " dddec_lib"         - for OMX Media Component Dolby(R) Digital Decoder Library
848         " dddec_mdw"         - for Dolby(R) Digital Decoder Middleware for Linux
849         " aaclcenc_lib"      - for OMX Media Component AAC-LC Encoder Library
850         " vp8dec_lib"        - for OMX Media Component VP8 Decoder Library for Linux
851         " vp8enc_lib"        - for OMX Media Component VP8 Encoder Library for Linux
852         " vp9dec_lib"        - for OMX Media Component VP9 Decoder Library for Linux
853         " aaclcenc_mdw"      - for AAC-LC Encoder Middleware for Linux
854         " cmsbcm"            - for CMS Basic Color Management Middleware for Linux
855         " cmsblc"            - for CMS CMM3 Backlight Control Middleware for Linux
856         " cmsdgc"            - for CMS VSP2 Dynamic Gamma Correction Middleware for Linux
857         " dtv"               - for ISDB-T DTV Software Package for Linux
858         " dvd"               - for DVD Core-Middleware for Linux
859         " adsp"              - for ADSP driver, ADSP interface and ADSP framework for Linux
860         " avb"               - for AVB Software Package for Linux
861         ```
862         Example:
863         ```sh
864         DISTRO_FEATURES_append = " h264dec_lib h265dec_lib mpeg2dec_lib aaclcdec_lib aaclcdec_mdw"
865         ```
866
867 * C. Configuration for test packages
868
869     Must ensure that Multimedia features have been enabled.
870     (Please refer to III/A to enable Multimedia.)
871
872     * Please add feature to `DISTRO_FEATURES_append` to local.conf.
873
874         **Configuration for multimedia test package**
875         ```sh
876         DISTRO_FEATURES_append = " mm-test"
877         ```
878
879 #### Enable Linux ICCOM driver and Linux ICCOM library
880
881 For Linux ICCOM driver and Linux ICCOM library
882
883 * Please copy proprietary libraries to the directory of recipes.
884
885 * Please set the following in local.conf:
886     ```sh
887     DISTRO_FEATURES_append = "iccom"
888     ```