1a79c911fSKhoronzhuk, IvanU-Boot port for Texas Instruments Keystone II EVM boards 2a79c911fSKhoronzhuk, Ivan======================================================== 3a79c911fSKhoronzhuk, Ivan 4a79c911fSKhoronzhuk, IvanAuthor: Murali Karicheri <m-karicheri2@ti.com> 5a79c911fSKhoronzhuk, Ivan 6a187559eSBin MengThis README has information on the U-Boot port for K2HK, K2E, and K2L EVM boards. 7a79c911fSKhoronzhuk, IvanDocumentation for this board can be found at 8a79c911fSKhoronzhuk, Ivanhttp://www.advantech.com/Support/TI-EVM/EVMK2HX_sd.aspx 9a79c911fSKhoronzhuk, Ivanhttps://www.einfochips.com/index.php/partnerships/texas-instruments/k2e-evm.html 104de96c79SKhoronzhuk, Ivanhttps://www.einfochips.com/index.php/partnerships/texas-instruments/k2l-evm.html 11a79c911fSKhoronzhuk, Ivan 12a79c911fSKhoronzhuk, IvanThe K2HK board is based on Texas Instruments Keystone2 family of SoCs: K2H, K2K. 13a79c911fSKhoronzhuk, IvanMore details on these SoCs are available at company websites 14a79c911fSKhoronzhuk, Ivan K2K: http://www.ti.com/product/tci6638k2k 15a79c911fSKhoronzhuk, Ivan K2H: http://www.ti.com/product/tci6638k2h 16a79c911fSKhoronzhuk, Ivan 17a79c911fSKhoronzhuk, IvanThe K2E SoC details are available at 184de96c79SKhoronzhuk, Ivan http://www.ti.com/lit/ds/symlink/66ak2e05.pdf 194de96c79SKhoronzhuk, Ivan 204de96c79SKhoronzhuk, IvanThe K2L SoC details are available at 214de96c79SKhoronzhuk, Ivan http://www.ti.com/lit/ds/symlink/tci6630k2l.pdf 22a79c911fSKhoronzhuk, Ivan 2301c50755SLokesh VutlaThe K2G SoC details are available at 2401c50755SLokesh Vutla http://www.ti.com/lit/ds/symlink/66ak2g02.pdf 2501c50755SLokesh Vutla 26a79c911fSKhoronzhuk, IvanBoard configuration: 27a79c911fSKhoronzhuk, Ivan==================== 28a79c911fSKhoronzhuk, Ivan 29a187559eSBin MengSome of the peripherals that are configured by U-Boot 30a79c911fSKhoronzhuk, Ivan+------+-------+-------+-----------+-----------+-------+-------+----+ 31a79c911fSKhoronzhuk, Ivan| |DDR3 |NAND |MSM SRAM |ETH ports |UART |I2C |SPI | 32a79c911fSKhoronzhuk, Ivan+------+-------+-------+-----------+-----------+-------+-------+----+ 33a79c911fSKhoronzhuk, Ivan|K2HK |2 |512MB |6MB |4(2) |2 |3 |3 | 34a79c911fSKhoronzhuk, Ivan|K2E |4 |512MB |2MB |8(2) |2 |3 |3 | 354de96c79SKhoronzhuk, Ivan|K2L |2 |512MB |2MB |4(2) |4 |3 |3 | 3601c50755SLokesh Vutla|K2G |2 |256MB |1MB |1 |1 |1 |1 | 37a79c911fSKhoronzhuk, Ivan+------+-------+-------+-----------+-----------+-------+-------+----+ 38a79c911fSKhoronzhuk, Ivan 39a79c911fSKhoronzhuk, IvanThere are only 2 eth port installed on the boards. 40a79c911fSKhoronzhuk, Ivan 41a79c911fSKhoronzhuk, IvanThere are separate PLLs to drive clocks to Tetris ARM and Peripherals. 42a79c911fSKhoronzhuk, IvanTo bring up SMP Linux on this board, there is a boot monitor 43a79c911fSKhoronzhuk, Ivancode that will be installed in MSMC SRAM. There is command available 44a187559eSBin Mengto install this image from U-Boot. 45a79c911fSKhoronzhuk, Ivan 46a79c911fSKhoronzhuk, IvanThe port related files can be found at following folders 47a79c911fSKhoronzhuk, Ivan keystone2 SoC related files: arch/arm/cpu/armv7/keystone/ 48a79c911fSKhoronzhuk, Ivan EVMs board files: board/ti/k2s_evm/ 49a79c911fSKhoronzhuk, Ivan 50a79c911fSKhoronzhuk, IvanBoard configuration files: 51a79c911fSKhoronzhuk, Ivaninclude/configs/k2hk_evm.h 52a79c911fSKhoronzhuk, Ivaninclude/configs/k2e_evm.h 534de96c79SKhoronzhuk, Ivaninclude/configs/k2l_evm.h 5401c50755SLokesh Vutlainclude/configs/k2g_evm.h 55a79c911fSKhoronzhuk, Ivan 56a187559eSBin MengAs U-Boot is migrating to Kconfig there is also board defconfig files 57a79c911fSKhoronzhuk, Ivanconfigs/k2e_evm_defconfig 58a79c911fSKhoronzhuk, Ivanconfigs/k2hk_evm_defconfig 594de96c79SKhoronzhuk, Ivanconfigs/k2l_evm_defconfig 6001c50755SLokesh Vutlaconfigs/k2g_evm_defconfig 61a79c911fSKhoronzhuk, Ivan 62a79c911fSKhoronzhuk, IvanSupported boot modes: 63a79c911fSKhoronzhuk, Ivan - SPI NOR boot 64*b7695c0eSCooper Jr., Franklin - AEMIF NAND boot (K2E, K2L and K2HK) 65be8ce70cSLokesh Vutla - UART boot 6601c50755SLokesh Vutla - MMC boot (Only on K2G) 67a79c911fSKhoronzhuk, Ivan 68a79c911fSKhoronzhuk, IvanSupported image formats: 6901c50755SLokesh Vutla - u-boot.bin: for loading and running u-boot.bin through 701985abe2SLokesh Vutla Texas Instruments code composure studio (CCS) and for UART boot. 71a79c911fSKhoronzhuk, Ivan - u-boot-spi.gph: gpimage for programming SPI NOR flash for SPI NOR boot 72*b7695c0eSCooper Jr., Franklin - MLO: gpimage for programming NAND flash for NAND boot, MMC boot. 73a79c911fSKhoronzhuk, Ivan 74a79c911fSKhoronzhuk, IvanBuild instructions: 75a79c911fSKhoronzhuk, Ivan=================== 7601c50755SLokesh VutlaExamples for k2hk, for k2e, k2l and k2g just replace k2hk prefix accordingly. 77a79c911fSKhoronzhuk, IvanDon't forget to add ARCH=arm and CROSS_COMPILE. 78a79c911fSKhoronzhuk, Ivan 7901c50755SLokesh VutlaTo build u-boot.bin, u-boot-spi.gph, MLO: 80a79c911fSKhoronzhuk, Ivan >make k2hk_evm_defconfig 81be8ce70cSLokesh Vutla >make 82a79c911fSKhoronzhuk, Ivan 83a79c911fSKhoronzhuk, IvanLoad and Run U-Boot on keystone EVMs using CCS 84a79c911fSKhoronzhuk, Ivan========================================= 85a79c911fSKhoronzhuk, Ivan 8601c50755SLokesh VutlaNeed Code Composer Studio (CCS) installed on a PC to load and run u-boot.bin 87a79c911fSKhoronzhuk, Ivanon EVM. See instructions at below link for installing CCS on a Windows PC. 88a79c911fSKhoronzhuk, Ivanhttp://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Getting_Started# 89a79c911fSKhoronzhuk, IvanInstalling_Code_Composer_Studio 9001c50755SLokesh VutlaUse u-boot.bin from the build folder for loading and running U-Boot binary 91a79c911fSKhoronzhuk, Ivanon EVM. Follow instructions at 92a79c911fSKhoronzhuk, IvanK2HK http://processors.wiki.ti.com/index.php/EVMK2H_Hardware_Setup 93a79c911fSKhoronzhuk, IvanK2E http://processors.wiki.ti.com/index.php/EVMK2E_Hardware_Setup 944de96c79SKhoronzhuk, IvanK2L http://processors.wiki.ti.com/index.php/TCIEVMK2L_Hardware_Setup 9501c50755SLokesh VutlaK2G http://processors.wiki.ti.com/index.php/66AK2G02_GP_EVM_Hardware_Setup 964de96c79SKhoronzhuk, Ivan 97a79c911fSKhoronzhuk, Ivanto configure SW1 dip switch to use "No Boot/JTAG DSP Little Endian Boot Mode" 98a79c911fSKhoronzhuk, Ivanand Power ON the EVM. Follow instructions to connect serial port of EVM to 99a79c911fSKhoronzhuk, IvanPC and start TeraTerm or Hyper Terminal. 100a79c911fSKhoronzhuk, Ivan 101a79c911fSKhoronzhuk, IvanStart CCS on a Windows machine and Launch Target 102a79c911fSKhoronzhuk, Ivanconfiguration as instructed at http://processors.wiki.ti.com/index.php/ 103a79c911fSKhoronzhuk, IvanMCSDK_UG_Chapter_Exploring#Loading_and_Running_U-Boot_on_EVM_through_CCS. 104a79c911fSKhoronzhuk, IvanThe instructions provided in the above link uses a script for 105a187559eSBin Mengloading the U-Boot binary on the target EVM. Instead do the following:- 106a79c911fSKhoronzhuk, Ivan 107a79c911fSKhoronzhuk, Ivan1. Right click to "Texas Instruments XDS2xx USB Emulator_0/CortexA15_1 core (D 108a79c911fSKhoronzhuk, Ivan is connected: Unknown)" at the debug window (This is created once Target 109a79c911fSKhoronzhuk, Ivan configuration is launched) and select "Connect Target". 110a79c911fSKhoronzhuk, Ivan2. Once target connect is successful, choose Tools->Load Memory option from the 11101c50755SLokesh Vutla top level menu. At the Load Memory window, choose the file u-boot.bin 112a79c911fSKhoronzhuk, Ivan through "Browse" button and click "next >" button. In the next window, enter 11301c50755SLokesh Vutla Start address as 0xc000000, choose Type-size "32 bits" and click "Finish" 114a79c911fSKhoronzhuk, Ivan button. 115a79c911fSKhoronzhuk, Ivan3. Click View -> Registers from the top level menu to view registers window. 116a79c911fSKhoronzhuk, Ivan4. From Registers, window expand "Core Registers" to view PC. Edit PC value 11701c50755SLokesh Vutla to be 0xc000000. From the "Run" top level menu, select "Free Run" 118a79c911fSKhoronzhuk, Ivan5. The U-Boot prompt is shown at the Tera Term/ Hyper terminal console as 119a79c911fSKhoronzhuk, Ivan below and type any key to stop autoboot as instructed := 120a79c911fSKhoronzhuk, Ivan 121a79c911fSKhoronzhuk, IvanU-Boot 2014.04-rc1-00201-gc215b5a (Mar 21 2014 - 12:47:59) 122a79c911fSKhoronzhuk, Ivan 123a79c911fSKhoronzhuk, IvanI2C: ready 124a79c911fSKhoronzhuk, IvanDetected SO-DIMM [SQR-SD3T-2G1333SED] 125a79c911fSKhoronzhuk, IvanDRAM: 1.1 GiB 126a79c911fSKhoronzhuk, IvanNAND: 512 MiB 127a79c911fSKhoronzhuk, IvanNet: K2HK_EMAC 128a79c911fSKhoronzhuk, IvanWarning: K2HK_EMAC using MAC address from net device 129a79c911fSKhoronzhuk, Ivan, K2HK_EMAC1, K2HK_EMAC2, K2HK_EMAC3 130a79c911fSKhoronzhuk, IvanHit any key to stop autoboot: 0 131a79c911fSKhoronzhuk, Ivan 132a79c911fSKhoronzhuk, IvanSPI NOR Flash programming instructions 133a79c911fSKhoronzhuk, Ivan====================================== 134a79c911fSKhoronzhuk, IvanU-Boot image can be flashed to first 512KB of the NOR flash using following 135a79c911fSKhoronzhuk, Ivaninstructions: 136a79c911fSKhoronzhuk, Ivan 137a187559eSBin Meng1. Start CCS and run U-Boot as described above. 138a79c911fSKhoronzhuk, Ivan2. Suspend Target. Select Run -> Suspend from top level menu 139a79c911fSKhoronzhuk, Ivan CortexA15_1 (Free Running)" 140a79c911fSKhoronzhuk, Ivan3. Load u-boot-spi.gph binary from build folder on to DDR address 0x87000000 1414de96c79SKhoronzhuk, Ivan through CCS as described in step 2 of "Load and Run U-Boot on K2HK/K2E/K2L 1424de96c79SKhoronzhuk, Ivan EVM using CCS", but using address 0x87000000. 143a187559eSBin Meng4. Free Run the target as described earlier (step 4) to get U-Boot prompt 144a187559eSBin Meng5. At the U-Boot console type following to setup U-Boot environment variables. 145a79c911fSKhoronzhuk, Ivan setenv addr_uboot 0x87000000 146a79c911fSKhoronzhuk, Ivan setenv filesize <size in hex of u-boot-spi.gph rounded to hex 0x10000> 147a79c911fSKhoronzhuk, Ivan run burn_uboot_spi 148a187559eSBin Meng Once U-Boot prompt is available, Power OFF the EVM. Set the SW1 dip switch 149a79c911fSKhoronzhuk, Ivan to "SPI Little Endian Boot mode" as per instruction at 150a79c911fSKhoronzhuk, Ivan http://processors.wiki.ti.com/index.php/*_Hardware_Setup. 151a187559eSBin Meng6. Power ON the EVM. The EVM now boots with U-Boot image on the NOR flash. 152a79c911fSKhoronzhuk, Ivan 153a79c911fSKhoronzhuk, IvanAEMIF NAND Flash programming instructions 154a79c911fSKhoronzhuk, Ivan====================================== 155a79c911fSKhoronzhuk, IvanU-Boot image can be flashed to first 1024KB of the NAND flash using following 156a79c911fSKhoronzhuk, Ivaninstructions: 157a79c911fSKhoronzhuk, Ivan 158a187559eSBin Meng1. Start CCS and run U-Boot as described above. 159a79c911fSKhoronzhuk, Ivan2. Suspend Target. Select Run -> Suspend from top level menu 160a79c911fSKhoronzhuk, Ivan CortexA15_1 (Free Running)" 1615f586e9fSLokesh Vutla3. Load MLO binary from build folder on to DDR address 0x87000000 162a79c911fSKhoronzhuk, Ivan through CCS as described in step 2 of "Load and Run U-Boot on K2HK EVM 163a79c911fSKhoronzhuk, Ivan using CCS", but using address 0x87000000. 164a187559eSBin Meng4. Free Run the target as described earlier (step 4) to get U-Boot prompt 165a187559eSBin Meng5. At the U-Boot console type following to setup U-Boot environment variables. 1665f586e9fSLokesh Vutla setenv filesize <size in hex of MLO rounded to hex 0x10000> 167a79c911fSKhoronzhuk, Ivan run burn_uboot_nand 168a187559eSBin Meng Once U-Boot prompt is available, Power OFF the EVM. Set the SW1 dip switch 169a79c911fSKhoronzhuk, Ivan to "ARM NAND Boot mode" as per instruction at 170a79c911fSKhoronzhuk, Ivan http://processors.wiki.ti.com/index.php/*_Hardware_Setup. 171a187559eSBin Meng6. Power ON the EVM. The EVM now boots with U-Boot image on the NAND flash. 172be8ce70cSLokesh Vutla 173be8ce70cSLokesh VutlaLoad and Run U-Boot on keystone EVMs using UART download 174be8ce70cSLokesh Vutla======================================================== 175be8ce70cSLokesh Vutla 176be8ce70cSLokesh VutlaOpen BMC and regular UART terminals. 177be8ce70cSLokesh Vutla 17801c50755SLokesh Vutla1. On the regular UART port start xmodem transfer of the u-boot.bin 179be8ce70cSLokesh Vutla2. Using BMC terminal set the ARM-UART bootmode and reboot the EVM 180be8ce70cSLokesh Vutla BMC> bootmode #4 181be8ce70cSLokesh Vutla MBC> reboot 182a187559eSBin Meng3. When xmodem is complete you should see the U-Boot starts on the UART port 18301c50755SLokesh Vutla 18401c50755SLokesh VutlaLoad and Run U-Boot on K2G EVMs using MMC 18501c50755SLokesh Vutla======================================================== 18601c50755SLokesh Vutla 18701c50755SLokesh VutlaOpen BMC and regular UART terminals. 18801c50755SLokesh Vutla 18901c50755SLokesh Vutla1. Set the SW3 dip switch to "ARM MMC Boot mode" as per instruction at 19001c50755SLokesh Vutla http://processors.wiki.ti.com/index.php/66AK2G02_GP_EVM_Hardware_Setup 19101c50755SLokesh Vutla2. Create SD card partitions as per steps given in Hardware Setup Guide. 19201c50755SLokesh Vutla3. Copy MLO to Boot Partition. 19301c50755SLokesh Vutla4. Insert SD card and Power on the EVM. 19401c50755SLokesh Vutla The EVM now boots with U-Boot image from SD card. 195