Template:GLSDK Using UART Boot

{{#ifeq:{{{platform}}}|DRA7xx|

Using UART boot
The GLSDK release for DRA7xx does not support boot over UART out of the box. The purpose of this template is to provide details on how to add UART-boot support on top of GLSDK release.

Boot over UART is tested on a rev D DRA7xx EVM. The ROM code can boot from UART3. By default the EVM supports UART1. Hence it is mandatory to do a hardware change to work with UART-boot.

Hardware Changes for UART-boot support
Populate resistor R776 and R777 with 50 ohm resistor.

Serial port configuration
DRA7xx EVM comes with onboard USB-to-serial converter. The USB cable supplied with the EVM can be used to connect the EVM to a host. The mini-USB end of the cable should be connected to 'J1 Terminal' connector on the EVM.

For correct operation the serial terminal software should be configured with the following settings:

* Baud rate: 115200 * Data bits: 8 * Parity: None * Stop bits: 1 * Flow control: None * Transmit delay: 0 msec/char, 100 msec/line

NOTE: Ensure that version 4.67 or later of Teraterm is installed. The implementation of the kermit protocol in Teraterm is not reliable in older versions. The latest version of Teraterm can be downloaded from here.

Boot Switch Settings
SW2[5:0] = 010011 Other than this, SW5.5 = OFF for UART3 support. (Default = ON for UART1)

Note: Apart from this patch following changes should be taken note of: 1. dra7xx_evm_uart3_config should be used instead of dra7xx_evm_config while rebuilding u-boot. For this replace following line in GLSDK's Rules.make file: DEFAULT_UBOOT_CONFIG=dra7xx_evm_config to   DEFAULT_UBOOT_CONFIG=dra7xx_evm_uart3_config 2. CONFIG_SPL_TEXT_BASE in include/configs/omap5_common.h should be manually changed from 0x40300350 to 0x40300000 for UART-boot. In memory boot mode ROM code transfers MLO to location OCMC_RAM1 base+offset (CONFIG_SPL_TEXT_BASE = 0x40300000+350). In peripheral boot mode ROM code transfers MLO to location OCMC_RAM1 base (0x40300000). UART-boot will not work without changing this address.

UART protocol used at various phases
ROM Code -> MLO  :- binary transfer, UART3: 115.2 Kbps, 8 bits, even parity, 1 stop-bit, no flow control

MLO     -> u-boot:- YModem protocol, UART3: 115.2 Kbps, 8 bits, none parity, 1 stop-bit, no flow control

u-boot  -> Linux :- Kermit protocol, UART3: 115.2 Kbps, 8 bits, none parity, 1 stop-bit, no flow control

Software & Tools
The following software is needed:

- MLO & u-boot should be built for DRA7xx. Note: For MLO use the spl/u-boot-spl.bin file. The difference between u-boot-spl.bin and MLO is that u-boot-spl.bin does not contain header information. Peripheral boot needs an MLO without header. For u-boot use u-boot.img file (and not u-boot.bin file)

- The script for transferring MLO.

Please note that this perl script is dependent on the perl Device::SerialPort module.

Perl can be downloaded from here. Let's say Perl is downloaded on Windows machine at location c:\perl.

For SerialPort module download following files from here to c:\perl Win32-SerialPort-0.22-PPM510.tar.gz Win32-SerialPort-0.22-PPM512.tar.gz Win32-SerialPort-0.22-PPM514.tar.gz Win32-SerialPort-0.22-PPM516.tar.gz Win32-SerialPort-0.22-PPM56.tar.gz Win32-SerialPort-0.22-PPM58.tar.gz Win32-SerialPort.ppd

Open a cmd and cd c:\perl, run ppm install Win32-SerialPort.ppd

- Teraterm on Windows machine.

Loading 1st state(MLO) over UART
1. Set boot mode switch SW2 and SW5.5 as per Boot_Switch_Settings

2. Switch ON EVM with UART boot mode.

3. Open Teraterm on Windows machine and set serial port to 115.2 Kbps, 8 bits, even parity, 1 stop-bit, no flow control

4. Ensure that “VA!” characters appear on TeraTerm window continuously

5. Close the teraterm window

6. Open cmd and execute the serial-boot.pl script as follows: ./serial-boot.pl -p  -s /u-boot-spl.bin For example: ./serial-boot.pl -p com26 -s c:\temp\u-boot-spl.bin You can add debug option to see debug messages when running this script ./serial-boot.pl -p com26 -s c:\temp\u-boot-spl.bin -d 1

Note:- If the serial-boot.pl doesn't wait for you to reset the board and if it continues saying "Board Detected" let it continue (dont reset the board here) once done rerun the script       with the same paramaeters now it should actually wait for you to reset.

Note: serial-boot.pl script, after opening the COM port takes care of setting it to 115.2 Kbps, 8 bits, even parity, 1 stop-bit

7. The script will ask you to reset the EVM

8. Press "Reset button" on EVM to initiate image download

9. The download is completed when you see "Second file download completed" message.

10.After image is successfully downloaded, the ROM code will boot it.

11.MLO will then be waiting to receive u-boot over ymodem.

Note: You will NOT be able to see the MLO logs on console as teraterm is closed.

Loading 2nd stage(u-boot) over UART
The moment the serial script execution is over,

1. Open Teraterm

2. Choose File -> Transfer -> YModem -> Send

3. Select the 2nd stage u-boot image “u-boot.img” built earlier and click “OPEN” button

4. Wait for download to complete

5. u-boot will start its execution once download is completed

6. Interrupt the boot to get 2nd Stage u-boot prompt

DRA752 EVM#

Note: MLO waits to receive u-boot for maximum timeout period of 20sec. So do not fail to start u-boot transfer within 20 sec. The actual transfer of u-boot starts after ~4-5 secs of opening the u-boot.img file.

Loading dra7-evm.dtb over UART
1. Run following command on u-boot prompt DRA752 EVM# loadb 0x825f0000

2. Choose File -> Transfer -> Kermit -> Send

3. Select "dra7-evm.dtb" click “OPEN” button

4. Wait for download to complete

Loading uImage over UART
1. Run following command on u-boot prompt DRA752 EVM# loadb 0x80300000

2. Choose File -> Transfer -> Kermit -> Send

3. Select "uImage" click “OPEN” button

4. Wait for download to complete

5. You can check whether uImage is downloaded properly using iminfo

Booting uImage
Run following command on u-boot prompt setenv bootargs 'elevator=noop console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootwait earlyprintk fixrtc' setenv fdt_high 0x84000000 bootm 0x80300000 - 0x825f0000

Note: Linux Kernel by default uses UART1 for console logs. In order to switch to UART3 as a default console use 'console=ttyO2' in the bootargs. e.g. setenv bootargs 'elevator=noop console=ttyO2,115200n8 root=/dev/mmcblk0p2 rw rootwait earlyprintk fixrtc' The final console where login prompt gets displayed is decided by the filesystem. Some filesystems read the default console being used while booting up(as in bootargs) and activate that as the final console. Some filesystems do not have this flexibility and will have a fixed final console, e.g. ttyO0. Based on the filesystem you use to boot the kernel, the login prompt will either get displayed directly or you will have to slide SW5.5=ON to see it.

NOTE: QSPI is not supported.

}}

Description
This template describes how to use QSPI Boot mode on.

Parameters
This template takes following parameters - platform, in DRA7xx, OMAP5

Example
To use this template simply add the following line to your wiki page.

Here's how it will look in your wiki page: